/* =============================================================
   main.css — Maranatha Management System
   Maranatha Christian High School, Lahore, Pakistan
   Colour palette: Navy #1a2a40 | Green #55724d | Gold #af861f
   White #ffffff | Light Grey #f4f5f7 | Danger #c0392b
   ============================================================= */

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --navy:        #1a2a40;
  --navy-light:  #243650;
  --navy-dark:   #111d2e;
  --green:       #55724d;
  --green-light: #6a8f61;
  --green-dark:  #4a6344;
  --gold:        #af861f;
  --gold-light:  #c9a035;
  --gold-dark:   #9a771a;
  --white:       #ffffff;
  --grey:        #f4f5f7;
  --grey-dark:   #e2e8f0;
  --danger:      #c0392b;
  --danger-dark: #a93226;
  --success:     #28B07E;
  --info:        #3498db;
  --warning:     #f39c12;

  --text-dark:   #1a2a40;
  --text-mid:    #4a5568;
  --text-light:  #718096;
  --text-muted:  #a0aec0;
  --border:      #e2e8f0;

  --shadow:      0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:   0 10px 25px rgba(0,0,0,.12), 0 4px 6px rgba(0,0,0,.05);

  --radius:      8px;
  --radius-lg:   12px;
  --sidebar-w:   260px;
  --topbar-h:    58px;
  --font:        'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}


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

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

body {
  font-family: var(--font);
  background: var(--grey);
  color: var(--text-dark);
  line-height: 1.55;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--green);
  text-decoration: none;
  transition: color .15s;
}
a:hover {
  text-decoration: underline;
  color: var(--green-dark);
}

img { max-width: 100%; height: auto; }

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
}
button {
  cursor: pointer;
  border: none;
  background: none;
}
svg { display: inline-block; vertical-align: middle; }

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  color: var(--navy);
}


/* ── Utility ──────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-gold { color: var(--gold); }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.fw-bold { font-weight: 700; }
.fw-semi { font-weight: 600; }


/* =============================================================
   AUTH SCREENS — Login / Register
   ============================================================= */
#auth-container {
  min-height: 100vh;
  background: linear-gradient(-45deg, #1a2a40, #2e7d32, #af861f, #00796b);
  background-size: 400% 400%;
  animation: authGradient 15s ease infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

@keyframes authGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.auth-wrapper {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-card {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 38px 36px 30px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  border-top: 4px solid;
  border-image: linear-gradient(135deg, #2e7d32, #af861f, #00796b) 1;
}

.auth-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.auth-logo-img {
  width: 110px;
  height: auto;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: none;
  border: none;
}

.auth-school-name {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #1a2a40, #2e7d32);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 3px;
  line-height: 1.25;
}

.auth-tagline {
  text-align: center;
  font-size: 12px;
  color: var(--gold);
  font-style: italic;
  margin-bottom: 4px;
  font-weight: 600;
  letter-spacing: .3px;
}

.auth-app-label {
  text-align: center;
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 22px;
}

.auth-form {}

.auth-form .form-control:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46,125,50,.15);
}

.auth-form .btn-primary {
  background: linear-gradient(135deg, #2e7d32, #1a5c28);
  border: none;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 12px 20px;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(46,125,50,.3);
}
.auth-form .btn-primary:hover {
  background: linear-gradient(135deg, #1a5c28, #0d3d18);
  box-shadow: 0 6px 20px rgba(46,125,50,.4);
  transform: translateY(-1px);
}

.auth-error {
  background: rgba(192,57,43,.08);
  border: 1px solid rgba(192,57,43,.25);
  border-radius: 6px;
  padding: 9px 13px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--danger);
}

.auth-info-box {
  background: rgba(175,134,31,.07);
  border: 1px solid rgba(175,134,31,.2);
  border-radius: 6px;
  padding: 10px 13px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: #7a5c10;
  line-height: 1.5;
}

.auth-link-row {
  text-align: center;
  margin-top: 12px;
}

.auth-link {
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
  cursor: pointer;
}
.auth-link:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.auth-bottom-text {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: rgba(255,255,255,.7);
}
.auth-bottom-text a {
  color: var(--gold-light);
  font-weight: 600;
}
.auth-bottom-text a:hover {
  color: var(--gold);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-light);
}
.auth-footer a {
  color: var(--gold);
  font-weight: 600;
}


/* =============================================================
   PENDING APPROVAL SCREEN
   ============================================================= */
#pending-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #2c4a3e 0%, #1a3c34 40%, #1e3040 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pending-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.pending-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(175,134,31,.12);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.pending-icon svg { width: 32px; height: 32px; }

.pending-card h2 {
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 12px;
  font-weight: 700;
}
.pending-card p {
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 10px;
  line-height: 1.7;
}

.pending-rejected .pending-icon {
  background: rgba(192,57,43,.1);
  color: var(--danger);
}


/* =============================================================
   APP LAYOUT — Sidebar + Main Content
   ============================================================= */
#app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}


/* ── Sidebar Overlay (mobile) ─────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99;
  opacity: 0;
  transition: opacity .3s;
}
.sidebar-overlay.active {
  display: block;
  opacity: 1;
}


/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: #55724d;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.12) transparent;
  transition: transform .3s ease;
  z-index: 100;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

/* Sidebar user section */
.sidebar-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sidebar-logo-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 10px;
  border: 3px solid var(--gold-light);
  box-shadow: 0 2px 10px rgba(175,134,31,.35);
}

.sidebar-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 10px;
  border: 3px solid var(--gold-light);
  box-shadow: 0 2px 8px rgba(175,134,31,.3);
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  text-align: center;
}

.sidebar-user-role {
  font-size: 10.5px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-top: 2px;
}

.sidebar-user-org {
  font-size: 10px;
  color: #ffffff;
  margin-top: 6px;
  text-align: center;
  line-height: 1.3;
}

.sidebar-user-loc {
  font-size: 9.5px;
  color: rgba(255,255,255,.85);
  margin-top: 1px;
  text-align: center;
}

/* Sidebar navigation */
#sidebar-nav {
  flex: 1;
  padding: 8px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-group {
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow .2s;
}

/* ── Group label (section heading) ─── */
.nav-group-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 8px 14px 5px;
  margin: 0;
}

/* ── Group items container ─── */
.nav-group-items {
  padding: 2px 4px 6px;
}

/* ── Colour themes per section ─── */
/* OVERVIEW — deep navy with gold accent */
.nav-group[data-group="overview"] {
  background: rgba(26,42,64,.45);
  border: 1px solid rgba(175,134,31,.25);
}
.nav-group[data-group="overview"] .nav-group-label {
  color: #d4a94e;
}

/* SCHOOL — warm gold tones */
.nav-group[data-group="school"] {
  background: rgba(175,134,31,.18);
  border: 1px solid rgba(175,134,31,.25);
}
.nav-group[data-group="school"] .nav-group-label {
  color: #f0c95c;
}

/* ACADEMICS — deep green */
.nav-group[data-group="academics"] {
  background: rgba(26,42,64,.4);
  border: 1px solid rgba(85,114,77,.35);
}
.nav-group[data-group="academics"] .nav-group-label {
  color: #8cc480;
}

/* COMMUNICATION — teal accent */
.nav-group[data-group="communication"] {
  background: rgba(45,100,110,.2);
  border: 1px solid rgba(45,100,110,.25);
}
.nav-group[data-group="communication"] .nav-group-label {
  color: #6dcdd8;
}

/* SYSTEM — muted slate */
.nav-group[data-group="system"] {
  background: rgba(60,60,80,.25);
  border: 1px solid rgba(100,100,130,.2);
}
.nav-group[data-group="system"] .nav-group-label {
  color: #b0b4c8;
}

/* ACCOUNT — subtle warm */
.nav-group[data-group="account"] {
  background: rgba(140,60,60,.15);
  border: 1px solid rgba(180,80,80,.2);
  margin-top: auto;
}
.nav-group[data-group="account"] .nav-group-label {
  color: #e08888;
}

/* ── Nav items ─── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  cursor: pointer;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  border-radius: 7px;
  transition: background .15s, color .15s, transform .1s;
  user-select: none;
  margin: 1px 0;
}
.nav-item:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  transform: translateX(2px);
}
.nav-item.active {
  background: rgba(255,255,255,.18);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-item i, .nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .85;
}
.nav-item.active i, .nav-item.active svg { opacity: 1; }

/* Sign-out item styling */
.nav-item-signout:hover {
  background: rgba(180,60,60,.25);
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
  text-align: center;
}

.sidebar-copyright {
  font-size: 9px;
  color: #ffffff;
  line-height: 1.4;
  margin-bottom: 6px;
}

.sidebar-version {
  font-size: 10px;
  color: rgba(255,255,255,.7);
  letter-spacing: .5px;
}


/* ── Main Content Wrapper ─────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}


/* ── Top Header ───────────────────────────────────────────── */
.top-header {
  height: var(--topbar-h);
  background: linear-gradient(135deg, #1a2a40, #2a3f5f);
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(26,42,64,.15);
  z-index: 10;
}

.topbar-logo { display: none; }
.topbar-info {
  display: flex; align-items: center;
  justify-content: center; flex: 1;
  text-align: center;
}
.topbar-school-name { display: none; }
.topbar-copyright {
  font-size: 12.5px; color: #ffffff;
  font-weight: 600; letter-spacing: 0.3px;
  line-height: 1.4; text-align: center;
}

.hamburger-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  color: #fff;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  flex-shrink: 0;
}
.hamburger-btn:hover { background: rgba(255,255,255,.15); }
.hamburger-btn svg { width: 20px; height: 20px; }

.top-header-title {
  display: none;
}

.top-header-school {
  display: none;
}


/* ── Content Area ─────────────────────────────────────────── */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--grey);
}

.page-section {
  animation: fadeIn .25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* =============================================================
   PAGE HEADER
   ============================================================= */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 3px;
}

.page-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}


/* =============================================================
   CARDS
   ============================================================= */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  background: var(--navy);
  color: var(--white);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-header h2 { font-size: 15px; font-weight: 700; color: var(--white); }

.card-body { padding: 20px; }

.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}


/* =============================================================
   STAT CARDS
   ============================================================= */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  border-top: 4px solid var(--grey-dark);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: default;
  transition: box-shadow .15s, transform .15s;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-primary { border-top-color: var(--green); }
.stat-success { border-top-color: var(--success); }
.stat-gold    { border-top-color: var(--gold); }
.stat-navy    { border-top-color: var(--navy); }
.stat-info    { border-top-color: var(--info); }
.stat-danger  { border-top-color: var(--danger); }
.stat-muted   { border-top-color: #aaa; }
.stat-warning { border-top-color: var(--warning); }

.stat-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  color: var(--gold);
}
.stat-icon svg { width: 38px; height: 38px; }
.stat-primary .stat-icon { color: var(--green); }
.stat-success .stat-icon { color: var(--success); }
.stat-navy .stat-icon    { color: var(--navy); }
.stat-info .stat-icon    { color: var(--info); }
.stat-danger .stat-icon  { color: var(--danger); }

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-light);
  font-weight: 600;
  margin-top: 2px;
}


/* ── Colorful Filled Stat Cards ─────────────────────────────── */
/* 5-column equal grid for expenses */
.stat-grid-5 { grid-template-columns: repeat(5, 1fr); }

.stat-filled-green { background: linear-gradient(135deg, #55724d, #3d5a36); border-top: none; }
.stat-filled-green .stat-value, .stat-filled-green .stat-label, .stat-filled-green .stat-icon { color: #fff !important; }
.stat-filled-gold { background: linear-gradient(135deg, #af861f, #8d6c18); border-top: none; }
.stat-filled-gold .stat-value, .stat-filled-gold .stat-label, .stat-filled-gold .stat-icon { color: #fff !important; }
.stat-filled-navy { background: linear-gradient(135deg, #1a2a40, #2a3f5f); border-top: none; }
.stat-filled-navy .stat-value, .stat-filled-navy .stat-label, .stat-filled-navy .stat-icon { color: #fff !important; }
.stat-filled-teal { background: linear-gradient(135deg, #2d646e, #1d4a52); border-top: none; }
.stat-filled-teal .stat-value, .stat-filled-teal .stat-label, .stat-filled-teal .stat-icon { color: #fff !important; }
.stat-filled-purple { background: linear-gradient(135deg, #5b4a8a, #443672); border-top: none; }
.stat-filled-purple .stat-value, .stat-filled-purple .stat-label, .stat-filled-purple .stat-icon { color: #fff !important; }
.stat-filled-rose { background: linear-gradient(135deg, #a84060, #8a3050); border-top: none; }
.stat-filled-rose .stat-value, .stat-filled-rose .stat-label, .stat-filled-rose .stat-icon { color: #fff !important; }

/* ── Dashboard Copyright Footer (sticky bottom) ──────────── */
.dashboard-copyright-footer {
  background: #af861f;
  color: #fff;
  text-align: center;
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  line-height: 1.5;
  position: fixed;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 9;
}
/* Give content area bottom padding so content isn't hidden behind footer */
.content-area { padding-bottom: 50px !important; }

/* =============================================================
   DASHBOARD GRID
   ============================================================= */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.dash-panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dash-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.dash-panel-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}
.quick-action-btn {
  background: var(--white);
  border: none;
  cursor: pointer;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  transition: background .15s;
}
.quick-action-btn:hover { background: rgba(85,114,77,.06); }
.quick-action-btn svg { width: 22px; height: 22px; color: var(--green); }

/* Colorful quick action buttons */
.quick-action-green { background: linear-gradient(135deg, #55724d, #3d5a36) !important; color: #fff !important; }
.quick-action-green svg { color: #fff !important; }
.quick-action-green:hover { opacity: .9; }
.quick-action-navy { background: linear-gradient(135deg, #1a2a40, #2a3f5f) !important; color: #fff !important; }
.quick-action-navy svg { color: #fff !important; }
.quick-action-navy:hover { opacity: .9; }
.quick-action-gold { background: linear-gradient(135deg, #af861f, #8d6c18) !important; color: #fff !important; }
.quick-action-gold svg { color: #fff !important; }
.quick-action-gold:hover { opacity: .9; }
.quick-action-teal { background: linear-gradient(135deg, #2d646e, #1d4a52) !important; color: #fff !important; }
.quick-action-teal svg { color: #fff !important; }
.quick-action-teal:hover { opacity: .9; }

/* Colorful dash panel headers */
.dash-panel-green .dash-panel-header { background: linear-gradient(135deg, #55724d, #3d5a36); border-bottom: none; }
.dash-panel-green .dash-panel-header h3 { color: #fff; }
.dash-panel-green .dash-panel-header .btn { background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.3); }
.dash-panel-gold .dash-panel-header { background: linear-gradient(135deg, #af861f, #8d6c18); border-bottom: none; }
.dash-panel-gold .dash-panel-header h3 { color: #fff; }

/* Finance nav group color */
.nav-group[data-group="finance"] {
  background: rgba(175,134,31,.2);
  border: 1px solid rgba(175,134,31,.3);
}
.nav-group[data-group="finance"] .nav-group-label {
  color: #f0c95c;
}


/* =============================================================
   NOTICES
   ============================================================= */
.notice-item {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.notice-item:last-child { border-bottom: none; }
.notice-urgent {
  background: rgba(175,134,31,.04);
  border-left: 3px solid var(--gold);
}
.notice-priority-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  background: var(--gold);
  color: var(--white);
  padding: 1px 7px;
  border-radius: 10px;
  margin-bottom: 4px;
}
.notice-title { font-size: 13.5px; font-weight: 600; color: var(--navy); }
.notice-date  { font-size: 11.5px; color: var(--text-light); margin-top: 2px; }


/* =============================================================
   ALERT BANNER
   ============================================================= */
.alert-banner {
  background: var(--gold);
  color: var(--white);
  padding: 10px 20px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.alert-link {
  margin-left: auto;
  text-decoration: underline;
  font-weight: 700;
  font-size: 13px;
}


/* =============================================================
   DATA TABLES
   ============================================================= */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead tr { background: var(--navy); }
thead th {
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 11px 14px;
  text-align: left;
  white-space: nowrap;
}

tbody tr { transition: background .1s; }
tbody tr:nth-child(even) { background: var(--grey); }
tbody tr:hover { background: rgba(85,114,77,.07); }

tbody td {
  padding: 11px 14px;
  font-size: 13.5px;
  color: var(--text-dark);
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.td-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.td-actions .btn { padding: 4px 9px; }

.table-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-light);
  font-size: 14px;
}


/* =============================================================
   FORMS
   ============================================================= */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--navy);
}

.form-required { color: var(--danger); }

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--text-dark);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-control:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(85,114,77,.12);
}
.form-control::placeholder { color: #aab; }
.form-control:disabled {
  background: var(--grey);
  color: var(--text-light);
  cursor: not-allowed;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a2a40' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 32px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.form-row-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 14px;
}

.form-hint {
  font-size: 11.5px;
  color: var(--text-light);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

.form-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}


/* =============================================================
   BUTTONS
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s, transform .1s;
  border: 2px solid transparent;
  white-space: nowrap;
  line-height: 1.4;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--green);
  color: var(--white);
}
.btn-primary:hover { background: var(--green-dark); }

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-secondary:hover { background: rgba(26,42,64,.06); }

.btn-gold {
  background: var(--gold);
  color: var(--white);
}
.btn-gold:hover { background: var(--gold-dark); }

.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover { background: var(--danger-dark); }

.btn-success {
  background: var(--success);
  color: var(--white);
}
.btn-success:hover { background: #219a6d; }

.btn-info {
  background: var(--info);
  color: var(--white);
}
.btn-info:hover { background: #2980b9; }

.btn-ghost {
  background: transparent;
  color: var(--text-mid);
}
.btn-ghost:hover { background: var(--grey); color: var(--navy); }

.btn-full { width: 100%; justify-content: center; }

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
}
.btn-sm svg { width: 13px; height: 13px; }

.btn-lg {
  padding: 11px 22px;
  font-size: 15px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
  transition: background .15s;
}
.btn-icon:hover { background: var(--grey); }
.btn-icon svg { width: 18px; height: 18px; }

.btn-group {
  display: flex;
  gap: 0;
}
.btn-group .btn {
  border-radius: 0;
}
.btn-group .btn:first-child { border-radius: 6px 0 0 6px; }
.btn-group .btn:last-child { border-radius: 0 6px 6px 0; }


/* =============================================================
   BADGES
   ============================================================= */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .3px;
}

.badge-success { background: var(--success); }
.badge-danger  { background: var(--danger); }
.badge-warning { background: var(--warning); color: var(--white); }
.badge-navy    { background: var(--navy); }
.badge-gold    { background: var(--gold); }
.badge-info    { background: var(--info); }
.badge-green   { background: var(--green); }
.badge-muted   { background: #aaa; }
.badge-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-mid);
}


/* =============================================================
   MODALS
   ============================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .25s;
}
.modal-backdrop.modal-open { opacity: 1; }

.modal {
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  transform: translateY(18px);
  transition: transform .25s;
}
.modal-backdrop.modal-open .modal { transform: translateY(0); }

.modal-lg { max-width: 780px; }
.modal-sm { max-width: 400px; }
.modal-xl { max-width: 960px; }

.modal-header {
  background: var(--navy);
  color: var(--white);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px 10px 0 0;
  flex-shrink: 0;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: rgba(255,255,255,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.modal-close:hover {
  background: rgba(255,255,255,.15);
  color: var(--white);
}
.modal-close svg { width: 16px; height: 16px; }

.modal-body { padding: 22px 20px; }

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}


/* =============================================================
   TOAST NOTIFICATIONS
   ============================================================= */
#toast-container {
  position: fixed;
  top: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 400px;
  padding: 12px 14px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  transform: translateX(120%);
  opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
  pointer-events: all;
}
.toast-show {
  transform: translateX(0);
  opacity: 1;
}

.toast-success { background: var(--green); color: var(--white); }
.toast-error   { background: var(--danger); color: var(--white); }
.toast-info    { background: var(--navy); color: var(--white); }
.toast-warning { background: var(--gold); color: var(--white); }

.toast-close {
  font-size: 18px;
  line-height: 1;
  color: rgba(255,255,255,.75);
  cursor: pointer;
  flex-shrink: 0;
}
.toast-close:hover { color: var(--white); }

.toast svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}


/* =============================================================
   SEARCH BAR
   ============================================================= */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  transition: border-color .15s;
}
.search-bar:focus-within { border-color: var(--green); }
.search-bar svg {
  width: 15px;
  height: 15px;
  color: var(--text-light);
  flex-shrink: 0;
}
.search-bar input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 13.5px;
  background: none;
}
.search-bar input::placeholder { color: #aab; }


/* =============================================================
   FILTER ROW
   ============================================================= */
.filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-row select {
  padding: 7px 30px 7px 10px;
  min-width: 140px;
}


/* =============================================================
   TOOLBAR
   ============================================================= */
.toolbar {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}


/* =============================================================
   SECTION LABELS
   ============================================================= */
.section-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 10px;
  margin-top: 20px;
}


/* =============================================================
   EMPTY, LOADING & ERROR STATES
   ============================================================= */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-light);
}
.empty-icon { width: 52px; height: 52px; margin: 0 auto 14px; opacity: .25; }
.empty-icon svg { width: 52px; height: 52px; }
.empty-state p { font-size: 14px; }

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 200px;
  color: var(--text-light);
  font-size: 14px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.page-error {
  text-align: center;
  padding: 40px;
  color: var(--danger);
}

.page-placeholder {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-mid);
}
.placeholder-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  color: var(--gold);
  opacity: .6;
}
.placeholder-icon svg { width: 56px; height: 56px; }
.page-placeholder h2 {
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 10px;
}
.page-placeholder p {
  font-size: 14px;
  margin-bottom: 6px;
}


/* =============================================================
   SPONSORSHIP OVERVIEW (Dashboard)
   ============================================================= */
.sponsorship-overview { padding: 14px 18px; }
.sp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
}
.sp-label { font-size: 13px; color: var(--text-mid); }
.sp-val   { font-size: 16px; font-weight: 700; color: var(--navy); }
.sp-divider { border-top: 1px solid var(--border); margin: 4px 0; }
.sp-total .sp-label { font-weight: 600; color: var(--navy); }
.sp-total .sp-val   { color: var(--green); }


/* =============================================================
   TABS
   ============================================================= */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  gap: 0;
}

.tab {
  flex: none;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-light);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tab:hover { color: var(--navy); }
.tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}


/* =============================================================
   AUTH TABS (legacy compat)
   ============================================================= */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 22px;
}

.auth-tab {
  flex: 1;
  padding: 9px 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-light);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.auth-tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}


/* =============================================================
   AVATAR
   ============================================================= */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-xl { width: 64px; height: 64px; font-size: 24px; }


/* =============================================================
   TOPBAR ELEMENTS (compat with legacy JS)
   ============================================================= */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .15s;
}
.topbar-user:hover { background: var(--grey); }

.topbar-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.topbar-user-info span:first-child {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
}
.topbar-user-info span:last-child {
  font-size: 10px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .5px;
}

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


/* =============================================================
   NOTIFICATION BADGE
   ============================================================= */
.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--danger);
  color: var(--white);
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  padding: 0 3px;
}


/* =============================================================
   PROGRESS BAR
   ============================================================= */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--grey);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width .4s ease;
}
.progress-fill.gold { background: var(--gold); }
.progress-fill.danger { background: var(--danger); }
.progress-fill.info { background: var(--info); }


/* =============================================================
   LIST ITEMS
   ============================================================= */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: rgba(85,114,77,.04); }

.list-item-content { flex: 1; min-width: 0; }
.list-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
}
.list-item-subtitle {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 1px;
}
.list-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}


/* =============================================================
   CHECKBOX & RADIO
   ============================================================= */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-dark);
  margin-bottom: 8px;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  accent-color: var(--green);
  width: 16px;
  height: 16px;
  cursor: pointer;
}


/* =============================================================
   DIVIDERS
   ============================================================= */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.divider-gold {
  border-top-color: var(--gold);
  border-top-width: 2px;
}


/* =============================================================
   RESPONSIVE GRID
   ============================================================= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }


/* =============================================================
   ATTENDANCE SPECIFIC
   ============================================================= */
.attendance-cell {
  text-align: center;
  min-width: 80px;
}
.attendance-present { color: var(--success); font-weight: 700; }
.attendance-absent  { color: var(--danger); font-weight: 700; }
.attendance-late    { color: var(--warning); font-weight: 700; }
.attendance-leave   { color: var(--info); font-weight: 700; }


/* =============================================================
   PRINT STYLES
   ============================================================= */
@media print {
  @page { size: A4 portrait; margin: 0; }
  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    overflow: visible;
    background: var(--white);
  }
  #sidebar,
  .sidebar-overlay,
  .top-header,
  .hamburger-btn,
  .page-header-actions,
  .btn,
  #toast-container,
  .no-print { display: none !important; }
  .main-content { height: auto; overflow: visible; }
  .content-area { padding: 0; overflow: visible; }
  #app-container { display: block !important; height: auto; }
  .print-only { display: block !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
.print-only { display: none; }


/* ── Class Cards Grid ─────────────────────────────────── */
.class-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.class-card {
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  color: #fff;
  position: relative;
  overflow: hidden;
  min-height: 130px;
}
.class-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.class-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fff;
}
.class-card .class-card-meta {
  font-size: 13px;
  opacity: 0.9;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.class-card .class-card-meta svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 4px;
}
.class-card .class-card-count {
  font-size: 28px;
  font-weight: 800;
  position: absolute;
  top: 14px;
  right: 18px;
  opacity: 0.25;
}


/* =============================================================
   MOBILE RESPONSIVE
   ============================================================= */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
  }
  #sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .hamburger-btn { display: flex; }

  .main-content { width: 100%; min-width: 0; }

  .content-area { padding: 12px; overflow-x: hidden; }

  .top-header { padding: 0 10px; }
  .topbar-copyright { font-size: 10px !important; word-wrap: break-word; }
  .topbar-info { min-width: 0; overflow: hidden; }

  .dashboard-copyright-footer { font-size: 10px; padding: 10px 12px; left: 0; }

  .top-header-school { display: none; }

  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid-5 { grid-template-columns: 1fr 1fr; }
  .class-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }

  .form-row-2,
  .form-row-3,
  .form-row-4 { grid-template-columns: 1fr; }

  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }

  .auth-card { padding: 28px 20px 24px; }

  .page-header { flex-direction: column; }
  .page-header-actions { width: 100%; }

  .modal { max-width: calc(100vw - 32px); }

  .tabs { overflow-x: auto; }
  .tab { padding: 10px 14px; font-size: 12.5px; }

  .topbar-user-info { display: none; }

  .table-wrap { margin: 0 -16px; }
  .table-wrap table { font-size: 12.5px; }
  .table-wrap th,
  .table-wrap td { padding: 8px 10px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .class-cards-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-row select { min-width: auto; width: 100%; }
  .btn-group { flex-direction: column; }
  .btn-group .btn { border-radius: 6px; }
}


/* =============================================================
   SCROLLBAR STYLING
   ============================================================= */
.content-area::-webkit-scrollbar { width: 6px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.12);
  border-radius: 3px;
}
.content-area::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.2); }


/* =============================================================
   TRANSITIONS & ANIMATIONS
   ============================================================= */
.fade-in {
  animation: fadeIn .3s ease;
}

.slide-up {
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.scale-in {
  animation: scaleIn .2s ease;
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Modal ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #fff; border-radius: 12px;
  width: 90%; max-width: 540px; max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleIn .2s ease;
}
.modal-box-wide  { max-width: 720px; }
.modal-box-xl    { max-width: 900px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 17px; font-weight: 700; color: var(--navy); margin: 0; }
.modal-close-btn {
  font-size: 24px; line-height: 1; background: none; border: none;
  color: var(--text-light); cursor: pointer; padding: 0 4px;
}
.modal-close-btn:hover { color: var(--danger); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ── Data Table ────────────────────────────────────────── */
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.data-table thead { background: #1a2a40; }
.data-table th {
  text-align: left; font-weight: 600; color: #ffffff;
  padding: 10px 14px; border-bottom: none;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
.data-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: rgba(85,114,77,.03); }

/* ── Card Grid ─────────────────────────────────────────── */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-top: 16px;
}
.info-card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
  transition: box-shadow .15s;
}
.info-card:hover { box-shadow: var(--shadow-md); }
.info-card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; background: var(--grey);
  border-bottom: 1px solid var(--border);
}
.info-card-header i { color: var(--green); width: 18px; height: 18px; }
.info-card-body { padding: 12px 16px; }
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; font-size: 13px;
}
.info-row span:first-child { color: var(--text-light); }
.info-row span:last-child  { font-weight: 500; }
.info-card-actions {
  padding: 10px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 8px;
}

/* ── Filter Bar ────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  align-items: center; margin: 16px 0;
}

/* ── Notice Card ───────────────────────────────────────── */
.notice-card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--border); padding: 18px 20px;
  margin-bottom: 12px;
}
.notice-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 8px;
}
.notice-card-header h3 { font-size: 15px; font-weight: 600; color: var(--navy); margin: 0; }
.notice-body { font-size: 14px; color: var(--text-mid); line-height: 1.6; margin-bottom: 10px; }
.notice-card-footer {
  display: flex; justify-content: space-between; align-items: center;
}

/* ── Profile Grid ──────────────────────────────────────── */
.profile-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.profile-field { font-size: 14px; }
.profile-field label {
  display: block; font-size: 11.5px; font-weight: 600;
  color: var(--text-light); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 3px;
}
.profile-field span { color: var(--text-dark); }

/* ── School Overview ───────────────────────────────────── */
.school-overview { padding: 8px 0; }
.overview-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.overview-row:last-child { border-bottom: none; }
.overview-label { color: var(--text-light); }
.overview-val   { font-weight: 500; }

/* ── Dashboard Grid ────────────────────────────────────── */
.dashboard-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px; margin-top: 20px;
}

/* ── Badge additions ───────────────────────────────────── */
.badge-grey { background: #a0aec0; }

/* ── Page Error ────────────────────────────────────────── */
.page-error {
  padding: 40px 20px; text-align: center; color: var(--danger);
}

/* ── Auth Info Box ─────────────────────────────────────── */
.auth-info-box {
  background: rgba(85,114,77,.08); border-radius: 6px;
  padding: 10px 14px; font-size: 12.5px; color: var(--text-mid);
  margin-bottom: 14px; line-height: 1.5;
}

/* ── Student Table Thumbnails ─────────────────────────────── */
.student-name-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--navy); text-decoration: none; transition: color .15s;
}
.student-name-link:hover { color: var(--green); }
.student-table-thumb {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--gold-light); flex-shrink: 0;
}
.student-table-thumb-placeholder {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--green); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── Student Profile Layout (details left, photo right) ── */
.student-profile-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  margin-top: 20px;
  align-items: start;
}
.student-profile-details {
  display: flex; flex-direction: column; gap: 20px;
}

/* Profile cards */
.profile-card {
  background: #fff; border-radius: 10px;
  border: 1px solid var(--border);
  padding: 20px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.profile-card-title {
  font-size: 15px; font-weight: 700; color: var(--navy);
  margin: 0 0 16px 0; display: flex; align-items: center; gap: 8px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.profile-card-title svg { width: 18px; height: 18px; color: var(--green); }
.info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px;
}
.info-item { display: flex; flex-direction: column; gap: 2px; }
.info-label {
  font-size: 11px; font-weight: 600; color: var(--text-light);
  text-transform: uppercase; letter-spacing: .5px;
}
.info-value { font-size: 14px; color: var(--text-dark); font-weight: 500; }

/* Photo card (right side) */
.student-profile-photo-card {
  position: sticky; top: 20px;
}
.photo-card-inner {
  background: #fff; border-radius: 12px;
  border: 1px solid var(--border);
  padding: 28px 20px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.photo-card-image {
  width: 160px; height: 160px; margin: 0 auto 16px;
  border-radius: 50%; overflow: hidden;
  border: 4px solid var(--gold-light);
  box-shadow: 0 3px 15px rgba(175,134,31,.2);
}
.photo-card-image img {
  width: 100%; height: 100%; object-fit: cover;
}
.photo-card-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--green), #3d5a36);
  color: #fff; font-size: 48px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.photo-card-name {
  font-size: 18px; font-weight: 700; color: var(--navy); margin: 0 0 4px;
}
.photo-card-class {
  font-size: 13px; color: var(--text-mid); margin: 0 0 8px;
}
.photo-card-id {
  font-size: 12px; color: var(--text-light); margin: 8px 0 0;
  font-family: monospace; letter-spacing: .5px;
}
.photo-card-detail {
  font-size: 12px; color: var(--text-light); margin: 4px 0 0;
}
.photo-card-actions {
  display: flex; gap: 8px; justify-content: center; margin-top: 16px;
}
.photo-card-detail svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.photo-card-verse { font-style: italic; color: var(--green); }

/* ── Photo Upload in Form ────────────────────────────────── */
.photo-upload-wrap {
  display: flex; flex-direction: column; align-items: center;
}
.photo-upload-preview {
  width: 120px; height: 120px; border-radius: 50%;
  border: 3px dashed var(--border); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color .2s;
  background: var(--bg-body);
}
.photo-upload-preview:hover { border-color: var(--green); }
.photo-upload-preview img {
  width: 100%; height: 100%; object-fit: cover;
}
.photo-upload-preview span {
  font-size: 11px; color: var(--text-light); text-align: center;
  line-height: 1.4;
}
.photo-upload-preview span svg { width: 24px; height: 24px; margin-bottom: 4px; }

@media (max-width: 768px) {
  .card-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .student-profile-layout { grid-template-columns: 1fr; }
  .student-profile-photo-card { order: -1; }
  .photo-card-image { width: 120px; height: 120px; }
  .info-grid { grid-template-columns: 1fr; }
  .modal-box { width: 95%; }
  .notice-card { padding: 14px 14px; }
  .notice-card-header { flex-direction: column; gap: 6px; }
  .notice-card-footer { flex-direction: column; gap: 6px; align-items: flex-start; }
}


/* =============================================================
   MISSING GLOBAL CLASSES (used in JS pages)
   ============================================================= */

/* ── Table Responsive wrapper ─────────────────────────────── */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

/* ── Outline Button ───────────────────────────────────────── */
.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--border);
}
.btn-outline:hover {
  background: var(--grey);
}

/* ── Actions Cell ─────────────────────────────────────────── */
.actions-cell {
  white-space: nowrap;
}

/* ── Cards Grid (families, etc) ───────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

/* ── Notices List ─────────────────────────────────────────── */
.notices-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}


/* =============================================================
   ENHANCED MOBILE — Comprehensive Phone Fix
   ============================================================= */
@media (max-width: 768px) {

  /* ── Topbar ──────────────────────────────────────────────── */
  .top-header {
    padding: 0 10px;
    gap: 8px;
    height: auto;
    min-height: var(--topbar-h);
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .topbar-logo {
    display: none !important;
  }
  .topbar-info {
    flex: 1;
    min-width: 0;
    text-align: center;
    justify-content: center;
  }
  .topbar-school-name {
    display: none;
  }
  .topbar-copyright {
    font-size: 11px !important;
    opacity: 0.9 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    text-align: center;
  }

  /* ── Page Header & Action Buttons ────────────────────────── */
  .page-header {
    flex-direction: column;
    gap: 10px;
  }
  .page-header-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .page-header-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12px;
  }
  .page-title {
    font-size: 18px;
  }
  .page-subtitle {
    font-size: 12px;
  }

  /* ── Stat Cards ──────────────────────────────────────────── */
  .stat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
  }
  .stat-card {
    padding: 12px 12px 10px;
    gap: 10px;
  }
  .stat-icon { width: 28px; height: 28px; }
  .stat-icon svg { width: 28px; height: 28px; }
  .stat-value { font-size: 18px; }
  .stat-label { font-size: 9px; letter-spacing: .5px; }

  /* ── Data Tables ─────────────────────────────────────────── */
  .table-responsive {
    margin: 0 -12px;
    border-radius: 0;
    box-shadow: none;
  }
  .data-table { font-size: 12px; }
  .data-table th {
    padding: 8px 10px;
    font-size: 10px;
  }
  .data-table td {
    padding: 8px 10px;
    font-size: 12px;
  }
  .actions-cell .btn {
    padding: 4px 8px;
    font-size: 11px;
  }
  .actions-cell .btn svg {
    width: 12px;
    height: 12px;
  }

  /* ── Cards Grid ──────────────────────────────────────────── */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* ── Modals ──────────────────────────────────────────────── */
  .modal-overlay {
    padding: 10px;
    align-items: flex-start;
    padding-top: 40px;
  }
  .modal-box {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 60px);
  }
  .modal-box-wide, .modal-box-xl {
    max-width: 100%;
  }
  .modal-body { padding: 16px; }
  .modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .modal-footer .btn {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }

  /* ── Toast Notifications ─────────────────────────────────── */
  #toast-container {
    top: auto;
    bottom: 60px;
    right: 10px;
    left: 10px;
  }
  .toast {
    min-width: auto;
    max-width: 100%;
    font-size: 12.5px;
    padding: 10px 12px;
  }

  /* ── Forms in Modals ─────────────────────────────────────── */
  .modal-form .form-row-2,
  .modal-form .form-row-3,
  .modal-form .form-row-4 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* ── Buttons ─────────────────────────────────────────────── */
  .btn {
    font-size: 12.5px;
    padding: 7px 12px;
  }
  .btn svg { width: 14px; height: 14px; }

  /* ── Fixed Footer ────────────────────────────────────────── */
  .dashboard-copyright-footer {
    left: 0;
    font-size: 10px;
    padding: 8px 12px;
  }
  .content-area {
    padding-bottom: 44px !important;
  }

  /* ── Sidebar ─────────────────────────────────────────────── */
  .sidebar-user {
    padding: 18px 14px 14px;
  }
  .sidebar-logo-img {
    width: 60px;
    height: 60px;
  }

  /* ── Notice Cards ────────────────────────────────────────── */
  .notice-card-header h3 { font-size: 14px; }
  .notice-body { font-size: 13px; }

  /* ── Quick Actions ───────────────────────────────────────── */
  .quick-actions {
    grid-template-columns: 1fr 1fr;
  }
  .quick-action-btn {
    padding: 12px 8px;
    font-size: 11px;
  }
  .quick-action-btn svg { width: 18px; height: 18px; }

  /* ── Profile Cards ───────────────────────────────────────── */
  .profile-card { padding: 14px 16px; }
  .profile-card-title { font-size: 14px; }

  /* ── Auth Screen ─────────────────────────────────────────── */
  #auth-container { padding: 16px; }
  .auth-card { padding: 24px 18px 20px; }
  .auth-school-name { font-size: 16px; }
  .auth-logo-img { width: 90px; }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr !important;
  }
  .page-header-actions .btn {
    font-size: 11px;
    padding: 7px 8px;
    gap: 4px;
  }
  .page-header-actions .btn svg {
    width: 12px;
    height: 12px;
  }
  .class-cards-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .topbar-school-name { font-size: 12px; }
  .topbar-copyright { font-size: 8px !important; }
}
