/**
 * admin.css - Admin Panel Stylesheet
 * Supports Dark Theme (White text) & Light Theme (Black text) with Theme Toggle.
 * Fully responsive on mobile phones, tablets, laptops, and desktop computers.
 */

:root {
  /* EDUMARK ACADEMIC BRAND PALETTE */
  --edu-brand: #003366;          /* rgb(0, 51, 102) - Deep Oxford Academic Navy */
  --edu-brand-light: #004080;    /* rgb(0, 64, 128) - Royal Academic Navy */
  --edu-brand-dark: #002244;     /* rgb(0, 34, 68) - Midnight Navy */
  --edu-yellow: #fdb913;         /* rgb(253, 185, 19) - University Gold/Yellow */
  --edu-yellow-dark: #e5a000;    /* rgb(229, 160, 0) - Deep Amber Gold */
  
  --bg: #002244;
  --bg2: #001a33;
  --blue-dk: #003366;
  --blue: #004080;
  --blue-lt: #3b82f6;
  --blue-glow: rgba(0, 64, 128, 0.45);
  --gold-dk: #e5a000;
  --gold: #fdb913;
  --gold-lt: #fde047;
  --yellow: #fdb913;
  --yellow-lt: #fde047;
  --yellow-glow: rgba(253, 185, 19, 0.35);
  
  --glass: rgba(255, 255, 255, 0.08);
  --glass-2: rgba(255, 255, 255, 0.14);
  --glass-brd: rgba(255, 255, 255, 0.18);
  --glass-highlight: rgba(255, 255, 255, 0.28);
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.12);
  --surface-card: rgba(0, 34, 68, 0.55);
  --border: rgba(255, 255, 255, 0.18);
  --border-soft: rgba(255, 255, 255, 0.12);
  --input-bg: rgba(0, 26, 51, 0.75);
  --text: #ffffff; /* PURE WHITE FONT COLOR FOR DARK THEME */
  --text-muted: #dbeafe;
  --text-dim: #93c5fd;
  --crimson: #ef4444;
  --crimson-glow: rgba(239, 68, 68, 0.22);
  --phosphor: #34d399;
  --green: #10b981;
  --mono: 'JetBrains Mono', ui-monospace, "SF Mono", "Cascadia Code", monospace;
  --sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --maxw: 1200px;
}

/* ==========================================================================
   LIGHT THEME OVERRIDES (MATCHING EDUMARK LIGHT THEME)
   ========================================================================== */
body.light-theme {
  --bg: #f8fafc;
  --bg2: #f1f5f9;
  --blue-dk: #002244;
  --blue: #003366;
  --blue-lt: #004080;
  --blue-glow: rgba(0, 51, 102, 0.15);
  --gold-dk: #b45309;
  --yellow: #d97706;
  --yellow-lt: #f59e0b;
  --yellow-glow: rgba(217, 119, 6, 0.18);
  --glass: #ffffff;
  --glass-2: #f8fafc;
  --glass-brd: #e2e8f0;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-card: #ffffff;
  --border: #cbd5e1;
  --border-soft: #e2e8f0;
  --input-bg: #ffffff;
  --text: #000000;
  --text-muted: #334155;
  --text-dim: #64748b;
  --crimson: #dc2626;
  --phosphor: #059669;
  --green: #16a34a;
  color: #000000 !important;
  background-color: #f1f5f9 !important;
  background-image: linear-gradient(135deg, #f8fafc 0%, #edf2f7 50%, #e2e8f0 100%) !important;
  background-attachment: fixed !important;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  background-color: #f1f5f9;
  background-image: linear-gradient(135deg, #f8fafc 0%, #edf2f7 50%, #e2e8f0 100%);
  background-attachment: fixed;
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
  position: relative;
}

body:not(.light-theme) {
  background-color: var(--edu-brand-dark);
  background-image: linear-gradient(135deg, var(--edu-brand) 0%, var(--edu-brand-light) 50%, var(--edu-brand-dark) 100%);
}

/* EduMark Ambient Glow Blobs */
.edumark-blob {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(90px);
  -webkit-filter: blur(90px);
  opacity: 0.16;
  mix-blend-mode: screen;
  animation: edumarkBlobFloat 12s infinite alternate ease-in-out;
}
body.light-theme .edumark-blob {
  opacity: 0.08;
  mix-blend-mode: multiply;
}
.blob-1 { top: -80px; right: -80px; background: var(--edu-yellow); animation-delay: 0s; }
.blob-2 { bottom: -80px; left: -80px; background: var(--edu-yellow); animation-delay: 4s; }
.blob-3 { top: 45%; left: 45%; transform: translate(-50%, -50%); background: var(--edu-brand-light); animation-delay: 8s; }

@keyframes edumarkBlobFloat {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.15) translate(25px, -20px); }
  100% { transform: scale(0.95) translate(-20px, 25px); }
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--edu-yellow); color: var(--edu-brand-dark); }
:focus-visible { outline: 2px solid var(--edu-yellow); outline-offset: 2px; }

/* Custom EduMark Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #002244; border-radius: 4px; }
body.light-theme ::-webkit-scrollbar-track { background: #f8fafc; }
::-webkit-scrollbar-thumb { background: #003366; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.1); }
::-webkit-scrollbar-thumb:hover { background: #fdb913; }

/* EduMark Glass Surfaces */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: 20px;
  box-shadow: 0 12px 36px rgba(0, 34, 68, 0.40), inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
body.light-theme .glass {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(0, 51, 102, 0.08), inset 0 1px 0 rgba(255, 255, 255, 1);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .glass {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
}

.clay-btn {
  background: linear-gradient(to right, var(--edu-yellow), var(--edu-yellow-dark));
  color: #000000 !important;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(253, 185, 19, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 42px;
}
.clay-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(253, 185, 19, 0.50);
  color: #000000 !important;
}
.clay-btn:active {
  transform: translateY(1px);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-brd);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 16px;
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.18s ease;
  min-height: 42px;
}
body.light-theme .secondary-btn {
  background: #ffffff;
  border-color: var(--border);
  color: #000000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--blue-lt);
  color: var(--text);
}
body.light-theme .secondary-btn:hover {
  background: #f1f5f9;
  border-color: var(--blue);
  color: #000000;
}

.danger-btn {
  background: rgba(224, 71, 90, 0.18);
  border: 1px solid rgba(224, 71, 90, 0.35);
  color: #ff9da9;
  border-radius: 12px;
  padding: 9px 16px;
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.18s ease;
  min-height: 42px;
}
body.light-theme .danger-btn {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.danger-btn:hover {
  background: rgba(224, 71, 90, 0.35);
  color: #ffffff;
}
body.light-theme .danger-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

#logout-btn {
  background: #dc2626 !important;
  color: #facc15 !important;
  border: 1px solid #b91c1c !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}
#logout-btn:hover {
  background: #b91c1c !important;
  color: #fef08a !important;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.6);
  transform: translateY(-1px);
}
body.light-theme #logout-btn {
  background: #dc2626 !important;
  color: #facc15 !important;
  border-color: #b91c1c !important;
}
body.light-theme #logout-btn:hover {
  background: #b91c1c !important;
  color: #fef08a !important;
}

/* ==========================================================================
   THEME TOGGLE BUTTON & SLIDING SWITCH
   ========================================================================== */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-brd);
  color: #ffffff;
  border-radius: 24px;
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: all 0.25s ease;
  min-height: 40px;
  font-weight: 600;
  user-select: none;
}
.theme-toggle-track {
  width: 36px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  position: relative;
  display: inline-block;
  transition: background 0.25s ease;
  flex-shrink: 0;
}
.theme-toggle-thumb {
  width: 14px;
  height: 14px;
  background: var(--yellow);
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--yellow);
  transform: translateY(-1px);
}

/* Light Theme Toggle Button & Switch */
body.light-theme .theme-toggle-btn {
  background: #ffffff;
  border-color: #94a3b8;
  color: #000000 !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}
body.light-theme .theme-toggle-btn:hover {
  background: #f1f5f9;
  border-color: #475569;
}
body.light-theme .theme-toggle-track {
  background: #cbd5e1;
}
body.light-theme .theme-toggle-thumb {
  transform: translateX(16px);
  background: #d97706;
}

/* ==========================================================================
   EXPLICIT FONT COLOR ENFORCEMENT:
   - Dark Mode  => Pure White (#ffffff)
   - Light Mode => Pure Black (#000000)
   ========================================================================== */
body:not(.light-theme) {
  color: #ffffff;
}
body:not(.light-theme) h1,
body:not(.light-theme) h2,
body:not(.light-theme) h3,
body:not(.light-theme) h4,
body:not(.light-theme) p,
body:not(.light-theme) label,
body:not(.light-theme) .title,
body:not(.light-theme) .sub,
body:not(.light-theme) .form-control,
body:not(.light-theme) select,
body:not(.light-theme) textarea,
body:not(.light-theme) input,
body:not(.light-theme) table.q-table th,
body:not(.light-theme) table.q-table td,
body:not(.light-theme) .secondary-btn,
body:not(.light-theme) .security-note,
body:not(.light-theme) .info-banner,
body:not(.light-theme) .tab-btn:not(.active),
body:not(.light-theme) .theme-toggle-btn,
body:not(.light-theme) .user-badge {
  color: #ffffff;
}
body:not(.light-theme) .action-btn {
  color: #ffffff;
}
body:not(.light-theme) .action-btn.del {
  color: #ff9da9;
}
body:not(.light-theme) .form-control {
  color: #ffffff;
  background: rgba(4, 7, 13, 0.7);
}

/* LIGHT THEME (PURE BLACK FONT COLOR) */
body.light-theme {
  color: #000000 !important;
}
body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme p,
body.light-theme label,
body.light-theme .title,
body.light-theme .sub,
body.light-theme .form-control,
body.light-theme select,
body.light-theme textarea,
body.light-theme input,
body.light-theme table.q-table th,
body.light-theme table.q-table td,
body.light-theme .secondary-btn,
body.light-theme .modal-box,
body.light-theme .security-note,
body.light-theme .info-banner,
body.light-theme .tab-btn,
body.light-theme .theme-toggle-btn,
body.light-theme .user-badge,
body.light-theme .action-btn,
body.light-theme .preview-card,
body.light-theme #filtered-count-display {
  color: #000000 !important;
}
body.light-theme .form-control {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #94a3b8 !important;
}
body.light-theme table.q-table th {
  color: #000000 !important;
  border-bottom: 2px solid #000000 !important;
}
body.light-theme table.q-table td {
  color: #000000 !important;
  border-top-color: #cbd5e1 !important;
}
body.light-theme .secondary-btn {
  color: #000000 !important;
  border-color: #94a3b8 !important;
  background: #ffffff !important;
}
body.light-theme .action-btn {
  color: #000000 !important;
  border-color: #94a3b8 !important;
  background: #ffffff !important;
}
body.light-theme .action-btn.del {
  color: #b91c1c !important;
  border-color: #f87171 !important;
}
body.light-theme .tab-btn {
  color: #000000 !important;
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}
body.light-theme .tab-btn.active {
  color: #1e1b4b !important;
  background: linear-gradient(150deg, #fbbf24, #f59e0b) !important;
}
body.light-theme .tab-badge {
  color: #000000 !important;
  background: #e2e8f0 !important;
}
body.light-theme .category-badge {
  color: #000000 !important;
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}
body.light-theme .unit-badge {
  color: #000000 !important;
  background: #fde68a !important;
  border-color: #d97706 !important;
}
body.light-theme .user-badge {
  color: #000000 !important;
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}
body.light-theme .security-note {
  color: #000000 !important;
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}
body.light-theme .info-banner {
  color: #000000 !important;
  background: #eff6ff !important;
  border-color: #93c5fd !important;
}
body.light-theme .info-banner strong {
  color: #000000 !important;
}
body.light-theme .modal-header h3 {
  color: #000000 !important;
}
body.light-theme .stat-card .lbl {
  color: #334155 !important;
}

/* Layout */
.admin-container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 14px;
}
.admin-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-header .brand img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}
.admin-header .brand .title {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.admin-header .brand .sub {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
}
.admin-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.user-badge {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--yellow);
  background: rgba(255, 212, 59, 0.12);
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 212, 59, 0.3);
  font-weight: 600;
}
body.light-theme .user-badge {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

/* Auto-Push Button Border */
.auto-push-label,
#auto-push-wrapper {
  border: 0.5px solid #000000 !important;
}
body.light-theme .auto-push-label,
body.light-theme #auto-push-wrapper {
  border: 0.5px solid #000000 !important;
  color: #000000 !important;
  background: rgba(0, 0, 0, 0.04) !important;
}

/* Notice Banner */
.info-banner {
  background: rgba(22, 32, 51, 0.50);
  border: 1px solid rgba(111, 168, 216, 0.40);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-muted);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
body.light-theme .info-banner {
  background: rgba(239, 246, 255, 0.50);
  border-color: rgba(147, 197, 253, 0.65);
  color: #1e3a8a;
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.info-banner strong {
  color: var(--text);
}
body.light-theme .info-banner strong {
  color: #172554;
}
.info-banner .icon {
  font-size: 18px;
  line-height: 1;
}

.security-note {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(10, 18, 32, 0.50);
  border-radius: 8px;
  border-left: 3px solid var(--yellow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  line-height: 1.5;
}
body.light-theme .security-note {
  background: rgba(248, 250, 252, 0.50);
  color: #334155;
  border-left-color: #d97706;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
  border-right: 1px solid rgba(226, 232, 240, 0.6);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Login View */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}
.login-card {
  width: 100%;
  max-width: 460px;
  padding: 40px 32px;
  text-align: center;
  position: relative;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(22, 32, 51, 0.50), rgba(10, 18, 32, 0.50));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  transition: all 0.3s ease;
}
.login-card:hover {
  border-color: rgba(255, 212, 59, 0.45);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55), 0 0 30px rgba(55, 118, 171, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
body.light-theme .login-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.50), rgba(248, 250, 252, 0.50));
  border: 1px solid rgba(255, 255, 255, 0.70);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08), inset 0 1px 0 #ffffff;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
}
.login-card .logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}
.login-card .logo-row img {
  width: 44px;
  height: 44px;
}
.login-card h1 {
  font-family: var(--mono);
  font-size: 24px;
  margin: 0 0 6px;
  color: var(--text);
}
.login-card p.desc {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 24px;
}
.login-theme-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.form-group {
  margin-bottom: 18px;
  text-align: left;
}
.form-group label {
  display: block;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.form-control {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  min-height: 44px;
}
body.light-theme .form-control {
  background: #ffffff;
  color: #000000; /* BLACK INPUT TEXT */
  border-color: #cbd5e1;
}
.form-control:focus {
  outline: none;
  border-color: var(--blue-lt);
  box-shadow: 0 0 0 3px rgba(55, 118, 171, 0.25);
}
body.light-theme .form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.password-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--blue-200);
  cursor: pointer;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  user-select: none;
  z-index: 2;
}

.password-toggle-btn:hover {
  color: var(--edu-yellow);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-50%) scale(1.08);
}

body.light-theme .password-toggle-btn {
  color: #64748b;
}

body.light-theme .password-toggle-btn:hover {
  color: var(--edu-brand);
  background: #f1f5f9;
}

textarea.form-control {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}
textarea.code-font {
  font-family: var(--mono);
  font-size: 13px;
  tab-size: 4;
}

/* Stat Cards with Class / Glass Effect */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.stat-card {
  padding: 20px 22px;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  cursor: default;
  background: linear-gradient(135deg, rgba(22, 32, 51, 0.50), rgba(10, 18, 32, 0.50));
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glass specular sheen across top border */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, rgba(255, 212, 59, 0.8), transparent);
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

/* Classy Hover Lift & Glow Effect */
.stat-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 25px rgba(55, 118, 171, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.30);
  border-color: rgba(255, 212, 59, 0.45);
}
.stat-card:hover::before {
  opacity: 1;
}

body.light-theme .stat-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.50), rgba(241, 245, 249, 0.50));
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}
body.light-theme .stat-card::before {
  background: linear-gradient(90deg, transparent, #2563eb, transparent);
  opacity: 0.5;
}
body.light-theme .stat-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12), 0 0 20px rgba(37, 99, 235, 0.15), inset 0 1px 0 #ffffff;
  border-color: #2563eb;
}

.stat-card .val {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  background: linear-gradient(140deg, var(--blue-lt), var(--yellow));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.light-theme .stat-card .val {
  background: linear-gradient(140deg, #1d4ed8, #d97706);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-card .lbl {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Actions Bar */
.actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.btn-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Dashboard Navigation Tabs */
.dashboard-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  border-radius: 12px;
  padding: 10px 18px;
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
.tab-btn.active,
body:not(.light-theme) .tab-btn.active,
body.light-theme .tab-btn.active {
  background: linear-gradient(150deg, var(--yellow-lt), var(--yellow)) !important;
  color: #000000 !important;
  font-weight: 800 !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px rgba(253, 185, 19, 0.40) !important;
}
.tab-badge {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 11.5px;
}
.tab-btn.active .tab-badge,
body:not(.light-theme) .tab-btn.active .tab-badge,
body.light-theme .tab-btn.active .tab-badge {
  background: rgba(0, 0, 0, 0.18) !important;
  color: #000000 !important;
  font-weight: 800 !important;
}
body.light-theme .tab-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}
body.light-theme .tab-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}
body.light-theme .tab-btn.active {
  background: linear-gradient(150deg, #fbbf24, #f59e0b) !important;
  color: #000000 !important;
}

.mini-link-btn {
  background: none;
  border: none;
  color: var(--blue-lt);
  font-family: var(--mono);
  font-size: 11.5px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0 4px;
  transition: color 0.15s ease;
}
.mini-link-btn:hover {
  color: var(--yellow);
}
body.light-theme .mini-link-btn {
  color: #2563eb;
}
body.light-theme .mini-link-btn:hover {
  color: #d97706;
}

/* Filters & Search */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}
.search-box {
  flex: 1;
  min-width: 240px;
  position: relative;
}
.search-box input {
  padding-left: 38px;
}
.search-box .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  font-size: 15px;
}
.filter-select {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text);
  min-width: 150px;
  min-height: 44px;
}
body.light-theme .filter-select {
  background: #ffffff;
  color: #000000; /* BLACK TEXT */
  border-color: #cbd5e1;
}
.filter-select:focus {
  outline: none;
  border-color: var(--blue-lt);
}

/* Questions Table */
.table-wrap {
  overflow-x: auto;
  padding: 6px 14px;
}
table.q-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
table.q-table th {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
body.light-theme table.q-table th {
  color: #475569;
  border-bottom: 2px solid #cbd5e1;
}
table.q-table td {
  padding: 14px 12px;
  border-top: 1px solid var(--border-soft);
  vertical-align: middle;
  color: var(--text);
}
body.light-theme table.q-table td {
  color: #000000; /* BLACK CELL TEXT */
  border-top: 1px solid #e2e8f0;
}
table.q-table tr:first-child td {
  border-top: none;
}
table.q-table tr:hover {
  background: rgba(255, 255, 255, 0.035);
}
body.light-theme table.q-table tr:hover {
  background: rgba(0, 0, 0, 0.025);
}

.tag-badge,
body.light-theme .tag-badge,
body:not(.light-theme) .tag-badge {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #ffffff !important;
  background: linear-gradient(150deg, var(--blue-lt), var(--blue));
  padding: 3px 8px;
  border-radius: 8px;
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: 0 2px 6px rgba(0, 34, 68, 0.25);
}
.unit-badge {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--yellow-lt);
  background: rgba(255, 212, 59, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 212, 59, 0.25);
  font-weight: 600;
}
body.light-theme .unit-badge {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.category-badge {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}
body.light-theme .category-badge {
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #e2e8f0;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.action-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 34px;
}
body.light-theme .action-btn {
  background: #ffffff;
  color: #000000;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.action-btn:hover {
  color: #ffffff;
  border-color: var(--blue-lt);
  background: rgba(55, 118, 171, 0.3);
}
body.light-theme .action-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.action-btn.del {
  color: #ff9da9;
  border-color: rgba(224, 71, 90, 0.4);
}
body.light-theme .action-btn.del {
  color: #dc2626;
  border-color: #fca5a5;
}
.action-btn.del:hover {
  border-color: var(--crimson);
  color: #ffffff;
  background: rgba(224, 71, 90, 0.5);
}
body.light-theme .action-btn.del:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.70) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#unit-editor-modal, #delete-unit-modal {
  z-index: 1100;
}
body.light-theme .modal-overlay,
body:not(.light-theme) .modal-overlay {
  background: rgba(255, 255, 255, 0.70) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-box {
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px 26px;
  border-radius: 22px;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}
body:not(.light-theme) .modal-box,
body.light-theme .modal-box {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}
.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid #e2e8f0 !important;
  padding-bottom: 14px;
}
.modal-header h3,
body:not(.light-theme) .modal-header h3,
body.light-theme .modal-header h3 {
  margin: 0;
  font-family: var(--mono);
  font-size: 19px;
  color: #000000 !important;
  font-weight: 700;
}
.modal-close-btn {
  background: none;
  border: none;
  color: #64748b !important;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 6px;
  transition: color 0.15s ease;
}
.modal-close-btn:hover {
  color: #000000 !important;
}

/* Modal Inner Form Elements */
.modal-box label,
body:not(.light-theme) .modal-box label,
body.light-theme .modal-box label {
  color: #000000 !important;
  font-weight: 600;
}

.modal-box h1,
.modal-box h2,
.modal-box h3,
.modal-box h4,
.modal-box p,
.modal-box span:not(.clay-btn):not(.danger-btn),
.modal-box small,
body:not(.light-theme) .modal-box h1,
body:not(.light-theme) .modal-box h2,
body:not(.light-theme) .modal-box h3,
body:not(.light-theme) .modal-box h4,
body:not(.light-theme) .modal-box p,
body:not(.light-theme) .modal-box small {
  color: #000000 !important;
}

.modal-box .form-control,
body:not(.light-theme) .modal-box .form-control,
body.light-theme .modal-box .form-control {
  background: #f8fafc !important;
  color: #000000 !important;
  border: 1px solid #cbd5e1 !important;
}

.modal-box .form-control:focus,
body:not(.light-theme) .modal-box .form-control:focus,
body.light-theme .modal-box .form-control:focus {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

.modal-box .form-control::placeholder {
  color: #94a3b8 !important;
}

.modal-box select.form-control option {
  background: #ffffff !important;
  color: #000000 !important;
}

.modal-box .secondary-btn,
body:not(.light-theme) .modal-box .secondary-btn,
body.light-theme .modal-box .secondary-btn {
  background: #f1f5f9 !important;
  color: #000000 !important;
  border: 1px solid #cbd5e1 !important;
}

.modal-box .secondary-btn:hover,
body:not(.light-theme) .modal-box .secondary-btn:hover,
body.light-theme .modal-box .secondary-btn:hover {
  background: #e2e8f0 !important;
  color: #000000 !important;
}

/* Form Grid */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid #e2e8f0 !important;
  padding-top: 18px;
}

/* Live Preview in Modal */
.preview-card {
  padding: 18px;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px;
  margin-top: 10px;
  color: #000000 !important;
  box-shadow: inset 0 1px 0 #ffffff;
}
.preview-card * {
  color: #000000;
}
body.light-theme .preview-card {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #000000 !important;
  box-shadow: inset 0 1px 0 #ffffff;
}

/* Toasts */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 90vw;
}
.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  padding: 12px 18px;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: slideInToast 0.25s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
@keyframes slideInToast {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast.success {
  background: #11281e;
  border: 1px solid rgba(46, 204, 113, 0.4);
  color: #7fe8b8;
}
body.light-theme .toast.success {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
}
.toast.error {
  background: #2b1115;
  border: 1px solid rgba(224, 71, 90, 0.4);
  color: #ff9da9;
}
body.light-theme .toast.error {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}
.toast.info {
  background: #0f1f33;
  border: 1px solid rgba(111, 168, 216, 0.4);
  color: #aed5fc;
}
body.light-theme .toast.info {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

/* ==========================================================================
   COMPREHENSIVE MOBILE-FRIENDLY RESPONSIVENESS (< 768px and < 480px)
   ========================================================================== */
@media (max-width: 768px) {
  .admin-container {
    padding: 12px 10px;
  }
  .admin-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 14px;
    margin-bottom: 14px;
  }
  .admin-header .brand {
    justify-content: flex-start;
    gap: 10px;
  }
  .admin-header .brand img {
    width: 26px;
    height: 26px;
  }
  .admin-header .brand .title {
    font-size: 15px;
    line-height: 1.3;
  }
  .admin-header .brand .sub {
    font-size: 11.5px;
  }

  /* 2x2 Clean Mobile Header Actions Grid */
  .admin-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .admin-header-actions .secondary-btn,
  .admin-header-actions .danger-btn,
  .admin-header-actions .theme-toggle-btn {
    width: 100%;
    font-size: 11.5px;
    padding: 8px 10px;
    min-height: 40px;
    justify-content: center;
    text-align: center;
  }
  .user-badge {
    display: none; /* saved space on small header */
  }

  /* Info Banner */
  .info-banner {
    padding: 12px 14px;
    font-size: 12px;
    gap: 10px;
    margin-bottom: 14px;
  }

  /* Stats Cards Grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
  }
  .stat-card {
    padding: 14px 12px;
    border-radius: 14px;
  }
  .stat-card .val {
    font-size: 24px;
  }
  .stat-card .lbl {
    font-size: 11px;
  }

  /* Actions Bar */
  .actions-bar {
    padding: 12px;
    margin-bottom: 14px;
    gap: 10px;
  }
  .btn-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .btn-group button, .btn-group a {
    width: 100%;
    min-height: 42px;
    font-size: 12px;
    padding: 8px 10px;
    justify-content: center;
    text-align: center;
  }
  /* Primary buttons span full width for easy thumb tap */
  #add-question-btn, #export-questions-pdf-btn {
    grid-column: 1 / -1;
    min-height: 44px;
    font-size: 13.5px;
  }

  /* Navigation Tabs */
  .dashboard-tabs {
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
  }
  .tab-btn {
    flex: 1;
    padding: 10px 8px;
    font-size: 12px;
    justify-content: center;
    text-align: center;
  }

  /* Search & Filters Row */
  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 14px;
  }
  .search-box {
    width: 100%;
    min-width: unset;
  }
  .search-box input, .filter-select {
    width: 100%;
    font-size: 15px; /* iOS friendly font size */
    min-height: 44px;
  }
  #filtered-count-display {
    font-size: 11.5px;
    text-align: right;
  }

  /* Responsive Question and Unit Table Cards */
  table.q-table, table.q-table tbody, table.q-table tr, table.q-table td {
    display: block;
    width: 100%;
  }
  table.q-table thead {
    display: none;
  }
  table.q-table tr {
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 16px;
    padding: 14px;
    background: rgba(22, 32, 51, 0.50);
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.20);
  }
  body.light-theme table.q-table tr {
    background: rgba(255, 255, 255, 0.50);
    border-color: rgba(255, 255, 255, 0.65);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
  }
  table.q-table td {
    border-top: none;
    padding: 4px 0;
  }
  .table-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-soft);
    display: flex;
    gap: 8px;
    width: 100%;
  }
  .table-actions .action-btn {
    flex: 1;
    text-align: center;
    justify-content: center;
    display: flex;
    min-height: 40px;
    font-size: 12px;
    padding: 8px 4px;
  }

  /* Modals */
  .modal-overlay {
    padding: 10px;
    align-items: center;
  }
  .modal-box {
    padding: 20px 14px;
    max-height: 92vh;
    border-radius: 18px;
    width: 100%;
    max-width: 100%;
  }
  .modal-header h3 {
    font-size: 16px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .form-control {
    font-size: 15px; /* iOS friendly font size */
    min-height: 44px;
  }
  textarea.form-control {
    min-height: 95px;
  }
  .modal-footer {
    flex-direction: column-reverse; /* primary button on top */
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
  }
  .modal-footer button {
    width: 100%;
    min-height: 44px;
  }

  /* Toast notification on mobile */
  #toast-container {
    bottom: 12px;
    left: 12px;
    right: 12px;
    max-width: unset;
  }
  .toast {
    min-width: unset;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .admin-header .brand .title {
    font-size: 13.5px;
  }
  .stat-card .val {
    font-size: 22px;
  }
  .login-card {
    padding: 28px 16px;
    max-width: 95vw;
  }
  .login-card h1 {
    font-size: 20px;
  }
  .login-card .desc {
    font-size: 12px;
  }
  .btn-group {
    grid-template-columns: 1fr;
  }
  .btn-group button, .btn-group a {
    width: 100%;
  }
  .table-actions {
    flex-wrap: wrap;
  }
  .table-actions .action-btn {
    min-width: calc(50% - 4px);
  }
}

/* ==========================================================================
   ACADEMIC WORKSPACE NAVIGATION: SEMESTER & SUBJECT SWITCHER BARS
   ========================================================================== */

.admin-nav-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(22, 32, 51, 0.50), rgba(10, 18, 32, 0.50));
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.20);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}
body.light-theme .admin-nav-bar {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.50), rgba(241, 245, 249, 0.50));
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.admin-bar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 4px;
}
.admin-bar-icon {
  font-size: 20px;
  line-height: 1;
}
.admin-bar-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
body.light-theme .admin-bar-title {
  color: #000000 !important;
}

.admin-bar-items {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

/* Semester Buttons in Admin */
.admin-sem-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-radius: 12px;
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 38px;
}
body.light-theme .admin-sem-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #000000 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.admin-sem-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--yellow);
  transform: translateY(-1px);
}
body.light-theme .admin-sem-btn:hover {
  background: #f1f5f9;
  border-color: #475569;
}
.admin-sem-btn.active,
body:not(.light-theme) .admin-sem-btn.active,
body.light-theme .admin-sem-btn.active {
  background: linear-gradient(150deg, var(--yellow-lt), var(--yellow)) !important;
  color: #000000 !important;
  font-weight: 800 !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px rgba(253, 185, 19, 0.40);
}

/* Subject Pills in Admin */
.admin-sub-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}
body.light-theme .admin-sub-pill {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.admin-sub-pill:hover {
  border-color: var(--blue-lt);
}
.admin-sub-pill.active {
  background: rgba(55, 118, 171, 0.25);
  border-color: var(--blue-lt);
  box-shadow: 0 0 12px rgba(55, 118, 171, 0.3);
}
body.light-theme .admin-sub-pill.active {
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.sub-tab-btn {
  background: none;
  border: none;
  color: #ffffff;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
body.light-theme .sub-tab-btn {
  color: #000000 !important;
}
.sub-tab-btn .badge {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--yellow);
}
body.light-theme .sub-tab-btn .badge {
  background: #e2e8f0;
  color: #1e3a8a;
}
.admin-sub-pill.active .sub-tab-btn .badge {
  background: var(--yellow);
  color: #241b00;
}
body.light-theme .admin-sub-pill.active .sub-tab-btn .badge {
  background: #2563eb;
  color: #ffffff;
}

.sub-edit-btn {
  background: none;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 10px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  transition: color 0.15s ease, background 0.15s ease;
}
body.light-theme .sub-edit-btn {
  border-left-color: #cbd5e1;
  color: #64748b;
}
.sub-edit-btn:hover {
  color: var(--yellow);
  background: rgba(255, 255, 255, 0.08);
}
body.light-theme .sub-edit-btn:hover {
  color: #2563eb;
  background: #f1f5f9;
}

@media (max-width: 768px) {
  .admin-nav-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }
  .admin-bar-items {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .admin-sem-btn, .admin-sub-pill {
    width: 100%;
    justify-content: center;
  }
  .sub-tab-btn {
    flex: 1;
    justify-content: center;
  }
}

/* ==========================================================================
   BULK ACTIONS BAR & MULTI-DELETE STYLING
   ========================================================================== */
.bulk-actions-bar {
  background: rgba(14, 22, 37, 0.50);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  transition: all 0.25s ease;
}
body.light-theme .bulk-actions-bar {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.14);
  color: #000000;
}
body.light-theme .bulk-actions-bar label {
  color: #000000 !important;
}

.q-table tr.row-selected {
  background: rgba(239, 68, 68, 0.12) !important;
}
body.light-theme .q-table tr.row-selected {
  background: rgba(254, 226, 226, 0.75) !important;
}

.q-row-checkbox, #select-all-questions, #table-head-checkbox {
  accent-color: #ef4444;
  cursor: pointer;
}

#output-image-preview-wrap {
  transition: all 0.2s ease;
}
body.light-theme #output-image-preview-wrap {
  background: rgba(241, 245, 249, 0.8) !important;
  border-color: rgba(203, 213, 225, 0.8) !important;
}

/* ==========================================================================
   GLOBAL HIGH-CONTRAST RULE: Any Yellow Button / Tab Must Have Black Font
   ========================================================================== */
.tab-btn.active,
.tab-btn.active *,
.tab-btn.active .tab-badge,
.admin-sem-btn.active,
.admin-sem-btn.active *,
.sem-pill-btn.active,
.sem-pill-btn.active *,
.clay-btn:not([style*="red"]):not([style*="blue"]):not([style*="green"]):not([style*="10b981"]):not([style*="ef4444"]):not([style*="3b82f6"]),
.clay-btn:not([style*="red"]):not([style*="blue"]):not([style*="green"]):not([style*="10b981"]):not([style*="ef4444"]):not([style*="3b82f6"]) *,
button.active[class*="tab"],
button.active[class*="sem"],
button.active[class*="pill"] {
  color: #000000 !important;
}

/* ==========================================================================
   SWEETALERT2 CUSTOM THEMING (White Card, Black Text, White Frosted Backdrop)
   ========================================================================== */
.swal2-container {
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  background: rgba(255, 255, 255, 0.70) !important;
  z-index: 99999 !important;
}

.swal2-popup,
.swal2-custom-white-card {
  background: #ffffff !important;
  color: #000000 !important;
  border-radius: 20px !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.06) !important;
  padding: 26px 24px !important;
}

.swal2-title {
  color: #000000 !important;
  font-family: var(--mono, 'JetBrains Mono', monospace) !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  padding: 0 !important;
  margin-bottom: 8px !important;
}

.swal2-html-container {
  color: #1e293b !important;
  font-size: 14.5px !important;
  margin: 10px 0 0 0 !important;
}

.swal2-confirm {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  padding: 9px 24px !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25) !important;
  border: none !important;
}

.swal2-timer-progress-bar {
  background: #3b82f6 !important;
}

