
@font-face {
  font-family: 'Caveat';
  src: url('/assets/fonts/Caveat-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* =============================================================
   Skoolms design system
   Tokens first; every component reads from them so light and
   dark themes only swap variables.
   ============================================================= */

:root,
[data-theme="light"] {
  color-scheme: light;

  --bg-app: #f5f7fb;
  --bg-card: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-secondary: #f8fafc;
  --bg-input: #ffffff;
  --bg-muted: #f1f4f9;
  --bg-elevated: #ffffff;
  --bg-glass: #ffffff;
  --bg-hover: rgba(79, 70, 229, 0.06);

  --border-light: #e4e8f0;
  --border-strong: #cfd6e3;
  --border-subtle: #eef1f6;
  --border-color: #e4e8f0;

  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #6366f1;
  --primary-tint: rgba(79, 70, 229, 0.08);
  --primary-glow: rgba(79, 70, 229, 0.22);
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);

  --accent-emerald: #059669;
  --accent-emerald-tint: rgba(5, 150, 105, 0.1);
  --accent-emerald-text: #047857;
  --accent-amber: #d97706;
  --accent-amber-tint: rgba(217, 119, 6, 0.1);
  --accent-amber-text: #b45309;
  --accent-rose: #e11d48;
  --accent-rose-tint: rgba(225, 29, 72, 0.09);
  --accent-rose-text: #be123c;
  --accent-purple: #7c3aed;
  --accent-purple-tint: rgba(124, 58, 237, 0.09);

  --text-main: #0b1220;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --text-on-primary: #ffffff;

  --font-sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-display: "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 6px -2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px -6px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, 0.04), 0 20px 44px -12px rgba(15, 23, 42, 0.18);
  --ring: 0 0 0 3px var(--primary-glow);
  --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease), opacity 0.18s var(--ease);

  --backdrop:
    radial-gradient(1100px 600px at 8% -10%, rgba(99, 102, 241, 0.13), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(124, 58, 237, 0.09), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(16, 185, 129, 0.06), transparent 60%);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg-app: #070b14;
  --bg-card: #0f1524;
  --bg-surface: #0f1524;
  --bg-surface-secondary: #161e31;
  --bg-input: #0f1524;
  --bg-muted: #161e31;
  --bg-elevated: #121a2b;
  --bg-glass: #0f1524;
  --bg-hover: rgba(129, 140, 248, 0.08);

  --border-light: #1f2a40;
  --border-strong: #2c3a57;
  --border-subtle: #182136;
  --border-color: #1f2a40;

  --primary: #818cf8;
  --primary-dark: #6366f1;
  --primary-light: #a5b4fc;
  --primary-tint: rgba(129, 140, 248, 0.13);
  --primary-glow: rgba(129, 140, 248, 0.3);
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  --accent-emerald: #34d399;
  --accent-emerald-tint: rgba(52, 211, 153, 0.12);
  --accent-emerald-text: #6ee7b7;
  --accent-amber: #fbbf24;
  --accent-amber-tint: rgba(251, 191, 36, 0.12);
  --accent-amber-text: #fcd34d;
  --accent-rose: #fb7185;
  --accent-rose-tint: rgba(251, 113, 133, 0.12);
  --accent-rose-text: #fda4af;
  --accent-purple: #a78bfa;
  --accent-purple-tint: rgba(167, 139, 250, 0.13);

  --text-main: #eef2fb;
  --text-secondary: #c3cce0;
  --text-muted: #8b97b1;
  --text-dim: #5f6b85;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px -2px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 24px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 48px -12px rgba(0, 0, 0, 0.75);
  --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.04);

  --backdrop:
    radial-gradient(1100px 600px at 8% -10%, rgba(99, 102, 241, 0.2), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(139, 92, 246, 0.14), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(16, 185, 129, 0.07), transparent 60%);
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}

/* Static ambient backdrop: painted once on its own layer, no script or per-frame work */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--backdrop);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-main);
}

a {
  color: var(--primary);
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

::selection {
  background: var(--primary-glow);
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-muted);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-xs);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------------------------------------
   GATEWAY
------------------------------------------------------------- */
.gateway-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1.5rem 0;
  width: 100%;
  box-sizing: border-box;
}

.login-page-body {
  min-height: 100vh;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1.5rem 1rem !important;
  margin: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.gateway-container {
  max-width: 1120px;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 2rem);
}

.gateway-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  z-index: 100;
}

.gateway-header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.gateway-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-shield {
  width: 42px;
  height: 42px;
  background: var(--primary-gradient);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 6px 16px -4px var(--primary-glow), var(--inset-highlight);
}


.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title-wrap .brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.15;
  color: var(--text-main);
}

.brand-title-wrap .brand-tagline,
.brand-tagline {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.gateway-brand h1 {
  font-size: 1.2rem;
  font-weight: 750;
}

.gateway-lan-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 0.38rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  box-shadow: var(--shadow-xs);
}

.lan-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-emerald-tint);
}

.school-hero-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm), var(--inset-highlight);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.school-hero-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: 420px;
  height: 100%;
  background: radial-gradient(closest-side at 70% 30%, var(--primary-tint), transparent);
  pointer-events: none;
}

.school-info {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-tint);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.5rem;
}

.school-info h2 {
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0;
}

.school-info p {
  color: var(--text-muted);
  font-size: 0.84rem;
  margin-top: 0.25rem;
  max-width: 560px;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.workspace-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.workspace-section-title h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.app-launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.app-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.1rem;
  text-decoration: none;
  display: flex;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm), var(--inset-highlight);
  transition: var(--transition);
}

.app-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.app-card.featured-app {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border-light));
}

.app-card-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--accent-emerald-tint);
  color: var(--accent-emerald-text);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
}

.app-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  background: var(--primary-gradient);
  box-shadow: 0 4px 10px -4px var(--primary-glow), var(--inset-highlight);
}

.app-card-icon.tone-emerald { background: linear-gradient(135deg, #10b981, #047857); }
.app-card-icon.tone-violet { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.app-card-icon.tone-amber { background: linear-gradient(135deg, #f59e0b, #b45309); }

.app-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-card-content h4 {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0 0 0.2rem 0;
}

.app-card-content p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0 0 0.5rem 0;
}

.app-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.btn-launch {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--primary);
  transition: var(--transition);
}

.app-card:hover .btn-launch {
  transform: translateX(3px);
}

.role-tag {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--bg-muted);
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
}

.signin-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.6rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-sm);
}

.signin-panel h4 {
  font-size: 1rem;
  font-weight: 700;
}

.signin-panel p {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* -------------------------------------------------------------
   APP PAGES: NAV BAR
------------------------------------------------------------- */
.app-page-body {
  min-height: 100vh;
}

.app-nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.75rem;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.nav-back-portal {
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-back-portal:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.nav-divider {
  width: 1px;
  height: 24px;
  background: var(--border-light);
}

.app-brand-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.app-brand-title .icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  background: var(--primary-tint);
}

.app-brand-title h2 {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
}

.app-brand-title p {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.nav-categories {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex: 1;
}

.user-pill-tag {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.85rem 0.25rem 0.3rem;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  display: grid;
  place-items: center;
}

.user-pill-tag .uname {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Nav dropdowns */
.nav-dropdown-group {
  position: relative;
  display: inline-flex;
}

.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.nav-dropdown-btn:hover,
.nav-dropdown-group:hover .nav-dropdown-btn,
.nav-dropdown-group.open .nav-dropdown-btn,
.nav-dropdown-group:focus-within .nav-dropdown-btn,
.nav-dropdown-btn.active {
  background: var(--bg-hover);
  color: var(--primary);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 250px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.22), 0 4px 12px -2px rgba(15, 23, 42, 0.12);
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  z-index: 99999 !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

/* Align all dropdown menus uniformly from left to right */
.nav-dropdown-group .nav-dropdown-menu,
.nav-dropdown-group:last-child .nav-dropdown-menu {
  left: 0;
  right: auto;
}

/* Hover bridge so the pointer can travel from the button into the menu */
.nav-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

/* Active on click (.open), on hover, or focus-within */
.nav-dropdown-group.open .nav-dropdown-menu,
.nav-dropdown-group:hover .nav-dropdown-menu,
.nav-dropdown-group:focus-within .nav-dropdown-menu {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--text-main);
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.nav-dropdown-item:hover,
.nav-dropdown-item.active {
  background: var(--primary-tint);
  color: var(--primary);
}

.nav-dropdown-item .item-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Segmented control */
.segmented-control {
  display: flex;
  background: var(--bg-muted);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  gap: 0.25rem;
}

.seg-btn {
  background: transparent;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.seg-btn:hover {
  color: var(--text-main);
}

.seg-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

/* -------------------------------------------------------------
   LAYOUT & SURFACES
------------------------------------------------------------- */
.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 7rem;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm), var(--inset-highlight);
  margin-bottom: 1.5rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.panel-title h2 {
  font-size: 1.12rem;
  font-weight: 700;
}

.panel-title p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Bento metrics */
.bento-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.bento-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-sm), var(--inset-highlight);
  transition: var(--transition);
}

.bento-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.bento-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.35rem;
  width: 28px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--primary);
}

.bento-card.emerald::before { background: var(--accent-emerald); }
.bento-card.amber::before { background: var(--accent-amber); }
.bento-card.purple::before { background: var(--accent-purple); }

.bento-label {
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.bento-val {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  margin-top: 0.4rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.bento-sub {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.bento-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.bento-link {
  padding: 0.15rem 0.5rem;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  cursor: pointer;
  transition: var(--transition);
}

.bento-link:hover {
  background: var(--primary-tint);
}

.bento-link:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.bento-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 0.35rem 0.5rem;
  margin-top: 0.5rem;
}

.bento-breakdown-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bento-breakdown-item span {
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bento-breakdown-item strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------
   BUTTONS
------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.58rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary {
  background: var(--primary-gradient);
  color: var(--text-on-primary);
  border: 1px solid rgba(30, 64, 175, 0.4);
  box-shadow: 0 4px 14px -2px var(--primary-glow), 0 2px 4px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 22px -3px var(--primary-glow), 0 3px 6px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.btn-secondary {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-subtle, #f8fafc) 100%);
  color: var(--text-secondary);
  border: 1.5px solid var(--border-light);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--bg-subtle, #f8fafc) 0%, var(--bg-muted, #f1f5f9) 100%);
  color: var(--text-main);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 5px 12px -2px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 1);
}

.btn-danger {
  background: linear-gradient(180deg, #f43f5e 0%, var(--accent-rose) 100%);
  color: #fff;
  border: 1px solid #be123c;
  box-shadow: 0 4px 14px -2px rgba(225, 29, 72, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -3px rgba(225, 29, 72, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  filter: brightness(1.05);
}

.btn-success {
  background: linear-gradient(180deg, #10b981 0%, var(--accent-emerald) 100%);
  color: #fff;
  border: 1px solid #047857;
  box-shadow: 0 4px 14px -2px rgba(5, 150, 105, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -3px rgba(5, 150, 105, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  filter: brightness(1.05);
}

.btn-sm {
  padding: 0.38rem 0.75rem;
  font-size: 0.78rem;
}

.btn-action-edit,
.btn-action-delete {
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 0.26rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition);
}

.btn-action-edit {
  color: var(--text-secondary);
}

.btn-action-edit:hover {
  background: var(--primary-tint);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-action-delete {
  color: var(--accent-rose);
}

.btn-action-delete:hover {
  background: var(--accent-rose-tint);
  border-color: var(--accent-rose);
}

.actions-cell {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
}

/* Management sees records without the editing controls */
.console-readonly .btn-action-edit,
.console-readonly .btn-action-delete,
.console-readonly .panel-header .btn-primary {
  display: none;
}

/* -------------------------------------------------------------
   TABLES & BADGES
------------------------------------------------------------- */
.clean-table-box {
  border-radius: var(--radius-md);
  overflow: auto;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.clean-table th:last-child {
  padding-right: 1.1rem;
  text-align: center;
}

.clean-table td:last-child {
  padding-right: 1.1rem;
  text-align: right;
}

.clean-table th {
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  padding: 0.75rem 1.1rem;
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.clean-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.87rem;
  vertical-align: middle;
}

.clean-table tr:last-child td {
  border-bottom: none;
}

.clean-table tbody tr {
  transition: background-color 0.12s ease;
}

.clean-table tbody tr:hover td {
  background: var(--bg-hover);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
}

.badge-online {
  background: var(--accent-emerald-tint);
  color: var(--accent-emerald-text);
}

.badge-alert {
  background: var(--accent-amber-tint);
  color: var(--accent-amber-text);
}

.badge-locked {
  background: var(--accent-rose-tint);
  color: var(--accent-rose-text);
}

.badge-form {
  background: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  font-weight: 650;
  font-size: 0.72rem;
}

.badge-system {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  font-weight: 650;
  font-size: 0.72rem;
}

.badge-graduated {
  background: rgba(147, 51, 234, 0.12);
  color: #7e22ce;
  border: 1px solid rgba(147, 51, 234, 0.35);
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.72rem;
}

.badge-dismissed {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.35);
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.72rem;
}

.badge-transferred {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.35);
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.72rem;
}

.dep-warning-box {
  background: var(--accent-rose-tint);
  border: 1px solid color-mix(in srgb, var(--accent-rose) 45%, transparent);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.dep-warning-box.master-override {
  background: var(--accent-amber-tint);
  border-color: color-mix(in srgb, var(--accent-amber) 45%, transparent);
}

.switch-banner {
  position: sticky;
  top: 0;
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--accent-amber-tint);
  border-bottom: 1px solid color-mix(in srgb, var(--accent-amber) 40%, transparent);
  color: var(--accent-amber-text);
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.access-add-profile {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding: 0.85rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}

.access-add-profile .form-group {
  flex: 1 1 160px;
  margin-bottom: 0;
}

.login-picker-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.switcher-heading {
  margin: 0.25rem 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#switcher-users {
  margin-top: 1.25rem;
}

.switcher-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
  max-height: 340px;
  overflow-y: auto;
}

.switcher-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-main);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.switcher-option:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-tint);
}

.switcher-option.active {
  border-color: var(--primary);
  cursor: default;
}

.switcher-option span {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
}

.switcher-user {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
}

.switcher-user span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.switcher-user-profiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.form-hint {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-hint strong {
  color: var(--primary);
  font-family: var(--font-mono);
}

.check-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
  max-height: 320px;
  overflow-y: auto;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.check-list label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-tint);
}

.badge-core {
  background: var(--primary-tint);
  color: var(--primary);
}

.badge-elective {
  background: var(--accent-amber-tint);
  color: var(--accent-amber-text);
}

.badge-learning-area {
  background: rgba(124, 58, 237, 0.12) !important;
  color: #7c3aed !important;
  border: 1px solid rgba(124, 58, 237, 0.3) !important;
  font-weight: 700;
}

[data-theme="dark"] .badge-learning-area,
body.dark-mode .badge-learning-area {
  background: rgba(139, 92, 246, 0.22) !important;
  color: #c4b5fd !important;
  border: 1px solid rgba(139, 92, 246, 0.45) !important;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.parent-portal-notice {
  background: var(--primary-tint);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
}

/* -------------------------------------------------------------
   FORMS
------------------------------------------------------------- */
.form-group,
.form-field {
  margin-bottom: 1.05rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-label,
.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-input,
.form-select,
.input-control,
.csv-textarea,
textarea.form-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  color: var(--text-main);
  font-size: 0.88rem;
  transition: var(--transition);
}

.form-select {
  appearance: none;
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.csv-textarea {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  min-height: 160px;
  resize: vertical;
}

.csv-textarea.is-dragover {
  border-style: dashed;
  border-color: var(--primary);
  background: var(--primary-tint);
}

.form-input::placeholder,
.input-control::placeholder,
.csv-textarea::placeholder {
  color: var(--text-dim);
}

.form-input:hover,
.form-select:hover,
.input-control:hover {
  border-color: var(--text-dim);
}

.form-input:focus,
.form-select:focus,
.input-control:focus,
.csv-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}

/* -------------------------------------------------------------
   MODALS
------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(7, 11, 20, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), visibility 0.2s;
}

.modal-overlay.open {
  display: flex !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(0.985);
  transition: transform 0.22s var(--ease);
  overflow: hidden;
}

.modal-overlay.open .modal-box {
  transform: none;
}

.modal-head,
.modal-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal-head h3,
.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-close,
.modal-close-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover,
.modal-close-btn:hover {
  background: var(--bg-muted);
  color: var(--text-main);
}

.modal-box > :not(.modal-head):not(.modal-header):not(.modal-actions):not(.modal-footer),
.modal-body {
  padding: 1.35rem 1.4rem;
  overflow-y: auto;
}

.modal-actions,
.modal-footer {
  padding: 0.95rem 1.4rem;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* -------------------------------------------------------------
   COLLAPSIBLE SETTINGS SECTIONS
   <details class="settings-section"> > <summary class="settings-section-head"> + <div class="settings-section-body">
------------------------------------------------------------- */
.settings-section {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  margin-bottom: 0.75rem;
}

.settings-section:last-of-type {
  margin-bottom: 0;
}

.settings-section-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.settings-section-head::-webkit-details-marker {
  display: none;
}

.settings-section-head:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.settings-section-head:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.settings-section-head::after {
  content: "";
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.18s var(--ease);
  flex-shrink: 0;
}

.settings-section[open] > .settings-section-head::after {
  transform: rotate(45deg);
}

.settings-section[open] > .settings-section-head {
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.settings-section-count {
  min-width: 1.5rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.settings-section-body {
  padding: 1rem;
}

.settings-section-body > .form-grid,
.settings-section-body > .form-group:last-child {
  margin-bottom: 0;
}

.settings-collapse-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.6rem;
}

.location-status {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.location-status a {
  color: var(--primary);
  font-weight: 650;
  white-space: nowrap;
}

.location-status.is-ok {
  border-color: color-mix(in srgb, var(--accent-emerald) 35%, transparent);
  background: var(--accent-emerald-tint);
  color: var(--accent-emerald-text);
}

.location-status.is-warn {
  border-color: color-mix(in srgb, var(--accent-amber) 35%, transparent);
  background: var(--accent-amber-tint);
  color: var(--accent-amber-text);
}

.location-status.is-error {
  border-color: color-mix(in srgb, var(--accent-rose) 35%, transparent);
  background: var(--accent-rose-tint);
  color: var(--accent-rose-text);
}

/* -------------------------------------------------------------
   TEACHER STUDIO
------------------------------------------------------------- */
.hud-strip {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md), var(--inset-highlight);
}

.session-badge {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 600;
  background: var(--primary-tint);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--primary);
}

.learner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.learner-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.learner-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.learner-card.focus-alert {
  border-color: var(--accent-amber);
  background: var(--accent-amber-tint);
}

.learner-card.locked-state {
  border-color: var(--accent-rose);
  background: var(--accent-rose-tint);
}

.learner-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

/* -------------------------------------------------------------
   STUDENT EXAM ROOM
------------------------------------------------------------- */
.quiz-runner-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md), var(--inset-highlight);
}

.quiz-timer-pill {
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.55rem 1.1rem;
  text-align: right;
}

.quiz-timer-pill .t-val {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  display: flex;
  justify-content: flex-end;
}

.st-timer-segmented {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
  vertical-align: middle;
}

.timer-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
}

.timer-unit-label {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #64748b);
  line-height: 1;
  margin-bottom: 2px;
}

.timer-digit {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
  color: inherit;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.timer-sep {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
  align-self: flex-end;
  margin-bottom: 2px;
  opacity: 0.55;
  color: inherit;
}

.question-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.35rem 0;
  padding: 0.7rem;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.q-pill {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 650;
  font-size: 0.88rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.q-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.q-pill.active {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 10px -4px var(--primary-glow);
}

.q-pill.answered {
  background: var(--accent-emerald-tint);
  color: var(--accent-emerald-text);
  border-color: color-mix(in srgb, var(--accent-emerald) 40%, transparent);
}

.q-pill.flagged {
  background: var(--accent-amber-tint);
  color: var(--accent-amber-text);
  border-color: color-mix(in srgb, var(--accent-amber) 40%, transparent);
}

.mcq-option-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.15rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.mcq-option-box:hover {
  background: var(--bg-card);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.mcq-option-box.selected {
  background: var(--primary-tint);
  border-color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
}

.exam-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.exam-head h2 {
  font-size: 1.45rem;
  font-weight: 750;
  margin-top: 0.4rem;
}

.question-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.question-card-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--text-muted);
}

.question-card-meta strong {
  color: var(--primary);
}

.question-card h3 {
  font-size: 1.2rem;
  font-weight: 650;
  line-height: 1.6;
  margin-bottom: 1.35rem;
}

.question-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.exam-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.exam-actions > div {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.save-status {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-emerald-text);
}

/* Report card */
.report-card {
  max-width: 920px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}

.report-head {
  text-align: center;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1.35rem;
  margin-bottom: 1.5rem;
}

.report-head .eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.report-head h2 {
  font-size: 1.65rem;
  font-weight: 800;
  margin: 0.35rem 0 0.25rem;
}

.report-head .motto {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted);
}

.report-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
}

.report-meta span {
  color: var(--text-muted);
  margin-right: 0.35rem;
}

.report-grade {
  font-weight: 800;
  color: var(--primary);
}

.report-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid var(--border-strong);
  padding-top: 1.15rem;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

.report-foot strong {
  font-size: 1.25rem;
  color: var(--primary);
}

.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
}

.ward-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ward-banner p {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .report-meta { grid-template-columns: 1fr; }
  .question-card { padding: 1.25rem; }
}

/* Kiosk shield */
.kiosk-shield {
  position: fixed;
  inset: 0;
  background: #070b14;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  color: #fff;
}

.kiosk-shield-bar {
  background: #be123c;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.92rem;
}

/* -------------------------------------------------------------
   TIMETABLE (Preferred Web Design - 100% Full-Width Layout)
------------------------------------------------------------- */
.tt-matrix,
.tt-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: separate !important;
  border-spacing: 4px !important;
  margin: 0 !important;
  box-sizing: border-box;
}

.tt-matrix tr,
.tt-table tr {
  height: 46px; /* Compact row height */
}

.tt-matrix th,
.tt-table th {
  padding: 0.45rem 0.5rem;
  background: var(--bg-muted, #f1f5f9);
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--text-secondary, #475569);
  border-radius: var(--radius-sm, 6px);
  text-align: center;
  border: 1px solid var(--border-light, #cbd5e1);
  box-sizing: border-box;
}

.tt-matrix th.tt-time-col,
.tt-table th.tt-time-col,
.tt-matrix td.tt-time-col,
.tt-table td.tt-time-col {
  width: 110px !important;
  min-width: 110px !important;
  max-width: 110px !important;
  box-sizing: border-box;
}

.tt-time-col {
  font-weight: 700;
  text-align: center;
  background: var(--bg-muted, #f1f5f9);
  white-space: nowrap;
  width: 110px !important;
  min-width: 110px !important;
  max-width: 110px !important;
  height: 46px;
  padding: 0.25rem 0.4rem;
  font-size: 0.74rem;
  line-height: 1.2;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border-light, #cbd5e1);
  box-sizing: border-box;
}

.tt-time-col span {
  display: block;
  font-weight: 600;
  font-size: 0.68rem;
  color: var(--text-muted, #64748b);
  margin-top: 1px;
}

.tt-matrix td,
.tt-table td {
  height: 100%;
  padding: 0;
  vertical-align: middle !important;
  text-align: center !important;
}

.tt-matrix td.tt-span-cell,
.tt-table td.tt-span-cell {
  height: 100%;
  vertical-align: middle !important;
  text-align: center !important;
}

.tt-cell {
  height: 100%;
  min-height: 46px;
  box-sizing: border-box;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-light, #cbd5e1);
  border-radius: var(--radius-sm, 6px);
  padding: 0.25rem 0.45rem;
  font-size: 0.78rem;
  line-height: 1.25;
  transition: var(--transition);
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  width: 100% !important;
  margin: 0 auto !important;
}

.tt-cell.booked {
  background: var(--primary-tint, #eff6ff);
  border-color: color-mix(in srgb, var(--primary, #0284c7) 35%, transparent);
}

.tt-cell.booked.double,
.tt-cell.booked.span,
.tt-cell.booked.double-span {
  min-height: 96px; /* Spans full space across 2 periods (46px + 4px + 46px) */
  height: 100%;
  background: var(--accent-purple-tint, #f5f3ff);
  border-color: color-mix(in srgb, var(--accent-purple, #7c3aed) 45%, transparent);
  border-left: 3px solid var(--accent-purple, #7c3aed);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  padding-left: calc(0.45rem - 2px) !important;
}

.tt-cell.booked.extra {
  background: var(--accent-amber-tint, #fdf1dc);
  border-color: color-mix(in srgb, #e3a03c 45%, transparent);
}

.tt-cell.booked.extra.span,
.tt-cell.booked.extra.double-span {
  border-left: 3px solid #e3a03c;
  padding-left: calc(0.45rem - 2px) !important;
}

.tt-cell.tt-empty {
  min-height: 46px;
  height: 100%;
  color: var(--text-dim, #94a3b8);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

.tt-card-title {
  font-weight: 700;
  color: var(--primary, #0284c7);
  font-size: 0.8rem;
  line-height: 1.25;
  text-align: center !important;
  width: 100%;
  margin: 0 auto;
}

/* Twice the font size for double periods, double cards, or when a session occupies a double card */
.tt-cell.booked.double .tt-card-title,
.tt-cell.booked.span .tt-card-title,
.tt-cell.booked.double-span .tt-card-title,
.tt-cell.double-card .tt-card-title,
.tt-cell[data-double="true"] .tt-card-title {
  color: var(--accent-purple, #7c3aed);
  font-size: 1.6rem !important;
  line-height: 1.25 !important;
  text-align: center !important;
}

.tt-cell.booked.extra .tt-card-title {
  color: #b45309;
}

.tt-cell.booked.extra.span .tt-card-title,
.tt-cell.booked.extra.double-span .tt-card-title,
.tt-cell.booked.extra.double-card .tt-card-title,
.tt-cell.booked.extra[data-double="true"] .tt-card-title {
  color: #b45309;
  font-size: 1.6rem !important;
  line-height: 1.25 !important;
  text-align: center !important;
}

.tt-card-sub {
  font-size: 0.7rem;
  color: var(--text-muted, #64748b);
  line-height: 1.25;
  margin-top: 2px;
  text-align: center !important;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.tt-cell.booked.double .tt-card-sub,
.tt-cell.booked.span .tt-card-sub,
.tt-cell.booked.double-span .tt-card-sub,
.tt-cell.double-card .tt-card-sub,
.tt-cell[data-double="true"] .tt-card-sub {
  font-size: 1.25rem !important;
  line-height: 1.25 !important;
  text-align: center !important;
  margin-top: 4px;
}

.tt-cell.booked.extra.span .tt-card-sub,
.tt-cell.booked.extra.double-span .tt-card-sub,
.tt-cell.booked.extra.double-card .tt-card-sub,
.tt-cell.booked.extra[data-double="true"] .tt-card-sub {
  font-size: 1.25rem !important;
  line-height: 1.25 !important;
  text-align: center !important;
  margin-top: 4px;
}

.tt-template-slot {
  background: var(--bg-card, #ffffff);
  border: 1.5px dashed var(--border-strong, #cbd5e1);
  border-radius: var(--radius-sm, 6px);
  height: 100%;
  min-height: 46px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.45rem;
  text-align: center;
  transition: all 0.15s ease-in-out;
}

.tt-template-slot:hover {
  background: var(--bg-muted, #f8fafc);
  border-color: var(--primary, #0284c7);
}

.tt-template-slot .tt-card-title {
  color: var(--text-muted, #64748b);
  font-weight: 700;
  font-size: 0.76rem;
}

.tt-template-slot .tt-card-sub {
  color: var(--text-dim, #94a3b8);
  font-size: 0.68rem;
  margin-top: 1px;
}

.tt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  padding: 0 1.25rem 1rem;
}

.tt-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
}

.tt-filter .form-select {
  width: 100%;
  padding: 0.45rem;
}

.tt-nav-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
}

.tt-banner {
  background: var(--primary-tint);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.tt-banner-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.tt-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tt-conflicts {
  margin-top: 0.85rem;
}

.tt-grid-card {
  width: 100% !important;
  box-sizing: border-box;
  margin: 0 0 1.5rem 0;
  padding: 0 1.25rem;
}

.tt-grid-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.65rem;
}

.tt-grid-card h3 span {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.tt-grid-scroll,
.clean-table-box,
.tt-table-wrap {
  width: 100% !important;
  box-sizing: border-box;
  overflow-x: auto;
}

#tt-grids {
  width: 100% !important;
  box-sizing: border-box;
}

.tt-result-count {
  margin: 0 1.25rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* -------------------------------------------------------------
   TIMETABLE BREAK ROW - SCRIPT FONT CARD ACROSS DAYS
------------------------------------------------------------- */
.tt-break-row {
  height: 52px !important;
}

.tt-break-row td {
  height: 52px !important;
  vertical-align: middle !important;
}

.tt-break-cell {
  padding: 4px 8px !important;
  background: transparent !important;
  border-left: 1px solid var(--border-light) !important;
}

.tt-break-card {
  width: 100%;
  height: 44px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.03) 0%, rgba(2, 132, 199, 0.12) 50%, rgba(2, 132, 199, 0.03) 100%) !important;
  border: 1.5px dashed var(--border-strong, #cbd5e1) !important;
  border-radius: var(--radius-sm, 8px) !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
  padding: 0 1.25rem;
  overflow: hidden;
  box-sizing: border-box;
}

.tt-break-line {
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(2, 132, 199, 0.35), transparent);
  margin: 0 1.5rem;
  min-width: 20px;
}

.tt-break-text {
  font-family: 'Caveat', 'Dancing Script', 'Brush Script MT', 'Segoe Script', 'Lucida Handwriting', cursive !important;
  font-size: 1.85rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.65rem !important;
  text-transform: capitalize;
  color: var(--primary, #0284c7) !important;
  text-align: center !important;
  white-space: nowrap;
  user-select: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  padding: 0 0.75rem;
}

[data-theme="dark"] .tt-break-card {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.04) 0%, rgba(56, 189, 248, 0.14) 50%, rgba(56, 189, 248, 0.04) 100%) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}

[data-theme="dark"] .tt-break-text {
  color: #38bdf8 !important;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

[data-theme="dark"] .tt-break-line {
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.4), transparent);
}

.tt-fields-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.tt-inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.tt-choice {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tt-choice-spaced {
  margin-top: 0.75rem;
}

.tt-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.tt-subhead {
  font-size: 0.82rem;
  font-weight: 700;
  margin: 1rem 0 0.5rem;
}

.tt-narrow {
  max-width: 280px;
}

.tt-breaks-editor,
.tt-rules {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.tt-break-row-edit,
.tt-rule-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 0.45rem;
  align-items: center;
}

.tt-day-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tt-day-preview span {
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.45rem;
}

.tt-center {
  text-align: center;
}

.tt-freedays-box {
  max-height: 220px;
  overflow-y: auto;
}

.tt-session-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-light);
}

.tt-session-row span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tt-session-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tt-pick-list,
.tt-day-checks {
  max-height: 160px;
  overflow-y: auto;
  margin: 0.4rem 0 0.75rem;
}

.tt-label-spaced {
  display: inline-block;
  margin-top: 0.5rem;
}

.tt-modal-wide {
  max-width: 720px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.segmented-control {
  display: flex;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.seg-btn {
  border: 0;
  background: var(--bg-card);
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  color: var(--text-secondary);
}

.seg-btn.active {
  background: var(--primary-tint);
  color: var(--primary);
}

/* -------------------------------------------------------------
   INFO TOOLTIP BADGE
------------------------------------------------------------- */
.info-badge {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 0.35rem;
  border-radius: 50%;
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  cursor: help;
  vertical-align: middle;
  text-transform: none;
  letter-spacing: 0;
  transition: var(--transition);
}

.info-badge:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.info-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(2px);
  background: #0b1220;
  color: #fff;
  font: 500 0.74rem/1.4 var(--font-sans);
  width: max-content;
  max-width: 260px;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-xs);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  text-align: left;
}

.info-badge:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%);
}

/* -------------------------------------------------------------
   GLOBAL SEARCH
------------------------------------------------------------- */
.global-search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.global-search-input {
  width: 220px;
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 0.42rem 0.9rem 0.42rem 2.1rem;
  font-size: 0.8rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition), width 0.22s var(--ease);
}

.global-search-input::placeholder {
  color: var(--text-dim);
}

.global-search-input:focus {
  width: 300px;
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: var(--ring);
}

.global-search-icon {
  position: absolute;
  left: 0.8rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.search-results-flyout {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 340px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.35rem;
  z-index: 1300;
  display: none;
}

.search-results-flyout.active {
  display: block;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
}

.search-result-item:hover,
.search-result-item:focus-visible {
  background: var(--primary-tint);
}

.search-result-category {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  font-weight: 650;
}

.search-result-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
}

.search-result-empty {
  padding: 0.85rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

/* -------------------------------------------------------------
   PROFILE CHIP & DROPDOWN
------------------------------------------------------------- */
.nav-profile-account {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.profile-account-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.75rem 0.25rem 0.28rem;
  cursor: pointer;
  user-select: none;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.profile-account-chip:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.profile-avatar-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.profile-info-block {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: left;
}

.profile-user-name {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text-main);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-user-role {
  font-size: 0.68rem;
  font-weight: 550;
  color: var(--text-muted);
}

.profile-account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
  z-index: 1500;
  display: none;
}

.profile-account-dropdown.show {
  display: block;
}

.profile-dropdown-header {
  padding: 0.55rem 0.65rem 0.65rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0.35rem;
}

.profile-dropdown-header strong {
  display: block;
  font-size: 0.86rem;
}

.profile-dropdown-header span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--text-main);
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.profile-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.profile-dropdown-divider {
  border-top: 1px solid var(--border-light);
  margin: 0.35rem 0;
}

.profile-dropdown-item.btn-logout-item {
  color: var(--accent-rose);
}

.profile-dropdown-item.btn-logout-item:hover {
  background: var(--accent-rose-tint);
  color: var(--accent-rose-text);
}

/* -------------------------------------------------------------
   AVATAR UPLOAD
------------------------------------------------------------- */
.avatar-upload-container {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 1.15rem;
}

.avatar-preview-box {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--primary);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

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

.avatar-preview-placeholder {
  font-size: 1.9rem;
  color: var(--text-dim);
  user-select: none;
}

.avatar-upload-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.avatar-upload-info label {
  font-size: 0.84rem;
  font-weight: 650;
}

.avatar-upload-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.avatar-file-input {
  display: none;
}

.avatar-size-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 650;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--accent-emerald-tint);
  color: var(--accent-emerald-text);
}

.user-table-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-light);
  vertical-align: middle;
  margin-right: 0.6rem;
}

.user-table-avatar-initial {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  font-weight: 650;
  font-size: 0.78rem;
  display: inline-grid;
  place-items: center;
  margin-right: 0.6rem;
  vertical-align: middle;
}

/* -------------------------------------------------------------
   FLOATING CONTROLS
------------------------------------------------------------- */
.theme-toggle-btn,
.debug-dock-btn {
  position: fixed;
  bottom: 1.25rem;
  height: 40px;
  padding: 0 0.95rem;
  border-radius: var(--radius-pill);
  background: var(--bg-glass);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition);
}

.theme-toggle-btn {
  left: 1.25rem;
}

.theme-toggle-btn:hover,
.debug-dock-btn:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.back-to-top-btn {
  position: fixed;
  bottom: 4.6rem;
  right: 1.25rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-glass);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  cursor: pointer;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: var(--transition), visibility 0.18s;
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.back-to-top-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.ai-faq-btn {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  left: auto;
  height: 44px;
  min-width: 142px;
  padding: 0 0.95rem;
  border-radius: var(--radius-pill, 9999px);
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 5px 16px -2px rgba(79, 70, 229, 0.55), 0 2px 5px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  cursor: pointer;
  z-index: 1000;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
  user-select: none;
  outline: none;
  overflow: visible !important;
  perspective: 700px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  will-change: transform;
}

.ai-flipper {
  position: relative;
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: aiFlipCycle 6s infinite ease-in-out;
}

.ai-faq-btn:hover .ai-flipper {
  transform: rotateX(180deg);
  animation-play-state: paused;
}

.ai-flip-front,
.ai-flip-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  height: 100%;
  white-space: nowrap;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  position: relative;
}

.ai-flip-front {
  transform: rotateX(0deg);
}

.ai-flip-back {
  position: absolute;
  inset: 0;
  transform: rotateX(180deg);
}

.ai-faq-btn .sparkle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  line-height: 1;
}

.ai-faq-btn .ai-btn-label {
  display: inline-block !important;
  font-weight: 800;
  white-space: nowrap;
  font-size: 0.85rem;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.ai-faq-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -2px rgba(79, 70, 229, 0.65), 0 3px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  filter: brightness(1.08);
}

.ai-faq-btn:active,
.ai-faq-btn[aria-expanded="true"] {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.4), inset 0 2px 4px rgba(0, 0, 0, 0.25) !important;
  filter: brightness(0.98);
}

@keyframes aiFlipCycle {
  0%, 42% {
    transform: rotateX(0deg);
  }
  50%, 92% {
    transform: rotateX(180deg);
  }
  100% {
    transform: rotateX(360deg);
  }
}

/* -------------------------------------------------------------
   SKOOLMS ASSISTANT
------------------------------------------------------------- */
.sc-assistant {
  position: fixed;
  bottom: 4.6rem;
  right: 1.25rem;
  left: auto;
  width: 320px;
  max-width: calc(100vw - 2.5rem);
  height: 500px;
  max-height: min(560px, calc(100vh - 6.5rem));
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.sc-assistant.open {
  display: flex !important;
  animation: rise-in 0.24s var(--ease);
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.sc-assist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  background: var(--primary-gradient);
  color: #fff;
  flex-shrink: 0;
}

.sc-assist-title {
  font-size: 0.88rem;
  font-weight: 700;
}

.sc-assist-close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.sc-assist-close:hover {
  background: rgba(255, 255, 255, 0.26);
}

.sc-assist-body {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sc-assist-shortcuts-wrap {
  flex-shrink: 0;
  padding: 0.6rem 0.85rem 0.35rem;
  border-bottom: 1px solid var(--border-light, #e2e8f0);
  background: var(--bg-muted, #f8fafc);
}

.sc-assist-shortcuts-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.sc-assist-thread {
  flex: 1 1 0%;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 0;
  overscroll-behavior: contain;
}

.sc-assist-msg {
  max-width: 88%;
  padding: 0.6rem 0.8rem;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-main);
}

.sc-assist-msg p {
  margin-top: 0.3rem;
}

.sc-assist-msg.from-bot {
  align-self: flex-start;
  background: var(--bg-muted);
  border-bottom-left-radius: 4px;
}

.sc-assist-msg.from-user {
  align-self: flex-end;
  background: var(--primary-gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.sc-assist-typing {
  color: var(--text-muted);
}

.sc-assist-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.sc-assist-link {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 650;
  text-decoration: none;
  transition: var(--transition);
}

.sc-assist-link:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.sc-assist-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0 0.35rem 0;
}

.sc-assist-chips:empty {
  display: none;
}

.sc-assist-chip {
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 550;
  cursor: pointer;
  transition: var(--transition);
}

.sc-assist-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-tint);
}

.sc-assist-form {
  display: flex;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card, #ffffff);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

.sc-assist-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong, #cbd5e1);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.82rem;
  transition: var(--transition);
}

.sc-assist-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.sc-assist-send {
  width: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--primary-gradient);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: var(--transition);
}

.sc-assist-send:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* -------------------------------------------------------------
   DEBUG DOCK (Platform Owner only)
------------------------------------------------------------- */
.debug-dock-btn,
.debug-floating-pill {
  right: 12.5rem !important;
  left: auto !important;
  z-index: 1050;
}

.debug-dock-btn.has-errors {
  border-color: var(--accent-rose);
  background: var(--accent-rose-tint);
  color: var(--accent-rose-text);
}

.dbg-badge {
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-pill);
}

.debug-dock-btn.has-errors .dbg-badge {
  background: var(--accent-rose);
  color: #fff;
}

.debug-drawer {
  position: fixed;
  bottom: 4.6rem;
  right: 1.25rem;
  left: auto;
  width: 540px;
  max-width: calc(100vw - 2.5rem);
  height: 480px;
  max-height: 80vh;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1300;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: rise-in 0.2s var(--ease);
}

.dbg-header {
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-elevated);
}

.dbg-close-btn {
  background: none;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text-dim);
  cursor: pointer;
}

.dbg-close-btn:hover {
  color: var(--text-main);
}

.dbg-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dbg-tabs {
  display: flex;
  gap: 0.25rem;
}

.dbg-tab {
  background: transparent;
  border: none;
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--text-muted);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.dbg-tab.active {
  background: var(--primary-tint);
  color: var(--primary);
}

.dbg-logs-tray {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.dbg-item {
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-xs);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.dbg-item:hover {
  background: var(--bg-hover);
}

.dbg-item.is-error {
  border-left: 3px solid var(--accent-rose);
}

.dbg-item-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  align-items: center;
}

.dbg-type-pill {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.dbg-item-time {
  font-size: 0.66rem;
  color: var(--text-dim);
}

.dbg-item-msg {
  word-break: break-word;
  line-height: 1.4;
}

.dbg-item-details {
  margin-top: 0.4rem;
  padding: 0.5rem;
  background: #0b1220;
  color: #7dd3fc;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
}

/* -------------------------------------------------------------
   GATEWAY FOOTER
------------------------------------------------------------- */
/* -------------------------------------------------------------
   GATEWAY FOOTER (Left-aligned with Teclyq logo & developer contact)
------------------------------------------------------------- */
.gateway-footer {
  margin-top: auto;
  padding: 1.75rem 0 5.5rem;
  border-top: 1px solid var(--border-light);
}

.footer-inner {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-sep {
  color: var(--border-strong, #cbd5e1);
  user-select: none;
}

.footer-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer-contact a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-contact a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-teclyq-logo {
  height: 20px;
  width: auto;
  max-width: 24px;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 3px;
  display: inline-block;
}

.footer-contact a {
  color: var(--primary);
  font-weight: 550;
  text-decoration: none;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

.footer-contact a:hover {
  text-decoration: underline;
  color: var(--primary-hover, var(--primary));
}

/* Footer Phone Stack (Icons replacing Tel/WhatsApp text) */
.footer-phones {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  line-height: 1.15;
  vertical-align: middle;
}

.footer-phone-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  line-height: 1.15;
}

.footer-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary, #3b4cb8);
  text-decoration: none;
  transition: transform 0.12s ease, color 0.12s ease;
  line-height: 1;
}

.footer-icon-btn:hover {
  transform: scale(1.15);
  color: var(--primary-hover, #2c3a99);
}

.footer-wa-btn {
  color: #25D366 !important;
}

.footer-wa-btn:hover {
  color: #1ebe5d !important;
}

.footer-phone-number {
  color: var(--text-secondary, #475569);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  transition: color 0.12s ease;
}

.footer-phone-number:hover {
  color: var(--primary, #3b4cb8);
  text-decoration: underline;
}


.footer-links {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 550;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

/* -------------------------------------------------------------
   SIGN-IN PAGE
------------------------------------------------------------- */
.login-wrapper {
  width: 100% !important;
  max-width: 480px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
  padding: 1rem !important;
  min-height: auto !important;
  box-sizing: border-box !important;
  position: relative;
  z-index: 10;
}

.login-container {
  width: 100% !important;
  max-width: 440px !important;
  margin: 0 auto !important;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2.4rem 2.2rem 2rem;
  box-shadow: var(--shadow-lg), var(--inset-highlight);
  box-sizing: border-box !important;
}

.login-brand {
  text-align: center;
  margin-bottom: 1.85rem;
}

.login-brand .brand-shield {
  width: 52px;
  height: 52px;
  font-size: 1.5rem;
  margin: 0 auto 1rem;
  border-radius: var(--radius-lg);
}

.login-brand h1 {
  font-size: 1.45rem;
  font-weight: 800;
}

.login-brand p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.3rem;
}

.login-error-alert {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-rose-tint);
  border: 1px solid color-mix(in srgb, var(--accent-rose) 40%, transparent);
  color: var(--accent-rose-text);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1.15rem;
}

.login-form-group {
  margin-bottom: 1.1rem;
}

.login-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.login-form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.login-label-row label {
  margin: 0;
}

.login-link-btn {
  background: none;
  border: none;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.login-input {
  width: 100%;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.93rem;
  transition: var(--transition);
}

.login-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.login-btn {
  width: 100%;
  padding: 0.78rem;
  margin-top: 0.35rem;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 650;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 20px -8px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: var(--transition);
}

.login-btn:hover {
  filter: brightness(1.06);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: progress;
}

.login-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-help {
  margin-top: 1.4rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.back-home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 0.85rem;
  transition: color 0.15s ease;
}

.back-home-link:hover {
  color: var(--primary);
}

/* -------------------------------------------------------------
   RESPONSIVE
------------------------------------------------------------- */
@media (max-width: 1100px) {
  .nav-categories {
    overflow-x: auto;
  }
  .global-search-input,
  .global-search-input:focus {
    width: 180px;
  }
}

@media (max-width: 900px) {
  .bento-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .app-nav-bar {
    height: 64px;
    flex-wrap: nowrap;
    padding: 0 1rem;
  }
  .segmented-control {
    overflow-x: auto;
  }
}

@media (max-width: 600px) {
  .gateway-body {
    padding: 1.25rem 1rem 0;
  }
  .school-hero-card {
    padding: 1.6rem;
  }
  .bento-row,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .search-results-flyout {
    width: calc(100vw - 2rem);
  }
  .theme-toggle-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    border-radius: 50% !important;
  }
  .theme-toggle-btn .theme-switch-icon,
  .theme-toggle-btn span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.25rem !important;
    line-height: 1 !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  .ai-faq-btn {
    min-width: 124px;
  }
  .ai-faq-btn .ai-btn-label {
    display: inline-block !important;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
  }
}

/* CSV Upload Dropzone & Banner */
.csv-upload-banner:hover {
  border-color: var(--primary) !important;
  background: var(--primary-tint) !important;
}
.csv-textarea.is-dragover {
  border-color: var(--primary) !important;
  background: var(--primary-tint) !important;
}

/* Password field inside-eye toggle */
.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.login-input-wrap .login-input {
  width: 100%;
  padding-right: 2.75rem;
}

.password-toggle-eye {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  line-height: 1;
}

.password-toggle-eye:hover {
  color: var(--primary);
  background: var(--bg-hover);
}

.password-toggle-eye:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.password-toggle-eye svg {
  display: block;
}


/* Universal Inspiring Ghanaian Students Background for All Pages */
.school-watermark-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background-image: url('/assets/ghana-students-breakthrough.webp') !important;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  opacity: 0.18;
  filter: saturate(1.15) contrast(1.05);
  pointer-events: none;
  z-index: -1 !important;
  transition: opacity 0.3s ease;
}

[data-theme="dark"] .school-watermark-bg {
  opacity: 0.22;
  filter: saturate(1.2) brightness(0.88) contrast(1.1);
}

/* Dedicated High-Visibility Styling for Sign-In Page */
.login-page-body .school-watermark-bg {
  opacity: 0.24;
  filter: saturate(1.22) contrast(1.08);
  z-index: -1 !important;
}

[data-theme="dark"] .login-page-body .school-watermark-bg {
  opacity: 0.28;
  filter: saturate(1.25) brightness(0.88) contrast(1.12);
  z-index: -1 !important;
}

/* Light transparent ambient glow on flanks for login page */
.login-page-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1 !important;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at -8% 50%, rgba(99, 102, 241, 0.08), transparent 60%),
    radial-gradient(900px 600px at 108% 50%, rgba(139, 92, 246, 0.07), transparent 60%),
    radial-gradient(750px 500px at 50% -10%, rgba(16, 185, 129, 0.05), transparent 60%);
}

[data-theme="dark"] .login-page-body::before {
  background:
    radial-gradient(900px 600px at -8% 50%, rgba(99, 102, 241, 0.14), transparent 60%),
    radial-gradient(900px 600px at 108% 50%, rgba(139, 92, 246, 0.12), transparent 60%),
    radial-gradient(750px 500px at 50% -10%, rgba(16, 185, 129, 0.08), transparent 60%);
}

@media print {
  body, html {
    background: #ffffff !important;
    color: #0b1220 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .app-nav-bar,
  header,
  nav,
  .modal-header,
  .btn,
  button,
  .modal-close,
  .nav-categories,
  .user-pill,
  .tt-banner-actions,
  .tt-filters,
  .tt-controls,
  .dashboard-cards,
  .bento-row,
  .admin-sidebar,
  .tab-nav,
  .tt-nav-actions,
  .structure-sub-nav-wrapper,
  .view-controls-bar,
  .search-box,
  .filter-bar,
  .stat-filters-container,
  .stat-action-bar,
  .stat-kpi-row,
  .debug-panel {
    display: none !important;
  }

  .school-watermark-bg {
    opacity: 0.08 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .modal-overlay {
    position: static !important;
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }
  .modal-box {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }
  .modal-body {
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    background: transparent !important;
  }
  .print-preview-sheet,
  .tt-print-sheet,
  .report-card-sheet,
  .stat-report-sheet,
  .print-target {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    margin: 0 auto 15px auto !important;
    page-break-after: always;
    break-after: page;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  @page {
    size: auto;
    margin: 8mm;
  }
}


/* Interactive Rounded Selector Buttons (Pill / Chip Buttons) */
.rounded-selector-bar {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 0.75rem 0 1rem;
}

.selector-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.selector-pill-btn:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.selector-pill-btn.active {
  background: var(--primary) !important;
  background-color: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px -2px var(--primary-glow) !important;
}

.selector-pill-btn.active span,
.selector-pill-btn.active * {
  color: #ffffff !important;
  fill: #ffffff !important;
}

.selector-pill-btn .pill-count {
  font-size: 0.68rem;
  padding: 0.05rem 0.38rem;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.08);
}

.selector-pill-btn.active .pill-count {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.print-preview-sheet {
  background: #ffffff !important;
  color: #0b1220 !important;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem auto;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
}

.print-preview-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 520px;
  height: 520px;
  max-width: 85%;
  max-height: 85%;
  background-image: var(--school-logo-bg, url('/assets/wbm-logo.webp'));
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.065;
  pointer-events: none;
}


/* -------------------------------------------------------------
   SPLIT PROFILE & PROFILE PIC HEADER BAR
------------------------------------------------------------- */
.user-header-split-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.header-profile-block {
  position: relative;
  display: inline-flex;
}

.btn-split-profile {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.btn-split-profile.interactive:hover {
  border-color: var(--primary);
  background: var(--bg-surface);
  color: var(--primary);
}

.btn-split-profile.static {
  cursor: default;
}

.split-prof-caret {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-left: 0.15rem;
}

.dropdown-split-profile {
  z-index: 2000 !important;
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  min-width: 250px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  padding: 0.45rem;
  z-index: 1002;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.split-dropdown-header {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  padding: 0.4rem 0.65rem 0.3rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0.25rem;
}

.split-dropdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.split-profile-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s ease;
}

.split-profile-option:hover {
  background: var(--bg-surface);
  color: var(--primary);
}

.split-profile-option.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
}

.split-profile-option .option-badge {
  margin-left: auto;
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.split-dropdown-footer {
  border-top: 1px solid var(--border-light);
  margin-top: 0.3rem;
  padding-top: 0.3rem;
}

.btn-switch-another-user {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* Profile Pic / Avatar on Right */
.header-avatar-block {
  position: relative;
  display: inline-flex;
}

.btn-split-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  background: var(--primary-gradient);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease;
  padding: 0;
  overflow: hidden;
}

.btn-split-avatar:hover {
  transform: scale(1.05);
  border-color: var(--primary);
}

.split-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dropdown-split-avatar {
  z-index: 2000 !important;
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  min-width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  padding: 0.5rem;
  z-index: 1002;
  display: flex;
  flex-direction: column;
}

.avatar-dropdown-user-header {
  padding: 0.6rem 0.8rem;
}

.avatar-user-name {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.25;
}

.avatar-user-role {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 700;
  margin-top: 0.15rem;
}

.avatar-user-id {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.avatar-dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 0.35rem 0;
}

.avatar-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  width: 100%;
  transition: background 0.15s ease;
}

.avatar-menu-item:hover {
  background: var(--bg-surface);
  color: var(--primary);
}

.avatar-menu-item.item-logout {
  color: #dc2626;
}

.avatar-menu-item.item-logout:hover {
  background: #fee2e2;
  color: #b91c1c;
}



/* -------------------------------------------------------------
   TRANSPARENT PAGE-CENTERED LOADING ICON ONLY
------------------------------------------------------------- */
.global-page-loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  pointer-events: none;
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.global-page-loader.active {
  opacity: 1;
  visibility: visible;
}

.global-spinner-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 4px solid rgba(14, 165, 233, 0.15);
  border-top-color: var(--primary, #0284c7);
  border-right-color: var(--primary, #0284c7);
  animation: global-spinner-spin 0.7s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
  background: transparent !important;
  box-shadow: none !important;
}

@keyframes global-spinner-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* -------------------------------------------------------------
   THEME TOGGLE BUTTON (Icon Only, No Text)
------------------------------------------------------------- */
.theme-toggle-btn {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  width: 42px;
  height: 42px;
  padding: 0 !important;
  border-radius: 50% !important;
  background: var(--bg-glass);
  color: var(--text-main);
  border: 1.5px solid var(--border-light);
  box-shadow: var(--shadow-md);
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* -------------------------------------------------------------
   UNIVERSAL FOOTER (Far right contact alignment)
------------------------------------------------------------- */
.gateway-footer {
  margin-top: auto;
  padding: 1.75rem 1.5rem 5.5rem;
  border-top: 1px solid var(--border-light);
  width: 100%;
}

.footer-inner {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}

.footer-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto !important;
}

.footer-teclyq-logo {
  height: 20px;
  width: auto;
  max-width: 24px;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 3px;
  display: inline-block;
}

.footer-contact a {
  color: var(--primary);
  font-weight: 550;
  text-decoration: none;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

.footer-contact a:hover {
  text-decoration: underline;
  color: var(--primary-hover, var(--primary));
}



/* -------------------------------------------------------------
   TIMETABLE BREAK ROW - LONG CARD ACROSS DAYS (SCRIPT FONT)
------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Dancing+Script:wght@600;700&display=swap');

.tt-break-row {
  height: 52px !important;
}

.tt-break-row td {
  height: 52px !important;
  vertical-align: middle !important;
}

.tt-break-cell {
  padding: 4px 8px !important;
  background: transparent !important;
  border-left: 1px solid var(--border-light) !important;
}

.tt-break-card {
  width: 100%;
  height: 44px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.03) 0%, rgba(2, 132, 199, 0.12) 50%, rgba(2, 132, 199, 0.03) 100%) !important;
  border: 1.5px dashed var(--border-strong, #cbd5e1) !important;
  border-radius: var(--radius-sm, 8px) !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
  padding: 0 1.25rem;
  overflow: hidden;
}

.tt-break-line {
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(2, 132, 199, 0.35), transparent);
  margin: 0 1.5rem;
  min-width: 20px;
}

.tt-break-text {
  font-family: 'Caveat', 'Dancing Script', 'Brush Script MT', 'Segoe Script', 'Lucida Handwriting', cursive !important;
  font-size: 1.85rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.65rem !important;
  text-transform: capitalize;
  color: var(--primary, #0284c7) !important;
  text-align: center !important;
  white-space: nowrap;
  user-select: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  padding: 0 0.75rem;
}

[data-theme="dark"] .tt-break-card {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.04) 0%, rgba(56, 189, 248, 0.14) 50%, rgba(56, 189, 248, 0.04) 100%) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}

[data-theme="dark"] .tt-break-text {
  color: #38bdf8 !important;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

[data-theme="dark"] .tt-break-line {
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.4), transparent);
}



/* -------------------------------------------------------------
   DYNAMIC FLOATING BUTTON OFFSETS (Keeps buttons just above footer)
------------------------------------------------------------- */
:root {
  --floating-bottom-offset: 1.25rem;
  --floating-secondary-offset: 4.6rem;
}

.theme-toggle-btn,
.debug-dock-btn {
  bottom: var(--floating-bottom-offset, 1.25rem) !important;
}

.ai-faq-btn {
  bottom: var(--floating-bottom-offset, 1.25rem) !important;
}

.back-to-top-btn {
  bottom: var(--floating-secondary-offset, 4.6rem) !important;
}

.sc-assistant {
  bottom: var(--floating-secondary-offset, 4.6rem) !important;
}

.debug-drawer {
  bottom: var(--floating-secondary-offset, 4.6rem) !important;
}

.gateway-footer {
  margin-top: auto;
  padding: 0.95rem 1.5rem !important;
  border-top: 1px solid var(--border-light);
  width: 100%;
  position: relative;
  z-index: 10;
  background: var(--bg-surface, var(--bg-card, #ffffff));
}



/* -------------------------------------------------------------
   FLOATING BUTTON FOOTER AVOIDANCE
------------------------------------------------------------- */
.theme-toggle-btn,
.debug-dock-btn,
.debug-floating-pill,
.ai-faq-btn {
  bottom: var(--floating-bottom-offset, 20px) !important;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.back-to-top-btn,
.sc-assistant,
.debug-drawer,
.debug-console-drawer {
  bottom: var(--floating-secondary-offset, 68px) !important;
  transition: transform 0.15s ease, opacity 0.15s ease;
}


/* HARDENED HEADER PROFILE DISPLAY RULES */
.user-header-split-bar {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.user-header-split-bar.guest-split-bar {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.65rem !important;
}

.header-profile-block,
.header-avatar-block {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  visibility: visible !important;
}

.btn-split-profile {
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.btn-split-avatar {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.nav-right {
  display: flex !important;
  align-items: center !important;
  gap: 0.65rem !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
  visibility: visible !important;
}

.nav-profile-account {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  visibility: visible !important;
}

.dropdown-split-profile,
.dropdown-split-avatar {
  z-index: 99999 !important;
}

.user-pill-tag {
  display: none !important;
}


/* CENTER MENU ITEMS IN HEADER (Between Page Title and Profile) */
.app-nav-bar {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  gap: 1rem !important;
}

.nav-left {
  flex: 1 1 0% !important;
  display: flex !important;
  align-items: center !important;
  min-width: max-content !important;
  flex-shrink: 0 !important;
}

.nav-categories {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  margin: 0 auto !important;
  flex: 0 0 auto !important;
  text-align: center !important;
  overflow: visible !important;
}

.nav-right {
  flex: 1 1 0% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0.65rem !important;
  margin-left: auto !important;
  min-width: max-content !important;
  flex-shrink: 0 !important;
}


/* ==============================================================
   SKOOLMS BRAND LOGO & ANIMATED 3-NODE CONNECTED HUB LOADER
   ============================================================== */
.skoolms-brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  overflow: visible !important;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s ease;
}
.skoolms-brand-logo:hover {
  transform: scale(1.05);
}

/* Tentacles and Center Hub geometry anchors */
.skoolms-animated-logo .skoolms-tentacle,
.skoolms-animated-logo .skoolms-hub {
  transform-origin: 246px 242px;
  transform-box: view-box;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.skoolms-animated-logo .skoolms-hub {
  filter: drop-shadow(0 2px 8px rgba(36, 44, 126, 0.4));
}
.skoolms-animated-logo .skoolms-tentacle-blue {
  filter: drop-shadow(0 0 4px rgba(59, 76, 184, 0.35));
}
.skoolms-animated-logo .skoolms-tentacle-green {
  filter: drop-shadow(0 0 4px rgba(56, 161, 105, 0.35));
}
.skoolms-animated-logo .skoolms-tentacle-orange {
  filter: drop-shadow(0 0 4px rgba(255, 122, 24, 0.35));
}

/* 1. Tentacle 1 (Blue): Contracts and restores first */
@keyframes skoolms-tentacle-blue-contract {
  0% { transform: scale(1); }
  3% { transform: scale(1); }
  16% { transform: scale(0.52); }
  28% { transform: scale(1.05); }
  36% { transform: scale(1); }
  100% { transform: scale(1); }
}

/* 2. Tentacle 2 (Green): Contracts and restores second */
@keyframes skoolms-tentacle-green-contract {
  0% { transform: scale(1); }
  22% { transform: scale(1); }
  36% { transform: scale(0.52); }
  48% { transform: scale(1.05); }
  56% { transform: scale(1); }
  100% { transform: scale(1); }
}

/* 3. Tentacle 3 (Orange): Contracts and restores third */
@keyframes skoolms-tentacle-orange-contract {
  0% { transform: scale(1); }
  42% { transform: scale(1); }
  56% { transform: scale(0.52); }
  68% { transform: scale(1.05); }
  76% { transform: scale(1); }
  100% { transform: scale(1); }
}

/* 4. Central Hub: Expands and contracts in synchrony */
@keyframes skoolms-hub-pulse-fluid {
  0% { transform: scale(1); }
  6% { transform: scale(1.04); }
  16% { transform: scale(1.15); }
  26% { transform: scale(1.03); }
  36% { transform: scale(1.16); }
  46% { transform: scale(1.04); }
  56% { transform: scale(1.16); }
  68% { transform: scale(1.03); }
  80% { transform: scale(0.97); }
  92% { transform: scale(1.01); }
  100% { transform: scale(1); }
}

/* Trigger animations on Hover or via .is-animating class */
.skoolms-animated-logo.is-animating .skoolms-tentacle-blue,
.skoolms-animated-logo:hover .skoolms-tentacle-blue,
.brand-logo-home-link:hover .skoolms-animated-logo .skoolms-tentacle-blue,
.brand-shield:hover .skoolms-animated-logo .skoolms-tentacle-blue {
  animation: skoolms-tentacle-blue-contract 1.85s cubic-bezier(0.34, 1.25, 0.64, 1) 1;
}

.skoolms-animated-logo.is-animating .skoolms-tentacle-green,
.skoolms-animated-logo:hover .skoolms-tentacle-green,
.brand-logo-home-link:hover .skoolms-animated-logo .skoolms-tentacle-green,
.brand-shield:hover .skoolms-animated-logo .skoolms-tentacle-green {
  animation: skoolms-tentacle-green-contract 1.85s cubic-bezier(0.34, 1.25, 0.64, 1) 1;
}

.skoolms-animated-logo.is-animating .skoolms-tentacle-orange,
.skoolms-animated-logo:hover .skoolms-tentacle-orange,
.brand-logo-home-link:hover .skoolms-animated-logo .skoolms-tentacle-orange,
.brand-shield:hover .skoolms-animated-logo .skoolms-tentacle-orange {
  animation: skoolms-tentacle-orange-contract 1.85s cubic-bezier(0.34, 1.25, 0.64, 1) 1;
}

.skoolms-animated-logo.is-animating .skoolms-hub,
.skoolms-animated-logo:hover .skoolms-hub,
.brand-logo-home-link:hover .skoolms-animated-logo .skoolms-hub,
.brand-shield:hover .skoolms-animated-logo .skoolms-hub {
  animation: skoolms-hub-pulse-fluid 1.85s cubic-bezier(0.34, 1.25, 0.64, 1) 1;
}
.brand-shield {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 2px !important;
  background: transparent !important;
  box-shadow: none !important;
}
.brand-shield .skoolms-brand-logo {
  width: 38px;
  height: 38px;
}
.login-brand .brand-shield {
  margin-bottom: 0.75rem !important;
}
.login-brand .brand-shield .skoolms-brand-logo {
  width: 72px;
  height: 72px;
}
.app-brand-title .icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.app-brand-title .icon .skoolms-brand-logo {
  width: 34px;
  height: 34px;
}

/* Global Animated Skoolms Page Loader Overlay */
.skoolms-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
[data-theme="dark"] .skoolms-loader-overlay {
  background: rgba(15, 23, 42, 0.9);
}
.skoolms-loader-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.skoolms-loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.75rem 2.25rem;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
  transform: translateY(0);
  transition: transform 0.25s ease;
}
[data-theme="dark"] .skoolms-loader-box {
  background: rgba(30, 41, 59, 0.98);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.skoolms-loader-icon {
  width: 76px;
  height: 76px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.skoolms-loader-icon img,
.skoolms-loader-icon svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.skoolms-loader-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text, #1e293b);
  letter-spacing: 0.01em;
}
.skoolms-inline-spinner {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
}
.skoolms-inline-spinner img,
.skoolms-inline-spinner svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Clickable Brand Logo Home Link (Tapping logo takes us home) */
.brand-logo-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  padding: 3px;
  border-radius: var(--radius-sm, 8px);
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.brand-logo-home-link:hover {
  transform: scale(1.08);
}
.brand-logo-home-link .skoolms-brand-logo {
  width: 36px;
  height: 36px;
  display: block;
}

/* -------------------------------------------------------------
   NARROW SCREENS: one header that wraps, a dock that stays
   in its own strip, and tables that scroll instead of spilling.
------------------------------------------------------------- */
@media (max-width: 900px) {
  .app-nav-bar {
    height: auto !important;
    min-height: 56px;
    flex-wrap: wrap !important;
    align-items: center !important;
    padding: 0.4rem 0.7rem 0.3rem !important;
    gap: 0.3rem 0.45rem !important;
  }

  .nav-left {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 10.5rem);
  }

  .app-brand-title h2 {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-tagline,
  .app-brand-title p {
    display: none !important;
  }

  .nav-categories {
    order: 3;
    flex: 1 1 100% !important;
    width: 100% !important;
    margin: 0 !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }

  .nav-dropdown-btn,
  .nav-categories .nav-dropdown-btn,
  #cat-btn-calendar {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.35rem 0.5rem !important;
    font-size: 0.74rem !important;
  }

  .nav-right {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    max-width: 10.5rem;
  }

  .split-prof-label {
    display: inline-block;
    max-width: 5.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
  }

  .nav-dropdown-menu {
    position: fixed;
    top: 6.75rem;
    left: 0.65rem !important;
    right: 0.65rem !important;
    width: auto;
    min-width: 0;
    max-height: min(60vh, 420px);
    overflow-y: auto;
  }

  .dropdown-split-profile {
    left: auto;
    right: 0;
    max-width: calc(100vw - 1.25rem);
  }

  .dropdown-split-avatar {
    right: 0;
    max-width: calc(100vw - 1.25rem);
  }

  .app-container {
    padding: 1rem 0.85rem 6.5rem;
  }

  .gateway-container {
    padding-bottom: 1rem;
  }

  .panel-card,
  .school-hero-card {
    padding: 1rem;
  }

  .app-launcher-grid {
    grid-template-columns: 1fr;
  }

  .bento-row {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
  }

  .clean-table-box,
  .tt-grid-scroll {
    max-width: 100%;
    overflow-x: auto;
  }

  .clean-table th:last-child,
  .clean-table td:last-child {
    padding-right: 1.1rem !important;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start !important;
  }

  .footer-contact {
    margin-left: 0 !important;
    max-width: 100%;
  }

  .footer-contact a,
  #hud-session-meta,
  #hud-session-name {
    overflow-wrap: anywhere;
  }

  .action-row,
  .hud-strip .panel-header {
    max-width: 100%;
  }

  .rc-toolbar-card,
  .rc-toolbar-card > div {
    min-width: 0 !important;
    max-width: 100%;
  }

  #rc-student-select {
    width: 100%;
    max-width: 100% !important;
    min-width: 0;
  }

  .modal-overlay {
    padding: 0.75rem;
  }

  .modal-box {
    max-width: calc(100vw - 1.5rem);
    max-height: calc(100vh - 1.5rem);
  }

  #delete-modal-actions {
    flex-wrap: wrap !important;
  }

  .debug-dock-btn > span:nth-child(2) {
    display: none;
  }

  .theme-toggle-btn {
    left: 0.75rem !important;
    width: 2.65rem;
    min-width: 2.65rem;
    padding: 0;
    justify-content: center;
  }

  .debug-dock-btn {
    right: auto !important;
    left: 4.15rem !important;
    width: 2.65rem;
    min-width: 2.65rem;
    padding: 0;
    justify-content: center;
    transform: none !important;
  }

  .debug-dock-btn .dbg-badge {
    position: absolute;
    top: -0.35rem;
    right: -0.3rem;
  }

  .ai-faq-btn {
    right: 0.75rem !important;
    left: auto !important;
    height: 38px;
    padding: 0 0.85rem;
    font-size: 0.8rem;
    gap: 0.35rem;
  }

  .back-to-top-btn {
    right: 0.75rem !important;
  }

  .debug-drawer,
  .sc-assistant {
    left: 0.5rem !important;
    right: 0.5rem !important;
    width: auto !important;
    max-width: none !important;
  }

  .dbg-toolbar,
  .dbg-tabs {
    overflow-x: auto;
  }
}

@media (max-width: 520px) {
  .bento-row {
    grid-template-columns: 1fr;
  }

  .split-prof-label {
    max-width: 4.2rem;
  }
}


/* =============================================================
   Curriculum, Subject Grouping & Searchable Comboboxes
   ============================================================= */
.searchable-combobox {
  position: relative;
  width: 100%;
  font-family: inherit;
}
.combobox-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  min-height: 42px;
  background: var(--bg-surface, var(--bg-card));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm, 6px);
  cursor: text;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.combobox-control:focus-within,
.combobox-control.is-open {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.combobox-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.combobox-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(79, 70, 229, 0.2);
}
.combobox-chip-remove {
  cursor: pointer;
  opacity: 0.7;
  font-size: 0.95rem;
  line-height: 1;
}
.combobox-chip-remove:hover {
  opacity: 1;
  color: var(--accent-rose, #ef4444);
}
.combobox-input {
  flex: 1;
  min-width: 90px;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  color: inherit;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.15rem 0;
}
.combobox-arrow {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.75rem;
  pointer-events: none;
  transition: transform 0.2s ease;
}
.combobox-control.is-open .combobox-arrow {
  transform: rotate(180deg);
}
.combobox-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm, 6px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  z-index: 1050;
  max-height: 250px;
  overflow-y: auto;
}
.combobox-group-header {
  padding: 0.4rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-muted);
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-light);
}
.combobox-option {
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s ease;
}
.combobox-option:last-child {
  border-bottom: none;
}
.combobox-option:hover,
.combobox-option.is-focused {
  background: var(--bg-hover);
}
.combobox-option.is-selected {
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 600;
}
.combobox-option-empty {
  padding: 0.85rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* Subject combination panels */
.curriculum-rule-banner {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm, 6px);
  margin-bottom: 1rem;
  font-size: 0.85rem;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  border: 1px solid transparent;
}
.curriculum-rule-banner.valid {
  background: var(--accent-emerald-tint);
  border-color: rgba(5, 150, 105, 0.3);
  color: var(--accent-emerald-text);
}
.curriculum-rule-banner.invalid {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #b91c1c;
}
.curriculum-group-box {
  background: var(--bg-surface, var(--bg-card));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm, 6px);
  padding: 0.85rem;
  margin-bottom: 0.85rem;
}
.curriculum-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}
.curriculum-group-title {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.curriculum-group-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: var(--bg-muted);
  color: var(--text-muted);
}
.curriculum-group-badge.valid {
  background: var(--accent-emerald-tint);
  color: var(--accent-emerald-text);
}
.curriculum-group-badge.warning {
  background: var(--accent-amber-tint);
  color: var(--accent-amber-text);
}
.subject-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.45rem;
}
.subject-chip-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  transition: all 0.12s ease;
}
.subject-chip-item:hover:not(.disabled) {
  border-color: var(--primary);
  background: var(--bg-hover);
}
.subject-chip-item.active {
  background: var(--primary-tint);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.subject-chip-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.subject-chip-item.mandatory {
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.3);
  color: var(--accent-emerald-text);
  font-weight: 600;
  cursor: default;
}


/* --- Table Sorting & Collapsible Groups --- */
.sort-arrows {
  display: inline-block;
  font-size: 0.72rem;
  margin-left: 0.25rem;
  opacity: 0.45;
  transition: opacity 0.15s, color 0.15s;
}
th[onclick]:hover .sort-arrows {
  opacity: 1;
  color: var(--primary);
}
details.curriculum-group-box {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md, 8px);
  background: var(--bg-surface);
  margin-bottom: 0.65rem;
  overflow: hidden;
  transition: border-color 0.15s ease;
}
details.curriculum-group-box summary.curriculum-group-head {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 0.55rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-muted, rgba(0, 0, 0, 0.02));
  outline: none;
}
details.curriculum-group-box summary.curriculum-group-head::-webkit-details-marker {
  display: none;
}
details.curriculum-group-box summary.curriculum-group-head::after {
  content: '▸';
  font-size: 1.4rem;
  line-height: 1;
  font-weight: bold;
  color: var(--text-muted);
  margin-left: 0.65rem;
  transition: transform 0.2s ease;
  display: inline-block;
  user-select: none;
}
details.curriculum-group-box[open] summary.curriculum-group-head::after {
  transform: rotate(90deg);
}
details.curriculum-group-box .subject-chips-grid {
  padding: 0.65rem 0.85rem;
}

/* Departments Table Column Refinements */
#table-depts .col-dept-id,
#table-depts th.col-dept-id,
#table-depts td.col-dept-id {
  width: 85px !important;
  min-width: 75px !important;
  max-width: 95px !important;
  text-align: center !important;
  white-space: nowrap !important;
}
#table-depts .col-dept-classes,
#table-depts th.col-dept-classes,
#table-depts td.col-dept-classes {
  min-width: 280px !important;
}


/* -------------------------------------------------------------
   CARD ZOOM & FOLDING SYSTEM
------------------------------------------------------------- */
:root {
  --card-zoom: 1;
}

.panel-card {
  zoom: var(--card-zoom, 1);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.panel-card.is-folded {
  margin-bottom: 0.85rem !important;
}

.panel-card.is-folded > *:not(.panel-header) {
  display: none !important;
}

.panel-card .panel-fold-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  margin-left: 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  transition: all 0.15s ease;
  user-select: none;
  vertical-align: middle;
}

.panel-card .panel-fold-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.panel-card .panel-fold-btn .fold-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.panel-card.is-folded .panel-fold-btn .fold-arrow {
  transform: rotate(-90deg);
}

/* Vertical Theme Switcher + Card Zoom Dock (Bottom-Left) */



/* -------------------------------------------------------------
   EXAM GUARDIAN & ANTI-TAMPERING STYLES
------------------------------------------------------------- */
.tamper-protected,
.tamper-protected .question-card,
.tamper-protected .question-card h3,
.tamper-protected .question-options,
.tamper-protected .opt-card {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

.tamper-protected input[type="text"],
.tamper-protected textarea {
  -webkit-user-select: text !important;
  user-select: text !important;
}

@keyframes pulseStrike {
  from { transform: scale(1); }
  to { transform: scale(1.12); }
}

@keyframes pulseLock {
  from { transform: scale(1); filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.4)); }
  to { transform: scale(1.08); filter: drop-shadow(0 0 25px rgba(239, 68, 68, 0.8)); }
}

.exam-guard-pill {
  animation: fadeInGuard 0.4s ease-out;
}

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

/* Fullscreen Kiosk Assessment Mode */
#student-exam-area.fullscreen-kiosk-mode {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  z-index: 999999 !important;
  background: var(--bg-main, #f8fafc) !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 1.5rem 2rem !important;
  box-sizing: border-box !important;
}

/* AI Question Generator Studio Styles */
.ai-tab-btn {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-light, #e2e8f0);
  color: var(--text-muted, #64748b);
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  transition: all 0.2s ease;
  cursor: pointer;
}
.ai-tab-btn:hover {
  background: var(--bg-surface, #f1f5f9);
  color: var(--text-main, #0f172a);
  border-color: var(--primary, #4f46e5);
}
.ai-tab-btn.active {
  background: var(--primary, #4f46e5) !important;
  color: #ffffff !important;
  border-color: var(--primary, #4f46e5) !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}
.q-review-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.q-review-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}
.q-review-card:focus-within {
  border-color: var(--primary, #4f46e5) !important;
}

/* =============================================================
   UNIVERSAL MOBILE FILTER BAR & POPUP MODAL ARCHITECTURE
   ============================================================= */
.mobile-filter-wrap,
.st-mobile-filter-wrap {
  display: none;
}
.mobile-filter-btn,
.st-mobile-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border-radius: 9px;
  border: 1.5px solid var(--border-light);
  background: var(--bg-elevated, var(--bg-card, #ffffff));
  color: var(--text-main);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
  position: relative;
}
.mobile-filter-btn:hover,
.st-mobile-filter-btn:hover {
  border-color: var(--primary);
  background: var(--bg-hover, var(--bg-surface));
}
.mobile-filter-btn.active-filter,
.st-mobile-filter-btn.active-filter {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
}
.mobile-filter-btn.active-filter svg,
.st-mobile-filter-btn.active-filter svg {
  stroke: #ffffff;
}
.mobile-filter-clear-link,
.st-mobile-filter-clear-link {
  display: none;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ef4444;
  text-align: center;
  margin-top: 0.25rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
}
.mobile-filter-clear-link:hover,
.st-mobile-filter-clear-link:hover {
  color: #dc2626;
}
.mobile-filter-btn-container,
.st-mobile-filter-btn-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

@media (max-width: 991px) {
  .stat-filters-desktop-row {
    display: none !important;
  }
  .stat-filters-card .mobile-filter-wrap {
    display: flex !important;
  }
  .learners-filters-desktop-row {
    display: none !important;
  }
  .learners-filter-bar .mobile-filter-wrap {
    display: flex !important;
  }
  .scores-filters-desktop-row {
    display: none !important;
  }
  #scores-filter-bar .mobile-filter-wrap {
    display: flex !important;
  }
  .tt-filters-desktop-row {
    display: none !important;
  }
  #tt-toolbar .mobile-filter-wrap {
    display: flex !important;
  }
}

/* =============================================================
   UNIVERSAL SOLID NON-TRANSPARENT CARDS & TABLES ENFORCEMENT
   All cards across all Skoolms pages have solid, 100% opaque backgrounds
   ============================================================= */
.app-container,
.gateway-container,
.login-wrapper,
.login-container,
.st-container,
.rc-page-container,
.landing-container {
  position: relative !important;
  z-index: 1 !important;
}

.card,
.panel-card,
.stat-card,
.bento-card,
.dash-card,
.metric-card,
.module-card,
.app-card,
.clean-table-box,
.table-card,
.modal-box,
.modal-card,
.st-matrix-card,
.st-review-card,
.st-runner-wrap,
.st-compact-runner,
.q-review-card,
.report-card,
.broadsheet-card,
.session-card,
.attendance-card,
.learner-card,
.hud-strip,
.school-hero-card,
.signin-panel,
.tt-grid-card,
.tt-stat-box,
.kpi-stat-box,
.kpi-card,
.pin-banner,
.rc-toolbar-card,
.rc-sheet,
.learners-filter-bar,
.stat-filters-card,
.settings-section,
.structure-sub-nav-wrapper,
.rounded-selector-bar,
.selector-pill-btn:not(.active),
.sc-assistant {
  position: relative !important;
  z-index: 1 !important;
  background-color: var(--bg-card, #ffffff) !important;
  background: var(--bg-card, #ffffff) !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

[data-theme="dark"] .card,
[data-theme="dark"] .panel-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .bento-card,
[data-theme="dark"] .dash-card,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .module-card,
[data-theme="dark"] .app-card,
[data-theme="dark"] .clean-table-box,
[data-theme="dark"] .table-card,
[data-theme="dark"] .modal-box,
[data-theme="dark"] .modal-card,
[data-theme="dark"] .st-matrix-card,
[data-theme="dark"] .st-review-card,
[data-theme="dark"] .st-runner-wrap,
[data-theme="dark"] .st-compact-runner,
[data-theme="dark"] .q-review-card,
[data-theme="dark"] .report-card,
[data-theme="dark"] .broadsheet-card,
[data-theme="dark"] .session-card,
[data-theme="dark"] .attendance-card,
[data-theme="dark"] .learner-card,
[data-theme="dark"] .hud-strip,
[data-theme="dark"] .school-hero-card,
[data-theme="dark"] .signin-panel,
[data-theme="dark"] .tt-grid-card,
[data-theme="dark"] .tt-stat-box,
[data-theme="dark"] .kpi-stat-box,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .pin-banner,
[data-theme="dark"] .rc-toolbar-card,
[data-theme="dark"] .rc-sheet,
[data-theme="dark"] .learners-filter-bar,
[data-theme="dark"] .stat-filters-card,
[data-theme="dark"] .settings-section,
[data-theme="dark"] .structure-sub-nav-wrapper,
[data-theme="dark"] .rounded-selector-bar,
[data-theme="dark"] .selector-pill-btn:not(.active),
[data-theme="dark"] .sc-assistant {
  background-color: var(--bg-card, #0f1524) !important;
  background: var(--bg-card, #0f1524) !important;
}

/* Ensure all tables, their rows, and cells are solid and readable */
.clean-table,
.clean-table thead,
.clean-table tbody,
.clean-table tfoot,
.clean-table tr,
.clean-table td {
  background-color: var(--bg-card, #ffffff) !important;
  background: var(--bg-card, #ffffff) !important;
  color: var(--text-main) !important;
}

.clean-table th {
  background-color: var(--bg-elevated, #ffffff) !important;
  background: var(--bg-elevated, #ffffff) !important;
}

[data-theme="dark"] .clean-table,
[data-theme="dark"] .clean-table thead,
[data-theme="dark"] .clean-table tbody,
[data-theme="dark"] .clean-table tfoot,
[data-theme="dark"] .clean-table tr,
[data-theme="dark"] .clean-table td {
  background-color: var(--bg-card, #0f1524) !important;
  background: var(--bg-card, #0f1524) !important;
  color: var(--text-main) !important;
}

[data-theme="dark"] .clean-table th {
  background-color: var(--bg-elevated, #121a2b) !important;
  background: var(--bg-elevated, #121a2b) !important;
}

/* Universal Mobile Viewport Overflow Protection */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  .app-container,
  .st-container,
  .login-wrapper {
    max-width: 100vw !important;
    box-sizing: border-box !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  .clean-table-box {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}


