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

/* ══════════════════════════════════════════
   DESIGN TOKENS
══════════════════════════════════════════ */
:root {
  color-scheme: light;

  /* Surfaces */
  --bg:          #F1F5F9;
  --surface:     #FFFFFF;
  --surface-2:   #F8FAFC;
  --surface-3:   #F1F5F9;

  /* Sidebar */
  --sidebar-bg:     #0F172A;
  --sidebar-ring:   rgba(255,255,255,0.06);
  --nav-text:       #94A3B8;
  --nav-hover-text: #CBD5E1;
  --nav-hover-bg:   rgba(255,255,255,0.06);
  --nav-active-text:#FFFFFF;
  --nav-active-bg:  rgba(99,102,241,0.18);
  --nav-active-bar: #6366F1;

  /* Text */
  --text:    #0F172A;
  --text-2:  #1E293B;
  --muted:   #64748B;
  --faint:   #94A3B8;

  /* Borders */
  --border:   #E2E8F0;
  --border-2: #CBD5E1;

  /* Primary — Indigo */
  --primary:        #6366F1;
  --primary-dark:   #4F46E5;
  --primary-light:  #EEF2FF;
  --primary-border: #C7D2FE;
  --primary-ring:   rgba(99,102,241,0.22);

  /* Status */
  --green:        #16A34A;
  --green-bg:     #F0FDF4;
  --green-border: #BBF7D0;
  --amber:        #D97706;
  --amber-bg:     #FFFBEB;
  --amber-border: #FDE68A;
  --red:          #DC2626;
  --red-bg:       #FEF2F2;
  --red-border:   #FECACA;
  --blue:         #2563EB;
  --blue-bg:      #EFF6FF;
  --blue-border:  #BFDBFE;
  --purple:       #7C3AED;
  --purple-bg:    #F5F3FF;
  --purple-border:#DDD6FE;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.05);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 4px 12px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 20px rgba(15,23,42,0.08), 0 1px 3px rgba(15,23,42,0.06);
  --shadow-lg: 0 12px 48px rgba(15,23,42,0.12), 0 4px 16px rgba(15,23,42,0.06);

  /* Radii */
  --r-sm:  6px;
  --r:     10px;
  --r-lg:  14px;
  --r-xl:  20px;
  --r-2xl: 28px;

  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv02","cv03","cv04","cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ══════════════════════════════════════════
   RESET
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }

/* ══════════════════════════════════════════
   BODY — PORTAL LAYOUT
══════════════════════════════════════════ */
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.login-body { display: block; }

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--nav-text);
  min-height: 100vh;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 20px 12px 24px;
  gap: 6px;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 20px;
  border-bottom: 1px solid var(--sidebar-ring);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #818CF8, #6366F1);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99,102,241,0.45);
}

.brand strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #F1F5F9;
  letter-spacing: -0.01em;
}

.brand small {
  display: block;
  font-size: 11px;
  color: var(--nav-text);
  margin-top: 1px;
  font-weight: 400;
}

/* Nav */
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: var(--nav-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 140ms ease, color 140ms ease;
  position: relative;
  border: 1px solid transparent;
}

.nav a svg { flex-shrink: 0; opacity: 0.8; }

.nav a:hover {
  background: var(--nav-hover-bg);
  color: var(--nav-hover-text);
}
.nav a:hover svg { opacity: 1; }

.nav a.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
  font-weight: 600;
}
.nav a.active svg { opacity: 1; }
.nav a.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--nav-active-bar);
}

/* Sidebar divider */
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #475569;
  padding: 14px 10px 6px;
}

/* Sidebar bottom area */
.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--sidebar-ring);
}

/* ══════════════════════════════════════════
   APP SHELL & TOPBAR
══════════════════════════════════════════ */
.app-shell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin: 0 0 2px;
}

h1 {
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
}

h2 { font-size: 1rem; font-weight: 600; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   CONTENT WRAPPER
══════════════════════════════════════════ */
.content-area {
  padding: 28px 32px 48px;
  flex: 1;
}

/* Views */
.view { display: none; }
.view.active { display: block; }

/* ══════════════════════════════════════════
   STATUS PILLS & BADGES
══════════════════════════════════════════ */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
}

#user-status {
  color: var(--primary);
  border-color: var(--primary-border);
  background: var(--primary-light);
  font-weight: 600;
}

.status-pill.live {
  color: var(--green);
  border-color: var(--green-border);
  background: var(--green-bg);
}
.status-pill.mock {
  color: var(--amber);
  border-color: var(--amber-border);
  background: var(--amber-bg);
}

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  background: var(--primary);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 3px rgba(99,102,241,0.3), 0 4px 10px rgba(99,102,241,0.15);
  transition: background 140ms ease, transform 130ms ease, box-shadow 140ms ease;
  white-space: nowrap;
  cursor: pointer;
}
.primary-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(99,102,241,0.35), 0 6px 16px rgba(99,102,241,0.2);
}
.primary-button:active { transform: translateY(0); }

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
  transition: background 140ms, border-color 140ms, color 140ms;
  cursor: pointer;
  white-space: nowrap;
}
.ghost-button:hover { background: var(--surface-2); border-color: var(--border-2); color: var(--text); }

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  background: none;
  color: var(--primary);
  border: none;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  transition: background 140ms;
  cursor: pointer;
}
.text-button:hover { background: var(--primary-light); }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 1.1rem;
  box-shadow: var(--shadow-xs);
  transition: background 140ms, border-color 140ms, color 140ms;
  cursor: pointer;
}
.icon-button:hover { background: var(--surface-2); color: var(--text); }

/* ══════════════════════════════════════════
   SETUP ALERT
══════════════════════════════════════════ */
.setup-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-left: 4px solid var(--amber);
  border-radius: var(--r);
  padding: 14px 18px;
  margin-bottom: 24px;
}
.setup-alert[hidden] { display: none; }
.setup-alert p, .config-callout p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  margin-top: 4px;
}

/* ══════════════════════════════════════════
   METRICS GRID
══════════════════════════════════════════ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.metric:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.metric::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.metric:nth-child(1)::after { background: linear-gradient(90deg, var(--blue), #60A5FA); }
.metric:nth-child(2)::after { background: linear-gradient(90deg, var(--amber), #FCD34D); }
.metric:nth-child(3)::after { background: linear-gradient(90deg, var(--purple), #A78BFA); }
.metric:nth-child(4)::after { background: linear-gradient(90deg, var(--green), #4ADE80); }

.metric span {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 2.2rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}

/* ══════════════════════════════════════════
   SECTION BAND
══════════════════════════════════════════ */
.section-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

/* ══════════════════════════════════════════
   PANEL / CARD
══════════════════════════════════════════ */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.action-panel {
  background: var(--surface-2);
  box-shadow: none;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.action-row { margin-bottom: 16px; }

/* ══════════════════════════════════════════
   STACK LIST ITEMS
══════════════════════════════════════════ */
.stack-list { display: grid; gap: 8px; }

.item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--r);
  padding: 12px 14px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 150ms, transform 150ms;
}
.item:hover { box-shadow: var(--shadow-sm); transform: translateX(2px); }

.item[data-todo-draggable="1"],
.calendar-chip[draggable="true"] { cursor: grab; }
.item.is-dragging,
.calendar-chip.is-dragging { opacity: 0.5; cursor: grabbing; }

.item.lesson    { border-left-color: var(--blue); }
.item.reminder  { border-left-color: var(--amber); }
.item.cancelled { border-left-color: var(--faint); opacity: 0.65; }

.item h3 {
  font-size: 13.5px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text-2);
}
.item p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms, border-color 140ms;
}
.mini-button:hover { background: var(--primary-light); border-color: var(--primary-border); }
.mini-button-dev {
  background: #fff9e6;
  border-color: #e6d59a;
  color: #8a6d1f;
}
.mini-button-dev:hover {
  background: #fff4cc;
  border-color: #d8be73;
}
.mini-button:disabled {
  opacity: 0.5;
  color: var(--faint);
  border-color: var(--border);
  background: var(--surface-3);
  cursor: not-allowed;
}
.mini-button-dev:disabled {
  opacity: 0.75;
  background: #fff9e6;
  border-color: #e6d59a;
  color: #b19a56;
}

.status-btn-active {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary-dark);
}

.recruit-status-btn {
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.recruit-status-invited {
  border-color: #fca5a5;
  color: #991b1b;
  background: #fff1f2;
}

.recruit-status-interviewed {
  border-color: #facc15;
  color: #111827;
  background: #fef9c3;
}

.recruit-status-selected {
  border-color: #c4b5fd;
  color: #5b21b6;
  background: #f5f3ff;
}

.recruit-status-btn.status-btn-active {
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.18);
  transform: translateY(-1px);
}

.recruit-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recruit-tag-filter {
  display: inline-flex;
  gap: 6px;
}

.recruit-tag-filter .mini-button.active {
  background: var(--primary-light);
  border-color: var(--primary-border);
}

.recruit-track-stem {
  border-color: var(--blue-border);
  color: var(--blue);
  background: var(--blue-bg);
}

.recruit-track-tutor {
  border-color: var(--amber-border);
  color: var(--amber);
  background: var(--amber-bg);
}

.recruit-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

.recruit-chip.stem {
  color: var(--blue);
  border-color: var(--blue-border);
  background: var(--blue-bg);
}

.recruit-chip.tutor {
  color: var(--amber);
  border-color: var(--amber-border);
  background: var(--amber-bg);
}

/* ══════════════════════════════════════════
   FORMS
══════════════════════════════════════════ */
.quick-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.record-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.record-form input,
.record-form select,
.quick-form input,
.quick-form select {
  height: 36px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  min-width: 0;
  transition: border-color 150ms, box-shadow 150ms;
}

.record-form input:focus,
.record-form select:focus,
.quick-form input:focus,
.quick-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.record-form .primary-button { width: 100%; }

.helper-text {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 10px 0 0;
}

/* ══════════════════════════════════════════
   CALENDAR
══════════════════════════════════════════ */
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays {
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.calendar-weekdays span { padding: 0 6px; }

.day {
  min-height: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 4px;
  transition: border-color 140ms, background 140ms;
}
.day:hover { border-color: var(--border-2); }

.day.outside {
  background: var(--bg);
  border-color: transparent;
}
.day.outside .day-number { color: var(--faint); }

.day-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}

.calendar-chip {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 4px;
  padding: 3px 7px;
  background: var(--purple-bg);
  color: var(--purple);
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--purple-border);
}
.calendar-chip.reminder {
  background: var(--amber-bg);
  color: var(--amber);
  border-color: var(--amber-border);
}
.calendar-chip.cancelled {
  background: var(--surface-2);
  color: var(--faint);
  border-color: var(--border);
  text-decoration: line-through;
}

.day.drop-target {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: inset 0 0 0 1px var(--primary-ring);
}

/* ══════════════════════════════════════════
   TODO BOARD
══════════════════════════════════════════ */
.todo-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.todo-column {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  min-height: 240px;
  transition: border-color 140ms, background 140ms;
}

.todo-column h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.todo-column.drop-target {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ══════════════════════════════════════════
   SETTINGS
══════════════════════════════════════════ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.config-callout {
  border: 1px solid var(--amber-border);
  border-radius: var(--r);
  background: var(--amber-bg);
  margin-bottom: 16px;
  padding: 14px 16px;
}
.config-callout.success {
  border-color: var(--primary-border);
  background: var(--primary-light);
}
.config-callout h3 { font-size: 14px; font-weight: 700; color: var(--text-2); }

.settings-grid div {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  background: var(--surface);
}
.settings-grid strong { display: block; font-size: 14px; font-weight: 600; margin-top: 5px; }
.settings-grid span   { display: block; font-size: 12.5px; color: var(--muted); }

/* ══════════════════════════════════════════
   STUDENTS MANAGER
══════════════════════════════════════════ */
.students-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.students-toolbar input,
.students-toolbar select {
  height: 36px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  min-width: 0;
}

.students-toolbar input:focus,
.students-toolbar select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.students-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.metric-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px;
  box-shadow: var(--shadow-xs);
}

.metric-mini span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.metric-mini strong {
  display: block;
  margin-top: 6px;
  font-size: 1.4rem;
  line-height: 1;
  font-weight: 800;
  color: var(--text);
}

/* ══════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════ */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 24px;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(99,102,241,0.07) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(99,102,241,0.05) 0%, transparent 40%);
}

.login-layout {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* Left panel — dark */
.login-aside {
  background: var(--sidebar-bg);
  padding: 52px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

/* Subtle grid pattern */
.login-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Glow blob */
.login-aside::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.25) 0%, transparent 70%);
  pointer-events: none;
}

.login-aside-top { position: relative; z-index: 1; }

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
}

.login-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #818CF8, #6366F1);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,0.45);
}

.login-logo-text strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #F1F5F9;
  letter-spacing: -0.01em;
}
.login-logo-text span {
  display: block;
  font-size: 12px;
  color: #64748B;
  margin-top: 1px;
}

.login-aside h1 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #F8FAFC;
  margin-bottom: 14px;
}

.login-copy {
  font-size: 14px;
  color: #94A3B8;
  line-height: 1.65;
}

.login-points {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 10px;
}

.login-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: #94A3B8;
  line-height: 1.5;
}

.login-points li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6366F1;
  flex-shrink: 0;
  margin-top: 7px;
}

.login-aside-bottom {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: #475569;
}

/* Right panel — white form */
.login-card {
  background: var(--surface);
  padding: 52px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card .eyebrow { margin-bottom: 6px; }

.login-card h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 6px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.login-form label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.login-form input {
  height: 44px;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 0 14px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14.5px;
  transition: border-color 150ms, box-shadow 150ms, background 150ms;
}
.login-form input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.login-error {
  font-size: 13px;
  color: var(--red);
  font-weight: 500;
}

.login-form .primary-button {
  height: 44px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: var(--r);
  box-shadow: 0 2px 8px rgba(99,102,241,0.3), 0 8px 20px rgba(99,102,241,0.15);
}

.report-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}
.report-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ══════════════════════════════════════════
   RESPONSIVE — TABLET
══════════════════════════════════════════ */
@media (max-width: 1024px) {
  body { grid-template-columns: 1fr; }

  .sidebar {
    min-height: auto;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 0 16px;
    height: 54px;
    gap: 0;
    overflow-x: auto;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .brand {
    padding: 0 16px 0 0;
    border-bottom: none;
    border-right: 1px solid var(--sidebar-ring);
    margin-bottom: 0;
    margin-right: 8px;
    flex-shrink: 0;
    height: 100%;
    align-items: center;
  }

  .nav {
    flex-direction: row;
    gap: 2px;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }

  .nav a::before { display: none; }

  .nav-section-label,
  .sidebar-footer,
  .brand small { display: none; }

  .topbar { height: 56px; padding: 0 18px; }

  .content-area { padding: 20px 18px 40px; }

  .metrics-grid,
  .split-layout,
  .todo-board,
  .record-form,
  .settings-grid { grid-template-columns: 1fr; }

  .students-toolbar { grid-template-columns: 1fr; }
  .students-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .calendar-grid { gap: 4px; }
  .day { min-height: 80px; padding: 6px; }

  .login-layout { grid-template-columns: 1fr; }
  .login-aside {
    padding: 36px 32px;
    display: block;
  }
  .login-aside::after { display: none; }
  .login-aside h1 { font-size: 1.5rem; }
  .login-points { display: none; }
  .login-aside-bottom { display: none; }
  .login-card { padding: 36px 32px; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE
══════════════════════════════════════════ */
@media (max-width: 640px) {
  .topbar { flex-direction: column; height: auto; padding: 12px 16px; gap: 10px; align-items: flex-start; }
  .topbar-actions { flex-wrap: wrap; }
  .section-band { flex-direction: column; align-items: flex-start; }
  .setup-alert { flex-direction: column; align-items: flex-start; }
  .quick-form { display: grid; grid-template-columns: 1fr; width: 100%; }
  .students-metrics { grid-template-columns: 1fr; }
  .login-shell { padding: 16px; }
  .login-aside, .login-card { padding: 28px 24px; }
}
