/* ==========================================================================
   LIFT Global Academy — shared design system
   One stylesheet, linked from every screen with:
     <link rel="stylesheet" href="lift-style.css">
   No build step — plain CSS, safe to edit directly and re-upload.
   ========================================================================== */

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

:root {
  /* Brand (sampled from the LIFT logo mark) */
  --navy-950: #0f1c2e;
  --navy-900: #16243a;
  --navy-800: #1a2e44;   /* primary brand color, same as the original screens */
  --navy-700: #2c4a68;
  --navy-600: #3d5e80;
  --logo-blue: #1e4a88;
  --brand-green: #00b863; /* deepened slightly from the logo's bright green for contrast */
  --brand-green-light: #e6faf0;

  /* Neutrals */
  --slate-50: #f7f7f5;
  --slate-100: #f1f1ef;
  --slate-200: #e6e7e9;
  --slate-300: #d8dadd;
  --slate-400: #9ca3af;
  --slate-500: #6b7280;
  --slate-600: #4b5563;
  --slate-700: #374151;
  --slate-900: #111827;
  --white: #ffffff;

  /* Status colors */
  --amber-50: #fef3c7;
  --amber-700: #92400e;
  --green-50: #d1fae5;
  --green-700: #065f46;
  --green-600: #15803d;
  --green-600-hover: #14642f;
  --red-50: #fef2f2;
  --red-100: #fecaca;
  --red-700: #991b1b;

  /* Surface */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 10px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.12), 0 4px 10px rgba(15, 23, 42, 0.06);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

  /* Sidebar workspace system */
  --sidebar-width: 236px;
  --sidebar-width-collapsed: 68px;
  --content-bg: #faf9f6;
  --sidebar-text: #c3cedd;
  --sidebar-text-dim: #8aa0bb;
  --sidebar-text-active: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-dot: #00d97e;

  /* Theme-aware surface/text tokens — light values here, overridden below for dark mode.
     Sidebar, buttons, and brand colors stay fixed in both themes; only these flip. */
  --surface-bg: var(--white);
  --page-bg: var(--content-bg);
  --text-primary: var(--navy-900);
  --text-secondary: var(--slate-500);
  --text-label: var(--slate-700);
  --border-color: var(--slate-200);
  --input-border: var(--slate-300);
}

/* ---------- Dark mode ---------- */
html[data-theme="dark"] {
  --surface-bg: #1a222c;
  --page-bg: #0f1720;
  --text-primary: #e5e7eb;
  --text-secondary: #9aa4b2;
  --text-label: #c7ccd3;
  --border-color: #2a333f;
  --input-border: #333e4d;
}
html[data-theme="dark"] body { background: var(--page-bg); color: var(--text-primary); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: var(--page-bg);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Layout ---------- */

.page { min-height: 100vh; display: flex; flex-direction: column; }

.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.wrap--narrow { max-width: 460px; }
.wrap--wide { max-width: 880px; }

/* ---------- Navbar ---------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 20px;
}

.navbar-inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.navbar-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
}

.navbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.navbar-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.2;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.navbar-back {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.navbar-back:hover { color: var(--navy-800); }

/* ---------- Cards ---------- */

.card {
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  margin-bottom: 20px;
}

.card--tight { padding: 22px; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

h1 { font-size: 23px; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0 0 14px; }
h3 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin: 0 0 10px; }

.subtitle, .top-subtitle { font-size: 13px; color: var(--text-secondary); }

.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 30px 0 12px;
}
.section-label:first-child { margin-top: 0; }

.hint { font-size: 12px; color: var(--text-secondary); margin-top: 16px; }

/* ---------- Buttons ---------- */

button, .btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

button:active { transform: translateY(1px); }

button, .btn-primary {
  background: var(--navy-800);
  color: var(--white);
}
button:hover, .btn-primary:hover { background: var(--navy-900); }
button:disabled { background: var(--slate-300); color: var(--slate-500); cursor: not-allowed; transform: none; }

.btn-secondary, button.secondary {
  background: var(--surface-bg);
  color: var(--text-primary);
  border: 1px solid var(--input-border);
}
.btn-secondary:hover, button.secondary:hover { background: var(--page-bg); border-color: var(--navy-800); }

.btn-outline-danger, button.signout, button.logout-btn, button.back {
  background: var(--surface-bg);
  color: var(--text-secondary);
  border: 1px solid var(--input-border);
  font-weight: 500;
  padding: 8px 14px;
  font-size: 13px;
}
.btn-outline-danger:hover, button.signout:hover, button.logout-btn:hover, button.back:hover {
  border-color: var(--red-700);
  color: var(--red-700);
  background: var(--red-50);
}
button.back:hover { border-color: var(--navy-800); color: var(--navy-800); background: var(--page-bg); }

button.approve {
  background: var(--green-600);
  color: var(--white);
}
button.approve:hover { background: var(--green-600-hover); }

button.revise {
  background: var(--red-50);
  color: var(--red-700);
  border: 1px solid var(--red-100);
}
button.revise:hover { background: #fde4e4; }

/* ---------- Forms ---------- */

label {
  display: block;
  font-size: 13px;
  color: var(--text-label);
  font-weight: 600;
  margin: 16px 0 6px;
}
label:first-of-type { margin-top: 0; }

input, select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface-bg);
  color: var(--text-primary);
  transition: border-color .15s ease, box-shadow .15s ease;
}

textarea { resize: vertical; min-height: 90px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy-800);
  box-shadow: 0 0 0 3px rgba(26, 46, 68, 0.12);
}

input::placeholder, textarea::placeholder { color: var(--slate-400); }

input:disabled, select:disabled { background: var(--page-bg); color: var(--slate-400); }

/* ---------- Messages ---------- */

.msg {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: none;
  font-weight: 500;
}
.msg.error { background: var(--red-50); color: var(--red-700); display: block; }
.msg.success { background: var(--green-50); color: var(--green-700); display: block; }

.error { background: var(--red-50); color: var(--red-700); border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13px; margin-bottom: 16px; display: none; }

/* ---------- Tiles ---------- */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

a.tile {
  display: block;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-primary);
  background: var(--surface-bg);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
a.tile:hover { border-color: var(--navy-800); box-shadow: var(--shadow-md); transform: translateY(-2px); }
a.tile .tile-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
a.tile .tile-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
a.tile.coming-soon { opacity: 0.5; cursor: default; pointer-events: none; }

/* ---------- Status pills ---------- */

.status-pill {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.status-draft { background: var(--slate-100); color: var(--slate-600); }
.status-pending_review { background: var(--amber-50); color: var(--amber-700); }
.status-approved { background: var(--green-50); color: var(--green-700); }
.status-revisions_requested { background: var(--red-50); color: var(--red-700); }

/* ---------- Lists / rows ---------- */

.list-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}
.list-item:last-child { border-bottom: none; }
.list-item .meta { color: var(--text-secondary); font-size: 12px; }
.list-item .row1 { display: flex; justify-content: space-between; font-weight: 600; width: 100%; }

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}
.info-row:last-of-type { border-bottom: none; }
.info-label { color: var(--text-secondary); }
.info-value { color: var(--text-primary); font-weight: 600; }

.empty-note { color: var(--text-secondary); font-size: 13px; padding: 10px 0; }

/* ---------- Queue items (evaluator) ---------- */

.queue-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.queue-item:hover { border-color: var(--navy-800); box-shadow: var(--shadow-sm); }
.queue-item .row1 { display: flex; justify-content: space-between; align-items: baseline; }
.queue-item .student-name { font-weight: 700; font-size: 15px; color: var(--text-primary); }
.queue-item .meta { color: var(--text-secondary); font-size: 12px; margin-top: 4px; }

/* ---------- Detail panel ---------- */

.detail-row { margin-bottom: 18px; }
.detail-label { font-size: 11px; color: var(--text-secondary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 5px; }
.detail-value { font-size: 14px; color: var(--text-primary); white-space: pre-wrap; line-height: 1.5; }
.grade-display { font-size: 28px; font-weight: 700; color: var(--text-primary); }

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

/* ---------- Progress bars ---------- */

.overall-bar-wrap { margin-top: 22px; }
.overall-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-label); margin-bottom: 7px; font-weight: 500; }
.bar-track { background: var(--border-color); border-radius: 999px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--navy-800); border-radius: 999px; transition: width .3s ease; }
.bar-fill.complete { background: var(--green-600); }

.req-row { padding: 15px 0; border-bottom: 1px solid var(--border-color); }
.req-row:last-child { border-bottom: none; }
.req-top { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.req-credits { color: var(--text-secondary); font-weight: 400; }
.req-row .bar-track { height: 7px; }
.req-row .bar-fill { background: var(--logo-blue); }
.req-row .bar-fill.complete { background: var(--green-600); }
.req-note { font-size: 11px; color: var(--text-secondary); margin-top: 5px; }

/* ---------- Checkboxes (subject picker) ---------- */

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: border-color .12s ease, background-color .12s ease;
}
.checkbox-item:has(input:checked) { border-color: var(--navy-800); background: var(--page-bg); }
.checkbox-item input { width: auto; margin: 0; accent-color: var(--navy-800); }

.subject-block {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 14px;
  background: var(--page-bg);
}

.subject-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  margin-bottom: 10px;
}
.subject-row label { margin-top: 0; }

/* ---------- Tables ---------- */

.preview-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13px; }
.preview-table th { text-align: left; color: var(--text-secondary); font-weight: 600; padding: 9px 6px; border-bottom: 1px solid var(--border-color); }
.preview-table td { padding: 9px 6px; border-bottom: 1px solid var(--border-color); color: var(--text-primary); }
.preview-table .term-header td { font-weight: 700; color: var(--text-primary); background: var(--page-bg); padding-top: 14px; }
.summary-row td { font-weight: 700; }

/* ---------- Gradebook ---------- */

.gb-cat-name-input, .gb-cat-weight-input { display: inline-block; width: auto; margin: 0 6px 0 0; }
.gb-score-input { text-align: center; }

/* ---------- Help / FAQ accordion ---------- */

.help-section-title { font-size: 15px; font-weight: 700; margin: 28px 0 10px; color: var(--text-primary); }
.help-section-title:first-child { margin-top: 0; }
.help-intro { font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; }

details.help-item {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--surface-bg);
  overflow: hidden;
}
details.help-item summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  list-style: none;
}
details.help-item summary::-webkit-details-marker { display: none; }
details.help-item summary::before { content: "+"; display: inline-block; width: 18px; color: var(--text-secondary); font-weight: 700; }
details.help-item[open] summary::before { content: "\2013"; }
details.help-item .help-body {
  padding: 0 16px 16px 34px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
}
details.help-item .help-body ol, details.help-item .help-body ul { margin: 8px 0; padding-left: 20px; }
details.help-item .help-body li { margin-bottom: 4px; }

/* ---------- Attendance status toggle ---------- */

.att-status-btn {
  background: var(--surface-bg);
  color: var(--text-secondary);
  border: 1px solid var(--input-border);
  font-weight: 600;
  padding: 6px 12px;
  font-size: 12px;
}
.att-status-btn:hover { background: var(--page-bg); }
.att-status-btn.active[data-status="present"] { background: var(--green-50); color: var(--green-700); border-color: var(--green-50); }
.att-status-btn.active[data-status="absent"] { background: var(--red-50); color: var(--red-700); border-color: var(--red-50); }
.att-status-btn.active[data-status="tardy"] { background: var(--amber-50); color: var(--amber-700); border-color: var(--amber-50); }
.att-status-btn.active[data-status="excused"] { background: var(--slate-100); color: var(--slate-600); border-color: var(--slate-100); }

/* ---------- Gate / loading ---------- */

.gate {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}
.gate a { color: var(--navy-800); font-weight: 600; }

.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border-color);
  border-top-color: var(--navy-800);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Misc ---------- */

a { color: var(--navy-800); }
.link-btn {
  display: block;
  padding: 13px 16px;
  margin-bottom: 10px;
  background: var(--page-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background-color .12s ease, border-color .12s ease;
}
a.link-btn:hover { background: var(--surface-bg); border-color: var(--navy-800); }

@media (max-width: 560px) {
  .card { padding: 22px; }
  .navbar-inner { gap: 8px; }
}

/* ==========================================================================
   Sidebar workspace system
   Used on the app screens once signed in (admin, billing, evaluator,
   teacher, transcript, graduation progress, home dashboards). The
   pre-auth screens (index, login, reset password) keep the simple
   centered-card layout above instead.
   ========================================================================== */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: fadeIn .2s ease; }

.workspace {
  display: flex;
  min-height: 100vh;
  background: var(--page-bg);
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--navy-900);
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width .18s ease;
}
.sidebar.collapsed { width: var(--sidebar-width-collapsed); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 22px;
  text-decoration: none;
}
.sidebar.collapsed .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }

.sidebar-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
}

.sidebar-brand-text { line-height: 1.2; white-space: nowrap; overflow: hidden; }
.sidebar.collapsed .sidebar-brand-text { display: none; }
.sidebar-brand-title { font-weight: 800; font-size: 14px; color: #fff; letter-spacing: .01em; }
.sidebar-brand-subtitle { font-size: 11px; color: var(--sidebar-text-dim); }

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  margin-bottom: 2px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sidebar-text);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.sidebar-nav-item:hover { background: var(--sidebar-hover); }
.sidebar.collapsed .sidebar-nav-item { justify-content: center; }

.sidebar-nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sidebar-dot);
  opacity: 0;
  flex-shrink: 0;
}
.sidebar-nav-item.active { color: var(--sidebar-text-active); background: rgba(255, 255, 255, .12); }
.sidebar-nav-item.active .sidebar-nav-dot { opacity: 1; }

.sidebar-nav-label { white-space: nowrap; }
.sidebar.collapsed .sidebar-nav-label { display: none; }

.sidebar-spacer { flex: 1; }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  margin-bottom: 10px;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
}
.theme-toggle:hover { background: var(--sidebar-hover); }
.theme-toggle-label { font-size: 12px; font-weight: 600; color: var(--sidebar-text); }
.sidebar.collapsed .theme-toggle-label { display: none; }
.sidebar.collapsed .theme-toggle { justify-content: center; }
.theme-toggle-switch {
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .15);
  position: relative;
  flex-shrink: 0;
  transition: background .15s ease;
}
.theme-toggle-switch.on { background: #d4af37; }
.theme-toggle-knob {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: left .15s ease;
}
.theme-toggle-switch.on .theme-toggle-knob { left: 18px; }

/* ---------- Per-school branding (teacher sidebar) ---------- */

.sidebar-school-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  margin: 0 0 14px;
  background: rgba(255, 255, 255, .06);
  border-radius: 10px;
  border-left: 3px solid var(--sidebar-dot);
}
.sidebar.collapsed .sidebar-school-badge { display: none; }
.sidebar-school-logo { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: block; }
.sidebar-school-name {
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
  line-height: 1.25;
}
.sidebar-school-label { font-size: 10.5px; font-weight: 700; margin-top: 1px; }

.sidebar-collapse-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
  border: none;
  background: none;
  font-family: inherit;
  width: 100%;
}
.sidebar-collapse-toggle:hover { background: var(--sidebar-hover); }
.sidebar.collapsed .sidebar-collapse-toggle { justify-content: center; }
.sidebar-collapse-toggle .chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--sidebar-text);
  border-bottom: 2px solid var(--sidebar-text);
  transform: rotate(-45deg);
  flex-shrink: 0;
  transition: transform .18s ease;
}
.sidebar.collapsed .sidebar-collapse-toggle .chevron { transform: rotate(135deg); }
.sidebar.collapsed .sidebar-collapse-toggle span { display: none; }

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-top: 14px;
  font-size: 12px;
  color: var(--sidebar-text-dim);
}
.sidebar-footer strong { color: #e8edf3; font-weight: 600; display: block; margin-top: 2px; }
.sidebar.collapsed .sidebar-footer { display: none; }

.workspace-main {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px 40px;
  min-width: 0;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.workspace-header-title { font-size: 22px; font-weight: 800; color: var(--text-primary); letter-spacing: -.01em; }
.workspace-header-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.workspace-header-actions { display: flex; gap: 8px; }
.workspace-header-actions a, .header-link {
  font: 600 13px var(--font-sans);
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--border-color);
  background: var(--surface-bg);
  color: var(--text-label);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.workspace-header-actions a:hover, .header-link:hover { border-color: var(--navy-800); color: var(--navy-800); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px 20px;
}
.stat-card-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.stat-card-value { font-size: 26px; font-weight: 800; color: var(--text-primary); margin-top: 6px; }

.panel {
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 22px;
}
.panel--list { padding: 6px 20px; }

.grid-2 { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }

.pill-toggle-group {
  display: flex;
  gap: 6px;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 4px;
  width: fit-content;
}
.pill-toggle {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text-secondary);
  border: none;
  background: none;
  font-family: inherit;
}
.pill-toggle.active { background: var(--navy-900); color: var(--white); }

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Mobile drawer sidebar ---------- */

.mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  background: var(--surface-bg);
  flex-shrink: 0;
}
.mobile-menu-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  flex-shrink: 0;
}
.mobile-menu-btn span { height: 2px; background: var(--text-primary); border-radius: 1px; display: block; }
.mobile-topbar-logo { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.mobile-topbar-title { font-weight: 800; font-size: 13.5px; color: var(--text-primary); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0);
  z-index: 15;
  pointer-events: none;
  transition: background .2s ease;
}
.sidebar-backdrop.open { background: rgba(15, 23, 42, .4); pointer-events: auto; }

@media (max-width: 680px) {
  .mobile-topbar { display: flex; }
  .sidebar-backdrop { display: block; }
  .workspace { flex-direction: column; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 20;
    box-shadow: none;
    transform: translateX(-100%);
    transition: transform .22s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-collapse-toggle { display: none; }
  .workspace-main { padding: 24px 18px 32px; }
  .stat-grid { grid-template-columns: 1fr; }
}
