@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=DM+Sans:wght@300;400;500;600;700&display=swap');

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

:root {
  --primary:       #f59e0b;
  --primary-h:     #d97706;
  --bg:            #0c0e14;
  --surface:       rgba(255,255,255,0.04);
  --surface-2:     rgba(255,255,255,0.07);
  --surface-hover: rgba(245,158,11,0.08);
  --border:        rgba(255,255,255,0.08);
  --border-2:      rgba(255,255,255,0.14);
  --text:          #fff;
  --muted:         rgba(255,255,255,0.4);
  --success:       #22c55e;
  --error:         #ef4444;
  --amber:         #f59e0b;
  --radius:        8px;
  --shadow:        0 4px 24px rgba(0,0,0,0.5);
  --tint-bg:       rgba(245,158,11,0.1);
  --tint-text:     #f59e0b;
  --tint-border:   rgba(245,158,11,0.25);
  --popup-bg:      #1c1f2b;
  --font:          'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:     'DM Sans', sans-serif;
  --font-display:  'Barlow Condensed', sans-serif;

  /* ── Design System v2 tokens ───────────────────────────────
   * Use these in NEW work and during migration. Existing styles
   * keep working with the original tokens above.
   * --------------------------------------------------------- */

  /* Spacing scale — pick from these, nothing in between */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Type scale */
  --text-xs:   0.72rem;  /* captions, micro labels */
  --text-sm:   0.82rem;  /* body small */
  --text-base: 0.92rem;  /* default body */
  --text-md:   1rem;     /* emphasized body */
  --text-lg:   1.15rem;  /* h3 / card headings */
  --text-xl:   1.4rem;   /* h2 / section headings */
  --text-2xl:  1.75rem;  /* h1 / page headings */
  --text-3xl:  2.4rem;   /* hero numbers */
  --leading-tight:  1.2;
  --leading-normal: 1.5;
  --leading-loose:  1.7;

  /* Radius scale */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-full: 9999px;

  /* Elevation — biggest "plain → polished" lever */
  --elev-0: none;
  --elev-1: 0 1px 2px rgba(0,0,0,0.25), 0 1px 3px rgba(0,0,0,0.15);
  --elev-2: 0 4px 8px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.2);
  --elev-3: 0 12px 24px rgba(0,0,0,0.45), 0 4px 8px rgba(0,0,0,0.25);
  --elev-4: 0 24px 48px rgba(0,0,0,0.55), 0 8px 16px rgba(0,0,0,0.3);
  /* Inner glow for focused inputs */
  --glow-focus: 0 0 0 3px rgba(245,158,11,0.18);

  /* Transitions */
  --t-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 180ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 280ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Semantic colors (with bg/border companions for badges + alerts) */
  --c-success:        #22c55e;
  --c-success-bg:     rgba(34,197,94,0.12);
  --c-success-border: rgba(34,197,94,0.32);
  --c-danger:         #ef4444;
  --c-danger-bg:      rgba(239,68,68,0.12);
  --c-danger-border:  rgba(239,68,68,0.32);
  --c-warn:           #f59e0b;
  --c-warn-bg:        rgba(245,158,11,0.12);
  --c-warn-border:    rgba(245,158,11,0.32);
  --c-info:           #60a5fa;
  --c-info-bg:        rgba(96,165,250,0.12);
  --c-info-border:    rgba(96,165,250,0.32);
  --c-neutral:        rgba(255,255,255,0.6);
  --c-neutral-bg:     rgba(255,255,255,0.06);
  --c-neutral-border: rgba(255,255,255,0.14);

  /* Z-index scale (so we stop guessing) */
  --z-dropdown: 1000;
  --z-sticky:   1100;
  --z-modal:    2000;
  --z-popover:  3000;
  --z-toast:    4000;
}

[data-theme="light"] {
  --elev-1: 0 1px 2px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.08);
  --elev-2: 0 4px 8px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --elev-3: 0 12px 24px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.05);
  --elev-4: 0 24px 48px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.06);
  --glow-focus: 0 0 0 3px rgba(217,119,6,0.2);
  --c-neutral:        rgba(0,0,0,0.55);
  --c-neutral-bg:     rgba(0,0,0,0.05);
  --c-neutral-border: rgba(0,0,0,0.12);
}

/* ── Light theme ──────────────────────────────────────────── */
[data-theme="light"] {
  --primary:       #d97706;
  --primary-h:     #b45309;
  --bg:            #f9f6f0;
  --surface:       #ffffff;
  --surface-2:     #f3ede3;
  --surface-hover: rgba(217,119,6,0.06);
  --border:        rgba(0,0,0,0.09);
  --border-2:      rgba(0,0,0,0.15);
  --text:          #0f0f1a;
  --muted:         rgba(0,0,0,0.45);
  --success:       #16a34a;
  --error:         #dc2626;
  --amber:         #d97706;
  --shadow:        0 4px 24px rgba(0,0,0,0.08);
  --tint-bg:       rgba(217,119,6,0.08);
  --tint-text:     #b45309;
  --tint-border:   rgba(217,119,6,0.3);
  --popup-bg:      #ffffff;
}

[data-theme="light"] body { background: var(--bg); }

[data-theme="light"] .navbar {
  background: rgba(249,246,240,0.9);
  border-bottom-color: var(--border);
}

[data-theme="light"] .form-group input,
[data-theme="light"] .policy-input,
[data-theme="light"] .admin-search-wrap input,
[data-theme="light"] .ann-post-card textarea {
  background: #fff;
  border-color: rgba(0,0,0,0.15);
  color: var(--text);
}

[data-theme="light"] .form-group input::placeholder,
[data-theme="light"] .policy-input::placeholder,
[data-theme="light"] .admin-search-wrap input::placeholder { color: rgba(0,0,0,0.35); }

[data-theme="light"] .dash-card,
[data-theme="light"] .auth-card,
[data-theme="light"] .settings-card,
[data-theme="light"] .package-card,
[data-theme="light"] .ann-post-card,
[data-theme="light"] .ann-history-item,
[data-theme="light"] .update-card {
  background: #fff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

[data-theme="light"] .settings-sidebar { background: #f3ede3; }
[data-theme="light"] .settings-tab:hover { background: rgba(217,119,6,0.06); }
[data-theme="light"] .settings-tab.active { background: var(--tint-bg); }

[data-theme="light"] .policy-item { background: #f8f9fd; }
[data-theme="light"] .policy-item-input { background: #fff; }

[data-theme="light"] .recent-expand-btn { background: #fff; }
[data-theme="light"] .payment-summary    { background: #fff; }

[data-theme="light"] .tx-credit { color: #16a34a; }
[data-theme="light"] .tx-debit  { color: #dc2626; }

[data-theme="light"] .alert-error   { background: rgba(220,38,38,0.06);  color: #dc2626; border-color: rgba(220,38,38,0.25); }
[data-theme="light"] .alert-success { background: rgba(22,163,74,0.06);  color: #16a34a; border-color: rgba(22,163,74,0.25); }

[data-theme="light"] .required-banner { background: rgba(217,119,6,0.06); border-color: rgba(217,119,6,0.25); color: #d97706; }
[data-theme="light"] .policy-reminder { background: rgba(217,119,6,0.06); border-color: rgba(217,119,6,0.2);  color: #d97706; }
[data-theme="light"] .req-badge       { color: #dc2626; }
[data-theme="light"] .req-badge-ok    { color: #16a34a; }

[data-theme="light"] .symbiote-bar { background: #ede9fe; border-bottom-color: #c4b5fd; color: #5b21b6; }

[data-theme="light"] .ann-post-card h3,
[data-theme="light"] .settings-card h3,
[data-theme="light"] .dash-card h3 { color: rgba(0,0,0,0.45); }

/* ── Dark theme ───────────────────────────────────────────── */

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse 80% 40% at 50% 0%, rgba(245,158,11,0.07) 0%, transparent 65%);
  pointer-events: none;
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(10,10,15,0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  text-decoration: none;
}
.nav-brand span { color: var(--primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.875rem;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }

/* Navbar button readability — the default .btn-outline (muted text on
 * transparent bg) is too dim against the dark glassy navbar. Brighten
 * text + border, give a quiet surface background, lift accent on hover. */
.navbar .btn-outline {
  background: var(--surface-2);
  color: rgba(255,255,255,0.85);
  border-color: var(--border-2);
}
.navbar .btn-outline:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--primary);
}
/* User greeting span next to navbar — also lift its readability */
.navbar #user-greeting {
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: rgba(245,158,11,0.15);
  color: var(--primary);
  border-color: rgba(245,158,11,0.4);
}
.btn-primary:hover {
  background: rgba(245,158,11,0.25);
  border-color: var(--primary);
}

.btn-outline {
  background: transparent;
  color: var(--muted);
  border-color: var(--border-2);
}
.btn-outline:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.3);
  background: var(--surface-2);
}

.btn-large { padding: 0.7rem 2rem; font-size: 0.95rem; }
.btn-full  { width: 100%; text-align: center; padding: 0.7rem; }
.btn-sm    { padding: 0.3rem 0.75rem; font-size: 0.78rem; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  text-align: center;
  padding: 3rem 1.5rem;
}

.hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: 4px;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero-content p {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 2rem;
}

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Features ─────────────────────────────────────────────── */
.features {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 2rem 2rem 4rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2);
  padding: 2rem;
  text-align: center;
  width: 220px;
}

.feature-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.feature-card h3 { margin-bottom: 0.5rem; font-size: 0.95rem; letter-spacing: 0.5px; }
.feature-card p { color: var(--muted); font-size: 0.875rem; }

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* ── Auth pages ───────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.auth-theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 6px 10px;
  transition: all 0.15s;
  z-index: 10;
}
.auth-theme-toggle:hover { border-color: var(--primary); color: var(--text); }

.auth-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--elev-3);
}
[data-theme="light"] .auth-card {
  background: #fff;
  box-shadow: var(--elev-3);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header .nav-brand { display: block; margin-bottom: 1rem; font-size: 1.8rem; }
.auth-header h2 {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 0.3rem;
}
.auth-header p { color: var(--muted); font-size: 0.875rem; }

/* ── Form ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 0.4rem;
}

.form-group input {
  width: 100%;
  padding: 0.65rem 0.95rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  font-family: var(--font);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  background: var(--surface);
  color: var(--text);
}
.form-group input:hover  { border-color: rgba(255,255,255,0.22); }
.form-group input:focus  { border-color: var(--primary); box-shadow: var(--glow-focus); background: var(--surface-2); }
.form-group input::placeholder { color: var(--muted); }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
}

.alert-error   { background: rgba(239,68,68,0.08);  color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.alert-success { background: rgba(34,197,94,0.08);  color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.hidden { display: none !important; }

/* ── Auth switch link ─────────────────────────────────────── */
.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}
.auth-switch a { color: var(--primary); text-decoration: none; font-weight: 500; }

/* ── Dashboard ────────────────────────────────────────────── */
.dashboard { padding: 2.5rem 2rem; max-width: 1400px; margin: 0 auto; }

.dashboard-header { margin-bottom: 2rem; }
.dashboard-header h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}
.dashboard-header p { color: var(--muted); font-size: 0.9rem; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2);
  padding: 1.5rem;
  overflow: hidden;
  min-width: 0;
}

.dash-card h3 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 1rem;
}
.dash-card p  { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.5rem; }
.dash-card p strong { color: var(--text); }

/* ── Nav greeting ─────────────────────────────────────────── */
#user-greeting { font-size: 0.85rem; color: var(--muted); }

/* ── Recent activity cards ────────────────────────────────── */
.recent-card { display: flex; flex-direction: column; gap: 0; }

.recent-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.recent-card-header h3 { margin-bottom: 0; }

.recent-view-all {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  color: var(--primary);
  text-decoration: none;
  text-transform: uppercase;
}
.recent-view-all:hover { text-decoration: underline; }

.recent-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.recent-row:last-of-type { border-bottom: none; }

.recent-label { font-weight: 600; color: var(--text); font-family: var(--font-mono); font-size: 0.82rem; }
.recent-sub   { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.recent-date  { font-size: 0.72rem; color: var(--muted); white-space: nowrap; margin-left: 0.5rem; }

.recent-expand-btn {
  margin-top: 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  color: var(--muted);
  cursor: pointer;
  width: 100%;
  transition: all 0.12s;
}
.recent-expand-btn:hover { color: var(--primary); border-color: var(--tint-border); background: var(--tint-bg); }

/* ── Token badge (navbar) ─────────────────────────────────── */
.token-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--tint-bg);
  color: var(--tint-text);
  border: 1px solid var(--tint-border);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
a.token-badge:hover {
  background: var(--tint-border);
  border-color: var(--tint-text);
}
/* Low-balance nudges on the nav wallet badge */
.token-badge.balance-low {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.5);
}
a.token-badge.balance-low:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: #f59e0b;
}
.token-badge.balance-empty {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.5);
}
a.token-badge.balance-empty:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: #f87171;
}

/* ── Token Wallet card ────────────────────────────────────── */
.token-wallet-card { text-align: center; }

.wallet-balance {
  font-family: var(--font-display);
  font-size: 3.5rem;
  letter-spacing: 2px;
  color: var(--primary);
  line-height: 1.1;
  margin-top: 0.5rem;
}

.wallet-label {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

/* ── Batch card ───────────────────────────────────────────── */
.batch-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1.5rem;
}

.batch-btn-primary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--primary);
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: calc(var(--radius) * 2);
  padding: 1.25rem 2.5rem;
  width: 100%;
  transition: all 0.15s;
}
.batch-btn-primary:hover {
  background: rgba(245,158,11,0.15);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.batch-icon { font-size: 2.5rem; line-height: 1; }

.batch-label {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.tx-credit { color: #4ade80; font-weight: 600; }
.tx-debit  { color: #f87171; font-weight: 600; }

/* ── Payment page ─────────────────────────────────────────── */
.payment-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.payment-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.payment-header h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.payment-header p { color: var(--muted); margin-bottom: 1rem; }

.current-balance-pill {
  display: inline-block;
  background: var(--tint-bg);
  color: var(--tint-text);
  border: 1px solid var(--tint-border);
  border-radius: 999px;
  padding: 0.35rem 1.1rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  transition: transform 0.2s;
}
.current-balance-pill.pulse { transform: scale(1.08); }

/* ── Package cards ────────────────────────────────────────── */
.package-grid {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.package-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-4);
  width: 210px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base), background var(--t-base);
  box-shadow: var(--elev-1);
}

.package-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  background: var(--surface-2);
  box-shadow: var(--elev-3);
}

.package-card.selected {
  border-color: var(--primary);
  background: var(--tint-bg);
  box-shadow: var(--elev-2), 0 0 0 2px rgba(245,158,11,0.2);
}

.package-card.popular {
  border-color: rgba(245,158,11,0.4);
  box-shadow: var(--elev-2);
}

.popular-tag {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  text-transform: uppercase;
}

.package-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.package-tokens {
  font-family: var(--font-display);
  font-size: 3.5rem;
  letter-spacing: 2px;
  color: var(--text);
  line-height: 1;
}

.package-label {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.package-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.package-note {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Payment form ─────────────────────────────────────────── */
.payment-form-wrap {
  max-width: 460px;
  margin: 0 auto;
}

.payment-summary {
  text-align: center;
  color: var(--muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--elev-1);
}

#payment-form h3 {
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.secure-tag {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--success);
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  letter-spacing: 0.5px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Settings layout ──────────────────────────────────────── */
.settings-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: calc(100vh - 58px);
  max-width: 1400px;
  margin: 0 auto;
  gap: 0;
}

/* ── Settings sidebar ─────────────────────────────────────── */
.settings-sidebar {
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  background: rgba(255,255,255,0.02);
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.75rem;
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.6rem 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: rgba(255,255,255,0.65);
  font-size: var(--text-sm);
  font-family: var(--font);
  letter-spacing: 0.02em;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all var(--t-fast);
  width: 100%;
}

.settings-tab:hover { background: var(--surface-2); color: var(--text); }
.settings-tab.active {
  background: var(--tint-bg);
  color: var(--primary);
  border-color: var(--tint-border);
  font-weight: 600;
  box-shadow: var(--elev-1);
}

.tab-icon { font-size: 0.95rem; }

/* ── Settings content ─────────────────────────────────────── */
.settings-content {
  padding: 2.5rem 2rem;
  overflow-y: auto;
}

.settings-panel { max-width: 860px; }

.settings-section-header { margin-bottom: 2rem; }
.settings-section-header h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}
.settings-section-header p { color: var(--muted); font-size: 0.875rem; margin-bottom: 0.75rem; }

/* ── Required badge ───────────────────────────────────────── */
.req-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(239,68,68,0.1);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  vertical-align: middle;
  margin-left: 0.4rem;
}

/* ── Required fields banner ───────────────────────────────── */
.required-banner {
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.25);
  color: #f59e0b;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.req-missing-item {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.policy-picker-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(99,102,241,0.05);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 8px;
}
.policy-picker-row label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.policy-picker-row select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.875rem;
  padding: 0.4rem 0.6rem;
}
.policy-picker-row select option {
  background: #1e2030;
  color: #e2e8f0;
}
[data-theme="light"] .policy-picker-row select option {
  background: #ffffff;
  color: #1a1a2e;
}

.policy-reminder {
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.2);
  color: #f59e0b;
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ── Settings card ────────────────────────────────────────── */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  box-shadow: var(--elev-1);
  transition: box-shadow var(--t-base);
}
.settings-card:hover { box-shadow: var(--elev-2); }

.settings-card h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.settings-card-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

/* ── Account info grid ────────────────────────────────────── */
.info-grid { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0; }

.info-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.info-row:last-child { border-bottom: none; }

.info-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: var(--muted);
  min-width: 110px;
}
.info-value { color: var(--text); }

/* ── Form helpers ─────────────────────────────────────────── */
.optional { color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.required  { color: var(--error); }

/* ── Location row ─────────────────────────────────────────── */
.location-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.input-hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.3rem;
  font-family: var(--font-mono);
}

/* ── Required badge — satisfied state ─────────────────────── */
.req-badge-ok {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(34,197,94,0.1);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  vertical-align: middle;
  margin-left: 0.4rem;
}

/* ── Shipping fixed fields ────────────────────────────────── */
.shipping-field-group { display: flex; flex-direction: column; gap: 1.75rem; }
.shipping-field-row   { display: flex; flex-direction: column; gap: 0.75rem; }

.shipping-field-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}

.preset-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.preset-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.btn-preset {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-preset:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(245,158,11,0.08);
}

.shipping-dims-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.shipping-dims-row .form-group {
  flex: 1;
  min-width: 180px;
  margin-bottom: 0;
}

.dims-inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.dims-inline input[type="number"] {
  width: 64px;
  text-align: center;
}

.dim-unit {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  margin-right: 0.35rem;
}

/* ── Policy list ──────────────────────────────────────────── */
.policy-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0;
}

.policy-list {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.policy-empty {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.5rem 0;
}

.policy-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.policy-item-text { flex: 1; color: var(--text); }

.policy-item-input {
  flex: 1;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--primary);
  border-radius: calc(var(--radius) * 0.6);
  font-size: 0.875rem;
  outline: none;
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.policy-item-actions { display: flex; gap: 0.25rem; }

/* ── Icon buttons ─────────────────────────────────────────── */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: calc(var(--radius) * 0.6);
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.12s, color 0.12s;
}
.btn-icon:hover        { background: var(--surface-2); color: var(--text); }
.btn-icon-save:hover   { background: rgba(34,197,94,0.15);  color: var(--success); }
.btn-icon-cancel:hover { background: rgba(239,68,68,0.12);  color: var(--error); }
.btn-icon-del:hover    { background: rgba(239,68,68,0.12);  color: var(--error); }

/* ── Policy add row ───────────────────────────────────────── */
.policy-add-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.policy-input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: var(--font);
  outline: none;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.policy-input:hover { border-color: rgba(255,255,255,0.22); }
.policy-input:focus { border-color: var(--primary); box-shadow: var(--glow-focus); background: var(--surface-2); }
.policy-input::placeholder { color: var(--muted); }

.policy-msg {
  margin-top: 0.6rem;
  font-size: 0.85rem;
}

/* ── Responsive ───────────────────────────────────────────── */

/* Navbar */
@media (max-width: 768px) {
  .navbar { padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .nav-brand { font-size: 1.2rem; letter-spacing: 2px; }
  .nav-links { gap: 0.4rem; flex-wrap: wrap; }
  #user-greeting { display: none; }
  .nav-links .token-badge { font-size: 0.72rem; padding: 0.2rem 0.6rem; }
  .btn { padding: 0.38rem 0.75rem; font-size: 0.78rem; }
  .btn-large { padding: 0.6rem 1.25rem; font-size: 0.88rem; }
}

/* Dashboard */
@media (max-width: 768px) {
  .dashboard { padding: 1.25rem 0.875rem; }
  .dashboard-header h1 { font-size: 1.75rem; letter-spacing: 2px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .wallet-balance { font-size: 2.75rem; }
  .batch-btn-primary { padding: 1rem 1.5rem; }
}

/* Settings */
@media (max-width: 680px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-sidebar { border-right: none; border-bottom: 1px solid var(--border); padding: 1rem 0; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; padding: 0 1rem; }
  .settings-tab { width: auto; }
  .settings-content { padding: 1.5rem 1rem; }
  .location-row { flex-direction: column; }
  .shipping-dims-row { flex-direction: column; }
  .shipping-dims-row .form-group { min-width: unset; }
  .settings-section-header h2 { font-size: 1.4rem; letter-spacing: 2px; }
}

/* Payment */
@media (max-width: 768px) {
  .payment-page { padding: 1.5rem 1rem 3rem; }
  .payment-header h1 { font-size: 1.75rem; letter-spacing: 2px; }
  .package-grid { flex-direction: column; align-items: center; }
  .package-card { width: 100%; max-width: 320px; }
  .form-row { grid-template-columns: 1fr; }
  .payment-form-wrap { padding: 0 0.25rem; }
}

/* Token history / Batch history */
@media (max-width: 768px) {
  .token-history-page,
  .batch-history-page { padding: 1.25rem 0.875rem; }
  .page-header h1 { font-size: 1.5rem; letter-spacing: 2px; }
}

/* Updates page */
@media (max-width: 768px) {
  .updates-page { padding: 1.5rem 0.875rem 3rem; }
  .updates-page h1 { font-size: 1.5rem; letter-spacing: 2px; }
}

/* Announcements banner */
@media (max-width: 768px) {
  .announcement-item { padding: 0.55rem 1rem; font-size: 0.8rem; }
}

/* Admin — acceptable desktop-only but basic fixes */
@media (max-width: 768px) {
  .admin-search-wrap { flex-wrap: wrap; }
  .ann-post-footer { flex-direction: column; align-items: flex-start; }
}

/* General touch target minimum */
@media (max-width: 768px) {
  button, .btn, a.btn {
    min-height: 36px;
  }
}

/* ── Symbiote (admin impersonation) banner ────────────────── */
.symbiote-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(124,58,237,0.2);
  border-bottom: 1px solid rgba(124,58,237,0.4);
  color: #c4b5fd;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  padding: 0.55rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 200;
}
.symbiote-bar button {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  padding: 0.25rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}
.symbiote-bar button:hover { background: rgba(255,255,255,0.18); }

/* ── Admin: login-as button ───────────────────────────────── */
.login-as-btn {
  background: var(--tint-bg);
  color: var(--primary);
  border: 1px solid var(--tint-border);
  border-radius: var(--radius);
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
}
.login-as-btn:hover { background: rgba(245,158,11,0.2); border-color: var(--primary); }

/* ── Admin: search bar ────────────────────────────────────── */
.admin-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.admin-search-wrap input {
  flex: 1;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: var(--font);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.admin-search-wrap input:focus { border-color: var(--primary); }
.admin-search-wrap input::placeholder { color: var(--muted); }

/* ── Admin: expandable batch list in panel ────────────────── */
.panel-expand-btn {
  margin-top: 0.5rem;
  background: transparent;
  color: var(--primary);
  border: none;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.panel-expand-btn:hover { color: var(--primary-h); }

/* ── Dark mode overrides (kept for compatibility) ─────────── */
[data-theme="dark"] .policy-reminder { color: #fde68a; }
[data-theme="dark"] .required-banner { color: #fbbf24; }
[data-theme="dark"] .req-badge       { color: #fca5a5; }
[data-theme="dark"] .req-badge-ok    { color: #86efac; }
[data-theme="dark"] .alert-error     { color: #fca5a5; }
[data-theme="dark"] .alert-success   { color: #86efac; }
[data-theme="dark"] .tx-credit       { color: #4ade80; }
[data-theme="dark"] .tx-debit        { color: #f87171; }

/* ── Theme toggle buttons (settings) ─────────────────────── */
.theme-toggle-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.theme-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
}
.theme-btn:hover { border-color: var(--primary); color: var(--text); }
.theme-btn-active {
  border-color: var(--primary);
  background: var(--tint-bg);
  color: var(--primary);
}

/* ── Announcement banner ──────────────────────────────────── */
.announcement-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1.5rem;
  background: rgba(245,158,11,0.06);
  border-bottom: 1px solid rgba(245,158,11,0.15);
  font-size: 0.85rem;
}
.announcement-item.announcement-update {
  background: rgba(34,197,94,0.06);
  border-bottom-color: rgba(34,197,94,0.15);
}
.announcement-content {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex: 1;
  flex-wrap: wrap;
}
.announcement-date {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  color: var(--primary);
  white-space: nowrap;
  text-transform: uppercase;
}
.announcement-item.announcement-update .announcement-date { color: var(--success); }
.announcement-msg { color: var(--text); line-height: 1.5; }
.announcement-close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.15rem 0.3rem;
  flex-shrink: 0;
  border-radius: 3px;
  line-height: 1;
}
.announcement-close:hover { color: var(--text); background: var(--surface-2); }

/* ── Dashboard footer ─────────────────────────────────────── */
.dashboard-footer {
  text-align: center;
  padding: 1rem 0 2.5rem;
}
.dashboard-footer a {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 2px;
  text-transform: lowercase;
}
.dashboard-footer a:hover { color: var(--primary); }

/* ── Admin: Announcements section ────────────────────────── */
.admin-section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 2.5rem;
}
.ann-post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.ann-post-card h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.ann-post-card textarea {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: var(--font);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  resize: vertical;
  outline: none;
  min-height: 80px;
  transition: border-color 0.15s;
}
.ann-post-card textarea:focus { border-color: var(--primary); }
.ann-post-card textarea::placeholder { color: var(--muted); }
.ann-post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.ann-update-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--muted);
}
.ann-update-toggle input[type="checkbox"] { accent-color: var(--primary); width: 1rem; height: 1rem; }
.ann-history-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.ann-history-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.ann-history-date {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 400;
}
.ann-type-badge {
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}
.ann-type-update   { background: rgba(34,197,94,0.1);   color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.ann-type-announce { background: var(--tint-bg); color: var(--tint-text); border: 1px solid var(--tint-border); }
.ann-history-msg   { font-size: 0.875rem; color: var(--text); line-height: 1.5; margin-bottom: 0.75rem; }
.ann-history-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ann-toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.12s;
}
.ann-toggle-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ── Settings: eBay updates link ──────────────────────────── */
.ebay-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.ebay-updates-link {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--muted);
  text-decoration: none;
}
.ebay-updates-link:hover { color: var(--primary); text-decoration: underline; }

/* ── Sidebar ──────────────────────────────────────────────── */
body.has-sidebar { padding-left: 180px; }

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 180px;
  height: 100vh;
  background: rgba(10,10,15,0.95);
  border-right: 1px solid var(--border);
  z-index: 99;
  display: flex;
  flex-direction: column;
  padding-top: 4rem;
  backdrop-filter: blur(12px);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  gap: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.sidebar-link.active {
  background: rgba(99,102,241,0.15);
  color: var(--accent);
}

.sidebar-icon {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  body.has-sidebar { padding-left: 0; }
  .sidebar { display: none; }
}

/* ── Updates page ─────────────────────────────────────────── */
.updates-page { max-width: 700px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.updates-page h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}
.updates-page .page-desc { color: var(--muted); margin-bottom: 2rem; font-size: 0.875rem; }
.update-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--success);
  border-radius: calc(var(--radius) * 1.5);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.update-card-date {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
  color: var(--success);
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}
.update-card-msg { font-size: 0.9rem; color: var(--text); line-height: 1.65; }
.updates-empty { text-align: center; padding: 4rem 2rem; color: var(--muted); }


/* ═══════════════════════════════════════════════════════════════
 * DESIGN SYSTEM EXTENSIONS (v2)
 * Use these in new work and during migration. Original styles
 * above keep working so this is purely additive.
 *
 * Quick reference:
 *   .surface, .surface-bordered, .surface-elevated  — card backgrounds
 *   .badge + .badge-{success|danger|warn|info|neutral}
 *   .input, .select, .textarea                       — form controls
 *   .btn-solid, .btn-danger                          — adds to existing .btn-*
 *   .stack-{2|3|4|5}                                 — vertical flex w/ gap
 *   .row-{2|3|4|5}                                   — horizontal flex w/ gap
 *   .cluster                                         — wrapping inline row
 *   .hover-lift                                      — 1px lift on hover
 *   .skeleton                                        — loading shimmer
 *   .focus-ring                                      — accessibility ring
 * ═══════════════════════════════════════════════════════════════ */

/* ── Surfaces ──────────────────────────────────────────────── */
.surface {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}
.surface-bordered {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}
.surface-elevated {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--elev-2);
}

/* ── Badge ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.5;
  font-family: var(--font);
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-success { color: var(--c-success); background: var(--c-success-bg); border-color: var(--c-success-border); }
.badge-danger  { color: var(--c-danger);  background: var(--c-danger-bg);  border-color: var(--c-danger-border); }
.badge-warn    { color: var(--c-warn);    background: var(--c-warn-bg);    border-color: var(--c-warn-border); }
.badge-info    { color: var(--c-info);    background: var(--c-info-bg);    border-color: var(--c-info-border); }
.badge-neutral { color: var(--c-neutral); background: var(--c-neutral-bg); border-color: var(--c-neutral-border); }
.badge-solid-warn    { color: #0c0e14; background: var(--c-warn);    border-color: var(--c-warn); }
.badge-solid-success { color: #0c0e14; background: var(--c-success); border-color: var(--c-success); }
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ── Form controls ─────────────────────────────────────────── */
.input,
.select,
.textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: var(--text-sm);
  font-family: var(--font);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.input::placeholder,
.textarea::placeholder { color: var(--muted); }
.input:hover,
.select:hover,
.textarea:hover { border-color: var(--border-2); }
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--glow-focus);
  background: var(--surface-2);
}
.input:disabled,
.select:disabled,
.textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.input-sm { padding: 0.35rem 0.55rem; font-size: var(--text-xs); }
.input-lg { padding: 0.7rem 0.95rem;  font-size: var(--text-base); }
.textarea { resize: vertical; min-height: 4.5rem; line-height: var(--leading-normal); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='rgba(255,255,255,0.5)' d='M6 8.5 1.5 4h9z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 10px;
  padding-right: 1.9rem;
}

/* Field with label */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.field-label {
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.field-help { font-size: var(--text-xs); color: var(--muted); }
.field-error { font-size: var(--text-xs); color: var(--c-danger); }

/* ── Button additions (extends existing .btn-* system) ────── */
.btn-solid {
  background: var(--primary);
  color: #0c0e14;
  border-color: var(--primary);
}
.btn-solid:hover {
  background: var(--primary-h);
  border-color: var(--primary-h);
}
.btn-danger {
  background: var(--c-danger-bg);
  color: var(--c-danger);
  border-color: var(--c-danger-border);
}
.btn-danger:hover {
  background: rgba(239,68,68,0.2);
  border-color: var(--c-danger);
}
.btn-success {
  background: var(--c-success-bg);
  color: var(--c-success);
  border-color: var(--c-success-border);
}
.btn-success:hover {
  background: rgba(34,197,94,0.2);
  border-color: var(--c-success);
}
/* Refined focus state for all buttons — pair with existing .btn class */
.btn:focus-visible { outline: none; box-shadow: var(--glow-focus); }

/* ── Layout helpers ────────────────────────────────────────── */
.stack-2 { display: flex; flex-direction: column; gap: var(--space-2); }
.stack-3 { display: flex; flex-direction: column; gap: var(--space-3); }
.stack-4 { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-5 { display: flex; flex-direction: column; gap: var(--space-5); }

.row-2 { display: flex; align-items: center; gap: var(--space-2); }
.row-3 { display: flex; align-items: center; gap: var(--space-3); }
.row-4 { display: flex; align-items: center; gap: var(--space-4); }
.row-5 { display: flex; align-items: center; gap: var(--space-5); }
.row-between { justify-content: space-between; }
.row-end     { justify-content: flex-end; }
.row-center  { justify-content: center; }

.cluster { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-3) 0;
  border: none;
}

/* ── Polish utilities ──────────────────────────────────────── */
.hover-lift {
  transition: transform var(--t-base), box-shadow var(--t-base);
  cursor: pointer;
}
.hover-lift:hover {
  transform: translateY(-1px);
  box-shadow: var(--elev-3);
}

.focus-ring:focus-visible {
  outline: none;
  box-shadow: var(--glow-focus);
}

@keyframes pp-fade-in  { from { opacity: 0; }                              to { opacity: 1; } }
@keyframes pp-slide-up { from { opacity: 0; transform: translateY(4px); }  to { opacity: 1; transform: translateY(0); } }
@keyframes pp-shimmer  { from { background-position: -400px 0; }           to { background-position: 400px 0; } }

.fade-in  { animation: pp-fade-in  var(--t-slow) ease-out both; }
.slide-up { animation: pp-slide-up var(--t-slow) ease-out both; }

/* Skeleton loader — replaces "Loading…" text */
.skeleton {
  display: inline-block;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 800px 100%;
  border-radius: var(--radius-sm);
  animation: pp-shimmer 1.4s ease-in-out infinite;
  color: transparent;
  user-select: none;
}
.skeleton-line     { height: 14px; width: 100%; margin: var(--space-2) 0; }
.skeleton-line-sm  { height: 10px; width: 60%; }
.skeleton-block    { height: 60px; width: 100%; }

/* ── Empty state ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-7) var(--space-4);
  color: var(--muted);
}
.empty-state-icon  { font-size: 2.5rem; margin-bottom: var(--space-3); opacity: 0.5; }
.empty-state-title { font-size: var(--text-lg); color: var(--text); font-weight: 600; margin-bottom: var(--space-2); }
.empty-state-sub   { font-size: var(--text-sm); margin-bottom: var(--space-4); max-width: 360px; margin-left: auto; margin-right: auto; line-height: var(--leading-normal); }

/* ── Typography helpers ────────────────────────────────────── */
.t-xs   { font-size: var(--text-xs); }
.t-sm   { font-size: var(--text-sm); }
.t-base { font-size: var(--text-base); }
.t-lg   { font-size: var(--text-lg); }
.t-xl   { font-size: var(--text-xl); }
.t-muted { color: var(--muted); }
.t-mono  { font-family: var(--font-mono); }
.t-tabular { font-variant-numeric: tabular-nums; }
.t-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.t-eyebrow {
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

/* ── Modal/dialog scaffolding (pair with fade-in/slide-up) ── */
.dialog-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: var(--z-modal);
  display: flex; align-items: flex-start; justify-content: center;
  padding: var(--space-6) var(--space-4);
  overflow-y: auto;
  animation: pp-fade-in var(--t-base) ease-out;
}
.dialog {
  background: var(--popup-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-4);
  width: 100%;
  max-width: 560px;
  padding: var(--space-5);
  animation: pp-slide-up var(--t-base) ease-out;
}
.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.dialog-title { font-size: var(--text-lg); font-weight: 700; line-height: var(--leading-tight); }
.dialog-sub   { font-size: var(--text-sm); color: var(--muted); margin-top: var(--space-1); }
.dialog-close {
  background: none; border: none; color: var(--muted);
  font-size: 1.2rem; cursor: pointer; padding: 0 6px; line-height: 1;
  border-radius: var(--radius-sm);
  transition: color var(--t-fast), background var(--t-fast);
}
.dialog-close:hover { color: var(--text); background: var(--surface-2); }

/* ════════════════════════════════════════════════════════════════
   POLISH LAYER — page transitions, hover micro-interactions, dropdown animations
   All gated on prefers-reduced-motion so accessibility users opt out automatically.
   ════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
  @keyframes mcbPageFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes mcbDropdownIn {
    from { opacity: 0; transform: translateY(-4px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
  @keyframes mcbModalIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
  }

  /* Page entry — runs once on load, every page */
  body {
    animation: mcbPageFadeIn 200ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Buttons — subtle lift on hover, gentle settle on press.
     Existing .btn already has `transition: all 0.15s` so transforms inherit it. */
  .btn:hover:not(:disabled),
  .btn-primary:hover:not(:disabled),
  .btn-outline:hover:not(:disabled),
  .btn-ghost:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  }
  .btn:active:not(:disabled),
  .btn-primary:active:not(:disabled),
  .btn-outline:active:not(:disabled),
  .btn-ghost:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: transform 60ms ease, box-shadow 60ms ease;
  }

  /* Cards — hover lift for dashboard and report cards (feels interactive) */
  .dash-card,
  .rpt-card,
  .settings-card {
    transition: transform var(--t-base, 180ms ease), box-shadow var(--t-base, 180ms ease), border-color var(--t-base, 180ms ease);
  }
  .dash-card:hover,
  .rpt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  }

  /* Export dropdowns — fade + slide-in when opened */
  .export-dropdown.open .export-dropdown-menu {
    animation: mcbDropdownIn 140ms cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top right;
  }

  /* Modal/overlay entries — soft scale-in for any dialog/modal */
  .listing-modal,
  .dialog,
  #bulk-comps-modal > div {
    animation: mcbModalIn 180ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Navigation links — smoother color/background transitions */
  .nav-links a,
  .nav-brand,
  .mcb-sidebar-link {
    transition: color var(--t-fast, 120ms ease), background var(--t-fast, 120ms ease), transform var(--t-fast, 120ms ease);
  }
  .nav-links a:hover {
    transform: translateY(-1px);
  }

  /* Input focus — subtle scale to confirm focus has landed */
  input:focus,
  select:focus,
  textarea:focus {
    transition: border-color var(--t-fast, 120ms ease), box-shadow var(--t-fast, 120ms ease), background var(--t-fast, 120ms ease);
  }
}

