/*
 * MyMCPAdm.in — main.css
 *
 * Intentionally minimal. All classes use the mh- prefix.
 * Replace this file entirely with a proper design system when ready.
 * Class names are stable — the HTML won't change when the CSS does.
 *
 * Class inventory (for reference when writing the real CSS):
 *
 * Layout
 *   mh-body          <body>
 *   mh-nav           top nav bar
 *   mh-nav__brand    logo/name link
 *   mh-nav__links    nav link group
 *   mh-nav__link     individual nav link
 *   mh-nav__theme    dark/light toggle button
 *   mh-main          page content wrapper
 *   mh-footer        footer bar
 *
 * Catalog
 *   mh-catalog        catalog page wrapper
 *   mh-catalog__header
 *   mh-catalog__title
 *   mh-catalog__subtitle
 *   mh-filter         category filter bar
 *   mh-filter__btn    category button
 *   mh-filter__btn--active
 *   mh-grid           server card grid
 *
 * Card
 *   mh-card           server card
 *   mh-card__header
 *   mh-card__body
 *   mh-card__footer
 *   mh-card__name
 *   mh-card__desc
 *   mh-card__actions
 *
 * Badges
 *   mh-badge                            base badge
 *   mh-badge--{category}                storage | productivity | data | communication | devtools | infrastructure | custom
 *   mh-badge--auth                      auth method badge
 *   mh-badge--{credential}              api_key | credentials | oauth | none | config
 *   mh-badge--status                    status badge
 *   mh-badge--running                   green
 *   mh-badge--stopped                   grey
 *   mh-badge--error                     red
 *   mh-badge--unknown                   yellow
 *
 * Buttons
 *   mh-btn             base button
 *   mh-btn--primary
 *   mh-btn--secondary
 *   mh-btn--warning
 *   mh-btn--ghost
 *
 * Configure page
 *   mh-configure
 *   mh-configure__header
 *   mh-configure__title
 *   mh-configure__desc
 *   mh-configure__docs
 *   mh-back              back link
 *
 * Form
 *   mh-form
 *   mh-form__fieldset
 *   mh-form__legend
 *   mh-form__field
 *   mh-form__field--required
 *   mh-form__label
 *   mh-form__required     asterisk span
 *   mh-form__input
 *   mh-form__input--secret
 *   mh-form__hint
 *   mh-form__actions
 *   mh-form__empty
 *
 * Alerts
 *   mh-alert
 *   mh-alert--success
 *   mh-alert--error
 *   mh-alert__link
 *
 * Logs
 *   mh-logs
 *   mh-logs__pre
 */

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens ────────────────────────────────────────────────────────── */
:root {
  --mh-bg:           #f8f9fa;
  --mh-surface:      #ffffff;
  --mh-border:       #dee2e6;
  --mh-border-input: #ced4da;
  --mh-text:         #212529;
  --mh-text-muted:   #6c757d;
  --mh-nav-bg:       #1a1a2e;
  --mh-nav-text:     #ffffff;
  --mh-nav-muted:    #cccccc;
  --mh-accent:       #1a1a2e;
  --mh-accent-text:  #ffffff;
}

[data-theme="dark"] {
  --mh-bg:           #0f0f1a;
  --mh-surface:      #1a1a2e;
  --mh-border:       #2d2d4e;
  --mh-border-input: #3a3a5c;
  --mh-text:         #e8e8f0;
  --mh-text-muted:   #9090b8;
  --mh-nav-bg:       #0a0a15;
  --mh-nav-text:     #ffffff;
  --mh-nav-muted:    #aaaacc;
  --mh-accent:       #5b5bff;
  --mh-accent-text:  #ffffff;
}

/* ── Body ──────────────────────────────────────────────────────────────────── */
.mh-body {
  font-family: system-ui, sans-serif;
  background: var(--mh-bg);
  color: var(--mh-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Nav ──────────────────────────────────────────────────────────────────────── */
.mh-nav {
  background: var(--mh-nav-bg);
  color: var(--mh-nav-text);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.mh-nav__brand { color: var(--mh-nav-text); text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.mh-nav__links { display: flex; gap: 1rem; flex: 1; }
.mh-nav__link  { color: var(--mh-nav-muted); text-decoration: none; }
.mh-nav__link:hover { color: var(--mh-nav-text); }

/* Theme toggle */
.mh-nav__theme {
  background: transparent;
  border: 1px solid var(--mh-nav-muted);
  color: var(--mh-nav-muted);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1.4;
  margin-left: auto;
  transition: color 0.15s, border-color 0.15s;
}
.mh-nav__theme:hover { color: var(--mh-nav-text); border-color: var(--mh-nav-text); }

/* ── Main / Footer ──────────────────────────────────────────────────────────────── */
.mh-main   { flex: 1; padding: 2rem 1.5rem; max-width: 1200px; margin: 0 auto; width: 100%; }
.mh-footer { background: var(--mh-nav-bg); color: #888; text-align: center; padding: 0.75rem; font-size: 0.85rem; }
.mh-footer a { color: #aaa; }

/* ── Catalog ────────────────────────────────────────────────────────────────── */
.mh-catalog__header { margin-bottom: 1.5rem; }
.mh-catalog__title  { font-size: 1.6rem; font-weight: 700; }
.mh-catalog__subtitle { color: var(--mh-text-muted); margin-top: 0.25rem; }

/* ── Filter bar ──────────────────────────────────────────────────────────────── */
.mh-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.mh-filter__btn {
  border: 1px solid var(--mh-border);
  background: var(--mh-surface);
  color: var(--mh-text);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
}
.mh-filter__btn--active,
.mh-filter__btn:hover { background: var(--mh-accent); color: var(--mh-accent-text); border-color: var(--mh-accent); }

/* ── Grid ──────────────────────────────────────────────────────────────────────── */
.mh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* ── Card ──────────────────────────────────────────────────────────────────────── */
.mh-card {
  background: var(--mh-surface);
  border: 1px solid var(--mh-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 0.75rem;
}
.mh-card__header { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.mh-card__name   { font-size: 1rem; font-weight: 600; }
.mh-card__desc   { font-size: 0.875rem; color: var(--mh-text-muted); line-height: 1.4; }
.mh-card__footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; }
.mh-card__actions { display: flex; gap: 0.5rem; }

/* ── Badges ──────────────────────────────────────────────────────────────────────── */
.mh-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--mh-border);
  color: var(--mh-text-muted);
}
.mh-badge--running  { background: #d1e7dd; color: #0a3622; }
.mh-badge--stopped  { background: var(--mh-border); color: var(--mh-text-muted); }
.mh-badge--error    { background: #f8d7da; color: #58151c; }
.mh-badge--unknown  { background: #fff3cd; color: #664d03; }

[data-theme="dark"] .mh-badge--running { background: #0d3321; color: #6ee8a8; }
[data-theme="dark"] .mh-badge--error   { background: #3a0d10; color: #f08080; }
[data-theme="dark"] .mh-badge--unknown { background: #3a2d00; color: #ffd97a; }

/* ── Buttons ──────────────────────────────────────────────────────────────────────── */
.mh-btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 5px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.mh-btn--primary   { background: var(--mh-accent); color: var(--mh-accent-text); }
.mh-btn--secondary { background: var(--mh-surface); color: var(--mh-accent); border-color: var(--mh-accent); }
.mh-btn--warning   { background: #ffc107; color: #000; }
.mh-btn--ghost     { background: transparent; color: var(--mh-text-muted); }
.mh-btn:hover      { opacity: 0.85; }

/* ── Configure ──────────────────────────────────────────────────────────────────────── */
.mh-configure { max-width: 600px; }
.mh-configure__header { margin-bottom: 1.5rem; }
.mh-configure__title  { font-size: 1.4rem; font-weight: 700; margin: 0.5rem 0 0.25rem; }
.mh-configure__desc   { color: var(--mh-text-muted); }
.mh-configure__docs   { font-size: 0.875rem; }
.mh-back { color: var(--mh-text-muted); text-decoration: none; font-size: 0.875rem; }

/* ── Form ──────────────────────────────────────────────────────────────────────── */
.mh-form { display: flex; flex-direction: column; gap: 1rem; }
.mh-form__fieldset { border: 1px solid var(--mh-border); border-radius: 6px; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.mh-form__legend   { padding: 0 0.5rem; font-weight: 600; }
.mh-form__field    { display: flex; flex-direction: column; gap: 0.25rem; }
.mh-form__label    { font-size: 0.875rem; font-weight: 500; }
.mh-form__required { color: #dc3545; margin-left: 2px; }
.mh-form__input {
  border: 1px solid var(--mh-border-input);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  width: 100%;
  background: var(--mh-surface);
  color: var(--mh-text);
}
.mh-form__input:focus { outline: 2px solid var(--mh-accent); border-color: transparent; }
.mh-form__hint    { font-size: 0.8rem; color: var(--mh-text-muted); }
.mh-form__actions { display: flex; gap: 0.75rem; }
.mh-form__empty   { color: var(--mh-text-muted); font-size: 0.875rem; }

/* ── Alerts ──────────────────────────────────────────────────────────────────────── */
.mh-alert { padding: 0.75rem 1rem; border-radius: 6px; font-size: 0.875rem; }
.mh-alert--success { background: #d1e7dd; color: #0a3622; }
.mh-alert--error   { background: #f8d7da; color: #58151c; }
.mh-alert__link    { color: inherit; font-weight: 600; margin-left: 0.5rem; }
.mh-alert__row     { display: flex; align-items: center; gap: 0.5rem; }
.mh-alert__detail  { margin-top: 0.4rem; font-size: 0.8rem; opacity: 0.85; }

[data-theme="dark"] .mh-alert--success { background: #0d3321; color: #6ee8a8; }
[data-theme="dark"] .mh-alert--error   { background: #3a0d10; color: #f08080; }

/* ── Spinner ──────────────────────────────────────────────────────────────────────── */
.mh-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: mh-spin 0.6s linear infinite;
  vertical-align: middle;
}
.mh-btn__spinner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
@keyframes mh-spin {
  to { transform: rotate(360deg); }
}

/* ── Logs ──────────────────────────────────────────────────────────────────────── */
.mh-logs { background: #0a0a15; border-radius: 6px; padding: 1rem; margin-top: 1rem; }
.mh-logs__pre { color: #cdd; font-size: 0.8rem; white-space: pre-wrap; word-break: break-all; max-height: 300px; overflow-y: auto; }
