/* ==============================================================================
   APEX MANAGEMENT SYSTEM - ULTRA PREMIUM DESIGN SYSTEM
   Tailored for Indian Education Context (Coaching Centers & Modern Schools)
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Theme: Dark Slate / Obsidian by default */
  --bg-main: #090D16;
  --bg-surface: #0F172A;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(245, 158, 11, 0.5);

  /* Brand Accents */
  --primary: #F59E0B; /* Indian Vibrant Saffron */
  --primary-hover: #D97706;
  --primary-glow: rgba(245, 158, 11, 0.25);
  --secondary: #6366F1; /* Royal Indigo */
  --secondary-glow: rgba(99, 102, 241, 0.25);
  --emerald: #10B981;
  --emerald-glow: rgba(16, 185, 129, 0.2);
  --rose: #F43F5E;
  --sky: #0EA5E9;

  /* Typography */
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  /* Elevations & Glass */
  --glass-bg: rgba(15, 23, 42, 0.75);
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);
  --glass-blur: blur(16px);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

/* Light Theme Override */
body.light-theme {
  --bg-main: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --border-subtle: #E2E8F0;
  --border-focus: rgba(245, 158, 11, 0.6);
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-dim: #94A3B8;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: 1px solid #E2E8F0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.12);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Localized data placeholders keep the shell responsive while data loads. */
.admin-data-skeleton { position: fixed; inset: 76px 24px 24px 286px; z-index: 20; pointer-events: none; }
.admin-skeleton-title { width: 34%; height: 28px; border-radius: 8px; margin: 24px 0; }
.admin-skeleton-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.admin-skeleton-card { display: block; height: 112px; border-radius: 16px; }
.admin-skeleton-table { height: 320px; border-radius: 16px; margin-top: 20px; }
.shimmer { background: linear-gradient(100deg, rgba(148,163,184,.10) 30%, rgba(148,163,184,.24) 50%, rgba(148,163,184,.10) 70%); background-size: 300% 100%; animation: data-shimmer 1.35s ease-in-out infinite; }
@keyframes data-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (max-width: 800px) { .admin-data-skeleton { inset: 72px 12px 12px; } .admin-skeleton-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .shimmer { animation: none; } }

/* Layout Elements */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 270px;
  background: var(--bg-surface);
  border-right: var(--glass-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.main-content {
  margin-left: 270px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  max-width: calc(100vw - 270px);
  overflow-x: hidden;
  background: radial-gradient(circle at 80% 10%, rgba(245, 158, 11, 0.05) 0%, transparent 50%),
              radial-gradient(circle at 10% 90%, rgba(99, 102, 241, 0.04) 0%, transparent 40%);
}

.topbar {
  height: 72px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-bottom: var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-body {
  padding: 32px;
  flex: 1;
}

/* Brand Logo */
.brand-box {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: var(--glass-border);
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), #EF4444);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-badge {
  font-size: 10px;
  text-transform: uppercase;
  background: var(--primary-glow);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-top: 4px;
}

/* Navigation Links */
.nav-menu {
  padding: 20px 14px;
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.nav-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 12px 14px 6px;
  letter-spacing: 0.08em;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-bottom: 3px;
}

.nav-link i {
  font-size: 18px;
  width: 22px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  transform: translateX(3px);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), rgba(99, 102, 241, 0.08));
  color: var(--primary);
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

/* User Card in Sidebar */
.sidebar-user {
  padding: 16px 20px;
  border-top: var(--glass-border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

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

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
}

/* Glass Cards & Grids */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.stat-card::after, .stat-card::before { content: none !important; display: none !important; }

.stat-val {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 4px;
}

.stat-lbl {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--card-accent, var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #D97706);
  color: #0F172A;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: var(--glass-border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
  background: var(--emerald);
  color: #FFF;
  box-shadow: 0 4px 14px var(--emerald-glow);
}

.btn-danger {
  background: var(--rose);
  color: #FFF;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* Asynchronous DataTable Styles */
.data-table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: var(--glass-border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.data-table th {
  background: rgba(15, 23, 42, 0.9);
  padding: 14px 18px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: var(--glass-border);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--primary); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(244, 63, 94, 0.15); color: var(--rose); border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-info { background: rgba(14, 165, 233, 0.15); color: var(--sky); border: 1px solid rgba(14, 165, 233, 0.3); }
.badge-purple { background: rgba(99, 102, 241, 0.15); color: var(--secondary); border: 1px solid rgba(99, 102, 241, 0.3); }

/* Active Video Playlist UX Highlight */
.lecture-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: var(--glass-border);
  background: rgba(15, 23, 42, 0.4);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lecture-list-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.lecture-list-item.active {
  border: 2px solid var(--primary);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16), rgba(99, 102, 241, 0.08));
  box-shadow: 0 0 16px var(--primary-glow);
}

.badge-now-playing {
  background: var(--primary);
  color: #0F172A;
  font-weight: 800;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 99px;
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-surface);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: var(--glass-border);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
}

/* Forms */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Camera Scanner View */
.scanner-viewport {
  width: 100%;
  height: 280px;
  background: #000;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--primary);
}

.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  box-shadow: 0 0 12px var(--primary);
  animation: scan-laser 2.5s infinite ease-in-out;
}

@keyframes scan-laser {
  0% { top: 10%; }
  50% { top: 90%; }
  100% { top: 10%; }
}

/* ================================================================ */
/* Printables Design Studio & Print-Specific CSS Engine */
/* ================================================================ */
@media print {
  @page {
    margin: 0 !important;
    size: auto;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    color: #000000 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Completely suppress all app chrome, sidebars, topbars, buttons, toolbars */
  .sidebar, .topbar, .subnav-bar, .modal-close,
  .btn, button, .no-print, .design-studio-header,
  .design-studio-editor, .design-studio-toolbar, .toast,
  .breadcrumb, .page-header, .placeholder-shelf, .studio-topbar,
  .studio-editor-pane, .studio-preview-header, .zoom-controls,
  .print-controls-bar, .modal-toolbar {
    display: none !important;
  }

  /* When printing from an open modal, hide background workspace content so only the document prints */
  body:has(.modal-overlay) .main-content,
  body:has(.modal-overlay) .topbar,
  body:has(.modal-overlay) .sidebar {
    display: none !important;
  }

  /* Allow modal overlays to render transparently on paper */
  .modal-overlay {
    display: block !important;
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    z-index: auto !important;
  }

  .modal-content, .cert-modal-box {
    display: block !important;
    position: static !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow: visible !important;
  }

  .main-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    position: static !important;
  }

  .page-body {
    padding: 0 !important;
    margin: 0 !important;
  }

  .paper-viewport, .preview-paper-stage, .studio-preview-pane, .studio-split, .studio-container {
    display: block !important;
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Isolate printable document sheets */
  #printable-render-area, .printable-sheet, .receipt-copy-box, .cert-frame, .cert-sheet-print {
    position: static !important;
    left: 0 !important;
    top: 0 !important;
    margin: 0 auto !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    z-index: auto !important;
    overflow: visible !important;
    transform: none !important;
    page-break-inside: avoid !important;
  }
}

/* Background Patterns */
.pattern-none {
  background-color: #ffffff !important;
}
.pattern-guilloche {
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%230284c7' stroke-width='0.6' stroke-opacity='0.1'%3E%3Cpath d='M0 40 Q 20 20, 40 40 T 80 40 M 0 20 Q 20 40, 40 20 T 80 20 M 0 60 Q 20 40, 40 60 T 80 60 M 40 0 Q 20 20, 40 40 T 40 80 M 20 0 Q 40 20, 20 40 T 20 80 M 60 0 Q 40 20, 60 40 T 60 80'/%3E%3C/g%3E%3C/svg%3E") !important;
  background-repeat: repeat !important;
}
.pattern-watermark {
  position: relative;
  background-color: #ffffff !important;
}
.pattern-watermark::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 320px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Ccircle cx='100' cy='100' r='90' fill='none' stroke='%230f172a' stroke-width='4' stroke-opacity='0.08'/%3E%3Ccircle cx='100' cy='100' r='75' fill='none' stroke='%230f172a' stroke-width='1.5' stroke-opacity='0.08'/%3E%3Cpolygon points='100,30 118,70 162,72 128,100 140,144 100,118 60,144 72,100 38,72 82,70' fill='%230f172a' fill-opacity='0.04' stroke='%230f172a' stroke-width='2' stroke-opacity='0.08'/%3E%3Ctext x='100' y='170' text-anchor='middle' font-family='sans-serif' font-size='11' font-weight='bold' fill='%230f172a' fill-opacity='0.09' letter-spacing='3'%3EOFFICIAL SEAL%3C/text%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  z-index: 0;
}
.pattern-watermark > * {
  position: relative;
  z-index: 1;
}
.pattern-border_luxury {
  background-color: #ffffff !important;
  box-sizing: border-box !important;
  border: 12px double #b45309 !important;
  outline: 2px solid #0f172a !important;
  outline-offset: -7px !important;
}
.pattern-dots {
  background-color: #ffffff !important;
  background-image: radial-gradient(#94a3b8 0.8px, #ffffff 0.8px) !important;
  background-size: 16px 16px !important;
}
.pattern-stripes {
  background-color: #ffffff !important;
  background-image: repeating-linear-gradient(45deg, #ffffff, #ffffff 12px, #f8fafc 12px, #f8fafc 24px) !important;
}
.pattern-geometric {
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 0L40 20L20 40L0 20z' fill='none' stroke='%23475569' stroke-width='0.5' stroke-opacity='0.09'/%3E%3C/svg%3E") !important;
  background-repeat: repeat !important;
}

/* Page Sizes in Screen Preview */
.sheet-size-a4 {
  width: 210mm;
  min-height: 297mm;
}
.sheet-size-a5 {
  width: 148mm;
  min-height: 210mm;
}
.sheet-size-letter {
  width: 8.5in;
  min-height: 11in;
}
.sheet-size-thermal_80mm {
  width: 80mm;
  min-height: 160mm;
  padding: 6mm !important;
}

/* Sub Navigation Bars & Responsive Tabs */
.subnav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: var(--glass-border);
  width: 100%;
  box-sizing: border-box;
}
.subnav-btn {
  padding: 6px 13px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.subnav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}
.subnav-btn.active {
  background: var(--primary);
  color: #0F172A;
  font-weight: 700;
  border-color: var(--primary);
}

/* Subnav container wrapper & snack sheet trigger on desktop */
.subnav-container {
  width: 100%;
  box-sizing: border-box;
}
.subnav-sheet-trigger,
.subnav-sheet-backdrop,
.subnav-sheet {
  display: none;
}

/* Printables Design Studio Layout */
.studio-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.studio-topbar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}
.studio-topbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.studio-stacked {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.studio-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 20px;
  min-height: 680px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.studio-split.layout-preview {
  grid-template-columns: minmax(0, 1fr) !important;
}
.studio-split.layout-editor {
  grid-template-columns: minmax(0, 1fr) !important;
}
@media (max-width: 1100px) {
  .studio-split:not(.layout-preview):not(.layout-editor) {
    grid-template-columns: minmax(0, 1fr);
  }
}
.studio-editor-pane {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-width: 0;
  box-sizing: border-box;
}
.editor-nav {
  display: flex;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 12px;
  gap: 8px;
  flex-wrap: wrap;
}
.editor-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.editor-nav-btn:hover {
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.05);
}
.editor-nav-btn.active {
  color: #fff;
  background: var(--primary);
}
.code-editor-textarea {
  flex: 1;
  width: 100%;
  min-height: 480px;
  background: #090d16;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  padding: 16px;
  border: none;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.code-editor-textarea:focus {
  background: #050811;
}
.placeholder-shelf {
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.3);
  border-bottom: 1px solid var(--border-color);
  max-height: 140px;
  overflow-y: auto;
}
.placeholder-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.placeholder-chip {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #818cf8;
  font-family: monospace;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.placeholder-chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}
.studio-preview-pane {
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 850px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.preview-paper-stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: auto;
}
.paper-viewport {
  flex-shrink: 0;
  position: relative;
  margin: 0 auto;
  border-radius: 3px;
  box-shadow: 0 14px 35px -5px rgba(0, 0, 0, 0.5), 0 8px 12px -6px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  background: #ffffff;
  transition: width 0.2s ease, height 0.2s ease;
}
.printable-sheet {
  background: #ffffff;
  color: #0f172a;
  padding: 10mm;
  border-radius: 0;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  transition: transform 0.2s ease;
}


.receipt-copy-box {
  background: #FFF;
  color: #111;
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px dashed #CBD5E1;
  margin-bottom: 20px;
  font-family: var(--font-body);
}

.receipt-header {
  text-align: center;
  border-bottom: 2px solid #0F172A;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .page-body { padding: 16px; }
}

/* Quick-Add / Custom Value Inline Creator */
.quick-add-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.quick-add-btn-trigger {
  background: rgba(99, 102, 241, 0.15);
  border: 1px dashed rgba(99, 102, 241, 0.5);
  color: #818cf8;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.2s ease;
}
.quick-add-btn-trigger:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
  border-color: #818cf8;
}
.quick-add-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 6px;
  border-radius: 6px;
  animation: fadeIn 0.2s ease;
}
.quick-add-bar input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
  padding: 4px 8px;
}
.quick-add-bar input:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.quick-add-success-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 4px;
  animation: fadeIn 0.2s ease;
}

/* ==========================================================================
   Complete Student 360° Profile Page Styling
   ========================================================================== */

.student-clickable-row {
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.student-clickable-row:hover {
  background: rgba(99, 102, 241, 0.08) !important;
}

.student-profile-page {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.profile-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 8px;
}

.profile-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ==============================================================================
   STUDENT 360° PROFILE HERO CARD & CONTROLS (EXECUTIVE DOSSIER REDESIGN)
   Professional grid-based responsive hierarchy for desktop, tablet & mobile
   ============================================================================== */

.profile-hero-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl, 20px);
  padding: 28px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.profile-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f59e0b 0%, #6366f1 50%, #10b981 100%);
}

.profile-hero-grid {
  display: grid;
  grid-template-columns: 140px 1fr 340px;
  gap: 28px;
  align-items: start;
}

/* 1. Identity Column */
.profile-identity-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.profile-avatar-wrapper {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.profile-avatar-frame {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(245, 158, 11, 0.8);
  background: #0f172a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  position: relative;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-status-indicator {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.profile-status-indicator.is-active {
  background: #10b981;
}

.profile-status-indicator.is-disabled {
  background: #ef4444;
}

.profile-photo-btn {
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted, #94a3b8);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-photo-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.profile-id-pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.profile-code-badge {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
  letter-spacing: 0.5px;
  text-align: center;
}

.profile-code-badge.badge-roll {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.25);
}

/* 2. Details Column */
.profile-details-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.profile-name-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 14px;
}

.profile-student-name {
  font-family: var(--font-heading, sans-serif);
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 10px 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.profile-header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-danger-soft {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Meta Grid: 2 columns on desktop */
.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
}

.profile-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.profile-meta-item .meta-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--primary, #f59e0b);
  flex-shrink: 0;
}

.profile-meta-item .meta-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-meta-item .meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #94a3b8);
}

.profile-meta-item .meta-value {
  font-size: 13px;
  font-weight: 500;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Linked Relations / Parents & Siblings Row */
.profile-relations-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
}

.profile-relations-row .relations-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.profile-relations-row .relations-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.relation-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  background: transparent;
}

.relation-chip.chip-parent {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
  color: #34d399;
}

.relation-chip.chip-parent:hover {
  background: rgba(16, 185, 129, 0.22);
}

.relation-chip.chip-sibling {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.28);
  color: #38bdf8;
}

.relation-chip.chip-sibling:hover {
  background: rgba(56, 189, 248, 0.22);
}

/* 3. KPI Scorecard Column */
.profile-kpi-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  align-self: stretch;
}

.kpi-metric-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md, 12px);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.kpi-metric-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.kpi-metric-card .kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-metric-card .kpi-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #94a3b8);
}

.kpi-metric-card .kpi-icon {
  font-size: 15px;
  color: var(--text-dim, #64748b);
}

.kpi-metric-card .kpi-val {
  font-family: var(--font-heading, sans-serif);
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}

.kpi-metric-card .kpi-sub {
  font-size: 10.5px;
  color: var(--text-dim, #64748b);
}

.kpi-progress-track {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 2px;
}

.kpi-progress-bar {
  height: 100%;
  background: #10b981;
  border-radius: 2px;
}

.kpi-metric-card .kpi-foot {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim, #64748b);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-tag {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-tag.tag-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.kpi-tag.tag-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.kpi-tag.tag-neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted, #94a3b8);
}

/* Color Accents for Values */
.text-danger { color: #f43f5e !important; }
.text-success { color: #10b981 !important; }
.text-indigo { color: #818cf8 !important; }
.text-sky { color: #38bdf8 !important; }

/* ==============================================================================
   PROFILE HEADER ACTIONS (NOW POSITIONED AFTER PROFILE-HERO-CARD)
   ============================================================================== */
.profile-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
  background: rgba(15, 23, 42, 0.6);
  padding: 12px 18px;
  border-radius: var(--radius-lg, 14px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.profile-actions-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.profile-actions-divider {
  height: 18px;
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.profile-dossier-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.profile-dossier-pill .dossier-lbl {
  color: var(--text-muted, #94a3b8);
}

.profile-dossier-pill .dossier-adm {
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.5px;
}

.profile-dossier-pill .dossier-route {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
}

.profile-actions-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-impersonate {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

.btn-impersonate:hover {
  background: linear-gradient(135deg, #6d28d9, #4338ca);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

/* ==============================================================================
   RESPONSIVE BREAKPOINTS (TABLET & MOBILE)
   ============================================================================== */

@media (max-width: 1100px) {
  .profile-hero-grid {
    grid-template-columns: 130px 1fr;
    gap: 20px;
  }
  .profile-kpi-col {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .profile-hero-card {
    padding: 20px 16px;
  }
  .profile-hero-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .profile-identity-col {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    text-align: left;
    width: 100%;
  }
  .profile-avatar-frame {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
  }
  .profile-avatar-wrapper {
    flex-shrink: 0;
  }
  .profile-id-pills {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .profile-student-name {
    font-size: 21px;
    margin-bottom: 6px;
  }
  .profile-meta-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .profile-kpi-col {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .kpi-metric-card {
    padding: 12px;
  }
  .kpi-metric-card .kpi-val {
    font-size: 18px;
  }
  .profile-header-actions {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    gap: 12px;
  }
  .profile-actions-left {
    justify-content: space-between;
    width: 100%;
  }
  .profile-actions-divider {
    display: none;
  }
  .profile-dossier-pill .dossier-route {
    display: none; /* Hide long route path on mobile */
  }
  .profile-actions-right {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .profile-actions-right .btn {
    width: 100%;
    justify-content: center;
    font-size: 12px;
    padding: 8px 10px;
    text-align: center;
  }
}

/* ==============================================================================
   STUDENT 360° PROFILE & DOSSIER TAB NAVIGATION
   Distinct from main menu subnavs: uses sleek tabstrip with active indicator bar
   ============================================================================== */
.profile-tabs-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 6px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: 24px;
  position: sticky;
  top: 70px;
  z-index: 100;
}
.profile-tabs-bar::-webkit-scrollbar {
  display: none;
}

.profile-tab-btn {
  padding: 9px 15px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  position: relative;
  flex-shrink: 0;
}

.profile-tab-btn i {
  font-size: 15px;
  opacity: 0.9;
  transition: transform 0.2s ease;
}

.profile-tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}
.profile-tab-btn:hover i {
  transform: scale(1.1);
}

/* Active tab style: Unmistakably a tab pane selector, NOT a solid amber CTA button */
.profile-tab-btn.active {
  background: rgba(99, 102, 241, 0.16);
  color: #ffffff;
  font-weight: 700;
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.15);
}

.profile-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 12px;
  right: 12px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #38bdf8);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}

.profile-tab-btn .tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #94a3b8);
  transition: all 0.2s ease;
}

.profile-tab-btn.active .tab-badge {
  background: rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.profile-card-section {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-card-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
  margin: 0;
}

.profile-key-value-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-kv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.profile-kv-row:last-child {
  border-bottom: none;
}

.profile-kv-row .kv-label {
  color: var(--text-muted);
  font-weight: 500;
}

.profile-kv-row .kv-value {
  color: #fff;
  font-weight: 600;
  text-align: right;
}

/* Authentic PVC Student ID Card Layout */
.pvc-id-card-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: center;
  padding: 20px 0;
}

.pvc-card {
  width: 320px;
  height: 490px;
  background: #ffffff;
  color: #0f172a;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.pvc-card-front-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  color: #fff;
  padding: 16px 14px;
  text-align: center;
  position: relative;
  border-bottom: 4px solid #f59e0b;
}

.pvc-card-front-header .inst-brand {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f59e0b;
  margin: 0;
}

.pvc-card-front-header .inst-sub {
  font-size: 9px;
  color: #94a3b8;
  margin: 2px 0 0 0;
}

.pvc-card-front-header .card-tag {
  display: inline-block;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 6px;
  letter-spacing: 0.05em;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.pvc-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.pvc-student-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  border: 3px solid #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  color: #475569;
  margin-bottom: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.pvc-student-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 2px 0;
  text-align: center;
}

.pvc-student-course {
  font-size: 11px;
  font-weight: 700;
  color: #4f46e5;
  margin-bottom: 12px;
  text-align: center;
}

.pvc-card-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.pvc-card-table td {
  padding: 3px 0;
}

.pvc-card-table td.lbl {
  color: #64748b;
  font-weight: 600;
  width: 40%;
}

.pvc-card-table td.val {
  color: #0f172a;
  font-weight: 700;
}

.pvc-barcode-wrap {
  width: 100%;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  margin-top: auto;
}

.pvc-barcode-lines {
  font-family: 'Libre Barcode 39', monospace, Courier;
  font-size: 26px;
  letter-spacing: 2px;
  color: #0f172a;
  line-height: 1;
}

.pvc-barcode-txt {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #475569;
  margin-top: 2px;
  font-weight: 600;
}

.pvc-card-back {
  background: #f8fafc;
}

.pvc-card-back-content {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.pvc-rules-list {
  font-size: 10px;
  color: #475569;
  line-height: 1.5;
  padding-left: 14px;
  margin: 10px 0 16px 0;
}

.pvc-sig-row {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.pvc-sig-box {
  text-align: center;
  font-size: 9px;
  color: #64748b;
  font-weight: 700;
}

.pvc-sig-img {
  font-family: 'Brush Script MT', cursive, serif;
  font-size: 18px;
  color: #1e3a8a;
  font-style: italic;
  margin-bottom: 4px;
}

/* ==============================================================================
   Certificate Printable Controls & Luxury Border Patterns
   ============================================================================== */
.cert-modal-container {
  width: 100%;
  max-width: 980px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 24px);
}

.cbt-question-filter-grid, .cbt-attempt-filter-grid { width: 100%; }
@media (max-width: 900px) {
  .cbt-question-filter-grid, .cbt-attempt-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 560px) {
  .cbt-question-filter-grid, .cbt-attempt-filter-grid { grid-template-columns: 1fr !important; }
}

@keyframes certificateCelebrateIn {
  0% { opacity: 0; transform: translateY(24px) scale(.88) rotate(-1deg); }
  55% { opacity: 1; transform: translateY(-4px) scale(1.02) rotate(.2deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
@keyframes certificateSparkle {
  0%, 100% { opacity: 0; transform: scale(.5) rotate(0); }
  35% { opacity: .9; transform: scale(1) rotate(45deg); }
  70% { opacity: .25; transform: scale(1.15) rotate(90deg); }
}
.certificate-celebrate-modal {
  animation: certificateCelebrateIn .55s cubic-bezier(.2,.8,.2,1) both;
  transform-origin: center;
}
.certificate-celebrate-overlay::before,
.certificate-celebrate-overlay::after {
  content: '✦';
  position: fixed;
  z-index: 1101;
  pointer-events: none;
  color: #fbbf24;
  font-size: 34px;
  animation: certificateSparkle 1.1s ease-out .1s both;
}
.certificate-celebrate-overlay::before { top: 22%; left: 18%; }
.certificate-celebrate-overlay::after { right: 18%; bottom: 22%; animation-delay: .25s; color: #f59e0b; }

@media (max-width: 700px) {
  .cert-modal-container { max-height: calc(100vh - 12px); border-radius: 14px; }
  .cert-controls-toolbar { padding: 10px; align-items: stretch; }
  .cert-controls-group { width: 100%; }
  .cert-controls-group:last-child { justify-content: flex-end; }
  .cert-preview-wrapper { padding: 10px; align-items: flex-start; }
  .cert-sheet.cert-landscape { width: min(860px, 92vw); min-height: min(600px, 64vw); transform-origin: top center; }
  .cert-sheet.cert-portrait { width: min(600px, 86vw); min-height: min(840px, 120vw); }
}

.cert-controls-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  gap: 12px;
  flex-wrap: wrap;
}

.cert-controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cert-control-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.cert-control-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFF;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.cert-control-select option {
  background: #0f172a;
  color: #FFF;
}

.cert-preview-wrapper {
  padding: 30px;
  background: #0b0f19;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.cert-sheet {
  background: #FFFFFF;
  color: #0F172A;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

/* Certificate Orientations & Sizes */
.cert-sheet.cert-landscape {
  width: 860px;
  min-height: 600px;
}

.cert-sheet.cert-portrait {
  width: 600px;
  min-height: 840px;
}

/* Luxury Border Patterns */
.cert-pattern-gold {
  border: 12px double #B45309;
  outline: 2px solid #D97706;
  outline-offset: -18px;
  background: radial-gradient(circle at center, #FFFDF7 0%, #FAF5EB 100%);
}

.cert-pattern-guilloche {
  border: 14px solid #1E3A8A;
  outline: 3px double #3B82F6;
  outline-offset: -20px;
  background-color: #FFFFFF;
  background-image: radial-gradient(#3B82F6 0.75px, transparent 0.75px), radial-gradient(#3B82F6 0.75px, #FFFFFF 0.75px);
  background-size: 30px 30px;
  background-position: 0 0, 15px 15px;
  background-opacity: 0.05;
}

.cert-pattern-watermark {
  border: 10px solid #065F46;
  outline: 2px dashed #10B981;
  outline-offset: -16px;
  background: #FFFFFF;
  position: relative;
}

.cert-watermark-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.04;
  pointer-events: none;
  font-size: 260px;
  color: #000;
}

/* ==============================================================================
   WordPress Style Media Library
   ============================================================================== */
.media-manager-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.media-dropzone {
  border: 2px dashed var(--border-glass-strong);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 24px;
}

.media-dropzone:hover, .media-dropzone.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.media-item-card {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.media-item-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.media-item-card.selected {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4);
}

.media-thumb-box {
  width: 100%;
  height: 130px;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.media-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.media-item-card:hover .media-thumb-img {
  transform: scale(1.05);
}

.media-info-box {
  padding: 8px 10px;
  font-size: 11px;
}

.media-info-title {
  font-weight: 600;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.media-info-meta {
  color: var(--text-dim);
  font-size: 10px;
  display: flex;
  justify-content: space-between;
}

.media-picker-modal {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483647 !important;
  padding: 24px;
  isolation: isolate;
}

.media-picker-content {
  width: 100%;
  max-width: 1100px;
  height: min(85vh, 920px);
  max-height: calc(100vh - 48px);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
}

.media-picker-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  flex: 1;
  overflow: hidden;
}

.media-picker-library {
  padding: 20px;
  overflow-y: auto;
  border-right: 1px solid var(--border-glass);
}

.media-picker-sidebar {
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==============================================================================
   APEX LOGIN IMPERSONATION SYSTEM - BANNER & MODAL STYLES
   ============================================================================== */

body.has-impersonation-banner {
  padding-top: 50px !important;
}

.apex-impersonation-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: linear-gradient(90deg, #4c1d95 0%, #312e81 35%, #1e1b4b 70%, #0f172a 100%);
  border-bottom: 2px solid #8b5cf6;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
  z-index: 9999999;
  display: flex;
  align-items: center;
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  color: #fff;
  backdrop-filter: blur(12px);
  animation: slideDownBanner 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownBanner {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.apex-impersonation-banner .impersonation-inner {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.apex-impersonation-banner .impersonation-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  flex-wrap: wrap;
}

.impersonation-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #a855f7;
  box-shadow: 0 0 10px #a855f7;
  animation: pulseDot 1.8s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.8;
    box-shadow: 0 0 4px #a855f7;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
    box-shadow: 0 0 14px #d8b4fe;
  }
}

.impersonation-tag {
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(192, 132, 252, 0.4);
  color: #f3e8ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
}

.impersonation-text {
  color: #f8fafc;
}

.impersonation-text strong {
  color: #fff;
  font-weight: 700;
}

.impersonation-role {
  color: #ddd6fe;
  font-size: 12px;
}

.impersonation-divider {
  color: rgba(255, 255, 255, 0.3);
}

.impersonation-admin {
  color: #cbd5e1;
  font-size: 12px;
}

.impersonation-admin strong {
  color: #f1f5f9;
}

.impersonation-exit-btn {
  background: #ef4444;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.impersonation-exit-btn:hover {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.6);
}

.impersonation-exit-btn:active {
  transform: translateY(0);
}

/* Impersonation Modal User Card Grid */
.impersonation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  max-height: 520px;
  overflow-y: auto;
  padding: 4px 2px;
}

.impersonation-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
}

.impersonation-card:hover {
  background: rgba(51, 65, 85, 0.7);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.15);
  transform: translateY(-1px);
}

.impersonation-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.impersonation-card-avatar.student {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.impersonation-card-avatar.parent {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.impersonation-card-avatar.staff {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.impersonation-card-avatar.other {
  background: rgba(147, 51, 234, 0.18);
  color: #c084fc;
  border: 1px solid rgba(147, 51, 234, 0.3);
}

/* ==============================================================================
   GOOGLE-STYLE ACCOUNT DROPDOWN & UNIVERSAL SETTINGS MODAL
   ============================================================================== */

.apex-account-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 100;
}

.apex-account-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  color: var(--text-main, #f8fafc);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  user-select: none;
}

.apex-account-trigger:hover,
.apex-account-trigger.is-active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.apex-account-avatar-wrapper {
  position: relative;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.apex-account-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.apex-account-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  background: #10b981;
  border: 2px solid var(--bg-surface, #0f172a);
  border-radius: 50%;
}

.apex-account-status-dot.totp-active {
  box-shadow: 0 0 8px #10b981;
}

.apex-account-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.apex-account-trigger-name {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apex-account-trigger-role {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
  text-transform: capitalize;
}

.apex-account-chevron {
  font-size: 16px;
  color: var(--text-muted, #94a3b8);
  transition: transform 0.2s ease;
}

.apex-account-trigger.is-active .apex-account-chevron {
  transform: rotate(180deg);
}

/* Google-Style Account Popover Card */
.apex-google-account-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 1000;
  animation: apexCardIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(20px);
}

@keyframes apexCardIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.apex-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #94a3b8;
  padding-bottom: 4px;
}

.apex-card-account-email {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}

.apex-card-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.apex-card-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* User Card Center Showcase */
.apex-card-user-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.apex-card-avatar-large {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
}

.apex-card-user-name {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
}

.apex-card-user-email {
  font-size: 12px;
  color: #94a3b8;
  word-break: break-all;
}

.apex-card-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* Google Pill Button: "Manage your Apex Account" */
.apex-manage-account-btn {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.apex-manage-account-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Menu items inside Google Card */
.apex-card-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -8px;
}

.apex-card-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}

.apex-card-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}

.apex-card-menu-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.apex-card-menu-left i {
  font-size: 17px;
  color: #94a3b8;
  width: 20px;
  text-align: center;
}

.apex-card-menu-item:hover .apex-card-menu-left i {
  color: #38bdf8;
}

.apex-card-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

.apex-card-signout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.apex-card-signout-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.apex-card-footer {
  text-align: center;
  font-size: 11px;
  color: #64748b;
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ==============================================================================
   UNIVERSAL ACCOUNT SETTINGS & 2FA MODAL
   ============================================================================== */

.apex-settings-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  animation: apexFadeIn 0.2s ease-out;
}

@keyframes apexFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.apex-settings-dialog {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  width: 100%;
  max-width: 780px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: apexDialogPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes apexDialogPop {
  from { transform: scale(0.96) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.apex-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.apex-settings-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
}

.apex-settings-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

@media (max-width: 700px) {
  .apex-settings-body {
    flex-direction: column;
  }
}

.apex-settings-tabs {
  width: 220px;
  background: rgba(15, 23, 42, 0.4);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .apex-settings-tabs {
    width: 100%;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
  }
}

.apex-settings-tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.apex-settings-tab-btn i {
  font-size: 16px;
}

.apex-settings-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

.apex-settings-tab-btn.is-active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.apex-settings-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* Form Styles inside Settings Modal */
.apex-form-group {
  margin-bottom: 16px;
}

.apex-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 6px;
}

.apex-form-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  color: #f8fafc;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.apex-form-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.apex-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 550px) {
  .apex-form-row {
    grid-template-columns: 1fr;
  }
}

/* Password strength meter */
.apex-strength-meter {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  margin-top: 6px;
  overflow: hidden;
}

.apex-strength-bar {
  height: 100%;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* 2FA Card Styling */
.apex-2fa-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.apex-2fa-banner.is-active {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.apex-2fa-banner.is-inactive {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.apex-qr-box {
  background: #ffffff;
  padding: 12px;
  border-radius: 12px;
  display: inline-flex;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.apex-totp-secret-key {
  font-family: var(--font-mono, monospace);
  font-size: 15px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  padding: 8px 14px;
  border-radius: 8px;
  letter-spacing: 2px;
  color: #38bdf8;
  user-select: all;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ==============================================================================
   WORKSPACE THEME SELECTION CARDS
   ============================================================================== */

.apex-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.apex-theme-card {
  background: rgba(15, 23, 42, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  text-align: left;
}

.apex-theme-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.apex-theme-card.is-selected {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 0 1px #38bdf8, 0 8px 24px rgba(56, 189, 248, 0.15);
}

.apex-theme-preview-box {
  height: 95px;
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.apex-theme-badge-active {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #10b981;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.apex-theme-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.apex-theme-card-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
  margin-bottom: 12px;
  flex: 1;
}

.apex-theme-card-btn {
  width: 100%;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
}

/* ==============================================================================
   Apex Universal Pagination Bar
   ============================================================================== */
.apex-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(17, 24, 39, 0.45);
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 0 0 12px 12px;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  user-select: none;
}

.pagination-info {
  color: var(--text-muted, #94a3b8);
  font-size: 13px;
}

.pagination-info strong {
  color: var(--text, #f1f5f9);
  font-weight: 600;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.05);
  color: var(--text, #f1f5f9);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--primary, #6366f1);
  background: rgba(99, 102, 241, 0.15);
  color: #ffffff;
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.04);
  color: var(--text, #f1f5f9);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.pagination-page-btn:hover:not(.active) {
  border-color: var(--primary, #6366f1);
  background: rgba(99, 102, 241, 0.12);
  color: #ffffff;
}

.pagination-page-btn.active {
  background: var(--primary, #6366f1);
  border-color: var(--primary, #6366f1);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.pagination-ellipsis {
  padding: 0 4px;
  color: var(--text-muted, #94a3b8);
  font-size: 13px;
}

.pagination-perpage {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted, #94a3b8);
  font-size: 13px;
}

.pagination-perpage select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
  background: rgba(15, 23, 42, 0.8);
  color: var(--text, #f1f5f9);
  font-size: 12px;
  cursor: pointer;
}

/* ==============================================================================
   Custom Student Fields, Form Editor & Documents Vault Styles
   ============================================================================== */
.field-vis-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted, #94a3b8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  user-select: none;
  transition: all 0.15s ease;
}

.field-vis-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.25);
}

.field-vis-pill.active {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

.custom-field-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.camera-viewfinder-box {
  width: 100%;
  max-width: 460px;
  height: 380px;
  background: #090d16;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.camera-face-guide {
  position: absolute;
  width: 200px;
  height: 240px;
  border: 2px dashed rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
}

.student-doc-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.student-doc-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary, #6366f1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ==============================================================================
   WYSIWYG RICH TEXT EDITOR & HOMEWORK ATTACHMENTS
   ============================================================================== */
.wysiwyg-container {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.wysiwyg-container:focus-within {
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.wysiwyg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  align-items: center;
}
.wysiwyg-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted, #94a3b8);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  min-width: 28px;
  height: 28px;
}
.wysiwyg-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}
.wysiwyg-btn.active {
  background: var(--primary, #6366f1);
  color: #fff;
}
.wysiwyg-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
}
.wysiwyg-editor {
  min-height: 140px;
  max-height: 360px;
  overflow-y: auto;
  padding: 12px 14px;
  color: var(--text-main, #f8fafc);
  font-size: 14px;
  line-height: 1.6;
  outline: none;
}
.wysiwyg-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--text-dim, #64748b);
  pointer-events: none;
  display: block;
}
.wysiwyg-editor p { margin: 0 0 8px 0; }
.wysiwyg-editor h2, .wysiwyg-editor h3 { margin: 8px 0 6px 0; font-weight: 700; color: #fff; }
.wysiwyg-editor ul, .wysiwyg-editor ol { margin: 0 0 8px 0; padding-left: 24px; }
.wysiwyg-editor blockquote {
  border-left: 3px solid var(--primary, #6366f1);
  margin: 8px 0;
  padding: 6px 12px;
  background: rgba(99, 102, 241, 0.08);
  border-radius: 0 6px 6px 0;
  color: #cbd5e1;
}
.wysiwyg-editor code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12.5px;
  color: #38bdf8;
}

/* Homework Attachments & Chips */
.attachments-wrapper {
  margin-top: 10px;
}
.attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-main, #f8fafc);
  text-decoration: none;
  transition: all 0.2s ease;
}
.attachment-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary, #6366f1);
  color: #fff;
  transform: translateY(-1px);
}
.attachment-chip i { font-size: 15px; }
.attachment-chip .chip-remove {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  display: flex;
  align-items: center;
}
.attachment-chip .chip-remove:hover { color: var(--rose, #ef4444); }

/* Rich Content Display */
.homework-rich-content {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary, #cbd5e1);
}
.homework-rich-content p { margin: 0 0 6px 0; }
.homework-rich-content ul, .homework-rich-content ol { margin: 0 0 6px 0; padding-left: 20px; }
.homework-rich-content blockquote {
  border-left: 3px solid var(--primary, #6366f1);
  margin: 6px 0;
  padding: 4px 10px;
  background: rgba(99, 102, 241, 0.08);
  border-radius: 0 4px 4px 0;
}
.homework-rich-content code {
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

/* ==============================================================================
   TOPBAR OMNISEARCH & QUICK CREATE (+ NEW) SYSTEM
   ============================================================================== */
#topbarOmniInput,
.topbar-omnisearch input,
.topbar-omnisearch input[type="text"] {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.topbar-quick-create {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.topbar-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 13px;
  background: linear-gradient(135deg, var(--primary, #3b82f6), #2563eb);
  color: #ffffff !important;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
  user-select: none;
}
.topbar-new-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}
.topbar-new-btn:active {
  transform: translateY(1px);
}

.quick-create-shortcut-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.5px;
}

/* Quick Create Dropdown Menu */
.quick-create-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 740px;
  max-width: min(740px, calc(100vw - 32px));
  max-height: 82vh;
  background: var(--bg-surface, #0f172a);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.16));
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: qcDropdownIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes qcDropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.quick-create-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.quick-create-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-create-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

.quick-create-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-create-key-pill {
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #94a3b8);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.quick-create-filter-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.quick-create-filter-wrap i {
  position: absolute;
  left: 12px;
  color: var(--primary, #3b82f6);
  font-size: 15px;
}
.quick-create-filter-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  color: var(--text-main, #f8fafc);
  font-size: 13px;
  outline: none;
  transition: all 0.15s ease;
}
.quick-create-filter-input:focus {
  border-color: var(--primary, #3b82f6);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.quick-create-body {
  padding: 16px 18px;
  overflow-y: auto;
  max-height: calc(82vh - 120px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.quick-create-category-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-create-category-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted, #94a3b8);
  padding-left: 2px;
}

.quick-create-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.quick-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  text-align: left;
}
.quick-action-card:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
}
.quick-action-card:active {
  transform: translateY(0);
}

.quick-action-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.quick-action-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.quick-action-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.quick-action-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quick-action-desc {
  font-size: 10.5px;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-action-key {
  font-size: 10px;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #94a3b8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  margin-left: 6px;
}

/* Theme thumbnails remain recognizable regardless of the currently active theme. */
.workspace-preview { display: flex; overflow: hidden; padding: 0 !important; border: 1px solid #d9dde3; height: 132px; color: #202124; font-family: Arial, sans-serif; text-align: left; }
.workspace-preview-sidebar { width: 25%; padding: 14px 7px; background: #eaeaef; }
.workspace-preview-sidebar b { display: block; width: 12px; height: 12px; background: #0066cc; border-radius: 4px; margin-bottom: 14px; }
.workspace-preview-sidebar i { display: block; height: 6px; background: #c3c6cd; border-radius: 5px; margin: 9px 0; }
.workspace-preview-sidebar i:first-of-type { background: #6ea6ec; }
.workspace-preview-main { flex: 1; padding: 11px; background: #f5f5f7; }
.workspace-preview-toolbar { height: 6px; width: 58%; border-radius: 4px; background: #d2d5dc; margin-bottom: 10px; }
.workspace-preview-main strong { font-size: 11px; color: #202124 !important; }
.workspace-preview-stats { display: flex; gap: 6px; margin: 8px 0; }
.workspace-preview-stats span { width: 44%; border-radius: 7px; padding: 6px; font-size: 12px; background: #fff; color: #202124 !important; }
.workspace-preview-row { height: 5px; background: #dfe2e7; border-radius: 4px; margin-top: 6px; }
.workspace-preview-row:last-child { width: 70%; }
.workspace-preview-gogole .workspace-preview-sidebar { background: #eaf0f9; }
.workspace-preview-gogole .workspace-preview-sidebar b { border-radius: 50%; background: conic-gradient(#4285f4 0 25%,#ea4335 25% 50%,#fbbc04 50% 75%,#34a853 75%); }
.workspace-preview-gogole .workspace-preview-main { background: #f8fafd; }
.workspace-preview-gogole .workspace-preview-stats span { background: #d3e3fd; border-radius: 12px; }
.workspace-preview-gogole .workspace-preview-stats span:last-child { background: #e6f4ea; }

/* School planner: shared controls, deliberate hierarchy, real scrollable schedules. */
.school-planner { display: grid; gap: 24px; }
.planner-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.planner-heading h2 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; margin: 5px 0 8px; }
.planner-heading p, .planner-section-heading p, .planner-help, .school-planner details p { color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.planner-eyebrow { color: var(--primary); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.planner-fieldset { border: 0; padding: 0; min-width: 0; }
.planner-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 24px; align-items: start; }
.planner-main { display: grid; gap: 20px; min-width: 0; }
.planner-section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.planner-section-heading h3, .planner-settings h3 { font-size: 17px; margin-bottom: 4px; }
.planner-section-heading > div { flex: 1; min-width: 150px; }
.planner-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-glow); color: var(--primary); font-weight: 700; }
.planner-class { padding: 14px 0; border-top: 1px solid var(--border-subtle); }
.planner-class > strong { display: block; margin-bottom: 10px; }
.planner-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.planner-chip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; background: var(--bg-surface); color: var(--text-main); }
.planner-chip.selected { background: var(--primary-glow); border-color: var(--primary); }
.planner-chip small { color: var(--text-muted); }
.planner-chip input { accent-color: var(--primary); }
.planner-subject { border-top: 1px solid var(--border-subtle); padding: 14px 0; }
.planner-subject-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.planner-count { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 12px; }
.planner-count input { width: 72px; }
.school-planner summary { cursor: pointer; color: var(--primary); font-size: 12px; padding: 12px 0; }
.planner-resource-group { margin-bottom: 14px; font-size: 12px; }
.planner-settings { display: grid; gap: 16px; position: sticky; top: 90px; }
.planner-settings label { font-size: 12px; color: var(--text-muted); }
.planner-settings .form-control { margin-top: 6px; }
.planner-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.planner-break { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 5px; }
.planner-break input { min-width: 0; padding-inline: 5px; }
.planner-generate { width: 100%; justify-content: center; min-height: 46px; }
.planner-preview-filters { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; }
.planner-preview-filters label { font-size: 12px; color: var(--text-muted); }
.planner-notice { padding: 16px; border: 1px solid var(--border-subtle); border-left: 3px solid var(--primary); border-radius: var(--radius-sm); background: var(--bg-surface); font-size: 13px; }
.planner-notice p + p { margin-top: 6px; }
.planner-progress progress { width: min(100%, 420px); margin: 15px 15px 0 0; accent-color: var(--primary); }
.schedule-table-scroll { width: 100%; max-width: 100%; overflow: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.schedule-preview-table { min-width: 850px !important; width: 100%; border-collapse: collapse; }
.schedule-preview-table th { white-space: nowrap; position: sticky; top: 0; }
.planner-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.planner-preview-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.schedule-grid-scroll { width: 100%; overflow: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.school-timetable-grid { width: 100%; min-width: 980px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.school-timetable-grid th, .school-timetable-grid td { border-right: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.school-timetable-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--workspace-table-head, var(--bg-card)); color: var(--text-main); padding: 13px 10px; text-align: center; font-size: 12px; }
.school-timetable-grid thead th small, .grid-period-label small { display: block; color: var(--text-muted); font-size: 10px; font-weight: 500; margin-top: 3px; }
.school-timetable-grid .grid-period-header, .school-timetable-grid .grid-period-label { width: 120px; background: var(--bg-card-hover); }
.grid-period-label { padding: 12px 10px; color: var(--text-main); font-size: 12px; text-align: left; position: sticky; left: 0; z-index: 1; }
.school-timetable-grid td { min-height: 94px; height: 94px; padding: 6px; background: var(--bg-surface); }
.school-timetable-grid td:has(.grid-empty):hover { background: var(--primary-glow); }
.grid-lesson { min-height: 78px; padding: 9px; border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border-subtle)); border-left: 4px solid var(--primary); border-radius: 10px; background: var(--bg-card); box-shadow: var(--shadow-sm); cursor: grab; user-select: none; }
.grid-lesson:active { cursor: grabbing; }
.grid-lesson strong, .grid-lesson span, .grid-lesson small { display: block; line-height: 1.3; }
.grid-lesson strong { color: var(--text-main); font-size: 12px; }
.grid-lesson span { color: var(--text-muted); font-size: 10px; margin-top: 4px; }
.grid-lesson small { color: var(--text-dim); font-size: 9px; margin-top: 5px; }
.grid-lesson-conflict { border-color: var(--rose); background: color-mix(in srgb, var(--rose) 10%, var(--bg-card)); }
.grid-empty { min-height: 78px; display: grid; place-items: center; color: var(--text-dim); font-size: 10px; opacity: .35; border: 1px dashed var(--border-subtle); border-radius: 8px; }
.grid-free { min-height: 78px; display: grid; place-items: center; color: var(--primary); background: var(--primary-glow); border: 1px dashed var(--primary); border-radius: 8px; font-size: 11px; font-weight: 700; }
@media (max-width: 1050px) { .planner-layout { grid-template-columns: 1fr; } .planner-settings { position: static; } }
@media (max-width: 768px) {
  .planner-subject-row { align-items: flex-start; flex-wrap: wrap; } .planner-chip { min-height: 44px; }
  .school-planner .form-control { font-size: 16px; } .planner-count input { width: 80px; }
  table.data-table.schedule-preview-table { display: table !important; }
  .schedule-preview-table thead { display: table-header-group !important; }
  .schedule-preview-table tbody { display: table-row-group !important; }
  .schedule-preview-table tr { display: table-row !important; }
  .schedule-preview-table :is(th,td) { display: table-cell !important; width: auto !important; padding: 12px !important; }
  .schedule-preview-table td::before { display: none !important; }
  .school-timetable-grid { min-width: 900px; }
  .school-timetable-grid .grid-period-header, .school-timetable-grid .grid-period-label { width: 105px; }
  .school-timetable-grid td { height: 104px; }
}
/* Statistic cards use spacing and typography, never ornamental accent rails. */
.stat-grid .stat-card { gap: 16px; box-shadow: var(--shadow-sm); }
.stat-grid .stat-lbl { letter-spacing: .04em; font-size: 11px; font-weight: 600; }
.stat-grid .stat-val { font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.lead-kanban-board { display:grid; grid-template-columns:repeat(4,minmax(220px,1fr)); gap:12px; overflow-x:auto; padding-bottom:4px; }
.lead-kanban-column { min-height:260px; border:1px solid var(--border-subtle); border-radius:12px; background:var(--surface-2,rgba(127,127,127,.06)); }
.lead-kanban-column-head { display:flex; justify-content:space-between; align-items:center; padding:12px; border-bottom:1px solid var(--border-subtle); text-transform:capitalize; }
.lead-kanban-card { margin:10px; padding:12px; border:1px solid var(--border-subtle); border-radius:10px; background:var(--surface-1,var(--card-bg)); box-shadow:var(--shadow-sm); cursor:grab; }
.lead-kanban-card:active { cursor:grabbing; opacity:.75; }
.teacher-timetable-scroll { overflow:auto; border:1px solid var(--border-subtle); border-radius:12px; }
.teacher-timetable-grid { width:100%; min-width:900px; border-collapse:separate; border-spacing:0; }
.teacher-timetable-grid th,.teacher-timetable-grid td { border-right:1px solid var(--border-subtle); border-bottom:1px solid var(--border-subtle); padding:10px; vertical-align:top; min-width:150px; }
.teacher-timetable-grid thead th { background:var(--surface-2,rgba(127,127,127,.08)); text-align:center; text-transform:uppercase; font-size:11px; letter-spacing:.04em; }
.teacher-period-col { width:120px; min-width:120px !important; background:var(--surface-2,rgba(127,127,127,.05)); }
.teacher-period-col small { display:block; margin-top:4px; color:var(--text-muted); font-weight:400; }
.teacher-lesson { min-height:78px; border-left:3px solid var(--primary); border-radius:8px; padding:9px; background:var(--primary-glow,rgba(59,130,246,.1)); display:flex; flex-direction:column; gap:4px; }
.teacher-lesson span,.teacher-lesson small { color:var(--text-muted); font-size:11px; }
.teacher-free { min-height:78px; display:grid; place-items:center; color:var(--text-muted); opacity:.6; font-size:12px; }
@media (max-width:900px) { .lead-kanban-board { grid-template-columns:repeat(2,minmax(220px,1fr)); } }
@media (max-width:620px) { .lead-kanban-board { grid-template-columns:repeat(1,minmax(240px,1fr)); } }
/* Marksheet builder preview themes */
.marksheet-design-preview{background:#fff;color:#172033;border:1px solid #cbd5e1;border-radius:12px;padding:18px;min-height:340px;box-shadow:0 12px 30px rgba(15,23,42,.12)}
.marksheet-design-preview table th,.marksheet-design-preview table td{border:1px solid #cbd5e1;padding:5px;text-align:left}
.marksheet-theme-modern{background:linear-gradient(145deg,#eff6ff,#fff);border-top:7px solid #2563eb;border-bottom:7px solid #14b8a6}
.marksheet-theme-modern table th{background:#dbeafe;color:#1e3a8a}
.marksheet-theme-minimal{border:1px solid #94a3b8;border-radius:2px;box-shadow:none;font-family:Georgia,serif}
.marksheet-theme-minimal table th{background:#f8fafc;font-weight:600}
@media (max-width: 700px){.birthday-widget{width:100%!important;min-width:0!important;max-width:none!important}}
