/* ═══════════════════════════════════════════════════════════════════
   TutorBirdKiller — Admin UI Styles
   Dark theme, teal accent, Inter font
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg: #0e0e12;
  --bg-sidebar: #12121a;
  --bg-card: #18182222;
  --bg-card-hover: #1e1e28;
  --bg-input: #14141c;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --text: #e8e6f0;
  --text-dim: rgba(232,230,240,0.62);
  --text-muted: rgba(232,230,240,0.30);
  --teal: #2a8f8f;
  --teal-bright: #35b0b0;
  --teal-soft: rgba(42,143,143,0.12);
  --teal-glow: rgba(42,143,143,0.25);
  --red: #e05555;
  --red-soft: rgba(224,85,85,0.12);
  --green: #3dba6d;
  --green-soft: rgba(61,186,109,0.12);
  --amber: #d4a030;
  --amber-soft: rgba(212,160,48,0.12);
  --purple: #8b6dd7;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
  --transition: 0.25s ease;
  --sidebar-width: 240px;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.6; -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

::selection { background: var(--teal); color: #fff; }
a { color: var(--teal-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── LOGIN ─── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg) 0%, #0a1a1a 100%);
  padding: 2rem;
}
.login-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 3rem 2.5rem;
  width: 100%; max-width: 400px; text-align: center;
}
.login-logo {
  font-size: 1.8rem; font-weight: 800; margin-bottom: 0.3rem;
  background: linear-gradient(135deg, var(--teal), var(--teal-bright));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-sub { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 2rem; }
.login-error { color: var(--red); font-size: 0.82rem; margin-bottom: 1rem; display: none; font-weight: 600; }
.login-error.show { display: block; }

/* ─── FORMS ─── */
.form-group { margin-bottom: 1.2rem; text-align: left; }
.form-group label {
  display: block; font-size: 0.7rem; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 0.4rem;
}
.form-input {
  width: 100%; padding: 0.75rem 0.9rem;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-family: inherit; font-size: 0.9rem;
  outline: none; transition: var(--transition);
}
.form-input:focus { border-color: var(--teal); }
.form-input::placeholder { color: var(--text-muted); }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 100px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem; border-radius: 8px;
  font-family: inherit; font-size: 0.85rem; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: var(--transition); text-decoration: none;
}
.btn-primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-primary:hover { background: var(--teal-bright); border-color: var(--teal-bright); text-decoration: none; }
.btn-secondary { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-card-hover); text-decoration: none; }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: rgba(224,85,85,0.2); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-dim); border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--bg-card); }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.78rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── APP SHELL ─── */
.app { display: none; }
.app.active { display: block; min-height: 100vh; }

/* Sidebar */
.sidebar {
  background: var(--bg-sidebar); border-right: 1px solid var(--border);
  padding: 1.5rem 0; display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width);
  z-index: 100; overflow-y: auto;
}
.sidebar-brand {
  padding: 0 1.5rem 1.5rem; border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.sidebar-brand h1 {
  font-size: 1.15rem; font-weight: 800;
  background: linear-gradient(135deg, var(--teal), var(--teal-bright));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar-brand .tenant-name { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }

.sidebar-nav { flex: 1; }
.nav-section { padding: 0.6rem 1.2rem 0.3rem; font-size: 0.62rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); }
.nav-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 1.5rem; margin: 0.1rem 0.5rem;
  border-radius: 8px; cursor: pointer;
  color: var(--text-dim); font-size: 0.88rem; font-weight: 500;
  transition: var(--transition);
}
.nav-item:hover { background: var(--bg-card); color: var(--text); }
.nav-item.active { background: var(--teal-soft); color: var(--teal-bright); }
.nav-item .icon { width: 18px; text-align: center; font-size: 0.95rem; }
.nav-item .badge {
  margin-left: auto; background: var(--teal-soft); color: var(--teal-bright);
  font-size: 0.68rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 50px;
}

.sidebar-footer {
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  margin-top: auto;
}
.sidebar-user { font-size: 0.82rem; color: var(--text-dim); }
.sidebar-user .name { color: var(--text); font-weight: 600; }
.sidebar-logout {
  font-size: 0.75rem; color: var(--text-muted); cursor: pointer;
  margin-top: 0.4rem; transition: var(--transition);
}
.sidebar-logout:hover { color: var(--red); }

/* Main content */
.main {
  margin-left: var(--sidebar-width); padding: 2rem 2.5rem;
  min-height: 100vh; overflow-y: auto;
}
.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.page-header h2 { font-size: 1.5rem; font-weight: 800; }
.page-header .actions { display: flex; gap: 0.6rem; }

/* ─── CARDS ─── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  transition: var(--transition);
}
.card:hover { border-color: var(--border-hover); }
.card-title { font-size: 0.68rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1rem; }

/* ─── STAT CARDS ─── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.4rem; }
.stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; color: var(--teal-bright); }
.stat-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.4rem; letter-spacing: 0.5px; text-transform: uppercase; }

/* ─── TABLES ─── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 0.7rem 1rem; text-align: left;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 0.8rem 1rem; border-bottom: 1px solid var(--border);
  font-size: 0.88rem; color: var(--text-dim);
}
tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--bg-card); }
tbody tr:hover td { color: var(--text); }

/* ─── STATUS BADGES ─── */
.badge {
  display: inline-block; padding: 0.2rem 0.6rem;
  border-radius: 50px; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.5px;
}
.badge-active { background: var(--green-soft); color: var(--green); }
.badge-trial { background: var(--amber-soft); color: var(--amber); }
.badge-paused { background: var(--red-soft); color: var(--red); }
.badge-archived { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.badge-scheduled { background: var(--teal-soft); color: var(--teal-bright); }
.badge-completed { background: var(--green-soft); color: var(--green); }
.badge-cancelled { background: var(--red-soft); color: var(--red); }
.badge-draft { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.badge-sent { background: var(--amber-soft); color: var(--amber); }
.badge-paid { background: var(--green-soft); color: var(--green); }
.badge-overdue { background: var(--red-soft); color: var(--red); }
.badge-enquiry { background: var(--purple); color: #fff; background: rgba(139,109,215,0.15); color: var(--purple); }

/* ─── MODALS ─── */
.modal-bg {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 2rem; overflow-y: auto;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 600px;
  margin: auto; position: relative;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: none; border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { border-color: var(--red); color: var(--red); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 0.6rem;
}

/* ─── TODAY'S LESSONS LIST ─── */
.lesson-list { list-style: none; }
.lesson-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.8rem 0; border-bottom: 1px solid var(--border);
}
.lesson-item:last-child { border-bottom: none; }
.lesson-time {
  font-size: 0.85rem; font-weight: 700; color: var(--teal-bright);
  min-width: 100px;
}
.lesson-info { flex: 1; }
.lesson-info .student { font-weight: 600; color: var(--text); }
.lesson-info .subject { font-size: 0.8rem; color: var(--text-muted); }
.lesson-actions { display: flex; gap: 0.4rem; }

/* ─── ATTENDANCE BUTTONS ─── */
.att-btn {
  padding: 0.3rem 0.7rem; border-radius: 6px; border: 1px solid var(--border);
  background: none; color: var(--text-dim); cursor: pointer;
  font-size: 0.72rem; font-weight: 600; transition: var(--transition);
}
.att-btn:hover { border-color: var(--teal); color: var(--teal-bright); }
.att-btn.attended { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.att-btn.absent { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.att-btn.late { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }

/* ─── SEARCH / FILTER BAR ─── */
.filter-bar {
  display: flex; gap: 0.8rem; margin-bottom: 1.5rem; flex-wrap: wrap;
  align-items: center;
}
.search-input {
  flex: 1; min-width: 200px;
  padding: 0.6rem 1rem; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: inherit; font-size: 0.88rem;
  outline: none; transition: var(--transition);
}
.search-input:focus { border-color: var(--teal); }
.search-input::placeholder { color: var(--text-muted); }
.filter-select {
  padding: 0.6rem 0.9rem; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: inherit; font-size: 0.85rem;
  cursor: pointer; outline: none;
}

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center; padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; }
.empty-state p { font-size: 0.95rem; margin-bottom: 1.5rem; }

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 9999;
  padding: 0.8rem 1.5rem; border-radius: 10px;
  font-size: 0.85rem; font-weight: 600;
  background: var(--teal); color: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px); opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--red); }

/* ─── RESPONSIVE ─── */
/* Prevent horizontal overflow globally */
html, body { overflow-x: hidden; max-width: 100%; }
* { max-width: 100%; }
img, video, canvas, svg { max-width: 100%; height: auto; }
.table-wrap, .page, .card { min-width: 0; }
table { max-width: 100%; }
input, select, textarea { max-width: 100%; box-sizing: border-box; }

@media (max-width: 900px) {
  .app.active { display: block; }
  .sidebar {
    transform: translateX(-100%); transition: transform 0.3s ease;
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); }
  /* Dim backdrop when menu open */
  .sidebar.open::after {
    content: ''; position: fixed; inset: 0; left: 260px;
    background: rgba(0,0,0,0.5); z-index: -1;
  }
  .main { margin-left: 0; padding: 1rem; padding-top: 4rem; }
  /* Hamburger moved to the RIGHT so it doesn't sit on header text */
  .mobile-menu-btn {
    display: flex !important; position: fixed; top: 0.75rem; right: 0.75rem; z-index: 99;
    width: 42px; height: 42px; border-radius: 10px;
    background: var(--bg-card); border: 1px solid var(--border);
    align-items: center; justify-content: center; cursor: pointer;
    color: var(--text); font-size: 1.3rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  /* Header spacing on mobile — give it room to breathe, no overlap */
  .page-header {
    margin-bottom: 1.25rem;
    padding-right: 3.5rem; /* clears the 42px hamburger */
  }
  .page-header h2 { font-size: 1.25rem; }
  .page-header .actions { width: 100%; flex-wrap: wrap; padding-right: 0; }
  .page-header .actions .btn { flex: 1 1 auto; min-width: 0; }

  /* Cards tighter */
  .card { padding: 1rem; border-radius: 10px; }

  /* Stats 2-across instead of 1 */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
  .stat-card { padding: 0.85rem 0.9rem; }
  .stat-value { font-size: 1.35rem; }
  .stat-label { font-size: 0.62rem; }

  /* Dashboard 3-col grid stacks on mobile */
  .dash-grid { grid-template-columns: 1fr; gap: 1rem; }

  /* All tables become horizontally scrollable, never push page wider */
  .page table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  /* Filter bar wraps */
  .filter-bar { flex-wrap: wrap; gap: 0.5rem; }
  .filter-bar .search-input, .filter-bar .filter-select { flex: 1 1 100%; }

  /* Forms — single column */
  .form-row { grid-template-columns: 1fr !important; gap: 0.6rem; }

  /* Modal — full-width with safe margins */
  .modal { width: calc(100vw - 1.5rem); max-width: 100%; margin: 1rem auto; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header h2 { font-size: 1.15rem; }
  .page-header .actions .btn { font-size: 0.82rem; padding: 0.45rem 0.7rem; }
  .card-title { font-size: 0.62rem; margin-bottom: 0.75rem; }
}

@media (min-width: 901px) {
  .mobile-menu-btn { display: none !important; }
}

/* Dashboard polish */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.dash-grid .card { margin-bottom: 0; }
.week-day { margin-bottom: 0.75rem; }
.week-day-label { font-weight: 600; font-size: 0.85rem; color: var(--text); margin-bottom: 0.25rem; padding-bottom: 0.25rem; border-bottom: 1px solid var(--border); }
.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.5rem; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.mini-list li:last-child { border-bottom: none; }
.mini-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.82rem; min-width: 3.2rem; }
.mini-main { font-weight: 500; color: var(--text); }
.mini-amt { font-weight: 600; color: var(--green, #4caf50); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: 0.82rem; }

/* Integrations */
.int-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.int-row:last-child { border-bottom: none; }
.int-icon { font-size: 1.8rem; text-align: center; }
.int-name { font-weight: 600; color: var(--text); font-size: 0.95rem; }
.int-desc { color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }
.int-right { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.int-status { font-size: 0.78rem; color: var(--muted); padding: 0.2rem 0.6rem; border-radius: 999px; background: rgba(148,163,184,0.15); }
.int-status.ok { background: rgba(46,160,67,0.2); color: #4ade80; }
.int-status.off { background: rgba(248,113,113,0.15); color: #f87171; }
@media (max-width: 600px) {
  .int-row { grid-template-columns: 36px 1fr; }
  .int-right { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Calendar drag drop */
.drop-hover { background: rgba(42,143,143,0.18) !important; outline: 2px dashed var(--teal-bright); outline-offset: -4px; }
[draggable="true"]:active { cursor: grabbing !important; }

/* ─── Time-grid calendar ─── */
.cal-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  grid-template-rows: 56px 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  user-select: none;
}
.cal-corner { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-card); }
.cal-dayhead {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 0.5rem 0.25rem;
  background: var(--bg-card);
}
.cal-dayhead.today { background: var(--teal-soft); }
.cal-dayhead .cal-wd { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.cal-dayhead .cal-dn { font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.cal-dayhead.today .cal-dn { color: var(--teal-bright); }

.cal-times {
  border-right: 1px solid var(--border);
  background: var(--bg-card);
  display: flex; flex-direction: column;
}
.cal-hour {
  height: 60px;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 2px 6px 0 6px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.cal-hour:last-child { border-bottom: none; }

.cal-daycol {
  border-right: 1px solid var(--border);
  position: relative;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 59px,
      var(--border) 59px,
      var(--border) 60px
    );
  cursor: crosshair;
  touch-action: none;
}
.cal-daycol:last-child { border-right: none; }
.cal-daycol.today { background:
  repeating-linear-gradient(
    to bottom,
    rgba(42,143,143,0.04) 0,
    rgba(42,143,143,0.04) 59px,
    var(--border) 59px,
    var(--border) 60px
  );
}

.cal-lesson {
  position: absolute;
  left: 4px; right: 4px;
  border-radius: 6px;
  padding: 4px 6px;
  border-left: 3px solid var(--teal);
  font-size: 0.72rem;
  cursor: grab;
  overflow: hidden;
  touch-action: none;
  transition: box-shadow 0.15s;
  z-index: 1;
}
.cal-lesson:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.25); z-index: 2; }
.cal-lesson .cal-l-time { font-weight: 700; color: var(--text); font-size: 0.7rem; }
.cal-lesson .cal-l-name { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-lesson .cal-l-sub { color: var(--text-muted); font-size: 0.66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 720px) {
  .cal-grid { grid-template-columns: 36px repeat(7, minmax(60px, 1fr)); overflow-x: auto; }
  .cal-hour { font-size: 0.62rem; padding: 2px 3px 0 3px; }
  .cal-dayhead .cal-dn { font-size: 1rem; }
  .cal-lesson .cal-l-name { font-size: 0.68rem; }
  .cal-lesson .cal-l-sub { display: none; }
}

/* ─── Light theme overrides for admin ─── */
[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f1f5;
  --bg-input: #ffffff;
  --border: rgba(0,0,0,0.08);
  --border-hover: rgba(0,0,0,0.16);
  --text: #1a1d24;
  --text-dim: rgba(26,29,36,0.65);
  --text-muted: rgba(26,29,36,0.40);
  --shadow: 0 1px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
}
[data-theme="light"] .login-page {
  background: linear-gradient(135deg, #f6f7fb 0%, #e6f2f2 100%);
}
[data-theme="light"] .login-logo {
  -webkit-text-fill-color: initial; background: none;
  color: var(--teal);
}
[data-theme="light"] .sidebar-brand h1 {
  -webkit-text-fill-color: initial; background: none;
  color: var(--teal);
}
[data-theme="light"] .nav-item.active { background: var(--teal-soft); color: var(--teal); }

/* Theme toggle button */
.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 999px;
  padding: 0.25rem 0.6rem; cursor: pointer; color: var(--text-dim);
  font-size: 0.78rem; display: inline-flex; align-items: center; gap: 0.35rem;
  transition: var(--transition);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-hover); background: var(--bg-card); }

/* ─── Collapsable sidebar groups ─── */
.nav-group { margin-bottom: 0.25rem; }
.nav-group .nav-section {
  cursor: pointer; user-select: none;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1.5rem 0.4rem;
  transition: color 0.15s;
}
.nav-group .nav-section:hover { color: var(--text-dim); }
.nav-chevron {
  display: inline-block; font-size: 0.95rem;
  transition: transform 0.2s ease;
  transform: rotate(90deg);
  color: var(--text-muted);
  font-weight: 400;
}
.nav-group.collapsed .nav-chevron { transform: rotate(0deg); }
.nav-items {
  overflow: hidden;
  max-height: 1000px;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  opacity: 1;
}
.nav-group.collapsed .nav-items { max-height: 0; opacity: 0; }

/* ─── Sidebar text contrast bumps ─── */
.sidebar .nav-section { color: rgba(232,230,240,0.75); font-size: 0.7rem; font-weight: 700; }
.sidebar .nav-item { color: rgba(232,230,240,0.85); }
.sidebar .nav-item:hover { color: #fff; }
.sidebar .nav-chevron { color: rgba(232,230,240,0.55); }

[data-theme="light"] .sidebar .nav-section { color: rgba(26,29,36,0.75); }
[data-theme="light"] .sidebar .nav-item { color: rgba(26,29,36,0.85); }
[data-theme="light"] .sidebar .nav-item:hover { color: #000; }
[data-theme="light"] .sidebar .nav-chevron { color: rgba(26,29,36,0.55); }

/* ─── Quick-action toolbar ─── */
.quickbar {
  display: flex; gap: 0.4rem; align-items: center;
  padding: 0.6rem 0.25rem 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  flex-wrap: wrap;
}
.qb-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.85rem; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all 0.15s; text-decoration: none;
  position: relative;
}
.qb-btn:hover { border-color: var(--teal); background: var(--bg-card-hover); text-decoration: none; }
.qb-icon { font-size: 1rem; line-height: 1; }
.qb-label { color: var(--text); }
.qb-badge {
  background: var(--red); color: #fff;
  font-size: 0.65rem; font-weight: 700; padding: 0.1rem 0.4rem;
  border-radius: 50px; min-width: 1rem; text-align: center;
}
.qb-wrap { position: relative; }
.qb-menu {
  display: none; position: absolute; top: 100%; left: 0; margin-top: 0.4rem;
  background: var(--bg-sidebar); border: 1px solid var(--border-hover); border-radius: 10px;
  padding: 0.4rem; min-width: 220px; z-index: 50;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
[data-theme="light"] .qb-menu { background: #ffffff; box-shadow: 0 12px 32px rgba(0,0,0,0.15); }
.qb-menu.open { display: block; }
.qb-menu a {
  display: block; padding: 0.55rem 0.75rem; border-radius: 6px;
  color: var(--text); cursor: pointer; font-size: 0.88rem;
  text-decoration: none;
}
.qb-menu a:hover { background: var(--teal-soft); color: var(--teal-bright); text-decoration: none; }
@media (max-width: 600px) {
  .quickbar { gap: 0.3rem; }
  .qb-label { display: none; }
  .qb-btn { padding: 0.55rem 0.7rem; }
}
