:root {
  /* ── Core palette (vibrant refresh — names preserved) ── */
  --bg: #0a0e1a;
  --surface: #111827;
  --surface2: #1a2235;
  --border: rgba(255,255,255,0.08);
  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #64748b;
  --accent: #6366f1;
  --accent2: #8b5cf6;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --blue: #3b82f6;
  --purple: #a855f7;
  --pink: #ec4899;
  --cyan: #06b6d4;
  --orange: #f97316;
  --radius: 12px;
  --radius-sm: 8px;               /* EXISTING 8px — kept (referenced widely) */
  --shadow: 0 4px 24px rgba(0,0,0,.4);

  /* ── Gradients (NEW) ── */
  --grad-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
  --grad-green:   linear-gradient(135deg, #10b981, #06b6d4);
  --grad-orange:  linear-gradient(135deg, #f97316, #f59e0b);
  --grad-pink:    linear-gradient(135deg, #ec4899, #a855f7);
  --grad-blue:    linear-gradient(135deg, #3b82f6, #6366f1);
  --grad-cyan:    linear-gradient(135deg, #06b6d4, #3b82f6);

  /* ── Sidebar ── */
  --sidebar-width: 240px;
  --sidebar-bg: #080c18;
  --sidebar-border: rgba(255,255,255,0.06);
  --sidebar-item-hover: rgba(99,102,241,0.1);
  --sidebar-item-active: rgba(99,102,241,0.2);
  --sidebar-icon-size: 18px;

  /* ── Typography scale ── */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 36px;

  /* ── Spacing scale ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* ── Elevation — color-tinted shadows (NEW) ── */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-accent: 0 4px 20px rgba(99,102,241,0.3);
  --shadow-green: 0 4px 20px rgba(16,185,129,0.25);

  /* ── Border radius scale ── */
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* ── Status colors (vivid) ── */
  --status-waiting-bg: rgba(245,158,11,0.15);
  --status-waiting-text: #fbbf24;
  --status-waiting-border: rgba(245,158,11,0.3);
  --status-processing-bg: rgba(99,102,241,0.15);
  --status-processing-text: #a5b4fc;
  --status-processing-border: rgba(99,102,241,0.3);
  --status-solved-bg: rgba(16,185,129,0.15);
  --status-solved-text: #6ee7b7;
  --status-solved-border: rgba(16,185,129,0.3);

  /* ── Component tokens ── */
  --input-bg: rgba(255,255,255,0.04);
  --input-border: rgba(255,255,255,0.1);
  --input-focus-border: var(--accent);
  --input-focus-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  --table-header-bg: rgba(99,102,241,0.06);
  --table-row-hover: rgba(99,102,241,0.05);
  --table-border: rgba(255,255,255,0.06);
}

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

body {
  font-family: -apple-system,
    BlinkMacSystemFont, 'Inter',
    'Segoe UI', sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 0%,
      rgba(99,102,241,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%,
      rgba(139,92,246,0.06) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  font-size: var(--text-base);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track {
  background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 3px; }
::-webkit-scrollbar-thumb:hover {
  background: rgba(99,102,241,0.5); }

/* ── LOGIN ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%,
      rgba(99,102,241,.14) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%,
      rgba(139,92,246,.1) 0%, transparent 60%);
}

.login-card {
  width: 400px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.login-logo .icon {
  width: 44px; height: 44px;
  background: var(--grad-primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-accent);
}

.login-logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.login-logo span {
  font-size: 12px;
  color: var(--text2);
  display: block;
  margin-top: 1px;
}

.login-card h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: 6px;
}

.login-card p {
  color: var(--text2);
  font-size: var(--text-sm);
  margin-bottom: 28px;
}

.login-submit { margin-top: 8px; }

.login-foot {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text3);
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-size: var(--text-base);
  font-family: inherit;
  transition: border-color .2s,
    box-shadow .2s;
  outline: none;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: var(--input-focus-shadow);
}

.field input::placeholder {
  color: var(--text3);
}


.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-error {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.28);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16,185,129,.12);
  border: 1px solid rgba(16,185,129,.28);
  color: #6ee7b7;
}

.alert-warning {
  background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.30);
  color: #fcd34d;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1.2;
}

.btn:disabled,
.btn.is-disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(99,102,241,.4);
}

/* .btn-secondary — neutral filled alternative */
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(99,102,241,.3);
}

.btn-ghost {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(99,102,241,.3);
}

.btn-success {
  background: var(--grad-green);
  color: #fff;
  box-shadow: var(--shadow-green);
}

.btn-success:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(16,185,129,.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
}

.btn-danger:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(239,68,68,.35);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
}

/* .btn-lg */
.btn-lg {
  padding: 13px 24px;
  font-size: var(--text-md);
  border-radius: var(--radius-md);
}

/* .btn-block — full-width helper. */
.btn-block { width: 100%; }

.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  border-radius: 8px;
}

/* ── LAYOUT ── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
}

.sidebar-logo {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .app-icon {
  width: 36px; height: 36px;
  background: var(--grad-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow-accent);
}

.sidebar-logo h2 {
  font-size: var(--text-md);
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent2);
}

.sidebar-logo span {
  font-size: var(--text-xs);
  color: var(--text3);
  display: block;
}

.sidebar-section {
  padding: 20px 12px 8px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  padding: 0 8px;
  margin-bottom: 4px;
}

.sidebar-nav { flex: 1; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all .15s ease;
  margin-bottom: 1px;
  position: relative;
  border-left: 3px solid transparent;
}

.nav-item .nav-icon {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: var(--text-md);
  flex-shrink: 0;
  background: transparent;
  transition: background .15s, filter .15s;
}

.nav-item:hover {
  color: var(--text);
  background: var(--sidebar-item-hover);
  transform: translateX(2px);
}

.nav-item:hover .nav-icon {
  background: rgba(99,102,241,.12);
}

.nav-item.active {
  color: var(--accent2);
  background: var(--sidebar-item-active);
  border-left: 3px solid var(--accent);
}

.nav-item.active .nav-icon {
  background: rgba(99,102,241,.2);
  filter: drop-shadow(0 0 6px var(--accent));
}

.nav-badge {
  margin-left: auto;
  background: var(--grad-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(99,102,241,.4);
}

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

.sidebar-version {
  font-size: var(--text-xs);
  color: var(--text3);
  text-align: center;
  padding: 4px 0 12px;
  letter-spacing: .3px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.03);
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }

.user-info strong {
  display: block;
  font-size: var(--text-sm);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info span {
  font-size: var(--text-xs);
  color: var(--text3);
}

.user-pill a {
  color: var(--text3);
  text-decoration: none;
  font-size: 16px;
  transition: color .15s;
}

.user-pill a:hover { color: var(--red); }

/* ── MOBILE SIDEBAR (hamburger + off-canvas + backdrop) ── */
.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
  z-index: 90;
}

.sidebar-backdrop.open { display: block; }

/* ── MAIN ── */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  background: rgba(10,14,26,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title {
  flex: 1;
  min-width: 0;
}

.topbar-title h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.topbar-title p {
  font-size: 12px;
  color: var(--text2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.content {
  padding: 28px;
  flex: 1;
}

/* ── PAGE HEADER — title + subtitle + action row ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}
.page-header .page-header-text { min-width: 0; }
.page-header h1 {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -.3px;
}
.page-header .subtitle {
  font-size: var(--text-sm);
  color: var(--text2);
  margin-top: 4px;
}
.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--text3);
  margin-bottom: var(--space-3);
}
.breadcrumb a {
  color: var(--text2);
  text-decoration: none;
  transition: color .15s;
}
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { color: var(--text3); opacity: .6; }
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* ── STATS ── */
.stats-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(200px,1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s,
    transform .2s, box-shadow .2s;
}

/* Gradient accent bar across the top of every stat card */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-primary);
}
.stat-card.purple::before { background: var(--grad-primary); }
.stat-card.green::before  { background: var(--grad-green);   }
.stat-card.orange::before { background: var(--grad-orange);  }
.stat-card.yellow::before { background: var(--grad-orange);  }
.stat-card.pink::before   { background: var(--grad-pink);    }
.stat-card.blue::before   { background: var(--grad-blue);    }
.stat-card.cyan::before   { background: var(--grad-cyan);    }
.stat-card.red::before    { background: linear-gradient(135deg,#ef4444,#dc2626); }

.stat-card:hover {
  border-color: rgba(99,102,241,0.2);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

/* Colored icon tiles — supports both the color-on-card markup
   (.purple .stat-icon) and the direct .stat-icon.purple form. */
.purple .stat-icon, .stat-icon.purple {
  background: rgba(99,102,241,.15);
  box-shadow: 0 0 20px rgba(99,102,241,.2); }
.green .stat-icon, .stat-icon.green {
  background: rgba(16,185,129,.15);
  box-shadow: 0 0 20px rgba(16,185,129,.2); }
.blue .stat-icon, .stat-icon.blue {
  background: rgba(59,130,246,.15);
  box-shadow: 0 0 20px rgba(59,130,246,.2); }
.yellow .stat-icon, .stat-icon.yellow {
  background: rgba(245,158,11,.15);
  box-shadow: 0 0 20px rgba(245,158,11,.2); }
.orange .stat-icon, .stat-icon.orange {
  background: rgba(249,115,22,.15);
  box-shadow: 0 0 20px rgba(249,115,22,.2); }
.pink .stat-icon, .stat-icon.pink {
  background: rgba(236,72,153,.15);
  box-shadow: 0 0 20px rgba(236,72,153,.2); }
.cyan .stat-icon, .stat-icon.cyan {
  background: rgba(6,182,212,.15);
  box-shadow: 0 0 20px rgba(6,182,212,.2); }
.red .stat-icon, .stat-icon.red {
  background: rgba(239,68,68,.15);
  box-shadow: 0 0 20px rgba(239,68,68,.2); }

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--text);
  margin-bottom: 6px;
}

.stat-sub {
  font-size: 12px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Trend chip inside a stat-sub */
.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}
.stat-trend.up   { background: rgba(16,185,129,.14); color: var(--green); }
.stat-trend.down { background: rgba(239,68,68,.14);  color: #fca5a5; }
.stat-trend.flat { background: rgba(255,255,255,.05); color: var(--text3); }

/* ── CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}

.card:hover {
  border-color: rgba(99,102,241,0.2);
  box-shadow: var(--shadow-md);
}

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

.card-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.card-header .count {
  font-size: 13px;
  color: var(--text2);
  font-weight: 400;
}

.card-body { padding: 20px; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }

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

thead tr {
  border-bottom: 1px solid rgba(99,102,241,0.15);
}

th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  white-space: nowrap;
  background: var(--table-header-bg);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text2);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background .1s;
}

tbody tr:hover td {
  background: var(--table-row-hover);
  color: var(--text);
}

/* .data-table — full-width styled table wrapper. */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.data-table-wrap .data-table td { border-bottom: 1px solid var(--table-border); }
.data-table thead th { background: var(--table-header-bg); }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-nursing {
  background: rgba(59,130,246,.15);
  color: #93c5fd;
}
.badge-medicine {
  background: rgba(245,158,11,.15);
  color: #fcd34d;
}
.badge-pharmacy {
  background: rgba(16,185,129,.15);
  color: #6ee7b7;
}
.badge-dentistry {
  background: rgba(168,85,247,.15);
  color: #d8b4fe;
}
.badge-physiotherapy {
  background: rgba(239,68,68,.15);
  color: #fca5a5;
}
.badge-general {
  background: rgba(255,255,255,.08);
  color: var(--text2);
}
.badge-active {
  background: rgba(16,185,129,.15);
  color: var(--green);
}
.badge-inactive {
  background: rgba(255,255,255,.05);
  color: var(--text3);
}
.badge-pro {
  background: rgba(99,102,241,.15);
  color: var(--accent2);
}

/* ── STATUS BADGES (semantic — uses status tokens + glow) ── */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-status.waiting {
  background: var(--status-waiting-bg);
  color: var(--status-waiting-text);
  border-color: var(--status-waiting-border);
  box-shadow: 0 0 8px rgba(245,158,11,0.1);
}
.badge-status.processing {
  background: var(--status-processing-bg);
  color: var(--status-processing-text);
  border-color: var(--status-processing-border);
  box-shadow: 0 0 8px rgba(99,102,241,0.15);
}
.badge-status.solved {
  background: var(--status-solved-bg);
  color: var(--status-solved-text);
  border-color: var(--status-solved-border);
  box-shadow: 0 0 8px rgba(16,185,129,0.1);
}
.badge-status.unknown {
  background: var(--surface2);
  color: var(--text3);
  border-color: var(--border);
}

/* ── TABS ── */
.tab-nav {
  display: flex;
  gap: 2px;
  background: var(--surface2);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(99,102,241,.08);
}

.tab-btn.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

/* ── SEARCH / TOOLBAR ── */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrap input,
.search-input {
  width: 100%;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 9px 14px 9px 36px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.search-input-wrap input:focus,
.search-input:focus {
  border-color: var(--accent);
  box-shadow: var(--input-focus-shadow);
}

.search-input-wrap input::placeholder,
.search-input::placeholder {
  color: var(--text3);
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 14px;
  pointer-events: none;
}

.filter-select {
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  min-width: 160px;
  transition: border-color .2s, box-shadow .2s;
}

.filter-select:focus {
  border-color: var(--accent);
  box-shadow: var(--input-focus-shadow);
}

/* ── FILTER PILLS — horizontal pill button group ── */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  background: var(--surface2);
  border: 1px solid var(--border);
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.filter-pill:hover {
  color: var(--text);
  border-color: rgba(99,102,241,.3);
}
.filter-pill.active {
  background: var(--sidebar-item-active);
  color: var(--accent2);
  border-color: var(--status-processing-border);
}
.filter-pill .pill-count {
  opacity: .7;
  font-weight: 700;
}

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 640px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  animation: modalIn .2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.96)
    translateY(10px); }
  to   { opacity: 1; transform: scale(1)
    translateY(0); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  width: 32px; height: 32px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.modal-close:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: var(--surface);
}

/* ── FORM ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group { margin-bottom: 16px; }

.form-group label,
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select,
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s,
    box-shadow .2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: var(--input-focus-shadow);
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text3);
}

.form-group textarea,
.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-group select option,
.form-select option {
  background: var(--surface2);
}

.form-hint {
  font-size: 11px;
  color: var(--text3);
  margin-top: 5px;
}

/* ── PROGRESS BAR ── */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px rgba(99,102,241,0.4);
  transition: width .3s ease;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: .4;
}

.empty-state h3 {
  font-size: 16px;
  color: var(--text2);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  max-width: 280px;
  margin: 0 auto;
}

.empty-state .btn { margin-top: 16px; }

/* Toolbar sitting flush inside a card (below the card-header) */
.card-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

/* ── TOAST (global system) ── */
.toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast-container .toast { pointer-events: auto; }

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  box-shadow: var(--shadow-md);
  max-width: 340px;
  animation: toastIn .18s ease-out;
}
.toast--success { background: var(--grad-green); }
.toast--error   { background: linear-gradient(135deg,#ef4444,#dc2626); }
.toast--warning { background: var(--grad-orange); color: #1a1400; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SKILL PILLS ── */
.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.skill-listening {
  background: rgba(59,130,246,.15);
  color: #93c5fd;
}
.skill-reading {
  background: rgba(16,185,129,.15);
  color: #6ee7b7;
}
.skill-writing {
  background: rgba(245,158,11,.15);
  color: #fcd34d;
}
.skill-speaking {
  background: rgba(168,85,247,.15);
  color: #d8b4fe;
}

/* ── AVATAR — circular avatar with initials fallback ── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  background: var(--grad-primary);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.avatar-sm { width: 28px; height: 28px; font-size: var(--text-xs); }
.avatar.avatar-lg { width: 48px; height: 48px; font-size: var(--text-lg); }

/* ── GRID ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ── MISC ── */
.mono {
  font-family: 'SF Mono', 'Fira Code',
    monospace;
  font-size: 11px;
  color: var(--text3);
}

.text-muted { color: var(--text3); }
.text-sm { font-size: 12px; }

/* Strong / emphasised table cell + small semantic value helpers */
.td-strong { font-weight: 600; color: var(--text); }
.score-good { color: var(--green); font-weight: 600; }
.streak { color: var(--yellow); font-weight: 600; }

/* Profession breakdown rows (dashboard) */
.prof-row { margin-bottom: 14px; }
.prof-row:last-child { margin-bottom: 0; }
.prof-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.prof-count {
  font-size: 12px;
  color: var(--text2);
  font-weight: 600;
}
.prof-count .text-muted { font-weight: 400; }

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

/* .divider with an optional centered label */
.divider-labeled {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text3);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.divider-labeled::before,
.divider-labeled::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.dot-green { background: var(--green); }
.dot-red { background: var(--red); }
.dot-yellow { background: var(--yellow); }

.tooltip {
  position: relative;
}
.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
.tooltip:hover::after { opacity: 1; }

/* ── CATEGORY BADGES (ticket categories — subtle tinted text) ── */
.badge-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface2);
  color: var(--text2);
}
.badge-cat.account   { color: var(--blue); }
.badge-cat.payment   { color: var(--yellow); }
.badge-cat.content   { color: var(--accent2); }
.badge-cat.technical { color: #fca5a5; }
.badge-cat.other     { color: var(--text2); }

/* ── PAGINATION (generic) ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.pagination .range { font-size: 12px; color: var(--text3); }
.pagination .pages {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pagination .page-now { font-size: 12px; color: var(--text2); }

/* ── DETAIL VIEW (ticket detail header/meta) ── */
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.detail-subject {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}
.detail-body { padding: var(--space-4) var(--space-5); }
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) 14px;
  font-size: 12px;
  color: var(--text3);
  padding-bottom: 14px;
}
.detail-meta .mono { color: var(--text2); }
.detail-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4px 0 var(--space-4);
}
.detail-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: var(--space-3);
}

.detail-back { display: inline-flex; margin-bottom: var(--space-4); }

/* ── CONVERSATION THREAD (chat bubbles) ── */
.conv-thread {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.conv-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
}
.conv-row--user  { justify-content: flex-start; }
.conv-row--admin { justify-content: flex-end; }

/* Column holding the timestamp (above) + bubble; keeps them
   aligned to the correct side of the thread. */
.conv-col {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  min-width: 0;
}
.conv-row--user  .conv-col { align-items: flex-start; }
.conv-row--admin .conv-col { align-items: flex-end; }

/* Simple 32px circular avatars — icon only, no gradients. */
.conv-avatar {
  flex: 0 0 32px;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.conv-avatar--user  { background: rgba(255,255,255,0.1); }
.conv-avatar--admin { background: rgba(99,102,241,0.2); }

.conv-bubble {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.conv-bubble--user {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  color: var(--text);
}
.conv-bubble--admin {
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius) var(--radius) 0 var(--radius);
  box-shadow: 0 2px 12px rgba(99,102,241,0.1);
  color: var(--text);
}

/* Timestamp sits above the bubble, outside the box. */
.conv-time {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 4px;
}
.conv-empty { color: var(--text3); font-size: var(--text-sm); }

/* Inline save feedback (below a form) */
.inline-msg {
  font-size: 12px;
  font-weight: 600;
  margin-top: var(--space-3);
  min-height: 16px;
  text-align: center;
}
.inline-msg--success { color: var(--green); }
.inline-msg--error   { color: var(--red); }

/* ══════════════════════════════════════════
   CONTENT PAGE (content.php — tabs, tables, modals)
   ══════════════════════════════════════════ */
.tab-count { margin-left: 4px; font-size: 11px; color: var(--text3); }

/* Truncated title cell used across all content tables */
.cell-title {
  color: var(--text);
  font-weight: 500;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Toggle-active button keeps a stable width so the label swap
   (Activate / Deactivate) doesn't jitter the column */
.btn-toggle { min-width: 82px; }

/* Listening audio column */
.audio-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text3);
}
.audio-legend .ok { color: var(--green); }
.audio-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.audio-mp3-row { display: flex; align-items: center; gap: 6px; }
.audio-tag-ok { color: var(--green); font-weight: 600; font-size: 12px; }

/* Generate-with-AI modal */
.gen-status-box {
  padding: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 8px;
}
.gen-status-row { display: flex; align-items: center; gap: 12px; }
.gen-status-title { color: var(--text); font-size: 13px; font-weight: 600; }
.gen-status-sub { color: var(--text3); font-size: 12px; margin-top: 2px; }
.gen-result { margin-top: 16px; }

/* Script modal */
.script-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text3);
}
.script-bar a { color: var(--accent2); text-decoration: none; font-weight: 600; }
.script-textarea {
  width: 100%;
  height: 380px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.8;
  resize: none;
  outline: none;
}
.voice-guide {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(99,102,241,.06);
  border: 1px solid rgba(99,102,241,.15);
  border-radius: var(--radius-sm);
}
.voice-guide-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}
.voice-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
}
.voice-guide-grid .role { color: var(--text3); }

/* Add-audio modal */
.audio-testinfo {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.audio-testinfo .ico { font-size: 20px; }
.audio-testinfo-label { font-size: 11px; color: var(--text3); margin-bottom: 2px; }
.audio-testinfo-id {
  font-family: monospace;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}
.audio-steps {
  background: rgba(16,185,129,.05);
  border: 1px solid rgba(16,185,129,.15);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.audio-steps-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 8px;
}
.audio-steps ol {
  color: var(--text2);
  font-size: 12px;
  line-height: 2;
  padding-left: 16px;
  margin: 0;
}
.audio-steps a { color: var(--accent2); font-weight: 600; }
.audio-steps strong { color: var(--text); }
.audio-preview-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}
.audio-player { width: 100%; border-radius: var(--radius-sm); outline: none; }

/* Small shared spacing helpers + modal size modifiers */
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.modal.modal-sm { width: 500px; }
.modal.modal-lg { width: 720px; }

/* ══════════════════════════════════════════
   APP CONFIG (appconfig.php — toggles + grids)
   ══════════════════════════════════════════ */
.cfg-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.cfg-toggle-row:last-child { border-bottom: none; }
.cfg-toggle-row .lbl strong {
  display: block;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}
.cfg-toggle-row .lbl span { font-size: 12px; color: var(--text3); }

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px; height: 26px;
  flex-shrink: 0;
}
.switch input { display: none; }
.switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 26px;
  transition: all .2s;
}
.switch .slider::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; top: 3px;
  background: var(--text3);
  border-radius: 50%;
  transition: all .2s;
}
.switch input:checked + .slider {
  background: rgba(16,185,129,.2);
  border-color: var(--green);
}
.switch input:checked + .slider::before {
  transform: translateX(20px);
  background: var(--green);
}

.cfg-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .cfg-section-grid { grid-template-columns: 1fr; }
}

/* Right-aligned form action bar (bottom save row) */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 40px;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Off-canvas sidebar */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }

  .main { margin-left: 0; }

  .menu-toggle {
    display: inline-flex;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 101;      /* above sidebar (100) so it always toggles */
    box-shadow: var(--shadow-md);
  }

  /* clear space under the floating hamburger so the title never hides */
  .topbar { padding: 0 16px 0 64px; }
  .content { padding: 18px 16px; }

  .page-header h1 { font-size: var(--text-xl); }
  /* On pages that use .page-header (no topbar), push it below the
     fixed hamburger so the title never sits under the button. */
  .content > .page-header:first-child { margin-top: 40px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

  .modal-footer { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar-actions .btn { padding: 8px 12px; }
}
