/* ── Reset & base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #0B1F3A;
  --navy-mid:   #142b4e;
  --navy-light: #1E3A5F;
  --blue:       #1B5FA5;
  --blue-hover: #1a55a0;
  --accent:     #2980e8;
  --gold:       #C8973A;
  --white:      #ffffff;
  --off-white:  #F4F7FC;
  --surface:    #EDF2FB;
  --border:     #D0DCF0;
  --text:       #1A2540;
  --muted:      #6B7A99;
  --danger:     #D64045;
  --success:    #2ECC71;
  --warn:       #F39C12;

  --radius:     10px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow:     0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.14);
  --nav-h:      58px;
  --trans:      0.18s ease;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  background: var(--off-white);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Utilities ─────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.muted-text { color: var(--muted); font-size: .9em; }
.error-msg { color: var(--danger); font-size: .88em; margin-top: 6px; }

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--navy);
  display: flex; align-items: center; gap: 0;
  padding: 0 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  margin-right: 28px; flex-shrink: 0;
}
.nav-logo {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: #fff;
  flex-shrink: 0;
}
.nav-logo img { width: 70%; height: 70%; object-fit: contain; }
.nav-title {
  font-weight: 700; font-size: 1.05rem;
  color: #fff; letter-spacing: .3px;
}
/* Wordmark image variant — used in dark-bg navbars where the white wordmark shows. */
.nav-title-img { height: 22px; width: auto; display: block; }

.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.7);
  padding: 6px 14px; border-radius: 8px;
  font-size: .92rem; font-weight: 500;
  transition: background var(--trans), color var(--trans);
  display: flex; align-items: center; gap: 6px;
}
.nav-btn:hover, .nav-btn.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.nav-btn.active { color: #fff; }

.nav-right {
  display: flex; align-items: center; gap: 10px; margin-left: auto;
}

/* avatar */
.avatar-wrap {
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden; cursor: pointer;
  background: var(--blue);
  border: 2px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--trans);
  flex-shrink: 0;
}
.avatar-wrap:hover { border-color: rgba(255,255,255,.6); }
.avatar-initials { font-size: .85rem; font-weight: 700; color: #fff; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; }

/* ── Main content ─────────────────────────────────────────────────────── */
main { padding-top: var(--nav-h); min-height: 100vh; }

.view { padding: 28px 32px; max-width: 1200px; margin: 0 auto; }
.center-view {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - var(--nav-h));
  padding: 20px;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border-radius: 8px;
  font-size: .9rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: background var(--trans), transform var(--trans), box-shadow var(--trans);
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--blue); color: #fff;
  box-shadow: 0 2px 8px rgba(27,95,165,.25);
}
.btn-primary:hover { background: var(--blue-hover); box-shadow: 0 4px 14px rgba(27,95,165,.35); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b53338; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #27ae60; }

.btn-ghost {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--surface); }

/* ghost variant inside dark navbar */
.navbar .btn-ghost {
  color: rgba(255,255,255,.85);
  border-color: rgba(255,255,255,.3);
}
.navbar .btn-ghost:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-color: rgba(255,255,255,.5);
}

.btn-wide { width: 100%; justify-content: center; padding: 12px 20px; font-size: 1rem; }
.btn-sm { padding: 6px 14px; font-size: .82rem; }

/* ── Inputs ─────────────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .92rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--trans), box-shadow var(--trans);
  outline: none;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(41,128,232,.15);
}
textarea.input { resize: vertical; min-height: 72px; }

/* ── Cards ─────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.card-title {
  font-size: 1rem; font-weight: 700;
  color: var(--text); margin-bottom: 14px;
}

/* ── Badge ───────────────────────────────────────────────────────────── */
.badge {
  background: var(--danger); color: #fff;
  font-size: .72rem; font-weight: 700;
  border-radius: 10px; padding: 1px 6px;
}
.badge-grade {
  display: inline-block;
  background: var(--surface);
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: .82rem;
  font-weight: 600;
}

/* ── Login ────────────────────────────────────────────────────────────── */
.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 44px 40px;
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center;
}
.login-logo {
  width: 64px; height: 64px;
  background: var(--navy);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 900; color: #fff;
  box-shadow: 0 6px 20px rgba(11,31,58,.3);
}
.login-logo img { width: 70%; height: 70%; object-fit: contain; }
.login-title { font-size: 1.8rem; font-weight: 800; color: var(--navy); }
.login-sub { color: var(--muted); font-size: .92rem; margin-top: -6px; }

.devel-users {
  width: 100%;
  display: flex; flex-direction: column; gap: 6px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--surface);
}
.devel-user-btn {
  text-align: left; padding: 8px 12px;
  border-radius: 7px; border: none;
  background: none; cursor: pointer;
  font-size: .9rem; color: var(--text);
  transition: background var(--trans);
}
.devel-user-btn:hover { background: var(--white); }

.poll-status {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: .9rem;
}

/* ── Stats strip ─────────────────────────────────────────────────────── */
.stats-strip {
  display: flex; align-items: center; gap: 0;
  background: var(--navy);
  border-radius: var(--radius-lg);
  padding: 18px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.stat-item { text-align: center; flex: 1; }
.stat-value { font-size: 2rem; font-weight: 800; color: #fff; line-height: 1; }
.stat-label { font-size: .78rem; color: rgba(255,255,255,.6); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }
.stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,.15); margin: 0 20px; flex-shrink: 0; }

/* ── Dashboard grid ──────────────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } }

.dash-right-col { display: flex; flex-direction: column; gap: 16px; }

/* next session card */
.next-session-card { border-left: 4px solid var(--accent); }
.next-session-body { display: flex; flex-direction: column; gap: 8px; }
.next-session-when {
  font-size: 1.4rem; font-weight: 800; color: var(--accent);
}
.next-session-detail { font-size: .92rem; color: var(--muted); line-height: 1.6; }

/* dashboard upcoming list */
.dash-upcoming-list { display: flex; flex-direction: column; gap: 1px; }
.dash-upcoming-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.dash-upcoming-item:last-child { border-bottom: none; }
.dash-upcoming-date {
  min-width: 38px; text-align: center;
  background: var(--navy);
  color: #fff;
  border-radius: 8px;
  padding: 5px 4px;
  flex-shrink: 0;
}
.dash-upcoming-date .d-day { font-size: 1.1rem; font-weight: 800; line-height: 1; }
.dash-upcoming-date .d-mon { font-size: .65rem; text-transform: uppercase; opacity: .7; }
.dash-upcoming-info { flex: 1; min-width: 0; }
.dash-upcoming-subject { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-upcoming-meta { font-size: .78rem; color: var(--muted); }
.dash-upcoming-role {
  font-size: .72rem; font-weight: 700;
  padding: 2px 7px; border-radius: 5px;
  background: var(--surface); color: var(--blue);
  flex-shrink: 0;
}
.dash-find-btn { color: var(--blue) !important; border-color: var(--border) !important; font-weight: 600; }

/* calendar legend */
.cal-legend {
  display: flex; align-items: center; gap: 5px;
  margin-top: 10px; font-size: .75rem; color: var(--muted);
}
.cal-legend-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); display: inline-block;
}
.cal-legend-dot.tutor { background: var(--gold); }

/* ── Calendar ────────────────────────────────────────────────────────── */
.calendar-card { padding: 18px; }
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.cal-title { font-size: 1rem; font-weight: 700; }
.cal-nav-btn {
  background: none; border: 1.5px solid var(--border);
  border-radius: 7px; padding: 4px 10px;
  font-size: 1.1rem; cursor: pointer;
  transition: background var(--trans);
}
.cal-nav-btn:hover { background: var(--surface); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-day-label {
  text-align: center; font-size: .72rem;
  color: var(--muted); padding: 4px 0;
  font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
}
.cal-cell {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; border-radius: 7px;
  cursor: default; position: relative;
  transition: background var(--trans);
}
.cal-cell.today { font-weight: 700; background: var(--surface); border: 1.5px solid var(--accent); }
.cal-cell.has-event::after {
  content: '';
  position: absolute; bottom: 3px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.cal-cell.has-event.tutor::after { background: var(--gold); }
.cal-cell.other-month { color: var(--border); }

/* ── Tutor grid ──────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; flex-wrap: wrap;
  gap: 14px; margin-bottom: 22px;
}
.page-header h2 { font-size: 1.4rem; font-weight: 800; flex: 1 0 100%; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; }
.filter-input { max-width: 220px; }

.tutor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.tutor-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow var(--trans), transform var(--trans);
}
.tutor-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.tutor-card-header { display: flex; align-items: center; gap: 14px; }
.tutor-initials-avatar {
  width: 48px; height: 48px;
  background: var(--navy-light);
  color: #fff; font-weight: 800; font-size: 1.1rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tutor-name { font-weight: 700; font-size: 1.05rem; }
.tutor-grade { font-size: .82rem; color: var(--muted); }
.tutor-rating { margin-left: auto; font-size: .95rem; color: var(--gold); font-weight: 700; }

.tutor-subjects {
  font-size: .88rem; color: var(--muted);
  line-height: 1.5;
}
.tutor-blocks { display: flex; flex-wrap: wrap; gap: 5px; }
.block-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 9px;
  font-size: .78rem; font-weight: 600;
  color: var(--blue);
}

/* ── Session grid ────────────────────────────────────────────────────── */
.session-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.session-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.session-card.upcoming { border-left: 4px solid var(--accent); }
.session-card.pending  { border-left: 4px solid var(--warn); }
.session-card.completed { opacity: .75; }

.session-header { display: flex; justify-content: space-between; align-items: center; }
.session-role-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--blue); margin-bottom: 2px;
}
.session-student { font-weight: 700; font-size: 1rem; }
.session-subject { font-size: .9rem; font-weight: 600; color: var(--blue); }
.session-meta { font-size: .85rem; color: var(--muted); line-height: 1.7; }
.session-status-badge {
  font-size: .75rem; font-weight: 700;
  padding: 2px 9px; border-radius: 6px;
  background: var(--surface); color: var(--muted);
}
.session-status-badge.upcoming  { background: #dbeeff; color: var(--blue); }
.session-status-badge.completed { background: #d5f5e3; color: #1e8449; }
.session-status-badge.pending   { background: #fef5de; color: #b7770d; }
.session-status-badge.cancelled { background: #fde8e8; color: var(--danger); }

.session-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ── Session cancel button ───────────────────────────────────────────── */
.session-cancel-btn {
  margin-top: 10px; width: 100%;
  justify-content: center;
  color: var(--danger) !important;
  border-color: rgba(214,64,69,.35) !important;
  font-size: .8rem !important;
}
.session-cancel-btn:hover {
  background: rgba(214,64,69,.06) !important;
  border-color: var(--danger) !important;
}

/* ── Pending card extra ──────────────────────────────────────────────── */
.pending-notes {
  font-size: .85rem; color: var(--muted);
  background: var(--surface);
  border-radius: 7px;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
}

/* ── History table ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.data-table th {
  background: var(--navy);
  color: rgba(255,255,255,.8);
  font-size: .8rem; text-transform: uppercase; letter-spacing: .5px;
  padding: 12px 16px; text-align: left;
}
.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface); }

/* ── Profile ─────────────────────────────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 700px) { .profile-grid { grid-template-columns: 1fr; } }

.profile-card { grid-column: 1 / -1; display: flex; align-items: center; gap: 20px; }
.profile-avatar-lg {
  width: 72px; height: 72px;
  background: var(--navy-light);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 800; color: #fff;
  overflow: hidden;
}
.profile-info h3 { font-size: 1.3rem; font-weight: 800; }
.profile-info p { font-size: .88rem; color: var(--muted); margin-top: 2px; }

.tutor-meta { display: flex; flex-direction: column; gap: 10px; }
.rating-display { display: flex; align-items: baseline; gap: 8px; }
.rating-stars { font-size: 1.5rem; font-weight: 800; color: var(--gold); }
.bio-text { font-size: .9rem; line-height: 1.6; color: var(--text); }

.upcoming-card { grid-column: 1 / -1; }
.upcoming-list { display: flex; flex-direction: column; gap: 10px; }
.upcoming-item {
  display: flex; gap: 14px; align-items: center;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 9px;
}
.upcoming-date-col { text-align: center; min-width: 44px; }
.upcoming-day { font-size: 1.2rem; font-weight: 800; color: var(--navy); }
.upcoming-month { font-size: .72rem; text-transform: uppercase; color: var(--muted); letter-spacing: .4px; }
.upcoming-detail { flex: 1; }
.upcoming-subject { font-weight: 700; font-size: .95rem; }
.upcoming-with { font-size: .85rem; color: var(--muted); }
.upcoming-role { font-size: .78rem; color: var(--blue); font-weight: 600; }
.upcoming-item .session-cancel-btn {
  margin-top: 0; margin-left: auto; width: auto;
  padding: 4px 12px; flex-shrink: 0;
}

/* ── Modal ───────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 500px;
  display: flex; flex-direction: column;
  max-height: 90vh;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 1.4rem;
  cursor: pointer; color: var(--muted);
  line-height: 1; padding: 0 4px;
}
.modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.form-label { font-size: .85rem; font-weight: 600; color: var(--text); display: block; margin-bottom: 4px; }
.required-mark { color: var(--danger); font-size: .9em; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ── Spinner ─────────────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Tutor org tags ──────────────────────────────────────────────────── */
.tutor-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.org-tag {
  font-size: .72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 5px;
  letter-spacing: .2px;
}
.org-tag.nhs { background: #d5f5e3; color: #1a7a47; border: 1px solid #a9dfbf; }
.org-tag.mat { background: #dbeeff; color: #1557a0; border: 1px solid #aaccf0; }

/* ── Messages ────────────────────────────────────────────────────────── */
.msg-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  height: calc(100vh - var(--nav-h) - 100px);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.msg-sidebar {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--off-white);
}

.msg-convo-list { display: flex; flex-direction: column; }

.msg-convo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--trans);
}
.msg-convo-item:hover { background: var(--surface); }
.msg-convo-item.active { background: #dbeeff; }

.msg-convo-avatar {
  width: 38px; height: 38px;
  border-radius: 50%; background: var(--navy-light);
  color: #fff; font-weight: 700; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.msg-convo-info { flex: 1; min-width: 0; }
.msg-convo-name { font-weight: 700; font-size: .9rem; }
.msg-convo-preview {
  font-size: .8rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msg-convo-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.msg-convo-time { font-size: .72rem; color: var(--muted); }

.msg-thread-pane {
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.msg-thread-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
}
.msg-thread-active { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }

.msg-thread-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 1rem;
  background: var(--white);
  flex-shrink: 0;
}

.msg-thread-body {
  flex: 1; overflow-y: auto;
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 10px;
}

.msg-bubble-wrap {
  display: flex;
  flex-direction: column;
}
.msg-bubble-wrap.mine { align-items: flex-end; }
.msg-bubble-wrap.theirs { align-items: flex-start; }

.msg-bubble {
  max-width: 68%; padding: 9px 14px;
  border-radius: 16px;
  font-size: .9rem; line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}
.msg-bubble.mine {
  background: var(--blue); color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-bubble.theirs {
  background: var(--surface); color: var(--text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}
.msg-bubble-time {
  font-size: .7rem; color: var(--muted);
  margin-top: 3px; padding: 0 4px;
}

.msg-compose {
  display: flex; gap: 10px; align-items: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
}
.msg-input { flex: 1; resize: none; }

.msg-badge { background: var(--blue); }

/* ── Time picker row ─────────────────────────────────────────────────── */
.time-row {
  display: flex; align-items: center; gap: 6px;
}
.time-part { width: auto; flex: 1; }
.time-sep {
  font-size: 1.1rem; font-weight: 700; color: var(--muted);
  flex-shrink: 0;
}

/* ── Registration ────────────────────────────────────────────────────── */
.reg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 720px) { .reg-grid { grid-template-columns: 1fr; } }

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  margin-top: 4px;
}
.subject-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  font-size: .85rem;
  transition: border-color var(--trans), background var(--trans);
  user-select: none;
}
.subject-chip input { display: none; }
.subject-chip.selected {
  border-color: var(--accent);
  background: #dbeeff;
  color: var(--blue);
  font-weight: 600;
}

.block-toggle-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
}
.block-toggle {
  padding: 5px 14px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  font-size: .85rem; font-weight: 600;
  transition: border-color var(--trans), background var(--trans);
  user-select: none;
}
.block-toggle.selected {
  border-color: var(--accent);
  background: #dbeeff;
  color: var(--blue);
}

.toggle-row {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: .92rem;
}
.toggle-row input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent);
}

.tutor-reg-section { margin-top: 6px; }

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  font-size: .95rem;
}

/* ── Review modal ────────────────────────────────────────────────────── */
.review-row {
  margin-bottom: 14px;
}
.review-row label {
  display: block;
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.star-picker {
  display: flex; gap: 6px;
}
.star {
  font-size: 1.6rem;
  color: #ccc;
  cursor: pointer;
  transition: color .12s, transform .1s;
  user-select: none;
}
.star:hover, .star.filled {
  color: var(--gold);
}
.star:hover {
  transform: scale(1.15);
}

/* ── Chat disclaimer ─────────────────────────────────────────────────── */
.msg-chat-disclaimer {
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 6px 16px;
  letter-spacing: .01em;
}

/* ── Notification bell ───────────────────────────────────────────────── */
.bell-wrap {
  position: relative;
  flex-shrink: 0;
}
.bell-btn {
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  color: rgba(255,255,255,.75);
  position: relative;
  transition: background var(--trans), color var(--trans);
}
.bell-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.bell-badge {
  position: absolute; top: 3px; right: 3px;
  background: var(--danger); color: #fff;
  font-size: .62rem; font-weight: 800;
  min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--navy);
  pointer-events: none;
}
.bell-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 300px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  overflow: hidden;
}
.bell-item {
  padding: 11px 16px;
  font-size: .88rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--trans);
  color: var(--text);
  line-height: 1.4;
}
.bell-item:last-child { border-bottom: none; }
.bell-item:hover { background: var(--surface); }
.bell-empty {
  color: var(--muted); text-align: center;
  padding: 20px 16px; font-size: .85rem;
  cursor: default;
}
.bell-empty:hover { background: none; }

/* ── Check-in ────────────────────────────────────────────────────────── */
.checkin-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: #d5f5e3; color: #1a7a47;
  border: 1px solid #a9dfbf;
  border-radius: 6px;
  font-size: .75rem; font-weight: 700;
  padding: 3px 9px;
  flex-shrink: 0;
}
.checkin-btn {
  flex-shrink: 0;
  font-size: .78rem !important;
}

/* ── Help Board ───────────────────────────────────────────────────────── */
.board-post-card { margin-bottom: 20px; }
.board-post-form {
  display: flex; flex-direction: column; gap: 10px;
}
.board-post-row {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.board-post-row > * { flex: 1; min-width: 140px; }
.board-card {
  border-left: 4px solid var(--gold) !important;
}

/* ── Admin ───────────────────────────────────────────────────────────── */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 860px) { .admin-grid { grid-template-columns: 1fr; } }

.admin-list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.admin-list-row:last-child { border-bottom: none; }
.admin-rank {
  min-width: 26px;
  font-size: .78rem; font-weight: 800;
  color: var(--muted);
}
.admin-name { flex: 1; font-weight: 600; }
.admin-stars { color: var(--gold); font-weight: 700; font-size: .88rem; flex-shrink: 0; }
.admin-muted { color: var(--muted); font-size: .82rem; flex-shrink: 0; }

/* ── Blocked dates ───────────────────────────────────────────────────── */
.blocked-dates-wrap { margin-top: 4px; }
.blocked-dates-list {
  display: flex; flex-wrap: wrap; gap: 6px;
  min-height: 28px;
  margin-bottom: 8px;
}
.blocked-date-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: #fde8e8; color: var(--danger);
  border: 1px solid rgba(214,64,69,.3);
  border-radius: 6px;
  font-size: .82rem; font-weight: 600;
  padding: 3px 8px;
}
.blocked-date-remove {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; line-height: 1;
  color: var(--danger); padding: 0 0 0 2px;
  opacity: .7;
  transition: opacity var(--trans);
}
.blocked-date-remove:hover { opacity: 1; }

/* ── Review snippet (tutor cards) ────────────────────────────────────── */
.review-snippets { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.review-snippet {
  font-size: .8rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.4;
  padding: 4px 8px;
  border-left: 2px solid var(--border);
  background: var(--surface);
  border-radius: 0 4px 4px 0;
}

/* ── Dashboard pending callout ───────────────────────────────────────── */
.dash-callout {
  background: #fff8e6;
  border: 1.5px solid #f0c060;
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 18px;
  font-size: .9rem;
  color: #7a5500;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* ── Dark mode ───────────────────────────────────────────────────────── */
/* ── Profile preferences card ────────────────────────────────────────── */
.profile-prefs-card { grid-column: 1 / -1; }

/* ── Dark mode ───────────────────────────────────────────────────────────────
   Toggle applied to both <html> and <body> so the full scroll area is dark. */
html, body, .card, .modal, .input, .session-card, .tutor-card,
.navbar, .stats-strip, .upcoming-item, .board-post-card,
.subject-chip, .block-toggle, .modal-header, .modal-body, .modal-footer {
  transition: background var(--trans), color var(--trans), border-color var(--trans);
}

html.dark { background: #0f1720; }

body.dark {
  --off-white:  #0f1720;
  --surface:    #1a2540;
  --border:     #2a3a5a;
  --text:       #d8e4f4;
  --muted:      #7888a8;
  --white:      #1a2540;
  --navy-mid:   #0d1a2e;
}

/* Core surfaces */
body.dark .card             { background: #1a2540; border-color: #2a3a5a; }
body.dark .navbar           { background: #080f1c; }
body.dark .modal            { background: #1a2540; border-color: #2a3a5a; }
body.dark .modal-header     { border-bottom-color: #2a3a5a; }
body.dark .modal-footer     { border-top-color: #2a3a5a; }
body.dark .input            { background: #0f1720; border-color: #2a3a5a; color: var(--text); }
body.dark select.input option { background: #1a2540; }
body.dark .session-card     { background: #1a2540; border-color: #2a3a5a; }
body.dark .tutor-card       { background: #1a2540; border-color: #2a3a5a; }
body.dark .stats-strip      { background: #1a2540; border-color: #2a3a5a; }

/* Profile page */
body.dark .profile-avatar-lg { background: #1b4a8a; }
body.dark .badge-grade      { background: #1a2f50; color: #7aaae8; border-color: #2a3a5a; }
body.dark .upcoming-item    { border-bottom-color: #2a3a5a; }

/* Chips & toggles (edit profile / registration) */
body.dark .subject-chip     { background: #0f1720; border-color: #2a3a5a; color: var(--text); }
body.dark .subject-chip.selected { background: #102540; border-color: var(--accent); color: #7ab8f5; }
body.dark .block-toggle     { background: #0f1720; border-color: #2a3a5a; color: var(--text); }
body.dark .block-toggle.selected { background: #102540; border-color: var(--accent); color: #7ab8f5; }

/* Board / review / misc */
body.dark .board-post-card  { background: #1a2540; }
body.dark .review-snippet   { background: #111d30; border-left-color: #2a3a5a; }
body.dark .dash-callout     { background: #2a2000; border-color: #7a5500; color: #f0c060; }
body.dark .bell-dropdown    { background: #1a2540; border-color: #2a3a5a; }
body.dark .bell-item        { border-bottom-color: #2a3a5a; color: var(--text); }

/* Messages */
body.dark .msg-convo-item   { border-bottom-color: #2a3a5a; }
body.dark .msg-convo-item:hover  { background: #111d30; }
body.dark .msg-convo-item.active { background: #0f1720; }
body.dark .msg-thread       { background: #0f1720; }

/* Admin / data table */
body.dark .data-table th    { background: #111d30; color: var(--muted); }
body.dark .data-table td    { border-bottom-color: #2a3a5a; }
body.dark .admin-list-row   { border-bottom-color: #2a3a5a; }

/* Login card */
body.dark .login-card       { background: #1a2540; border-color: #2a3a5a; }

/* ─────────────────────────────────────────────────────────────────────────
   LANDING PAGE  (all styles scoped under #landing to avoid conflicts)
   ───────────────────────────────────────────────────────────────────────── */

#landing {
  background: #fff;
  font-size: 16px;
  line-height: 1.6;
  color: #1A2540;
}
#landing a { text-decoration: none; color: inherit; }

/* ── Landing Nav ── */
#landing .ln-nav {
  position: sticky; top: 0; z-index: 200;
  background: var(--navy);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; height: 62px;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
#landing .ln-nav-brand {
  display: flex; align-items: center; gap: 10px;
}
#landing .ln-nav-logo {
  width: 34px; height: 34px;
  background: var(--accent); border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 17px; color: #fff; flex-shrink: 0;
}
#landing .ln-nav-logo img { width: 70%; height: 70%; object-fit: contain; }
#landing .ln-nav-wordmark {
  font-size: 1.1rem; font-weight: 700; color: #fff; letter-spacing: .2px;
}
#landing .ln-nav-wordmark-img { height: 24px; width: auto; display: block; }
#landing .ln-nav-links {
  display: flex; align-items: center; gap: 4px;
}
#landing .ln-nav-link {
  color: rgba(255,255,255,.75);
  font-size: .92rem; font-weight: 500;
  padding: 7px 16px; border-radius: 7px;
  transition: background .15s, color .15s;
}
#landing .ln-nav-link:hover { background: rgba(255,255,255,.1); color: #fff; }
#landing .ln-nav-actions { display: flex; align-items: center; gap: 10px; }

/* ── Landing Buttons ── */
.ln-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 22px; border-radius: 8px;
  font-size: .92rem; font-weight: 600; cursor: pointer;
  border: none; transition: background .15s, transform .1s, box-shadow .15s;
  font-family: inherit;
}
.ln-btn:active { transform: scale(.97); }
.ln-btn-accent {
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 8px rgba(41,128,232,.35);
}
.ln-btn-accent:hover { background: #1a72d4; }
.ln-btn-ghost-nav {
  background: transparent; color: rgba(255,255,255,.85);
  border: 1.5px solid rgba(255,255,255,.3);
}
.ln-btn-ghost-nav:hover { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.55); }
.ln-btn-white {
  background: #fff; color: var(--navy);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.ln-btn-white:hover { background: #f0f4fa; }
.ln-btn-gold {
  background: var(--gold); color: #fff;
  box-shadow: 0 2px 8px rgba(200,151,58,.3);
}
.ln-btn-gold:hover { background: #b5862e; }
.ln-btn-lg { padding: 14px 34px; font-size: 1rem; border-radius: 10px; }
.ln-btn-google {
  background: #fff; color: #3c4043;
  border: 1.5px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  width: 100%;
  padding: 11px 22px;
}
.ln-btn-google:hover { background: #f8fafe; }

/* ── Hero (split layout) ── */
#landing .ln-hero {
  background: var(--navy);
  overflow: hidden;
  position: relative;
}
#landing .hero-split {
  display: flex; align-items: stretch; min-height: 600px;
}
#landing .hero-content {
  flex: 0 0 52%;
  padding: 88px 56px 88px 80px;
  background: var(--navy);
  display: flex; flex-direction: column; justify-content: center;
  position: relative; z-index: 2;
}
#landing .hero-visual {
  flex: 1; position: relative; overflow: hidden;
}
#landing .hero-visual img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
#landing .hero-photo-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to right,
    rgba(11,31,58,1) 0%,
    rgba(11,31,58,1) 2%,
    rgba(11,31,58,.85) 22%,
    rgba(11,31,58,.35) 50%,
    transparent 72%);
}
#landing .hero-float-card {
  position: absolute; bottom: 44px; left: 32px;
  background: rgba(255,255,255,.97); border-radius: 14px;
  padding: 16px 20px; box-shadow: 0 8px 40px rgba(0,0,0,.22);
  max-width: 230px; z-index: 3;
}
#landing .hero-float-stars { color: var(--gold); font-size: .95rem; letter-spacing: 2px; margin-bottom: 8px; }
#landing .hero-float-quote { font-size: .82rem; color: #1A2540; line-height: 1.5; font-style: italic; }
#landing .hero-float-name  { margin-top: 9px; font-size: .76rem; font-weight: 600; color: var(--muted); }

#landing .ln-hero-label {
  display: inline-block;
  background: rgba(41,128,232,.22); color: #7ab8f5;
  font-size: .82rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  padding: 5px 14px; border-radius: 20px; border: 1px solid rgba(41,128,232,.35);
  margin-bottom: 28px;
}
#landing .ln-h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 800; color: #fff;
  line-height: 1.15; letter-spacing: -.5px; margin-bottom: 20px;
}
#landing .ln-h1 span { color: #f0b84a; }
#landing .ln-hero-sub {
  font-size: 1.08rem; color: rgba(255,255,255,.7); max-width: 440px; margin-bottom: 40px; line-height: 1.7;
}
#landing .ln-hero-ctas { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
#landing .ln-hero-note { margin-top: 20px; font-size: .81rem; color: rgba(255,255,255,.38); }

/* ── Stats band ── */
#landing .ln-band {
  background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 28px 48px; display: flex; align-items: center; justify-content: center;
  gap: 60px; flex-wrap: wrap;
}
#landing .ln-band-stat { text-align: center; }
#landing .ln-band-num  { font-size: 2rem; font-weight: 800; color: var(--navy); line-height: 1; }
#landing .ln-band-lbl  { font-size: .85rem; color: var(--muted); margin-top: 4px; font-weight: 500; }
#landing .ln-band-div  { width: 1px; height: 44px; background: var(--border); }

/* ── Shared section styles ── */
#landing .ln-section { padding: 80px 48px; }
#landing .ln-section-white  { background: #fff; }
#landing .ln-section-tinted { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
#landing .ln-section-hdr    { margin-bottom: 52px; text-align: center; }
#landing .ln-lbl   { font-size: .82rem; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
#landing .ln-title { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; color: var(--navy); line-height: 1.2; letter-spacing: -.3px; }
#landing .ln-sub   { font-size: 1.05rem; color: var(--muted); margin-top: 12px; max-width: 520px; line-height: 1.6; }
#landing .ln-section-hdr .ln-sub { margin: 12px auto 0; }
#landing .ln-tag-explainer {
  max-width: 980px; margin: 0 auto; text-align: center;
}
#landing .ln-tag-explainer .ln-sub {
  max-width: 680px; margin: 14px auto 0;
  font-size: 1.02rem; line-height: 1.7; color: var(--text);
}
#landing .ln-tag-points {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-top: 44px; text-align: left;
}
#landing .ln-tag-point {
  background: #fff; padding: 24px 22px;
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
#landing .ln-tag-point-icon {
  font-size: 1.8rem; line-height: 1; margin-bottom: 12px;
}
#landing .ln-tag-point h3 {
  font-size: 1.05rem; font-weight: 700; color: var(--navy);
  margin-bottom: 6px;
}
#landing .ln-tag-point p { font-size: .9rem; line-height: 1.55; color: var(--text); }
@media (max-width: 800px) {
  #landing .ln-tag-points { grid-template-columns: 1fr; }
}

/* ── Feature grid ── */
#landing .ln-feat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px; max-width: 1100px; margin: 0 auto;
}
#landing .ln-feat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 28px 24px;
  transition: box-shadow .2s, transform .2s;
}
#landing .ln-feat-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.09); transform: translateY(-2px); }
#landing .ln-feat-card h3 { font-size: 1.02rem; font-weight: 700; color: var(--navy); margin: 16px 0 8px; }
#landing .ln-feat-card p  { font-size: .92rem; color: var(--muted); line-height: 1.6; }
#landing .ln-feat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #1a60b5);
  display: flex; align-items: center; justify-content: center;
}
#landing .ln-feat-icon-gold   { background: linear-gradient(135deg, var(--gold), #a07020); }
#landing .ln-feat-icon-navy   { background: linear-gradient(135deg, var(--navy-light), var(--navy)); }
#landing .ln-feat-icon-green  { background: linear-gradient(135deg, #27ae60, #1e8449); }
#landing .ln-feat-icon-purple { background: linear-gradient(135deg, #8e44ad, #6c3483); }

/* ── How it works ── */
#landing .ln-how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; max-width: 1000px; margin: 0 auto; }
#landing .ln-how-col-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .7px;
  padding: 5px 14px; border-radius: 20px; margin-bottom: 28px;
}
#landing .ln-col-student { background: rgba(41,128,232,.1); color: var(--accent); border: 1px solid rgba(41,128,232,.25); }
#landing .ln-col-parent  { background: rgba(46,204,113,.12); color: #1f7a44; border: 1px solid rgba(46,204,113,.3); }
#landing .ln-col-teacher { background: rgba(200,151,58,.12); color: #8a6020; border: 1px solid rgba(200,151,58,.3); }
#landing .ln-how-step { display: flex; gap: 16px; margin-bottom: 24px; }
#landing .ln-step-num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 700;
}
#landing .ln-how-step h4 { font-size: .95rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
#landing .ln-how-step p  { font-size: .88rem; color: var(--muted); line-height: 1.55; }

/* ── For schools ── */
#landing .ln-schools-split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; max-width: 1100px; margin: 0 auto; align-items: center; }
#landing .ln-check-list { list-style: none; margin-top: 28px; display: flex; flex-direction: column; gap: 18px; }
#landing .ln-check-list li { display: flex; gap: 14px; align-items: flex-start; }
#landing .ln-check {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; margin-top: 1px;
}
#landing .ln-check-list p { font-size: .92rem; color: var(--muted); line-height: 1.55; }
#landing .ln-check-list strong { color: var(--text); }
#landing .ln-admin-card {
  background: var(--navy); border-radius: 16px; padding: 28px;
  box-shadow: 0 12px 40px rgba(11,31,58,.35);
}
#landing .ln-admin-title { color: rgba(255,255,255,.5); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 20px; }
#landing .ln-admin-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.07);
  font-size: .92rem;
}
#landing .ln-admin-row:last-child { border-bottom: none; }
#landing .ln-admin-row span:first-child { color: rgba(255,255,255,.65); }
#landing .ln-admin-row span:last-child  { color: #fff; font-weight: 700; }

/* ── CTA section ── */
#landing .ln-cta {
  background: var(--navy);
  padding: 80px 48px; text-align: center;
}
#landing .ln-cta h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; color: #fff; margin-bottom: 12px; }
#landing .ln-cta > p { color: rgba(255,255,255,.65); font-size: 1.05rem; margin-bottom: 48px; }
#landing .ln-cta-cards { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
#landing .ln-cta-card {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px; padding: 32px 28px; max-width: 320px; text-align: left;
}
#landing .ln-cta-role { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: rgba(255,255,255,.5); margin-bottom: 10px; }
#landing .ln-cta-card h3 { font-size: 1.2rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
#landing .ln-cta-card p  { font-size: .9rem; color: rgba(255,255,255,.6); line-height: 1.6; margin-bottom: 24px; }

/* ── Footer ── */
#landing .ln-footer {
  background: #060f1e; padding: 32px 48px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
#landing .ln-footer-brand { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.7); font-weight: 600; font-size: .95rem; }
#landing .ln-footer-links { display: flex; gap: 24px; }
#landing .ln-footer-links a { color: rgba(255,255,255,.5); font-size: .88rem; transition: color .15s; }
#landing .ln-footer-links a:hover { color: rgba(255,255,255,.85); }
#landing .ln-footer-copy { color: rgba(255,255,255,.3); font-size: .82rem; }

/* ── Admin moderation ── */
.mod-tabs { display: flex; gap: 0; border: 1.5px solid var(--border); border-radius: 9px; overflow: hidden; max-width: 380px; }
.mod-tab {
  flex: 1; padding: 9px; font-size: .88rem; font-weight: 600;
  background: transparent; border: none; cursor: pointer;
  color: var(--muted); transition: background .15s, color .15s; font-family: inherit;
}
.mod-tab.active { background: var(--navy); color: #fff; }
.mod-pane { margin-top: 16px; }
.mod-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px; border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 8px; background: var(--white);
}
.mod-row-main { flex: 1; min-width: 0; font-size: .9rem; }
.mod-row-main strong { font-size: .92rem; }
.mod-row-meta { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.mod-row-body { margin-top: 6px; line-height: 1.45; word-wrap: break-word; }
.mod-del-btn {
  flex-shrink: 0; padding: 6px 12px; font-size: .82rem; font-weight: 600;
  background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
  border-radius: 6px; cursor: pointer; font-family: inherit;
}
.mod-del-btn:hover { background: #fee2e2; }
.mod-del-btn:disabled { opacity: .5; cursor: not-allowed; }
.mod-row-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; align-items: flex-end; }
.mod-tag-btn {
  padding: 6px 12px; font-size: .82rem; font-weight: 600;
  background: #eff6ff; color: var(--navy); border: 1px solid #bfdbfe;
  border-radius: 6px; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.mod-tag-btn:hover { background: #dbeafe; }
.mod-tag-btn:disabled { opacity: .5; cursor: not-allowed; }
.tag-pill {
  display: inline-block; margin-left: 6px;
  padding: 2px 9px; font-size: .72rem; font-weight: 700;
  background: var(--navy); color: #fff; border-radius: 999px;
  letter-spacing: .03em; vertical-align: middle; white-space: nowrap;
}
.tag-pill-success { background: #d6f5e3; color: #1f7a44; }
.tag-pill-warn    { background: #fff3d6; color: #8a5a00; }
.tag-pill-danger  { background: #fde2e2; color: #b91c1c; }
.tag-pill-neutral { background: var(--surface); color: var(--muted); }

/* ── Loading + empty states ──────────────────────────────────────────── */
.loader-spinner {
  display: inline-block; width: 22px; height: 22px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
.loader-spinner-lg { width: 32px; height: 32px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loader-block {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 32px 16px;
  color: var(--muted); font-size: .9rem;
}

.empty-state-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 36px 20px; text-align: center;
  color: var(--muted);
}
.empty-state-card .empty-icon {
  font-size: 2.2rem; line-height: 1; opacity: .55;
  margin-bottom: 4px;
}
.empty-state-card .empty-title {
  font-size: 1rem; font-weight: 600; color: var(--text);
}
.empty-state-card .empty-msg { font-size: .9rem; max-width: 380px; line-height: 1.5; }
.empty-state-card .empty-cta { margin-top: 10px; }

/* ── Toggle switch (admin settings) ───────────────────────────────────── */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 999px;
  transition: background var(--trans);
}
.switch-slider::before {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; background: #fff; border-radius: 50%;
  transition: transform var(--trans);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:disabled + .switch-slider { opacity: .5; cursor: not-allowed; }

/* ── TAG request cards (redesigned) ───────────────────────────────────── */
.tag-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  display: flex; gap: 16px;
  align-items: stretch;
}
.tag-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.tag-card-actions {
  flex-shrink: 0; display: flex; flex-direction: column; gap: 6px;
  align-items: stretch; justify-content: flex-start;
  min-width: 110px;
}
.tag-card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 1.02rem; font-weight: 700; color: var(--text);
}
.tag-card-head .tag-pill { margin-left: 0; }
.tag-card-sub { font-size: .82rem; color: var(--muted); }

.tag-card-facts {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 2px;
}
.tag-fact {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface); color: var(--text);
  font-size: .78rem; font-weight: 500;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.tag-fact-label { color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.tag-fact-value { color: var(--text); }
.tag-fact-primary { background: #eff6ff; border-color: #bfdbfe; }
.tag-fact-primary .tag-fact-label { color: var(--accent); }

.tag-card-section {
  background: #f8fafc;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
  font-size: .9rem;
}
.tag-card-section + .tag-card-section { margin-top: 6px; }
.tag-card-section-label {
  font-size: .72rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 2px;
}
.tag-card-section-body { color: var(--text); line-height: 1.45; }
.tag-card-section.tag-card-section-warn { background: #fff8eb; border-left-color: var(--gold); }

.tag-card-actions .ln-btn,
.tag-card-actions .mod-tag-btn,
.tag-card-actions .mod-del-btn { width: 100%; justify-content: center; }
.tag-card-empty { color: var(--muted); padding: 12px 4px; }

@media (max-width: 600px) {
  .tag-card { flex-direction: column; }
  .tag-card-actions { flex-direction: row; min-width: 0; }
  .tag-card-actions > * { flex: 1; }
}

/* ── Landing Login Modal ── */
.ln-modal-bg {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.ln-modal-bg.open { opacity: 1; pointer-events: auto; }
.ln-modal-box {
  background: #fff; border-radius: 16px;
  width: 100%; max-width: 420px; margin: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  transform: translateY(12px); transition: transform .2s;
  /* Allow tall forms to scroll inside the modal instead of overflowing the viewport. */
  max-height: calc(100vh - 32px);
  display: flex; flex-direction: column;
}
.ln-modal-bg.open .ln-modal-box { transform: translateY(0); }
.ln-modal-hdr {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.ln-modal-hdr h3 { font-size: 1.1rem; font-weight: 700; color: var(--navy); }
.ln-modal-close { background: none; border: none; cursor: pointer; font-size: 1.4rem; color: var(--muted); line-height: 1; padding: 0 2px; }
.ln-modal-body { padding: 24px 28px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.ln-modal-sub { font-size: .9rem; color: var(--muted); line-height: 1.5; }
.ln-modal-note { font-size: .8rem; color: var(--muted); margin-top: 4px; text-align: center; }
.ln-role-tabs { display: flex; gap: 0; border: 1.5px solid var(--border); border-radius: 9px; overflow: hidden; }
.ln-role-tab {
  flex: 1; padding: 9px; font-size: .88rem; font-weight: 600;
  background: transparent; border: none; cursor: pointer;
  color: var(--muted); transition: background .15s, color .15s; font-family: inherit;
}
.ln-role-tab.active { background: var(--navy); color: #fff; }
.ln-form-label {
  font-size: .85rem; font-weight: 600; color: var(--navy);
  margin-top: 6px;
}
.ln-form-input {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: .92rem; font-family: inherit; box-sizing: border-box;
  background: #fff; color: var(--text);
}
.ln-form-input:focus { outline: none; border-color: var(--navy); }
textarea.ln-form-input { resize: vertical; min-height: 60px; line-height: 1.45; }
textarea.ln-form-input.ln-form-textarea { min-height: 120px; }
.ln-form-hint { font-size: .78rem; color: var(--muted); margin-top: -6px; }
.ln-google-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%234285F4' d='M23.745 12.27c0-.79-.07-1.54-.19-2.27h-11.3v4.51h6.47c-.29 1.48-1.14 2.73-2.4 3.58v3h3.86c2.26-2.09 3.56-5.17 3.56-8.82z'/%3E%3Cpath fill='%2334A853' d='M12.255 24c3.24 0 5.95-1.08 7.93-2.91l-3.86-3c-1.08.72-2.45 1.16-4.07 1.16-3.13 0-5.78-2.11-6.73-4.96h-3.98v3.09C3.515 21.3 7.615 24 12.255 24z'/%3E%3Cpath fill='%23FBBC05' d='M5.525 14.29c-.25-.72-.38-1.49-.38-2.29s.14-1.57.38-2.29V6.62h-3.98a11.86 11.86 0 000 10.76l3.98-3.09z'/%3E%3Cpath fill='%23EA4335' d='M12.255 4.75c1.77 0 3.35.61 4.6 1.8l3.42-3.42C18.205 1.19 15.495 0 12.255 0c-4.64 0-8.74 2.7-10.71 6.62l3.98 3.09c.95-2.85 3.6-4.96 6.73-4.96z'/%3E%3C/svg%3E") center/contain no-repeat;
}
/* Devel user buttons inside landing modal */
#landing .devel-user-btn {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface); cursor: pointer; font-size: .85rem; text-align: left;
  margin-bottom: 6px; transition: background .15s; font-family: inherit;
}
#landing .devel-user-btn:hover { background: var(--border); }

/* ── Responsive ── */
@media (max-width: 860px) {
  #landing .hero-split { flex-direction: column; min-height: auto; }
  #landing .hero-content { flex: none; padding: 64px 24px 56px; }
  #landing .hero-visual { height: 300px; }
  #landing .hero-photo-overlay { background: linear-gradient(to bottom, var(--navy) 0%, transparent 40%); }
  #landing .hero-float-card { display: none; }
  #landing .ln-how-grid { grid-template-columns: 1fr; }
  #landing .ln-schools-split { grid-template-columns: 1fr; }
  #landing .ln-cta-cards { flex-direction: column; align-items: center; }
}
@media (max-width: 700px) {
  #landing .ln-nav { padding: 0 20px; }
  #landing .ln-nav-links { display: none; }
  #landing .ln-section { padding: 60px 20px; }
  #landing .ln-band { padding: 24px 20px; gap: 32px; }
  #landing .ln-band-div { display: none; }
  #landing .ln-footer { padding: 28px 20px; flex-direction: column; align-items: flex-start; }
  #landing .ln-cta { padding: 60px 20px; }
}
