/* ─────────────────────────────────────────────────────────────────────────
 * sarhad-theme.css — Refined editorial-academic design system for TTR.
 *
 * Aesthetic: serif display (Fraunces) + clean grotesque body (DM Sans) +
 * tabular monospace (JetBrains Mono). Navy-dominant with precision gold.
 * Warm cream surfaces; hairline borders; subtle motion; no drop-shadow noise.
 *
 * Tokens live as CSS variables so the redesigned dashboards and any future
 * Module page can opt in by importing this file once.
 * ───────────────────────────────────────────────────────────────────────── */

:root {
  /* Brand */
  --sarhad-navy:    #002147;
  --sarhad-navy-2:  #194775;
  --sarhad-navy-3:  #001530;
  --sarhad-gold:    #ffd700;
  --sarhad-gold-2:  #d4af00;

  /* Refined editorial palette */
  --bg:             #FAFAF7;   /* warm cream paper */
  --surface:        #FFFFFF;
  --surface-2:      #F4F2EB;   /* secondary surface (icon backdrops) */
  --hairline:       #E8E5DC;
  --hairline-strong:#D5D0C2;
  --ink:            #1A1A1A;
  --ink-soft:       #4A4A4A;
  --muted:          #6B6960;
  --muted-soft:     #8F8C82;

  /* Semantic accents (used sparingly to color-key cards/pills) */
  --sage:           #4A7C59;
  --amber:          #B8860B;
  --terracotta:     #C44536;
  --azure:          #2C5F8D;
  --plum:           #6B3F5F;

  /* Typography */
  --font-display:   'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --font-body:      'Plus Jakarta Sans', 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono:      'JetBrains Mono', ui-monospace, 'Courier New', monospace;

  /* Motion curves */
  --ease-out:       cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth:    cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Spatial rhythm */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* Layout */
  --container: 1200px;
  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 20px;

  /* Restrained shadows */
  --shadow-sm: 0 1px 2px rgba(0, 33, 71, 0.04);
  --shadow:    0 4px 16px rgba(0, 33, 71, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 33, 71, 0.10);
}

/* ── Reset + base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

/* Subtle paper texture for cream backgrounds */
body.has-texture {
  background-image:
    radial-gradient(circle at 100% 0%, rgba(0,33,71,0.025), transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(255,215,0,0.04), transparent 45%);
  background-attachment: fixed;
}

/* ── Typography ────────────────────────────────────────────────────────── */
.display, h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  font-variation-settings: "SOFT" 30, "opsz" 144;
  color: var(--sarhad-navy);
  margin: 0;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.05; }
h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); line-height: 1.1; }
h3 { font-size: 1.4rem; line-height: 1.2; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 2px;
  background: var(--sarhad-gold);
}

.tabular {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' on;
  letter-spacing: -0.02em;
}

/* ── Shell ─────────────────────────────────────────────────────────────── */
.shell {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px 96px;
}

/* ── Navigation strip ──────────────────────────────────────────────────── */
.sarhad-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--sarhad-navy);
  color: #fff;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}
.sarhad-nav .inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.sarhad-nav .brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: #fff;
  min-width: 0;
}
.sarhad-nav .brand .seal {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 10px;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.sarhad-nav .brand .seal img {
  width: 100%; height: 100%; object-fit: contain;
}
.sarhad-nav .brand .words { min-width: 0; }
.sarhad-nav .brand .name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  letter-spacing: -0.01em;
  line-height: 1.05;
  font-weight: 600;
  font-variation-settings: "SOFT" 0, "opsz" 14;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sarhad-nav .brand .scope {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sarhad-nav .links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.sarhad-nav .links a,
.sarhad-nav .links button {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: 8px 14px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.18s, background 0.18s;
  line-height: 1.2;
}
.sarhad-nav .links a:hover,
.sarhad-nav .links button:hover {
  color: var(--sarhad-gold);
  background: rgba(255,255,255,0.06);
}
.sarhad-nav .links a.active {
  color: #fff;
  background: rgba(255,255,255,0.10);
}
.sarhad-nav .pill {
  background: rgba(255,255,255,0.1) !important;
  border-radius: 999px !important;
  padding: 6px 16px !important;
}
.sarhad-nav .pill:hover {
  background: var(--sarhad-gold) !important;
  color: var(--sarhad-navy) !important;
}
.sarhad-nav .more {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.sarhad-nav .more:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--sarhad-gold);
  color: var(--sarhad-gold);
}
.sarhad-nav .dropdown-menu {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  margin-top: 10px;
  min-width: 240px;
  font-family: var(--font-body);
}
.sarhad-nav .dropdown-menu .dropdown-item {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.92rem;
  color: var(--ink);
  display: flex; align-items: center; gap: 10px;
  transition: background 0.15s, color 0.15s;
}
.sarhad-nav .dropdown-menu .dropdown-item:hover {
  background: var(--surface-2);
  color: var(--sarhad-navy);
}
.sarhad-nav .dropdown-menu .dropdown-item i { color: var(--muted); width: 18px; }
.sarhad-nav .dropdown-menu .dropdown-item.text-danger { color: var(--terracotta); }
.sarhad-nav .dropdown-menu .dropdown-item.text-danger:hover {
  background: rgba(196, 69, 54, 0.08); color: var(--terracotta);
}
.sarhad-nav .dropdown-menu .dropdown-item.text-danger i { color: var(--terracotta); }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  padding: 56px 0 24px;
}
.hero .eyebrow { margin-bottom: 14px; }
.hero h1 { margin: 0; }
.hero h1 em {
  font-style: italic;
  font-variation-settings: "SOFT" 80, "opsz" 144;
  color: var(--sarhad-navy-2);
  font-weight: 500;
}
.hero .lede {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 14px 0 0;
  max-width: 640px;
}
.hero .rule {
  height: 1px;
  background: var(--hairline);
  margin: 36px 0 0;
  position: relative;
}
.hero .rule::before {
  content: '';
  position: absolute;
  left: 0; top: -1px;
  height: 3px; width: 88px;
  background: var(--sarhad-gold);
}

/* ── Profile bar (identity strip below hero) ───────────────────────────── */
.profile-bar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  margin-top: 28px;
  flex-wrap: wrap;
}
.profile-bar .avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--sarhad-navy);
  flex-shrink: 0;
}
.profile-bar .info { flex: 1; min-width: 200px; }
.profile-bar .info .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: -0.01em;
  color: var(--sarhad-navy);
  margin: 0;
  line-height: 1.2;
}
.profile-bar .info .meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}
.profile-bar .info .meta i { margin-right: 4px; color: var(--muted-soft); }
.role-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--sarhad-navy);
  color: #fff;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  font-weight: 500;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
}
.role-tag .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sarhad-gold);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.25);
}

/* ── Stat tiles ────────────────────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 28px;
}
.stat {
  padding: 22px 22px 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  transition: border-color 0.18s, transform 0.18s;
}
.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--hairline-strong);
}
.stat.gold::before  { background: var(--sarhad-gold); }
.stat.sage::before  { background: var(--sage); }
.stat.amber::before { background: var(--amber); }
.stat.terra::before { background: var(--terracotta); }
.stat.azure::before { background: var(--azure); }
.stat.plum::before  { background: var(--plum); }
.stat .label {
  font-family: var(--font-body);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 500;
}
.stat .value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 2.4rem;
  color: var(--sarhad-navy);
  margin-top: 8px;
  letter-spacing: -0.04em;
  line-height: 1;
  font-weight: 500;
}
.stat .delta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat .delta i { font-size: 0.7rem; }

/* ── Section headings ──────────────────────────────────────────────────── */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 64px 0 6px;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 14px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: 1.6rem; margin: 0; }
.section-head .count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
}
.section-head + .section-sub {
  color: var(--muted);
  margin: 10px 0 24px;
  font-size: 0.95rem;
  max-width: 620px;
}

/* ── Menu / action grid (replaces the bootstrap card-icon grid) ────────── */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.menu-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px 22px 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.menu-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 0;
  background: var(--sarhad-gold);
  transition: height 0.18s ease;
}
.menu-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--sarhad-navy);
  color: var(--ink);
}
.menu-card:hover::before { height: 3px; }
.menu-card .ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--sarhad-navy);
  font-size: 1.15rem;
  margin-bottom: 14px;
  transition: background 0.18s, color 0.18s;
}
/* Accent classes kept for backward-compat but rendered uniformly — every
 * card now uses the same restrained navy-on-cream icon styling. The
 * differentiator is the LABEL, not the colour. */
.menu-card.accent-gold .ic,
.menu-card.accent-sage .ic,
.menu-card.accent-amber .ic,
.menu-card.accent-azure .ic,
.menu-card.accent-terra .ic,
.menu-card.accent-plum .ic {
  background: var(--surface-2);
  color: var(--sarhad-navy);
}
.menu-card .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 5px;
  color: var(--sarhad-navy);
}
.menu-card .desc {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}
.menu-card .arrow {
  position: absolute;
  top: 22px; right: 22px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-soft);
  font-size: 0.85rem;
  transition: color 0.18s ease, transform 0.18s ease;
}
.menu-card:hover .arrow {
  color: var(--sarhad-navy);
  transform: translate(2px, -2px);
}
.menu-card.danger {
  background: var(--sarhad-navy);
  color: #fff;
  border-color: var(--sarhad-navy);
}
.menu-card.danger::before { display: none; }
.menu-card.danger:hover { background: var(--sarhad-navy-3); }
.menu-card.danger .ic { background: rgba(255,255,255,0.08); color: #fff; }
.menu-card.danger .name { color: #fff; }
.menu-card.danger .desc { color: rgba(255,255,255,0.7); }
.menu-card.danger .arrow { color: rgba(255,255,255,0.7); }
.menu-card.danger:hover .arrow { color: var(--sarhad-gold); }

/* ── Panels (used by teacher + student dashboards) ─────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 18px;
}
.panel h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 4px;
  color: var(--sarhad-navy);
}
.panel .panel-sub {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 18px;
}

/* ── Primary action button ─────────────────────────────────────────────── */
.btn-prime {
  background: var(--sarhad-navy);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 1rem;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
  cursor: pointer;
}
.btn-prime:hover {
  background: var(--sarhad-navy-2);
  color: var(--sarhad-gold);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn-prime.gold {
  background: var(--sarhad-gold);
  color: var(--sarhad-navy);
}
.btn-prime.gold:hover {
  background: var(--sarhad-gold-2);
  color: var(--sarhad-navy);
}
.btn-ghost {
  background: transparent;
  color: var(--sarhad-navy);
  border: 1px solid var(--hairline-strong);
  font-family: var(--font-body);
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  cursor: pointer;
}
.btn-ghost:hover {
  border-color: var(--sarhad-navy);
  background: var(--surface);
  color: var(--sarhad-navy);
}

/* ── Status pills (re-usable in monitor/review/student) ────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.present  { background: rgba(74,124,89,0.12); color: var(--sage); }
.pill.pending  { background: rgba(184,134,11,0.14); color: var(--amber); }
.pill.absent   { background: rgba(196,69,54,0.12); color: var(--terracotta); }
.pill.neutral  { background: var(--surface-2); color: var(--muted); }
.pill.gold     { background: rgba(255,215,0,0.18); color: var(--sarhad-navy); }

/* ── Countdown / big number block ──────────────────────────────────────── */
.countdown {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 3.2rem;
  font-weight: 500;
  color: var(--sarhad-navy);
  letter-spacing: -0.04em;
  line-height: 1;
}

/* ── Data tables ───────────────────────────────────────────────────────── */
.table-data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.table-data th {
  text-align: left;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-2);
}
.table-data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
}
.table-data tr:last-child td { border-bottom: 0; }
.table-data tr:hover td { background: var(--bg); }

/* ── Floating help (used by student) ───────────────────────────────────── */
.notice {
  margin-top: 16px;
  padding: 14px 18px;
  background: rgba(0, 33, 71, 0.04);
  border: 1px solid rgba(0, 33, 71, 0.1);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-left: 3px solid var(--sarhad-gold);
}

/* ═══════════════════════════════════════════════════════════════════════
 * ADMIN SHELL — sidebar + topbar layout for admin & module-admin pages
 * ═══════════════════════════════════════════════════════════════════════
 *
 * Activated by header.php when the logged-in role is main_admin / sub_admin.
 * Other roles (teacher) keep the existing top-strip navigation, untouched.
 *
 * Structure:
 *   <body class="admin-shell-layout">
 *     <aside class="sidebar">       ← sticky on desktop, drawer on mobile
 *       ...nav items...
 *     </aside>
 *     <div class="sidebar-backdrop"></div>
 *     <div class="content-area">
 *       <header class="topbar">...</header>
 *       <main class="shell">...page content (unchanged)...</main>
 *       <footer class="sarhad-footer">...</footer>
 *     </div>
 *   </body>
 */
.admin-shell-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px 1fr;
  background: var(--bg);
  margin: 0;
  font-family: var(--font-body);
}

/* === SIDEBAR === */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  background:
    linear-gradient(180deg, #ffffff 0%, #fafaf7 100%);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.32s var(--ease-out);
}
/* Subtle scrollbar inside the sidebar */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--hairline-strong);
  border-radius: 6px;
}
.sidebar::-webkit-scrollbar-track { background: transparent; }

.sidebar .sb-brand {
  padding: 22px 22px 20px;
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.sidebar .sb-brand .seal {
  width: 40px; height: 40px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #fff 0%, #f4f2eb 100%);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 4px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 33, 71, 0.06);
}
.sidebar .sb-brand .seal img {
  width: 100%; height: 100%; object-fit: contain;
}
.sidebar .sb-brand .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--sarhad-navy);
  font-variation-settings: "SOFT" 0, "opsz" 14;
}
.sidebar .sb-brand .scope {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 500;
}

.sidebar .sb-role {
  margin: 14px 14px 0;
  padding: 12px 14px;
  background:
    linear-gradient(135deg, rgba(0, 33, 71, 0.05) 0%, rgba(255, 215, 0, 0.07) 100%);
  border: 1px solid rgba(0, 33, 71, 0.08);
  border-radius: 12px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar .sb-role .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sarhad-navy) 0%, var(--sarhad-navy-2) 100%);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  flex-shrink: 0;
}
.sidebar .sb-role .who { min-width: 0; }
.sidebar .sb-role .who .nm {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar .sb-role .who .rl {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 2px;
}

.sb-nav {
  flex: 1;
  padding: 10px 12px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  margin: 0;
}
.sb-nav .group-label {
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-soft);
  font-weight: 600;
  padding: 16px 14px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-nav .group-label::before {
  content: '';
  width: 12px; height: 1px;
  background: var(--hairline-strong);
}
.sb-nav li:first-child .group-label { padding-top: 6px; }

.sb-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 10px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.18s var(--ease-smooth),
              color 0.18s var(--ease-smooth),
              transform 0.18s var(--ease-smooth),
              box-shadow 0.18s var(--ease-smooth);
  position: relative;
  letter-spacing: -0.005em;
}
.sb-nav a:hover {
  background: var(--surface-2);
  color: var(--sarhad-navy);
  transform: translateX(2px);
}
.sb-nav a.active {
  background: linear-gradient(135deg, var(--sarhad-navy) 0%, var(--sarhad-navy-2) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 33, 71, 0.18);
}
.sb-nav a.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 22px;
  background: var(--sarhad-gold);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}
.sb-nav a .ic {
  width: 22px;
  text-align: center;
  font-size: 0.98rem;
  flex-shrink: 0;
  opacity: 0.85;
}
.sb-nav a.active .ic { opacity: 1; }
.sb-nav a.danger { color: var(--terracotta); }
.sb-nav a.danger:hover {
  background: rgba(196, 69, 54, 0.08);
  color: var(--terracotta);
}

/* === Sidebar footer (bottom strip with logout) === */
.sb-foot {
  flex-shrink: 0;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--hairline);
}
.sb-foot .logout-pill {
  width: 100%;
  background: transparent;
  border: 1px solid var(--hairline-strong);
  color: var(--ink-soft);
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s var(--ease-smooth);
}
.sb-foot .logout-pill:hover {
  background: var(--terracotta);
  color: #fff;
  border-color: var(--terracotta);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(196, 69, 54, 0.2);
}

/* === CONTENT AREA === */
.content-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* === TOPBAR === */
.topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--hairline);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  gap: 16px;
}
.topbar .menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--ink);
  font-size: 1rem;
  transition: background 0.18s var(--ease-smooth);
}
.topbar .menu-toggle:hover {
  background: var(--surface-2);
}
.topbar .crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--muted);
  min-width: 0;
}
.topbar .crumb .home {
  color: var(--muted-soft);
  text-decoration: none;
  transition: color 0.18s;
}
.topbar .crumb .home:hover { color: var(--sarhad-navy); }
.topbar .crumb .sep {
  color: var(--muted-soft);
  font-size: 0.7rem;
}
.topbar .crumb .current {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.topbar .icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s var(--ease-smooth);
  font-size: 0.95rem;
}
.topbar .icon-btn:hover {
  background: var(--sarhad-navy);
  color: #fff;
  border-color: var(--sarhad-navy);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 33, 71, 0.15);
}

/* === SIDEBAR BACKDROP (mobile drawer overlay) === */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 33, 71, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 45;
  opacity: 0;
  transition: opacity 0.32s var(--ease-out);
}
.sidebar-backdrop.show { opacity: 1; }

/* === ADMIN SHELL — RESPONSIVE === */
@media (max-width: 991px) {
  .admin-shell-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 280px;
    transform: translateX(-100%);
    box-shadow: 0 20px 60px rgba(0, 33, 71, 0.25);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-backdrop.show {
    display: block;
  }
  .topbar { padding: 12px 20px; }
  .topbar .menu-toggle { display: inline-flex; align-items: center; gap: 6px; }
  .content-area .shell { padding: 0 20px 60px; }
}
@media (max-width: 520px) {
  .topbar { padding: 10px 16px; }
  .topbar .crumb { font-size: 0.85rem; }
}

/* ═══════════════════════════════════════════════════════════════════════
 * MOTION — page-load reveals + reusable keyframes
 * ═══════════════════════════════════════════════════════════════════════ */
@keyframes ttr-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ttr-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes ttr-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Reveal on load with subtle stagger — applied to hero, profile bar, stat
 * cards and menu cards. Tuned to feel intentional, not flashy.
 */
.hero,
.profile-bar,
.stats .stat,
.menu-grid .menu-card,
.panel,
.section-head {
  animation: ttr-fade-up 0.55s var(--ease-out) both;
}
.profile-bar     { animation-delay: 80ms; }
.stats .stat:nth-child(1) { animation-delay: 100ms; }
.stats .stat:nth-child(2) { animation-delay: 140ms; }
.stats .stat:nth-child(3) { animation-delay: 180ms; }
.stats .stat:nth-child(4) { animation-delay: 220ms; }
.stats .stat:nth-child(5) { animation-delay: 260ms; }
.menu-grid .menu-card:nth-child(1)  { animation-delay: 240ms; }
.menu-grid .menu-card:nth-child(2)  { animation-delay: 280ms; }
.menu-grid .menu-card:nth-child(3)  { animation-delay: 320ms; }
.menu-grid .menu-card:nth-child(4)  { animation-delay: 360ms; }
.menu-grid .menu-card:nth-child(5)  { animation-delay: 400ms; }
.menu-grid .menu-card:nth-child(6)  { animation-delay: 440ms; }
.menu-grid .menu-card:nth-child(7)  { animation-delay: 480ms; }
.menu-grid .menu-card:nth-child(8)  { animation-delay: 520ms; }
.menu-grid .menu-card:nth-child(n+9){ animation-delay: 560ms; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
 * REFINEMENTS — premium light-theme touches
 * ═══════════════════════════════════════════════════════════════════════ */

/* Menu cards: smoother hover with multi-layer shadow + corner glow */
.menu-card {
  transition: transform 0.28s var(--ease-out),
              box-shadow 0.28s var(--ease-out),
              border-color 0.28s var(--ease-out);
}
.menu-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 1px 2px rgba(0, 33, 71, 0.04),
    0 8px 24px rgba(0, 33, 71, 0.10),
    0 16px 48px rgba(0, 33, 71, 0.04);
}
.menu-card .ic {
  transition: transform 0.32s var(--ease-spring),
              background 0.2s var(--ease-smooth);
}
.menu-card:hover .ic {
  transform: scale(1.06) rotate(-2deg);
}

/* Stat tiles — subtle gradient surface + hover lift */
.stat {
  background:
    linear-gradient(180deg, #ffffff 0%, #fdfcf8 100%);
  transition: transform 0.28s var(--ease-out),
              box-shadow 0.28s var(--ease-out);
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 2px rgba(0, 33, 71, 0.04),
    0 6px 18px rgba(0, 33, 71, 0.08);
}

/* Hero italic gets a soft gold underline accent on hover (for the dashboard h1) */
.hero h1 em {
  background: linear-gradient(180deg, transparent 70%, rgba(255, 215, 0, 0.35) 70%);
  background-size: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size 0.6s var(--ease-out);
}
.hero:hover h1 em {
  background-size: 100% 100%;
}

/* Profile bar — premium edge highlight */
.profile-bar {
  position: relative;
  overflow: hidden;
}
.profile-bar::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--sarhad-navy) 0%, var(--sarhad-gold) 100%);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}
.profile-bar:hover::before { opacity: 1; }

/* Buttons — softer, more refined */
.btn-prime {
  transition: background 0.24s var(--ease-smooth),
              color 0.24s var(--ease-smooth),
              transform 0.24s var(--ease-out),
              box-shadow 0.24s var(--ease-out);
  box-shadow: 0 1px 2px rgba(0, 33, 71, 0.10),
              0 4px 12px rgba(0, 33, 71, 0.08);
}
.btn-prime:hover {
  box-shadow: 0 2px 4px rgba(0, 33, 71, 0.12),
              0 10px 24px rgba(0, 33, 71, 0.18);
}

/* ═══════════════════════════════════════════════════════════════════════
 * BOOTSTRAP OVERRIDES — make every legacy/module page look like the
 * design system by overriding Bootstrap's default form / table / button /
 * modal / alert / badge rules. This is the single biggest lever for
 * cross-page consistency.
 * ═══════════════════════════════════════════════════════════════════════ */

/* Strong body defaults — these cascade into every page that doesn't load
 * its own conflicting CSS.
 *
 * STICKY FOOTER baseline: body is a flex column with min-height = 100vh.
 * The footer ends up as the last flex child with `margin-top: auto`, so
 * it always sits at the bottom of the viewport regardless of content
 * height. Login pages re-declare display: grid (specificity wins), and
 * the admin shell's grid is on a child <div>, not body — both still work.
 */
html { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Admin shell expands to fill the body so its internal layout works. */
.admin-shell-layout {
  flex: 1 0 auto;
}

/* For non-admin pages, the page's main content area should expand so the
 * footer is pushed to the bottom. Covers Bootstrap .container, custom
 * wrappers used by individual pages, and the design system's .shell. */
body > .container,
body > .container-fluid,
body > main,
body > .shell,
body > .wrap,
body > .dashboard-wrapper {
  flex: 1 0 auto;
}

/* === Containers (Bootstrap .container, custom ones) === */
.container,
.container-fluid {
  font-family: var(--font-body);
}

/* === Headings inside content === */
.shell h1, .shell h2, .shell h3,
.container h1, .container h2, .container h3,
main h1, main h2, main h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--sarhad-navy);
  font-variation-settings: "SOFT" 30, "opsz" 144;
}

/* === Forms === */
.form-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-control,
.form-select {
  font-family: var(--font-body);
  font-size: 0.94rem;
  padding: 11px 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.18s var(--ease-smooth),
              box-shadow 0.18s var(--ease-smooth);
  box-shadow: none;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--sarhad-navy);
  box-shadow: 0 0 0 3px rgba(0, 33, 71, 0.08);
  outline: none;
}
.form-control::placeholder { color: var(--muted-soft); }
.form-text { color: var(--muted); font-size: 0.84rem; }
.form-check-input:checked {
  background-color: var(--sarhad-navy);
  border-color: var(--sarhad-navy);
}
.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(0, 33, 71, 0.12);
  border-color: var(--sarhad-navy);
}

/* === Buttons === */
.btn {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 10px 18px;
  border-radius: 10px;
  letter-spacing: 0;
  transition: background 0.2s var(--ease-smooth),
              color 0.2s var(--ease-smooth),
              border-color 0.2s var(--ease-smooth),
              transform 0.2s var(--ease-out),
              box-shadow 0.2s var(--ease-out);
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--sarhad-navy);
  border-color: var(--sarhad-navy);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 33, 71, 0.10),
              0 4px 10px rgba(0, 33, 71, 0.08);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--sarhad-navy-2);
  border-color: var(--sarhad-navy-2);
  color: var(--sarhad-gold);
  box-shadow: 0 2px 4px rgba(0, 33, 71, 0.12),
              0 10px 20px rgba(0, 33, 71, 0.16);
}
.btn-secondary {
  background: var(--surface-2);
  border-color: var(--hairline-strong);
  color: var(--ink);
}
.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--sarhad-navy);
  color: var(--sarhad-navy);
}
.btn-outline-primary {
  background: transparent;
  border-color: var(--hairline-strong);
  color: var(--sarhad-navy);
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: var(--sarhad-navy);
  border-color: var(--sarhad-navy);
  color: #fff;
}
.btn-outline-secondary {
  background: transparent;
  border-color: var(--hairline-strong);
  color: var(--ink-soft);
}
.btn-outline-secondary:hover {
  background: var(--surface-2);
  border-color: var(--ink-soft);
  color: var(--ink);
}
.btn-success {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}
.btn-success:hover { background: #3d6b4a; border-color: #3d6b4a; color: #fff; }
.btn-warning {
  background: var(--sarhad-gold);
  border-color: var(--sarhad-gold-2);
  color: var(--sarhad-navy);
}
.btn-warning:hover {
  background: var(--sarhad-gold-2);
  border-color: var(--sarhad-gold-2);
  color: var(--sarhad-navy);
}
.btn-danger {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #fff;
}
.btn-danger:hover { background: #a83b2e; border-color: #a83b2e; color: #fff; }
.btn-info {
  background: var(--azure);
  border-color: var(--azure);
  color: #fff;
}
.btn-outline-warning {
  background: transparent;
  border-color: var(--hairline-strong);
  color: var(--amber);
}
.btn-outline-warning:hover {
  background: var(--sarhad-gold);
  border-color: var(--sarhad-gold-2);
  color: var(--sarhad-navy);
}
.btn-outline-danger {
  background: transparent;
  border-color: var(--hairline-strong);
  color: var(--terracotta);
}
.btn-outline-danger:hover {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #fff;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: 8px;
}

/* === Tables === */
.table {
  font-family: var(--font-body);
  color: var(--ink);
  border-color: var(--hairline);
}
.table > thead {
  background: var(--surface-2);
  border-bottom: 1px solid var(--hairline-strong);
}
.table > thead th {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 14px;
  border: 0;
  background: transparent !important;
}
.table > tbody td {
  padding: 12px 14px;
  border-color: var(--hairline);
  vertical-align: middle;
  background: var(--surface);
}
.table-bordered { border-color: var(--hairline) !important; }
.table-bordered > tbody > tr > td,
.table-bordered > thead > tr > th { border-color: var(--hairline) !important; }
.table-striped > tbody > tr:nth-of-type(odd) > td { background: var(--bg); }
.table-hover > tbody > tr:hover > td { background: var(--surface-2); }

/* === Modals === */
.modal-content {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 33, 71, 0.18);
  background: var(--surface);
}
.modal-header {
  background: var(--sarhad-navy);
  color: #fff;
  border: 0;
  padding: 18px 22px;
}
.modal-header .modal-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.modal-body { padding: 22px; font-family: var(--font-body); }
.modal-footer {
  border-top: 1px solid var(--hairline);
  padding: 14px 22px;
}
.btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); }

/* === Alerts === */
.alert {
  border-radius: 10px;
  border-width: 1px;
  border-style: solid;
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 12px 16px;
}
.alert-info {
  background: rgba(44, 95, 141, 0.06);
  border-color: rgba(44, 95, 141, 0.18);
  color: var(--azure);
}
.alert-success {
  background: rgba(74, 124, 89, 0.08);
  border-color: rgba(74, 124, 89, 0.22);
  color: var(--sage);
}
.alert-warning {
  background: rgba(184, 134, 11, 0.10);
  border-color: rgba(184, 134, 11, 0.25);
  color: var(--amber);
}
.alert-danger {
  background: rgba(196, 69, 54, 0.08);
  border-color: rgba(196, 69, 54, 0.22);
  color: var(--terracotta);
}

/* === Badges === */
.badge {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 999px;
}
.bg-primary  { background: var(--sarhad-navy) !important; }
.bg-success  { background: var(--sage) !important; }
.bg-warning  { background: var(--sarhad-gold) !important; color: var(--sarhad-navy) !important; }
.bg-danger   { background: var(--terracotta) !important; }
.bg-secondary{ background: var(--muted) !important; }
.bg-info     { background: var(--azure) !important; }

/* === Page-wrapping .container in legacy pages — bring it inline === */
.shell + .container,
main > .container {
  font-family: var(--font-body);
}

/* ── Footer — global brand strip + developer credit ─────────────────────
 * margin-top: auto is the second half of the sticky-footer pattern — it
 * absorbs all remaining vertical space inside the flex column so the
 * footer pins to the bottom of the viewport even on near-empty pages.
 * flex-shrink: 0 stops the footer from squishing on tiny viewports. */
.sarhad-footer {
  margin-top: auto;
  flex-shrink: 0;
  padding-top: 0;
  background: var(--sarhad-navy);
  color: rgba(255, 255, 255, 0.82);
  border-top: 3px solid var(--sarhad-gold);
  position: relative;
}
.sarhad-footer::before {
  /* Subtle gold whisper across the top edge */
  content: '';
  position: absolute;
  inset: -3px 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sarhad-gold), transparent);
  opacity: 0.4;
}
.sarhad-footer .inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 30px 24px 26px;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 32px;
  align-items: center;
}
.sarhad-footer .brand-col {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.sarhad-footer .brand-col .seal {
  width: 42px; height: 42px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 8px;
  padding: 5px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.sarhad-footer .brand-col .seal img {
  width: 100%; height: 100%; object-fit: contain;
}
.sarhad-footer .brand-col .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.1;
  font-variation-settings: "SOFT" 0, "opsz" 14;
}
.sarhad-footer .brand-col .line {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.sarhad-footer .credit-col {
  text-align: center;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 20px;
}
.sarhad-footer .credit-col .system {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 8px;
}
.sarhad-footer .credit-col .dev {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 500;
  font-style: italic;
  font-variation-settings: "SOFT" 60, "opsz" 144;
  color: #fff;
  letter-spacing: -0.005em;
}
.sarhad-footer .credit-col .dev .by {
  font-style: normal;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
  margin-right: 6px;
}
.sarhad-footer .credit-col .dev strong {
  color: var(--sarhad-gold);
  font-weight: 600;
  font-style: italic;
}
.sarhad-footer .meta-col {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
}
.sarhad-footer .meta-col .year {
  color: #fff;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.sarhad-footer .meta-col .ver {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

/* ── Modern login layout — full-bleed campus image with centred card ──
 *
 * Structure:
 *   <body class="sarhad-login-page">
 *     <div class="login-shell">              <-- centring wrapper
 *       <article class="sarhad-login-card-v2">
 *         ...brand + form...
 *       </article>
 *     </div>
 *     <?php include footer ?>                <-- sticky at the bottom
 *   </body>
 *
 * The body uses bglogo.jpg as a fixed full-viewport background with a
 * navy gradient overlay so the photo reads as atmosphere, not competition
 * with the form. Decorative gold circles add quiet brand presence.
 */
.sarhad-login-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(0, 33, 71, 0.78) 0%, rgba(0, 21, 48, 0.92) 100%),
    url('../images/bglogo.jpg') center center / cover no-repeat fixed;
  position: relative;
  overflow-x: hidden;
}

/* Far-off decorative whispers */
.sarhad-login-page::before {
  content: '';
  position: fixed;
  top: -240px; right: -240px;
  width: 600px; height: 600px;
  border: 1px solid rgba(255, 215, 0, 0.12);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.sarhad-login-page::after {
  content: '';
  position: fixed;
  bottom: -180px; left: -180px;
  width: 420px; height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.sarhad-login-page .login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: relative;
  z-index: 1;
}

/* === CENTRED CARD — iOS "liquid glass" treatment over the full-bleed bg
 *
 * Layered for a premium glass feel:
 *   1. Multi-stop translucent gradient (brighter at top, cooler at bottom)
 *   2. Strong backdrop blur + saturation boost — picks up the bg image
 *   3. Outer multi-layer drop shadow (deep + close)
 *   4. Inner top-edge highlight (catches "light" — the iOS signature)
 *   5. Soft ambient gold halo underneath (very subtle warmth)
 *   6. Decorative brand stripe at the very top edge
 *   7. Light-reflection sheen across the top (::after)
 * ====================================================================== */
.sarhad-login-card-v2 {
  width: 100%;
  max-width: 460px;
  padding: 40px 36px 32px;
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.7);

  /* Layered translucent gradient — top brighter, bottom marginally cooler */
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.96) 0%,
      rgba(252, 252, 255, 0.86) 50%,
      rgba(248, 250, 254, 0.92) 100%
    );

  /* iOS-style frosted-glass filter — strong blur + saturation lift */
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);

  /* Multi-layer shadow stack:
   *   - thin ambient gold glow (atmospheric)
   *   - deep navy outer (lifts the card visibly off the bg image)
   *   - close shadow for solidity
   *   - inset top-edge highlight (the glass "light catch")
   *   - inset thin ring (subtle definition)
   */
  box-shadow:
    0 0 90px rgba(255, 215, 0, 0.06),
    0 30px 72px rgba(0, 17, 40, 0.55),
    0 14px 32px rgba(0, 33, 71, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;

  animation: ttr-fade-up 0.6s var(--ease-out) both;
  animation-delay: 100ms;
}

/* Brand stripe at the very top edge */
.sarhad-login-card-v2::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--sarhad-navy) 0%,
    var(--sarhad-navy-2) 55%,
    var(--sarhad-gold) 100%);
  border-radius: 26px 26px 0 0;
  z-index: 2;
}

/* Light-reflection sheen — narrow band of brightness across the top, like
 * sunlight catching the curve of a glass surface. Pure decoration. */
.sarhad-login-card-v2::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 12%;
  right: 12%;
  height: 32px;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0) 100%);
  border-radius: 50%;
  filter: blur(8px);
  pointer-events: none;
  z-index: 1;
}

/* Bring inner content above the sheen layer */
.sarhad-login-card-v2 > * {
  position: relative;
  z-index: 3;
}

/* Brand block (logo + college name + scope rule) */
.sarhad-login-card-v2 .brand {
  text-align: center;
  margin-bottom: 24px;
}
.sarhad-login-card-v2 .brand .seal {
  width: 78px;
  height: 78px;
  margin: 0 auto 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fafaf7 100%);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 10px 24px rgba(0, 33, 71, 0.18),
    0 2px 6px rgba(0, 33, 71, 0.08);
  transition: transform 0.4s var(--ease-spring);
}
.sarhad-login-card-v2:hover .brand .seal {
  transform: translateY(-2px) scale(1.02);
}
.sarhad-login-card-v2 .brand .seal img {
  width: 100%; height: 100%; object-fit: contain;
}
.sarhad-login-card-v2 .brand .college {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--sarhad-navy);
  margin: 0;
  letter-spacing: -0.015em;
  line-height: 1.1;
  font-variation-settings: "SOFT" 0, "opsz" 144;
}
.sarhad-login-card-v2 .brand .scope {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 10px;
  font-weight: 500;
}
.sarhad-login-card-v2 .brand .scope::before,
.sarhad-login-card-v2 .brand .scope::after {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--hairline-strong);
  flex-shrink: 0;
}

/* Italic editorial pitch */
.sarhad-login-card-v2 .pitch {
  text-align: center;
  margin: 0 0 28px;
  padding: 0 8px;
}
.sarhad-login-card-v2 .pitch p {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.4;
  font-style: italic;
  font-variation-settings: "SOFT" 80, "opsz" 144;
}
.sarhad-login-card-v2 .pitch p em {
  font-style: italic;
  color: var(--sarhad-navy);
  font-weight: 600;
}

/* Form fields */
.sarhad-login-card-v2 .field {
  margin-bottom: 14px;
}
.sarhad-login-card-v2 .field label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.sarhad-login-card-v2 .field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.96rem;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  transition: border-color 0.2s var(--ease-smooth),
              box-shadow 0.2s var(--ease-smooth),
              background 0.2s var(--ease-smooth);
}
.sarhad-login-card-v2 .field input::placeholder {
  color: var(--muted-soft);
}
.sarhad-login-card-v2 .field input:focus {
  outline: none;
  border-color: var(--sarhad-navy);
  box-shadow: 0 0 0 4px rgba(0, 33, 71, 0.08);
  background: #fff;
}

.sarhad-login-card-v2 .submit {
  width: 100%;
  background: linear-gradient(135deg, var(--sarhad-navy) 0%, var(--sarhad-navy-2) 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 15px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: color 0.24s var(--ease-smooth),
              transform 0.24s var(--ease-out),
              box-shadow 0.24s var(--ease-out);
  box-shadow:
    0 1px 2px rgba(0, 33, 71, 0.20),
    0 6px 14px rgba(0, 33, 71, 0.22);
}
.sarhad-login-card-v2 .submit:hover {
  color: var(--sarhad-gold);
  transform: translateY(-1px);
  box-shadow:
    0 2px 4px rgba(0, 33, 71, 0.24),
    0 12px 28px rgba(0, 33, 71, 0.32);
}

.sarhad-login-card-v2 .below-link {
  text-align: center;
  margin-top: 20px;
  font-size: 0.86rem;
}
.sarhad-login-card-v2 .below-link a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--hairline-strong);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.sarhad-login-card-v2 .below-link a:hover {
  color: var(--sarhad-navy);
  border-color: var(--sarhad-navy);
}

.sarhad-login-card-v2 .alert {
  background: rgba(196, 69, 54, 0.10);
  color: var(--terracotta);
  border: 1px solid rgba(196, 69, 54, 0.22);
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sarhad-login-card-v2 .alert i { font-size: 1rem; }

/* Footer over the dark background — translucent navy */
.sarhad-login-page .sarhad-footer {
  margin-top: 0;
  background: rgba(0, 21, 48, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top-color: rgba(255, 215, 0, 0.6);
}

/* ── Legacy split-screen elements kept hidden (in case any page still uses them) === */
.sarhad-login-page .image-panel,
.sarhad-login-page .form-panel { display: none; }
/* Decorative geometric whispers — quiet, far-off */
.sarhad-login-page .image-panel::before {
  content: '';
  position: absolute;
  top: -120px; right: -140px;
  width: 420px; height: 420px;
  border: 1px solid rgba(255, 215, 0, 0.18);
  border-radius: 50%;
  z-index: -1;
}
.sarhad-login-page .image-panel::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -100px;
  width: 300px; height: 300px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  z-index: -1;
}

.sarhad-login-page .image-panel .top {
  display: flex; align-items: center; gap: 14px;
}
.sarhad-login-page .image-panel .top .seal {
  width: 50px; height: 50px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 12px;
  padding: 6px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.sarhad-login-page .image-panel .top .seal img {
  width: 100%; height: 100%; object-fit: contain;
}
.sarhad-login-page .image-panel .top .words .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.05;
  font-variation-settings: "SOFT" 0, "opsz" 14;
}
.sarhad-login-page .image-panel .top .words .scope {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 3px;
}

.sarhad-login-page .image-panel .pitch {
  max-width: 460px;
}
.sarhad-login-page .image-panel .pitch .eyebrow {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.sarhad-login-page .image-panel .pitch .eyebrow::before {
  content: '';
  width: 24px; height: 2px;
  background: var(--sarhad-gold);
  display: inline-block;
}
.sarhad-login-page .image-panel .pitch h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.2vw, 3rem);
  color: #fff;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 18px 0 0;
  font-variation-settings: "SOFT" 30, "opsz" 144;
}
.sarhad-login-page .image-panel .pitch h2 em {
  color: var(--sarhad-gold);
  font-style: italic;
  font-weight: 500;
  font-variation-settings: "SOFT" 100, "opsz" 144;
}
.sarhad-login-page .image-panel .pitch .lede {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
  line-height: 1.5;
  max-width: 380px;
}

.sarhad-login-page .image-panel .features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sarhad-login-page .image-panel .features .feature {
  display: flex; align-items: center; gap: 14px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.94rem;
}
.sarhad-login-page .image-panel .features .feature .ic {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.12);
  color: var(--sarhad-gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  border: 1px solid rgba(255, 215, 0, 0.25);
}

/* === Right/bottom panel: the form === */
.sarhad-login-page .form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 40px;
  background: var(--bg);
  position: relative;
}
.sarhad-login-page .form-container {
  width: 100%;
  max-width: 400px;
}

/* On desktop the seal lives in the image panel; on mobile we show a tiny
   one above the form so the brand is still visible at the form. */
.sarhad-login-page .form-container .mobile-seal {
  display: none;
}

.sarhad-login-page .form-container .eyebrow {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.sarhad-login-page .form-container .eyebrow::before {
  content: '';
  width: 22px; height: 2px;
  background: var(--sarhad-gold);
  display: inline-block;
}
.sarhad-login-page .form-container .title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  color: var(--sarhad-navy);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  line-height: 1.05;
}
.sarhad-login-page .form-container .title em {
  font-style: italic;
  color: var(--sarhad-navy-2);
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-weight: 500;
}
.sarhad-login-page .form-container .subtitle {
  color: var(--muted);
  margin: 0 0 32px;
  font-size: 0.95rem;
}

.sarhad-login-page .form-container .field {
  margin-bottom: 14px;
}
.sarhad-login-page .form-container .field label {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 8px;
}
.sarhad-login-page .form-container .field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.96rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.sarhad-login-page .form-container .field input:focus {
  outline: none;
  border-color: var(--sarhad-navy);
  box-shadow: 0 0 0 4px rgba(0, 33, 71, 0.08);
}
.sarhad-login-page .form-container .submit {
  width: 100%;
  background: var(--sarhad-navy);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 15px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.18s, color 0.18s, transform 0.18s, box-shadow 0.18s;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.sarhad-login-page .form-container .submit:hover {
  background: var(--sarhad-navy-2);
  color: var(--sarhad-gold);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 33, 71, 0.18);
}
.sarhad-login-page .form-container .below-link {
  text-align: center;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--muted);
}
.sarhad-login-page .form-container .below-link a {
  color: var(--sarhad-navy);
  text-decoration: none;
  border-bottom: 1px dotted var(--hairline-strong);
  padding-bottom: 1px;
  transition: color 0.18s, border-color 0.18s;
}
.sarhad-login-page .form-container .below-link a:hover {
  color: var(--sarhad-gold-2);
  border-color: var(--sarhad-gold-2);
}
.sarhad-login-page .form-container .alert {
  background: rgba(196, 69, 54, 0.08);
  color: var(--terracotta);
  border: 1px solid rgba(196, 69, 54, 0.22);
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sarhad-login-page .form-container .alert i {
  font-size: 1rem;
}

/* === Responsive — collapse split into stacked at < 992px === */
@media (max-width: 991px) {
  .sarhad-login-page .login-shell {
    grid-template-columns: 1fr;
  }
  .sarhad-login-page .image-panel {
    min-height: auto;
    padding: 32px 28px;
    gap: 24px;
  }
  .sarhad-login-page .image-panel .pitch {
    max-width: none;
  }
  .sarhad-login-page .image-panel .pitch h2 {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
  }
  .sarhad-login-page .image-panel .pitch .lede {
    font-size: 0.92rem;
    max-width: none;
  }
  .sarhad-login-page .image-panel .features {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px 20px;
  }
  .sarhad-login-page .image-panel .features .feature {
    font-size: 0.84rem;
  }
}

@media (max-width: 600px) {
  .sarhad-login-page .image-panel {
    padding: 28px 22px;
    gap: 18px;
  }
  .sarhad-login-page .image-panel .top .seal { width: 42px; height: 42px; }
  .sarhad-login-page .image-panel .top .words .name { font-size: 1.02rem; }
  .sarhad-login-page .image-panel .top .words .scope { font-size: 0.65rem; }
  .sarhad-login-page .image-panel .pitch .lede {
    display: none;
  }
  .sarhad-login-page .image-panel .features {
    display: none;
  }
  .sarhad-login-page .form-panel {
    padding: 36px 22px 44px;
  }
  .sarhad-login-page .form-container .title { font-size: 1.55rem; }
  .sarhad-login-page .form-container .subtitle { margin-bottom: 24px; }
}

/* ── Legacy login card (kept for backward compatibility) ───────────────── */
.sarhad-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 0% 0%,   rgba(0, 33, 71, 0.25), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(255, 215, 0, 0.10), transparent 50%),
    var(--bg);
  position: relative;
  overflow: hidden;
}
.sarhad-login-screen::before,
.sarhad-login-screen::after {
  /* Decorative thin gold circles, far-off and quiet */
  content: '';
  position: absolute;
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 50%;
  pointer-events: none;
}
.sarhad-login-screen::before {
  width: 480px; height: 480px;
  top: -120px; right: -120px;
}
.sarhad-login-screen::after {
  width: 320px; height: 320px;
  bottom: -80px; left: -80px;
  border-color: rgba(0, 33, 71, 0.08);
}
.sarhad-login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(0, 33, 71, 0.12);
  padding: 40px 36px 32px;
  position: relative;
  overflow: hidden;
}
.sarhad-login-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--sarhad-navy), var(--sarhad-navy-2), var(--sarhad-gold));
}
.sarhad-login-card .seal {
  width: 84px; height: 84px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 10px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(0, 33, 71, 0.10);
}
.sarhad-login-card .seal img {
  width: 100%; height: 100%; object-fit: contain;
}
.sarhad-login-card .college {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.55rem;
  color: var(--sarhad-navy);
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0;
}
.sarhad-login-card .college .of {
  font-style: italic;
  font-weight: 500;
  font-variation-settings: "SOFT" 80, "opsz" 144;
  color: var(--sarhad-navy-2);
}
.sarhad-login-card .scope {
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 10px 0 8px;
  font-weight: 500;
}
.sarhad-login-card .scope::before,
.sarhad-login-card .scope::after {
  content: '';
  display: inline-block;
  width: 20px; height: 1px;
  background: var(--hairline-strong);
  vertical-align: middle;
  margin: 0 10px;
}
.sarhad-login-card .portal {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0 0 24px;
  letter-spacing: -0.005em;
}
.sarhad-login-card .field {
  position: relative;
  margin-bottom: 14px;
}
.sarhad-login-card .field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.96rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.sarhad-login-card .field input:focus {
  outline: none;
  border-color: var(--sarhad-navy);
  box-shadow: 0 0 0 3px rgba(0, 33, 71, 0.08);
}
.sarhad-login-card .submit {
  width: 100%;
  background: var(--sarhad-navy);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.18s, color 0.18s;
}
.sarhad-login-card .submit:hover {
  background: var(--sarhad-navy-2);
  color: var(--sarhad-gold);
}
.sarhad-login-card .below-link {
  text-align: center;
  margin-top: 16px;
  font-size: 0.88rem;
}
.sarhad-login-card .below-link a {
  color: var(--sarhad-navy);
  text-decoration: none;
  border-bottom: 1px dotted var(--hairline-strong);
  padding-bottom: 1px;
  transition: color 0.18s, border-color 0.18s;
}
.sarhad-login-card .below-link a:hover {
  color: var(--sarhad-gold-2);
  border-color: var(--sarhad-gold-2);
}
.sarhad-login-card .alert {
  background: rgba(196, 69, 54, 0.08);
  color: var(--terracotta);
  border: 1px solid rgba(196, 69, 54, 0.2);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  text-align: center;
  margin-bottom: 18px;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { padding: 44px 0 18px; }
}
@media (max-width: 768px) {
  .sarhad-nav .inner { padding: 0 16px; }
  .sarhad-nav .brand .scope { display: none; }
  .sarhad-nav .links a, .sarhad-nav .links button { padding: 8px 10px; font-size: 0.86rem; }
  .sarhad-nav .links .label-nav { display: none; }
  .shell { padding: 0 16px 56px; }
  .hero { padding: 32px 0 14px; }
  .hero h1 { font-size: clamp(1.7rem, 6vw, 2.4rem); }
  .hero .lede { font-size: 0.95rem; }
  .profile-bar { padding: 16px; gap: 14px; }
  .profile-bar .avatar { width: 50px; height: 50px; }
  .profile-bar .info .name { font-size: 1.05rem; }
  .profile-bar .info .meta { gap: 10px; font-size: 0.8rem; }
  .menu-grid { grid-template-columns: 1fr; gap: 12px; }
  .stat { padding: 18px; }
  .stat .value { font-size: 2rem; }
  .countdown { font-size: 2.6rem; }
  /* Dashboard: day-selector hint clutters on phones — drop it. */
  .panel .tt-hint { display: none; }
  /* Stack the day-selector / adjustment-select rows cleanly. */
  .panel select.form-select { max-width: 100% !important; width: 100%; }
  .section-head { flex-wrap: wrap; gap: 6px; }
}
@media (max-width: 520px) {
  .sarhad-nav .brand .name {
    font-size: 0.95rem;
    max-width: 145px;
    line-height: 1.05;
    white-space: normal;
  }
  .hero h1 { font-size: clamp(1.45rem, 6.5vw, 2rem); }
  .hero .eyebrow { font-size: 0.7rem; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat .label { font-size: 0.68rem; }
  .stat .value { font-size: 1.7rem; }
  .panel { padding: 18px; }
  .section-head h2 { font-size: 1.35rem; }
  .sarhad-login-card { padding: 32px 24px 26px; }
  .sarhad-login-card .seal { width: 70px; height: 70px; border-radius: 14px; }
  .sarhad-login-card .college { font-size: 1.35rem; }
  /* Phone-tight panels: less internal padding so the cards inside breathe. */
  .panel { padding: 14px !important; }
  .profile-bar .role-tag { font-size: 0.65rem; padding: 5px 10px; }
  .btn-prime, .btn-ghost { font-size: 0.9rem; padding: 10px 16px; }
}
@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr; }
  .stat { padding: 14px 16px; }
  .stat .value { font-size: 1.55rem; }
  .hero h1 { font-size: 1.4rem; }
  .profile-bar { padding: 14px; }
  .profile-bar .role-tag { width: 100%; justify-content: center; }
}

/* Footer responsive — current footer markup uses .sarhad-footer-inner,
 * legacy markup uses .inner; cover both so old + new layouts both stack. */
@media (max-width: 820px) {
  .sarhad-footer .inner,
  .sarhad-footer .sarhad-footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 20px;
    padding: 26px 20px 22px;
  }
  .sarhad-footer .brand-col {
    justify-content: center;
  }
  .sarhad-footer .credit-col {
    border-left: 0;
    border-right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 18px 0;
  }
  .sarhad-footer .meta-col { text-align: center; }
}

/* ──────────────────────────────────────────────────────────────────────
 * STUDENT PAGES + PHONE POLISH — extended responsive block.
 *
 * Covers:
 *   - .sarhad-login-card-v2 (student login card) at every breakpoint
 *   - Student dashboard's inline-styled live-session hero panel
 *   - Profile-bar avatar + role-tag size on phones
 *   - Mark-attendance button (inline-styled .btn-prime.gold)
 *   - Countdown, eyebrow, pitch sizes
 *   - Footer + masthead seal at very small screens
 *
 * Inline styles in student dashboard.php are overridden via [style*="..."]
 * attribute selectors + !important — works without touching the PHP.
 * ────────────────────────────────────────────────────────────────────── */

/* ── Tablet & medium phones (≤ 768px) ──────────────────────────────── */
@media (max-width: 768px) {
  /* Student login card v2 */
  .sarhad-login-card-v2 {
    padding: 32px 26px 26px;
    border-radius: 22px;
    max-width: 92vw;
  }
  .sarhad-login-card-v2 .brand .seal {
    width: 70px; height: 70px; border-radius: 18px; padding: 8px;
  }
  .sarhad-login-card-v2 .brand .college { font-size: 1.45rem; }
  .sarhad-login-card-v2 .pitch p { font-size: 0.98rem; }
  .sarhad-login-card-v2 .field input { padding: 13px 14px; font-size: 0.95rem; }
  .sarhad-login-card-v2 .submit { padding: 14px 16px; font-size: 0.96rem; }

  /* Student dashboard live-session hero panel (inline-styled) */
  .panel[style*="linear-gradient(135deg, #002147"] {
    padding: 24px !important;
    margin-top: 22px !important;
  }
  .panel[style*="linear-gradient(135deg, #002147"] h2 {
    font-size: 1.4rem !important;
    margin: 10px 0 6px !important;
  }
  .panel[style*="linear-gradient(135deg, #002147"] .countdown {
    font-size: 2.2rem !important;
  }

  /* Profile-bar avatar (inline-styled) — keep a usable touch size */
  .profile-bar .avatar[style*="background: var(--sarhad-navy)"] {
    width: 50px !important;
    height: 50px !important;
    font-size: 1.1rem !important;
  }

  /* Mark-attendance gold button — looks lost at full padding on phone */
  .btn-prime[style*="padding: 16px 32px"] {
    padding: 14px 22px !important;
    font-size: 0.98rem !important;
  }

  /* Status pill inside the hero — tighter */
  .panel[style*="linear-gradient(135deg, #002147"] .pill[style*="padding: 8px 18px"] {
    padding: 7px 14px !important;
    font-size: 0.92rem !important;
  }
}

/* ── Phones (≤ 520px) ──────────────────────────────────────────────── */
@media (max-width: 520px) {
  /* Login card v2 — already-good cream theme breakpoint sits here */
  .sarhad-login-page .login-shell { padding: 28px 16px; }
  .sarhad-login-card-v2 {
    padding: 26px 20px 22px;
    border-radius: 20px;
    max-width: 100%;
  }
  .sarhad-login-card-v2 .brand { margin-bottom: 18px; }
  .sarhad-login-card-v2 .brand .seal {
    width: 62px; height: 62px; border-radius: 16px; padding: 7px;
    margin-bottom: 12px;
  }
  .sarhad-login-card-v2 .brand .college { font-size: 1.3rem; }
  .sarhad-login-card-v2 .brand .scope {
    font-size: 0.66rem; letter-spacing: 0.18em;
  }
  .sarhad-login-card-v2 .brand .scope::before,
  .sarhad-login-card-v2 .brand .scope::after { width: 16px; }
  .sarhad-login-card-v2 .pitch { margin: 0 0 20px; padding: 0 4px; }
  .sarhad-login-card-v2 .pitch p { font-size: 0.92rem; }
  .sarhad-login-card-v2 .field { margin-bottom: 12px; }
  .sarhad-login-card-v2 .field input { padding: 12px 14px; font-size: 0.92rem; }
  .sarhad-login-card-v2 .submit { padding: 13px 16px; font-size: 0.94rem; }

  /* Live-session hero — phone-tight, stacked, no decorative rings */
  .panel[style*="linear-gradient(135deg, #002147"] {
    padding: 18px !important;
    margin-top: 18px !important;
  }
  .panel[style*="linear-gradient(135deg, #002147"] h2 {
    font-size: 1.2rem !important;
  }
  .panel[style*="linear-gradient(135deg, #002147"] .countdown {
    font-size: 1.9rem !important;
  }
  /* Hide the two decorative ring divs (positioned absolutely with border-radius:50%) */
  .panel[style*="linear-gradient(135deg, #002147"] > div[style*="border-radius: 50%"] {
    display: none !important;
  }

  /* Mark-attendance button — go full-width on phones */
  .btn-prime[style*="padding: 16px 32px"] {
    width: 100% !important;
    justify-content: center !important;
    padding: 13px 18px !important;
    font-size: 0.95rem !important;
  }

  /* Stretchy parent that wraps the button + countdown — let it stack */
  .panel[style*="linear-gradient(135deg, #002147"] .d-flex.flex-wrap {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
  }
}

/* ── Tiny phones (≤ 380px) ──────────────────────────────────────────── */
@media (max-width: 380px) {
  .sarhad-login-card-v2 { padding: 22px 16px 18px; border-radius: 18px; }
  .sarhad-login-card-v2 .brand .college { font-size: 1.18rem; }
  .sarhad-login-card-v2 .brand .seal { width: 56px; height: 56px; }
  .sarhad-login-card-v2 .pitch p { font-size: 0.88rem; }

  .panel[style*="linear-gradient(135deg, #002147"] {
    padding: 16px !important;
  }
  .panel[style*="linear-gradient(135deg, #002147"] h2 {
    font-size: 1.05rem !important;
  }
  .panel[style*="linear-gradient(135deg, #002147"] .countdown {
    font-size: 1.6rem !important;
  }
}

/* ── Footer — extra tightening below 480px (existing rule starts at 820px) */
@media (max-width: 480px) {
  .sarhad-footer .inner,
  .sarhad-footer .sarhad-footer-inner {
    padding: 22px 16px 18px !important;
    gap: 16px !important;
  }
  .sarhad-footer .credit-col .system { font-size: 0.66rem; letter-spacing: 0.1em; }
  .sarhad-footer .credit-col .dev { font-size: 0.9rem; }
  .sarhad-footer .meta-col { font-size: 0.7rem; }
  .sarhad-footer .brand-col .seal { width: 38px; height: 38px; }
  .sarhad-footer .brand-col .name { font-size: 0.92rem; }
  .sarhad-footer .brand-col .line { font-size: 0.7rem; }
}

/* ── Nav strip — masthead breathing room on small phones ──────────── */
@media (max-width: 600px) {
  .sarhad-nav { padding: 10px 0; }
  .sarhad-nav .brand .seal {
    width: 38px; height: 38px; border-radius: 8px; padding: 4px;
  }
  .sarhad-nav .brand .name { font-size: 1rem; }
  .sarhad-nav .pill { padding: 5px 12px !important; font-size: 0.84rem; }
  .sarhad-nav .links { gap: 2px; }
}

/* ── Sidebar (admin shell) — collapse padding on tablet & below ─────── */
@media (max-width: 1024px) {
  .admin-shell-layout .sidebar { padding: 16px 12px; }
  .admin-shell-layout .content-area { padding: 16px; }
}

/* ── Anywhere a long URL or roll-no overflows: word-break safety net ──── */
.sarhad-login-card-v2 .field input,
.profile-bar .info .meta {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ══════════════════════════════════════════════════════════════════════
 * AGGRESSIVE PHONE MODE — overrides the above at narrow widths, with
 * very high specificity (html body …) + !important so it wins over any
 * cached / overlapping rule. Targets the actual phone widths used by
 * 95% of Indian users (Samsung A-series, Xiaomi Redmi, Realme): 360-414
 * CSS pixels in portrait.
 * ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* ── Nav strip — tight + compact pill button ───────────────────────── */
  html body .sarhad-nav { padding: 8px 0 !important; }
  html body .sarhad-nav .inner { padding: 0 12px !important; gap: 8px !important; }
  html body .sarhad-nav .brand { gap: 8px !important; }
  html body .sarhad-nav .brand .seal {
    width: 34px !important; height: 34px !important;
    border-radius: 8px !important; padding: 3px !important;
  }
  html body .sarhad-nav .brand .name {
    font-size: 0.95rem !important; line-height: 1.05 !important;
  }
  html body .sarhad-nav .brand .scope { display: none !important; }
  html body .sarhad-nav .pill {
    padding: 5px 12px !important; font-size: 0.8rem !important;
    border-radius: 999px !important;
  }
  html body .sarhad-nav .pill .ms-1 { margin-left: 4px !important; }

  /* ── Shell + hero — claw back horizontal space ─────────────────────── */
  html body .shell { padding: 0 14px 50px !important; }
  html body .hero { padding: 24px 0 12px !important; }
  html body .hero .eyebrow {
    font-size: 0.62rem !important; letter-spacing: 0.16em !important;
  }
  html body .hero h1 {
    font-size: clamp(1.35rem, 5.8vw, 1.8rem) !important;
    line-height: 1.1 !important; letter-spacing: -0.01em !important;
  }
  html body .hero .lede {
    font-size: 0.86rem !important; line-height: 1.5 !important;
    margin-top: 10px !important;
  }
  html body .hero .rule { margin-top: 18px !important; }

  /* ── Profile bar STACKS vertically on phones ───────────────────────── */
  html body .profile-bar {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 16px !important;
    gap: 10px !important;
  }
  html body .profile-bar .avatar,
  html body .profile-bar .avatar[style*="background: var(--sarhad-navy)"] {
    width: 52px !important; height: 52px !important;
    font-size: 1.05rem !important; flex-shrink: 0 !important;
  }
  html body .profile-bar .info { width: 100% !important; min-width: 0 !important; }
  html body .profile-bar .info .name { font-size: 1rem !important; }
  html body .profile-bar .info .meta {
    justify-content: center !important; gap: 10px !important;
    font-size: 0.76rem !important;
  }
  html body .profile-bar .role-tag {
    width: 100% !important; max-width: 240px !important;
    justify-content: center !important; padding: 6px 12px !important;
    font-size: 0.62rem !important;
  }

  /* ── Live-session hero panel (inline-styled with the gradient) ────── */
  html body .panel[style*="linear-gradient(135deg, #002147"] {
    padding: 18px !important; margin-top: 16px !important;
  }
  html body .panel[style*="linear-gradient(135deg, #002147"] > div[style*="border-radius: 50%"] {
    display: none !important;
  }
  html body .panel[style*="linear-gradient(135deg, #002147"] h2 {
    font-size: 1.15rem !important; margin: 8px 0 6px !important;
  }
  html body .panel[style*="linear-gradient(135deg, #002147"] .countdown {
    font-size: 1.8rem !important;
  }
  html body .panel[style*="linear-gradient(135deg, #002147"] .d-flex.flex-wrap {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }
  html body .btn-prime[style*="padding: 16px 32px"] {
    width: 100% !important;
    padding: 12px 16px !important;
    font-size: 0.92rem !important;
    justify-content: center !important;
  }

  /* ── Empty-state "No active session" panel ────────────────────────── */
  html body .panel[style*="padding: 56px 28px"] {
    padding: 28px 18px !important;
  }
  html body .panel[style*="padding: 56px 28px"] h3 { font-size: 1.05rem !important; }
  html body .panel[style*="padding: 56px 28px"] p {
    font-size: 0.85rem !important; line-height: 1.5 !important;
  }

  /* ── All generic panels: tighter padding ──────────────────────────── */
  html body .panel { padding: 16px !important; border-radius: 12px !important; }

  /* ── Stats: 1 column on phones (was 2) ────────────────────────────── */
  html body .stats { grid-template-columns: 1fr !important; gap: 10px !important; }
  html body .stat { padding: 14px 18px !important; }
  html body .stat .label { font-size: 0.66rem !important; }
  html body .stat .value { font-size: 1.6rem !important; }
  html body .stat .delta { font-size: 0.76rem !important; }

  /* ── Section heads + sub copy tighter ─────────────────────────────── */
  html body .section-head h2 { font-size: 1.15rem !important; }
  html body .section-sub { font-size: 0.84rem !important; }

  /* ── Buttons more thumb-friendly ──────────────────────────────────── */
  html body .btn-prime, html body .btn-ghost {
    width: 100% !important; justify-content: center !important;
    padding: 12px 14px !important; font-size: 0.92rem !important;
  }
}

/* ── Ultra-narrow phones (≤ 360px — old / budget devices) ───────────── */
@media (max-width: 360px) {
  html body .sarhad-nav .brand .name {
    font-size: 0.86rem !important; max-width: 130px !important;
  }
  html body .sarhad-nav .pill .ms-1 { display: none !important; }
  html body .hero h1 { font-size: 1.25rem !important; }
  html body .hero .lede { font-size: 0.82rem !important; }
  html body .profile-bar .avatar { width: 48px !important; height: 48px !important; }
  html body .profile-bar .info .meta { font-size: 0.72rem !important; gap: 8px !important; }
  html body .panel { padding: 14px !important; }
  html body .panel[style*="linear-gradient(135deg, #002147"] h2 { font-size: 1.05rem !important; }
}
