/* ============================================================
   Mnemo Portal — Design System
   Editorial clarity with warm dark surfaces.
   Brand token: #0B7285
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  /* Surface (warm dark) */
  --bg:        #0f1415;
  --bg1:       #161d1f;
  --bg2:       #1d2528;
  --bg3:       #273235;
  --border:    rgba(223, 236, 238, 0.11);
  --border-md: rgba(223, 236, 238, 0.17);

  /* Brand + accents */
  --color-brand:        #0B7285;
  --color-brand-strong: #095d6d;
  --color-brand-soft:   rgba(11, 114, 133, 0.14);
  --color-brand-glow:   rgba(11, 114, 133, 0.30);
  --color-link:         #7fc9d7;
  --color-focus:        #8dd9e6;

  /* Backward-compatible aliases for existing classes/components */
  --indigo:    var(--color-brand);
  --indigo-lt: var(--color-link);
  --indigo-dk: var(--color-brand-strong);
  --indigo-bg: var(--color-brand-soft);
  --indigo-gl: var(--color-brand-glow);

  /* Text */
  --text1: #f4f8f8;
  --text2: #b4c3c6;
  --text3: #8a9ca0;
  --text4: #68787d;

  /* Semantic */
  --success: #22C55E;
  --warning: #F59E0B;
  --danger:  #EF4444;

  /* Semantic light tints (for badges, chips — WCAG AA on dark bg) */
  --danger-lt:  #f87171;
  --success-lt: #4ade80;
  --warning-lt: #fbbf24;
  --purple-lt:  #a78bfa;  /* support role accent only */

  /* Typography */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --fast: 150ms;
  --mid:  250ms;

  /* Layout */
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --max-w:     1100px;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text1);
  line-height: 1.6;
  min-height: 100vh;
  letter-spacing: 0.003em;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
}
body.visible { opacity: 1; visibility: visible; }

a { color: var(--indigo-lt); text-decoration: none; }
a:hover { color: var(--text1); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* ── Typography ───────────────────────────────────────────── */
.t-hero   { font-family: var(--font-display); font-size: clamp(2.25rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.t-h1     { font-family: var(--font-display); font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 700; letter-spacing: -0.015em; }
.t-h2     { font-family: var(--font-display); font-size: 1.375rem; font-weight: 600; letter-spacing: -0.01em; }
.t-h3     { font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; }
.t-body   { font-size: 1rem; color: var(--text2); }
.t-small  { font-size: 0.8125rem; color: var(--text3); }
.t-label  { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text3); }
.t-mono   { font-family: var(--font-mono); font-size: 0.8125rem; }

.gradient-text {
  background: linear-gradient(135deg, var(--color-link) 0%, var(--color-brand) 85%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Layout ───────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.page      { min-height: 100vh; display: flex; flex-direction: column; }
.spacer    { flex: 1; }

/* ── Nav ──────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 20, 21, 0.86);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text1);
}

.nav-logo-mark {
  width: 30px;
  height: 30px;
  background: var(--indigo);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.nav-logo-mark img {
  filter: brightness(1.2) saturate(1.1);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text2);
  padding: 6px 14px;
  border-radius: 8px;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.nav-link:hover { color: var(--text1); background: var(--bg2); }
.nav-link.active { color: var(--indigo-lt); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--fast) var(--ease);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-brand);
  color: white;
}
.btn-primary:hover { background: var(--color-brand-strong); color: white; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(11, 114, 133, 0.34); }
.btn-primary:active { transform: none; }

.btn-secondary {
  background: var(--bg2);
  color: var(--text1);
  border: 1px solid var(--border-md);
}
.btn-secondary:hover { background: var(--bg3); color: var(--text1); }

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg2); color: var(--text1); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.25);
}
.btn-danger:hover { background: rgba(239,68,68,0.1); }

.btn-sm { font-size: 0.8125rem; padding: 6px 14px; }
.btn-lg { font-size: 1rem; padding: 14px 28px; border-radius: 12px; }

.btn-google {
  background: white;
  color: #1F1F1F;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid #E0E0E0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: box-shadow var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn-google:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.3); transform: translateY(-1px); color: #1F1F1F; }
.btn-google svg { flex-shrink: 0; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg1);
  border: 1px solid rgba(223, 236, 238, 0.08);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 4px 12px rgba(3, 6, 7, 0.08), 0 24px 48px rgba(0,0,0,0.4);
}

.card-sm { padding: 16px; border-radius: var(--radius); }
.card-lg { padding: 32px; border-radius: var(--radius-xl); }

/* ── Hero Section ─────────────────────────────────────────── */
.hero {
  padding: 96px 0 80px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--indigo-bg);
  border: 1px solid var(--indigo-gl);
  color: var(--indigo-lt);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  background: var(--indigo);
  border-radius: 50%;
}

.hero h1 { margin-bottom: 20px; }

.hero p {
  font-size: 1.125rem;
  color: var(--text2);
  max-width: 540px;
  margin: 0 auto 36px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-sub {
  margin-top: 16px;
  font-size: 0.8125rem;
  color: var(--text3);
}

.step-dot {
  width: 56px;
  height: 56px;
  background: var(--indigo-bg);
  border: 1px solid var(--indigo-gl);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--indigo-lt);
}

.cta-band {
  padding: 80px 0;
  background: linear-gradient(135deg, rgba(11, 114, 133, 0.16) 0%, rgba(11, 114, 133, 0.05) 100%);
  border-top: 1px solid var(--indigo-gl);
  border-bottom: 1px solid var(--border);
}

/* ── Section ──────────────────────────────────────────────── */
.section { padding: 72px 0; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { margin-bottom: 12px; }
.section-header p { color: var(--text2); max-width: 500px; margin: 0 auto; }

/* ── Grid ─────────────────────────────────────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .grid-2, .grid-4 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .nav-inner {
    height: auto;
    padding: 10px 0;
    gap: 8px;
    flex-wrap: wrap;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav-link {
    padding: 6px 10px;
  }

  .dash-usage-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Feature Card ─────────────────────────────────────────── */
.feature-card .icon {
  width: 44px;
  height: 44px;
  background: var(--indigo-bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.25rem;
}
.feature-card h3 { margin-bottom: 8px; }
.feature-card p  { font-size: 0.9rem; color: var(--text2); line-height: 1.6; }

/* ── Works With ───────────────────────────────────────────── */
.works-with {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.app-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text2);
}

.app-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ── Pricing ──────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 1000px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .pricing-grid { grid-template-columns: 1fr; } }

.pricing-card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.pricing-card.featured {
  background: linear-gradient(145deg, rgba(11, 114, 133, 0.18) 0%, rgba(22, 29, 31, 1) 56%);
  border-color: var(--indigo-gl);
  box-shadow: 0 0 0 1px var(--indigo-gl), 0 0 36px rgba(11, 114, 133, 0.16);
}

.pricing-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--indigo);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 16px;
  align-self: flex-start;
}

.pricing-tier { font-size: 0.8125rem; font-weight: 600; color: var(--text3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.pricing-price { margin: 12px 0; }
.pricing-price .amount { font-size: 2.25rem; font-weight: 700; color: var(--text1); }
.pricing-price .period { font-size: 0.875rem; color: var(--text3); }
.pricing-desc { font-size: 0.875rem; color: var(--text2); margin-bottom: 20px; line-height: 1.5; }

.pricing-features { list-style: none; margin-bottom: 24px; flex: 1; }
.pricing-features li {
  font-size: 0.875rem;
  color: var(--text2);
  padding: 6px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-features li::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; margin-top: 1px; }

.pricing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}
.toggle-label { font-size: 0.9rem; color: var(--text2); }
.toggle-label.active { color: var(--text1); font-weight: 600; }
.toggle-save { font-size: 0.75rem; color: var(--success); font-weight: 600; }

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute;
  inset: 0;
  background: var(--bg3);
  border-radius: 100px;
  cursor: pointer;
  transition: background var(--fast) var(--ease);
}
.switch input:checked + .switch-track { background: var(--indigo); }
.switch-track::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform var(--fast) var(--ease);
}
.switch input:checked + .switch-track::after { transform: translateX(20px); }

/* ── Token Table ──────────────────────────────────────────── */
.token-table-wrap { overflow-x: auto; }

.token-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.token-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.token-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.token-table tr:last-child td { border-bottom: none; }
.token-table tr:hover td { background: var(--bg2); }

.token-name { font-weight: 500; color: var(--text1); }
.token-mask { font-family: var(--font-mono); color: var(--text3); font-size: 0.8rem; }
.token-name-row { display: flex; align-items: center; gap: 8px; }
.token-rename-wrap { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.token-rename-input {
  max-width: 220px;
  background: var(--bg);
  border: 1px solid var(--border-md);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text1);
  font-size: 0.8rem;
  font-family: inherit;
}
.token-inline-action {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text3);
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--fast) var(--ease);
}
.token-inline-action:hover { color: var(--text1); border-color: var(--border-md); }
.token-inline-action:disabled { opacity: 0.65; cursor: not-allowed; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-green  { background: rgba(34,197,94,0.12);  color: var(--success); }
.badge-yellow { background: rgba(245,158,11,0.12); color: var(--warning); }
.badge-red    { background: rgba(239,68,68,0.12);  color: var(--danger); }
.badge-indigo { background: var(--indigo-bg);       color: var(--indigo-lt); }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--mid) var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg1);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  padding: 32px;
  transform: scale(0.96) translateY(8px);
  transition: transform var(--mid) var(--ease);
}
.modal-overlay.open .modal { transform: none; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg3);
  border: none;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--fast) var(--ease);
}
.modal-close:hover { background: var(--bg3); color: var(--text1); }

.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 6px; color: var(--text2); }
.form-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text1);
  font-family: inherit;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color var(--fast) var(--ease);
}
.form-input:focus { border-color: var(--indigo); }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2371717A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* ── Export Card ──────────────────────────────────────────── */
.export-card {
  position: relative;
}

.export-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.export-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.export-group {
  display: flex;
  flex-direction: column;
}

.export-action {
  display: flex;
  align-items: center;
  gap: 16px;
}

.export-progress {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-brand) 0%, var(--color-link) 100%);
  width: 0%;
  animation: progress-pulse 1s ease-in-out infinite;
}

@keyframes progress-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.export-download-link {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.export-download-link .alert {
  margin-bottom: 12px;
}

.export-error {
  margin-top: 12px;
}

/* ── Backup & Restore ─────────────────────────────────────── */
.backup-card {
  position: relative;
}

.backup-status {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.snapshot-table-wrap {
  overflow-x: auto;
}

.snapshot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.snapshot-table th {
  background: var(--bg);
  color: var(--text2);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-md);
  text-align: left;
  font-size: 0.8125rem;
}

.snapshot-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}

.snapshot-table tr:last-child td {
  border-bottom: none;
}

.snapshot-table tr:hover td {
  background: var(--bg2);
}

.snapshot-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text3);
}

.snapshot-status.completed {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.snapshot-status.failed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.snapshot-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.snapshot-action-btn {
  font-size: 0.8125rem;
  padding: 6px 12px;
  border: none;
  background: var(--bg2);
  color: var(--indigo-lt);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--fast) var(--ease);
}

.snapshot-action-btn:hover {
  background: var(--bg3);
  color: var(--text1);
}

.snapshot-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.backup-progress {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

/* ── Restore Modal ────────────────────────────────────────── */
.restore-info {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.restore-mode-toggle {
  flex-direction: column;
}

.toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius);
  transition: background var(--fast) var(--ease);
}

.toggle-label:hover {
  background: var(--bg2);
}

.toggle-label input[type="radio"],
.toggle-label input[type="checkbox"] {
  margin-top: 4px;
  cursor: pointer;
}

.toggle-label span:first-of-type {
  font-weight: 500;
  color: var(--text1);
}

.restore-progress {
  padding: 16px 0;
}

.upgrade-prompt {
  text-align: center;
  border-color: var(--indigo-gl);
  background: rgba(11, 114, 133, 0.05);
}

.upgrade-prompt .alert {
  justify-content: center;
}

/* ── Token Reveal ─────────────────────────────────────────── */
.token-reveal {
  background: var(--bg);
  border: 1px solid var(--indigo-gl);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.token-reveal-text {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--indigo-lt);
  word-break: break-all;
}
.token-copy-btn {
  flex-shrink: 0;
  background: var(--indigo-bg);
  border: 1px solid var(--indigo-gl);
  border-radius: 6px;
  color: var(--indigo-lt);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all var(--fast) var(--ease);
}
.token-copy-btn:hover { background: var(--indigo); color: white; }
.token-copy-btn.copied { background: rgba(34,197,94,0.15); color: var(--success); border-color: rgba(34,197,94,0.3); }

.token-warning {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.8125rem;
  color: var(--warning);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

/* ── Setup Tabs ───────────────────────────────────────────── */
.setup-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 16px;
}

.setup-tab {
  flex: 1;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text3);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--fast) var(--ease);
  border: none;
  background: transparent;
  font-family: inherit;
}
.setup-tab:hover { color: var(--text2); }
.setup-tab.active { background: var(--bg1); color: var(--text1); box-shadow: 0 1px 3px rgba(0,0,0,0.3); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Code Block ───────────────────────────────────────────── */
.code-block {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
}
.code-block pre {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text2);
  overflow-x: auto;
  white-space: pre;
}
.code-block .copy-code {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--fast) var(--ease);
}
.code-block .copy-code:hover { color: var(--text1); background: var(--bg3); }
.code-block .copy-code.copied { color: var(--success); }

code { font-family: var(--font-mono); background: var(--bg2); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; color: var(--indigo-lt); }

/* ── Usage Bar ────────────────────────────────────────────── */
.usage-bar-wrap { margin-bottom: 16px; }
.usage-bar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.usage-bar-label  { font-size: 0.95rem; font-weight: 500; }
.usage-bar-count  { font-size: 0.95rem; color: var(--text3); }

.usage-bar-track {
  height: 8px;
  background: var(--bg3);
  border-radius: 100px;
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  background: var(--indigo);
  border-radius: 100px;
  transition: width 0.6s var(--ease);
  width: var(--bar-width, 0%);
}
.usage-bar-fill.warn { background: var(--warning); }
.usage-bar-fill.crit { background: var(--danger); }

/* ── Dashboard Layout ─────────────────────────────────────── */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.dash-header-left { display: flex; align-items: center; gap: 12px; }
.dash-header-right { display: flex; align-items: center; gap: 8px; }

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--indigo-bg);
  border: 1px solid var(--indigo-gl);
  color: var(--indigo-lt);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
}

.doc-page {
  max-width: 760px;
  margin: 0 auto;
}
.doc-page-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.doc-page-hero h1 { margin-bottom: 8px; }
.doc-page-hero p { color: var(--text2); max-width: 500px; }

.doc-section {
  margin-bottom: 28px;
}

.doc-section h2 {
  margin-bottom: 10px;
}

.doc-section p,
.doc-section li {
  color: var(--text2);
  font-size: 0.95rem;
}

.doc-section ul {
  margin-left: 18px;
  display: grid;
  gap: 8px;
}

.doc-note {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.faq-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.faq-code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 12px 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text2);
  line-height: 1.6;
}

.faq-section-divider {
  margin: 48px 0 8px;
  padding-top: 40px;
  border-top: 2px solid var(--border);
}

.faq-section-divider h2 {
  margin-bottom: 8px;
}

.faq-section-divider p {
  color: var(--text2);
  margin-bottom: 0;
}

.faq-platform-list {
  margin: 12px 0 16px 20px;
  padding: 0;
}

.faq-platform-list li {
  margin-bottom: 10px;
  color: var(--text2);
  line-height: 1.5;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h3 {
  margin-bottom: 8px;
}

.dash-section { margin-bottom: 36px; }
.dash-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

.dash-usage-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 14px;
  align-items: stretch;
}

.usage-card-compact {
  padding: 14px 16px;
}

.admin-grid {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-mfa-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 380px;
}

.client-total {
  color: var(--text3);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.client-metrics-list {
  display: grid;
  gap: 8px;
}

.client-row {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
}

.client-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.client-row .k {
  color: var(--text3);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.client-row .v {
  color: var(--text1);
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.client-row-track {
  height: 6px;
  border-radius: 999px;
  background: var(--bg3);
  overflow: hidden;
}

.client-row-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(11, 114, 133, 0.55), var(--color-brand));
  border-radius: 999px;
  transition: width 280ms var(--ease);
  width: var(--bar-width, 0%);
}

@media (max-width: 760px) {
  .admin-mfa-row {
    max-width: none;
  }

  .admin-mfa-row .form-input {
    min-width: 0;
    flex: 1 1 auto;
  }
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text3);
}
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text2); margin-bottom: 8px; }
.empty-state p  { font-size: 0.875rem; max-width: 300px; margin: 0 auto 20px; }

/* ── Divider ──────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 32px 0; }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 0.875rem; color: var(--text3); }
.footer-links a:hover { color: var(--text2); }
.footer-copy { font-size: 0.8125rem; color: var(--text3); }

/* ── Alert ────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: rgba(34,197,94,0.08);  border: 1px solid rgba(34,197,94,0.2);  color: #86EFAC; }
.alert-error   { background: rgba(239,68,68,0.08);  border: 1px solid rgba(239,68,68,0.2);  color: #FCA5A5; }
.alert-info    { background: var(--indigo-bg); border: 1px solid var(--indigo-gl); color: var(--indigo-lt); }

/* ── Loader ───────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-md);
  border-top-color: var(--indigo);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility ──────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex   { display: flex; }
.flex-1 { flex: 1; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flex-end { display: flex; gap: 10px; justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-2   { margin-top: 2px; }
.mt-4   { margin-top: 4px; }
.mt-6   { margin-top: 6px; }
.mt-8   { margin-top: 8px; }
.mt-10  { margin-top: 10px; }
.mt-12  { margin-top: 12px; }
.mt-14  { margin-top: 14px; }
.mt-16  { margin-top: 16px; }
.mt-20  { margin-top: 20px; }
.mt-24  { margin-top: 24px; }
.mt-48  { margin-top: 48px; }
.mt-56  { margin-top: 56px; }
.mt-72  { margin-top: 72px; }
.mb-2   { margin-bottom: 2px; }
.mb-4   { margin-bottom: 4px; }
.mb-6   { margin-bottom: 6px; }
.mb-8   { margin-bottom: 8px; }
.mb-10  { margin-bottom: 10px; }
.mb-12  { margin-bottom: 12px; }
.mb-14  { margin-bottom: 14px; }
.mb-16  { margin-bottom: 16px; }
.mb-20  { margin-bottom: 20px; }
.mb-24  { margin-bottom: 24px; }
.mb-28  { margin-bottom: 28px; }
.mb-32  { margin-bottom: 32px; }
.mb-34  { margin-bottom: 34px; }
.mb-36  { margin-bottom: 36px; }
.mb-40  { margin-bottom: 40px; }
.mb-48  { margin-bottom: 48px; }
.mb-52  { margin-bottom: 52px; }
.mb-56  { margin-bottom: 56px; }
.py-48  { padding-top: 48px; padding-bottom: 48px; }
.py-56  { padding-top: 56px; padding-bottom: 56px; }
.py-64  { padding-top: 64px; padding-bottom: 64px; }
.p-24   { padding: 24px; }
.px-12  { padding-left: 12px; padding-right: 12px; }
.ml-auto { margin-left: auto; }
.max-w-640 { max-width: 640px; margin-left: auto; margin-right: auto; }
.no-underline { text-decoration: none; }
.w-40   { width: 40px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-link { color: var(--indigo-lt); }
.text-secondary { color: var(--text2); }
.text-tertiary { color: var(--text3); }
.text-danger { color: var(--danger); }
.text-upper { text-transform: uppercase; }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.bold-text1 { font-weight: 700; color: var(--text1); }
.overflow-hidden { overflow: hidden; }
.block { display: block; }
.status-ok { color: var(--success-lt); }
.status-error { color: var(--danger-lt); }
.main-section { padding: 40px 0; flex: 1; }

/* ── Activation & Retention: Brief Card Zones ────────────────── */

/* Week review card */
.week-review-card > summary { cursor: pointer; list-style: none; }
.week-review-card > summary::-webkit-details-marker { display: none; }
.week-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.week-stat { display: flex; flex-direction: column; gap: 2px; }
.week-stat-value { font-size: 28px; font-weight: 700; color: var(--text1); }
.week-stat-label { font-size: 12px; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }
.week-stat-wide { grid-column: 1 / -1; font-size: 13px; color: var(--text2); padding-top: 8px; border-top: 1px solid var(--border); }

/* Next step card */
.next-step-card { border-color: var(--indigo-500, #6366f1); background: var(--color-brand-soft); }

/* Urgent alert with CTA */
.alert .btn { margin-left: auto; flex-shrink: 0; }

/* ── Alert warning (amber) ────────────────────────────────── */
.alert-warning { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2); color: #FBBF24; }

/* ── Week review badge colors ─────────────────────────────── */
.badge-normal { background: rgba(96,165,250,0.12); color: #93c5fd; }
.badge-elevated { background: rgba(251,146,60,0.12); color: #fdba74; }
.badge-urgent { background: rgba(239,68,68,0.12); color: #fca5a5; }

/* ── Pulse card ───────────────────────────────────────────── */
.pulse-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pulse-badge-normal  { background: rgba(96,165,250,0.12); color: #93c5fd; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.pulse-badge-elevated { background: rgba(251,146,60,0.12); color: #fdba74; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.pulse-badge-urgent  { background: rgba(239,68,68,0.12); color: #fca5a5; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }

/* ── Urgent list ──────────────────────────────────────────── */
.urgent-list { display: flex; flex-direction: column; gap: 8px; }
.urgent-item { display: flex; align-items: center; gap: 8px; border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.urgent-cta  { margin-left: auto; flex-shrink: 0; font-size: 12px; padding: 4px 12px; border-radius: 6px; font-weight: 600; background: var(--color-brand); color: #fff; border: none; cursor: pointer; text-decoration: none; }

/* ── Admin Shell ─────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(15, 20, 21, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.admin-topbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-topbar-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-brand-soft);
  border: 1px solid var(--border-md);
  color: var(--color-link);
  font-size: 1rem;
  font-weight: 800;
}

.admin-topbar-title {
  color: var(--text1);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.admin-main {
  padding: 28px 0 56px;
  display: grid;
  gap: 20px;
}

.admin-hero {
  display: grid;
  gap: 14px;
}

.admin-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-brand-soft);
  border: 1px solid var(--indigo-gl);
  color: var(--color-link);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.admin-notice {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-md);
  background: var(--bg2);
  color: var(--text2);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
}

.admin-notice--success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.22);
  color: var(--text1);
}

.admin-notice--error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.24);
  color: var(--text1);
}

.admin-notice--info {
  background: var(--color-brand-soft);
  border-color: var(--indigo-gl);
  color: var(--text1);
}

.admin-content {
  display: grid;
  gap: 20px;
}

.admin-grid {
  display: grid;
  gap: 20px;
}

.admin-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-panel {
  display: grid;
  gap: 16px;
}

.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-panel-title {
  display: grid;
  gap: 4px;
}

.admin-panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-section-body {
  display: grid;
  gap: 16px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-form-grid .form-group:last-child {
  grid-column: 1 / -1;
}

.admin-help {
  color: var(--text3);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.admin-inline-error {
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger-lt);
  line-height: 1.5;
}

.admin-state {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-md);
  background: var(--bg);
  color: var(--text2);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
}

.admin-state--loading {
  background: var(--color-brand-soft);
  border-color: var(--indigo-gl);
}

.admin-state--error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.22);
  color: var(--danger-lt);
}

.admin-state--empty {
  background: var(--bg2);
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-list-card {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.admin-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-list-title {
  color: var(--text1);
  font-size: 0.95rem;
  font-weight: 600;
}

.admin-list-summary {
  color: var(--text2);
  font-size: 0.875rem;
  line-height: 1.55;
}

.admin-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text3);
  font-size: 0.75rem;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-table-shell .token-table {
  min-width: 720px;
}

.admin-table .btn {
  white-space: nowrap;
}

.admin-gate {
  max-width: 760px;
}

.admin-gate-form {
  max-width: 420px;
}

.admin-modal-form {
  display: grid;
  gap: 14px;
}

.admin-modal-copy {
  color: var(--text2);
  line-height: 1.55;
}

.admin-modal-textarea {
  min-height: 120px;
  resize: vertical;
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 940px) {
  .admin-grid--two,
  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-table-shell .token-table {
    min-width: 620px;
  }
}

@media (max-width: 640px) {
  .admin-topbar-inner {
    padding: 14px 16px;
  }

  .admin-main {
    padding: 20px 0 44px;
  }

  .admin-table-shell .token-table {
    min-width: 540px;
  }
}

/* ── Admin Dashboard: Compact Layout ───────────────────── */
.admin-grid--compact {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.5rem;
}

.admin-table-compact {
  font-size: 0.8125rem;
  table-layout: fixed;
  width: 100%;
}

.admin-table-compact th,
.admin-table-compact td {
  padding: 4px 6px;
  line-height: 1.2;
  height: 28px;
}

/* Truncate only the email cell — badges + buttons must never be clipped */
.admin-table-compact td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table-compact .btn {
  padding: 4px 8px;
  font-size: 0.75rem;
}

.admin-table-compact col.col-check  { width: 30px; }
.admin-table-compact col.col-email  { width: auto; }
.admin-table-compact col.col-tier   { width: 80px; }
.admin-table-compact col.col-status { width: 82px; }
.admin-table-compact col.col-actions{ width: 185px; }

.email-form-section {
  margin-bottom: 1.5rem;
}

.email-form-section h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.email-form-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.email-form-group.full {
  grid-column: 1 / -1;
}

.email-form-group input,
.email-form-group select {
  padding: 6px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg2);
  color: var(--text);
}

.email-form-group button {
  padding: 8px 12px;
  font-size: 0.75rem;
  width: 100%;
}

.email-list {
  margin-top: 1rem;
}

.email-list-item {
  padding: 8px;
  background: var(--bg2);
  border-left: 3px solid var(--color-brand);
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
}

.email-list-item .badge {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(25, 118, 210, 0.12);
  color: #1976d2;
  border-radius: 3px;
  font-size: 0.625rem;
  margin-right: 0.5rem;
  font-weight: 600;
}

.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
  font-size: 0.75rem;
}

.pagination button {
  padding: 4px 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  transition: all 150ms;
}

.pagination button:hover:not(:disabled) {
  background: var(--color-brand-soft);
  border-color: var(--color-brand);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Dashboard Sidebar Architecture ───────────────────── */
.dashboard-app-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.sidebar {
  background: rgba(15, 20, 21, 0.86);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 32px 16px;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 200;
  overflow-y: auto;
}

.sidebar .nav-logo {
  margin-bottom: 40px;
  padding: 0 14px;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text2);
  padding: 10px 14px;
  border-radius: 8px;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.sidebar-link:hover {
  background: var(--bg2);
  color: var(--text1);
}

.sidebar-link.active {
  background: var(--color-brand-soft);
  color: var(--color-link);
}

.dashboard-main {
  flex: 1;
  overflow-y: auto;
  padding: 48px 0;
}

/* Modal setup tweaks */
#setup-modal .modal {
  background: var(--bg);
  border: 1px solid var(--border-md);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}


/* Admin Power Tools */
#omni-search-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
    display: none; align-items: flex-start; justify-content: center; padding-top: 15vh; z-index: 1000;
}
#omni-search-modal.open { display: flex; }
.omni-search-box {
    background: var(--bg); border: 1px solid var(--border-md); border-radius: 12px;
    width: 100%; max-width: 600px; box-shadow: 0 24px 48px rgba(0,0,0,0.5); overflow: hidden;
}
.omni-search-input {
    width: 100%; background: transparent; border: none; padding: 20px 24px;
    color: var(--text1); font-size: 1.25rem; outline: none;
}
#admin-bulk-bar {
    position: fixed; bottom: -80px; left: 50%; transform: translateX(-50%);
    background: var(--bg1); border: 1px solid var(--indigo-gl); border-radius: 100px;
    padding: 12px 24px; display: flex; align-items: center; gap: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); transition: bottom 0.3s var(--ease); z-index: 500;
}
#admin-bulk-bar.visible { bottom: 40px; }

/* ============================================================
   ENTERPRISE APP SHELL — Dashboard Redesign
   Premium dark theme with sidebar, glassmorphism, and KPI cards
   ============================================================ */

/* ── Ambient background ─────────────────────────────────── */
.ambient-bg {
  position: fixed; inset: 0; pointer-events: none;
  z-index: 0; overflow: hidden;
}
.ambient-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.15;
  animation: orb-drift 20s ease-in-out infinite alternate;
}
.ambient-orb--1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #0b7285 0%, transparent 70%);
  top: -200px; left: -150px; animation-duration: 25s;
}
.ambient-orb--2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #3730a3 0%, transparent 70%);
  bottom: -150px; right: -100px; animation-duration: 30s; animation-delay: -8s;
}
.ambient-orb--3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #065f46 0%, transparent 70%);
  top: 40%; left: 55%; animation-duration: 22s; animation-delay: -15s; opacity: 0.08;
}
@keyframes orb-drift {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(40px,-30px) scale(1.08); }
  100% { transform: translate(-20px,50px) scale(0.95); }
}

/* ── App shell ───────────────────────────────────────────── */
.app-body { min-height: 100vh; overflow: hidden; }
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  height: 100vh;
  height: 100dvh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  background: rgba(11,15,16,0.82);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column;
  height: 100vh; position: sticky; top: 0; z-index: 200; overflow-y: auto;
}
.sidebar-brand { padding: 28px 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text1); }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -0.03em; color: #f4f8f8; }
.brand-mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg,#0d9caf 0%,#0b7285 100%);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: .875rem; font-weight: 800; color: white;
  box-shadow: 0 4px 12px rgba(11,114,133,.4); flex-shrink: 0;
}
.brand-name { font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em; }

.sidebar-identity {
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.05);
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.identity-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg,#3730a3 0%,#0b7285 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem; font-weight: 700; color: white; flex-shrink: 0; text-transform: uppercase;
}
.identity-info { flex: 1; min-width: 0; }
.identity-name { font-size: .8375rem; font-weight: 600; color: var(--text1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity-email { font-size: .75rem; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tier-pill {
  flex-shrink: 0; font-size: .65rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 100px;
  background: var(--color-brand-soft); border: 1px solid var(--color-brand-glow); color: var(--color-link);
}
.sidebar-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.snav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; font-size: .875rem; font-weight: 500;
  color: var(--text3); text-decoration: none;
  transition: all 160ms cubic-bezier(.4,0,.2,1); position: relative;
}
.snav-link:hover { background: rgba(255,255,255,.05); color: var(--text1); }
.snav-link--active { background: rgba(11,114,133,.14); color: var(--color-link); }
.snav-link--active::before {
  content: ''; position: absolute; left: 0; top: .25rem; bottom: .25rem;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--color-brand);
}
.snav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.snav-link--active .snav-icon { opacity: 1; }
.sidebar-footer { padding: 12px 10px 20px; border-top: 1px solid rgba(255,255,255,.05); }
.snav-signout {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 8px; font-size: .875rem; font-weight: 500;
  color: var(--text3); background: transparent; border: none; cursor: pointer;
  font-family: inherit; transition: all 160ms; text-align: left;
}
.snav-signout svg { width: 18px; height: 18px; flex-shrink: 0; }
.snav-signout:hover { background: rgba(239,68,68,.08); color: #fca5a5; }
.snav-token-note {
  font-size: .72rem; color: var(--text3); opacity: .6;
  margin: 4px 12px 0; line-height: 1.4;
}
.snav-token-note a { color: inherit; text-decoration: underline; }

/* ── Main content ───────────────────────────────────────── */
.app-main {
  min-height: 0;
  overflow-y: auto;
  padding: 36px 40px 60px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-title { font-size: 1.625rem; font-weight: 700; letter-spacing: -.02em; color: var(--text1); line-height: 1.2; }
.page-subtitle { font-size: .9rem; color: var(--text3); margin-top: 4px; }
.page-header-right { display: flex; align-items: center; gap: 10px; }

.profile-slug-bar {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8125rem; color: var(--text3); margin-bottom: 28px;
  background: rgba(11,114,133,.06); border: 1px solid rgba(11,114,133,.18);
  border-radius: 8px; padding: 6px 12px;
}
.profile-slug-bar svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--color-brand); }
.profile-slug-bar code { font-family: var(--font-mono); color: var(--color-link); font-size: .8rem; }
.slug-copy-btn { font-size: .75rem; font-weight: 600; color: var(--color-brand); background: transparent; border: none; cursor: pointer; padding: 0 0 0 6px; font-family: inherit; transition: color 150ms; }
.slug-copy-btn:hover { color: var(--color-link); }

.btn-upgrade {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: 8px; font-size: .8125rem; font-weight: 600;
  background: linear-gradient(135deg,rgba(11,114,133,.3) 0%,rgba(55,48,163,.3) 100%);
  border: 1px solid rgba(11,114,133,.4); color: var(--color-link); transition: all 160ms; text-decoration: none;
}
.btn-upgrade svg { width: 14px; height: 14px; }
.btn-upgrade:hover { background: linear-gradient(135deg,rgba(11,114,133,.5) 0%,rgba(55,48,163,.5) 100%); color: white; }

.section-label { font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text3); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.content-section { margin-bottom: 36px; }

.page-content {
  width: 100%;
  max-width: 720px;
  padding: 40px 48px;
  margin: 0 auto;
}

.glass-card {
  background: rgba(22,29,31,.7);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.07); border-radius: 14px; padding: 20px;
  transition: border-color 200ms;
}
.glass-card:hover { border-color: rgba(255,255,255,.11); }

/* ── KPI row ────────────────────────────────────────────── */
.kpi-row { margin-bottom: 36px; }
.kpi-row-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.upgrade-link { font-size: .8125rem; color: var(--color-link); text-decoration: none; transition: color 150ms; }
.upgrade-link:hover { color: var(--text1); }

.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.kpi-card { padding: 16px; display: grid; gap: 10px; }
.kpi-icon { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-icon--sessions  { background: rgba(11,114,133,.15); color: #38bcd5; }
.kpi-icon--decisions { background: rgba(99,102,241,.15); color: #a5b4fc; }
.kpi-icon--threads   { background: rgba(16,185,129,.15); color: #6ee7b7; }
.kpi-body { min-width: 0; }
.kpi-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text3); margin-bottom: 4px; }
.kpi-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.03em; color: var(--text1); line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-limit { font-size: .75rem; color: var(--text3); margin-top: 2px; }
.kpi-bar-track { height: 4px; background: rgba(255,255,255,.07); border-radius: 100px; overflow: hidden; }
.kpi-bar-fill {
  height: 100%; border-radius: 100px;
  background: linear-gradient(90deg,var(--color-brand) 0%,#38bcd5 100%);
  width: var(--bar-pct,0%); transition: width .8s cubic-bezier(.4,0,.2,1);
}

.clients-card { padding: 16px; }
.clients-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.client-total-badge { font-size: .72rem; font-weight: 600; color: var(--text3); background: rgba(255,255,255,.05); border-radius: 100px; padding: 2px 8px; }
.client-list { display: grid; gap: 6px; }
.client-row { display: grid; grid-template-columns: 52px 1fr 28px; align-items: center; gap: 8px; }
.client-name { font-size: .78rem; color: var(--text3); }
.client-bar-track { height: 4px; background: rgba(255,255,255,.07); border-radius: 100px; overflow: hidden; }
.client-bar-fill { height: 100%; background: linear-gradient(90deg,#3730a3 0%,#0b7285 100%); border-radius: 100px; width: var(--bar-pct,0%); transition: width .7s cubic-bezier(.4,0,.2,1); }
.client-count { font-size: .75rem; font-weight: 600; color: var(--text2); text-align: right; font-variant-numeric: tabular-nums; }
.clients-note { font-size: .72rem; color: var(--text4); margin-top: 10px; }

/* ── Token table ────────────────────────────────────────── */
.token-card { padding: 0; overflow: hidden; }
.token-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.token-table th {
  text-align: left; font-size: .72rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text4);
  padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.15);
}
.token-table td { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; color: var(--text2); }
.token-table tr:last-child td { border-bottom: none; }
.token-table tbody tr { transition: background 120ms; }
.token-table tbody tr:hover td { background: rgba(255,255,255,.03); }

/* ── Checklist table ───────────────────────────────────── */
.checklist-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.checklist-table td { padding: 16px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: middle; color: var(--text2); }
.checklist-table tr:first-child td { border-top: 1px solid rgba(255,255,255,.06); }
.checklist-table tr:last-child td { border-bottom: none; }
.checklist-table td:first-child { color: var(--text1); font-weight: 500; width: 50%; }
.checklist-table td:last-child { text-align: right; color: var(--text3); }

/* ── Empty state ───────────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 24px; }
.empty-icon { width: 64px; height: 64px; margin: 0 auto 16px; color: var(--text4); }
.empty-icon svg { width: 100%; height: 100%; }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text2); margin-bottom: 8px; }
.empty-body { font-size: .875rem; color: var(--text3); max-width: 280px; margin: 0 auto 20px; line-height: 1.55; }

/* ── Export / form ─────────────────────────────────────── */
.export-card { display: grid; gap: 16px; }
.export-header { padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.06); }
.export-title { font-size: .9375rem; font-weight: 600; color: var(--text1); }
.export-subtitle { font-size: .8125rem; color: var(--text3); margin-top: 3px; }
.export-controls { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.export-field { display: flex; flex-direction: column; gap: 5px; }
.export-action-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.export-ready { display: grid; gap: 8px; }

.field-label { font-size: .8125rem; font-weight: 500; color: var(--text3); }
.field-input {
  width: 100%; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; padding: 8px 12px; color: var(--text1);
  font-family: inherit; font-size: .875rem; outline: none; transition: border-color 150ms; appearance: none;
}
.field-input:focus { border-color: var(--color-brand); }
.field-input::placeholder { color: var(--text4); }
select.field-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2368787d' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.field-hint { font-size: .75rem; color: var(--text4); }

/* Progress */
.progress-block { display: grid; gap: 6px; }
.progress-track { height: 4px; background: rgba(255,255,255,.07); border-radius: 100px; overflow: hidden; }
.progress-fill {
  height: 100%; background: linear-gradient(90deg,var(--color-brand) 0%,#38bcd5 100%);
  border-radius: 100px; animation: progress-shimmer 1.5s ease-in-out infinite; transition: width 400ms ease;
}
@keyframes progress-shimmer { 0%,100% { opacity: 1; } 50% { opacity: .65; } }

/* Backup */
.backup-status-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px; }
.stat-pair { display: grid; gap: 3px; }
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--text3); }
.stat-val { font-size: 1rem; font-weight: 600; color: var(--text1); }

/* Brief */
.brief-section { margin-bottom: 28px; display: grid; gap: 10px; }
.brief-card { padding: 18px; }
.brief-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.brief-day-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); }
.brief-headline { font-size: .9375rem; font-weight: 500; color: var(--text1); line-height: 1.45; }
.status-pill { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 100px; background: rgba(99,102,241,.12); color: #a5b4fc; }
.week-review-head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding-bottom: 10px; list-style: none; }
.week-review-head::-webkit-details-marker { display: none; }
.week-stats-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 14px; padding-top: 12px; }
.next-step { border-color: rgba(11,114,133,.3); background: rgba(11,114,133,.07); }
.next-step-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

/* Modal improvements */
.modal-title { font-size: 1.125rem; font-weight: 600; color: var(--text1); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.modal--wide { max-width: 620px; max-height: 85vh; overflow-y: auto; }

.token-warning-banner {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-radius: 8px; background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.2);
  font-size: .8125rem; color: var(--warning-lt); margin-bottom: 12px;
}
.token-reveal-block {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.25); border: 1px solid var(--color-brand-glow);
  border-radius: 10px; padding: 12px 14px;
}
.token-reveal-text {
  flex: 1; font-family: var(--font-mono);
  font-size: .78rem; color: var(--color-link); word-break: break-all; user-select: all;
}
.token-copy-btn {
  flex-shrink: 0; background: var(--color-brand-soft); border: 1px solid var(--color-brand-glow);
  border-radius: 6px; color: var(--color-link); font-size: .8rem; font-weight: 600;
  padding: 5px 12px; cursor: pointer; font-family: inherit; transition: all 150ms;
}
.token-copy-btn:hover { background: var(--color-brand); color: white; }

.radio-group { display: grid; gap: 8px; }
.radio-option { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.06); cursor: pointer; transition: background 150ms; }
.radio-option:hover { background: rgba(255,255,255,.03); }
.radio-option span { display: flex; flex-direction: column; gap: 2px; }
.checkbox-label { display: flex; align-items: center; gap: 10px; font-size: .875rem; color: var(--text2); cursor: pointer; margin: 12px 0; }

/* Responsive */
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: relative; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid rgba(255,255,255,.06); }
  .sidebar-brand { border-bottom: none; padding: 14px 16px; }
  .sidebar-identity { display: none; }
  .sidebar-nav { flex-direction: row; flex: 1; flex-wrap: wrap; gap: 2px; padding: 8px; }
  .snav-link { padding: 7px 10px; font-size: .8125rem; }
  .snav-link--active::before { display: none; }
  .sidebar-footer { border-top: none; padding: 8px; }
  .app-main { padding: 20px 16px 40px; }
  .export-controls { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .backup-status-row { grid-template-columns: 1fr; }
}

.text-muted { color: var(--text3); }
.align-center { align-items: center; }

/* ── Admin Design System ──────────────────────────────────── */

/* Teal aliases (explicit names for admin surfaces) */
:root {
  --color-teal-primary: var(--color-brand);
  --color-teal-dark:    var(--color-brand-strong);
  --color-teal-light:   var(--color-link);
}

/* ── Admin Badge ── */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.admin-badge-ops      { background: var(--color-brand-soft);       color: var(--color-link); }
.admin-badge-security { background: rgba(239, 68, 68, 0.12);       color: var(--danger-lt); }
.admin-badge-product  { background: rgba(34, 197, 94, 0.12);       color: var(--success-lt); }
.admin-badge-finance  { background: rgba(245, 158, 11, 0.12);      color: var(--warning-lt); }
.admin-badge-support  { background: rgba(139, 92, 246, 0.12);      color: var(--purple-lt); }

/* ── Role Chips ── */
.role-chip { padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.role-super_admin { background: rgba(239, 68, 68, 0.15);  color: var(--danger-lt); }
.role-admin       { background: var(--color-brand-soft);  color: var(--color-link); }
.role-operator    { background: rgba(245, 158, 11, 0.12); color: var(--warning-lt); }
.role-security    { background: rgba(239, 68, 68, 0.10);  color: var(--danger-lt); }
.role-viewer      { background: var(--bg3);               color: var(--text3); }

/* ── Access Reason Modal ── */
.access-reason-modal {
  background: var(--bg1);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  padding: 1.5rem;
}
.access-reason-modal textarea {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  color: var(--text1);
  border-radius: 4px;
  width: 100%;
  padding: 0.5rem;
  font-family: inherit;
  resize: vertical;
}
.access-reason-modal textarea:focus {
  border-color: var(--color-brand);
  outline: none;
  box-shadow: 0 0 0 2px var(--color-brand-soft);
}

/* ── Audit Log Table ── */
.audit-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.audit-table th {
  color: var(--text3);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--bg3);
  text-align: left;
}
.audit-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--bg2);
  color: var(--text2);
}
.audit-table tr:hover td { background: var(--bg2); }

/* ── Performance Metric Card ── */
.perf-metric {
  background: var(--bg1);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
.perf-metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text1);
  font-variant-numeric: tabular-nums;
}
.perf-metric-label {
  font-size: 0.75rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.perf-metric-trend-up   { color: var(--danger);  font-size: 0.8rem; }
.perf-metric-trend-down { color: var(--success); font-size: 0.8rem; }

/* ── Admin Alert Banners ── */
.admin-alert {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.875rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
}
.admin-alert-warning {
  background: rgba(245, 158, 11, 0.10);
  border-left: 3px solid var(--warning);
  color: var(--warning);
}
.admin-alert-error,
.admin-alert-danger {
  background: rgba(239, 68, 68, 0.10);
  border-left: 3px solid var(--danger);
  color: var(--danger);
}
.admin-alert-success {
  background: rgba(34, 197, 94, 0.10);
  border-left: 3px solid var(--success);
  color: var(--success);
}
.admin-alert-info {
  background: var(--color-brand-soft);
  border-left: 3px solid var(--color-brand);
  color: var(--color-link);
}

/* ── Admin Tab Navigation (Session 6) ── */
.admin-tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--bg3);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-tab-nav::-webkit-scrollbar { display: none; }

.admin-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text3);
  cursor: pointer;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.admin-tab:hover { color: var(--text1); }
.admin-tab.active {
  color: var(--color-brand);
  border-bottom-color: var(--color-brand);
  font-weight: 600;
}

/* ── Active Sessions Panel (Session 6) ── */
.admin-sessions-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Alert Banner Zone (Session 6) ── */
.admin-alert-zone {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* ── Role Matrix Table (Session 6) ── */
.role-matrix-table th:not(:first-child),
.role-matrix-table td:not(:first-child) {
  text-align: center;
  width: 80px;
}

/* ── Roles List (Session 6) ── */
.roles-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ── Help Page Concept Cards ── */
.help-concept-card { margin-bottom: 16px; }
.help-try-block {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 12px;
}
.help-try-command {
  flex: 1;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  color: var(--text1);
  background: none;
  border: none;
  white-space: pre-wrap;
  word-break: break-word;
}
.help-copy-btn { flex-shrink: 0; }
.mt-6 { margin-top: 6px; }
.help-footer-section {
  border-top: 1px solid var(--bg3);
  padding-top: 32px;
  margin-top: 32px;
}
.help-footer-note {
  text-align: center;
  color: var(--text2);
}

/* ── Feedback Admin Panel ── */
.admin-feedback-filters {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg2);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.admin-feedback-filters .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-feedback-filters .form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-feedback-filters .form-input {
  padding: 8px 12px;
  background: var(--bg1);
  border: 1px solid var(--border-md);
  border-radius: 4px;
  color: var(--text1);
  font-size: 14px;
}

.admin-feedback-filters #feedback-apply-filters-btn {
  align-self: flex-end;
  margin-top: 24px;
}

.feedback-table {
  width: 100%;
  border-collapse: collapse;
}

.feedback-table thead th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--text2);
  background: var(--bg2);
  border-bottom: 1px solid var(--border-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feedback-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
}

.feedback-table tbody tr:hover {
  background-color: var(--bg2);
}

.feedback-table {
  table-layout: fixed;
}

.feedback-table thead th:nth-child(1) { width: 160px; }
.feedback-table thead th:nth-child(2) { width: 130px; }
.feedback-table thead th:nth-child(3) { width: auto; }
.feedback-table thead th:nth-child(4) { width: 110px; }
.feedback-table thead th:nth-child(5) { width: 80px; }

.feedback-table tbody td {
  padding: 8px 12px;
  color: var(--text1);
  font-size: 13px;
  height: 36px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-profile {
  font-weight: 600;
  color: var(--color-link);
}

.feedback-message {
  color: var(--text2);
}

.feedback-date {
  color: var(--text3);
  font-size: 12px;
}

.feedback-audit-btn {
  padding: 4px 8px;
  font-size: 12px;
  border: none;
  background: var(--bg3);
  color: var(--color-link);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.feedback-audit-btn:hover {
  background: var(--color-brand-soft);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-sm {
  padding: 2px 6px;
  font-size: 11px;
}

/* ── Admin modal card (used inside .modal-overlay in admin pages) ── */
.modal-content {
  background: var(--bg1);
  border: 1px solid var(--border-md);
  border-radius: 8px;
  max-width: 600px;
  max-height: 80vh;
  width: 90%;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.modal-content .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-content .modal-header .t-h2 {
  margin: 0;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  color: var(--text1);
}

.modal-body {
  padding: 20px;
}

/* ── Audit Timeline ── */
.audit-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.audit-event {
  padding: 12px;
  background: var(--bg2);
  border-left: 3px solid var(--color-brand);
  border-radius: 4px;
}

.audit-event-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.audit-event-time {
  font-size: 12px;
  color: var(--text3);
  font-family: var(--font-mono, monospace);
}

.audit-event-type {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-link);
}

.audit-event-admin {
  font-size: 12px;
  color: var(--text2);
  padding: 2px 6px;
  background: var(--bg3);
  border-radius: 3px;
}

.audit-event-detail {
  font-size: 12px;
  color: var(--text2);
  margin-top: 4px;
  font-family: var(--font-mono, monospace);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .admin-feedback-filters {
    grid-template-columns: 1fr;
  }

  .admin-feedback-filters #feedback-apply-filters-btn {
    margin-top: 0;
  }

  .feedback-table {
    font-size: 12px;
  }

  .feedback-table tbody td {
    padding: 8px;
  }

  .feedback-message {
    max-width: 150px;
  }

  .modal-content {
    width: 95%;
    max-height: 90vh;
  }
}


/* Analytics tab */
.kpi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 8px;
}

.kpi-card {
  flex: 1 1 140px;
  background: var(--surface-alt, #f8f8f8);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  padding: 12px 16px;
}

.kpi-label {
  font-size: 11px;
  color: var(--text3, #888);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text1, #111);
  line-height: 1;
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
  margin-top: 8px;
}

.trend-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.trend-bar {
  background: var(--accent, #0B7285);
  width: 100%;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  transition: height 0.2s ease;
  cursor: default;
  position: relative;
}

.trend-bar[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-dark, #222);
  color: #fff;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

.trend-label {
  font-size: 10px;
  color: var(--text3, #888);
  margin-top: 4px;
  text-align: center;
}

.never-active-panel {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.never-filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* Capacity tab */
.subtab-pills {
  display: flex;
  gap: 0.5rem;
  margin-top: 12px;
}

.subtab-pill {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--border, #e0e0e0);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2, #444);
  transition: background 0.15s, color 0.15s;
}

.subtab-pill.active,
.subtab-pill:hover {
  background: var(--accent, #0B7285);
  color: #fff;
  border-color: var(--accent, #0B7285);
}

.nested-table-row td {
  background: var(--surface-alt, #f8f8f8);
  padding-left: 2rem;
}

.drill-spinner {
  display: inline-block;
  padding: 8px;
  color: var(--text3, #888);
  font-size: 12px;
}

.sortable-col:hover {
  background: var(--surface-alt, #f8f8f8);
}


/* ── Breadcrumb ─────────────────────────────────────────────────────────────── */
.breadcrumb {
  margin-bottom: 12px;
}
.breadcrumb-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.breadcrumb-list::-webkit-scrollbar { display: none; }
.breadcrumb-item { display: flex; align-items: center; }
.breadcrumb-sep {
  margin: 0 6px;
  color: var(--text4, #5a6a70);
  font-size: 0.75rem;
  user-select: none;
}
.breadcrumb-link {
  font-size: 0.8125rem;
  color: var(--text3, #8a9ca0);
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb-link:hover { color: var(--color-brand, #0B7285); }
.breadcrumb-current {
  font-size: 0.8125rem;
  color: var(--text2, #b4c3c6);
  font-weight: 500;
}

/* What's New page (moved from inline styles for CSP compatibility) */
.whats-new-page .release-block { margin-bottom: 48px; }
.whats-new-page .release-date {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3, #888);
  margin-bottom: 6px;
}
.whats-new-page .release-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text1, #f0f0f5);
  margin-bottom: 10px;
  line-height: 1.3;
}
.whats-new-page .release-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}
.whats-new-page .tag-new { background: rgba(124,109,255,.15); color: #a89dff; }
.whats-new-page .tag-improved { background: rgba(52,211,153,.12); color: #6ee7b7; }
.whats-new-page .release-body {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text2, #bbb);
}
.whats-new-page .release-body strong { color: var(--text1, #f0f0f5); }
.whats-new-page .release-body-spaced { margin-top: 14px; }
.whats-new-page .release-divider {
  border: none;
  border-top: 1px solid var(--bg3, #2a2a35);
  margin: 40px 0;
}
.whats-new-page .whats-new-meta {
  font-size: 0.8125rem;
  color: var(--text3, #888);
  margin-bottom: 40px;
}
.whats-new-page .release-group-header {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3, #888);
  border-bottom: 1px solid var(--bg3, #2a2a35);
  padding-bottom: 8px;
  margin-top: 48px;
  margin-bottom: 32px;
}
