/**
 * Punjab College for Women (PCW Jhelum) Management Portal
 * Design System v2 — tokens, app shell (sidebar / top bar), dashboard.
 *
 * Brand: crest navy + maroon, with a warm gold accent.
 * Everything is driven by the tokens below so light / dark themes and any
 * future re-brand are a matter of changing variables, not hunting selectors.
 */

/* ---------- Fonts (self-hosted so the portal works offline on local dev) ---------- */
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('../vendor/fonts/plus-jakarta-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url('../vendor/fonts/plus-jakarta-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('../vendor/fonts/plus-jakarta-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('../vendor/fonts/plus-jakarta-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-style: normal; font-display: swap; src: url('../vendor/fonts/plus-jakarta-sans-latin-800-normal.woff2') format('woff2'); }

:root {
  /* Brand */
  --pcw-maroon: #7B1824;
  --pcw-maroon-light: #9A2234;
  --pcw-maroon-dark: #560E18;
  --pcw-navy: #0B2240;
  --pcw-navy-light: #17386B;
  --pcw-navy-dark: #06152B;
  --pcw-gold: #D4A94C;

  /* Surfaces */
  --bg-main: #F4F5F9;
  --bg-surface: #FFFFFF;
  --bg-sidebar: #0B2240;
  --surface-subtle: #F8F9FC;
  --input-bg: #FFFFFF;

  /* Text */
  --text-main: #344054;
  --text-heading: #101828;
  --text-muted: #667085;
  --text-light: #98A2B3;

  /* Lines */
  --border-subtle: #E4E7EC;
  --border-card: #ECEEF3;

  /* Sidebar (always dark navy, in both themes) */
  --sidebar-text: rgba(255, 255, 255, 0.70);
  --sidebar-text-strong: #FFFFFF;
  --sidebar-muted: rgba(255, 255, 255, 0.36);
  --sidebar-hover-bg: rgba(255, 255, 255, 0.07);
  --sidebar-active-bg: rgba(255, 255, 255, 0.11);
  --sidebar-line: rgba(255, 255, 255, 0.08);

  /* Semantic palette */
  --card-green: #12A762;
  --card-green-bg: #E7F7EF;
  --card-yellow: #E8890C;
  --card-yellow-bg: #FEF3E2;
  --card-blue: #2E6FE8;
  --card-blue-bg: #E9F0FE;
  --card-cyan: #0A9DBF;
  --card-cyan-bg: #E3F5FA;
  --card-purple: #7A55E0;
  --card-purple-bg: #F0EBFC;
  --card-red: #E5484D;
  --card-red-bg: #FDECEC;

  /* Depth */
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.04);
  --shadow-hover: 0 12px 28px -8px rgba(16, 24, 40, 0.14), 0 4px 8px -4px rgba(16, 24, 40, 0.06);

  /* Layout */
  --sidebar-w: 268px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 68px;

  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- Dark theme ---------- */
html.dark-theme {
  --pcw-maroon: #C4425A;
  --pcw-maroon-light: #D4566D;
  --pcw-maroon-dark: #A8334A;

  --bg-main: #0B1220;
  --bg-surface: #151E2E;
  --bg-sidebar: #0A1424;
  --surface-subtle: #1B2638;
  --input-bg: #1B2638;

  --text-main: #CBD5E1;
  --text-heading: #F1F5F9;
  --text-muted: #94A3B8;
  --text-light: #64748B;

  --border-subtle: #2A374B;
  --border-card: #233044;

  --card-green-bg: rgba(18, 167, 98, 0.16);
  --card-yellow-bg: rgba(232, 137, 12, 0.16);
  --card-blue-bg: rgba(46, 111, 232, 0.18);
  --card-cyan-bg: rgba(10, 157, 191, 0.18);
  --card-purple-bg: rgba(122, 85, 224, 0.2);
  --card-red-bg: rgba(229, 72, 77, 0.17);

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 14px 30px -8px rgba(0, 0, 0, 0.55);
}

/* Many pages set inline colors written for light surfaces. Repoint the common
   ones so every inner page stays readable in dark mode. */
html.dark-theme [style*="color: var(--pcw-navy)"],
html.dark-theme [style*="color:var(--pcw-navy)"],
html.dark-theme [style*="color: #0B2240"],
html.dark-theme [style*="color:#0B2240"] { color: var(--text-heading) !important; }

html.dark-theme [style*="color: #4A5568"],
html.dark-theme [style*="color:#4A5568"],
html.dark-theme [style*="color: #718096"],
html.dark-theme [style*="color:#718096"] { color: var(--text-muted) !important; }

html.dark-theme [style*="border-bottom: 1px solid #EDF2F7"],
html.dark-theme [style*="border-bottom:1px solid #EDF2F7"] { border-bottom-color: var(--border-card) !important; }

html.dark-theme [style*="background: #F8FAFC"],
html.dark-theme [style*="background:#F8FAFC"],
html.dark-theme [style*="background: #fff"],
html.dark-theme [style*="background: #ffffff"],
html.dark-theme [style*="background: #FFFFFF"] { background: var(--surface-subtle) !important; }

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 13.5px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--text-heading); letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; }

::selection { background: rgba(123, 24, 36, 0.16); }

:focus-visible { outline: 2px solid var(--pcw-maroon); outline-offset: 2px; }

/* Slim scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-subtle) transparent; }

/* ---------- App shell ---------- */
.app-container { display: flex; min-height: 100vh; width: 100%; }

.app-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-main);
  transition: margin-left 0.25s ease;
}

html.sidebar-collapsed .app-main { margin-left: var(--sidebar-w-collapsed); }

.page-content {
  padding: 24px 28px 32px;
  flex: 1;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

/* ---------- Sidebar ---------- */
.app-sidebar {
  width: var(--sidebar-w);
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(123, 24, 36, 0.35) 0%, transparent 55%),
    linear-gradient(180deg, #0D2848 0%, #08192F 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1000;
  transition: width 0.25s ease, transform 0.25s ease;
  color: var(--sidebar-text);
}

html.dark-theme .app-sidebar {
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(196, 66, 90, 0.18) 0%, transparent 55%),
    linear-gradient(180deg, #0B1628 0%, #070F1D 100%);
}

.sidebar-header {
  height: var(--topbar-h);
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--sidebar-line);
  flex-shrink: 0;
}

.sidebar-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.sidebar-brand-logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
  object-fit: contain;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.sidebar-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sidebar-brand-text strong { color: #fff; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.sidebar-brand-text small { color: var(--pcw-gold); font-size: 9.5px; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; white-space: nowrap; }

.sidebar-menu { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 12px 16px; }
.sidebar-menu::-webkit-scrollbar { width: 6px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 6px; }

.menu-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  letter-spacing: 0.12em;
  padding: 20px 12px 7px;
  white-space: nowrap;
}

.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  color: var(--sidebar-text);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.menu-item i {
  font-size: 14px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.15s ease;
}

.menu-item span { overflow: hidden; text-overflow: ellipsis; }

.menu-item:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-text-strong); }
.menu-item:hover i { color: #fff; }

.menu-item.active { background: var(--sidebar-active-bg); color: #fff; font-weight: 700; }
.menu-item.active i { color: var(--pcw-gold); }
.menu-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--pcw-gold);
}

.menu-item .menu-count {
  margin-left: auto;
  background: var(--pcw-maroon-light);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 12px;
  border-top: 1px solid var(--sidebar-line);
  background: rgba(0, 0, 0, 0.16);
}

.sidebar-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-user-info { min-width: 0; flex: 1; line-height: 1.25; }
.sidebar-user-info strong { display: block; color: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info small { color: var(--sidebar-muted); font-size: 11px; font-weight: 600; }

.sidebar-logout {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.sidebar-logout:hover { background: rgba(229, 72, 77, 0.2); color: #FF8A8E; }

/* Collapsed (icon rail) — desktop only */
@media (min-width: 993px) {
  html.sidebar-collapsed .app-sidebar { width: var(--sidebar-w-collapsed); }
  html.sidebar-collapsed .sidebar-brand-text,
  html.sidebar-collapsed .menu-item span,
  html.sidebar-collapsed .menu-count,
  html.sidebar-collapsed .sidebar-user-info,
  html.sidebar-collapsed .sidebar-logout { display: none; }
  html.sidebar-collapsed .sidebar-header { justify-content: center; padding: 0; }
  html.sidebar-collapsed .menu-item { justify-content: center; padding: 11px 0; }
  html.sidebar-collapsed .menu-item.active::before { left: -12px; }
  html.sidebar-collapsed .menu-section-title { font-size: 0; padding: 12px 0 6px; text-align: center; }
  html.sidebar-collapsed .menu-section-title::after { content: ''; display: block; height: 1px; background: var(--sidebar-line); margin: 0 14px; }
  html.sidebar-collapsed .sidebar-user { justify-content: center; }
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 21, 43, 0.55);
  backdrop-filter: blur(2px);
  z-index: 999;
}

/* ---------- Top bar ---------- */
.top-navbar {
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 900;
}

.nav-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.nav-toggle-btn { flex-shrink: 0; }

.nav-page-title { min-width: 0; line-height: 1.25; }
.nav-page-title h1 { font-size: 17px; font-weight: 800; color: var(--text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-page-title p { font-size: 12px; color: var(--text-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-right-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.nav-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
  position: relative;
}
.nav-icon-btn:hover { background: var(--surface-subtle); color: var(--text-heading); border-color: var(--text-light); }

.nav-icon-btn .badge-pill {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--card-red);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surface);
}

/* Search / command palette trigger */
.nav-search-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 8px 0 14px;
  min-width: 250px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
  color: var(--text-light);
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-search-btn:hover { border-color: var(--text-light); background: var(--bg-surface); }
.nav-search-btn span { flex: 1; text-align: left; }
.kbd {
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
}

/* Session pill */
.session-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}
.session-pill i { color: var(--pcw-maroon); font-size: 12px; }
.session-pill select {
  background: transparent;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text-heading);
  cursor: pointer;
  outline: none;
  max-width: 120px;
}
.session-pill select option { color: #101828; background: #fff; }

/* Dropdowns (notifications, profile) */
.notif-wrap, .profile-wrap { position: relative; }

.notif-dropdown, .profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: 0 20px 40px -12px rgba(16, 24, 40, 0.25);
  z-index: 1000;
  overflow: hidden;
  animation: pop-in 0.16s ease;
}
.notif-dropdown { width: 350px; max-height: 420px; display: flex; flex-direction: column; }
.profile-dropdown { width: 230px; padding: 6px; }
.notif-dropdown[hidden], .profile-dropdown[hidden] { display: none; }

@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }

.notif-dropdown-header {
  padding: 14px 16px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-heading);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notif-dropdown-header small { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.notif-dropdown-list { overflow-y: auto; max-height: 360px; }

.notif-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-card);
  transition: background 0.15s ease;
}
.notif-dropdown-item:last-child { border-bottom: none; }
.notif-dropdown-item:hover { background: var(--surface-subtle); }
.notif-dropdown-item i {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--pcw-maroon-glow, rgba(123, 24, 36, 0.1));
  color: var(--pcw-maroon);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.notif-empty { padding: 28px 16px; font-size: 12.5px; color: var(--text-muted); text-align: center; }
.notif-empty i { display: block; font-size: 26px; color: var(--card-green); margin-bottom: 8px; }

.nav-avatar-pill {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--pcw-navy-light), #7B1824);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(11, 34, 64, 0.25);
}
.nav-avatar-pill.sm { width: 34px; height: 34px; font-size: 13px; border-radius: 10px; }

.profile-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border-card); margin-bottom: 6px; line-height: 1.3; }
.profile-head strong { display: block; font-size: 13px; color: var(--text-heading); }
.profile-head small { color: var(--text-muted); font-size: 11.5px; }
.profile-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  transition: background 0.15s ease;
}
.profile-link i { width: 16px; text-align: center; color: var(--text-muted); }
.profile-link:hover { background: var(--surface-subtle); }
.profile-link.danger, .profile-link.danger i { color: var(--card-red); }

/* ---------- Command palette (Ctrl/⌘ + K) ---------- */
.cmdk-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 21, 43, 0.5);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}
.cmdk-backdrop.open { display: flex; }
.cmdk {
  width: 100%;
  max-width: 560px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  animation: pop-in 0.16s ease;
}
.cmdk-input-row { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border-subtle); }
.cmdk-input-row i { color: var(--text-light); }
.cmdk-input { flex: 1; border: none; outline: none; background: transparent; font-family: inherit; font-size: 15px; color: var(--text-heading); padding: 18px 0; }
.cmdk-list { max-height: 360px; overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-light); padding: 10px 12px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--text-main); cursor: pointer; }
.cmdk-item i { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-subtle); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.cmdk-item.sel { background: var(--surface-subtle); color: var(--text-heading); }
.cmdk-item.sel i { background: var(--pcw-maroon); color: #fff; }
.cmdk-item small { margin-left: auto; color: var(--text-light); font-weight: 600; font-size: 11.5px; }
.cmdk-empty { padding: 28px; text-align: center; color: var(--text-muted); }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border-subtle); background: var(--surface-subtle); font-size: 11.5px; color: var(--text-muted); }

/* ---------- Dashboard ---------- */
.dash-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(212, 169, 76, 0.22) 0%, transparent 55%),
    linear-gradient(115deg, #0B2240 0%, #17386B 52%, #7B1824 140%);
  border-radius: 20px;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  color: #fff;
  box-shadow: 0 18px 36px -18px rgba(11, 34, 64, 0.6);
  flex-wrap: wrap;
}

.dash-hero::before {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -70px;
  width: 280px;
  height: 340px;
  background: url('../images/logo.png') center / contain no-repeat;
  opacity: 0.07;
  filter: grayscale(1) brightness(2);
  transform: rotate(-8deg);
  pointer-events: none;
}

.dash-hero > * { position: relative; }

.dash-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pcw-gold);
  margin-bottom: 8px;
}
.dash-hero-info h1 { font-size: 26px; font-weight: 800; color: #fff; margin-bottom: 6px; letter-spacing: -0.02em; }
.dash-hero-info p { font-size: 13px; color: rgba(255, 255, 255, 0.72); font-weight: 500; }

.dash-hero-stats { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; }

.dash-hero-stat {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 118px;
}
.dash-hero-stat span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.09em; color: rgba(255, 255, 255, 0.6); font-weight: 700; }
.dash-hero-stat strong { font-size: 16px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }

.dash-hero-btn {
  background: #fff;
  color: var(--pcw-navy-dark);
  font-size: 13px;
  font-weight: 800;
  padding: 0 20px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.dash-hero-btn:hover { background: var(--pcw-gold); transform: translateY(-1px); }

/* Segmented control (Basic / Graphical) */
.dash-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-view-toggle {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.dash-view-tab {
  padding: 7px 16px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s ease;
}
.dash-view-tab:hover { color: var(--text-heading); }
.dash-view-tab.active { background: var(--pcw-navy); color: #fff; }
html.dark-theme .dash-view-tab.active { background: var(--pcw-maroon); color: #fff; }

/* Quick actions */
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.quick-action {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px 8px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-heading);
  transition: all 0.15s ease;
}
.quick-action i {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: var(--pcw-maroon-glow, rgba(123, 24, 36, 0.1));
  color: var(--pcw-maroon);
}
.quick-action:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: transparent; }

/* Section headings */
.dash-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 14px;
}
.dash-section-header h2 { font-size: 15px; font-weight: 800; }
.dash-section-header i {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.dash-section-header .section-note { margin-left: auto; font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* KPI tiles */
.dash-kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (min-width: 1700px) { .dash-kpi-grid { grid-template-columns: repeat(6, 1fr); } }

.dash-kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}
a.dash-kpi-card:hover, .dash-kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.dash-kpi-card .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.dash-kpi-card .kpi-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.dash-kpi-card .kpi-val { font-size: 30px; font-weight: 800; color: var(--text-heading); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.dash-kpi-card .kpi-icon-box { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.dash-kpi-card .kpi-go { position: absolute; right: 16px; bottom: 16px; font-size: 11px; color: var(--text-light); opacity: 0; transform: translateX(-4px); transition: all 0.2s ease; }
a.dash-kpi-card:hover .kpi-go { opacity: 1; transform: none; }

.card-theme-green .kpi-icon-box  { background: var(--card-green-bg);  color: var(--card-green); }
.card-theme-yellow .kpi-icon-box { background: var(--card-yellow-bg); color: var(--card-yellow); }
.card-theme-blue .kpi-icon-box   { background: var(--card-blue-bg);   color: var(--card-blue); }
.card-theme-cyan .kpi-icon-box   { background: var(--card-cyan-bg);   color: var(--card-cyan); }
.card-theme-purple .kpi-icon-box { background: var(--card-purple-bg); color: var(--card-purple); }
.card-theme-red .kpi-icon-box    { background: var(--card-red-bg);    color: var(--card-red); }

/* Dashboard two-column layouts */
.dash-split { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: stretch; }
.dash-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Fee stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat-block { padding: 22px 24px; position: relative; }
.stat-block + .stat-block { border-left: 1px solid var(--border-card); }
.stat-block .stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.stat-block .summary-icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.stat-block .stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.stat-block .stat-amount { font-size: 24px; font-weight: 800; color: var(--text-heading); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-block .stat-amount small { font-size: 13px; font-weight: 700; color: var(--text-muted); margin-right: 3px; letter-spacing: 0; }

.badge-tag { font-size: 10px; font-weight: 800; padding: 4px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.06em; }
.tag-today { background: var(--card-blue-bg); color: var(--card-blue); }
.tag-aug { background: var(--card-green-bg); color: var(--card-green); }
.tag-arrears, .tag-payable { background: var(--card-red-bg); color: var(--card-red); }
.tag-receivable { background: var(--card-cyan-bg); color: var(--card-cyan); }

/* Finance ledger rows */
.ledger { padding: 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.ledger-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; transition: background 0.15s ease; }
.ledger-row:hover { background: var(--surface-subtle); }
.ledger-row .ledger-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.ledger-row .ledger-label { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text-main); }
.ledger-row .ledger-val { font-size: 14px; font-weight: 800; color: var(--text-heading); font-variant-numeric: tabular-nums; }

/* Attendance panels */
.att-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.att-panel-head h3 { font-size: 14.5px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.att-panel-head h3 i { color: var(--pcw-maroon); font-size: 14px; }
.att-panel-head p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.att-rate { text-align: right; line-height: 1; }
.att-rate strong { font-size: 26px; font-weight: 800; color: var(--text-heading); letter-spacing: -0.02em; }
.att-rate span { display: block; font-size: 10.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-top: 4px; }

.att-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--border-card); margin: 18px 22px 4px; gap: 2px; }
.att-bar i { display: block; height: 100%; min-width: 0; transition: flex-grow 0.6s ease; }
.att-bar .seg-green { background: var(--card-green); }
.att-bar .seg-red { background: var(--card-red); }
.att-bar .seg-yellow { background: var(--card-yellow); }
.att-bar .seg-cyan { background: var(--card-cyan); }

.att-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px 22px 22px; }
.att-card { border-radius: 14px; padding: 12px 14px; background: var(--surface-subtle); border: 1px solid var(--border-card); }
.att-card .att-label { font-size: 11.5px; font-weight: 700; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.att-card .att-label::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.att-card .att-val { font-size: 24px; font-weight: 800; margin-top: 4px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.att-card-green .att-label, .att-card-green .att-val { color: var(--card-green); }
.att-card-red .att-label, .att-card-red .att-val { color: var(--card-red); }
.att-card-yellow .att-label, .att-card-yellow .att-val { color: var(--card-yellow); }
.att-card-cyan .att-label, .att-card-cyan .att-val { color: var(--card-cyan); }

/* Floating settings gear (kept, but quieter) */
.floating-settings-btn {
  position: fixed;
  right: 0;
  bottom: 96px;
  width: 40px;
  height: 40px;
  background: var(--pcw-navy);
  color: #fff;
  border-radius: 12px 0 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -4px 6px 16px rgba(11, 34, 64, 0.25);
  z-index: 800;
  transition: all 0.2s ease;
}
html.dark-theme .floating-settings-btn { background: var(--pcw-maroon); }
.floating-settings-btn:hover { width: 48px; }
.floating-settings-btn i { transition: transform 0.4s ease; }
.floating-settings-btn:hover i { transform: rotate(90deg); }

.dash-footer {
  margin-top: 40px;
  padding: 18px 0 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Legacy classes some pages still use */
.dash-breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; font-weight: 500; }
.dash-breadcrumb a { color: var(--text-muted); }
.dash-breadcrumb strong { color: var(--text-heading); font-weight: 700; }
.summary-card { background: var(--bg-surface); border: 1px solid var(--border-card); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow-card); }
.dash-3col-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.dash-4col-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ---------- Toasts ---------- */
#toastContainer { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 40px); }
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 420px;
  padding: 12px 16px;
  background: var(--bg-surface);
  color: var(--text-heading);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--toast-color, var(--card-green));
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 16px 32px -10px rgba(16, 24, 40, 0.28);
  transform: translateX(110%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.3s ease;
}
.toast.show { transform: none; opacity: 1; }
.toast-icon { width: 26px; height: 26px; border-radius: 50%; background: var(--toast-color, var(--card-green)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.toast-success { --toast-color: var(--card-green); }
.toast-error { --toast-color: var(--card-red); }
.toast-warning { --toast-color: var(--card-yellow); }
.toast-info { --toast-color: var(--card-blue); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .dash-split { grid-template-columns: 1fr; }
  .ledger { grid-template-columns: repeat(2, 1fr); }
  .nav-search-btn { min-width: 0; }
  .nav-search-btn .kbd { display: none; }
}

@media (max-width: 992px) {
  .app-sidebar { transform: translateX(-100%); width: var(--sidebar-w); box-shadow: none; }
  .app-sidebar.open { transform: translateX(0); box-shadow: 20px 0 50px rgba(0, 0, 0, 0.35); }
  .sidebar-backdrop.open { display: block; }
  .app-main, html.sidebar-collapsed .app-main { margin-left: 0; }
  .top-navbar { padding: 0 16px; }
  .page-content { padding: 18px 16px 28px; }
  .dash-pair { grid-template-columns: 1fr; }
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-3col-grid, .dash-4col-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-search-btn { width: 38px; min-width: 38px; padding: 0; justify-content: center; }
  .nav-search-btn span { display: none; }
  .session-pill i { display: none; }
}

@media (max-width: 640px) {
  .dash-hero { padding: 22px 20px; border-radius: 16px; }
  .dash-hero-info h1 { font-size: 21px; }
  .dash-hero-stats { width: 100%; }
  .dash-hero-stat { flex: 1; min-width: 0; }
  .dash-hero-btn { padding: 12px 20px; flex: 1 1 100%; justify-content: center; }
  .stat-strip { grid-template-columns: 1fr; }
  .stat-block + .stat-block { border-left: none; border-top: 1px solid var(--border-card); }
  .att-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-kpi-grid, .ledger { grid-template-columns: 1fr; }
  .dash-3col-grid, .dash-4col-grid { grid-template-columns: 1fr; }
  .nav-page-title p, .session-pill { display: none; }
  .notif-dropdown { position: fixed; top: calc(var(--topbar-h) + 6px); left: 12px; right: 12px; width: auto; }
}

@media print {
  .app-sidebar, .top-navbar, .floating-settings-btn, .sidebar-backdrop { display: none !important; }
  .app-main { margin-left: 0 !important; }
}
