/* ════════════════════════════════════════════════════════════════════
   MedMint Admin — extends the existing MedMint design system.
   Uses ONLY the same --mm-* tokens defined in tokens.css. No new colors.
   Targets Stripe / Vercel / Linear-quality polish while remaining
   recognizably MedMint (teal #166D72 + mint #2BC5B4).
   ════════════════════════════════════════════════════════════════════ */

/* ── Admin shell layout ──
   Reuses .app-shell + .main-pane from app.css but expands the sidebar to
   280px for the longer admin nav labels, and adds a faint mint top accent. */
.admin-shell { background: var(--mm-bg); }
.admin-shell .sidebar { width: 280px; min-width: 280px; }
.admin-shell::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--mm-teal-600), var(--mm-mint-400), var(--mm-teal-600));
  background-size: 200% 100%;
  animation: adminTopShine 6s ease infinite;
  z-index: 200; pointer-events: none;
}
@keyframes adminTopShine {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 0%; }
}

/* Sidebar admin badge — sits under the brand row */
.sidebar-admin-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: 1.2px;
  background: linear-gradient(135deg, var(--mm-teal-600), var(--mm-mint-400));
  color: #fff;
  padding: 4px 10px; border-radius: 20px; margin: 8px 0 6px 12px;
  box-shadow: 0 2px 8px rgba(22,109,114,0.25);
}
.sidebar-admin-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulseDot 1.8s ease infinite; }
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* "Back to user mode" pill in the sidebar footer */
.admin-exit-pill {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: var(--mm-teal-50); color: var(--mm-teal-700);
  border: 1px solid var(--mm-teal-100);
  border-radius: 10px; padding: 10px 14px;
  font-size: 12.5px; font-weight: 700;
  transition: all .15s;
}
.admin-exit-pill:hover { background: var(--mm-teal-100); transform: translateY(-1px); }
.admin-exit-pill svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }

/* ── Admin topbar ── */
.admin-topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px; min-height: 64px;
  background: var(--mm-surface);
  border-bottom: 1px solid var(--mm-border);
  flex-shrink: 0;
}
.admin-topbar-title { display: flex; flex-direction: column; gap: 1px; }
.admin-topbar-title .t { font-size: 17px; font-weight: 800; color: var(--mm-text); letter-spacing: -0.2px; }
.admin-topbar-title .s { font-size: 11.5px; color: var(--mm-text-3); font-weight: 600; }
.admin-topbar .grow { flex: 1; }

.admin-search {
  position: relative; width: 320px; max-width: 32vw;
}
.admin-search input {
  width: 100%; height: 40px; padding: 0 12px 0 38px;
  background: var(--mm-surface-2); border: 1px solid var(--mm-border);
  border-radius: 10px; color: var(--mm-text); font-size: 13px;
  transition: all .15s;
}
.admin-search input:focus { outline: none; border-color: var(--mm-teal-600); background: var(--mm-surface); box-shadow: 0 0 0 3px rgba(22,109,114,0.08); }
.admin-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; fill: var(--mm-text-3); pointer-events: none; }

.admin-icon-btn {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--mm-surface-2); color: var(--mm-text-2);
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: all .15s;
  border: 1px solid var(--mm-border);
}
.admin-icon-btn:hover { background: var(--mm-teal-50); color: var(--mm-teal-600); border-color: var(--mm-teal-100); }
.admin-icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.admin-icon-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mm-red-500); border: 2px solid var(--mm-surface);
}

.admin-clock {
  font-variant-numeric: tabular-nums;
  font-size: 13px; font-weight: 700; color: var(--mm-text-2);
  padding: 0 8px;
}

.admin-status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  padding: 5px 10px; border-radius: 20px;
  background: var(--mm-green-50); color: var(--mm-green-500);
}
.admin-status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulseDot 2s ease infinite; }

/* Profile menu dropdown */
.admin-profile-menu { position: relative; }
.admin-avatar-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--mm-surface-2); border: 1px solid var(--mm-border);
  border-radius: 12px; padding: 4px 10px 4px 4px;
  cursor: pointer; transition: all .15s;
}
.admin-avatar-btn:hover { background: var(--mm-teal-50); border-color: var(--mm-teal-100); }
.admin-avatar {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--mm-teal-600), var(--mm-mint-400));
  color: #fff; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.admin-avatar-btn .name { font-size: 13px; font-weight: 700; color: var(--mm-text); }
.admin-avatar-btn .chev { width: 14px; height: 14px; fill: var(--mm-text-3); }

.admin-menu-pop {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 260px; background: var(--mm-surface);
  border: 1px solid var(--mm-border); border-radius: 14px;
  box-shadow: var(--mm-shadow-lg);
  padding: 8px; z-index: 100;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.admin-menu-pop.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.admin-menu-pop .head { padding: 10px 12px; border-bottom: 1px solid var(--mm-border); margin-bottom: 6px; }
.admin-menu-pop .head .n { font-weight: 700; font-size: 13.5px; color: var(--mm-text); }
.admin-menu-pop .head .e { font-size: 11.5px; color: var(--mm-text-3); }
.admin-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--mm-text-2);
  transition: background .12s;
}
.admin-menu-item:hover { background: var(--mm-teal-50); color: var(--mm-teal-700); }
.admin-menu-item svg { width: 16px; height: 16px; fill: currentColor; opacity: 0.8; }
.admin-menu-item.danger { color: var(--mm-red-500); }
.admin-menu-item.danger:hover { background: var(--mm-red-50); }
.admin-menu-item.highlight {
  background: linear-gradient(135deg, var(--mm-teal-50), var(--mm-mint-50));
  color: var(--mm-teal-700);
}
.admin-menu-item.highlight:hover { background: linear-gradient(135deg, var(--mm-teal-100), var(--mm-mint-100)); }
.admin-menu-sep { height: 1px; background: var(--mm-border); margin: 6px 4px; }

/* ── Page content container ── */
.admin-content { padding: 22px 26px 40px; max-width: 1480px; margin: 0 auto; width: 100%; }
.admin-content.tight { max-width: 1120px; }
.admin-section { margin-bottom: 26px; }
.admin-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.admin-section-head .t { font-size: 13px; font-weight: 800; color: var(--mm-text); letter-spacing: 0.3px; text-transform: uppercase; }
.admin-section-head .s { font-size: 12px; color: var(--mm-text-3); }
.admin-section-head .grow { flex: 1; }

/* ── KPI cards (admin dashboard command center) ──
   Reference: Stripe Dashboard metric tiles.
   Each card has: large number, label, trend chip, mini sparkline, hover lift. */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
  position: relative; overflow: hidden;
  background: var(--mm-surface); border: 1px solid var(--mm-border);
  border-radius: 14px; padding: 18px 18px 14px;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  cursor: default;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--mm-shadow-md); border-color: var(--mm-teal-200); }
.kpi-card .label { font-size: 11px; font-weight: 700; color: var(--mm-text-3); letter-spacing: 0.6px; text-transform: uppercase; }
.kpi-card .value { font-size: 28px; font-weight: 800; color: var(--mm-text); margin: 6px 0 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }
.kpi-card .desc { font-size: 11.5px; color: var(--mm-text-3); }
.kpi-card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.kpi-card .ic {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.kpi-card .ic.teal   { background: var(--mm-teal-50);   color: var(--mm-teal-600); }
.kpi-card .ic.mint   { background: var(--mm-mint-50);   color: var(--mm-mint-500); }
.kpi-card .ic.gold   { background: var(--mm-gold-50);   color: var(--mm-gold-700); }
.kpi-card .ic.red    { background: var(--mm-red-50);    color: var(--mm-red-500); }
.kpi-card .ic.green  { background: var(--mm-green-50);  color: var(--mm-green-500); }
.kpi-card .ic.purple { background: var(--mm-purple-50); color: var(--mm-purple-500); }

.kpi-trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
}
.kpi-trend.up   { background: var(--mm-green-50); color: var(--mm-green-500); }
.kpi-trend.down { background: var(--mm-red-50);   color: var(--mm-red-500); }
.kpi-trend.flat { background: var(--mm-surface-2); color: var(--mm-text-3); }

.kpi-spark { margin-top: 10px; height: 30px; width: 100%; }

/* Status strip on top of card */
.kpi-card .status-strip { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--mm-teal-600); }
.kpi-card .status-strip.mint   { background: var(--mm-mint-400); }
.kpi-card .status-strip.gold   { background: var(--mm-gold-500); }
.kpi-card .status-strip.red    { background: var(--mm-red-500); }
.kpi-card .status-strip.green  { background: var(--mm-green-500); }
.kpi-card .status-strip.purple { background: var(--mm-purple-500); }

/* ── Admin panel (generic surface) ── */
.admin-panel {
  background: var(--mm-surface); border: 1px solid var(--mm-border);
  border-radius: 14px; padding: 18px;
}
.admin-panel-title { font-size: 13px; font-weight: 800; color: var(--mm-text); letter-spacing: 0.3px; text-transform: uppercase; margin-bottom: 4px; }
.admin-panel-subtitle { font-size: 12px; color: var(--mm-text-3); margin-bottom: 12px; }

/* ── Admin area chart container ── */
.admin-chart { width: 100%; height: 260px; display: block; }
.admin-chart.tall { height: 320px; }
.admin-chart.short { height: 200px; }

/* ── AI insights cards (admin dashboard row 3) ──
   Inspired by Linear's recommendation cards. */
.ai-insight {
  display: flex; gap: 12px; padding: 14px;
  background: var(--mm-surface); border: 1px solid var(--mm-border);
  border-left: 3px solid var(--mm-mint-400);
  border-radius: 12px; transition: all .18s;
}
.ai-insight:hover { transform: translateX(2px); box-shadow: var(--mm-shadow-sm); }
.ai-insight .ic {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--mm-teal-50), var(--mm-mint-50));
  color: var(--mm-teal-600); font-size: 18px;
}
.ai-insight.warn { border-left-color: var(--mm-gold-500); }
.ai-insight.warn .ic { background: var(--mm-gold-50); color: var(--mm-gold-700); }
.ai-insight.danger { border-left-color: var(--mm-red-500); }
.ai-insight.danger .ic { background: var(--mm-red-50); color: var(--mm-red-500); }
.ai-insight.success { border-left-color: var(--mm-green-500); }
.ai-insight.success .ic { background: var(--mm-green-50); color: var(--mm-green-500); }
.ai-insight .body { flex: 1; min-width: 0; }
.ai-insight .body .title { font-size: 13.5px; font-weight: 700; color: var(--mm-text); margin-bottom: 3px; }
.ai-insight .body .desc { font-size: 12.5px; color: var(--mm-text-2); line-height: 1.5; }
.ai-insight .body .action {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px; font-size: 12px; font-weight: 700;
  color: var(--mm-teal-600);
}
.ai-insight .body .action:hover { color: var(--mm-teal-700); }

/* ── Quick action cards (admin dashboard row 4) ──
   Inspired by Vercel's project tiles. */
.qa-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1100px) { .qa-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .qa-grid { grid-template-columns: 1fr; } }

.qa-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--mm-surface); border: 1px solid var(--mm-border);
  border-radius: 12px; padding: 16px;
  cursor: pointer; transition: all .18s; text-align: left;
  position: relative; overflow: hidden;
}
.qa-card::after {
  content: ""; position: absolute; top: 0; right: 0; width: 80px; height: 80px;
  background: radial-gradient(circle at top right, var(--mm-teal-50), transparent 70%);
  opacity: 0; transition: opacity .18s; pointer-events: none;
}
.qa-card:hover { transform: translateY(-2px); box-shadow: var(--mm-shadow-md); border-color: var(--mm-teal-200); }
.qa-card:hover::after { opacity: 1; }
.qa-card .ic {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--mm-teal-50); color: var(--mm-teal-600);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.qa-card.mint .ic { background: var(--mm-mint-50); color: var(--mm-mint-500); }
.qa-card.gold .ic { background: var(--mm-gold-50); color: var(--mm-gold-700); }
.qa-card.purple .ic { background: var(--mm-purple-50); color: var(--mm-purple-500); }
.qa-card.red .ic { background: var(--mm-red-50); color: var(--mm-red-500); }
.qa-card.green .ic { background: var(--mm-green-50); color: var(--mm-green-500); }
.qa-card .t { font-size: 13.5px; font-weight: 700; color: var(--mm-text); }
.qa-card .d { font-size: 11.5px; color: var(--mm-text-3); line-height: 1.4; }
.qa-card .arrow { position: absolute; bottom: 12px; right: 14px; opacity: 0; transition: all .18s; color: var(--mm-teal-600); }
.qa-card:hover .arrow { opacity: 1; transform: translateX(2px); }

/* ── Live activity feed (admin dashboard row 5) ──
   Vertical timeline with colored dots. */
.activity-feed { position: relative; padding-left: 20px; }
.activity-feed::before {
  content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 2px; background: var(--mm-border); border-radius: 1px;
}
.activity-row {
  position: relative; padding: 8px 0 14px;
  display: flex; gap: 10px; align-items: flex-start;
}
.activity-row::before {
  content: ""; position: absolute; left: -20px; top: 12px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--mm-surface); border: 2px solid var(--mm-teal-600);
  box-shadow: 0 0 0 3px var(--mm-surface);
}
.activity-row.mint::before    { border-color: var(--mm-mint-400); }
.activity-row.gold::before    { border-color: var(--mm-gold-500); }
.activity-row.red::before     { border-color: var(--mm-red-500); }
.activity-row.green::before   { border-color: var(--mm-green-500); }
.activity-row.purple::before  { border-color: var(--mm-purple-500); }
.activity-row .ic { font-size: 14px; line-height: 1; }
.activity-row .body { flex: 1; min-width: 0; }
.activity-row .body .t { font-size: 13px; color: var(--mm-text); font-weight: 600; }
.activity-row .body .m { font-size: 11.5px; color: var(--mm-text-3); margin-top: 2px; }
.activity-row .time { font-size: 11px; color: var(--mm-text-4); white-space: nowrap; font-weight: 600; }

/* ── Data table (user management, quiz management, logs) ──
   Reference: Stripe subscription list, Linear issues table. */
.data-table-wrap {
  background: var(--mm-surface); border: 1px solid var(--mm-border);
  border-radius: 14px; overflow: hidden;
}
.data-table-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--mm-border);
  flex-wrap: wrap;
}
.data-table-head .title { font-size: 14px; font-weight: 800; color: var(--mm-text); }
.data-table-head .grow { flex: 1; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 12px 16px; text-align: left;
  font-size: 13px; color: var(--mm-text-2);
  border-bottom: 1px solid var(--mm-border);
  vertical-align: middle;
}
.admin-table th {
  font-size: 11px; font-weight: 800; color: var(--mm-text-3);
  text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--mm-surface-2);
  position: sticky; top: 0;
  user-select: none;
}
.admin-table th.sortable { cursor: pointer; }
.admin-table th.sortable:hover { color: var(--mm-teal-600); }
.admin-table th.sortable .arrow { font-size: 10px; opacity: 0.4; margin-left: 4px; }
.admin-table th.sortable.active .arrow { opacity: 1; color: var(--mm-teal-600); }
.admin-table tbody tr { transition: background .12s; }
.admin-table tbody tr:hover { background: var(--mm-teal-50); }
.admin-table tbody tr.selected { background: var(--mm-teal-100); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table .row-checkbox { width: 36px; }
.admin-table .row-actions { width: 60px; text-align: right; }

.table-row-avatar {
  display: flex; align-items: center; gap: 10px;
}
.table-row-avatar .av {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--mm-teal-500), var(--mm-mint-400));
  color: #fff; font-weight: 800; font-size: 12.5px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.table-row-avatar .av.gold   { background: linear-gradient(135deg, var(--mm-gold-500), var(--mm-gold-700)); }
.table-row-avatar .av.purple { background: linear-gradient(135deg, var(--mm-purple-500), var(--mm-teal-600)); }
.table-row-avatar .av.red    { background: linear-gradient(135deg, var(--mm-red-500), var(--mm-red-700)); }
.table-row-avatar .meta { display: flex; flex-direction: column; min-width: 0; }
.table-row-avatar .meta .n { font-size: 13px; font-weight: 700; color: var(--mm-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.table-row-avatar .meta .e { font-size: 11.5px; color: var(--mm-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

/* Status badges — reuse existing tokens, varied by state */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  white-space: nowrap;
}
.status-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.active   { background: var(--mm-green-50);  color: var(--mm-green-500); }
.status-badge.pending  { background: var(--mm-gold-50);   color: var(--mm-gold-700); }
.status-badge.suspended{ background: var(--mm-red-50);    color: var(--mm-red-500); }
.status-badge.draft    { background: var(--mm-surface-2); color: var(--mm-text-3); }
.status-badge.published{ background: var(--mm-teal-50);   color: var(--mm-teal-600); }
.status-badge.archived { background: var(--mm-surface-2); color: var(--mm-text-4); }

.role-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
  white-space: nowrap;
}
.role-badge.admin    { background: var(--mm-purple-50); color: var(--mm-purple-500); }
.role-badge.aiprem   { background: var(--mm-mint-50);   color: var(--mm-mint-500); }
.role-badge.prem     { background: var(--mm-gold-50);   color: var(--mm-gold-700); }
.role-badge.free     { background: var(--mm-surface-2); color: var(--mm-text-3); }

/* Filter chips */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--mm-surface); color: var(--mm-text-2);
  border: 1px solid var(--mm-border);
  font-size: 12px; font-weight: 600;
  padding: 6px 11px; border-radius: 20px;
  transition: all .15s;
}
.filter-chip:hover { border-color: var(--mm-teal-200); color: var(--mm-teal-600); }
.filter-chip.active { background: var(--mm-teal-600); color: #fff; border-color: var(--mm-teal-600); }
.filter-chip .count { background: rgba(0,0,0,0.06); padding: 1px 6px; border-radius: 10px; font-size: 10px; font-weight: 800; }
.filter-chip.active .count { background: rgba(255,255,255,0.2); }

.admin-select {
  height: 36px; padding: 0 28px 0 12px;
  background: var(--mm-surface); border: 1px solid var(--mm-border);
  border-radius: 9px; color: var(--mm-text); font-size: 13px; font-weight: 600;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236B7280'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat; background-position: right 6px center; background-size: 18px;
}
.admin-select:focus { outline: none; border-color: var(--mm-teal-600); }

.admin-input {
  height: 36px; padding: 0 12px;
  background: var(--mm-surface); border: 1px solid var(--mm-border);
  border-radius: 9px; color: var(--mm-text); font-size: 13px; font-weight: 500;
}
.admin-input:focus { outline: none; border-color: var(--mm-teal-600); }

.admin-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--mm-teal-600); color: #fff;
  font-size: 13px; font-weight: 700;
  padding: 0 14px; height: 36px;
  border-radius: 9px;
  transition: background .15s, transform .1s;
}
.admin-btn:hover { background: var(--mm-teal-700); }
.admin-btn:active { transform: scale(0.97); }
.admin-btn svg { width: 15px; height: 15px; fill: currentColor; }
.admin-btn.ghost { background: var(--mm-surface); color: var(--mm-text-2); border: 1px solid var(--mm-border); }
.admin-btn.ghost:hover { background: var(--mm-surface-2); color: var(--mm-teal-600); border-color: var(--mm-teal-200); }
.admin-btn.danger { background: var(--mm-red-500); }
.admin-btn.danger:hover { background: var(--mm-red-700); }
.admin-btn.outline-red { background: var(--mm-surface); color: var(--mm-red-500); border: 1px solid var(--mm-red-100); }
.admin-btn.outline-red:hover { background: var(--mm-red-50); }

/* Pagination */
.admin-pagination {
  display: flex; align-items: center; gap: 4px;
  padding: 12px 16px; border-top: 1px solid var(--mm-border);
  font-size: 12.5px; color: var(--mm-text-3); font-weight: 600;
}
.admin-pagination .info { flex: 1; }
.admin-pagination button {
  width: 30px; height: 30px; border-radius: 7px;
  font-size: 12.5px; font-weight: 700; color: var(--mm-text-2);
  background: var(--mm-surface); border: 1px solid var(--mm-border);
  transition: all .12s;
}
.admin-pagination button:hover:not(:disabled) { background: var(--mm-teal-50); color: var(--mm-teal-600); border-color: var(--mm-teal-100); }
.admin-pagination button.active { background: var(--mm-teal-600); color: #fff; border-color: var(--mm-teal-600); }
.admin-pagination button:disabled { opacity: 0.4; cursor: default; }

/* ── Right drawer (the canonical admin edit surface) ──
   Never use big modal popups. Everything slides in from the right. */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(11,15,20,0.45);
  backdrop-filter: blur(2px);
  z-index: 300;
  opacity: 0; transition: opacity .25s;
}
.drawer-backdrop.open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 460px; max-width: 92vw;
  background: var(--mm-surface);
  box-shadow: -10px 0 40px rgba(0,0,0,0.18);
  z-index: 301;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.22,.61,.36,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--mm-border);
  flex-shrink: 0;
}
.drawer-head .t { font-size: 15px; font-weight: 800; color: var(--mm-text); flex: 1; }
.drawer-head .s { font-size: 12px; color: var(--mm-text-3); font-weight: 600; }
.drawer-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--mm-surface-2); color: var(--mm-text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
}
.drawer-close:hover { background: var(--mm-red-50); color: var(--mm-red-500); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.drawer-foot {
  display: flex; gap: 10px; padding: 14px 20px;
  border-top: 1px solid var(--mm-border); flex-shrink: 0;
  background: var(--mm-surface-2);
}

/* Drawer form rows */
.drawer-section { margin-bottom: 18px; }
.drawer-section-title { font-size: 11px; font-weight: 800; color: var(--mm-text-3); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 10px; }
.drawer-row { margin-bottom: 12px; }
.drawer-row .lbl { font-size: 11.5px; font-weight: 700; color: var(--mm-text-2); margin-bottom: 5px; display: block; }
.drawer-row .inp {
  width: 100%; height: 38px; padding: 0 12px;
  background: var(--mm-surface); border: 1px solid var(--mm-border);
  border-radius: 9px; color: var(--mm-text); font-size: 13px;
}
.drawer-row .inp:focus { outline: none; border-color: var(--mm-teal-600); box-shadow: 0 0 0 3px rgba(22,109,114,0.08); }
.drawer-row textarea.inp { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }

/* Toggle switch */
.toggle {
  position: relative; display: inline-block;
  width: 42px; height: 24px; flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--mm-border-2); border-radius: 24px;
  transition: background .2s;
}
.toggle .slider::before {
  content: ""; position: absolute;
  height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .slider { background: var(--mm-teal-600); }
.toggle input:checked + .slider::before { transform: translateX(18px); }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--mm-border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row .info { flex: 1; min-width: 0; }
.toggle-row .info .t { font-size: 13px; font-weight: 700; color: var(--mm-text); }
.toggle-row .info .d { font-size: 11.5px; color: var(--mm-text-3); margin-top: 2px; }

/* Question card (question bank) */
.qb-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 900px) { .qb-grid { grid-template-columns: 1fr; } }
.qb-card {
  background: var(--mm-surface); border: 1px solid var(--mm-border);
  border-radius: 12px; padding: 14px;
  transition: all .15s;
}
.qb-card:hover { border-color: var(--mm-teal-200); box-shadow: var(--mm-shadow-sm); }
.qb-card .top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.qb-card .q { font-size: 13.5px; font-weight: 600; color: var(--mm-text); line-height: 1.5; margin-bottom: 10px; }
.qb-card .meta { display: flex; align-items: center; gap: 14px; font-size: 11.5px; color: var(--mm-text-3); font-weight: 600; }
.qb-card .meta .v { color: var(--mm-text-2); font-weight: 700; }
.qb-card .actions { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--mm-border); }

/* Tabs (settings page) */
.admin-tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--mm-surface-2); border: 1px solid var(--mm-border);
  border-radius: 10px; width: fit-content; max-width: 100%; overflow-x: auto;
}
.admin-tab {
  padding: 7px 14px; border-radius: 7px;
  font-size: 12.5px; font-weight: 700; color: var(--mm-text-3);
  white-space: nowrap; transition: all .15s;
}
.admin-tab:hover { color: var(--mm-teal-600); }
.admin-tab.active { background: var(--mm-surface); color: var(--mm-teal-600); box-shadow: var(--mm-shadow-sm); }

/* Empty state — MedMint style */
.admin-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 20px; text-align: center;
}
.admin-empty .ill {
  width: 80px; height: 80px; border-radius: 20px;
  background: linear-gradient(135deg, var(--mm-teal-50), var(--mm-mint-50));
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; margin-bottom: 14px;
  border: 1px solid var(--mm-teal-100);
}
.admin-empty .t { font-size: 16px; font-weight: 800; color: var(--mm-text); margin-bottom: 4px; }
.admin-empty .s { font-size: 13px; color: var(--mm-text-3); max-width: 340px; line-height: 1.5; }

/* Skeleton loader — MedMint style */
.skel { background: linear-gradient(90deg, var(--mm-surface-2) 0%, var(--mm-border) 50%, var(--mm-surface-2) 100%); background-size: 200% 100%; animation: skelShine 1.4s ease infinite; border-radius: 8px; }
@keyframes skelShine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-line { height: 12px; margin-bottom: 8px; }
.skel-line.short { width: 60%; }
.skel-card { height: 110px; }

/* Toast (admin) — extends .toast-wrap from app.css */
.admin-toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 400; display: flex; flex-direction: column; gap: 8px; }
.admin-toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--mm-surface); border: 1px solid var(--mm-border);
  border-left: 3px solid var(--mm-teal-600);
  border-radius: 11px; padding: 12px 14px;
  box-shadow: var(--mm-shadow-lg);
  min-width: 260px; max-width: 360px;
  animation: toastIn .3s cubic-bezier(.22,.61,.36,1);
}
.admin-toast.success { border-left-color: var(--mm-green-500); }
.admin-toast.warn { border-left-color: var(--mm-gold-500); }
.admin-toast.error { border-left-color: var(--mm-red-500); }
.admin-toast .ic { font-size: 18px; flex-shrink: 0; }
.admin-toast .body { flex: 1; min-width: 0; }
.admin-toast .body .t { font-size: 13px; font-weight: 700; color: var(--mm-text); }
.admin-toast .body .m { font-size: 11.5px; color: var(--mm-text-3); margin-top: 1px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* Counter animation utility */
.count-up { display: inline-block; }

/* Page transition */
.page-fade { animation: pageFade .35s cubic-bezier(.22,.61,.36,1); }
@keyframes pageFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive: collapse sidebar to icons under 900px — handled by existing mobile sidebar */
@media (max-width: 900px) {
  .admin-topbar { padding: 0 14px; gap: 8px; }
  .admin-topbar-title .t { font-size: 15px; }
  .admin-search { display: none; }
  .admin-clock { display: none; }
  .admin-status-pill { display: none; }
  .admin-avatar-btn .name { display: none; }
  .admin-content { padding: 14px 14px 30px; }
  .kpi-grid { gap: 10px; }
  .qa-grid { gap: 10px; }
}
