/* ============================================================
   SANTARA V1.0 — Premium Design System
   Google Font: Inter (loaded via base.html)
   Colour palette: Deep Forest Green + Slate Dark
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  /* Core palette */
  --bg:            #f0f4f2;
  --surface:       #ffffff;
  --surface-2:     #f6f9f7;
  --surface-3:     #edf2ef;
  --text:          #111c17;
  --text-2:        #2d4039;
  --muted:         #687f74;

  /* Border / divider */
  --line:          #dce8e2;
  --line-strong:   #c4d5cc;

  /* Brand – emerald */
  --brand:         #18865c;
  --brand-hover:   #117048;
  --brand-dark:    #0c4d34;
  --brand-deeper:  #083326;
  --brand-soft:    #e5f5ed;
  --brand-mid:     #a7d9bf;

  /* Accents */
  --amber:         #c07d0b;
  --amber-soft:    #fff4d9;
  --red:           #c0271c;
  --red-soft:      #ffeceb;
  --blue:          #1764aa;
  --blue-soft:     #e7f2ff;
  --purple:        #7c3aed;
  --purple-soft:   #f3eeff;

  /* Shadows & Glows */
  --shadow-sm:     0 1px 4px rgba(11,40,27,.07), 0 2px 10px rgba(11,40,27,.04);
  --shadow:        0 4px 20px rgba(11,40,27,.10), 0 1px 4px rgba(11,40,27,.06);
  --shadow-lg:     0 16px 48px rgba(11,40,27,.16), 0 4px 16px rgba(11,40,27,.08);
  --glow-brand:    0 0 0 3px rgba(24,134,92,.20);

  /* Geometry */
  --radius-sm:     8px;
  --radius:        14px;
  --radius-lg:     20px;
  --radius-full:   999px;
  --sidebar:       268px;
  --topbar-h:      72px;

  /* Typography */
  --font:          'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-image: 
    radial-gradient(ellipse at 10% 20%, rgba(24, 134, 92, 0.13) 0%, transparent 40%),
    radial-gradient(ellipse at 90% 80%, rgba(12, 77, 52, 0.10) 0%, transparent 40%),
    radial-gradient(ellipse at 60% 10%, rgba(51, 201, 139, 0.07) 0%, transparent 30%),
    radial-gradient(ellipse at 30% 90%, rgba(23, 100, 170, 0.06) 0%, transparent 30%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin-top: 0; }
img { max-width: 100%; }
small { color: var(--muted); font-size: .85em; }
strong { font-weight: 700; }
::selection { background: var(--brand-soft); color: var(--brand-dark); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ============================================================
   LAYOUT — App Shell
   ============================================================ */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: linear-gradient(180deg, rgba(8, 51, 38, 0.97) 0%, rgba(6, 38, 28, 0.98) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(51, 201, 139, 0.12);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  box-shadow: 4px 0 40px rgba(0,0,0,.28), inset -1px 0 0 rgba(51,201,139,0.08);
}

/* Brand mark */
.brand {
  height: var(--topbar-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.brand-mark, .login-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #33c98b, #18865c);
  color: #fff;
  font-weight: 900;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(24,134,92,.35);
  flex-shrink: 0;
}
.brand strong {
  display: block;
  font-size: 15px;
  letter-spacing: .05em;
  font-weight: 800;
}
.brand span {
  display: block;
  font-size: 11px;
  color: #8ec7a8;
  margin-top: 1px;
}

/* Period strip */
.sidebar-period {
  margin: 14px 14px 4px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(4px);
  flex-shrink: 0;
}
.sidebar-period span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #7bb59c;
  font-weight: 600;
}
.sidebar-period strong {
  display: block;
  font-size: 13px;
  margin-top: 3px;
  color: #d5ede4;
}

/* Nav */
.sidebar-nav {
  padding: 10px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}
.nav-heading {
  padding: 16px 12px 6px;
  color: #5a8f74;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  margin: 2px 0;
  border-radius: 10px;
  color: #b8d9cc;
  font-size: 13.5px;
  font-weight: 600;
  transition: background .15s, color .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav-item.active {
  background: rgba(24,134,92,.28);
  color: #fff;
  box-shadow: inset 3px 0 0 #33c98b;
}
.nav-icon {
  width: 22px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
  opacity: .85;
}
.nav-item.active .nav-icon { opacity: 1; }

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #6a9e86;
  flex-shrink: 0;
}
.sidebar-footer strong { color: #33c98b; }

/* ============================================================
   TOPBAR
   ============================================================ */
.main-panel {
  grid-column: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.5);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.menu-button { display: none; }

.topbar-title { display: flex; flex-direction: column; }
.topbar-title .eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  font-weight: 700;
}
.topbar-title strong { font-size: 16px; font-weight: 800; color: var(--text); }

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Server status dot */
.server-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.server-indicator > span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #21c78a;
  box-shadow: 0 0 0 4px rgba(33,199,138,.18);
  animation: pulse-dot 2.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(33,199,138,.18); }
  50% { box-shadow: 0 0 0 6px rgba(33,199,138,.08); }
}

/* Mode indicator */
.mode-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  border: 1.5px solid var(--line);
  color: var(--text);
  background: var(--surface);
  transition: .15s;
}
.mode-indicator small { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.mode-indicator.mode-proctor { background: var(--blue-soft); color: var(--blue); border-color: #b5d4ef; }
.mode-indicator.mode-teacher { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-mid); }

/* User menu */
.user-menu { position: relative; }
.user-menu summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px;
  border-radius: 12px;
  transition: background .15s;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--surface-3); }
.avatar {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  border-radius: 50%;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(24,134,92,.28);
  flex-shrink: 0;
}
.avatar-large { width: 72px; height: 72px; font-size: 28px; }
.user-summary strong, .user-summary small { display: block; }
.user-summary strong { font-size: 13px; font-weight: 700; }
.user-summary small { font-size: 11px; color: var(--muted); }
.user-dropdown {
  position: absolute;
  right: 0;
  top: 52px;
  width: 180px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: dropdown-in .15s ease;
  z-index: 50;
}
@keyframes dropdown-in { from { opacity:0; transform: translateY(-6px); } to { opacity:1; transform: none; } }
.user-dropdown a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: background .12s;
}
.user-dropdown a:hover { background: var(--surface-3); color: var(--brand); }

/* Content area */
.content {
  padding: 28px;
  max-width: 1640px;
  margin: 0 auto;
  flex: 1;
  width: 100%;
}

/* ============================================================
   PAGE HEADING
   ============================================================ */
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.page-heading h1 {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.15;
  margin: 5px 0 6px;
  letter-spacing: -.3px;
}
.page-heading p { color: var(--muted); margin: 0; font-size: 14px; }
.breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.heading-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ============================================================
   PANELS & CARDS
   ============================================================ */
.panel {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255, 0.7);
  border-top: 1px solid rgba(255,255,255, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.8);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.panel-header h2 { font-size: 16px; margin: 0 0 2px; font-weight: 700; }
.panel-header p { font-size: 12px; color: var(--muted); margin: 0; }
.panel-footer {
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 13.5px;
  border: 1px solid transparent;
  transition: all .15s cubic-bezier(.4,0,.2,1);
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-mid), var(--brand));
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(24,134,92,.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 6px 20px rgba(24,134,92,.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #fff;
  color: var(--brand);
  border-color: var(--brand-mid);
}
.btn-secondary:hover { background: var(--brand-soft); color: var(--brand-hover); }

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

.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(192,39,28,.28);
}
.btn-danger:hover { background: #a01f16; color: #fff; }

.btn-danger-outline {
  background: #fff;
  color: var(--red);
  border-color: #f0b4b0;
}
.btn-danger-outline:hover { background: var(--red-soft); }

.btn-warning {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: #ebc97a;
}
.btn-warning:hover { background: #ffe8a3; }

.btn-block { width: 100%; margin-top: 10px; }
.btn-small { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-xs { padding: 4px 9px; font-size: 11px; border-radius: 7px; }

.icon-button {
  border: 0;
  background: transparent;
  width: 36px; height: 36px;
  border-radius: 9px;
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: background .15s, color .15s;
}
.icon-button:hover { background: var(--surface-3); color: var(--text); }
.icon-button.danger { color: var(--red); }
.icon-button[disabled] { opacity: .35; cursor: not-allowed; }

/* ============================================================
   BADGES & PILLS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: .02em;
}
.badge-draft, .badge-needs_revision { background: #f0f2f3; color: #59676f; }
.badge-verified, .badge-approved, .badge-finished, .badge-submitted { background: var(--brand-soft); color: var(--brand); }
.badge-waiting_verification, .badge-warning { background: var(--amber-soft); color: var(--amber); }
.badge-scheduled, .badge-active { background: var(--blue-soft); color: var(--blue); }
.badge-archived, .badge-locked { background: var(--red-soft); color: var(--red); }
.badge-neutral { background: #edf2ef; color: #52665e; }

.status-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 800;
}
.status-active, .status-scheduled, .status-started { background: var(--blue-soft); color: var(--blue); }
.status-completed, .status-submitted, .status-approved { background: var(--brand-soft); color: var(--brand); }
.status-absent, .status-locked { background: var(--red-soft); color: var(--red); }
.status-ready, .status-registered { background: #edf2ef; color: #52665e; }

/* ============================================================
   STAT CARDS / KPI GRID
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.stat-card, .kpi-card {
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255,255,255, 0.7);
  border-top: 1px solid rgba(255,255,255, 0.95);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow .2s, transform .2s;
  position: relative;
  overflow: hidden;
}
.stat-card::before, .kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), #33c98b);
  opacity: 0;
  transition: opacity .2s;
}
.stat-card:hover, .kpi-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card:hover::before, .kpi-card:hover::before { opacity: 1; }
.stat-card-accent {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(24,134,92,.30);
}
.stat-card-accent::before { opacity: 1; background: rgba(255,255,255,.25); }
.stat-label, .kpi-card span { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat-card-accent .stat-label, .stat-card-accent small { color: rgba(255,255,255,.75); }
.stat-card > strong, .kpi-card strong { font-size: 32px; line-height: 1.15; margin: 4px 0; font-weight: 900; letter-spacing: -.5px; }

/* ============================================================
   DATA TABLE
   ============================================================ */
.table-wrap { overflow: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}
.data-table th {
  padding: 12px 16px;
  background: var(--surface-2);
  text-align: left;
  color: var(--muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--surface-2); }
.data-table td strong, .data-table td small { display: block; }
.data-table td small { margin-top: 2px; }
.table-actions { text-align: right; white-space: nowrap; }
.table-actions a { font-weight: 700; font-size: 12px; margin-left: 8px; }
.empty-cell { text-align: center !important; padding: 40px !important; color: var(--muted); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.form-control, .form-select {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  border-radius: 10px;
  padding: 10px 13px;
  color: var(--text);
  outline: none;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: var(--glow-brand);
}
.form-control::placeholder { color: #aabcb4; }
.field-error { color: var(--red); font-size: 11px; }
.help-text { font-size: 11px; color: var(--muted); }
.form-check { display: flex; align-items: flex-start; gap: 9px; margin: 10px 0; font-size: 13px; }
.form-check-input { margin-top: 3px; accent-color: var(--brand); }

/* Form layouts */
.form-grid { display: grid; gap: 16px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; }
.form-main { display: flex; flex-direction: column; gap: 18px; }
.form-aside { min-width: 0; }
.form-section { padding: 24px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.sticky-card { position: sticky; top: 90px; }

.form-errors {
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
}

/* ============================================================
   ALERTS / TOAST
   ============================================================ */
.alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  animation: slide-down .25s ease;
}
@keyframes slide-down { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }
.alert-success { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid var(--brand-mid); }
.alert-error { background: var(--red-soft); color: var(--red); border: 1px solid #f0b4b0; }
.alert-warning { background: var(--amber-soft); color: var(--amber); border: 1px solid #ebc97a; }
.alert-info { background: var(--blue-soft); color: var(--blue); border: 1px solid #b5d4ef; }
.alert button { border: 0; background: transparent; color: inherit; font-size: 18px; line-height: 1; padding: 0 2px; }
.message-stack { margin-bottom: 16px; }

/* Info box */
.info-box {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  margin: 14px 0;
  font-size: 13px;
}
.info-box.subtle { background: var(--surface-2); color: var(--text-2); }
.info-box.success { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand-mid); }
.info-box strong { flex-shrink: 0; }
.info-box span { font-size: 12px; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  font-size: 12px;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page { background: #0a2f1e; min-height: 100vh; display: flex; }
.login-layout {
  min-height: 100vh;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr minmax(460px, .75fr);
}
.login-brand-panel {
  background: linear-gradient(145deg, #0c4d34 0%, #083326 100%);
  color: #fff;
  padding: 64px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
/* Decorative blobs */
.login-brand-panel::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(51,201,139,.18) 0%, transparent 70%);
  top: -100px; left: -100px;
}
.login-brand-panel::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(24,134,92,.12) 0%, transparent 70%);
  bottom: 50px; right: 60px;
}
.login-brand-content { max-width: 620px; margin: auto; position: relative; z-index: 1; }
.login-logo {
  width: 60px; height: 60px;
  font-size: 30px;
  box-shadow: 0 8px 24px rgba(51,201,139,.30);
}
.login-kicker {
  display: block;
  margin: 26px 0 2px;
  color: #7ecba8;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  font-weight: 700;
}
.login-brand-content h1 {
  font-size: 60px;
  letter-spacing: .06em;
  margin: 0;
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff, #8ce8c0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-brand-content > p {
  font-size: 17px;
  color: #c8e6db;
  max-width: 520px;
  margin: 12px 0 32px;
}
.login-feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 28px; }
.login-feature-grid > div {
  padding: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}
.login-feature-grid strong, .login-feature-grid span { display: block; }
.login-feature-grid span { font-size: 11px; color: #9dd4be; margin-top: 3px; }

.login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  background: #f0f4f2;
}
.login-card {
  max-width: 430px;
  width: 100%;
  margin: auto;
  background: #fff;
  padding: 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.login-card-heading span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--brand);
  font-weight: 800;
}
.login-card-heading h2 { font-size: 26px; margin: 6px 0; font-weight: 900; }
.login-card-heading p { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-note {
  display: flex;
  flex-direction: column;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.login-note strong { color: var(--text); }
.login-footer { text-align: center; font-size: 11px; color: var(--muted); margin-top: 18px; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 20px;
}
.panel-wide { min-width: 0; }
.eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }

/* ============================================================
   TEACHER MODE — Question Bank & Question Form (Moodle-inspired)
   ============================================================ */
/* Question type picker */
.moodle-type-dialog { max-width: 900px; margin: 0 auto; padding: 0; overflow: hidden; }
.moodle-dialog-heading { padding: 22px 26px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.moodle-dialog-heading h2 { margin: 0 0 4px; }
.moodle-dialog-heading p { margin: 0; color: var(--muted); }
.question-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 24px; }
.question-type-card {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 17px;
  cursor: pointer;
  background: #fff;
  transition: all .15s;
}
.question-type-card:hover { border-color: var(--brand-mid); background: var(--brand-soft); box-shadow: var(--shadow-sm); }
.question-type-card input { margin-top: 5px; accent-color: var(--brand); }
.question-type-card:has(input:checked) { border-color: var(--brand); box-shadow: var(--glow-brand); background: var(--brand-soft); }
.question-type-icon {
  width: 44px; height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 20px;
  font-weight: 800;
}
.question-type-copy strong, .question-type-copy small { display: block; }
.question-type-copy small { margin-top: 5px; color: var(--muted); line-height: 1.45; font-size: 12px; }
.moodle-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--surface-2); }

/* Question form */
.moodle-question-form { max-width: 1100px; margin: 0 auto; }
.moodle-form-section { margin-bottom: 20px; overflow: hidden; }
.moodle-form-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.moodle-form-section-header h2 { font-size: 16px; margin: 0; font-weight: 700; }
.moodle-form-section-header span { font-size: 11px; color: var(--muted); }
.moodle-form-body { padding: 18px 24px; }
.moodle-form-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid #edf1ef;
  align-items: start;
}
.moodle-form-row:last-child { border-bottom: 0; }
.moodle-form-row > label { padding-top: 10px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.required-row > label::after { content: ' *'; color: var(--red); }
.compact-field { max-width: 320px; }

/* Answer cards */
.moodle-answer-card {
  margin: 0 24px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  transition: border-color .15s;
}
.moodle-answer-card:hover { border-color: var(--brand-mid); }
.answer-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.answer-card-title strong { font-size: 12px; font-weight: 700; }
.moodle-answer-card .moodle-form-row { padding: 10px 16px; grid-template-columns: 165px minmax(0, 1fr); }
.moodle-formset-actions { display: flex; align-items: center; gap: 9px; padding: 4px 24px 20px; }
.moodle-formset-actions .form-check { margin-left: auto; }

/* Save bar */
.moodle-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 -4px 20px rgba(11,40,27,.10);
  backdrop-filter: blur(12px);
}

/* Short answer settings */
.short-answer-settings {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 1fr);
  gap: 12px 20px;
  padding: 0 0 17px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.smart-threshold { max-width: 320px; }
.review-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 10px;
  font-weight: 700;
}
.smart-review-box { border: 1px solid #efd18a; background: #fffaf0; border-radius: 9px; padding: 12px; margin-top: 12px; }
.smart-review-box strong, .smart-review-box span { display: block; }
.smart-review-box span { font-size: 11px; color: #735a1c; margin-top: 4px; }

/* Question bank list */
.question-cell { min-width: 300px; }
.bank-pick-item { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); }
.bank-pick-item strong, .bank-pick-item small { display: block; }
.bank-pick-item p { font-size: 11px; color: var(--muted); margin: 4px 0; }
.bank-pick-list { padding: 7px 16px; }
.inline-search { display: flex; gap: 7px; padding: 13px; border-bottom: 1px solid var(--line); }

/* ============================================================
   EXAM BUILDER
   ============================================================ */
.builder-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, .8fr); gap: 20px; }
.builder-list { padding: 10px 20px; }
.builder-item {
  display: grid;
  grid-template-columns: 60px 75px minmax(0, 1fr) 80px 36px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.builder-item:last-child { border-bottom: 0; }
.builder-order label, .builder-mark label { display: none; }
.builder-question strong, .builder-question small { display: block; }
.builder-question p { display: none; }
.builder-question strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.question-type-summary { display: none; }
.builder-order-code small { display: none; }
.builder-order-code { text-align: center; font-size: 14px; font-weight: bold; color: var(--muted); }
.builder-item .form-control { padding: 2px 6px; height: 28px; text-align: center; }
.builder-question small { display: none; }

.builder-bank { align-self: start; position: sticky; top: 90px; max-height: calc(100vh - 112px); overflow: auto; }
.section-builder-card { margin-bottom: 20px; overflow: hidden; }
.section-builder-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 18px 22px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.section-builder-header h2 { margin: 3px 0 4px; font-size: 17px; }
.section-builder-header p { margin: 0; color: var(--muted); font-size: 12px; }

/* ============================================================
   EXAM SCHEDULE CARDS
   ============================================================ */
.schedule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.schedule-card {
  padding: 24px;
  transition: box-shadow .2s, transform .2s;
  position: relative;
  overflow: hidden;
}
.schedule-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), #33c98b);
  opacity: 0;
  transition: opacity .2s;
}
.schedule-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.schedule-card:hover::after { opacity: 1; }
.schedule-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.schedule-card-active-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  color: #21c78a;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.schedule-card-active-indicator i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #21c78a;
  box-shadow: 0 0 0 3px rgba(33,199,138,.22);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}
.schedule-card h2 { font-size: 18px; margin: 14px 0 4px; font-weight: 800; }
.schedule-card p { color: var(--muted); font-size: 12px; margin: 0; }
.schedule-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.schedule-meta div { padding: 10px 11px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--line); }
.schedule-meta dt { font-size: 9px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.schedule-meta dd { margin: 3px 0 0; font-weight: 800; font-size: 12px; color: var(--text); }

/* ============================================================
   PROCTOR MONITORING — New Premium Design
   ============================================================ */
/* Top summary strip */
.monitor-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: linear-gradient(135deg, #0c4d34 0%, #083326 60%, #051f19 100%);
  border-radius: var(--radius-lg);
  color: #fff;
  margin-bottom: 20px;
  box-shadow: 0 8px 40px rgba(8,51,38,.35), inset 0 1px 0 rgba(51,201,139,.15);
  overflow: hidden;
  position: relative;
}
.monitor-summary::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(51,201,139,.12) 0%, transparent 70%);
  pointer-events: none;
}
.monitor-summary > div {
  padding: 20px 22px;
  border-right: 1px solid rgba(255,255,255,.08);
  position: relative;
  transition: background .2s;
}
.monitor-summary > div:hover { background: rgba(255,255,255,.04); }
.monitor-summary > div:last-child { border-right: 0; }
.monitor-summary .ms-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,.10);
  margin-bottom: 10px;
  font-size: 16px;
}
.monitor-summary span.ms-label { display: block; font-size: 10px; color: rgba(255,255,255,.60); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }
.monitor-summary strong { display: block; font-size: 32px; font-weight: 900; letter-spacing: -.5px; line-height: 1; }
.monitor-summary .ms-progress { height: 3px; background: rgba(255,255,255,.12); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.monitor-summary .ms-progress-bar { height: 100%; background: linear-gradient(90deg, #33c98b, #21c78a); border-radius: 99px; transition: width .8s ease; }
.monitor-summary .ms-alert { background: rgba(192,39,28,.20); border-right-color: rgba(192,39,28,.2); }
.monitor-summary .ms-alert strong { color: #ff8f87; }
.monitor-summary .ms-alert .ms-icon { background: rgba(192,39,28,.25); }
.monitor-summary .ms-alert .ms-progress-bar { background: linear-gradient(90deg, #ff6b6b, #ff4444); }
.monitor-summary .ms-done strong { color: #7ecba8; }
.monitor-summary .ms-done .ms-progress-bar { background: linear-gradient(90deg, #7ecba8, #33c98b); }

/* Toolbar */
.monitor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  margin-bottom: 18px;
}
.monitor-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  transition: all .15s;
  cursor: pointer;
}
.filter-pill:hover { border-color: var(--brand-mid); color: var(--brand); background: var(--brand-soft); }
.filter-pill.active { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 2px 8px rgba(24,134,92,.28); }

/* Monitor view mode tabs */
.monitor-view-tabs { display: flex; gap: 6px; }
.view-tab {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all .15s;
}
.view-tab.active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-mid); }

/* Student monitoring cards — premium redesign */
.student-monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}
.student-status-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s, transform .15s;
  display: flex;
  flex-direction: column;
}
.student-status-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.student-status-card.status-warning { border-color: #e5b96a; }
.student-status-card.status-locked,
.student-status-card.status-frozen { border-color: #e29093; background: #fffafb; }
.student-status-card.status-submitted { opacity: .72; }

/* Card header */
.student-card-header {
  display: flex;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.student-avatar {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
  color: #fff;
  border-radius: 50%;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(24,134,92,.20);
}
.student-ident { flex: 1; min-width: 0; }
.student-ident strong { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-ident span { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #21c78a;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(33,199,138,.20);
  transition: all .3s;
}
.status-warning .status-dot { background: #d98b12; box-shadow: 0 0 0 3px rgba(217,139,18,.20); }
.status-locked .status-dot,
.status-frozen .status-dot { background: var(--red); box-shadow: 0 0 0 3px rgba(192,39,28,.20); }
.status-submitted .status-dot { background: #7e8d87; box-shadow: none; }
.status-not-started .status-dot { background: #c0cbc5; box-shadow: none; }

/* Card body */
.student-card-body { padding: 13px 14px; flex: 1; }
.student-progress { font-size: 10px; color: var(--muted); font-weight: 600; }
.student-progress > div { height: 4px; background: var(--surface-3); border-radius: 99px; margin: 5px 0 12px; overflow: hidden; }
.student-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #33c98b); border-radius: 99px; width: 0; transition: width .5s ease; }
.student-card-body dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 0; }
.student-card-body dt { font-size: 9px; text-transform: uppercase; color: var(--muted); font-weight: 700; letter-spacing: .05em; }
.student-card-body dd { font-size: 11.5px; font-weight: 700; margin: 2px 0 0; }
.last-event { font-size: 10px; color: var(--amber); margin: 10px 0 0; font-weight: 600; }
.lock-reason { font-size: 10px; color: var(--red); margin: 10px 0 0; font-weight: 600; }

/* ===== CCTV CAMERA TILE ===== */
.camera-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.camera-tile {
  position: relative;
  background: #0d1a14;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1.5px solid #1e3428;
  transition: border-color .2s, box-shadow .2s;
}
.camera-tile:hover { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(24,134,92,.15); }
.camera-tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(.95);
}
.camera-tile video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* Placeholder when no image */
.camera-tile-placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #3d6650;
  font-size: 12px;
  font-weight: 600;
}
.camera-tile-placeholder svg, .camera-tile-placeholder span.cam-icon { font-size: 32px; opacity: .5; }
/* Name overlay on camera */
.camera-name-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 100%);
  padding: 24px 10px 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.camera-name-bar strong {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.camera-name-bar .cam-status {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #21c78a;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(33,199,138,.25);
  animation: pulse-dot 2.5s ease-in-out infinite;
}
.camera-name-bar .cam-status.offline { background: #999; box-shadow: none; animation: none; }
/* Top-right live badge */
.camera-live-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: var(--radius-full);
  letter-spacing: .08em;
  backdrop-filter: blur(4px);
}
.camera-live-badge i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ff4444;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
/* Security suspended badge */
.camera-suspended-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(192,39,28,.80);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
  letter-spacing: .04em;
}

/* Card actions */
.student-card-actions {
  display: flex;
  border-top: 1px solid var(--line);
}
.student-card-actions button {
  flex: 1;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 9px 4px;
  font-size: 11px;
  color: var(--brand);
  font-weight: 700;
  transition: background .12s;
  cursor: pointer;
}
.student-card-actions button:last-child { border-right: 0; }
.student-card-actions button:hover { background: var(--brand-soft); }
.student-card-actions button:disabled { color: #b0bfb8; background: #f5f7f6; cursor: not-allowed; }
.student-card-actions button.danger { color: var(--red); }
.student-card-actions button.danger:hover { background: var(--red-soft); }

/* Monitor modal */
.monitor-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
}
.monitor-modal[hidden] { display: none; }
.monitor-modal-backdrop { position: absolute; inset: 0; background: rgba(8,33,22,.65); backdrop-filter: blur(4px); }
.monitor-modal-card {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-lg);
  animation: modal-in .2s ease;
}
@keyframes modal-in { from { opacity:0; transform:scale(.96) translateY(10px); } to { opacity:1; transform:none; } }
.monitor-modal-close {
  position: absolute;
  right: 14px; top: 14px;
  border: 0;
  background: var(--surface-3);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 18px;
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: background .15s;
}
.monitor-modal-close:hover { background: var(--line); color: var(--text); }
.modal-heading h2 { margin: 5px 0; }
.modal-heading p { color: var(--muted); font-size: 12px; }
.modal-stat-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 18px 0; }
.modal-stat-row > div { background: var(--surface-2); padding: 13px; border-radius: 10px; }
.modal-stat-row span, .modal-stat-row strong { display: block; }
.modal-stat-row span { font-size: 10px; color: var(--muted); }
.modal-stat-row strong { font-size: 22px; font-weight: 900; }
.event-list, .action-history { display: grid; gap: 8px; margin-bottom: 20px; }
.event-row, .action-history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.event-row > div, .action-history-row { flex: 1; }
.event-row strong, .event-row span, .action-history-row strong, .action-history-row span, .action-history-row small { display: block; }
.event-row span, .action-history-row span, .action-history-row small { font-size: 10px; color: var(--muted); }
.event-row.severity-critical { border-color: #f0b4b0; background: var(--red-soft); }
.event-row.severity-warning { border-color: #ebc97a; background: var(--amber-soft); }
.monitor-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.monitor-action-grid button {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 11px;
  padding: 14px;
  color: var(--brand);
  font-weight: 800;
  font-size: 13px;
  transition: all .15s;
  cursor: pointer;
}
.monitor-action-grid button:hover { background: var(--brand-soft); border-color: var(--brand-mid); }
.monitor-action-grid button.danger { color: var(--red); }
.monitor-action-grid button.danger:hover { background: var(--red-soft); border-color: #f0b4b0; }
.monitor-action-grid button.warning-action { color: var(--amber); }
.monitor-action-grid button.warning-action:hover { background: var(--amber-soft); border-color: #ebc97a; }
.transfer-result { text-align: center; padding: 18px; }
.transfer-result h2 { font-size: 38px; letter-spacing: .1em; margin: 8px 0; color: var(--brand); font-weight: 900; }
.transfer-result p { color: var(--muted); }

/* ============================================================
   STUDENT — Exam Runtime (Premium Redesign)
   ============================================================ */
.exam-runtime-body {
  background: #07291a;
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(24, 134, 92, 0.25) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 70%, rgba(8, 51, 38, 0.4) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 100%, rgba(51, 201, 139, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  overflow: hidden;
  user-select: none;
}
.exam-runtime { height: 100vh; display: flex; flex-direction: column; }

/* Header */
.exam-runtime-header {
  height: 68px;
  background: linear-gradient(90deg, #051f19 0%, #0c4d34 40%, #107a50 100%);
  color: #fff;
  display: grid;
  grid-template-columns: 300px 1fr 260px;
  align-items: center;
  padding: 0 22px;
  gap: 18px;
  box-shadow: 0 4px 28px rgba(0,0,0,.35), 0 1px 0 rgba(51,201,139,.2);
  z-index: 5;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(51,201,139,.15);
}
.exam-runtime-brand { display: flex; align-items: center; gap: 11px; }
.exam-runtime-brand > span {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.18);
  color: #fff;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-weight: 900;
  font-size: 21px;
  border: 1.5px solid rgba(255,255,255,.25);
}
.exam-runtime-brand strong, .exam-runtime-brand small,
.exam-runtime-title strong, .exam-runtime-title span { display: block; }
.exam-runtime-brand small, .exam-runtime-title span { color: rgba(255,255,255,.65); font-size: 10px; }
.exam-runtime-title { text-align: center; }
.exam-runtime-title strong { font-size: 14px; font-weight: 700; }
.exam-runtime-status { text-align: right; }
.exam-runtime-status span, .exam-runtime-status strong { display: block; }
.exam-runtime-status span { font-size: 10px; color: rgba(255,255,255,.65); }
.exam-runtime-status strong { font-size: 26px; font-weight: 900; letter-spacing: .04em; }
.exam-runtime-status [data-state="error"] { color: #ff9990; }

/* Timer warning flash */
@keyframes timer-warning { 0%, 100% { color: #ff9990; } 50% { color: #fff; } }

/* Main area */
.exam-runtime-main {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Question Stage */
.exam-question-stage {
  flex: 1;
  padding: 24px 2%;
  overflow-y: auto;
}

/* Question nav (bottom bar) */
.exam-question-nav-bottom {
  background: rgba(7, 41, 26, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(51,201,139,.15);
  padding: 18px 2%;
  flex-shrink: 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,.25);
}
.exam-nav-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 14px; }
.exam-nav-heading strong, .exam-nav-heading span { display: block; }
.exam-nav-heading strong { color: rgba(255,255,255,.85); font-size: 11px; }
.exam-nav-heading span { font-size: 10px; color: rgba(255,255,255,.45); }

/* Palette – Moodle V0.8.1 style adapted for bottom nav */
.moodle-quiz-navigation { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.moodle-quiz-navigation-header { display: none; }
.question-palette { flex: 1; display: flex !important; gap: 10px; overflow-x: auto; padding: 0 10px 10px; }
.palette-section { padding: 0; border: none; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 150px; flex: 1; }
.palette-section-heading { display: none; }
.palette-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.palette-section-heading-copy { min-width: 0; }
.palette-section-heading strong { display: block; color: rgba(255,255,255,.85); font-size: 13px; }
.palette-section-title { display: none; margin-top: 2px; color: rgba(255,255,255,.45); font-size: 11px; }
.palette-section-count { flex: 0 0 auto; color: rgba(255,255,255,.35); font-size: 10px; white-space: nowrap; }
.palette-section-buttons { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.palette-section-buttons button {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px; height: 34px;
  min-width: 32px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.75);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  transition: all .15s;
}
.palette-section-buttons button:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3); color: #fff; }
.palette-section-buttons button.answered { background: linear-gradient(to bottom, rgba(255,255,255,.1) 0, rgba(255,255,255,.1) calc(100% - 7px), rgba(104,115,125,.7) calc(100% - 7px), rgba(104,115,125,.7) 100%); border-color: rgba(255,255,255,.2); }
.palette-section-buttons button.active { border: 2px solid #3dd99b; background: rgba(61,217,155,.18); box-shadow: 0 0 0 2px rgba(61,217,155,.25), 0 0 12px rgba(61,217,155,.15); color: #fff; }
.palette-section-buttons button.active.answered { background: linear-gradient(to bottom, rgba(61,217,155,.18) 0, rgba(61,217,155,.18) calc(100% - 7px), #3dd99b calc(100% - 7px), #3dd99b 100%); }
.palette-section-buttons button.flagged::after { content: ''; position: absolute; top: -1px; right: -1px; width: 0; height: 0; border-top: 13px solid #d9534f; border-left: 13px solid transparent; }
.moodle-quiz-navigation-legend { display: flex; gap: 12px; padding: 0; border: none; color: rgba(255,255,255,.45); font-size: 10px; }
.moodle-quiz-navigation-legend span { display: flex; align-items: center; gap: 7px; }
.moodle-quiz-navigation-legend i { position: relative; width: 19px; height: 20px; flex: 0 0 19px; border: 1px solid rgba(255,255,255,.2); border-radius: 3px; background: rgba(255,255,255,.08); }
.moodle-quiz-navigation-legend i.state-current { border: 2px solid #3dd99b; background: rgba(61,217,155,.15); }
.moodle-quiz-navigation-legend i.state-answered { background: linear-gradient(to bottom, rgba(255,255,255,.08) 0, rgba(255,255,255,.08) 62%, rgba(104,115,125,.8) 62%, rgba(104,115,125,.8) 100%); }
.moodle-quiz-navigation-legend i.state-flagged::after { content: ''; position: absolute; top: -1px; right: -1px; width: 0; height: 0; border-top: 9px solid #d9534f; border-left: 9px solid transparent; }
.moodle-finish-attempt { padding: 10px 20px; border: none; background: linear-gradient(135deg, #33c98b, var(--brand)); border-radius: 8px; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: all .2s; box-shadow: 0 4px 14px rgba(33,199,138,.35); }
.moodle-finish-attempt:hover { background: linear-gradient(135deg, #3dd99b, #1a9e6a); box-shadow: 0 6px 20px rgba(33,199,138,.45); transform: translateY(-1px); }

/* Question stage */
.exam-question-stage {
  padding: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: transparent;
  gap: 16px;
}
.exam-question-card {
  max-width: 940px;
  width: 100%;
  margin: 0 auto;
  overflow-y: auto;
  flex: 1;
  padding: 32px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,1);
  flex: 1;
  backdrop-filter: blur(4px);
}
.exam-question-topline { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 700; letter-spacing: .06em; }
.exam-question-card h1 { font-size: 19px; margin: 16px 0 8px; font-weight: 700; }
.exam-question-prompt { font-size: 16px; white-space: pre-wrap; line-height: 1.75; padding: 14px 0 20px; border-bottom: 1px solid var(--line); user-select: none; }
.exam-answer-area { padding: 22px 0; }

/* Options */
.runtime-option-list { display: grid; gap: 10px; }
.runtime-option {
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  background: #fff;
  transition: all .15s;
}
.runtime-option:hover { background: var(--surface-2); border-color: var(--brand-mid); }
.runtime-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: var(--glow-brand); }
.runtime-option input { position: absolute; opacity: 0; pointer-events: none; }
.runtime-option-marker {
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  font-weight: 800;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.runtime-option:has(input:checked) .runtime-option-marker { background: var(--brand); color: #fff; }
.runtime-option-text { white-space: pre-wrap; font-size: 14px; line-height: 1.6; }

/* Text / Essay answers */
.runtime-text-answer {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: #fff;
  outline: none;
  user-select: text;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.runtime-text-answer:focus { border-color: var(--brand); box-shadow: var(--glow-brand); }
.runtime-essay-answer { resize: none; line-height: 1.65; }

/* Flag control */
.exam-flag-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--amber);
  font-weight: 700;
  cursor: pointer;
}
.exam-flag-control input { accent-color: var(--amber); }

/* Navigation actions */
.exam-navigation-actions {
  max-width: 940px;
  width: 100%;
  margin: 16px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* Gates, overlays */
.exam-gate, .exam-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8,33,22,.92);
  display: grid;
  place-items: center;
  padding: 20px;
  backdrop-filter: blur(8px);
}
.exam-gate[hidden], .exam-lock-overlay[hidden] { display: none; }
.exam-gate-card, .exam-lock-card {
  max-width: 520px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modal-in .25s ease;
}
.exam-gate-card .state-icon {
  width: 66px; height: 66px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 29px;
  margin: 0 auto 18px;
}
.exam-gate-card h1, .exam-lock-card h1 { font-size: 24px; margin: 6px 0 9px; font-weight: 900; }
.exam-gate-card p, .exam-lock-card p { color: var(--muted); margin-bottom: 20px; font-size: 14px; }
.exam-gate-card .btn { margin: 4px; }
.lock-symbol {
  width: 70px; height: 70px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 900;
  font-size: 32px;
  margin: 0 auto 18px;
  box-shadow: 0 0 0 8px rgba(192,39,28,.08);
}

/* Security suspended overlay (softer) */
.exam-security-suspended {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: rgba(12,77,52,.92);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
  animation: slide-up .3s ease;
  white-space: nowrap;
}
.exam-security-suspended[hidden] { display: none; }
@keyframes slide-up { from { opacity:0; transform:translateX(-50%) translateY(10px); } to { opacity:1; transform:translateX(-50%) none; } }
.exam-security-suspended .sec-dot { width: 8px; height: 8px; border-radius: 50%; background: #33c98b; animation: pulse-dot 1.5s ease-in-out infinite; }

/* Toast */
.exam-toast {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 150;
  max-width: 360px;
  padding: 13px 16px;
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  font-weight: 700;
  animation: slide-up .25s ease;
  display: flex;
  align-items: center;
  gap: 9px;
}
.exam-toast.warning { background: var(--amber-soft); color: var(--amber); }
.exam-toast.error { background: var(--red-soft); color: var(--red); }

/* Paper essay box */
.paper-answer-box { display: flex; gap: 16px; padding: 20px; border: 1.5px solid var(--brand-mid); border-radius: var(--radius); background: var(--brand-soft); }
.paper-answer-icon { width: 44px; height: 44px; border-radius: 12px; background: #fff; color: var(--brand); display: grid; place-items: center; font-size: 24px; flex: 0 0 auto; box-shadow: var(--shadow-sm); }
.paper-answer-box strong { display: block; font-size: 16px; }
.paper-answer-box p { margin: 6px 0 14px; color: var(--muted); font-size: 13px; }
.paper-answer-check { display: flex; align-items: flex-start; gap: 9px; padding: 11px 14px; background: #fff; border: 1.5px solid var(--brand-mid); border-radius: 10px; font-weight: 700; font-size: 13px; }
.paper-answer-check input { margin-top: 3px; accent-color: var(--brand); }

/* Student dashboard */
.student-exam-list { display: grid; gap: 16px; }
.student-exam-card {
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(330px, .8fr) auto;
  gap: 22px;
  align-items: center;
  transition: box-shadow .15s;
}
.student-exam-card:hover { box-shadow: var(--shadow); }
.student-exam-card.is-submitted { opacity: .75; }
.student-exam-card-main { display: flex; gap: 14px; align-items: center; }
.exam-type-mark {
  width: 50px; height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-soft), var(--brand-mid));
  color: var(--brand);
  font-size: 22px;
  font-weight: 900;
  flex: 0 0 auto;
}
.student-exam-card-main .eyebrow { font-size: 10px; color: var(--brand); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.student-exam-card h2 { font-size: 18px; margin: 3px 0; font-weight: 800; }
.student-exam-card p { margin: 0; color: var(--muted); font-size: 12px; }
.student-exam-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.student-exam-meta div { padding: 10px; background: var(--surface-2); border-radius: 10px; }
.student-exam-meta dt { font-size: 9px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.student-exam-meta dd { margin: 3px 0 0; font-size: 11px; font-weight: 800; }
.student-exam-actions { min-width: 210px; }
.token-start-form { display: flex; gap: 7px; }
.token-start-form input { width: 130px; text-transform: uppercase; }

/* Transfer card */
.transfer-card { max-width: 620px; padding: 30px; }
.transfer-token-input { text-transform: uppercase; letter-spacing: .14em; font-weight: 800; font-size: 18px; }
.token-reveal { padding: 20px 24px; margin-bottom: 20px; border-color: var(--brand-mid); background: var(--brand-soft); }
.token-reveal span, .token-reveal strong, .token-reveal p { display: block; }
.token-reveal span { font-size: 11px; text-transform: uppercase; color: var(--brand); font-weight: 700; }
.token-reveal strong { font-size: 36px; letter-spacing: .1em; margin: 4px 0; color: var(--brand); }
.token-reveal p { margin: 0; color: var(--muted); font-size: 12px; }

/* ============================================================
   SIMULATION BANNER
   ============================================================ */
.simulation-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  border: 1.5px solid #ebc97a;
  background: var(--amber-soft);
  border-radius: var(--radius);
  color: var(--amber);
}
.simulation-banner strong { white-space: nowrap; }
.simulation-banner span { font-size: 12px; }

/* ============================================================
   SECTION TABS (exam builder / runtime)
   ============================================================ */
.exam-section-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.exam-section-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
  transition: all .15s;
  cursor: pointer;
}
.exam-section-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 10px rgba(24,134,92,.25); }
.exam-section-tab small { font-size: 10px; opacity: .75; }
.exam-section-label { display: inline-flex; padding: 5px 10px; border-radius: var(--radius-full); background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 800; margin-bottom: 10px; }
.section-instructions { padding: 10px 14px; margin: 12px 0; border-left: 4px solid var(--brand); background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--muted); font-size: 12px; }

/* ============================================================
   GRADING / ANALYSIS
   ============================================================ */
.grading-list { display: grid; gap: 18px; padding-bottom: 90px; }
.grading-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); transition: box-shadow .15s; }
.grading-card:hover { box-shadow: var(--shadow); }
.grading-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 14px; }
.grading-card header h2 { margin: 4px 0; font-size: 17px; }
.question-number { font-size: 11px; color: var(--brand); font-weight: 800; text-transform: uppercase; }
.mark-badge { background: var(--brand-soft); color: var(--brand); border-radius: var(--radius-full); padding: 6px 12px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.question-prompt { padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.student-answer-box { margin: 14px 0; padding: 15px; border-radius: 10px; background: var(--surface-2); }
.student-answer-box > span { display: block; font-size: 10px; text-transform: uppercase; color: var(--muted); font-weight: 800; margin-bottom: 5px; }
.manual-grade-grid { display: grid; grid-template-columns: 180px 1fr; gap: 16px; margin-top: 16px; }
.result-pass { display: inline-flex; padding: 4px 10px; border-radius: var(--radius-full); background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 800; }
.result-fail { display: inline-flex; padding: 4px 10px; border-radius: var(--radius-full); background: var(--red-soft); color: var(--red); font-size: 11px; font-weight: 800; }
.sticky-form-actions {
  position: fixed;
  z-index: 30;
  bottom: 0;
  left: var(--sidebar);
  right: 0;
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
  padding: 13px 28px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  backdrop-filter: blur(10px);
}

/* ============================================================
   MATH EDITOR
   ============================================================ */
.math-editor-tools { border: 1.5px solid var(--line-strong); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--surface-2); }
.math-editor-tools + textarea, .math-editor-tools + input { border-radius: 0 0 10px 10px; }
.math-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 7px; border-bottom: 1px solid var(--line); }
.math-tool-button { border: 1px solid var(--line-strong); background: #fff; border-radius: 6px; padding: 5px 9px; font-size: 11px; cursor: pointer; color: var(--text-2); transition: all .12s; }
.math-tool-button:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.math-live-preview { min-height: 40px; padding: 9px 12px; background: #fff; font-size: 15px; overflow: auto; }
.math-preview-placeholder { font-size: 11px; color: var(--muted); }
.math-render { font-family: 'Cambria Math', 'STIX Two Math', 'Times New Roman', serif; white-space: nowrap; }
.math-block { display: block; text-align: center; padding: 8px 0; }
.math-frac { display: inline-flex; vertical-align: middle; flex-direction: column; text-align: center; line-height: 1.08; margin: 0 .18em; }
.math-frac > span:first-child { border-bottom: 1px solid currentColor; padding: 0 .15em .08em; }
.math-frac > span:last-child { padding: .08em .15em 0; }
.math-root { display: inline-flex; align-items: flex-start; }
.root-sign { font-size: 1.35em; line-height: .85; }
.root-body { border-top: 1px solid currentColor; padding: 0 .12em; }
.math-render sup, .math-render sub { font-size: .72em; }
.question-prompt .math-render, .runtime-option-text .math-render { font-size: 1.04em; }

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.centered-state { max-width: 640px; margin: 60px auto; padding: 46px; text-align: center; }
.centered-state .state-icon { width: 70px; height: 70px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 18px; background: var(--brand-soft); color: var(--brand); font-size: 32px; box-shadow: var(--shadow-sm); }
.centered-state p { color: var(--muted); max-width: 500px; margin: 0 auto 20px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.detail-sidebar { padding: 22px; }
.detail-sidebar h2 { font-size: 17px; }
.detail-list { margin: 0; }
.detail-list > div { padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { font-size: 10px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.detail-list dd { margin: 3px 0 0; font-size: 13px; font-weight: 600; }
.muted-text { color: var(--muted); font-size: 12px; }
.preline { white-space: pre-line; }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.separator { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* ============================================================
   V0.9 — Academics admin modules
   ============================================================ */
.admin-module-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0 0 20px; }
.admin-module { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; color: var(--text); display: flex; flex-direction: column; gap: 5px; box-shadow: var(--shadow-sm); transition: all .18s; }
.admin-module:hover { border-color: var(--brand-mid); box-shadow: var(--shadow); transform: translateY(-2px); }
.admin-module > span { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 900; font-size: 18px; margin-bottom: 5px; }
.admin-module strong { font-size: 15px; font-weight: 700; }
.admin-module small { line-height: 1.45; }

.group-card-grid { padding: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.group-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--text); background: var(--surface-2); display: flex; flex-direction: column; gap: 7px; transition: all .15s; }
.group-card:hover { background: #fff; border-color: var(--brand-mid); box-shadow: var(--shadow); }
.group-card-kicker { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); font-weight: 800; }
.group-card > strong { font-size: 16px; font-weight: 700; }
.group-card-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.group-card-stats b { color: var(--text); }
.group-card-footer { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 5px; font-size: 11px; color: var(--muted); }

.course-card-grid { padding: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.course-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--text); display: flex; flex-direction: column; gap: 5px; transition: all .15s; }
.course-card:hover { border-color: var(--brand-mid); background: var(--surface-2); box-shadow: var(--shadow-sm); }
.course-code { font-size: 10px; color: var(--brand); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.course-card > strong { font-size: 15px; font-weight: 700; }

/* Proctor assignment */
.proctor-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; margin-bottom: 20px; }
.proctor-card-list { padding: 12px 20px 20px; }
.proctor-card { display: grid; grid-template-columns: minmax(250px, 1fr) auto auto; gap: 12px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.proctor-card:last-child { border-bottom: 0; }
.proctor-identity { display: flex; align-items: center; gap: 12px; }
.proctor-identity strong, .proctor-identity span, .proctor-identity small { display: block; }
.proctor-identity span { font-size: 12px; color: var(--muted); }
.compact-form { position: absolute; right: 0; top: 44px; width: 360px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 10; }
.mode-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 900px; margin: 0 auto; }
.mode-choice-card { padding: 28px; display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-height: 320px; transition: all .18s; }
.mode-choice-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.mode-choice-card h2 { margin: 5px 0 8px; font-size: 23px; font-weight: 800; }
.mode-choice-card p { color: var(--muted); }
.mode-choice-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 28px; margin-bottom: 18px; }
.mode-choice-proctor .mode-choice-icon { background: var(--blue-soft); color: var(--blue); }
.assigned-room-list { width: 100%; display: flex; flex-direction: column; gap: 7px; margin: auto 0 14px; }
.assigned-room-list span { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); font-size: 11px; }
.assigned-room-list strong { color: var(--blue); margin-right: 5px; }

/* Operations */
.secure-station-identity { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); margin-bottom: 20px; }
.secure-station-identity span, .secure-station-identity strong, .secure-station-identity small { display: block; }
.secure-station-identity span { font-size: 10px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.secure-station-identity strong { font-size: 17px; margin: 3px 0; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.action-card { padding: 22px; }
.action-card h2 { font-size: 17px; margin-bottom: 6px; }
.action-card p { color: var(--muted); font-size: 12px; }
.action-card form { display: grid; gap: 10px; }
.import-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; }
.filter-bar { display: flex; gap: 10px; padding: 14px; margin-bottom: 16px; }
.filter-bar .form-control { flex: 1; }
.finalize-box { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; margin: 18px 0; }
.kpi-card span { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.kpi-card strong { font-size: 28px; margin: 4px 0; }

/* section manager */
.section-manager { padding: 22px; }
.section-manager-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.builder-section-block { border-top: 1px solid var(--line); }
.builder-section-block:first-child { border-top: 0; }
.builder-section-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 18px; background: var(--surface-2); }
.builder-section-title strong, .builder-section-title span { display: block; }
.builder-section-title span { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   FILTER PANEL
   ============================================================ */
.filter-panel { padding: 16px; margin-bottom: 20px; }
.filter-grid { display: grid; grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(130px, 1fr)) auto; gap: 12px; align-items: end; }
.filter-actions { display: flex; gap: 5px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .stat-grid, .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-module-grid { grid-template-columns: repeat(2, 1fr); }
  .group-card-grid, .course-card-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .builder-layout { grid-template-columns: 1fr; }
  .builder-bank { position: static; max-height: none; }
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .form-layout, .detail-layout { grid-template-columns: 1fr; }
  .form-aside .sticky-card { position: static; }
  .login-layout { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-panel { width: 100%; }
  .menu-button { display: grid; }
  .topbar { padding: 0 14px; }
  .server-indicator, .user-summary { display: none; }
  .content { padding: 18px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .heading-actions { width: 100%; }
  .monitor-summary { grid-template-columns: repeat(3, 1fr); }
  .mode-choice-grid, .proctor-layout { grid-template-columns: 1fr; }
  .proctor-card { grid-template-columns: 1fr; }
  .compact-form { position: static; width: 100%; margin-top: 10px; }
  .mode-indicator { display: none; }
  .two-columns, .detail-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .action-grid, .kpi-grid { grid-template-columns: 1fr 1fr; }
  .section-manager-grid { grid-template-columns: 1fr; }
  .manual-grade-grid { grid-template-columns: 1fr; }
  .sticky-form-actions { left: 0; }
  .student-exam-card { grid-template-columns: 1fr; }
  .student-exam-actions { min-width: 0; }
  .student-exam-meta { grid-template-columns: 1fr; }
  .modal-stat-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .stat-grid, .kpi-grid { grid-template-columns: 1fr; }
  .admin-module-grid, .group-card-grid, .course-card-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr; }
  .monitor-summary { grid-template-columns: repeat(2, 1fr); }
  .student-monitor-grid { grid-template-columns: 1fr; }
  .camera-grid { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 14px; }
  .panel { border-radius: 11px; }
  .exam-section-tabs { flex-wrap: wrap; }
  .monitor-action-grid { grid-template-columns: 1fr; }
}

/* Exam runtime responsive */
@media (max-width: 1100px) {
  .exam-runtime-header { grid-template-columns: 260px minmax(0, 1fr) 180px; }
  .exam-runtime-main { grid-template-columns: 260px 1fr; }
}
@media (max-width: 820px) {
  .exam-runtime-body { overflow: auto; }
  .exam-runtime { height: auto; min-height: 100vh; }
  .exam-runtime-header { position: sticky; top: 0; grid-template-columns: minmax(0, 1fr) auto; height: auto; min-height: 66px; padding: 10px 14px; }
  .exam-runtime-brand { display: none; }
  .exam-runtime-title { text-align: left; }
  .exam-runtime-main { display: flex; flex-direction: column; }
  .exam-question-nav { order: 2; border-right: 0; border-top: 1px solid var(--line); padding: 12px; }
  .exam-question-stage { order: 1; min-height: calc(100vh - 66px); padding: 16px; }
  .exam-question-card { padding: 20px; }
}
@media (max-width: 600px) {
  .exam-runtime-body::before {
    content: "SANTARA Exam tidak mendukung layar ponsel. Gunakan laptop, PC, atau tablet yang disetujui sekolah.";
    position: fixed; inset: 0; z-index: 999; background: #fff; color: var(--red); display: grid; place-items: center; text-align: center; padding: 40px; font-weight: 800; font-size: 14px;
  }
  .exam-runtime { display: none; }
}

/* ============================================================
   MISC CARRY-FORWARD (legacy compatibility)
   ============================================================ */
.compact-stats { margin-bottom: 20px; }
.status-word { font-size: 24px !important; }
.status-word.small { font-size: 18px !important; }
.timeline-list { padding: 5px 20px 18px; }
.timeline-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-date { width: 44px; height: 48px; border-radius: 10px; background: var(--brand-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 0 0 auto; }
.timeline-date strong { line-height: 1; }
.timeline-date span { font-size: 10px; text-transform: uppercase; }
.timeline-item > div:last-child strong, .timeline-item > div:last-child span { display: block; }
.timeline-item > div:last-child span { font-size: 11px; color: var(--muted); margin-top: 3px; }
.chip-list { padding: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; gap: 5px; padding: 7px 11px; border-radius: var(--radius-full); background: var(--surface-2); font-size: 12px; border: 1px solid var(--line); }
.empty-state { padding: 36px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-state.compact { padding: 20px 4px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 3px 0 0; font-size: 17px; }
.split-heading { align-items: center; }
.compact-group-list { padding: 8px 20px 16px; }
.compact-group-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.compact-group-list > div:last-child { border-bottom: 0; }
.compact-group-list span strong, .compact-group-list span small { display: block; }
.compact-group-list b { min-width: 36px; text-align: center; padding: 5px 8px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
.notice-box { padding: 13px 16px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.notice-box span { font-size: 11px; }
.readonly-note { padding: 13px 16px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); margin-top: 12px; }
.master-number { font-weight: 800; color: var(--brand); white-space: nowrap; }
.question-type-summary { display: flex; gap: 6px; flex-wrap: wrap; }
.essay-mode-badge { display: inline-flex; padding: 4px 9px; border-radius: var(--radius-full); background: var(--blue-soft); color: var(--blue); font-size: 10px; font-weight: 800; }
.paper-response-note { padding: 13px 16px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: 12px; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.form-panel { padding: 24px; }
.table-panel { padding: 0; overflow: hidden; }
.responsive-table { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.profile-panel { padding: 24px; }
.profile-hero { display: flex; align-items: center; gap: 16px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.profile-hero h2 { margin: 0; }
.profile-hero p { color: var(--muted); margin: 2px 0 0; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.detail-grid > div { padding: 15px 0; border-bottom: 1px solid var(--line); }
.detail-grid dt { font-size: 11px; color: var(--muted); }
.detail-grid dd { margin: 3px 0 0; font-weight: 600; }
.section-heading { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.section-heading > span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.section-heading h2, .form-section > h2 { font-size: 17px; margin: 1px 0 3px; }
.section-heading p { font-size: 12px; color: var(--muted); margin: 0; }
.stack-form { display: flex; flex-direction: column; gap: 15px; }
.stack-form input[type=text], .stack-form input[type=password], .stack-form input[type=number], .stack-form select, .stack-form textarea { width: 100%; border: 1.5px solid var(--line-strong); background: #fff; border-radius: 10px; padding: 10px 13px; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.stack-form input:focus, .stack-form select:focus, .stack-form textarea:focus { border-color: var(--brand); box-shadow: var(--glow-brand); }
.summary-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.summary-strip > div { padding: 17px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip strong { font-size: 18px; font-weight: 800; }
.summary-strip span { font-size: 11px; color: var(--muted); }
.warning-list { margin: 0 20px 20px; padding: 14px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); display: flex; flex-direction: column; gap: 4px; }
.warning-list span { font-size: 11px; }
.import-result-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
.import-result-grid > div { padding: 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.import-result-grid > div:last-child { border-right: 0; }
.import-result-grid strong { font-size: 22px; font-weight: 800; }
.import-result-grid span { font-size: 11px; color: var(--muted); }
.schedule-empty { grid-column: 1 / -1; }
.option-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.option-row { display: grid; grid-template-columns: 80px minmax(200px, 1fr) 60px 60px; gap: 10px; padding: 9px; align-items: center; border-top: 1px solid var(--line); }
.option-row:first-child { border-top: 0; }
.option-head { background: var(--surface-2); font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.option-check { text-align: center; }
.review-comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.smart-review-card .student-answer-box { margin: 0; }
.schedule-proctors { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.schedule-proctors span { font-size: 10px; padding: 4px 8px; border-radius: var(--radius-full); background: var(--surface-2); border: 1px solid var(--line); }
.text-link { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 700; }
.checkbox-group { justify-content: flex-end; }
.checkbox-group input { width: 18px; height: 18px; accent-color: var(--brand); }
.process-list { padding-left: 20px; color: var(--muted); font-size: 13px; }
.process-list li { margin: 9px 0; }
.direct-create-box { padding: 14px; border: 1.5px dashed var(--brand-mid); border-radius: 10px; background: var(--brand-soft); margin: 12px; }
.direct-create-box strong, .direct-create-box span { display: block; }
.direct-create-box span { font-size: 11px; color: var(--muted); margin: 3px 0 10px; }
.section-builder-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.section-builder-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-type-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 4px 0; }
.section-type-list label { display: flex; gap: 8px; align-items: flex-start; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: 12px; cursor: pointer; transition: all .15s; }
.section-type-list label:hover { border-color: var(--brand-mid); background: var(--brand-soft); }
.palette-section-buttons button.flagged { box-shadow: inset 0 -4px 0 #d88a12; }
.objective-grade { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); margin-top: 14px; }
.option-distribution { display: grid; gap: 3px; min-width: 200px; }
.option-distribution span { font-size: 10px; color: var(--muted); }
.section-preview { margin: 22px 0; }
.section-preview-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; padding: 18px 22px; background: var(--brand-dark); color: #fff; border-radius: 14px 14px 0 0; }
.section-preview-header h2 { margin: 3px 0; font-size: 19px; }
.section-preview-header p { margin: 0; color: #c8ddd5; font-size: 12px; }
.section-preview-header span { font-size: 11px; color: #c8ddd5; }
.section-preview .preview-question-card { border-radius: 0; border-top: 0; }
.section-preview .preview-question-card:last-child { border-radius: 0 0 14px 14px; }
.score-summary { min-width: 170px; background: var(--brand); color: #fff; border-radius: var(--radius); padding: 16px 20px; text-align: right; }
.score-summary span, .score-summary small, .score-summary strong { display: block; }
.score-summary span, .score-summary small { font-size: 11px; color: rgba(255,255,255,.75); }
.score-summary strong { font-size: 30px; font-weight: 900; line-height: 1.1; }
.grading-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; padding: 0; overflow: hidden; margin-bottom: 20px; background: var(--line); }
.grading-summary > div { background: #fff; padding: 18px 20px; }
.grading-summary span, .grading-summary strong { display: block; }
.grading-summary span { font-size: 11px; color: var(--muted); }
.grading-summary strong { margin-top: 5px; font-weight: 800; }
.replace-box { position: relative; }
.replace-box summary { list-style: none; }
.replace-box summary::-webkit-details-marker { display: none; }
.remove-proctor-form { margin: 0; }
.compact-info { margin-top: 18px; }
.assignment-history-panel { margin-top: 20px; }
.muted { color: var(--muted); }
.builder-order-code { min-width: 86px; }
.builder-order-code strong { display: block; font-size: 13px; color: var(--brand); }
.builder-order-code small { display: block; font-size: 10px; color: var(--muted); }
.exam-preview-shell { max-width: 960px; margin: auto; }
.exam-preview-header { padding: 22px 26px; background: var(--brand-dark); color: #fff; border-radius: 14px; display: flex; justify-content: space-between; }
.exam-preview-header h2 { margin: 3px 0; }
.exam-preview-header p, .exam-preview-header span { color: #b7d1c7; margin: 0; }
.exam-timer { text-align: right; }
.exam-timer strong { display: block; }
.instructions-box { padding: 20px; margin: 16px 0; }
.preview-question-list { display: flex; flex-direction: column; gap: 14px; }
.preview-question-card { display: grid; grid-template-columns: 46px 1fr; padding: 20px; }
.preview-question-number { width: 36px; height: 36px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); border-radius: 10px; font-weight: 800; }
.question-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.student-option-list { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.student-option-list label { display: flex; gap: 9px; border: 1px solid var(--line); padding: 11px; border-radius: 9px; cursor: pointer; }
.answer-preview { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.answer-preview > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-weight: 700; }
.answer-preview.correct { border-color: var(--brand-mid); background: var(--brand-soft); }
.answer-preview-list { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.answer-key-box { margin-top: 20px; padding: 16px; background: var(--surface-2); border-radius: 10px; }
.answer-key-box > strong, .answer-key-box > span { display: block; margin-bottom: 7px; }
/* Camera Widget */
.floating-camera-widget {
  position: fixed;
  bottom: 100px;
  left: 24px;
  width: 175px;
  height: 130px;
  border-radius: 14px;
  background: #000;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,.5), 0 0 0 1px rgba(51,201,139,.25);
  z-index: 50;
  border: 2px solid rgba(51,201,139,0.30);
  transition: transform .2s, box-shadow .2s;
}
.floating-camera-widget:hover {
  transform: scale(1.04);
  box-shadow: 0 20px 56px rgba(0,0,0,.6), 0 0 0 2px rgba(51,201,139,.4);
}
.floating-camera-widget video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.camera-status-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.80), transparent);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 14px 10px 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #33c98b;
  box-shadow: 0 0 8px #33c98b;
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ============================================================
   DASHBOARD COMPONENTS
   ============================================================ */

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

/* Admin Modules Grid */
.admin-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.admin-module {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all .2s ease;
  box-shadow: var(--shadow-sm);
}
.admin-module:hover {
  border-color: var(--brand-mid);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.admin-module span {
  font-size: 24px;
  margin-bottom: 12px;
  color: var(--brand);
}
.admin-module strong {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}
.admin-module small {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

/* Resource List */
.resource-list {
  display: flex;
  flex-direction: column;
  padding: 0;
}
.resource-item {
  display: flex;
  align-items: center;
  padding: 14px 22px;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  transition: background .15s ease;
}
.resource-item:last-child {
  border-bottom: none;
}
.resource-item:hover {
  background: var(--surface-2);
}
.resource-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}
.resource-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.resource-main strong {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.resource-main small {
  font-size: 12px;
  color: var(--muted);
}
.resource-item .badge {
  flex-shrink: 0;
}

/* Compact Group List */
.compact-group-list {
  display: flex;
  flex-direction: column;
}
.compact-group-list > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}
.compact-group-list > div:last-child {
  border-bottom: none;
}
.compact-group-list span {
  display: flex;
  flex-direction: column;
}
.compact-group-list strong {
  font-size: 13.5px;
  color: var(--text);
}
.compact-group-list small {
  font-size: 11.5px;
  color: var(--muted);
}
.compact-group-list b {
  font-size: 16px;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* Timeline List */
.timeline-list {
  display: flex;
  flex-direction: column;
  padding: 16px 22px;
  gap: 16px;
}
.timeline-item {
  display: flex;
  gap: 16px;
  align-items: center;
}
.timeline-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  flex-shrink: 0;
}
.timeline-date strong {
  font-size: 16px;
  line-height: 1.1;
  color: var(--brand);
}
.timeline-date span {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.timeline-item > div:last-child {
  display: flex;
  flex-direction: column;
}
.timeline-item > div:last-child strong {
  font-size: 13.5px;
  color: var(--text);
}
.timeline-item > div:last-child span {
  font-size: 11.5px;
  color: var(--muted);
}

/* Chip List */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 22px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-2);
  transition: all .2s;
}
.chip:hover {
  background: var(--brand-soft);
  border-color: var(--brand-mid);
  color: var(--brand-dark);
}
.chip strong {
  margin-right: 4px;
  color: var(--brand);
}

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 22px;
  text-align: center;
}
.empty-state.compact {
  padding: 20px;
  flex-direction: row;
  justify-content: space-between;
}
.empty-state strong {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}
.empty-state span {
  font-size: 12.5px;
  color: var(--muted);
}

/* ============================================================
   ENHANCED HOVER EFFECTS & SIDEBAR TOGGLE
   ============================================================ */

/* Sidebar Toggle */
.app-shell {
  transition: grid-template-columns .3s cubic-bezier(.4,0,.2,1);
}
.app-shell.sidebar-closed {
  grid-template-columns: 0 1fr;
}
.app-shell.sidebar-closed .sidebar {
  transform: translateX(-100%);
}
.menu-button {
  display: inline-flex !important; 
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Hover fixes and enhancements */
.admin-module, .resource-item, .stat-card, .timeline-item {
  transition: all 0.25s cubic-bezier(.4,0,.2,1) !important;
}
.admin-module:hover, .stat-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 12px 24px rgba(24,134,92,0.12) !important;
}
.resource-item:hover {
  background: var(--surface-3) !important;
  border-color: var(--brand-mid);
  transform: translateX(4px);
}
.timeline-item:hover {
  transform: translateX(4px);
}

/* Fix unreadable text on hover for links */
.admin-module, .resource-item {
  color: inherit !important; 
  text-decoration: none !important;
}
.admin-module strong, .resource-item strong, .admin-module small, .resource-item small {
  transition: color 0.2s;
}
.admin-module:hover strong, .resource-item:hover strong {
  color: var(--brand-dark) !important;
}
.admin-module:hover small, .resource-item:hover small {
  color: var(--text-2) !important;
}

/* Fix sidebar nav items hover legibility */
.nav-item {
  transition: all 0.2s !important;
}
.nav-item:hover {
  background: rgba(255,255,255,0.15) !important;
  color: #ffffff !important;
  transform: translateX(4px);
}
.nav-item.active {
  background: rgba(51,201,139,0.3) !important;
}

/* Fix anchor button hover text colors overriding button text */
a.btn-primary:hover, .btn-primary:hover {
    color: #fff !important;
}
a.btn-danger:hover, .btn-danger:hover {
    color: #fff !important;
}

.question-image { max-width: 100%; height: auto; border-radius: 6px; margin: 8px 0; }

/* Camera widget top bar */
.camera-top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: linear-gradient(to bottom, rgba(0,0,0,.80), transparent);
  z-index: 5;
}
.cam-live-badge {
  font-size: 9px;
  font-weight: 900;
  color: #fff;
  letter-spacing: .08em;
  text-transform: uppercase;
  animation: cam-pulse 1.2s ease-in-out infinite;
}
@keyframes cam-pulse {
  0%,100% { opacity: 1; }
  50% { opacity: .55; }
}
.cam-minimize-btn {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  border-radius: 4px;
  width: 18px; height: 18px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.cam-minimize-btn:hover { background: rgba(255,255,255,.30); }

/* Minimized camera bar */
.cam-minimized-bar {
  position: fixed;
  bottom: 100px;
  left: 24px;
  background: #111;
  border: 2px solid rgba(51,201,139,0.40);
  border-radius: 10px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  cursor: default;
}
.cam-restore-btn {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  border-radius: 4px;
  width: 18px; height: 18px;
  font-size: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.cam-restore-btn:hover { background: rgba(51,201,139,.40); }
