:root {
  --primary: #667eea;
  --primary-dark: #5a67d8;
  --secondary: #764ba2;
  --sidebar-bg: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(20, 34, 61, 0.98) 52%, rgba(12, 24, 45, 0.99) 100%);
  --sidebar-width: 284px;
  --topbar-height: 70px;
  --card-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --success: #48bb78;
  --danger: #fc8181;
  --warning: #f6ad55;
  --info: #63b3ed;
  --sidebar-accent: #fa991c;
  --sidebar-accent-soft: #fbf3f2;
  --sidebar-glow: rgba(250, 153, 28, 0.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(250, 153, 28, 0.10), transparent 20%),
    linear-gradient(180deg, #f8fafc 0%, #eef4f9 100%);
  color: #2d3748;
  min-height: 100vh;
}

/* ─────────────────────────────────────────────────────────
   SIDEBAR  (curved cut-out active design)
   ───────────────────────────────────────────────────────── */

/* CSS custom properties scoped to sidebar palette */
:root {
  --sb-bg:            #0f172a;       /* deep navy */
  --sb-bg2:           #1e2d4a;       /* slightly lighter navy */
  --sb-active-bg:     #f0f4ff;       /* light blue-white – the "content" colour */
  --sb-active-text:   #1e3a5f;
  --sb-inactive-text: rgba(255,255,255,0.65);
  --sb-section-text:  rgba(255,255,255,0.35);
  --sb-accent:        #fa991c;
  --sb-curve-r:       22px;          /* corner radius of the cut-out */
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background: var(--sb-bg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: 6px 0 32px rgba(15, 23, 42, 0.55);
  overflow: hidden;
  isolation: isolate;
}

/* Subtle top-left gradient glow */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 160px 120px at -20px -20px, rgba(250,153,28,0.14), transparent),
    radial-gradient(ellipse 180px 140px at 120% 80%,   rgba(102,126,234,0.11), transparent);
  pointer-events: none;
}

/* Decorative ambient orbs (kept from original) */
.sidebar-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(36px);
  opacity: 0.55;
  pointer-events: none;
}
.sidebar-orb-one {
  width: 180px; height: 180px;
  top: -60px; right: -60px;
  background: rgba(250, 153, 28, 0.20);
}
.sidebar-orb-two {
  width: 140px; height: 140px;
  bottom: 80px; left: -50px;
  background: rgba(102, 126, 234, 0.18);
}

/* ── Brand block ─────────────────────────────────────────── */
.sidebar-brand {
  position: relative;
  z-index: 2;
  padding: 18px 16px 14px;
  margin: 12px 10px 6px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.04);
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: background 0.25s;
}
.sidebar-brand:hover { background: rgba(255,255,255,0.07); }
.sidebar-brand-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--sb-accent), #ffd49f);
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(250,153,28,0.28);
}
.sidebar-brand-text { color: #fff; overflow: hidden; }
.sidebar-brand-text .school-name {
  font-size: 13.5px; font-weight: 800; line-height: 1.25;
  letter-spacing: -0.01em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.sidebar-brand-text .school-sub {
  font-size: 10px; color: rgba(255,255,255,0.52);
  text-transform: uppercase; letter-spacing: 1.1px; margin-top: 2px;
}

/* ── Scrollable nav area ─────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: visible;  /* let ::before/::after corner blobs bleed right */
  /* right padding leaves space for the cut-out shape bleeding off-edge */
  padding: 6px 0 18px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  position: relative;
  z-index: 2;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
}

/* ── Section headings ────────────────────────────────────── */
.nav-section-title {
  padding: 14px 20px 5px;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--sb-section-text);
}

/* ════════════════════════════════════════════════════════════
   NAV ITEM WRAPPER  — provides the clipping context
   ══════════════════════════════════════════════════════════ */
.nav-item {
  position: relative;
  /* a small right-padding so ::after pseudo-circles can overflow cleanly */
  margin: 2px 0;
  padding-right: 0;
}

/* ── Base link ───────────────────────────────────────────── */
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  /* left indent + right gap for the blob */
  padding: 10px 20px 10px 18px;
  color: var(--sb-inactive-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.25s ease, background 0.25s ease,
              padding-left 0.25s ease, border-radius 0.3s ease,
              box-shadow 0.3s ease;
  position: relative;
  z-index: 2;          /* sits above pseudo-elements */
  border-radius: 0;
  white-space: nowrap;
}

/* Hover ─ subtle left-slide + tint */
.nav-link:not(.active):hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
  padding-left: 22px;   /* tiny left nudge */
}

/* ════════════════════════════════════════════════════════════
   ACTIVE ITEM  —  curved cut-out blob

   Technique:
     1. The link itself gets the light "content" background.
     2. Two ::before / ::after concave quarter-circles on the
        .nav-item wrapper reuse the sidebar's own dark colour
        via box-shadow so the sidebar peeks through, creating
        the illusion of being carved out.
   ══════════════════════════════════════════════════════════ */

.nav-link.active {
  color: var(--sb-active-text);
  font-weight: 700;
  /* The main blob: rounded left pill, open on the right */
  background: var(--sb-active-bg);
  border-radius: 999px 0 0 999px;   /* full-round left, flat right */
  margin-right: 0;
  /* Extend right edge flush with sidebar edge */
  padding-right: 14px;
  /* Slight shadow for depth */
  box-shadow:
    -6px 0 0 0 var(--sb-active-bg),   /* bleed left into padding */
    inset 0 1px 0 rgba(255,255,255,0.5),
    4px 0 16px rgba(250,153,28,0.06);
  animation: blob-in 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes blob-in {
  from { clip-path: inset(0 100% 0 0 round 999px 0 0 999px); }
  to   { clip-path: inset(0 0% 0 0   round 999px 0 0 999px); }
}

/* Top concave corner — sits above the blob */
.nav-item:has(.nav-link.active)::before {
  content: '';
  position: absolute;
  right: 0;
  /* The top corner sits just above the item's own top edge */
  top: calc(-1 * var(--sb-curve-r));
  width: var(--sb-curve-r);
  height: var(--sb-curve-r);
  /*
    box-shadow trick: draw a circle of radius = height, then use a
    large spread box-shadow in the active-bg colour.
    The circle itself stays transparent; the shadow fills the
    outside space that creates the concave notch effect.
  */
  background: transparent;
  border-radius: 0 0 0 var(--sb-curve-r);
  box-shadow: 0 var(--sb-curve-r) 0 0 var(--sb-active-bg);
  pointer-events: none;
  z-index: 1;
}

/* Bottom concave corner — sits below the blob */
.nav-item:has(.nav-link.active)::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: calc(-1 * var(--sb-curve-r));
  width: var(--sb-curve-r);
  height: var(--sb-curve-r);
  background: transparent;
  border-radius: 0 var(--sb-curve-r) 0 0;
  box-shadow: 0 calc(-1 * var(--sb-curve-r)) 0 0 var(--sb-active-bg);
  pointer-events: none;
  z-index: 1;
}

/* Dark "nail" that fills behind the two corner pseudo-elements
   so the corners don't accidentally bleed into adjacent items */
.nav-item:has(.nav-link.active) {
  /* Ensure stacking order */
  z-index: 3;
  isolation: isolate;
}

/* ── Icon badge ──────────────────────────────────────────── */
.nav-link .nav-icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
  background: rgba(255,255,255,0.07);
  transition: background 0.25s, box-shadow 0.25s;
}
.nav-link.active .nav-icon {
  background: linear-gradient(135deg, #fff8ee, #fff);
  box-shadow: 0 2px 8px rgba(250,153,28,0.22);
}
.nav-link:not(.active):hover .nav-icon {
  background: rgba(255,255,255,0.12);
}

/* ── Label ───────────────────────────────────────────────── */
.nav-text { flex: 1; letter-spacing: 0.01em; }

/* ── Optional badge count ────────────────────────────────── */
.nav-link .badge-count {
  margin-left: auto;
  background: var(--sb-accent);
  color: #fff;
  font-size: 10px; padding: 2px 7px;
  border-radius: 10px; font-weight: 700;
}

/* ── Sidebar footer ──────────────────────────────────────── */
.sidebar-footer {
  position: relative;
  z-index: 2;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255,255,255,0.025);
}
.sidebar-user {
  display: flex; align-items: center;
  gap: 10px; min-width: 0;
}
.sidebar-user-lock {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08);
}
.sidebar-user strong {
  display: block; color: #fff;
  font-size: 12.5px; line-height: 1.2;
}
.sidebar-user small { color: rgba(255,255,255,0.50); font-size: 11px; }
.sidebar-logout-form { margin-left: auto; flex-shrink: 0; }
.sidebar-logout {
  width: 36px; height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.80);
  cursor: pointer; transition: var(--transition);
}
.sidebar-logout:hover {
  background: rgba(250,153,28,0.20);
  color: #fff;
  border-color: rgba(250,153,28,0.35);
}

/* ── TOPBAR ─────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 999;
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: 0 6px 24px rgba(15,23,42,0.05);
  border-bottom: 1px solid rgba(226,232,240,0.8);
  gap: 16px;
}
.topbar-title { font-size: 18px; font-weight: 800; color: #1a202c; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.btn-icon {
  width: 38px; height: 38px;
  border-radius: 10px; border: none;
  background: #f7fafc; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: var(--transition); color: #4a5568;
}
.btn-icon:hover { background: #edf2f7; transform: translateY(-1px); }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; background: #f0f4ff;
  border-radius: 12px; cursor: default;
  font-size: 13px; font-weight: 600; color: #2d3748;
  text-decoration: none; transition: var(--transition);
  border: 1px solid #e2e8f0;
}
.user-chip:hover { background: #e8eeff; }
.user-chip .user-name-main { font-weight: 700; font-size: 13px; color: #1a202c; }
.user-chip .user-name-sub  { font-size: 11px; color: #718096; }
.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700;
}

/* ── MAIN CONTENT ──────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  padding-top: var(--topbar-height);
  min-height: 100vh;
}
.content-wrapper {
  padding: 28px;
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-ring {
  0%   { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ── STAT CARDS ─────────────────────────────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-bottom: 22px; }

.stat-card {
  border-radius: 18px;
  padding: 22px 24px 18px;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 140px;
  position: relative; overflow: hidden;
  transition: transform 0.22s cubic-bezier(.34,1.3,.64,1), box-shadow 0.22s;
  animation: fadeInUp 0.4s ease both;
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
  cursor: default;
}
.stat-card:hover { transform: translateY(-5px) scale(1.02); box-shadow: 0 18px 44px rgba(0,0,0,0.28); }
.stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-card:nth-child(3) { animation-delay: 0.16s; }
.stat-card:nth-child(4) { animation-delay: 0.24s; }

/* Gradient backgrounds — 8 unique colors */
.sc-1 { background: linear-gradient(135deg, #f857a6 0%, #ff5858 100%); }
.sc-2 { background: linear-gradient(135deg, #a855f7 0%, #6d28d9 100%); }
.sc-3 { background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%); }
.sc-4 { background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%); }
.sc-5 { background: linear-gradient(135deg, #f97316 0%, #ef4444 100%); }
.sc-6 { background: linear-gradient(135deg, #eab308 0%, #f97316 100%); }
.sc-7 { background: linear-gradient(135deg, #06b6d4 0%, #6d28d9 100%); }
.sc-8 { background: linear-gradient(135deg, #84cc16 0%, #10b981 100%); }
/* keep legacy aliases */
.sc-blue   { background: linear-gradient(135deg, #f857a6 0%, #ff5858 100%); }
.sc-green  { background: linear-gradient(135deg, #a855f7 0%, #6d28d9 100%); }
.sc-red    { background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%); }
.sc-orange { background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%); }

/* Wavy line texture overlay — diagonal curved stripes */
.stat-card::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='1.5'%3E%3Cpath d='M-50,150 Q75,50 200,150 T450,150'/%3E%3Cpath d='M-50,120 Q75,20 200,120 T450,120'/%3E%3Cpath d='M-50,90 Q75,-10 200,90 T450,90'/%3E%3Cpath d='M-50,60 Q75,-40 200,60 T450,60'/%3E%3Cpath d='M-50,30 Q75,-70 200,30 T450,30'/%3E%3Cpath d='M-50,0 Q75,-100 200,0 T450,0'/%3E%3Cpath d='M-50,180 Q75,80 200,180 T450,180'/%3E%3Cpath d='M-50,210 Q75,110 200,210 T450,210'/%3E%3Cpath d='M-50,240 Q75,140 200,240 T450,240'/%3E%3Cpath d='M-50,270 Q75,170 200,270 T450,270'/%3E%3Cpath d='M-50,300 Q75,200 200,300 T450,300'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 300px 300px;
  border-radius: inherit;
  pointer-events: none;
}

/* Label at top */
.stat-label {
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.85);
  letter-spacing: 0.4px; z-index: 1; position: relative;
}

/* Value + icon row */
.stat-mid {
  display: flex; align-items: center; justify-content: space-between;
  z-index: 1; position: relative; margin-top: 8px;
}
.stat-value {
  font-size: 36px; font-weight: 900; color: #fff;
  line-height: 1; letter-spacing: -1px;
}
.stat-icon {
  font-size: 40px; line-height: 1;
  opacity: 0.85;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.3));
  flex-shrink: 0;
}

/* Sub text at bottom */
.stat-sub {
  font-size: 11.5px; color: rgba(255,255,255,0.75);
  font-weight: 500; z-index: 1; position: relative; margin-top: 6px;
}

/* ── CARDS ─────────────────────────────────────────────── */
.card {
  background: #fff; border-radius: var(--card-radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow: hidden; margin-bottom: 22px;
  animation: fadeIn 0.5s ease;
}
.card-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid #edf2f7;
  display: flex; align-items: center; justify-content: space-between;
  background: #fff;
}
.card-title { font-size: 15px; font-weight: 700; color: #1a202c; }
.card-body { padding: 22px 24px; }

/* ── TABLES ────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: #f7fafc; padding: 11px 14px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: #718096; text-align: left;
  border-bottom: 2px solid #edf2f7; white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid #f7fafc;
  transition: background 0.15s;
}
tbody tr:hover { background: #f7fafc; }
tbody td { padding: 11px 14px; font-size: 13.5px; color: #2d3748; vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }

/* ── BADGES ────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-success { background: #f0fff4; color: #276749; }
.badge-danger  { background: #fff5f5; color: #c53030; }
.badge-warning { background: #fffaf0; color: #c05621; }
.badge-info    { background: #ebf8ff; color: #2b6cb0; }
.badge-secondary { background: #f7fafc; color: #4a5568; }
.badge-purple  { background: #faf5ff; color: #6b46c1; }

/* ── BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; border: none;
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: var(--transition);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; box-shadow: 0 4px 12px rgba(102,126,234,0.35); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(102,126,234,0.5); color: #fff; }
.btn-success { background: linear-gradient(135deg, #48bb78, #38a169); color: #fff; box-shadow: 0 4px 12px rgba(72,187,120,0.35); }
.btn-success:hover { box-shadow: 0 6px 20px rgba(72,187,120,0.5); color: #fff; }
.btn-danger  { background: linear-gradient(135deg, #fc8181, #e53e3e); color: #fff; }
.btn-warning { background: linear-gradient(135deg, #f6ad55, #ed8936); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-light { background: #f7fafc; color: #4a5568; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.btn-light:hover { background: #edf2f7; }

/* ── FORMS ─────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: #4a5568; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px; }
.form-control, .form-select {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid #e2e8f0; border-radius: 8px;
  font-size: 14px; color: #2d3748; background: #fff;
  transition: var(--transition); outline: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102,126,234,0.12);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check-input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.form-text { font-size: 11.5px; color: #a0aec0; margin-top: 4px; }

/* ── STEP PROGRESS ─────────────────────────────────────── */
.step-progress { display: flex; align-items: center; gap: 0; margin-bottom: 32px; }
.step {
  display: flex; align-items: center; flex: 1;
  position: relative;
}
.step-circle {
  width: 36px; height: 36px; border-radius: 50%;
  background: #e2e8f0; color: #a0aec0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0; z-index: 1;
  transition: var(--transition);
}
.step.active .step-circle { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; box-shadow: 0 4px 12px rgba(102,126,234,0.4); }
.step.done .step-circle { background: var(--success); color: #fff; }
.step-label { margin-left: 10px; font-size: 12px; font-weight: 600; color: #a0aec0; }
.step.active .step-label { color: var(--primary); }
.step.done .step-label { color: var(--success); }
.step-line { flex: 1; height: 2px; background: #e2e8f0; margin: 0 12px; }
.step.done + .step .step-line, .step.done .step-line { background: var(--success); }

/* ── ALERTS / MESSAGES ─────────────────────────────────── */
.alert {
  padding: 12px 18px; border-radius: 8px;
  margin-bottom: 16px; font-size: 13.5px;
  display: flex; align-items: flex-start; gap: 10px;
  animation: slideInLeft 0.3s ease;
}
.alert-success { background: #f0fff4; color: #276749; border-left: 4px solid #48bb78; }
.alert-error   { background: #fff5f5; color: #c53030; border-left: 4px solid #fc8181; }
.alert-warning { background: #fffaf0; color: #c05621; border-left: 4px solid #f6ad55; }
.alert-info    { background: #ebf8ff; color: #2b6cb0; border-left: 4px solid #63b3ed; }

/* ── PAGE HEADER ───────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header-left { flex: 1; }
.page-title { font-size: 22px; font-weight: 800; color: #1a202c; }
.page-subtitle { font-size: 13px; color: #718096; margin-top: 2px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #a0aec0; margin-top: 4px; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb-sep { color: #cbd5e0; }

/* ── FILTER BAR ────────────────────────────────────────── */
.filter-bar {
  background: #fff; border-radius: var(--card-radius);
  padding: 16px 20px; margin-bottom: 20px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 5px; min-width: 140px; }
.filter-label { font-size: 11px; font-weight: 600; color: #718096; text-transform: uppercase; letter-spacing: 0.4px; }
.filter-control { padding: 7px 12px; border: 1.5px solid #e2e8f0; border-radius: 7px; font-size: 13px; outline: none; }
.filter-control:focus { border-color: var(--primary); }

/* ── AVATAR / PHOTO ────────────────────────────────────── */
.student-avatar {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.student-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }

/* ── RECEIPT ───────────────────────────────────────────── */
.receipt-card {
  max-width: 600px; margin: 0 auto;
  border: 2px solid #e2e8f0; border-radius: 12px; overflow: hidden;
}
.receipt-header { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; padding: 24px; text-align: center; }
.receipt-body { padding: 24px; }
.receipt-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #e2e8f0; font-size: 13.5px; }
.receipt-total { background: #f7fafc; margin: 16px -24px -24px; padding: 16px 24px; }

/* ── DAYBOOK ───────────────────────────────────────────── */
.daybook-nav { display: flex; align-items: center; gap: 12px; }
.daybook-date { font-size: 20px; font-weight: 800; }
.income-badge { background: #f0fff4; color: #276749; padding: 6px 14px; border-radius: 8px; font-weight: 700; }
.expense-badge { background: #fff5f5; color: #c53030; padding: 6px 14px; border-radius: 8px; font-weight: 700; }
.net-positive { color: #276749; font-weight: 800; font-size: 18px; }
.net-negative { color: #c53030; font-weight: 800; font-size: 18px; }

/* ── REPORT CARD PRINT ─────────────────────────────────── */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; padding-top: 0 !important; }
  .content-wrapper { padding: 0 !important; }
  .card { box-shadow: none !important; }
}
.print-header { text-align: center; padding: 20px; border-bottom: 2px solid #e2e8f0; margin-bottom: 20px; }
.grade-A { color: #276749; font-weight: 800; }
.grade-B { color: #2b6cb0; font-weight: 800; }
.grade-C { color: #c05621; font-weight: 800; }
.grade-F { color: #c53030; font-weight: 800; }

/* ── TC PRINT ──────────────────────────────────────────── */
.tc-document { border: 3px double #2d3748; padding: 32px; max-width: 800px; margin: 0 auto; }
.tc-school-header { text-align: center; margin-bottom: 24px; }
.tc-title { font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; color: #1a202c; margin: 12px 0; }
.tc-fields table { width: 100%; }
.tc-fields td { padding: 8px 12px; font-size: 13.5px; }
.tc-fields td:first-child { font-weight: 600; width: 40%; color: #4a5568; }

/* ── MOBILE ────────────────────────────────────────────── */
.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(226,232,240,1);
  border-radius: 12px;
  font-size: 20px;
  cursor: pointer;
  color: #334155;
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: min(86vw, 320px);
  }
  .sidebar.open { transform: translateX(0); }
  /* On mobile the active blob bleeds to the physical edge */
  .nav-link.active { border-radius: 999px 0 0 999px; }
  .main-content { margin-left: 0; }
  .topbar {
    left: 0;
    padding: 0 14px;
  }
  .sidebar-toggle { display: flex; }
  .content-wrapper { padding: 16px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .topbar-title {
    font-size: 16px;
  }
  .topbar-actions .btn {
    display: none;
  }
  .user-chip {
    padding: 5px 10px;
  }
  .stat-cards {
    grid-template-columns: 1fr;
  }
}

/* ── CHART CONTAINER ───────────────────────────────────── */
.chart-container { position: relative; height: 280px; }

/* ── LOADING ANIMATION ──────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f0f4f8 25%, #e2e8f0 50%, #f0f4f8 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 6px;
}
@keyframes skeleton-loading {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── SEARCH INPUT ──────────────────────────────────────── */
.search-box {
  position: relative; display: flex; align-items: center;
}
.search-box input {
  padding: 9px 14px 9px 38px;
  border: 1.5px solid #e2e8f0; border-radius: 8px;
  font-size: 13.5px; width: 260px; outline: none; transition: var(--transition);
}
.search-box input:focus { border-color: var(--primary); width: 300px; }
.search-box .search-icon { position: absolute; left: 12px; font-size: 14px; color: #a0aec0; }

/* ── PROGRESS BAR ──────────────────────────────────────── */
.progress { background: #e2e8f0; border-radius: 20px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 20px; transition: width 0.6s ease; }

/* ── ATTENDANCE GRID ───────────────────────────────────── */
.att-grid { display: grid; gap: 8px; }
.att-row { display: grid; grid-template-columns: 1fr 180px 180px 1fr; gap: 12px; align-items: center; padding: 10px 14px; background: #f7fafc; border-radius: 8px; }
.att-status-btns { display: flex; gap: 6px; }
.att-status-btn {
  padding: 5px 10px; border: 1.5px solid #e2e8f0; border-radius: 6px;
  font-size: 11px; font-weight: 600; cursor: pointer; background: #fff;
  transition: var(--transition);
}
.att-status-btn.selected-P { background: #f0fff4; border-color: #48bb78; color: #276749; }
.att-status-btn.selected-A { background: #fff5f5; border-color: #fc8181; color: #c53030; }
.att-status-btn.selected-HD { background: #fffaf0; border-color: #f6ad55; color: #c05621; }
.att-status-btn.selected-L  { background: #ebf8ff; border-color: #63b3ed; color: #2b6cb0; }

/* ── GRADIENT ACCENTS ──────────────────────────────────── */
.gradient-text { background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.divider { height: 1px; background: #edf2f7; margin: 20px 0; }

/* ── EMPTY STATE ──────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: #a0aec0; }
.empty-state-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.6; }
.empty-state-title { font-size: 16px; font-weight: 700; color: #4a5568; margin-bottom: 6px; }
.empty-state-text { font-size: 13px; }

/* ── LOGIN PAGE ─────────────────────────────────────────── */
.login-page { min-height: 100vh; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; border-radius: 20px; padding: 44px 40px; width: 100%; max-width: 420px; box-shadow: 0 24px 64px rgba(0,0,0,0.3); animation: fadeInUp 0.5s ease; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-icon { width: 72px; height: 72px; background: linear-gradient(135deg, var(--primary), var(--secondary)); border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 32px; margin: 0 auto 12px; box-shadow: 0 8px 24px rgba(102,126,234,0.4); }
.login-title { font-size: 24px; font-weight: 800; color: #1a202c; }
.login-subtitle { font-size: 13px; color: #718096; margin-top: 4px; }
.login-form .btn { width: 100%; justify-content: center; padding: 12px; font-size: 15px; margin-top: 6px; }
