/* ================================================================
   HOSPITAL TRAINING SYSTEM v5 — Clinical Precision Design
   Aesthetic: Deep Indigo × Amber Gold — authoritative, refined
   Fonts: DM Serif Display (headings) + Plus Jakarta Sans (body)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ── Variables ──────────────────────────────────────────── */
:root {
  /* Brand */
  --indigo-900: #0F1B4C;
  --indigo-800: #1a2a6c;
  --indigo-700: #1e3a8a;
  --indigo-600: #2563eb;
  --indigo-500: #3b82f6;
  --indigo-100: #e0e7ff;
  --indigo-50:  #eef2ff;

  --amber-500: #F59E0B;
  --amber-400: #FBBF24;
  --amber-100: #FEF3C7;
  --amber-50:  #FFFBEB;

  --emerald-500: #10B981;
  --emerald-100: #D1FAE5;
  --rose-500: #F43F5E;
  --rose-100: #FFE4E6;
  --violet-500: #8B5CF6;
  --violet-100: #EDE9FE;
  --sky-500: #0EA5E9;
  --sky-100: #E0F2FE;

  /* Neutral */
  --gray-950: #030712;
  --gray-900: #111827;
  --gray-800: #1F2937;
  --gray-700: #374151;
  --gray-600: #4B5563;
  --gray-500: #6B7280;
  --gray-400: #9CA3AF;
  --gray-300: #D1D5DB;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;
  --gray-50:  #F9FAFB;
  --white: #FFFFFF;

  /* Semantic */
  --primary: var(--indigo-700);
  --primary-hover: var(--indigo-800);
  --primary-light: var(--indigo-50);
  --accent: var(--amber-500);
  --accent-light: var(--amber-50);

  --success: var(--emerald-500);
  --success-light: var(--emerald-100);
  --danger: var(--rose-500);
  --danger-light: var(--rose-100);
  --warning: var(--amber-500);
  --warning-light: var(--amber-100);
  --info: var(--indigo-600);
  --info-light: var(--indigo-50);

  /* Surfaces */
  --bg: #F0F4FF;
  --surface: var(--white);
  --surface-2: #F8FAFF;
  --surface-dark: var(--indigo-900);
  --sidebar-bg: var(--indigo-900);
  --sidebar-w: 252px;

  /* Text */
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-tertiary: var(--gray-400);
  --text-disabled: var(--gray-300);
  --text-on-dark: rgba(255,255,255,0.9);
  --text-on-dark-muted: rgba(255,255,255,0.5);

  /* Borders */
  --border: var(--gray-200);
  --border-light: var(--gray-100);
  --border-dark: rgba(255,255,255,0.08);

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(15,27,76,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 32px rgba(15,27,76,.10), 0 2px 8px rgba(0,0,0,.06);
  --shadow-xl: 0 24px 64px rgba(15,27,76,.14);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,.08);

  /* Typography */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, 'PingFang SC', sans-serif;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  /* Subtle dot-grid background texture */
  background-image: radial-gradient(circle, var(--indigo-100) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: 0 0;
}

/* ── Screens ────────────────────────────────────────────── */
.screen { position: fixed; inset: 0; }
.screen.active { display: flex; }
.screen.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   LOGIN SCREEN
═══════════════════════════════════════════════════════════ */
#login-screen {
  align-items: center;
  justify-content: center;
  background: var(--indigo-900);
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(37,99,235,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 30%, rgba(245,158,11,0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(30,58,138,0.6) 0%, transparent 60%);
}

/* Animated orbs */
.login-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbFloat 12s ease-in-out infinite;
}
.orb-1 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(37,99,235,0.4), transparent 70%); top: -20%; left: -10%; animation-duration: 15s; }
.orb-2 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(245,158,11,0.2), transparent 70%); bottom: -10%; right: 5%; animation-duration: 18s; animation-direction: reverse; }
.orb-3 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(139,92,246,0.2), transparent 70%); top: 30%; right: 25%; animation-duration: 22s; animation-delay: 3s; }

/* Geometric grid overlay */
#login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* Medical cross decoration */
#login-screen::after {
  content: '';
  position: absolute;
  width: 160px;
  height: 160px;
  opacity: 0.04;
  background:
    linear-gradient(white, white) center center / 40px 160px no-repeat,
    linear-gradient(white, white) center center / 160px 40px no-repeat;
  top: 12%;
  right: 8%;
  animation: spinSlow 60s linear infinite;
}

.login-card {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-2xl);
  padding: 48px 44px;
  width: 420px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5), var(--shadow-inset);
  animation: cardReveal 0.6s cubic-bezier(0.16,1,0.3,1);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}
.login-hospital-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--indigo-600), var(--indigo-800));
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.login-hospital-logo.placeholder svg { width: 28px; height: 28px; }
.login-title { font-family: var(--font-display); font-size: 20px; color: white; line-height: 1.2; }
.login-subtitle { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 3px; letter-spacing: 0.3px; }

.login-card .form-group { margin-bottom: 14px; }
.login-card label { display: block; font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.55); margin-bottom: 7px; letter-spacing: 0.5px; text-transform: uppercase; }
.login-card input {
  width: 100%; padding: 12px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: white;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}
.login-card input::placeholder { color: rgba(255,255,255,0.3); }
.login-card input:focus {
  background: rgba(255,255,255,0.12);
  border-color: rgba(245,158,11,0.6);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  padding: 9px 13px;
  background: rgba(244,63,94,0.12);
  border: 1px solid rgba(244,63,94,0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.login-card .btn-primary {
  width: 100%;
  height: 46px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--amber-400), var(--amber-500));
  color: var(--indigo-900);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.login-card .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(245,158,11,0.35); }
.login-card .btn-primary:active { transform: translateY(0); }

.login-hint { text-align: center; font-size: 12px; color: rgba(255,255,255,0.35); margin-top: 16px; }
.login-hint a { color: rgba(245,158,11,0.7); text-decoration: none; }
.login-hint a:hover { color: var(--amber-400); }

/* ═══════════════════════════════════════════════════════════
   MAIN LAYOUT
═══════════════════════════════════════════════════════════ */
#main-screen { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  position: relative;
  box-shadow: 4px 0 24px rgba(0,0,0,0.2);
}
/* Subtle gradient accent line on right edge */
.sidebar::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(245,158,11,0.3) 40%, rgba(245,158,11,0.3) 60%, transparent);
  pointer-events: none;
}

.sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border-dark);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-default {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--indigo-600), var(--amber-500));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.logo-default svg { width: 16px; height: 16px; }
.sidebar-logo span {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-on-dark);
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-section { margin-bottom: 4px; }
.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-on-dark-muted);
  padding: 10px 10px 4px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-on-dark-muted);
  transition: all 0.15s;
  user-select: none;
  text-decoration: none;
  margin-bottom: 1px;
  position: relative;
}
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.7; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: var(--text-on-dark); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(245,158,11,0.08));
  color: var(--amber-400);
  border: 1px solid rgba(245,158,11,0.15);
}
.nav-item.active svg { opacity: 1; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--amber-400);
  border-radius: 0 2px 2px 0;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 14px 16px;
  border-top: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--indigo-600), var(--violet-500));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.15);
}
.user-details { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-on-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-on-dark-muted); margin-top: 1px; }
.btn-logout {
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-on-dark-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-logout svg { width: 14px; height: 14px; }
.btn-logout:hover { background: rgba(244,63,94,0.15); border-color: rgba(244,63,94,0.2); color: var(--danger); }

/* ── Main content ───────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: transparent;
  height: 100vh;
}
.page { display: none; min-height: 100%; }
.page.active { display: block; }
.page.hidden { display: none; }

/* Page header */
.page-header {
  padding: 26px 32px 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(240,244,255,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.7);
}
.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--gray-900);
  line-height: 1.2;
  letter-spacing: -0.3px;
}
.page-subtitle { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; align-items: center; }
.page-body { padding: 24px 32px; }

/* ═══════════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to right, var(--surface), var(--surface-2));
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.1px; }
.card-body { padding: 20px 22px; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px 20px 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card:hover::before { opacity: 1; }
.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-label { font-size: 11px; color: var(--text-tertiary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-icon svg { width: 16px; height: 16px; }
.stat-value { font-family: var(--font-display); font-size: 28px; line-height: 1; }
.stat-change { font-size: 12px; color: var(--text-tertiary); margin-top: 5px; }

/* ═══════════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 18px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 12px 18px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text-primary);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s; }
tbody tr:hover td { background: var(--indigo-50); }
.table-actions { display: flex; gap: 5px; }

/* ═══════════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 15px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-4col { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }

input, textarea, select {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface);
  transition: all 0.15s;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--indigo-600);
  box-shadow: 0 0 0 3px rgba(30,58,138,0.08);
}
textarea { resize: vertical; min-height: 90px; }
input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
input[type="file"] { padding: 7px 11px; cursor: pointer; }

/* ═══════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
  user-select: none;
  letter-spacing: 0.1px;
}
.btn svg { width: 14px; height: 14px; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--indigo-700), var(--indigo-800));
  color: white;
  box-shadow: 0 1px 3px rgba(30,58,138,0.3);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--indigo-800), var(--indigo-900)); box-shadow: 0 4px 12px rgba(30,58,138,0.25); transform: translateY(-1px); }

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); }

.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: #ffd0d6; }
.btn-success { background: var(--success-light); color: #059669; }
.btn-warning { background: var(--warning-light); color: #b45309; }
.btn-ai {
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  color: white;
  box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}
.btn-ai:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(79,70,229,0.35); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; }
.btn-icon { padding: 7px; }

/* ═══════════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-blue { background: var(--indigo-50); color: var(--indigo-700); border: 1px solid var(--indigo-100); }
.badge-green { background: var(--emerald-100); color: #059669; border: 1px solid #a7f3d0; }
.badge-red { background: var(--rose-100); color: var(--rose-500); border: 1px solid #fecdd3; }
.badge-orange { background: var(--amber-100); color: #b45309; border: 1px solid #fde68a; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200); }
.badge-purple { background: var(--violet-100); color: var(--violet-500); border: 1px solid #ddd6fe; }

/* ═══════════════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,27,76,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal-overlay.hidden { display: none !important; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.2s cubic-bezier(0.16,1,0.3,1);
  border: 1px solid rgba(255,255,255,0.8);
}
.modal-header {
  padding: 20px 26px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.2px; }
.modal-close {
  background: var(--gray-100);
  border: none; width: 28px; height: 28px; border-radius: 8px;
  cursor: pointer; font-size: 12px; color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--gray-200); color: var(--text-primary); }
.modal-body { padding: 20px 26px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 26px 20px;
  border-top: 1px solid var(--border-light);
  display: flex; justify-content: flex-end; gap: 8px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════ */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--gray-900);
  color: white;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.05);
  animation: slideInRight 0.25s cubic-bezier(0.16,1,0.3,1);
  display: flex; align-items: center; gap: 9px;
  max-width: 320px;
  border-left: 3px solid transparent;
}
.toast-success { background: #052e16; border-left-color: var(--emerald-500); }
.toast-error { background: #2d0a0e; border-left-color: var(--rose-500); }
.toast-info { background: #0c1a4a; border-left-color: var(--indigo-500); }
.toast-warning { background: #2d1a00; border-left-color: var(--amber-500); }

/* ═══════════════════════════════════════════════════════════
   MISCELLANEOUS
═══════════════════════════════════════════════════════════ */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.progress-bar { width: 100%; height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.progress-blue { background: linear-gradient(90deg, var(--indigo-600), var(--indigo-500)); }
.progress-green { background: linear-gradient(90deg, #059669, var(--emerald-500)); }
.progress-red { background: linear-gradient(90deg, var(--rose-500), #fb7185); }

.pill-group { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  color: var(--text-secondary);
  background: var(--surface);
  letter-spacing: 0.2px;
}
.pill:hover { border-color: var(--indigo-400); color: var(--indigo-700); }
.pill.selected { background: var(--indigo-50); border-color: var(--indigo-400); color: var(--indigo-700); }

.tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 5px; font-size: 12px; font-weight: 500; margin: 2px; background: var(--indigo-50); color: var(--indigo-700); border: 1px solid var(--indigo-100); }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 64px 20px; text-align: center;
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.15; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--text-tertiary); }

.hidden { display: none !important; }
.divider { height: 1px; background: var(--border-light); margin: 14px 0; }
.section-label { font-size: 11px; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 10px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--indigo-600); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }

/* ── Tabs ───────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--border-light); margin-bottom: 18px; gap: 2px; }
.tab-btn {
  padding: 10px 16px;
  background: none; border: none;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  color: var(--text-tertiary); cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab-btn.active { color: var(--indigo-700); border-bottom-color: var(--indigo-700); background: var(--indigo-50); }
.tab-btn:hover { color: var(--text-primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Score circles ──────────────────────────────────────── */
.score-circle {
  width: 80px; height: 80px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 22px;
  border: 3px solid;
}
.score-pass { color: #059669; border-color: var(--emerald-500); background: var(--emerald-100); }
.score-fail { color: var(--rose-500); border-color: var(--rose-500); background: var(--rose-100); }

/* ── Questions ──────────────────────────────────────────── */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 12px;
  transition: box-shadow 0.15s;
}
.question-card:hover { box-shadow: var(--shadow-md); }
.question-text { font-size: 14px; font-weight: 600; margin: 8px 0; line-height: 1.6; }
.question-option {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
  line-height: 1.5;
}
.question-option:hover { background: var(--indigo-50); }
.question-option.selected { background: var(--indigo-50); }
.question-option.correct { background: var(--emerald-100); }
.question-option.wrong { background: var(--rose-100); }
.opt-key {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  transition: all 0.15s;
}
.question-option.selected .opt-key { background: var(--indigo-700); border-color: var(--indigo-700); color: white; }
.question-option.correct .opt-key { background: #059669; border-color: #059669; color: white; }
.question-option.wrong .opt-key { background: var(--rose-500); border-color: var(--rose-500); color: white; }
.fill-answer-input {
  width: 100%; max-width: 380px;
  margin-top: 10px; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font-body); outline: none;
}
.fill-answer-input:focus { border-color: var(--indigo-600); box-shadow: 0 0 0 3px rgba(30,58,138,0.08); }

/* ── Exam / Study screens ───────────────────────────────── */
#exam-screen, #study-screen {
  background: var(--bg);
  flex-direction: column;
  overflow-y: auto;
  background-image: radial-gradient(circle, var(--indigo-100) 1px, transparent 1px);
  background-size: 28px 28px;
}
.exam-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.exam-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.exam-timer { font-size: 20px; font-weight: 700; color: var(--indigo-700); font-variant-numeric: tabular-nums; font-family: var(--font-display); }
.exam-timer.warning { color: var(--rose-500); animation: pulse 1s ease-in-out infinite; }
.exam-body { padding: 24px 36px; max-width: 820px; margin: 0 auto; width: 100%; }
.exam-progress-bar { height: 4px; background: var(--gray-200); border-radius: 2px; margin-bottom: 20px; }
.exam-progress-fill { height: 100%; background: linear-gradient(90deg, var(--indigo-600), var(--amber-500)); border-radius: 2px; transition: width 0.3s; }
.exam-result-overlay {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 44px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  margin: 32px auto;
  border: 1px solid var(--border);
}
.study-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.study-body { padding: 28px 40px; max-width: 900px; margin: 0 auto; width: 100%; }
.study-content-text { font-size: 14px; line-height: 2; color: var(--text-secondary); white-space: pre-wrap; }
.study-progress-info {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--indigo-50), var(--amber-50));
  border: 1px solid var(--indigo-100);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--indigo-700);
}

/* ── AI dots ────────────────────────────────────────────── */
.ai-dots { display: flex; gap: 5px; }
.ai-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--indigo-500);
  animation: aiDot 1.4s ease-in-out infinite;
}
.ai-dot:nth-child(2) { animation-delay: 0.2s; background: var(--amber-500); }
.ai-dot:nth-child(3) { animation-delay: 0.4s; background: var(--violet-500); }

/* ── Chart containers ───────────────────────────────────── */
.chart-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.chart-card:hover { box-shadow: var(--shadow-md); }
.chart-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to right, var(--surface), var(--surface-2));
}
.chart-card-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.chart-card-body { padding: 16px 18px; }
.chart-container { position: relative; height: 240px; }
.btn-dl-chart {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-tertiary);
  display: flex; align-items: center; gap: 4px;
  transition: all 0.15s;
  font-family: var(--font-body);
}
.btn-dl-chart:hover { background: var(--indigo-50); color: var(--indigo-700); border-color: var(--indigo-200); }

/* ── Content card ───────────────────────────────────────── */
.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  transition: all 0.15s;
  margin-bottom: 8px;
}
.content-card:hover { box-shadow: var(--shadow-md); border-color: var(--indigo-200); }
.content-info { flex: 1; min-width: 0; }
.content-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }

/* ── Dept rows ──────────────────────────────────────────── */
.dept-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.dept-row:last-child { border-bottom: none; }
.dept-rank { width: 24px; height: 24px; border-radius: 8px; background: var(--gray-100); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.dept-rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: white; }
.dept-rank-2 { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); color: white; }
.dept-rank-3 { background: linear-gradient(135deg, #CD7F32, #A0522D); color: white; }
.dept-name { flex: 1; font-size: 13px; }
.dept-score { font-size: 14px; font-weight: 700; color: var(--indigo-700); }

/* ── Upload area ────────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface-2);
}
.upload-area:hover, .upload-area.drag-over { border-color: var(--indigo-400); background: var(--indigo-50); }
.upload-area svg { width: 36px; height: 36px; color: var(--text-tertiary); margin-bottom: 10px; }
.upload-area p { font-size: 13px; color: var(--text-tertiary); }
.upload-area strong { color: var(--indigo-700); }
.file-preview {
  padding: 10px 14px; background: var(--gray-50);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
}
.file-preview .fp-name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview .fp-remove { cursor: pointer; color: var(--text-tertiary); font-size: 16px; flex-shrink: 0; }
.file-preview .fp-remove:hover { color: var(--danger); }

/* ── AI Report ──────────────────────────────────────────── */
.ai-report { font-size: 14px; line-height: 1.9; color: var(--text-primary); }
.ai-report h2 { font-family: var(--font-display); font-size: 18px; margin: 24px 0 10px; color: var(--indigo-800); border-bottom: 1px solid var(--indigo-100); padding-bottom: 6px; }
.ai-report h3 { font-size: 14px; margin: 16px 0 6px; color: var(--text-primary); font-weight: 700; }
.ai-report ul { padding-left: 20px; margin-bottom: 12px; }
.ai-report li { margin-bottom: 5px; }
.ai-report p { margin-bottom: 12px; }
.ai-report strong { font-weight: 700; color: var(--indigo-800); }

/* ── Retake badge ───────────────────────────────────────── */
.retake-pending { background: var(--amber-100); color: #b45309; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--amber-200); }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════════ */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp   { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes spin      { to { transform: rotate(360deg); } }
@keyframes pulse     { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes aiDot     { 0%,100% { transform: translateY(0); opacity: 0.4; } 50% { transform: translateY(-6px); opacity: 1; } }
@keyframes orbFloat  { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-40px) scale(1.06); } }
@keyframes cardReveal { from { transform: translateY(24px) scale(0.97); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes spinSlow  { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════
   SIDEBAR BRAND BLOCK
═══════════════════════════════════════════════════════════ */
.sidebar-brand {
  padding: 22px 18px 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  position: relative;
}

/* Subtle shimmer line below brand */
.sidebar-divider {
  height: 1px;
  margin: 0 16px;
  background: linear-gradient(90deg, transparent, rgba(245,158,11,0.3) 30%, rgba(245,158,11,0.3) 70%, transparent);
}

.sidebar-brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37,99,235,0.8), rgba(245,158,11,0.5));
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
  overflow: hidden;
  position: relative;
}
.sidebar-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}
.sidebar-brand-logo svg {
  width: 22px;
  height: 22px;
}

/* Glow ring around logo */
.sidebar-brand-logo::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(245,158,11,0.5), rgba(37,99,235,0.5));
  z-index: -1;
}

.sidebar-brand-text {
  min-width: 0;
  flex: 1;
}
.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: 15px;
  color: rgba(255,255,255,0.95);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}
.sidebar-brand-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  margin-top: 3px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   HOSPITAL BANNER (Dashboard top)
═══════════════════════════════════════════════════════════ */
.hosp-banner {
  background: linear-gradient(135deg, var(--indigo-900) 0%, var(--indigo-800) 60%, #1a3a6e 100%);
  border-bottom: none;
  padding: 22px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

/* Decorative elements */
.hosp-banner::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,0.12), transparent 70%);
  pointer-events: none;
}
.hosp-banner::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,158,11,0.4) 30%, rgba(245,158,11,0.4) 70%, transparent);
}

/* Cross watermark */
.hosp-banner-cross {
  position: absolute;
  right: 180px; top: 50%;
  transform: translateY(-50%);
  opacity: 0.04;
  pointer-events: none;
}

.hosp-banner-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hosp-banner-logo {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  flex-shrink: 0;
}

.hosp-banner-logo-default {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37,99,235,0.6), rgba(245,158,11,0.4));
  border: 2px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.hosp-banner-logo-default svg {
  width: 28px;
  height: 28px;
}

.hosp-banner-name {
  font-family: var(--font-display);
  font-size: 22px;
  color: white;
  line-height: 1.2;
  letter-spacing: 0.3px;
  margin-bottom: 5px;
}
.hosp-banner-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.3px;
}

.hosp-banner-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.hosp-banner-tag {
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  backdrop-filter: blur(8px);
}

/* ═══════════════════════════════════════════════════════════
   DEPT TREE SIDEBAR (Users page)
═══════════════════════════════════════════════════════════ */
.dept-tree-sidebar {
  width: 180px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  overflow-y: auto;
  max-height: calc(100vh - 120px);
  position: sticky;
  top: 0;
}
.dept-tree-header {
  padding: 12px 14px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 1px solid var(--border);
}
.dept-tree-group {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
}
.dept-tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.dept-tree-item:hover { background: var(--surface-2); color: var(--text-primary); }
.dept-tree-item.active { background: var(--blue-muted); color: var(--blue); border-left-color: var(--blue); font-weight: 600; }
.dept-tree-count {
  margin-left: auto;
  font-size: 11px;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 10px;
  color: var(--text-tertiary);
}
.dept-tree-item.active .dept-tree-count { background: var(--blue)18; color: var(--blue); }

/* ── Article training editor ─────────────────────────────────── */
.article-editor-shell {
  display: grid;
  grid-template-columns: minmax(0,1fr) 405px;
  gap: 20px;
  align-items: start;
}
.article-editor-main { min-width: 0; }
.article-toolbar {
  position: sticky;
  top: -20px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  margin-bottom: 12px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
}
.article-toolbar button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
}
.article-toolbar button.warn { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.article-toolbar button.tip { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.article-toolbar button.danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.article-editor {
  min-height: 520px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}
.article-block {
  position: relative;
  margin-bottom: 14px;
}
.article-block p,
.article-block h2 {
  outline: none;
  line-height: 1.9;
}
.article-block p {
  white-space: pre-wrap;
  word-break: break-word;
}
.article-block h2 { font-size: 20px; margin: 18px 0 8px; color: var(--text-primary); }
.article-media img,
.article-media video {
  width: 100%;
  display: block;
  border-radius: 8px;
  background: #020617;
}
.article-media-title {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.article-media.audio {
  display: grid;
  grid-template-columns: 14px 1fr 220px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--gray-50);
}
.article-media.audio small { display: block; color: var(--text-tertiary); margin-top: 2px; }
.audio-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(244,63,94,.12);
}
.medical-box {
  padding: 14px 16px;
  border-radius: 8px;
  border-left: 5px solid;
}
.medical-box.warning { background: #fff7ed; border-left-color: #f97316; }
.medical-box.tip { background: #eff6ff; border-left-color: #2563eb; }
.medical-box.danger { background: #fef2f2; border-left-color: #dc2626; }
.medical-box-title { font-weight: 800; margin-bottom: 6px; outline: none; }
.medical-box-body { outline: none; line-height: 1.8; }
.medical-step-block {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.medical-step-block > span {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #0f766e; color: #fff; font-weight: 800;
}
.medical-step-block strong,
.medical-step-block p { outline: none; }
.article-editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.article-phone { position: sticky; top: 20px; }
.article-phone-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  text-align: center;
}
.article-phone-frame {
  width: 375px;
  height: 720px;
  margin: 0 auto;
  overflow-y: auto;
  border: 10px solid #0f172a;
  border-radius: 32px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15,23,42,.22);
}
.phone-article-head {
  padding: 22px 18px 8px;
}
.phone-article-head span {
  display: inline-flex;
  padding: 2px 9px;
  border-radius: 999px;
  background: #ecfeff;
  color: #0e7490;
  font-size: 12px;
  font-weight: 800;
}
.phone-article-head h1 {
  margin: 12px 0 8px;
  font-size: 24px;
  line-height: 1.25;
}
.phone-article-head p {
  color: #64748b;
  line-height: 1.7;
}
.phone-article-content,
.article-preview-modal {
  padding: 8px 18px 28px;
  line-height: 1.9;
}
.article-preview-summary {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--indigo-50);
  color: var(--text-secondary);
}

@media (max-width: 1100px) {
  .article-editor-shell { grid-template-columns: 1fr; }
  .article-phone { position: static; }
}
