/* ================================================================
   style.css — StatsPulse Analytics Dashboard
   Architecture: CSS Custom Properties → Base → Layout → Components
   ================================================================ */

/* ── 1. CSS Custom Properties (Design Tokens) ─────────────────── */
:root {
  /* Brand */
  --brand-primary:    #6366f1;   /* indigo */
  --brand-secondary:  #8b5cf6;   /* violet */
  --brand-teal:       #14b8a6;
  --brand-orange:     #f97316;

  /* Chart colors */
  --chart-blue:       rgba(99, 102, 241, 1);
  --chart-blue-fill:  rgba(99, 102, 241, 0.15);
  --chart-purple:     rgba(139, 92, 246, 1);
  --chart-purple-fill:rgba(139, 92, 246, 0.12);

  /* Backgrounds */
  --bg-base:          #0f0f13;
  --bg-surface:       #18181f;
  --bg-elevated:      #22222d;
  --bg-overlay:       rgba(0, 0, 0, 0.72);

  /* Text */
  --text-primary:     #f4f4f8;
  --text-secondary:   #9696ad;
  --text-muted:       #5a5a70;

  /* Borders */
  --border-subtle:    rgba(255, 255, 255, 0.06);
  --border-default:   rgba(255, 255, 255, 0.10);
  --border-strong:    rgba(255, 255, 255, 0.18);

  /* Shadows */
  --shadow-sm:        0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:        0 4px 12px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.4);
  --shadow-lg:        0 20px 50px rgba(0,0,0,0.6);

  /* Gradients */
  --gradient-brand:   linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-card:    linear-gradient(145deg, #1c1c26 0%, #18181f 100%);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:  'Fira Code', 'Cascadia Code', Consolas, monospace;
  --text-xs:    0.72rem;
  --text-sm:    0.85rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.25rem;
  --text-2xl:   1.5rem;
  --text-3xl:   2rem;

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow:   400ms ease;

  /* Layout */
  --container-max: 1280px;
  --navbar-h:      64px;
}

/* ── Light Mode Override ──────────────────────────────────────── */
[data-theme="light"] {
  --bg-base:       #f4f4f8;
  --bg-surface:    #ffffff;
  --bg-elevated:   #f0f0f5;
  --bg-overlay:    rgba(0, 0, 0, 0.55);

  --text-primary:  #1a1a2e;
  --text-secondary:#4a4a6a;
  --text-muted:    #8a8aaa;

  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-default:rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);

  --shadow-sm:     0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg:     0 20px 50px rgba(0,0,0,0.15);

  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8f8fc 100%);

  --chart-blue-fill:   rgba(99, 102, 241, 0.08);
  --chart-purple-fill: rgba(139, 92, 246, 0.08);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-base);
  min-height: 100vh;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; border: none; background: none; }
input, select { font: inherit; }
a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ── 3. Container ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* ── 4. Navbar ────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--navbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-slow);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-4);
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.navbar__logo {
  display: flex;
  align-items: center;
  color: var(--brand-primary);
  filter: drop-shadow(0 0 8px rgba(99,102,241,0.5));
}

.navbar__title {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ── 5. Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
}

.btn:hover::after { background: rgba(255,255,255,0.05); }
.btn:active::after { background: rgba(255,255,255,0.10); }

.btn--primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}
.btn--primary:hover {
  box-shadow: 0 6px 20px rgba(99,102,241,0.50);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
.btn--ghost:hover, .btn--ghost.active {
  background: rgba(99,102,241,0.12);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.btn--icon {
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
.btn--icon:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}

.btn--sm { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
.btn--full { width: 100%; }

/* Spinner inside button */
.btn__spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Range buttons group */
.control-group {
  display: flex;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-default);
}
.control-group .btn {
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--border-default);
}
.control-group .btn:last-child { border-right: none; }

/* ── 6. Select ────────────────────────────────────────────────── */
.select-wrapper { position: relative; }
.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
  font-size: 12px;
}

.select {
  appearance: none;
  padding: var(--space-2) var(--space-8) var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}

/* ── 7. Overlay / Login ───────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-overlay);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--space-4);
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-12);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: slideUp 0.35s ease;
}

.login-card__logo {
  display: flex;
  justify-content: center;
  color: var(--brand-primary);
  margin-bottom: var(--space-4);
  filter: drop-shadow(0 0 12px rgba(99,102,241,0.6));
}

.login-card__title {
  font-size: var(--text-3xl);
  font-weight: 700;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-2);
}

.login-card__sub {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
}

.form-group { text-align: left; margin-bottom: var(--space-5); }
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: var(--text-base);
  transition: all var(--transition-fast);
}
.form-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.form-input::placeholder { color: var(--text-muted); }

.form-hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); display: block; }

.form-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

/* ── 8. Main Layout ───────────────────────────────────────────── */
.main {
  padding-top: var(--space-8);
  padding-bottom: var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  position: relative;
}

/* ── 9. Loading & Error ───────────────────────────────────────── */
.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  background: rgba(15,15,19,0.7);
  border-radius: var(--radius-lg);
  min-height: 200px;
}

.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border-default);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.error-banner {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  color: #f87171;
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-sm);
}

/* ── 10. KPI Cards ────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

.kpi-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 60%);
  pointer-events: none;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card__icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-card__icon--blue   { background: rgba(99,102,241,0.15); color: #818cf8; }
.kpi-card__icon--purple { background: rgba(139,92,246,0.15); color: #a78bfa; }
.kpi-card__icon--teal   { background: rgba(20,184,166,0.15); color: #2dd4bf; }
.kpi-card__icon--orange { background: rgba(249,115,22,0.15); color: #fb923c; }

.kpi-card__body { flex: 1; min-width: 0; }
.kpi-card__label {
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}
.kpi-card__value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
  transition: color var(--transition-normal);
}

.kpi-card__trend {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* ── 11. Cards ────────────────────────────────────────────────── */
.card {
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal);
}

.card:hover { box-shadow: var(--shadow-md); }

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}

.card__title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ── 12. Chart Section ────────────────────────────────────────── */
.chart-section { }

.chart-wrapper {
  padding: var(--space-5) var(--space-6) var(--space-6);
  height: 280px;
  position: relative;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot--blue   { background: var(--chart-blue); }
.legend-dot--purple { background: var(--chart-purple); }

/* ── 13. Grid Layouts ─────────────────────────────────────────── */
.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.grid-three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

/* ── 14. Data Tables ──────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table thead th {
  padding: var(--space-3) var(--space-5);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table tbody td {
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  transition: background var(--transition-fast);
}
.data-table tbody tr:hover {
  background: rgba(255,255,255,0.025);
}

.table-url {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  color: var(--brand-primary);
  font-size: var(--text-xs);
}

.row-num {
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  width: 24px;
}

.bar-cell { display: flex; align-items: center; gap: var(--space-2); }
.mini-bar {
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  min-width: 4px;
  transition: width var(--transition-slow);
}

.empty-row { text-align: center; color: var(--text-muted); padding: var(--space-8) !important; }

/* ── 15. Bar Lists (Browser / OS / Device) ────────────────────── */
.bar-list {
  list-style: none;
  padding: var(--space-4) var(--space-6) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bar-item { }

.bar-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  margin-bottom: var(--space-1);
}

.bar-item__name { color: var(--text-primary); font-weight: 500; }
.bar-item__value { color: var(--text-muted); }

.bar-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* ── 16. Badge ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background: rgba(99,102,241,0.15);
  color: var(--brand-primary);
  font-size: var(--text-xs);
  font-weight: 600;
  min-width: 24px;
}

/* ── 17. Inline Code ──────────────────────────────────────────── */
.inline-code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  color: var(--brand-primary);
  word-break: break-all;
}

/* ── 18. Footer ───────────────────────────────────────────────── */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-6) 0;
  background: var(--bg-surface);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ── 19. Animations ───────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeIn 0.4s ease forwards;
}

.kpi-card__value.updated {
  animation: countUp 0.35s ease;
}

/* ── 20. Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-three { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --navbar-h: 56px; }

  .container { padding-inline: var(--space-4); }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid-two { grid-template-columns: 1fr; }
  .grid-three { grid-template-columns: 1fr; }

  .navbar__title { font-size: var(--text-lg); }
  .navbar__actions { gap: var(--space-2); }

  .login-card { padding: var(--space-8); }

  .chart-wrapper { height: 220px; }

  .footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card__value { font-size: var(--text-xl); }
}

/* ── 21. Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── 22. Focus visible (accessibility) ───────────────────────── */
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ════════════════════════════════════════════════════════════════
   v2 — Multi-Site Components
   ════════════════════════════════════════════════════════════════ */

/* ── 23. Site Switcher in Navbar ──────────────────────────────── */
.site-switcher-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ── 24. Modal Cards ──────────────────────────────────────────── */
.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card--wide { max-width: 600px; }

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

.modal-card__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  cursor: pointer;
  background: none;
  border: none;
  flex-shrink: 0;
}
.modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.modal-card__body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.modal-card__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

/* ── 25. Required field star ──────────────────────────────────── */
.required-star { color: #f87171; margin-left: 2px; }

/* ── 26. Snippet Modal ────────────────────────────────────────── */
.snippet-success-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(16,185,129,0.10);
  border: 1px solid rgba(16,185,129,0.25);
  color: #10b981;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
}

.snippet-meta {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.snippet-meta__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.snippet-meta__label {
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.snippet-meta__value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--brand-primary);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.snippet-instruction {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.snippet-instruction code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: var(--bg-elevated);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-primary);
}

.snippet-box {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.snippet-pre {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: #a78bfa;
  padding: var(--space-4) var(--space-10) var(--space-4) var(--space-4);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  line-height: 1.7;
}

.snippet-copy-btn {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* ── 27. View Header ──────────────────────────────────────────── */
.view-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.view-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.view-sub {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ── 28. Sites Breakdown Table link buttons ────────────────────── */
.btn--link {
  background: none;
  border: none;
  color: var(--brand-primary);
  font: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}
.btn--link:hover {
  background: rgba(99,102,241,0.10);
}

/* ── 29. Responsive additions ─────────────────────────────────── */
@media (max-width: 768px) {
  .site-switcher-wrap { flex-wrap: wrap; }
  .modal-card { max-width: 100%; }
  .modal-card--wide { max-width: 100%; }
  .snippet-meta { flex-direction: column; gap: var(--space-3); }
}

@media (max-width: 480px) {
  .modal-card__body { padding: var(--space-4); }
  .modal-card__footer { padding: var(--space-3) var(--space-4); }
  .modal-card__header { padding: var(--space-4); }
}
