/* base.css — design tokens + layout primitives. */

:root {
  --bg: #0f1117;
  --bg-secondary: #151823;
  --bg-card: #1a1d27;
  --bg-input: #0f1117;
  --border: #2a2e3a;
  --text: #e6e6e6;
  --text-muted: #9aa0b4;
  --text-dim: #6b7085;
  --accent: #4f7ef8;
  --accent-hover: #3a6cf0;
  --success: #3ec97e;
  --warning: #f5a623;
  --danger: #e05252;
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

input, textarea, select, button {
  font: inherit;
  color: inherit;
}

input[type=email],
input[type=text],
input[type=password] {
  width: 100%;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  outline: none;
}
input:focus { border-color: var(--accent); }

button.btn,
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  cursor: pointer;
}
button.btn:disabled { opacity: 0.5; cursor: default; }
button.btn:hover:not(:disabled) { background: var(--accent-hover); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.app-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
}

.main {
  padding: 1.5rem 2rem;
  overflow-x: auto;
  min-width: 0;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  gap: 0.75rem;
}
.header h1 { margin: 0; font-size: 1.25rem; font-weight: 600; }

/* Hamburger toggle: hidden on desktop, shown on mobile via media query. */
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.menu-toggle:hover { background: var(--bg-card); }
.menu-toggle svg { width: 20px; height: 20px; }

/* Sidebar backdrop: visible only when the mobile sidebar is open. */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ---- Mobile breakpoint ---- */
@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;   /* sidebar becomes overlay, not column */
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.2s ease-out;
    overflow-y: auto;
    box-shadow: 2px 0 16px rgba(0,0,0,0.4);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }
  .menu-toggle { display: inline-flex; }

  .main { padding: 1rem; }
  .header { gap: 0.5rem; }
  .header h1 { font-size: 1.05rem; }

  .auth-page { padding: 1rem; }
  .auth-card { padding: 1.5rem; }
  .auth-card h1 { font-size: 1.25rem; }

  .card { padding: 1rem; }

  /* iOS auto-zooms in on focused inputs whose font-size is < 16px, then
     leaves a slight horizontal scroll after blur. Forcing 16px on every
     editable element on narrow viewports prevents the zoom-bounce entirely.
     Lives inside the max-width media query so desktop chrome keeps its
     compact form sizing. */
  input[type=email],
  input[type=text],
  input[type=password],
  input[type=number],
  input[type=search],
  input[type=tel],
  input[type=url],
  input[type=date],
  input[type=datetime-local],
  input[type=time],
  input:not([type]),
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Touch-friendly: bigger tap targets on coarse-pointer devices. */
@media (pointer: coarse) {
  .sidebar-nav a {
    padding: 0.85rem 1rem;
    font-size: 1rem;
  }
  button.btn, .btn {
    padding: 0.75rem 1rem;
    min-height: 44px;
  }
  input[type=email],
  input[type=text],
  input[type=password],
  input[type=number],
  input[type=search],
  input[type=tel],
  input[type=url],
  input[type=date],
  input[type=datetime-local],
  input[type=time],
  input:not([type]),
  textarea,
  select {
    padding: 0.75rem;
    font-size: 16px;
  }
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.auth-card h1 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  text-align: center;
}
.auth-card label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.auth-card .field { margin-bottom: 1rem; }
.auth-card .btn { width: 100%; }
.auth-card .footer-link {
  margin-top: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  max-width: 360px;
  z-index: 1000;
}
.toast.error  { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }

.error-msg {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(224, 82, 82, 0.1);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.9rem;
}
.error-msg:empty { display: none; }

/* ---- Dashboard ---- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.dash-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}
.dash-tile:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
}
.dash-tile-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.dash-tile-value {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
}
.dash-tile-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.dash-callout {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.dash-callout.warn {
  background: rgba(245, 166, 35, 0.10);
  border: 1px solid var(--warning);
  color: var(--text);
}
.dash-callout.danger {
  background: rgba(224, 82, 82, 0.10);
  border: 1px solid var(--danger);
  color: var(--text);
}
.dash-callout p { margin: 0; flex: 1 1 320px; }
.dash-callout .btn { background: var(--accent); }

.dash-bottom {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.dash-activity {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.dash-activity h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.dash-activity .refresh-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.dash-activity .refresh-btn:hover { color: var(--text); border-color: var(--accent); }
.dash-activity-list { list-style: none; margin: 0; padding: 0; }
.dash-activity-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.dash-activity-list li:last-child { border-bottom: none; }
.dash-activity-list .ico {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(79, 126, 248, 0.10);
  color: var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}
.dash-activity-list .summary { color: var(--text); }
.dash-activity-list .summary a { color: var(--text); }
.dash-activity-list .summary a:hover { color: var(--accent); }
.dash-activity-list .when { color: var(--text-dim); font-size: 0.8rem; white-space: nowrap; }
.dash-activity-empty {
  color: var(--text-muted);
  padding: 1.5rem 0;
  text-align: center;
}

.dash-actions {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.dash-actions h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}
.dash-actions .quick-action {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.dash-actions .quick-action:hover {
  border-color: var(--accent);
  background: rgba(79, 126, 248, 0.05);
  text-decoration: none;
}

@media (max-width: 1024px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-bottom { grid-template-columns: 1fr; }
  .dash-analytics { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .dash-grid { grid-template-columns: 1fr; }
}

/* ---- Dashboard analytics row ---- */
.dash-analytics {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.dash-tile-spark {
  position: relative;
  cursor: default;
}
.dash-spark {
  width: 100%;
  height: 40px;
  margin-top: 0.5rem;
  color: var(--accent);
  display: block;
}
.dash-toppages {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.dash-toppages h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}
.dash-toppages-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toppages;
}
.dash-toppages-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  counter-increment: toppages;
}
.dash-toppages-list li:last-child { border-bottom: none; }
.dash-toppages-list li::before {
  content: counter(toppages) ".";
  color: var(--text-muted);
  font-weight: 600;
  min-width: 1.2em;
}
.top-page-link {
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-page-link:hover { color: var(--accent); }
.top-page-count {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

mcms-sidebar { display: block; }
.sidebar-logo {
  padding: 0 1rem 1rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo h1 { margin: 0; font-size: 1.25rem; }
.sidebar-logo p { margin: 0.25rem 0 0; color: var(--text-dim); font-size: 0.8rem; }
.sidebar-nav { padding: 0.5rem 0; }
.sidebar-nav a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  text-decoration: none;
}
.sidebar-nav a:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.sidebar-nav a.active {
  color: var(--text);
  background: rgba(79, 126, 248, 0.08);
  border-left-color: var(--accent);
}

/* ─────────────────────────────────────────────────────────────────
   Editor full-height shell (page/component/form/email-template
   builders). The .main column stops scrolling so the inner editor
   panes own scroll, mirroring the desktop split-pane look the
   ported SiteBuilder pages used to get from portal.css.
   ───────────────────────────────────────────────────────────────── */
.main.editor-main {
  padding: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.main.editor-main mcms-header .header {
  padding: 10px 16px;
  margin: 0;
}

/* Side-by-side editor surface. The split is .chat-pane | .pane-divider |
   .preview-pane and lives inside .main.editor-main. */
.designer {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.designer .editor-col {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.designer .pane-divider {
  width: 6px;
  cursor: col-resize;
  background: var(--border);
  flex-shrink: 0;
  user-select: none;
}
.designer .pane-divider:hover,
.designer .pane-divider.dragging { background: var(--accent); }
.designer .chat-pane,
.designer .preview-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}
.designer .chat-pane    { flex: 0 0 50%; min-width: 300px; }
.designer .preview-pane { flex: 1; min-width: 300px; }

/* Mobile-only tab strip used by the editor pages to switch between Chat /
   Preview / HTML / CSS / JS / Versions panes. Hidden on desktop so the
   side-by-side split is what the user sees. */
.mobile-tabs {
  display: none;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  overflow-x: auto;
  flex-shrink: 0;
}
.mobile-tabs .mobile-tab {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  user-select: none;
  white-space: nowrap;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  font: inherit;
}
.mobile-tabs .mobile-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Floating save button — visible only on mobile editor pages. Sticks to the
   bottom-right so the user can save without scrolling back to the chat
   pane's button row. The page hooks its click to whatever save action is
   appropriate for the current pane. */
.floating-save {
  display: none;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 50;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.floating-save:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 768px) {
  /* Stack the editor split into a single column. One pane fills the
     viewport; the mobile tab strip is what the user taps to switch. */
  .designer .editor-col   { flex-direction: column; }
  .designer .pane-divider { display: none; }
  .designer .chat-pane,
  .designer .preview-pane {
    display: none;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: auto;
  }
  .designer .chat-pane.mobile-active,
  .designer .preview-pane.mobile-active { display: flex; }
  .mobile-tabs   { display: flex; }
  .floating-save { display: inline-flex; }
  /* The per-pane sub-tab strip (Preview / HTML / CSS / JS / Meta / Versions
     inside .preview-pane) is redundant on mobile because the .mobile-tabs
     strip already exposes the same sub-panes as top-level tabs. Hiding it
     prevents the duplicate-tabs visual bug and the user confusion of "the
     parent tabs don't do anything" — on mobile the only navigation surface
     is the .mobile-tabs strip; on desktop both panes are visible side-by-
     side and the inner .tabs strip becomes the only way to switch sub-panes.
     Header sub-tab strips (.tpl-list .tabs, settings tabs, etc.) live
     outside .designer so they're untouched. */
  .designer .preview-pane > .tabs,
  .designer .chat-pane    > .tabs { display: none; }
}
@media (min-width: 769px) {
  /* Desktop always shows both panes regardless of the mobile-active class
     so the side-by-side layout never collapses. */
  .designer .chat-pane,
  .designer .preview-pane { display: flex; }
}

/* Settings tabs strip used by /admin/settings/*.html pages. */
.mcms-settings-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.mcms-settings-tab {
  padding: 0.6rem 1rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.mcms-settings-tab:hover { color: var(--text); text-decoration: none; }
.mcms-settings-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Toast container used by portal.js for the legacy showToast() helper.
   The base.css single-toast .toast rule above already styles each item;
   this just gives the container a fixed slot in the bottom-right corner
   so multiple toasts stack cleanly. */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast-container .toast {
  position: static;
}

/* Modal — used by the ported SiteBuilder pages via openModal/closeModal. */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.active { display: flex; }
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
}
.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.875rem;
  gap: 0.5rem;
}
.modal-title { margin: 0; font-size: 1rem; flex: 1; }
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.25rem;
}
.modal-close:hover { color: var(--text); }
.modal-footer {
  display: flex;
  gap: 0.625rem;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border);
}

/* Form controls used by ported pages (.form-input / .form-select / .form-label /
   .form-group / .form-textarea). Matches the visual the legacy portal.css
   established but layered over base.css tokens. */
.form-group { margin-bottom: 0.875rem; }
.form-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  font-weight: 600;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 13px;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-textarea {
  resize: vertical;
  font-family: ui-monospace, 'SF Mono', monospace;
}

/* Button variants ported pages reach for. .btn (the base) is already in
   base.css; everything below adds size + colour modifiers. */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card); color: var(--text); }
.btn-danger {
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
}
.btn-danger:hover { filter: brightness(1.1); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 12px; min-height: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Tables used by list pages (pages.html, forms.html, etc). */
table { border-collapse: collapse; width: 100%; }
th { text-align: left; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
td, th { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); }
code { background: var(--bg-input); padding: 1px 5px; border-radius: 3px; font-size: 12px; }

/* ─────────────────────────────────────────────────────────────────
   Header site switcher (rendered by <mcms-header>)
   ───────────────────────────────────────────────────────────────── */
.header-titles {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.mcms-site-switcher {
  position: relative;
  display: inline-flex;
}
.mcms-site-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.55rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
  max-width: 320px;
}
.mcms-site-switcher-btn:hover {
  background: var(--bg-card);
  color: var(--text);
}
.mcms-site-switcher-active-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mcms-site-switcher-active-sub {
  color: var(--text-dim);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
}
.mcms-site-switcher-active-sub:before { content: " · "; color: var(--text-dim); }
.mcms-site-switcher-chev {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}
.mcms-site-switcher-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  min-width: 260px;
  max-width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  overflow: hidden;
}
.mcms-site-switcher-list {
  max-height: 320px;
  overflow-y: auto;
}
.mcms-site-switcher-empty {
  padding: 0.6rem 0.85rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.mcms-site-switcher-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.mcms-site-switcher-item:last-child { border-bottom: none; }
.mcms-site-switcher-item:hover { background: rgba(79,126,248,0.08); }
.mcms-site-switcher-item.current { background: rgba(79,126,248,0.12); }
.mcms-site-switcher-name { font-weight: 500; }
.mcms-site-switcher-sub {
  color: var(--text-dim);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
}
.mcms-site-switcher-tick { color: var(--accent); font-weight: 700; }
.mcms-site-switcher-foot {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.mcms-site-switcher-foot a {
  display: block;
  padding: 0.55rem 0.85rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
}
.mcms-site-switcher-foot a:hover {
  background: rgba(79,126,248,0.08);
  text-decoration: none;
}
.mcms-site-switcher-new { color: var(--accent); font-weight: 600; }

/* ─────────────────────────────────────────────────────────────────
   Sites management table (sites.html)
   ───────────────────────────────────────────────────────────────── */
.sites-table tr.site-row { cursor: pointer; }
.sites-table tr.site-row:hover td { background: rgba(79,126,248,0.06); }
.sites-table tr.archived td { color: var(--text-dim); }
.sites-table .badge {
  display: inline-block;
  padding: 1px 7px;
  font-size: 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin-left: 0.4rem;
}
.sites-table .badge.active   { color: var(--accent);  border-color: var(--accent); }
.sites-table .badge.archived { color: var(--warning); border-color: var(--warning); }
.sites-table .row-actions {
  display: inline-flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.sites-table .row-actions .btn-sm { font-size: 11px; padding: 0.2rem 0.55rem; }
.sites-table td.subdomain { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.8rem; color: var(--text-muted); }
