/* Hallmark studied-DNA layer - Almanac school operations console */
:root {
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-text: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --color-paper: oklch(96% 0.012 96);
  --color-paper-soft: oklch(92% 0.018 98);
  --color-surface: oklch(99% 0.004 98);
  --color-ink: oklch(21% 0.035 242);
  --color-ink-soft: oklch(36% 0.04 238);
  --color-muted: oklch(52% 0.032 233);
  --color-rule: oklch(76% 0.024 108);
  --color-rule-strong: oklch(24% 0.035 242);
  --color-command: oklch(98% 0.006 98);
  --color-command-line: oklch(73% 0.035 112);
  --color-nav-active: oklch(31% 0.08 164);
  --color-accent: oklch(47% 0.11 164);
  --color-accent-strong: oklch(36% 0.1 164);
  --color-accent-soft: oklch(92% 0.045 158);
  --color-violet: oklch(48% 0.11 294);
  --color-violet-soft: oklch(92% 0.035 294);
  --color-warn: oklch(64% 0.14 72);
  --color-warn-soft: oklch(92% 0.055 80);
  --color-danger: oklch(54% 0.16 28);
  --color-danger-soft: oklch(93% 0.045 28);
  --color-success: oklch(48% 0.11 154);
  --color-success-soft: oklch(92% 0.045 154);
  --color-focus: oklch(55% 0.14 162);
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --text-xs: 0.72rem;
  --text-sm: 0.82rem;
  --text-md: 0.94rem;
  --text-lg: 1.12rem;
  --text-xl: 1.42rem;
  --text-display: clamp(1.8rem, 3vw, 3.35rem);
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 999px;
  --rule-hair: 1px solid var(--color-rule);
  --rule-bold: 2px solid var(--color-rule-strong);
  --shadow-soft: 0 1px 0 var(--color-rule);
  --shadow-offset: 8px 8px 0 var(--color-command-line);
  --shadow-panel: 0 10px 28px oklch(24% 0.035 242 / 0.1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 180ms;
  --dur-slow: 260ms;
  --bg-base: var(--color-paper-soft);
  --bg-layer1: var(--color-surface);
  --bg-layer2: var(--color-paper);
  --bg-layer3: var(--color-paper-soft);
  --glass-1: var(--color-surface);
  --glass-2: var(--color-surface);
  --glass-3: var(--color-paper);
  --glass-4: var(--color-paper-soft);
  --glass-5: var(--color-paper-soft);
  --brand-primary: var(--color-accent);
  --brand-secondary: var(--color-violet);
  --brand-tertiary: var(--color-accent-strong);
  --brand-warm: var(--color-warn);
  --brand-danger: var(--color-danger);
  --brand-success: var(--color-success);
  --brand-purple: var(--color-violet);
  --text-1: var(--color-ink);
  --text-2: var(--color-ink-soft);
  --text-3: var(--color-muted);
  --text-4: oklch(64% 0.026 230);
  --border-1: var(--color-rule);
  --border-2: var(--color-rule-strong);
  --border-3: var(--color-accent);
  --border-focus: var(--color-focus);
  --teal-bg: var(--color-accent-soft);
  --indigo-bg: var(--color-violet-soft);
  --cyan-bg: oklch(92% 0.04 205);
  --amber-bg: var(--color-warn-soft);
  --red-bg: var(--color-danger-soft);
  --green-bg: var(--color-success-soft);
  --purple-bg: var(--color-violet-soft);
  --r-xs: var(--radius-xs);
  --r-sm: var(--radius-sm);
  --r-md: var(--radius-md);
  --r-lg: var(--radius-lg);
  --r-xl: var(--radius-lg);
  --r-full: var(--radius-full);
  --shadow-sm: var(--shadow-soft);
  --shadow-md: var(--shadow-panel);
  --shadow-lg: var(--shadow-panel);
  --shadow-xl: var(--shadow-panel);
  --glow-teal: none;
  --glow-indigo: none;
  --glow-red: none;
  --glow-green: none;
  --grad-primary: linear-gradient(0deg, var(--color-accent), var(--color-accent));
  --grad-warm: linear-gradient(0deg, var(--color-warn), var(--color-warn));
  --grad-cool: linear-gradient(0deg, var(--color-violet), var(--color-violet));
  --grad-teal: linear-gradient(0deg, var(--color-accent), var(--color-accent));
  --grad-danger: linear-gradient(0deg, var(--color-danger), var(--color-danger));
  --sidebar-w: 100%;
  --sidebar-collapsed-w: 100%;
  --topbar-h: 0px;
}
*, *::before, *::after {
  box-sizing: border-box; margin: 0; padding: 0;
}
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Ambient background orbs */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 700px 500px at 10% 15%, rgba(0,201,167,0.06), transparent),
    radial-gradient(ellipse 600px 400px at 90% 80%, rgba(99,102,241,0.07), transparent),
    radial-gradient(ellipse 500px 350px at 55% 45%, rgba(6,182,212,0.04), transparent);
  animation: ambientGlow 14s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes ambientGlow {
  from { opacity: 0.7; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.04) translate(6px, -6px); }
  to { opacity: 0.75; transform: scale(0.98) translate(-4px, 4px); }
}

a { color: var(--brand-primary); text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
::selection { background: rgba(0,201,167,0.3); color: #fff; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* ── APP LAYOUT ── */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: rgba(8,13,26,0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border-1);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 22px 18px;
  border-bottom: 1px solid var(--border-1);
  flex-shrink: 0;
}

.logo-icon-wrap {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: var(--grad-teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
  box-shadow: var(--glow-teal);
  overflow: hidden;
}
.logo-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.logo-texts {
  display: flex; flex-direction: column;
  overflow: hidden; white-space: nowrap;
}

.logo-texts .app-name {
  font-size: 0.95rem; font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-texts .app-tagline {
  font-size: 0.65rem; color: var(--text-3);
  font-weight: 500; letter-spacing: 0.3px;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto; overflow-x: hidden;
  padding: 14px 10px;
}

.nav-section-label {
  font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--text-4);
  padding: 14px 12px 6px;
  white-space: nowrap;
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--text-3);
  font-size: 0.82rem; font-weight: 500;
  cursor: pointer;
  position: relative;
  margin-bottom: 2px;
  overflow: hidden;
  white-space: nowrap;
  transition: all var(--dur-base) var(--ease-out);
}

.nav-item::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px; height: 18px;
  background: var(--grad-teal);
  border-radius: 0 3px 3px 0;
  transition: transform var(--dur-base) var(--ease-spring);
}

.nav-item:hover {
  color: var(--text-1);
  background: var(--glass-2);
}

.nav-item.active {
  color: var(--text-1);
  background: var(--teal-bg);
}

.nav-item.active::before {
  transform: translateY(-50%) scaleY(1);
}

.nav-icon-box {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: var(--glass-2);
  font-size: 0.95rem; flex-shrink: 0;
  transition: background var(--dur-base) var(--ease-in-out);
}

.nav-item.active .nav-icon-box {
  background: rgba(0,201,167,0.15);
}

.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.nav-badge {
  font-size: 0.6rem; font-weight: 700;
  padding: 2px 7px; border-radius: var(--r-full);
  background: var(--brand-danger); color: #fff;
  flex-shrink: 0;
}

.nav-divider {
  height: 1px; background: var(--border-1);
  margin: 10px 12px;
}

.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid var(--border-1);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-in-out);
}

.sidebar-user:hover { background: var(--glass-2); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: var(--grad-teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.user-info { overflow: hidden; white-space: nowrap; flex: 1; }
.user-name { font-size: 0.78rem; font-weight: 600; color: var(--text-1); }
.user-role { font-size: 0.65rem; color: var(--text-3); }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  z-index: 99; opacity: 0;
  transition: opacity var(--dur-base) var(--ease-in-out);
}
.sidebar-overlay.active { display: block; opacity: 1; }

/* ── MOBILE HEADER ── */
.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: rgba(8,13,26,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-1);
  z-index: 90;
  align-items: center; justify-content: space-between;
  padding: 0 16px;
}

.hamburger-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  font-size: 1.2rem;
  transition: background var(--dur-fast) var(--ease-in-out);
}
.hamburger-btn:hover { background: var(--glass-3); }

.mobile-logo-text {
  font-size: 0.95rem; font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── MAIN CONTENT ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 32px 36px;
  min-height: 100vh;
  transition: margin-left var(--dur-slow) var(--ease-out);
}

/* ── PAGE SYSTEM ── */
.page { display: none; animation: pageIn var(--dur-slow) var(--ease-out); }
.page.active { display: block; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  margin-bottom: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-1);
}

.page-header-left { min-width: 0; }

.page-title {
  font-size: 1.7rem; font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
  line-height: 1.2;
  display: flex; align-items: center; gap: 10px;
}

.page-title .title-icon {
  background: var(--glass-3);
  border-radius: var(--r-sm);
  padding: 6px; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  -webkit-text-fill-color: initial;
  background: var(--glass-3);
}

.page-subtitle {
  font-size: 0.82rem; color: var(--text-3);
  margin-top: 5px; font-weight: 400;
}

.page-actions {
  display: flex; align-items: center;
  gap: 8px; flex-wrap: wrap;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 9px 18px;
  font-size: 0.8rem; font-weight: 600;
  border-radius: var(--r-md);
  border: 1px solid var(--border-2);
  background: var(--glass-3);
  color: var(--text-1);
  cursor: pointer; white-space: nowrap;
  transition: all var(--dur-base) var(--ease-out);
  position: relative; overflow: hidden;
}
.btn:hover {
  background: var(--glass-4); border-color: var(--border-3);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: var(--grad-teal); border: none;
  color: #04050e; font-weight: 700;
  box-shadow: var(--glow-teal);
}
.btn-primary:hover {
  box-shadow: 0 0 32px rgba(0,201,167,0.5), 0 0 64px rgba(0,201,167,0.18);
  transform: translateY(-2px);
}

.btn-secondary { background: var(--glass-2); backdrop-filter: blur(8px); }
.btn-secondary:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

.btn-danger {
  background: var(--red-bg); border-color: rgba(244,63,94,0.3);
  color: var(--brand-danger);
}
.btn-danger:hover { background: rgba(244,63,94,0.2); box-shadow: var(--glow-red); }

.btn-success {
  background: var(--green-bg); border-color: rgba(16,185,129,0.3);
  color: var(--brand-success);
}
.btn-success:hover { background: rgba(16,185,129,0.2); box-shadow: var(--glow-green); }

.btn-indigo {
  background: var(--indigo-bg); border-color: rgba(99,102,241,0.3);
  color: var(--brand-secondary);
}
.btn-indigo:hover { background: rgba(99,102,241,0.2); box-shadow: var(--glow-indigo); }

.btn-sm { padding: 6px 13px; font-size: 0.74rem; border-radius: var(--r-sm); }
.btn-xs { padding: 4px 10px; font-size: 0.68rem; border-radius: var(--r-xs); }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: var(--r-sm); }

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--glass-2);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 0;
  position: relative; overflow: hidden;
  transition: all var(--dur-base) var(--ease-out);
  cursor: default;
}

.stat-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px; border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.stat-card:nth-child(1)::after { background: var(--grad-teal); }
.stat-card:nth-child(2)::after { background: var(--grad-cool); }
.stat-card:nth-child(3)::after { background: var(--grad-warm); }
.stat-card:nth-child(4)::after { background: linear-gradient(135deg, #06b6d4, #a855f7); }
.stat-card:nth-child(5)::after { background: var(--grad-danger); }
.stat-card:nth-child(6)::after { background: linear-gradient(135deg, #10b981, #00c9a7); }

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-2);
}

.stat-card-inner {
  padding: 20px 18px 16px;
  display: flex; gap: 14px; align-items: flex-start;
}

.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex-shrink: 0;
}
.stat-card:nth-child(1) .stat-icon { background: var(--teal-bg); }
.stat-card:nth-child(2) .stat-icon { background: var(--indigo-bg); }
.stat-card:nth-child(3) .stat-icon { background: var(--amber-bg); }
.stat-card:nth-child(4) .stat-icon { background: var(--cyan-bg); }
.stat-card:nth-child(5) .stat-icon { background: var(--red-bg); }
.stat-card:nth-child(6) .stat-icon { background: var(--green-bg); }

.stat-info { flex: 1; min-width: 0; }

.stat-value {
  font-size: 1.75rem; font-weight: 800;
  color: var(--text-1); line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.74rem; color: var(--text-3);
  font-weight: 500; margin-top: 5px;
}

/* ── GLASS CARDS ── */
.glass-card {
  background: var(--glass-2);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color var(--dur-base) var(--ease-in-out),
              box-shadow var(--dur-base) var(--ease-in-out);
}
.glass-card:hover { border-color: var(--border-2); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-1);
}
.card-header h3 {
  font-size: 0.9rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 18px 20px; }

/* ── DATA TABLE ── */
.table-wrapper {
  background: var(--glass-2);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.table-top-bar {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-1);
  flex-wrap: wrap; gap: 10px;
}

.search-input-wrap {
  position: relative;
}
.search-input-wrap .search-icon {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3); font-size: 0.85rem;
  pointer-events: none;
}
.search-input-wrap input {
  padding: 7px 12px 7px 32px;
  background: var(--bg-layer2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-sm);
  color: var(--text-1);
  width: 220px;
  transition: all var(--dur-base) var(--ease-in-out);
}
.search-input-wrap input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0,201,167,0.18);
  width: 260px;
}
.search-input-wrap input::placeholder { color: var(--text-4); }

.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  padding: 10px 18px;
  text-align: left;
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--text-3);
  background: var(--glass-1);
  border-bottom: 1px solid var(--border-1);
  white-space: nowrap;
}
.data-table tbody tr {
  border-bottom: 1px solid var(--border-1);
  transition: background var(--dur-fast) var(--ease-in-out);
}
.data-table tbody tr:nth-child(even) { background: var(--glass-1); }
.data-table tbody tr:hover { background: var(--glass-3); }
.data-table tbody td {
  padding: 11px 18px;
  font-size: 0.81rem;
  vertical-align: middle;
}
.data-table tbody tr:last-child { border-bottom: none; }

.table-footer {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border-1);
  font-size: 0.74rem; color: var(--text-3);
}

/* ── BADGE ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  font-size: 0.66rem; font-weight: 700;
  border-radius: var(--r-full); gap: 4px;
}
.badge-teal { background: var(--teal-bg); color: var(--brand-primary); }
.badge-indigo { background: var(--indigo-bg); color: var(--brand-secondary); }
.badge-amber { background: var(--amber-bg); color: var(--brand-warm); }
.badge-red { background: var(--red-bg); color: var(--brand-danger); }
.badge-green { background: var(--green-bg); color: var(--brand-success); }
.badge-cyan { background: var(--cyan-bg); color: var(--brand-tertiary); }
.badge-purple { background: var(--purple-bg); color: var(--brand-purple); }

.color-dot {
  width: 10px; height: 10px;
  border-radius: var(--r-full);
  display: inline-block;
  margin-right: 7px; vertical-align: middle;
  box-shadow: 0 0 5px currentColor;
}

/* ── TABLE ACTIONS ── */
.tbl-actions { display: flex; align-items: center; gap: 5px; }
.tbl-actions .btn-icon {
  width: 28px; height: 28px;
  border-radius: var(--r-xs);
  font-size: 0.78rem; opacity: 0.5;
  transition: all var(--dur-fast) var(--ease-in-out);
}
.data-table tbody tr:hover .tbl-actions .btn-icon { opacity: 1; }
.tbl-actions .btn-icon:hover { background: var(--glass-4); opacity: 1; }
.tbl-actions .btn-icon.delete:hover { background: var(--red-bg); color: var(--brand-danger); }
.tbl-actions .btn-icon.edit:hover { background: var(--teal-bg); color: var(--brand-primary); }

/* ── EMPTY STATE ── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 24px; text-align: center;
}
.empty-icon { font-size: 3.2rem; opacity: 0.2; margin-bottom: 14px; }
.empty-title { font-size: 1rem; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.empty-sub { font-size: 0.8rem; color: var(--text-3); max-width: 300px; }
.empty-state .btn { margin-top: 18px; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-base) var(--ease-in-out),
              visibility var(--dur-base) var(--ease-in-out);
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-layer1);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  width: 100%; max-width: 560px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: translateY(28px) scale(0.95);
  transition: transform var(--dur-slow) var(--ease-spring);
  overflow: hidden;
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 720px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-1);
  flex-shrink: 0;
  background: var(--glass-1);
}
.modal-header h2 {
  font-size: 1.05rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}

.modal-close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  font-size: 1rem; color: var(--text-3);
  transition: all var(--dur-fast) var(--ease-in-out);
}
.modal-close:hover { background: var(--glass-4); color: var(--text-1); }

.modal-body { padding: 22px; overflow-y: auto; flex: 1; }

.modal-footer {
  display: flex; align-items: center;
  justify-content: flex-end;
  gap: 10px; padding: 15px 22px;
  border-top: 1px solid var(--border-1);
  flex-shrink: 0;
  background: var(--glass-1);
}

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.75rem; font-weight: 600;
  color: var(--text-2); margin-bottom: 7px;
  letter-spacing: 0.2px;
}
.form-group label .req { color: var(--brand-danger); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 13px;
  background: var(--bg-layer2) !important;
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--text-1) !important;
  font-size: 0.83rem;
  transition: all var(--dur-base) var(--ease-in-out);
}
.form-input:hover, .form-select:hover, .form-textarea:hover {
  border-color: var(--border-3);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0,201,167,0.2);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-4); }
.form-textarea { min-height: 80px; resize: vertical; }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7c93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 11px center !important;
  padding-right: 34px; cursor: pointer;
}
.form-select option { background: var(--bg-layer2); color: var(--text-1); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 0.7rem; color: var(--text-3); margin-top: 5px; }
.form-error { font-size: 0.7rem; color: var(--brand-danger); margin-top: 5px; }

/* ── COLOR PICKER ── */
.color-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.color-option {
  width: 34px; height: 34px;
  border-radius: var(--r-full);
  cursor: pointer;
  border: 3px solid transparent;
  transition: all var(--dur-base) var(--ease-spring);
}
.color-option:hover { transform: scale(1.18); }
.color-option.selected {
  border-color: #fff; transform: scale(1.18);
  box-shadow: 0 0 16px currentColor;
}
.color-option.selected::after {
  content: '✓'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 900;
  color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.color-option { position: relative; }

/* ── CHECKBOX GROUP ── */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 7px; }

.checkbox-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-2);
  background: var(--glass-1);
  cursor: pointer;
  font-size: 0.76rem; font-weight: 500;
  color: var(--text-3);
  transition: all var(--dur-base) var(--ease-out);
  user-select: none;
}
.checkbox-chip:hover { border-color: var(--border-3); background: var(--glass-2); color: var(--text-1); }
.checkbox-chip.checked {
  background: var(--teal-bg);
  border-color: rgba(0,201,167,0.4);
  color: var(--brand-primary);
}
.checkbox-chip input { display: none; }

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px; margin-top: 6px;
}
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 11px;
  background: var(--bg-layer2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 0.82rem; color: var(--text-2);
  transition: all var(--dur-fast) var(--ease-in-out);
}
.checkbox-label:hover { border-color: var(--brand-primary); color: var(--text-1); }
.checkbox-label input[type="checkbox"] { accent-color: var(--brand-primary); }

/* ── AVAIL GRID ── */
.avail-grid { display: flex; flex-direction: column; gap: 8px; }
.avail-row { display: flex; align-items: center; gap: 10px; }
.avail-row strong { width: 65px; font-size: 0.76rem; color: var(--text-2); }
.avail-checks { display: flex; gap: 5px; flex-wrap: wrap; }
.avail-check { position: relative; cursor: pointer; user-select: none; }
.avail-check input { display: none; }
.avail-check span {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  background: var(--red-bg);
  border: 1px solid rgba(244,63,94,0.25);
  color: var(--brand-danger);
  font-size: 0.74rem; font-weight: 700;
  transition: all var(--dur-fast) var(--ease-in-out);
}
.avail-check input:checked + span {
  background: var(--green-bg);
  border-color: rgba(16,185,129,0.35);
  color: var(--brand-success);
  box-shadow: var(--glow-green);
}
.avail-check span:hover { transform: scale(1.1); }

/* ── DASHBOARD GRID ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* Recent / guide items */
.guide-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-1);
}
.guide-item:last-child { border-bottom: none; }
.guide-icon {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; flex-shrink: 0;
}
.guide-text { flex: 1; }
.guide-title { font-size: 0.82rem; font-weight: 600; color: var(--text-1); }
.guide-sub { font-size: 0.72rem; color: var(--text-3); }

/* Conflict card */
.conflict-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-1);
  font-size: 0.78rem;
}
.conflict-item:last-child { border-bottom: none; }
.conflict-dot {
  width: 8px; height: 8px;
  border-radius: var(--r-full);
  background: var(--brand-danger);
  flex-shrink: 0; margin-top: 4px;
}

/* Quick actions */
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* Progress */
.progress-wrap { margin-bottom: 14px; }
.progress-label-row {
  display: flex; justify-content: space-between;
  font-size: 0.75rem; margin-bottom: 6px;
}
.progress-label-row .prog-title { color: var(--text-2); font-weight: 500; }
.progress-label-row .prog-val { color: var(--text-1); font-weight: 700; }

.progress-bar {
  width: 100%; height: 6px;
  background: var(--glass-1);
  border-radius: var(--r-full); overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--grad-teal);
  position: relative;
  transition: width 1s var(--ease-out);
}
.progress-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── SCHEDULE CONTROLS BAR ── */
.schedule-controls-bar {
  display: flex; align-items: center;
  flex-wrap: wrap; gap: 10px;
  padding: 13px 18px;
  background: var(--glass-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  margin-bottom: 20px;
}
.schedule-controls-bar .ctrl-group {
  display: flex; align-items: center; gap: 8px;
}
.schedule-controls-bar .ctrl-sep {
  width: 1px; height: 28px;
  background: var(--border-1);
}

/* ── SCHEDULE LAYOUT ── */
.schedule-layout { display: flex; gap: 18px; align-items: flex-start; }

/* Available lessons panel */
.available-panel {
  width: 250px; flex-shrink: 0;
  position: sticky; top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--glass-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 14px;
}
.available-panel h3 {
  font-size: 0.82rem; font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-1);
}

/* Lesson chip */
.lesson-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px;
  background: var(--glass-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  cursor: grab; user-select: none;
  transition: all var(--dur-base) var(--ease-out);
  margin-bottom: 5px;
}
.lesson-chip:hover {
  background: var(--glass-3);
  border-color: var(--border-2);
  transform: translateX(3px);
}
.lesson-chip:active { cursor: grabbing; }
.lesson-chip .chip-dot {
  width: 7px; height: 7px;
  border-radius: var(--r-full); flex-shrink: 0;
}
.lesson-chip .chip-label {
  font-size: 0.76rem; font-weight: 600; color: var(--text-1);
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lesson-chip .chip-count {
  font-size: 0.62rem; font-weight: 700;
  padding: 2px 7px; border-radius: var(--r-full);
  background: var(--glass-3); color: var(--text-2);
}

/* ── TIMETABLE ── */
.timetable-wrapper { flex: 1; min-width: 0; overflow-x: auto; }

.print-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--glass-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
}
.print-header:empty { display: none !important; }
.print-header-logo,
.print-header-logo-fallback {
  width: 54px; height: 54px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: #fff;
}
.print-header-logo { object-fit: contain; }
.print-header-logo-fallback {
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border-2);
  color: var(--text-4);
  font-size: 0.65rem; font-weight: 800;
  letter-spacing: 0.08em;
}
.print-header-text { min-width: 0; }
.print-header-school {
  font-size: 1rem; font-weight: 800;
  color: var(--text-1);
}
.print-header-title {
  margin-top: 2px;
  font-size: 0.82rem; font-weight: 700;
  color: var(--text-2);
}
.print-header-meta {
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--text-3);
}

.timetable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: fixed;
}

.timetable thead th {
  padding: 10px 6px;
  font-size: 0.72rem; font-weight: 700;
  text-align: center;
  border-radius: var(--r-sm);
}
.timetable .day-header {
  background: var(--glass-3);
  color: var(--text-1);
  text-transform: uppercase; letter-spacing: 0.8px;
  border: 1px solid var(--border-1);
}
.timetable .day-header:nth-child(2) { border-bottom: 2px solid var(--brand-primary); }
.timetable .day-header:nth-child(3) { border-bottom: 2px solid var(--brand-secondary); }
.timetable .day-header:nth-child(4) { border-bottom: 2px solid var(--brand-success); }
.timetable .day-header:nth-child(5) { border-bottom: 2px solid var(--brand-warm); }
.timetable .day-header:nth-child(6) { border-bottom: 2px solid var(--brand-danger); }
.timetable .day-header:nth-child(7) { border-bottom: 2px solid var(--brand-purple); }

.timetable .period-header {
  background: var(--glass-1);
  color: var(--text-3);
  font-size: 0.68rem;
  width: 78px;
  border: 1px solid var(--border-1);
}
.period-header .pnum {
  font-size: 0.85rem; font-weight: 800;
  color: var(--text-2); display: block;
}
.period-header .ptime {
  font-size: 0.58rem; color: var(--text-3);
  display: block; margin-top: 2px;
}

.timetable td {
  vertical-align: top;
  padding: 3px;
  min-height: 76px; height: 76px;
  border-radius: var(--r-sm);
}

.schedule-cell {
  height: 100%; min-height: 70px;
  background: var(--glass-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-sm);
  padding: 3px;
  position: relative;
  transition: all var(--dur-base) var(--ease-in-out);
  cursor: pointer;
}
.schedule-cell:hover {
  background: var(--glass-2);
  border-color: var(--border-2);
}
.schedule-cell.drag-over {
  border-color: var(--brand-primary);
  background: var(--teal-bg);
  box-shadow: inset 0 0 20px rgba(0,201,167,0.08), var(--glow-teal);
}
.schedule-cell.has-conflict {
  border-color: var(--brand-danger);
  animation: conflictPulse 2s ease-in-out infinite;
}
@keyframes conflictPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244,63,94,0); }
  50% { box-shadow: 0 0 14px 2px rgba(244,63,94,0.2); }
}

.empty-cell {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: transparent; font-size: 1.1rem;
  transition: color var(--dur-fast) var(--ease-in-out);
}
.schedule-cell:hover .empty-cell { color: var(--text-4); }

/* Schedule chip (inside cell) */
.schedule-chip {
  background: var(--glass-3);
  border-left: 3px solid var(--brand-primary);
  border-radius: 2px var(--r-xs) var(--r-xs) 2px;
  padding: 5px 7px;
  height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  gap: 2px;
  position: relative;
  transition: all var(--dur-fast) var(--ease-in-out);
  cursor: move;
}
.schedule-chip:hover { background: var(--glass-4); }
.schedule-chip.conflict { border-left-color: var(--brand-danger); }

.schedule-chip .chip-subject {
  font-size: 0.7rem; font-weight: 800;
  color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.schedule-chip .chip-meta {
  font-size: 0.6rem; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.chip-remove {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.55rem;
  background: var(--red-bg); color: var(--brand-danger);
  opacity: 0; transition: opacity var(--dur-fast);
}
.schedule-chip:hover .chip-remove { opacity: 1; }
.chip-remove:hover { background: var(--brand-danger); color: #fff; }

/* Break row */
.break-row td { background: rgba(245,158,11,0.05); }
.break-cell {
  font-size: 0.72rem; color: var(--brand-warm);
  font-style: italic; text-align: center;
  padding: 8px;
}

/* Conflict banner */
.conflict-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: rgba(244,63,94,0.07);
  border: 1px solid rgba(244,63,94,0.2);
  border-radius: var(--r-md);
  margin-bottom: 18px;
  font-size: 0.8rem; color: var(--brand-danger);
  font-weight: 500;
  animation: bannerIn var(--dur-slow) var(--ease-out);
}
@keyframes bannerIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── SETTINGS ── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.settings-card {
  background: var(--glass-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.settings-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-1);
  background: var(--glass-1);
}
.settings-card-header h3 {
  font-size: 0.88rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.settings-card-body { padding: 20px; }
.settings-card-desc { font-size: 0.78rem; color: var(--text-3); margin-bottom: 16px; }

/* Period config table */
.period-table { width: 100%; border-collapse: collapse; }
.period-table thead th {
  padding: 8px 14px;
  text-align: left;
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border-1);
}
.period-table tbody tr { border-bottom: 1px solid var(--border-1); }
.period-table tbody tr:last-child { border-bottom: none; }
.period-table tbody td { padding: 7px 14px; vertical-align: middle; }
.period-input {
  width: 100%; max-width: 110px;
  padding: 5px 9px;
  background: var(--bg-layer2) !important;
  border: 1px solid var(--border-1);
  border-radius: var(--r-xs);
  color: var(--text-1) !important;
  font-size: 0.78rem;
  transition: border-color var(--dur-fast);
}
.period-input:focus {
  outline: none; border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(0,201,167,0.15);
}

/* ── REPORTS ── */
.tab-bar {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border-1);
  margin-bottom: 22px;
  overflow-x: auto;
}
.tab-item {
  padding: 11px 18px;
  font-size: 0.8rem; font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all var(--dur-base) var(--ease-out);
}
.tab-item:hover { color: var(--text-2); background: var(--glass-1); }
.tab-item.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  font-weight: 600;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.report-card {
  background: var(--glass-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 18px;
  transition: all var(--dur-base) var(--ease-out);
}
.report-card:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.report-card h4 {
  font-size: 0.82rem; font-weight: 700;
  color: var(--text-2); margin-bottom: 14px;
  display: flex; align-items: center; gap: 7px;
}

.overview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.ov-card {
  background: var(--glass-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 14px 12px; text-align: center;
  transition: all var(--dur-base) var(--ease-out);
}
.ov-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.ov-card h3 { font-size: 1.5rem; font-weight: 800; color: var(--text-1); }
.ov-card p { font-size: 0.72rem; color: var(--text-3); margin-top: 4px; }
.ov-card.success h3 { color: var(--brand-success); }
.ov-card.danger h3 { color: var(--brand-danger); }

.report-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.8rem;
}
.report-table thead th {
  padding: 9px 14px; text-align: left;
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border-1);
}
.report-table tbody tr {
  border-bottom: 1px solid var(--border-1);
  transition: background var(--dur-fast);
}
.report-table tbody tr:hover { background: var(--glass-2); }
.report-table tbody tr:last-child { border-bottom: none; }
.report-table tbody td { padding: 9px 14px; }
.report-table tbody tr.row-warning td:first-child { color: var(--brand-danger); font-weight: 700; }

.mini-bar-wrap {
  width: 90px; height: 12px;
  background: var(--glass-1); border-radius: var(--r-full); overflow: hidden;
  display: inline-block; vertical-align: middle;
}
.mini-bar-fill {
  height: 100%; border-radius: var(--r-full);
  transition: width 0.8s var(--ease-out);
}

/* ── SUBSTITUTION ── */
.sub-card {
  background: var(--glass-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: all var(--dur-base) var(--ease-out);
}
.sub-card:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); }

.sub-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.sub-date { font-size: 0.76rem; color: var(--text-3); }
.sub-body { font-size: 0.8rem; }
.sub-body p { margin-bottom: 4px; }
.sub-body strong { color: var(--text-2); }
.sub-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.sub-message-box {
  width: 100%;
  min-height: 168px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  background: rgba(0,0,0,0.16);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 0.78rem;
  line-height: 1.55;
  resize: vertical;
}
.sub-message-box:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0,201,167,0.12);
}
.sub-message-hint {
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--text-3);
}
.sub-share-note {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-3);
}
.sub-slot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.sub-slot-card {
  padding: 12px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  background: var(--glass-1);
}
.sub-slot-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.78rem;
  color: var(--text-2);
}
.sub-rank-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.sub-rank-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-sm);
  background: var(--bg-layer2);
  font-size: 0.75rem;
}
.sub-rank-item.unavailable {
  opacity: 0.58;
}
.sub-rank-no {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  background: var(--teal-bg);
  color: var(--brand-primary);
  font-weight: 800;
  font-size: 0.68rem;
}
.sub-rank-name {
  font-weight: 700;
  color: var(--text-1);
}
.sub-rank-reason {
  color: var(--text-3);
  margin-top: 2px;
}
.sub-rank-score {
  color: var(--text-3);
  white-space: nowrap;
}

.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  font-size: 0.68rem; font-weight: 700;
  border-radius: var(--r-full);
}
.status-badge::before {
  content: ''; width: 6px; height: 6px;
  border-radius: var(--r-full); background: currentColor;
}
.status-pending { background: var(--amber-bg); color: var(--brand-warm); }
.status-confirmed { background: var(--green-bg); color: var(--brand-success); }
.status-cancelled { background: var(--red-bg); color: var(--brand-danger); text-decoration: line-through; }

/* ── TOAST ── */
.toast-container {
  position: fixed; bottom: 22px; right: 22px;
  z-index: 2000;
  display: flex; flex-direction: column-reverse;
  gap: 8px; pointer-events: none;
}

.toast {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 15px;
  min-width: 300px; max-width: 400px;
  background: var(--bg-layer1);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xl);
  pointer-events: all;
  position: relative; overflow: hidden;
  animation: toastIn var(--dur-slow) var(--ease-spring);
}
.toast.removing { animation: toastOut var(--dur-base) var(--ease-in-out) forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(80px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(80px); }
}

.toast::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 3px; height: 100%;
}
.toast-success::before { background: var(--brand-success); }
.toast-error::before { background: var(--brand-danger); }
.toast-info::before { background: var(--brand-tertiary); }
.toast-warning::before { background: var(--brand-warm); }

.toast-icon {
  font-size: 1rem; flex-shrink: 0; margin-top: 1px;
}
.toast-success .toast-icon { color: var(--brand-success); }
.toast-error .toast-icon { color: var(--brand-danger); }
.toast-info .toast-icon { color: var(--brand-tertiary); }
.toast-warning .toast-icon { color: var(--brand-warm); }

.toast-content { flex: 1; min-width: 0; }
.toast-title { font-size: 0.8rem; font-weight: 700; color: var(--text-1); margin-bottom: 2px; }
.toast-message { font-size: 0.72rem; color: var(--text-2); line-height: 1.5; }
.toast-actions { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.toast-action {
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: var(--bg-layer2);
  color: var(--text-1);
  font-size: 0.68rem;
  font-weight: 800;
}
.toast-action:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

.toast-progress {
  position: absolute; bottom: 0; left: 0;
  height: 2px; opacity: 0.4;
  animation: toastProg 3.5s linear forwards;
}
.toast-success .toast-progress { background: var(--brand-success); }
.toast-error .toast-progress { background: var(--brand-danger); }
.toast-info .toast-progress { background: var(--brand-tertiary); }
.toast-warning .toast-progress { background: var(--brand-warm); }
@keyframes toastProg { from { width: 100%; } to { width: 0%; } }

/* ── PRINT ── */
@media print {
  *, *::before, *::after {
    background: transparent !important; color: #000 !important;
    box-shadow: none !important; backdrop-filter: none !important;
  }
  body { background: #fff !important; font-size: 10pt; }
  body::before { display: none !important; }
  .sidebar, .mobile-header, .schedule-controls-bar, .available-panel,
  .page-actions, .tbl-actions, .chip-remove, .toast-container,
  .tab-bar, .modal-overlay, .btn, .conflict-banner { display: none !important; }
  .main-content { margin-left: 0 !important; padding: 0 !important; }
  .page { display: block !important; }
  .timetable { border-spacing: 2px !important; }
  .timetable th, .timetable td { border: 1px solid #ccc !important; }
  .print-header {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 16px;
    padding: 0 !important;
    border: 0 !important;
  }
  .print-header-logo, .print-header-logo-fallback { width: 58px; height: 58px; margin-bottom: 4px; }
  @page { margin: 1.5cm; }
}

/* ── FOCUS ── */
:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* ── UTILITY ── */
.gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-muted { color: var(--text-3) !important; }
.text-danger { color: var(--brand-danger) !important; }
.text-success { color: var(--brand-success) !important; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── SKELETON ── */
.skeleton {
  background: linear-gradient(90deg, var(--glass-1) 25%, var(--glass-2) 50%, var(--glass-1) 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes skelShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── TOOLTIP ── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 7px);
  left: 50%; transform: translateX(-50%) translateY(4px);
  padding: 5px 11px;
  background: var(--bg-layer2); color: var(--text-1);
  font-size: 0.68rem; font-weight: 500;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  opacity: 0; visibility: hidden;
  pointer-events: none;
  transition: all var(--dur-fast) var(--ease-out);
  z-index: 800;
}
[data-tooltip]:hover::after {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ── STAGGER ANIMATION ── */
.stagger > * {
  animation: fadeUp var(--dur-slow) var(--ease-out) both;
}
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 50ms; }
.stagger > *:nth-child(3) { animation-delay: 100ms; }
.stagger > *:nth-child(4) { animation-delay: 150ms; }
.stagger > *:nth-child(5) { animation-delay: 200ms; }
.stagger > *:nth-child(6) { animation-delay: 250ms; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── LIGHT MODE ── */
body.light-mode {
  --bg-base: #f0f4f8;
  --bg-layer1: #ffffff;
  --bg-layer2: #f7fafc;
  --bg-layer3: #eef2f7;
  --glass-1: rgba(0,0,0,0.02);
  --glass-2: rgba(0,0,0,0.04);
  --glass-3: rgba(0,0,0,0.07);
  --glass-4: rgba(0,0,0,0.10);
  --glass-5: rgba(0,0,0,0.13);
  --text-1: #0f172a;
  --text-2: #334155;
  --text-3: #64748b;
  --text-4: #94a3b8;
  --border-1: rgba(0,0,0,0.07);
  --border-2: rgba(0,0,0,0.11);
  --border-3: rgba(0,0,0,0.17);
  --teal-bg: rgba(0,201,167,0.12);
  --indigo-bg: rgba(99,102,241,0.1);
  --cyan-bg: rgba(6,182,212,0.1);
  --amber-bg: rgba(245,158,11,0.1);
  --red-bg: rgba(244,63,94,0.1);
  --green-bg: rgba(16,185,129,0.1);
  --purple-bg: rgba(168,85,247,0.1);
}
body.light-mode::before {
  background:
    radial-gradient(ellipse 700px 500px at 10% 15%, rgba(0,201,167,0.08), transparent),
    radial-gradient(ellipse 600px 400px at 90% 80%, rgba(99,102,241,0.07), transparent),
    radial-gradient(ellipse 500px 350px at 55% 45%, rgba(6,182,212,0.05), transparent);
}
body.light-mode .sidebar {
  background: rgba(255,255,255,0.85);
  border-right: 1px solid var(--border-1);
}
body.light-mode .mobile-header {
  background: rgba(255,255,255,0.9);
}

/* ── NOTIFICATION CENTER ── */
.notif-bell {
  position: relative; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); cursor: pointer; font-size: 1rem;
  transition: background var(--dur-fast); flex-shrink: 0;
}
.notif-bell:hover { background: var(--glass-3); }
.notif-dot {
  position: absolute; top: 5px; right: 5px;
  width: 8px; height: 8px; border-radius: var(--r-full);
  background: var(--brand-danger);
  border: 2px solid var(--bg-base);
  animation: notifPulse 2s infinite;
}
@keyframes notifPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.35); }
}
.notif-panel {
  position: fixed; top: 12px; right: 12px; width: 340px;
  background: var(--bg-layer1); border: 1px solid var(--border-2);
  border-radius: var(--r-xl); box-shadow: var(--shadow-xl);
  z-index: 900; overflow: hidden;
  transform: translateY(-8px) scale(0.95);
  opacity: 0; visibility: hidden;
  transition: all var(--dur-base) var(--ease-spring);
}
.notif-panel.open { transform: translateY(0) scale(1); opacity: 1; visibility: visible; }
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border-1);
  background: var(--glass-1);
}
.notif-panel-head h3 { font-size: 0.88rem; font-weight: 700; }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 16px; border-bottom: 1px solid var(--border-1);
  cursor: pointer; transition: background var(--dur-fast);
  position: relative;
}
.notif-item:hover { background: var(--glass-2); }
.notif-item.unread::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--brand-primary);
}
.notif-icon {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; flex-shrink: 0;
}
.notif-text { flex: 1; min-width: 0; }
.notif-title { font-size: 0.79rem; font-weight: 600; color: var(--text-1); }
.notif-desc { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; }
.notif-time { font-size: 0.64rem; color: var(--text-4); margin-top: 4px; }

/* ── TOPBAR (right side) ── */
.topbar-right {
  position: fixed; top: 0; right: 0;
  height: 0; display: flex; align-items: center; gap: 8px;
  padding-right: 24px; padding-top: 12px;
  z-index: 200; pointer-events: none;
}
.topbar-right > * { pointer-events: all; }

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.74rem; color: var(--text-3);
  margin-bottom: 16px;
}
.breadcrumb-item { cursor: pointer; transition: color var(--dur-fast); }
.breadcrumb-item:hover { color: var(--brand-primary); }
.breadcrumb-sep { color: var(--text-4); }
.breadcrumb-current { color: var(--text-1); font-weight: 600; cursor: default; }

/* ── KEYBOARD SHORTCUTS PANEL ── */
.kbd-panel {
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-layer1); border: 1px solid var(--border-2);
  border-radius: var(--r-xl); padding: 20px 24px;
  box-shadow: var(--shadow-xl); z-index: 900;
  width: 520px; max-width: 95vw;
  opacity: 0; visibility: hidden;
  transition: all var(--dur-slow) var(--ease-spring);
}
.kbd-panel.open {
  transform: translateX(-50%) translateY(0);
  opacity: 1; visibility: visible;
}
.kbd-panel h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.kbd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kbd-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border-1); font-size: 0.78rem; }
.kbd-row:last-child { border-bottom: none; }
.kbd-label { color: var(--text-2); }
.kbd { display: inline-flex; align-items: center; gap: 3px; }
.key {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  background: var(--glass-3); border: 1px solid var(--border-2);
  border-radius: var(--r-xs); font-size: 0.65rem; font-weight: 700;
  font-family: var(--font-mono); color: var(--text-2);
  box-shadow: 0 2px 0 var(--border-2);
}

/* ── STATS GRID extended ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 28px;
}
.stat-card {
  background: var(--glass-2);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--dur-base) var(--ease-out);
  cursor: pointer;
}
.stat-card:hover {
  border-color: var(--border-3);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.stat-card-inner {
  padding: 18px 16px;
  display: flex; align-items: center; gap: 13px;
}
.stat-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md); font-size: 1.15rem;
  flex-shrink: 0;
}
.stat-card:nth-child(1) .stat-icon { background: var(--teal-bg); }
.stat-card:nth-child(2) .stat-icon { background: var(--indigo-bg); }
.stat-card:nth-child(3) .stat-icon { background: var(--amber-bg); }
.stat-card:nth-child(4) .stat-icon { background: var(--cyan-bg); }
.stat-card:nth-child(5) .stat-icon { background: var(--green-bg); }
.stat-card:nth-child(6) .stat-icon { background: var(--red-bg); }

/* ── CALENDAR VIEW ── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px; margin-top: 12px;
}
.cal-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 2px; }
.cal-header-cell {
  text-align: center; font-size: 0.66rem; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px;
  padding: 4px 0;
}
.cal-day {
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 4px; border-radius: var(--r-sm);
  border: 1px solid var(--border-1);
  background: var(--glass-1); cursor: pointer;
  transition: all var(--dur-fast);
  min-height: 48px;
}
.cal-day:hover { background: var(--glass-3); border-color: var(--border-2); }
.cal-day.today { border-color: var(--brand-primary); background: var(--teal-bg); }
.cal-day.inactive { opacity: 0.3; cursor: default; }
.cal-day.has-sub { background: rgba(245,158,11,0.07); border-color: rgba(245,158,11,0.3); }
.cal-date { font-size: 0.72rem; font-weight: 700; color: var(--text-2); }
.cal-day.today .cal-date { color: var(--brand-primary); }
.cal-dot { width: 5px; height: 5px; border-radius: var(--r-full); background: var(--brand-warm); margin-top: 2px; }

/* ── QUICK STATS BAR ── */
.quick-stats-bar {
  display: flex; gap: 14px; flex-wrap: wrap;
  padding: 12px 18px; margin-bottom: 20px;
  background: var(--glass-2); border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
}
.qs-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; color: var(--text-2);
}
.qs-val { font-weight: 700; color: var(--text-1); }
.qs-sep { width: 1px; height: 16px; background: var(--border-1); }

/* ── TEACHER WORKLOAD CHART ── */
.workload-chart { margin-top: 14px; }
.wl-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--border-1);
}
.wl-row:last-child { border-bottom: none; }
.wl-name { width: 160px; font-size: 0.78rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-bar-wrap { flex: 1; height: 10px; background: var(--glass-1); border-radius: var(--r-full); overflow: hidden; }
.wl-bar-fill { height: 100%; border-radius: var(--r-full); transition: width 1s var(--ease-out); }
.wl-count { font-size: 0.74rem; font-weight: 600; color: var(--text-1); width: 48px; text-align: right; }

/* ── SCHEDULE PRINT WEEK SELECTOR ── */
.week-selector {
  display: flex; align-items: center; gap: 6px;
}
.week-btn {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; background: var(--glass-2);
  border: 1px solid var(--border-1);
  transition: all var(--dur-fast);
}
.week-btn:hover { background: var(--glass-4); }
.week-label { font-size: 0.78rem; font-weight: 600; color: var(--text-2); min-width: 90px; text-align: center; }

/* ── FILTER CHIPS ── */
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: var(--r-full);
  border: 1px solid var(--border-2);
  background: var(--glass-2); font-size: 0.73rem; font-weight: 500;
  color: var(--text-3); cursor: pointer;
  transition: all var(--dur-fast);
}
.filter-chip:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.filter-chip.active { background: var(--teal-bg); border-color: rgba(0,201,167,0.4); color: var(--brand-primary); }

/* ── TEACHER DETAIL CARD ── */
.teacher-detail-card {
  background: var(--glass-2); border: 1px solid var(--border-1);
  border-radius: var(--r-lg); padding: 18px; margin-bottom: 12px;
}
.teacher-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.teacher-avatar {
  width: 44px; height: 44px; border-radius: var(--r-full);
  background: var(--grad-teal); display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800; color: #04050e; flex-shrink: 0;
}
.teacher-detail-info h4 { font-size: 0.9rem; font-weight: 700; }
.teacher-detail-info p { font-size: 0.74rem; color: var(--text-3); }

/* ── SUBJECT USAGE BAR ── */
.subj-usage-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--border-1);
}
.subj-usage-item:last-child { border-bottom: none; }
.subj-color-bar { width: 4px; height: 30px; border-radius: 2px; flex-shrink: 0; }
.subj-usage-name { flex: 1; font-size: 0.79rem; font-weight: 500; }
.subj-usage-num { font-size: 0.74rem; color: var(--text-3); }

/* ── DRAG INDICATOR ── */
.drag-hint {
  font-size: 0.7rem; color: var(--text-4);
  display: flex; align-items: center; gap: 5px;
  padding: 8px 0;
}

/* ── FLOATING ACTION BTN ── */
.fab {
  position: fixed; bottom: 28px; right: 28px;
  width: 52px; height: 52px;
  border-radius: var(--r-full);
  background: var(--grad-teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #04050e;
  box-shadow: var(--glow-teal), var(--shadow-lg);
  cursor: pointer; z-index: 500;
  transition: all var(--dur-base) var(--ease-spring);
  border: none;
}
.fab:hover { transform: scale(1.1) rotate(10deg); box-shadow: 0 0 36px rgba(0,201,167,0.55), var(--shadow-xl); }
.fab-menu {
  position: fixed; bottom: 90px; right: 28px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 499; pointer-events: none; opacity: 0;
  transition: all var(--dur-base) var(--ease-out);
  transform: translateY(10px);
}
.fab-menu.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.fab-item {
  display: flex; align-items: center; gap: 10px;
  justify-content: flex-end;
}
.fab-label {
  background: var(--bg-layer1); border: 1px solid var(--border-2);
  border-radius: var(--r-full); padding: 5px 13px;
  font-size: 0.76rem; font-weight: 600; color: var(--text-1);
  box-shadow: var(--shadow-sm); white-space: nowrap;
}
.fab-btn {
  width: 42px; height: 42px; border-radius: var(--r-full);
  background: var(--glass-4); border: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; cursor: pointer;
  transition: all var(--dur-fast); flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.fab-btn:hover { background: var(--teal-bg); border-color: rgba(0,201,167,0.4); }

/* ── SEARCH COMMAND PALETTE ── */
.cmd-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(10px);
  z-index: 1100; display: flex; align-items: flex-start;
  justify-content: center; padding-top: 80px;
  opacity: 0; visibility: hidden;
  transition: all var(--dur-base);
}
.cmd-overlay.open { opacity: 1; visibility: visible; }
.cmd-box {
  background: var(--bg-layer1); border: 1px solid var(--border-2);
  border-radius: var(--r-xl); width: 600px; max-width: 95vw;
  box-shadow: var(--shadow-xl);
  transform: translateY(-16px) scale(0.97);
  transition: transform var(--dur-slow) var(--ease-spring);
  overflow: hidden;
}
.cmd-overlay.open .cmd-box { transform: translateY(0) scale(1); }
.cmd-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border-1);
}
.cmd-search-icon { font-size: 1.1rem; color: var(--text-3); flex-shrink: 0; }
.cmd-input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 1rem; font-family: var(--font-body);
  color: var(--text-1); font-weight: 500;
}
.cmd-input::placeholder { color: var(--text-4); }
.cmd-results { max-height: 360px; overflow-y: auto; }
.cmd-section { padding: 8px 20px 4px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-4); }
.cmd-result {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 20px; cursor: pointer;
  transition: background var(--dur-fast);
}
.cmd-result:hover, .cmd-result.selected { background: var(--glass-3); }
.cmd-result-icon { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--glass-3); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; flex-shrink: 0; }
.cmd-result-text { flex: 1; }
.cmd-result-title { font-size: 0.82rem; font-weight: 600; color: var(--text-1); }
.cmd-result-sub { font-size: 0.71rem; color: var(--text-3); }
.cmd-result-arrow { font-size: 0.7rem; color: var(--text-4); }
.cmd-empty { padding: 36px 20px; text-align: center; color: var(--text-3); font-size: 0.84rem; }
.cmd-footer {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; border-top: 1px solid var(--border-1);
  background: var(--glass-1); font-size: 0.67rem; color: var(--text-3);
}
.cmd-key-hint { display: flex; align-items: center; gap: 5px; }

/* ── COPY CHIP TO CLIPBOARD FEEDBACK ── */
@keyframes copyFlash {
  0%,100% { opacity: 1; } 50% { opacity: 0.4; }
}
.copy-flash { animation: copyFlash 0.4s ease; }

/* ── ENHANCED STAT TREND ── */
.stat-trend {
  font-size: 0.66rem; font-weight: 600;
  padding: 2px 7px; border-radius: var(--r-full);
  margin-top: 5px; display: inline-block;
}
.trend-up { background: var(--green-bg); color: var(--brand-success); }
.trend-down { background: var(--red-bg); color: var(--brand-danger); }
.trend-neutral { background: var(--glass-3); color: var(--text-3); }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .sidebar { width: var(--sidebar-collapsed-w); }
  .sidebar .logo-texts, .sidebar .nav-label,
  .sidebar .nav-badge, .sidebar .nav-section-label,
  .sidebar .user-info { opacity: 0; width: 0; overflow: hidden; }
  .sidebar:hover { width: var(--sidebar-w); box-shadow: var(--shadow-xl); }
  .sidebar:hover .logo-texts, .sidebar:hover .nav-label,
  .sidebar:hover .nav-badge, .sidebar:hover .nav-section-label,
  .sidebar:hover .user-info { opacity: 1; width: auto; }
  .sidebar-logo { justify-content: center; padding: 22px 14px; }
  .sidebar:hover .sidebar-logo { justify-content: flex-start; padding: 22px 18px; }
  .nav-item { justify-content: center; padding: 9px; }
  .sidebar:hover .nav-item { justify-content: flex-start; padding: 9px 12px; }
  .main-content { margin-left: var(--sidebar-collapsed-w); }
  .schedule-layout { flex-direction: column; }
  .available-panel { width: 100%; position: static; max-height: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar { width: var(--sidebar-w); transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0) !important; }
  .sidebar .logo-texts, .sidebar .nav-label,
  .sidebar .nav-badge, .sidebar .nav-section-label,
  .sidebar .user-info { opacity: 1; width: auto; }
  .sidebar .nav-item { justify-content: flex-start; padding: 9px 12px; }
  .sidebar .sidebar-logo { justify-content: flex-start; padding: 22px 18px; }
  .main-content { margin-left: 0; padding: 20px 16px; padding-top: calc(var(--topbar-h) + 18px); }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-title { font-size: 1.3rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .toast-container { left: 14px; right: 14px; bottom: 14px; }
  .toast { min-width: 0; width: 100%; }
  .modal { max-width: 100%; max-height: 90vh; border-radius: var(--r-lg); }
  .schedule-controls-bar { flex-direction: column; align-items: stretch; }
  .settings-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .overview-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ── ATTENDANCE TRACKER ── */
.attendance-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(140px,1fr)); gap: 10px; margin-top: 12px; }
.att-card { background: var(--glass-2); border: 1px solid var(--border-1); border-radius: var(--r-md); padding: 12px; cursor: pointer; transition: all var(--dur-base) var(--ease-out); }
.att-card:hover { border-color: var(--border-3); transform: translateY(-2px); }
.att-card .att-name { font-size: 0.78rem; font-weight: 600; color: var(--text-1); margin-bottom: 6px; }
.att-card .att-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.att-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* ── ACADEMIC CALENDAR ── */
.calendar-mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-mini-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 0.66rem; font-weight: 600; border-radius: 4px; cursor: pointer; transition: all var(--dur-fast); color: var(--text-2); }
.cal-mini-day:hover { background: var(--glass-3); }
.cal-mini-day.today { background: var(--brand-primary); color: #fff !important; }
.cal-mini-day.event { background: var(--amber-bg); color: var(--brand-warm); }
.cal-mini-day.holiday { background: var(--red-bg); color: var(--brand-danger); }
.cal-mini-day.empty { opacity: 0; pointer-events: none; }
.cal-mini-header { text-align: center; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; color: var(--text-4); padding: 4px 0; }

/* ── WEEKLY OVERVIEW STRIP ── */
.week-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 20px; }
.week-day-card { background: var(--glass-2); border: 1px solid var(--border-1); border-radius: var(--r-md); padding: 11px 10px; text-align: center; cursor: pointer; transition: all var(--dur-base); }
.week-day-card:hover { border-color: var(--border-3); transform: translateY(-2px); }
.week-day-card.today { border-color: var(--brand-primary); background: var(--teal-bg); }
.week-day-name { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-3); margin-bottom: 4px; }
.week-day-card.today .week-day-name { color: var(--brand-primary); }
.week-day-count { font-size: 1.3rem; font-weight: 800; color: var(--text-1); line-height: 1; }
.week-day-sub { font-size: 0.62rem; color: var(--text-3); margin-top: 3px; }

/* ── GANTT / TIMELINE ── */
.timeline-wrap { overflow-x: auto; }
.timeline-row { display: flex; align-items: center; gap: 0; height: 36px; border-bottom: 1px solid var(--border-1); }
.timeline-label { width: 120px; flex-shrink: 0; font-size: 0.74rem; font-weight: 500; padding: 0 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-bar-area { flex: 1; display: flex; align-items: center; position: relative; height: 100%; }
.timeline-block { position: absolute; height: 22px; border-radius: 4px; display: flex; align-items: center; padding: 0 7px; font-size: 0.62rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; cursor: pointer; transition: opacity var(--dur-fast); }
.timeline-block:hover { opacity: 0.8; }

/* ── DONUT CHART ── */
.donut-wrap { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.donut-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-val { font-size: 1.2rem; font-weight: 800; color: var(--text-1); line-height: 1; }
.donut-lbl { font-size: 0.6rem; color: var(--text-3); font-weight: 500; margin-top: 2px; }

/* ── TEACHER WORKLOAD EXPANDED ── */
.wl-status { font-size: 0.65rem; font-weight: 700; padding: 2px 7px; border-radius: var(--r-full); }
.wl-ok { background: var(--green-bg); color: var(--brand-success); }
.wl-warn { background: var(--amber-bg); color: var(--brand-warm); }
.wl-over { background: var(--red-bg); color: var(--brand-danger); }

/* ── SEARCH HIGHLIGHT ── */
.hl { background: rgba(0,201,167,0.25); border-radius: 2px; color: var(--brand-primary); font-weight: 700; }

/* ── MINI PROGRESS RING ── */
.ring-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ring-svg { transform: rotate(-90deg); }
.ring-val { position: absolute; font-size: 0.64rem; font-weight: 700; }

/* ── GRADE FILTER TAB ── */
.grade-tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.grade-tab { padding: 5px 14px; border-radius: var(--r-full); border: 1px solid var(--border-2); background: var(--glass-1); font-size: 0.74rem; font-weight: 600; color: var(--text-3); cursor: pointer; transition: all var(--dur-fast); }
.grade-tab:hover { border-color: var(--border-3); color: var(--text-1); }
.grade-tab.active { background: var(--teal-bg); border-color: rgba(0,201,167,0.4); color: var(--brand-primary); }

/* ── SUBSTITUTION ENHANCED ── */
.sub-status-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--glass-1); border-radius: var(--r-md); margin-bottom: 14px; flex-wrap: wrap; }
.sub-stat { display: flex; align-items: center; gap: 6px; font-size: 0.76rem; }
.sub-stat-val { font-weight: 700; color: var(--text-1); }

/* ── CONFLICT BANNER ── */
.conflict-banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--red-bg); border: 1px solid rgba(244,63,94,0.25); border-radius: var(--r-md); margin-bottom: 14px; animation: slideIn 0.3s var(--ease-out); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.conflict-banner-icon { font-size: 1rem; flex-shrink: 0; }
.conflict-banner-text { flex: 1; font-size: 0.8rem; color: var(--brand-danger); }
.conflict-banner-text strong { font-weight: 700; }
.conflict-banner .btn-xs { font-size: 0.68rem; padding: 4px 10px; }

/* ── QUICK ASSIGN PANEL ── */
.quick-panel { position: fixed; right: 0; top: 0; height: 100vh; width: 340px; background: var(--bg-layer1); border-left: 1px solid var(--border-2); z-index: 300; transform: translateX(100%); transition: transform var(--dur-slow) var(--ease-out); display: flex; flex-direction: column; }
.quick-panel.open { transform: translateX(0); }
.quick-panel-head { padding: 18px 20px; border-bottom: 1px solid var(--border-1); display: flex; align-items: center; justify-content: space-between; }
.quick-panel-body { padding: 18px 20px; flex: 1; overflow-y: auto; }

/* ── OVERVIEW MINI CARDS ── */
.overview-mini { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--glass-2); border: 1px solid var(--border-1); border-radius: var(--r-md); margin-bottom: 8px; cursor: pointer; transition: all var(--dur-fast); }
.overview-mini:hover { border-color: var(--border-3); transform: translateX(3px); }
.overview-mini-icon { font-size: 0.95rem; width: 28px; text-align: center; }
.overview-mini-text { flex: 1; }
.overview-mini-title { font-size: 0.78rem; font-weight: 600; color: var(--text-1); }
.overview-mini-sub { font-size: 0.67rem; color: var(--text-3); }
.overview-mini-val { font-size: 0.82rem; font-weight: 700; color: var(--text-1); }

/* ── SHALAT TIME WIDGET ── */
.prayer-widget { background: linear-gradient(135deg, rgba(0,201,167,0.12), rgba(99,102,241,0.1)); border: 1px solid rgba(0,201,167,0.2); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 16px; }
.prayer-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--brand-primary); margin-bottom: 10px; }
.prayer-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.prayer-item { text-align: center; }
.prayer-name { font-size: 0.6rem; color: var(--text-3); font-weight: 600; }
.prayer-time { font-size: 0.76rem; font-weight: 700; color: var(--text-1); margin-top: 2px; }
.prayer-item.next .prayer-name { color: var(--brand-primary); }
.prayer-item.next .prayer-time { color: var(--brand-primary); }

/* ── SETTINGS V3 EXTRAS ── */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.settings-card { background: var(--glass-2); border: 1px solid var(--border-1); border-radius: var(--r-lg); overflow: hidden; }
.settings-card-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border-1); background: var(--glass-1); }
.settings-card-header h3 { font-size: 0.88rem; font-weight: 700; }
.settings-card-body { padding: 18px; }
.settings-card-desc { font-size: 0.78rem; color: var(--text-3); margin-bottom: 14px; }
/* Hallmark · component: account-settings-card · genre: operational · theme: existing app tokens
 * states: default · hover · focus · active · disabled · loading · error · success
 * contrast: pass
 */
.account-settings-card {
  min-height: 100%;
}
.account-hero {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-sm);
  background: var(--color-paper);
  border: var(--rule-bold);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
}
.account-avatar-large {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  background: var(--color-accent);
  border: var(--rule-bold);
  border-radius: var(--radius-md);
  color: var(--color-surface);
  font-weight: 900;
  letter-spacing: 0;
}
.account-hero-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.account-hero-meta span {
  color: var(--color-accent-strong);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.account-hero-meta strong {
  overflow: hidden;
  color: var(--color-ink);
  font-size: var(--text-md);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-hero-meta small {
  overflow: hidden;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}
.account-status-item {
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-surface);
  border: var(--rule-hair);
  border-radius: var(--radius-sm);
}
.account-status-item span {
  display: block;
  color: var(--color-muted);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.account-status-item strong {
  display: block;
  overflow: hidden;
  color: var(--color-ink);
  font-size: var(--text-xs);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-divider {
  height: 1px;
  margin: var(--space-md) 0;
  background: var(--color-rule);
}
.account-password-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
}
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}
@media (max-width: 760px) {
  .account-status-grid,
  .account-password-grid {
    grid-template-columns: 1fr;
  }
}
/* Hallmark · component: active-days · genre: operational · theme: existing app tokens
 * states: default · hover · focus · active · disabled · loading · error · success
 * contrast: pass
 */
.active-days-panel {
  display: grid;
  gap: var(--space-sm);
}
.active-days-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-paper);
  border: var(--rule-hair);
  border-radius: var(--radius-md);
}
.active-days-summary {
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 800;
}
.active-days-hint {
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  text-align: right;
}
.active-days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
  gap: var(--space-xs);
}
.active-day-card {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-sm);
  min-width: 0;
  background: var(--color-surface);
  border: var(--rule-hair);
  border-radius: var(--radius-lg);
  color: var(--color-muted);
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.active-day-card:hover,
.active-day-card.is-hover {
  background: var(--color-paper);
  border-color: var(--color-rule-strong);
}
.active-day-card:focus-within,
.active-day-card.is-focus {
  border-color: var(--color-focus);
  box-shadow: 0 0 0 4px var(--color-accent-soft);
}
.active-day-card:active,
.active-day-card.is-pressed {
  background: var(--color-paper-soft);
}
.active-days-panel.is-loading .active-day-card {
  opacity: 0.72;
  cursor: progress;
}
.active-day-card.is-active {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-ink);
}
.active-day-card.is-off {
  opacity: 0.82;
}
.active-day-card.is-error {
  border-color: var(--color-danger);
  background: var(--color-danger-soft);
}
.active-day-card.is-success {
  border-color: var(--color-success);
  background: var(--color-success-soft);
}
.active-day-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
  cursor: pointer;
}
.active-day-check {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.active-day-box {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  background: var(--color-surface);
  border: 2px solid var(--color-ink-soft);
  border-radius: var(--radius-sm);
  color: transparent;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.active-day-check:checked + .active-day-box {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-surface);
}
.active-day-main {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.active-day-name {
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.active-day-state {
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.2;
}
.active-day-card.is-active .active-day-state {
  color: var(--color-accent-strong);
}
.active-day-limit {
  min-height: 36px;
  width: 100%;
  padding: 7px 30px 7px 9px;
  font-size: var(--text-xs);
  font-weight: 800;
}
.active-day-limit:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  background: var(--color-paper);
  color: var(--color-muted);
  border-color: var(--color-rule);
}
.active-days-save {
  justify-self: start;
  margin-top: 2px;
}
@media (max-width: 520px) {
  .active-days-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .active-days-hint {
    text-align: left;
  }
  .active-days-grid {
    grid-template-columns: 1fr;
  }
  .active-days-save {
    width: 100%;
  }
}
.school-logo-preview {
  width: 86px;
  height: 86px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-2);
  background: var(--glass-1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-3);
  font-size: 1.6rem;
  margin-bottom: 10px;
}
.school-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

/* ── REPORT GRID ── */
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 20px; }
.report-tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--border-1); margin-bottom: 20px; }
.report-tab { padding: 8px 18px; font-size: 0.8rem; font-weight: 600; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; transition: all var(--dur-base); }
.report-tab.active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); }
.report-tab:hover:not(.active) { color: var(--text-1); }

/* ── MINI BAR ── */
.mini-bar-wrap { flex: 1; height: 6px; background: var(--glass-1); border-radius: var(--r-full); overflow: hidden; min-width: 60px; }
.mini-bar-fill { height: 100%; border-radius: var(--r-full); transition: width 0.8s var(--ease-out); }

/* ── PERIOD TABLE ── */
.period-table { width: 100%; border-collapse: collapse; }
.period-table th { padding: 8px 12px; text-align: left; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-3); border-bottom: 1px solid var(--border-1); }
.period-table td { padding: 8px 12px; font-size: 0.82rem; border-bottom: 1px solid var(--border-1); vertical-align: middle; }
.period-table tr:last-child td { border-bottom: none; }
.period-table input { background: var(--bg-layer2); border: 1px solid var(--border-1); border-radius: var(--r-sm); padding: 5px 8px; font-size: 0.8rem; color: var(--text-1); width: 100%; }
.period-table input:focus { outline: none; border-color: var(--brand-primary); }

/* ── HISTORY LOG ── */
.history-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-1); }
.history-item:last-child { border-bottom: none; }
.history-icon { width: 28px; height: 28px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; margin-top: 1px; }
.history-text { flex: 1; }
.history-title { font-size: 0.78rem; font-weight: 600; color: var(--text-1); }
.history-time { font-size: 0.66rem; color: var(--text-4); margin-top: 2px; }

/* ── SCHEDULE CHIP ENHANCED ── */
.schedule-chip { padding: 7px 9px 7px 18px; background: var(--glass-2); border: 1px solid var(--border-1); border-left: 3px solid transparent; border-radius: var(--r-sm); cursor: grab; transition: all var(--dur-base) var(--ease-out); position: relative; }
.schedule-chip:active { cursor: grabbing; }
.schedule-chip::before { content: '⋮⋮'; position: absolute; left: 4px; top: 50%; transform: translateY(-50%); color: var(--text-4); font-size: 11px; opacity: 0.4; transition: opacity 0.2s; pointer-events: none; }
.schedule-chip:hover::before { opacity: 0.8; color: var(--brand-primary); }
.schedule-chip:hover { transform: scale(1.02); box-shadow: var(--shadow-md); z-index: 2; }
.schedule-chip.conflict { border-color: var(--brand-danger) !important; background: var(--red-bg) !important; }
.schedule-chip.locked { cursor: default; box-shadow: inset 0 0 0 1px var(--color-command-line); }
.schedule-chip.locked::before { content: 'LOCK'; left: 3px; font-size: 7px; writing-mode: vertical-rl; letter-spacing: 0; opacity: 0.75; color: var(--color-command-line); }
.chip-subject { font-size: 0.74rem; font-weight: 700; color: var(--text-1); }
.chip-meta { font-size: 0.64rem; color: var(--text-3); margin-top: 2px; }
.chip-remove { position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border-radius: 3px; font-size: 0.6rem; display: flex; align-items: center; justify-content: center; background: transparent; color: var(--text-4); opacity: 0; transition: all var(--dur-fast); }
.schedule-chip:hover .chip-remove { opacity: 1; }
.chip-remove:hover { background: var(--red-bg); color: var(--brand-danger); }
.chip-lock { position: absolute; right: 22px; top: 3px; min-width: 34px; height: 16px; padding: 0 5px; border-radius: var(--radius-xs); background: var(--color-paper); color: var(--color-ink-soft); border: var(--rule-hair); font-size: 0.56rem; font-weight: 800; line-height: 1; opacity: 0; transition: opacity var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.schedule-chip:hover .chip-lock,
.schedule-chip.locked .chip-lock { opacity: 1; }
.schedule-chip.locked .chip-lock { background: var(--color-nav-active); color: var(--color-surface); border-color: var(--color-nav-active); }
.schedule-cell { padding: 3px; vertical-align: top; min-width: 100px; }
.empty-cell { height: 48px; border: 1px dashed var(--border-2); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: var(--text-4); cursor: pointer; transition: all var(--dur-fast); }
.empty-cell:hover { border-color: var(--brand-primary); color: var(--brand-primary); background: var(--teal-bg); }
.schedule-cell.drag-over { background: var(--teal-bg) !important; border: 1px dashed var(--brand-primary); border-radius: var(--r-sm); }
.break-row td { background: var(--amber-bg); font-size: 0.74rem; color: var(--brand-warm); }
.break-cell { text-align: center; font-style: italic; }
.period-header { text-align: center; min-width: 70px; }
.pnum { display: block; font-size: 0.78rem; font-weight: 800; color: var(--text-1); }
.ptime { display: block; font-size: 0.61rem; color: var(--text-3); margin-top: 1px; }

/* ── SUBSTITUTION CARD ── */
.sub-card { background: var(--glass-2); border: 1px solid var(--border-1); border-radius: var(--r-lg); margin-bottom: 12px; overflow: hidden; transition: all var(--dur-base); }
.sub-card:hover { border-color: var(--border-2); }
.sub-card-header { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid var(--border-1); }
.sub-card-header h4 { font-size: 0.84rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sub-card-body { padding: 14px 18px; }
.sub-detail { display: flex; gap: 20px; flex-wrap: wrap; }
.sub-item { font-size: 0.78rem; }
.sub-item-label { color: var(--text-3); margin-bottom: 2px; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; }

/* ── BTN VARIANTS ── */
.btn-xs { padding: 5px 10px; font-size: 0.72rem; }
.btn-sm { padding: 7px 13px; font-size: 0.77rem; }
.btn-indigo { background: var(--grad-cool); border: none; color: #fff; font-weight: 700; box-shadow: var(--glow-indigo); }
.btn-indigo:hover { box-shadow: 0 0 28px rgba(99,102,241,0.5); transform: translateY(-2px); }
.btn-warning { background: var(--grad-warm); border: none; color: #fff; font-weight: 700; }
.btn-success { background: linear-gradient(135deg,#10b981,#059669); border: none; color: #fff; font-weight: 700; }
.btn-success:hover { transform: translateY(-2px); }
.btn-danger { background: var(--grad-danger); border: none; color: #fff; font-weight: 700; }
.btn-danger:hover { transform: translateY(-2px); }
.btn-secondary { background: var(--glass-3); border: 1px solid var(--border-2); color: var(--text-2); }

/* ── TOGGLE SWITCH ── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-1); }
.toggle-row:last-child { border-bottom: none; }
.toggle-info .toggle-title { font-size: 0.82rem; font-weight: 600; color: var(--text-1); }
.toggle-info .toggle-desc { font-size: 0.71rem; color: var(--text-3); margin-top: 2px; }
.toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { display: none; }
.toggle-track { display: block; width: 100%; height: 100%; background: var(--glass-4); border-radius: 11px; cursor: pointer; transition: background var(--dur-base); border: 1px solid var(--border-2); }
.toggle input:checked + .toggle-track { background: var(--brand-primary); border-color: var(--brand-primary); }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 8px; background: #fff; transition: left var(--dur-base) var(--ease-spring); pointer-events: none; }
.toggle input:checked ~ .toggle-thumb { left: 21px; }

/* ── ACADEMIC EVENTS ── */
.event-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r-full); font-size: 0.68rem; font-weight: 600; }
.event-exam { background: var(--red-bg); color: var(--brand-danger); }
.event-holiday { background: var(--amber-bg); color: var(--brand-warm); }
.event-meeting { background: var(--indigo-bg); color: var(--brand-secondary); }
.event-activity { background: var(--green-bg); color: var(--brand-success); }
.event-block-chip {
  padding: 8px 9px;
  border-radius: var(--r-sm);
  border-left: 3px solid var(--brand-warm);
  background: var(--amber-bg);
  color: var(--text-1);
  font-size: 0.72rem;
  line-height: 1.35;
}
.event-block-chip .event-title {
  font-weight: 800;
}
.event-block-chip .event-meta {
  color: var(--text-3);
  margin-top: 2px;
}


html,
body {
  overflow-x: clip;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-text);
  color: var(--color-ink);
  background: var(--color-paper-soft);
}

body::before,
.sidebar-overlay,
.mobile-header,
.nav-section-label,
.nav-divider,
.sidebar-footer {
  display: none !important;
}

button,
input,
select,
textarea {
  font-family: var(--font-text);
}

.app-layout {
  display: block;
  min-height: 100vh;
  background: var(--color-paper-soft);
}

.sidebar {
  position: sticky;
  top: 0;
  width: 100%;
  height: auto;
  min-height: 132px;
  transform: none !important;
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  align-items: stretch;
  overflow: visible;
  background: var(--color-command);
  color: var(--color-ink);
  border: 0;
  border-bottom: var(--rule-bold);
  box-shadow: none;
  z-index: 120;
}

.sidebar-logo {
  min-width: 0;
  padding: var(--space-md) var(--space-lg);
  border: 0;
  border-right: var(--rule-hair);
}

.logo-icon-wrap,
.user-avatar {
  width: 44px;
  height: 44px;
  background: var(--color-nav-active);
  color: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.brand-mark {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 4px;
  background:
    linear-gradient(135deg, var(--color-nav-active), var(--color-accent-strong));
  color: var(--color-surface);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.logo-icon-wrap img,
.school-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.logo-texts .app-name,
.mobile-logo-text,
.page-title {
  font-family: var(--font-display);
  background: none;
  color: currentColor;
  -webkit-text-fill-color: currentColor;
  letter-spacing: 0;
}

.logo-texts .app-name,
.sidebar .user-name {
  color: var(--color-ink);
}

.logo-texts .app-tagline,
.sidebar .user-role {
  color: var(--color-muted);
}

.sidebar-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--space-xs);
  overflow-x: auto;
  overflow-y: hidden;
  padding: var(--space-md) var(--space-lg);
  scrollbar-width: thin;
}

.nav-item {
  flex: 0 0 auto;
  min-width: 112px;
  max-width: 152px;
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  justify-items: start;
  gap: var(--space-xs);
  padding: var(--space-sm);
  margin: 0;
  border: var(--rule-hair);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-ink-soft);
  white-space: normal;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

.nav-item::before {
  display: none;
}

.nav-item:hover,
.nav-item.active {
  background: var(--color-nav-active);
  color: var(--color-surface);
  border-color: var(--color-nav-active);
  transform: none;
}

.nav-icon-box {
  width: 26px;
  height: 26px;
  border: var(--rule-hair);
  border-radius: var(--radius-md);
  background: var(--color-paper);
  color: var(--color-ink);
  font-size: 0.95rem;
}

.nav-item:hover .nav-icon-box,
.nav-item.active .nav-icon-box {
  background: var(--color-surface);
  color: var(--color-nav-active);
}

.nav-label {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  font-size: var(--text-xs);
  line-height: 1.2;
}

.nav-badge {
  position: absolute;
  top: var(--space-xs);
  right: var(--space-xs);
}

.main-content {
  margin-left: 0;
  min-height: calc(100vh - 132px);
  padding: var(--space-lg);
  background:
    linear-gradient(180deg, var(--color-paper) 0, var(--color-paper-soft) 100%);
}

.page {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--space-lg);
  background: var(--color-surface);
  border: var(--rule-bold);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 34px oklch(24% 0.035 242 / 0.09);
  animation: pageIn var(--dur-slow) var(--ease-out);
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-md);
  margin: calc(var(--space-lg) * -1) calc(var(--space-lg) * -1) var(--space-lg);
  padding: var(--space-lg);
  background: var(--color-paper);
  border-bottom: var(--rule-bold);
}

.page-title {
  color: var(--color-ink);
  font-size: var(--text-display);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.page-title .title-icon {
  display: none;
}

.page-subtitle {
  max-width: 72ch;
  margin-top: var(--space-xs);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.page-actions {
  align-self: center;
  display: flex;
  gap: var(--space-xs);
}

.btn,
.report-tab,
.notif-bell,
.hamburger-btn {
  border-radius: var(--radius-md);
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.btn {
  min-height: 42px;
  padding: 9px 16px;
  border: var(--rule-hair);
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: 0 1px 0 var(--color-rule);
  white-space: nowrap;
}

.btn:hover,
.btn.is-hover {
  background: var(--color-paper);
  border-color: var(--color-rule-strong);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px oklch(24% 0.035 242 / 0.12);
}

.btn:active,
.btn.is-active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.btn:focus-visible,
.nav-item:focus-visible,
.hamburger-btn:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible,
.report-tab:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary,
.btn-success {
  background: var(--color-nav-active);
  color: var(--color-surface);
}

.btn-indigo {
  background: var(--color-violet);
  color: var(--color-surface);
}

.btn-danger {
  background: var(--color-danger);
  color: var(--color-surface);
}

.btn-warning {
  background: var(--color-warn);
  color: var(--color-ink);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0;
  margin-bottom: var(--space-lg);
  background: var(--color-surface);
  border: var(--rule-bold);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 24px oklch(24% 0.035 242 / 0.08);
}

.stat-card {
  border: 0;
  border-right: var(--rule-bold);
  border-radius: 0;
  background: var(--color-surface);
  box-shadow: none;
  cursor: default;
}

.stat-card:last-child {
  border-right: 0;
}

.stat-card::after {
  display: none;
}

.stat-card-inner {
  min-height: 116px;
  padding: var(--space-md);
  align-items: flex-start;
}

.stat-icon {
  width: auto;
  height: auto;
  background: transparent !important;
  border: 0;
  border-radius: 0;
  font-size: 1rem;
}

.stat-value {
  color: var(--color-ink);
  font-size: 2rem;
  letter-spacing: 0;
}

.stat-label {
  color: var(--color-muted);
}

.glass-card,
.table-wrapper,
.settings-card,
.sub-card,
.quick-stats-bar,
.prayer-widget,
.modal,
.notif-panel,
.kbd-panel {
  background: var(--color-surface);
  border: var(--rule-bold);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.glass-card:hover,
.sub-card:hover,
.stat-card:hover,
.schedule-chip:hover,
.empty-cell:hover,
.cal-day:hover {
  transform: none;
  box-shadow: none;
}

.dashboard-grid,
.report-grid,
.settings-grid {
  gap: var(--space-md);
}

.card-header,
.table-top-bar,
.settings-card-header,
.modal-header,
.modal-footer,
.sub-card-header {
  padding: var(--space-sm) var(--space-md);
  background: var(--color-paper);
  border-color: var(--color-rule-strong);
}

.card-header h3,
.settings-card-header h3,
.sub-card-header h4 {
  color: var(--color-ink);
}

.card-body,
.settings-card-body,
.sub-card-body {
  padding: var(--space-md);
}

.table-wrapper {
  overflow: clip;
}

.data-table thead th,
.period-table th {
  background: var(--color-ink);
  color: var(--color-surface);
  letter-spacing: 0.04em;
}

.data-table tbody tr,
.period-table td {
  border-color: var(--color-rule);
}

.data-table tbody tr:nth-child(even) {
  background: var(--color-paper);
}

.data-table tbody tr:hover {
  background: var(--color-accent-soft);
}

.data-table tbody td {
  padding-block: 9px;
}

.form-input,
.form-select,
.form-textarea,
.period-table input,
.search-input-wrap input {
  background: var(--color-surface);
  border: 2px solid var(--color-ink-soft);
  border-radius: 0;
  color: var(--color-ink);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.period-table input:focus,
.search-input-wrap input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-accent-soft);
}

.badge,
.event-chip {
  border-radius: var(--radius-full);
}

.badge-teal,
.event-activity,
.att-hadir {
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
}

.badge-indigo,
.event-meeting {
  background: var(--color-violet-soft);
  color: var(--color-violet);
}

.badge-amber,
.event-holiday,
.att-izin {
  background: var(--color-warn-soft);
  color: var(--color-warn);
}

.badge-red,
.event-exam,
.att-alpha {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.schedule-chip,
.empty-cell,
.cal-day,
.week-day,
.overview-mini,
.event-block-chip,
.empty-state {
  background: var(--color-surface);
  border-color: var(--color-rule);
  border-radius: var(--radius-sm);
}

.empty-state {
  background: var(--color-paper);
  border: 1px dashed var(--color-rule);
}

.schedule-chip:hover,
.empty-cell:hover,
.cal-day:hover {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
}

.schedule-chip.conflict {
  background: var(--color-danger-soft) !important;
  border-color: var(--color-danger) !important;
}

.modal-overlay {
  background: oklch(17% 0.035 242 / 0.48);
}

.modal {
  color: var(--color-ink);
  box-shadow: 10px 10px 0 var(--color-command-line);
}

.toast {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-panel);
}

body.light-mode {
  --bg-base: var(--color-paper-soft);
  --bg-layer1: var(--color-surface);
  --bg-layer2: var(--color-paper);
  --bg-layer3: var(--color-paper-soft);
  --text-1: var(--color-ink);
  --text-2: var(--color-ink-soft);
  --text-3: var(--color-muted);
  --border-1: var(--color-rule);
  --border-2: var(--color-rule-strong);
  --border-3: var(--color-accent);
}

body.light-mode::before {
  display: none;
}

body.light-mode .sidebar,
body.light-mode .mobile-header {
  background: var(--color-command);
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  overflow: auto;
  padding: var(--space-lg);
  background: var(--color-paper-soft);
}
.auth-gate.active {
  display: block;
}
.auth-reset-gate {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  place-items: center;
  padding: var(--space-lg);
  background: var(--color-paper-soft);
}
.auth-reset-gate.active {
  display: grid;
}
/* Hallmark · pre-emit critique: P5 H5 E4 S4 R5 V4 */
/* Hallmark · component: auth-landing · genre: operational · theme: existing app tokens
 * states: default · hover · focus · active · disabled · loading · error · success
 * contrast: pass
 */
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: var(--space-lg);
  align-items: stretch;
  width: min(1080px, 100%);
  min-height: calc(100vh - (var(--space-lg) * 2));
  margin: 0 auto;
}
.auth-landing {
  display: grid;
  align-content: space-between;
  gap: var(--space-lg);
  padding: clamp(24px, 4vw, 48px);
  background: var(--color-surface);
  border: var(--rule-bold);
  border-radius: var(--radius-lg);
}
.auth-brand-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.auth-brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: var(--color-accent);
  border: var(--rule-bold);
  border-radius: var(--radius-md);
  color: var(--color-surface);
  font-size: var(--text-lg);
  font-weight: 900;
}
.auth-brand-text {
  display: grid;
  gap: 2px;
}
.auth-brand-text strong {
  color: var(--color-ink);
  font-size: var(--text-md);
  font-weight: 900;
}
.auth-brand-text span {
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 800;
}
.auth-landing-copy {
  display: grid;
  gap: var(--space-sm);
  max-width: 620px;
}
.auth-landing-copy h1 {
  color: var(--color-ink);
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.auth-landing-copy p {
  max-width: 560px;
  color: var(--color-muted);
  font-size: var(--text-md);
  line-height: 1.55;
}
.auth-capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
}
.auth-capability {
  padding: var(--space-sm);
  background: var(--color-paper);
  border: var(--rule-hair);
  border-radius: var(--radius-sm);
}
.auth-capability strong {
  display: block;
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 900;
}
.auth-capability span {
  display: block;
  margin-top: 4px;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.45;
}
.auth-form-wrap {
  display: grid;
  align-content: center;
}
.auth-card {
  width: min(460px, 100%);
  background: var(--color-surface);
  border: var(--rule-bold);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-offset);
}
.auth-card h2 {
  color: var(--color-ink);
  font-size: var(--text-xl);
  line-height: 1.2;
  margin-bottom: var(--space-xs);
}
.auth-card p {
  color: var(--color-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-md);
}
.auth-actions {
  display: grid;
  gap: var(--space-xs);
}
.auth-login-tools {
  display: flex;
  justify-content: flex-end;
  margin-top: calc(var(--space-xs) * -1);
  margin-bottom: var(--space-sm);
}
.auth-link-button {
  color: var(--color-accent);
  font-size: var(--text-xs);
  font-weight: 900;
}
.auth-link-button:hover,
.auth-link-button.is-hover {
  color: var(--color-accent-strong);
  text-decoration: underline;
}
.auth-link-button:focus-visible,
.auth-link-button.is-focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}
.auth-link-button:active,
.auth-link-button.is-active {
  transform: translateY(1px);
}
.auth-form-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: var(--space-sm);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 800;
}
.auth-form-switch button {
  color: var(--color-accent);
  font-weight: 900;
}
.auth-message {
  min-height: 20px;
  color: var(--color-danger);
  font-size: var(--text-xs);
  font-weight: 700;
  margin-top: var(--space-sm);
}
@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .auth-landing {
    align-content: start;
  }
}
@media (max-width: 560px) {
  .auth-gate {
    padding: var(--space-sm);
  }
  .auth-capability-grid {
    grid-template-columns: 1fr;
  }
  .auth-landing {
    padding: var(--space-md);
  }
}
    /* Hallmark · component: profile-dock · genre: operational · states: default/hover/focus/active/loading/error/success */
    .auth-user-pill {
  position: fixed;
  right: var(--space-md);
  bottom: var(--space-md);
  z-index: 1500;
  display: none;
  align-items: center;
  gap: var(--space-sm);
  width: min(360px, calc(100vw - 32px));
  padding: var(--space-xs);
  background: var(--color-surface);
  border: var(--rule-bold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-offset);
  transition: border-color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.auth-user-pill.active {
  display: flex;
}
.auth-user-pill:hover,
.auth-user-pill.is-hover {
  background: var(--color-paper);
  border-color: var(--color-accent);
}
.auth-user-pill:focus-within,
.auth-user-pill.is-focus {
  box-shadow: 0 0 0 4px var(--color-accent-soft), var(--shadow-offset);
}
.auth-user-pill:active,
.auth-user-pill.is-pressed {
  transform: translateY(1px);
}
.auth-user-pill.is-loading {
  cursor: progress;
  opacity: 0.72;
}
.auth-user-pill.is-error {
  border-color: var(--color-danger);
  background: var(--color-danger-soft);
}
.auth-user-pill.is-success {
  border-color: var(--color-success);
  background: var(--color-success-soft);
}
.profile-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  background: var(--color-accent-soft);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-lg);
  color: var(--color-accent-strong);
  font-size: var(--text-xs);
  font-weight: 900;
}
.profile-mini {
  display: grid;
  flex: 1 1 auto;
  gap: 1px;
  min-width: 0;
  padding: 3px 0;
  text-align: left;
  line-height: 1.2;
}
.profile-mini:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}
.profile-kicker {
  color: var(--color-accent-strong);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
}
.profile-mini strong {
  min-width: 0;
  overflow: hidden;
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-mini span {
  min-width: 0;
  overflow: hidden;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-user-pill .profile-mini {
  min-height: 40px;
}
.profile-logout {
  flex: 0 0 auto;
  min-height: 40px;
  padding-inline: var(--space-sm);
  border-radius: var(--radius-md);
  font-weight: 900;
}
.profile-panel {
  position: fixed;
  right: var(--space-md);
  bottom: 76px;
  z-index: 1500;
  display: none;
  width: min(380px, calc(100vw - 32px));
  background: var(--color-surface);
  border: var(--rule-bold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-offset);
}
.profile-panel.active {
  display: block;
}
.profile-panel-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-bottom: var(--rule-hair);
}
.profile-panel-body {
  display: grid;
  gap: var(--space-sm);
  padding: var(--space-md);
}
.profile-meta {
  display: grid;
  gap: 3px;
}
.profile-meta strong {
  color: var(--color-ink);
  font-size: var(--text-md);
  line-height: 1.2;
}
.profile-meta span {
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 700;
}
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}
@media (max-width: 520px) {
  .auth-user-pill,
  .profile-panel {
    right: var(--space-sm);
    left: var(--space-sm);
    max-width: none;
    width: auto;
  }
  .auth-user-pill {
    bottom: var(--space-sm);
  }
  .profile-logout {
    padding-inline: var(--space-xs);
  }
}

body:not(.light-mode) {
  --color-paper: oklch(19% 0.025 242);
  --color-paper-soft: oklch(14% 0.024 245);
  --color-surface: oklch(23% 0.028 242);
  --color-ink: oklch(94% 0.01 96);
  --color-ink-soft: oklch(82% 0.018 96);
  --color-muted: oklch(67% 0.025 235);
  --color-rule: oklch(34% 0.03 242);
  --color-rule-strong: oklch(58% 0.035 112);
  --color-command: oklch(18% 0.026 242);
  --color-command-line: oklch(42% 0.046 164);
  --color-nav-active: oklch(71% 0.11 164);
  --color-accent: oklch(72% 0.13 164);
  --color-accent-strong: oklch(78% 0.12 164);
  --color-accent-soft: oklch(28% 0.055 164);
  --color-violet: oklch(73% 0.12 294);
  --color-violet-soft: oklch(30% 0.052 294);
  --color-warn: oklch(76% 0.14 72);
  --color-warn-soft: oklch(31% 0.06 80);
  --color-danger: oklch(68% 0.16 28);
  --color-danger-soft: oklch(29% 0.06 28);
  --color-success: oklch(70% 0.12 154);
  --color-success-soft: oklch(29% 0.055 154);
  --color-focus: oklch(76% 0.14 162);
  --bg-base: var(--color-paper-soft);
  --bg-layer1: var(--color-surface);
  --bg-layer2: var(--color-paper);
  --bg-layer3: oklch(25% 0.03 242);
  --glass-1: oklch(100% 0 0 / 0.035);
  --glass-2: oklch(100% 0 0 / 0.055);
  --glass-3: oklch(100% 0 0 / 0.08);
  --glass-4: oklch(100% 0 0 / 0.12);
  --glass-5: oklch(100% 0 0 / 0.16);
  --text-1: var(--color-ink);
  --text-2: var(--color-ink-soft);
  --text-3: var(--color-muted);
  --text-4: oklch(58% 0.026 230);
  --border-1: var(--color-rule);
  --border-2: var(--color-rule-strong);
  --border-3: var(--color-accent);
  --border-focus: var(--color-focus);
  --teal-bg: var(--color-accent-soft);
  --indigo-bg: var(--color-violet-soft);
  --cyan-bg: oklch(29% 0.05 205);
  --amber-bg: var(--color-warn-soft);
  --red-bg: var(--color-danger-soft);
  --green-bg: var(--color-success-soft);
  --purple-bg: var(--color-violet-soft);
  --shadow-panel: 0 16px 38px oklch(5% 0.02 245 / 0.38);
  --shadow-offset: 8px 8px 0 oklch(9% 0.02 245);
}

body:not(.light-mode)::before {
  display: block;
  background:
    radial-gradient(ellipse 700px 500px at 10% 15%, oklch(72% 0.13 164 / 0.08), transparent),
    radial-gradient(ellipse 600px 400px at 90% 80%, oklch(73% 0.12 294 / 0.08), transparent),
    radial-gradient(ellipse 500px 350px at 55% 45%, oklch(74% 0.1 205 / 0.05), transparent);
}

body:not(.light-mode) .sidebar,
body:not(.light-mode) .mobile-header {
  background: oklch(16% 0.026 242 / 0.88);
}

body:not(.light-mode) .page {
  box-shadow: 0 16px 42px oklch(5% 0.02 245 / 0.34);
}

body:not(.light-mode) .btn:hover,
body:not(.light-mode) .btn.is-hover,
body:not(.light-mode) .stats-grid {
  box-shadow: 0 10px 28px oklch(5% 0.02 245 / 0.28);
}

@media (max-width: 1100px) {
  .sidebar {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar .logo-texts,
  .sidebar .nav-label,
  .sidebar .nav-badge,
  .sidebar .nav-section-label,
  .sidebar .user-info {
    opacity: 1;
    width: auto;
  }

  .sidebar:hover {
    width: 100%;
    box-shadow: none;
  }

  .sidebar-logo {
    border-right: 0;
    border-bottom: var(--rule-hair);
  }

  .main-content {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: sticky;
    min-height: auto;
    transform: none !important;
  }

  .sidebar.open {
    transform: none !important;
  }

  .sidebar-nav {
    padding: var(--space-sm);
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .nav-item {
    min-width: 104px;
    max-width: 150px;
    min-height: 64px;
  }

  .main-content {
    padding: var(--space-md) 0;
  }

  .page {
    padding: var(--space-md);
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .page-header,
  .table-top-bar,
  .card-header {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    flex-direction: column;
  }

  .page-header {
    margin: calc(var(--space-md) * -1) calc(var(--space-md) * -1) var(--space-md);
    padding: var(--space-md);
  }

  .page-actions,
  .table-top-bar > * {
    width: 100%;
  }

  .btn,
  .search-input-wrap input {
    width: 100%;
  }

  .stats-grid,
  .settings-grid,
  .report-grid,
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-card {
    border-right: 0;
    border-bottom: var(--rule-bold);
  }

  .stat-card:last-child {
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 120ms !important;
  }
}


/* Logo frameless overrides when it contains an image */
.logo-icon-wrap:has(img) {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}
.auth-brand-mark:has(img) {
  background: transparent !important;
  border: none !important;
  width: 64px !important;
  height: 64px !important;
}
.auth-brand-mark:has(img) img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

/* Redesigned Login Screen Layout */
.auth-gate {
  background: #f1f5f9 !important;
  padding: 0 !important;
  display: none;
  font-family: var(--font-body);
}
.auth-gate.active {
  display: block;
}

/* Header Navbar */
.auth-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 40px;
  background: #ffffff;
  border-bottom: 1px solid oklch(90% 0.01 90);
  position: sticky;
  top: 0;
  z-index: 100;
}
.auth-navbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-nav-logo-wrap {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-nav-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #041a12;
}
.auth-navbar-center {
  display: flex;
  gap: 28px;
}
.auth-nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: oklch(45% 0.01 90);
  transition: color var(--dur-fast) var(--ease-out);
}
.auth-nav-link:hover {
  color: #041a12;
}
.auth-btn-admin-login {
  background: #041a12 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
  padding: 8px 16px !important;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.auth-btn-admin-login:hover {
  transform: translateY(-1px);
  background: #05261b !important;
}

/* Split Hero Section */
.auth-landing-hero-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 40px;
}
.auth-hero-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: start;
}

/* Left Hero Column */
.auth-hero-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.auth-hero-title {
  font-size: clamp(2rem, 3.5vw, 3.2rem) !important;
  font-weight: 800;
  line-height: 1.15 !important;
  color: #0f172a !important;
  letter-spacing: -0.02em;
  text-align: left !important;
  background: none !important;
  -webkit-text-fill-color: initial !important;
}
.auth-hero-desc {
  font-size: 1.05rem;
  color: oklch(50% 0.01 90);
  line-height: 1.6;
  max-width: 580px;
  text-align: left;
}

/* 4 Feature Grid */
.auth-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.auth-feature-card {
  display: flex;
  gap: 14px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
  text-align: left;
}
.auth-feature-card:hover {
  transform: translateY(-2px);
  border-color: oklch(80% 0.02 90);
  box-shadow: 0 8px 24px oklch(24% 0.035 242 / 0.04);
}
.auth-feature-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.auth-feature-content h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}
.auth-feature-content p {
  font-size: 0.78rem;
  color: oklch(55% 0.01 90);
  line-height: 1.45;
  margin-bottom: 0 !important;
}

/* Right Hero Column */
.auth-hero-right {
  display: flex;
  justify-content: center;
}
.auth-card {
  width: 100% !important;
  max-width: 440px !important;
  padding: 32px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08) !important;
  text-align: left;
}
.auth-card h2 {
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin-bottom: 8px !important;
  background: none !important;
  -webkit-text-fill-color: initial !important;
}
.auth-card p {
  font-size: 0.85rem !important;
  color: oklch(50% 0.01 90) !important;
  margin-bottom: 24px !important;
}
.auth-actions {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .auth-navbar {
    padding: 0 24px;
  }
  .auth-landing-hero-container {
    padding: 40px 24px;
  }
  .auth-hero-split {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .auth-navbar-center {
    display: none;
  }
}
@media (max-width: 576px) {
  .auth-feature-grid {
    grid-template-columns: 1fr;
  }
}


/* ─── GLOBAL ANNOUNCEMENT BANNER ─── */
.announcement-banner {
  padding: 12px 20px;
  margin: 16px 24px 0 24px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  animation: slideDown 0.3s ease;
}
.announcement-banner-info {
  background: var(--indigo-bg) !important;
  border-left: 4px solid var(--brand-primary) !important;
  color: #1e1b4b !important;
}
.announcement-banner-warning {
  background: var(--amber-bg) !important;
  border-left: 4px solid var(--brand-warm) !important;
  color: #451a03 !important;
}
.announcement-banner-danger {
  background: var(--red-bg) !important;
  border-left: 4px solid var(--brand-danger) !important;
  color: #450a0a !important;
}
.announcement-banner-success {
  background: var(--teal-bg) !important;
  border-left: 4px solid var(--brand-success) !important;
  color: #064e3b !important;
}

/* ─── SYSTEM MAINTENANCE OVERLAY ─── */
.maintenance-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #f8fafc;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  box-sizing: border-box;
}
.maintenance-card {
  max-width: 440px;
  width: 100%;
  background: #ffffff;
  padding: 40px;
  border-radius: var(--r-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-1);
}
.maintenance-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: pulse 2s infinite;
}
.maintenance-title {
  font-size: 1.48rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
}
.maintenance-desc {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 24px;
}

@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Pricing & FAQ Sections */
.auth-gate {
  scroll-behavior: smooth;
}

.auth-navbar-center {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.auth-nav-link {
  color: var(--text-2);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
  padding: var(--space-2xs) var(--space-xs);
  border-radius: var(--radius-sm);
}

.auth-nav-link:hover {
  color: var(--color-accent-strong);
  background: var(--color-accent-soft);
}

.auth-pricing-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 40px;
  border-top: 1px solid var(--border-1);
}

.pricing-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.pricing-header h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: var(--space-xs);
}

.pricing-header p {
  font-size: var(--text-md);
  color: var(--text-3);
  max-width: 600px;
  margin: 0 auto;
}

/* Billing Toggle Switch */
.billing-toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.billing-label {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-2);
  transition: color var(--dur-fast) var(--ease-out);
}

.billing-label.active {
  color: var(--color-accent-strong);
}

.billing-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.billing-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.billing-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--color-rule);
  transition: .3s;
  border-radius: var(--radius-full);
}

.billing-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.billing-toggle input:checked + .billing-slider {
  background-color: var(--color-accent);
}

.billing-toggle input:checked + .billing-slider:before {
  transform: translateX(24px);
}

.discount-badge {
  background: var(--color-warn);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
}

/* Pricing Cards */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  align-items: stretch;
  margin-bottom: 60px;
}

@media (max-width: 992px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto 60px auto;
  }
}

.pricing-card {
  background: var(--bg-layer1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
  box-shadow: var(--shadow-sm);
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.pricing-card.popular {
  border: 2px solid var(--color-accent);
  box-shadow: 0 10px 30px oklch(47% 0.11 164 / 0.15);
}

.badge-popular {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing-card-header {
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-1);
  padding-bottom: var(--space-md);
}

.pricing-card-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: var(--space-2xs);
}

.pricing-card-desc {
  font-size: var(--text-sm);
  color: var(--text-3);
  min-height: 40px;
}

.pricing-price-wrap {
  margin: var(--space-md) 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.pricing-currency {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-1);
}

.pricing-amount {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -1px;
}

.pricing-period {
  font-size: var(--text-sm);
  color: var(--text-3);
}

.pricing-features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-xl) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex-grow: 1;
}

.pricing-feature-item {
  display: flex;
  align-items: start;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--text-2);
  line-height: 1.4;
}

.pricing-feature-icon {
  flex-shrink: 0;
  font-weight: 700;
}

.pricing-feature-icon.included {
  color: var(--color-success);
}

.pricing-feature-icon.excluded {
  color: var(--color-muted);
}

.pricing-feature-item.muted {
  color: var(--color-muted);
}

.pricing-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--text-sm);
  text-align: center;
  border: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.pricing-btn-free {
  background: var(--color-paper-soft);
  color: var(--text-1);
  border: 1px solid var(--border-1);
}

.pricing-btn-free:hover {
  background: var(--color-rule);
}

.pricing-btn-pro {
  background: var(--color-accent);
  color: #fff;
}

.pricing-btn-pro:hover {
  background: var(--color-accent-strong);
}

.pricing-btn-enterprise {
  background: #0f172a;
  color: #fff;
}

.pricing-btn-enterprise:hover {
  background: #1e293b;
}

/* FAQ Section */
.faq-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 60px 40px 40px 40px;
  border-top: 1px solid var(--border-1);
}

.faq-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.faq-header h3 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-1);
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 768px) {
  .faq-grid {
    grid-template-columns: 1fr;
  }
}

.faq-item {
  background: var(--bg-layer1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.faq-item h4 {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: var(--space-2xs);
  display: flex;
  gap: 8px;
}

.faq-item p {
  font-size: var(--text-sm);
  color: var(--text-2);
  line-height: 1.5;
}

/* Features Detailed Section */
.auth-features-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 40px;
  border-top: 1px solid var(--border-1);
}

.features-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.features-header h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: var(--space-xs);
  letter-spacing: -0.5px;
}

.features-header p {
  font-size: var(--text-md);
  color: var(--text-3);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 1200px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

.feature-detail-card {
  background: var(--bg-layer1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.feature-detail-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent-soft);
}

.feature-detail-icon {
  font-size: 2.2rem;
  margin-bottom: 4px;
  display: inline-block;
}

.feature-detail-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-1);
}

.feature-detail-card p {
  font-size: var(--text-sm);
  color: var(--text-2);
  line-height: 1.5;
}
