/* ============================================================
   Eswatini Secondary Inspectorate — Professional Stylesheet
   Emerald & gold theme (Eswatini national colours inspired)
   ============================================================ */

:root {
  /* Primary emerald palette */
  --primary: #1a5276;
  --primary-dark: #0e3d5e;
  --primary-darker: #0a2a42;
  --primary-light: #e8f0f7;
  --primary-lighter: #f4f8fc;
  --primary-fg: #ffffff;

  /* Accent gold */
  --accent: #d4a017;
  --accent-dark: #b8860b;
  --accent-light: #fef3d8;
  --accent-fg: #4a3500;

  /* Neutrals */
  --bg: #f5f8fc;
  --bg-card: #ffffff;
  --bg-hover: #eef3f9;
  --fg: #1a2a3a;
  --fg-muted: #5a6b7a;
  --fg-light: #8a9bb0;
  --border: #d8e2ec;
  --border-light: #e8eef5;

  /* Status */
  --danger: #c0392b;
  --danger-light: #fdecea;
  --danger-dark: #922b21;
  --success: #1a5276;
  --success-light: #e8f0f7;
  --warning: #d4a017;
  --warning-light: #fef3d8;
  --info: #2c7fb8;
  --info-light: #e8f4fc;

  /* Radii */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(14,61,94,.04);
  --shadow-sm: 0 2px 4px rgba(14,61,94,.06), 0 1px 2px rgba(14,61,94,.04);
  --shadow: 0 4px 12px -2px rgba(14,61,94,.08), 0 2px 4px -1px rgba(14,61,94,.04);
  --shadow-md: 0 8px 20px -4px rgba(14,61,94,.1), 0 4px 8px -2px rgba(14,61,94,.05);
  --shadow-lg: 0 16px 40px -8px rgba(14,61,94,.14), 0 8px 16px -4px rgba(14,61,94,.06);
  --shadow-xl: 0 24px 56px -12px rgba(14,61,94,.18);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ---- Flag stripe ---- */
.flag-stripe {
  height: 5px;
  background: linear-gradient(90deg,
    #074ea2 0%, #074ea2 12%,
    #ffd700 12%, #ffd700 18%,
    #cf102d 18%, #cf102d 82%,
    #ffd700 82%, #ffd700 88%,
    #074ea2 88%, #074ea2 100%);
  flex-shrink: 0;
}

/* ============================================================
   PROFESSIONAL ICON CONTAINERS
   ============================================================ */
.icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.icon-sm { width: 2rem; height: 2rem; }
.icon-md { width: 2.5rem; height: 2.5rem; }
.icon-lg { width: 3rem; height: 3rem; }
.icon-xl { width: 3.5rem; height: 3.5rem; }

.icon-gradient-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--primary-fg);
  box-shadow: 0 6px 16px -4px rgba(26,82,118,.4), inset 0 1px 0 rgba(255,255,255,.15);
}
.icon-gradient-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: var(--primary-fg);
  box-shadow: 0 6px 16px -4px rgba(212,160,23,.4), inset 0 1px 0 rgba(255,255,255,.2);
}
.icon-soft-primary {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid rgba(26,82,118,.15);
}
.icon-soft-accent {
  background: var(--accent-light);
  color: var(--accent-fg);
  border: 1px solid rgba(212,160,23,.2);
}
.icon-soft-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(192,57,43,.15);
}
.icon-hover:hover {
  transform: translateY(-3px) scale(1.05);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s var(--ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 13px 28px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--primary-fg);
  box-shadow: 0 4px 12px -2px rgba(26,82,118,.35), inset 0 1px 0 rgba(255,255,255,.1);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-darker) 100%);
  box-shadow: 0 6px 20px -3px rgba(26,82,118,.45), inset 0 1px 0 rgba(255,255,255,.15);
  color: var(--primary-fg);
}
.btn-outline {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--fg);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-lighter); }
.btn-ghost { background: transparent; color: var(--fg-muted); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--fg); }
.btn-danger { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: var(--danger-light); color: var(--danger-dark); }
.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: var(--primary-fg);
  box-shadow: 0 4px 12px -2px rgba(212,160,23,.35), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-accent:hover { color: var(--primary-fg); box-shadow: 0 6px 20px -3px rgba(212,160,23,.45); }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  line-height: 1.4;
}
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--fg-muted); }
.badge-excellent { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: var(--primary-fg); }
.badge-good { background: var(--primary-light); color: var(--primary-dark); border: 1px solid rgba(26,82,118,.15); }
.badge-satisfactory { background: var(--accent-light); color: var(--accent-fg); border: 1px solid rgba(212,160,23,.2); }
.badge-poor { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(192,57,43,.15); }
.badge-ack { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: var(--primary-fg); }
.badge-submitted { background: var(--accent-light); color: var(--accent-fg); border: 1px solid rgba(212,160,23,.2); }
.badge-chief { background: linear-gradient(135deg, var(--primary), var(--primary-darker)); color: var(--primary-fg); box-shadow: 0 2px 8px -2px rgba(26,82,118,.3); }
.badge-senior { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: var(--primary-fg); box-shadow: 0 2px 8px -2px rgba(212,160,23,.3); }
.badge-regional { background: var(--bg-card); border: 1px solid var(--border); color: var(--fg-muted); }
.badge-role { background: var(--primary-light); color: var(--primary-dark); border: 1px solid rgba(26,82,118,.15); }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.card:hover { box-shadow: var(--shadow); }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--border-light); background: var(--primary-lighter); }
.card-title { font-size: 16px; font-weight: 700; color: var(--fg); }
.card-body { padding: 22px; }

/* ---- Forms ---- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--fg); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="tel"], input[type="search"], input[type="file"], select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--fg);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(26,82,118,.1);
}
input[type="search"] { padding-left: 36px; background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235a6b7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 11px center; }
textarea { min-height: 100px; resize: vertical; border-radius: var(--radius); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235a6b7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 36px;
}
.form-group { margin-bottom: 16px; }
.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 640px) { .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: 1fr; } }
.required { color: var(--danger); }
.hint { font-size: 12px; color: var(--fg-muted); margin-top: 5px; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  padding: 12px 14px;
  background: var(--primary-lighter);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 2px solid var(--border);
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border-light); vertical-align: top; }
tbody tr { transition: background .15s var(--ease); }
tbody tr:hover td { background: var(--primary-lighter); }
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }

/* ---- Alerts ---- */
.alert {
  padding: 14px 16px 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
}
.alert::before { font-size: 18px; line-height: 1; flex-shrink: 0; }
.alert-success { background: var(--success-light); color: var(--primary-dark); border-color: rgba(26,82,118,.2); }
.alert-success::before { content: '✓'; }
.alert-error { background: var(--danger-light); color: var(--danger-dark); border-color: rgba(192,57,43,.2); }
.alert-error::before { content: '✕'; }
.alert-info { background: var(--info-light); color: var(--info); border-color: rgba(44,127,184,.2); }
.alert-info::before { content: 'ℹ'; }

/* ============================================================
   PUBLIC SITE LAYOUT
   ============================================================ */
.page-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 3px rgba(14,61,94,.04);
}
.header-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; height: 68px; }
.logo-link { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-link:hover { text-decoration: none; }
.header-logo { height: 46px; width: auto; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,.05)); }
.logo-text { display: flex; flex-direction: column; line-height: 1.2; border-left: 1px solid var(--border); padding-left: 12px; }
.logo-title { font-size: 15px; font-weight: 700; color: var(--fg); letter-spacing: -.2px; }
.logo-sub { font-size: 11px; color: var(--fg-muted); }
.main-nav { display: flex; gap: 4px; }
.main-nav a {
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  border-radius: var(--radius);
  transition: all .15s var(--ease);
  position: relative;
}
.main-nav a:hover, .main-nav a.active { background: var(--primary-light); color: var(--primary-dark); text-decoration: none; }
.main-nav a.active { font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--fg); border-radius: 1px; transition: all .2s; }

@media (max-width: 768px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .logo-text { display: none; }
  body.nav-open .main-nav { display: flex; position: absolute; top: 73px; left: 0; right: 0; flex-direction: column; background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 8px; box-shadow: var(--shadow-md); }
}

/* ---- Hero with slider ---- */
.hero { position: relative; overflow: hidden; background: var(--bg); }
.hero-slider { position: absolute; inset: 0; z-index: 0; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.5s ease-in-out; }
.hero-slide.active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(105deg, rgba(10,42,66,.72) 0%, rgba(10,42,66,.45) 35%, rgba(10,42,66,.1) 65%, transparent 100%); }
.hero-overlay2 { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,42,66,.5), transparent 30%, transparent 70%, rgba(10,42,66,.2)); }
.hero-caption { position: absolute; bottom: 24px; right: 24px; z-index: 5; max-width: 340px; background: rgba(10,42,66,.75); backdrop-filter: blur(10px); color: #fff; border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius); padding: 12px 18px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-md); }
.hero-dots { position: absolute; bottom: 24px; left: 24px; z-index: 5; display: flex; gap: 6px; }
.hero-dot { width: 10px; height: 10px; border-radius: var(--radius-full); background: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.3); cursor: pointer; transition: all .25s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.hero-dot.active { width: 32px; border-radius: 5px; background: var(--primary); border-color: var(--primary); }
.hero-arrows { display: none; }
@media (min-width: 768px) {
  .hero-arrows { display: block; }
  .hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 40px; height: 40px; border-radius: var(--radius-full); background: rgba(255,255,255,.7); backdrop-filter: blur(10px); border: 1px solid rgba(216,226,219,.5); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--fg-muted); font-size: 20px; transition: all .2s var(--ease); }
  .hero-arrow:hover { background: var(--bg-card); color: var(--primary); box-shadow: var(--shadow); transform: translateY(-50%) scale(1.05); }
  .hero-arrow.prev { left: 16px; }
  .hero-arrow.next { right: 16px; }
}
.hero-content { position: relative; z-index: 2; max-width: 1280px; margin: 0 auto; display: grid; gap: 40px; padding: 72px 24px; grid-template-columns: 1fr 1fr; align-items: center; }
@media (max-width: 768px) { .hero-content { grid-template-columns: 1fr; padding: 48px 24px; } }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); color: var(--primary-dark); border: 1px solid rgba(255,255,255,.8); border-radius: var(--radius-full); font-size: 12px; font-weight: 700; margin-bottom: 18px; box-shadow: var(--shadow); }
.hero h1 { font-size: 40px; font-weight: 800; line-height: 1.1; color: #fff; letter-spacing: -1px; text-shadow: 0 2px 4px rgba(0,0,0,.5), 0 0 20px rgba(0,0,0,.3); }
@media (min-width: 768px) { .hero h1 { font-size: 52px; } }
.hero p { margin-top: 18px; max-width: 540px; font-size: 18px; color: rgba(255,255,255,.95); line-height: 1.6; font-weight: 500; text-shadow: 0 1px 4px rgba(0,0,0,.5), 0 0 12px rgba(0,0,0,.3); }
.hero-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-features { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 20px; font-size: 14px; color: #fff; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.hero-features span { display: flex; align-items: center; gap: 8px; }
.hero-stats-card { background: rgba(255,255,255,.95); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.6); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); overflow: hidden; }
.hero-stats-card .flag-stripe { height: 6px; }
.hero-stats-card .card-header { padding: 16px 22px; background: rgba(255,255,255,.8); }
.hero-stats-card .stats-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; text-align: center; padding: 22px; }
.hero-stats-card .stat-value { font-size: 28px; font-weight: 800; color: var(--primary); }
.hero-stats-card .stat-label { font-size: 12px; color: var(--fg-muted); font-weight: 500; }
.hero-stats-card .stat-icon { width: 40px; height: 40px; margin: 0 auto 6px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 20px; }

/* ---- Stats band ---- */
.stats-band { border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); background: linear-gradient(180deg, var(--primary-lighter), var(--bg)); }
.stats-band-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; }
@media (max-width: 640px) { .stats-band-inner { grid-template-columns: repeat(2, 1fr); } }
.stats-band .stat { background: var(--bg-card); padding: 28px 20px; text-align: center; transition: background .15s var(--ease); }
.stats-band .stat:hover { background: var(--primary-lighter); }
.stats-band .stat-icon-box { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 22px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 4px 12px -2px rgba(26,82,118,.3); }
.stats-band .stat-num { font-size: 32px; font-weight: 800; color: var(--primary-dark); line-height: 1; }
.stats-band .stat-label { font-size: 13px; color: var(--fg-muted); margin-top: 4px; font-weight: 500; }

/* ---- Section ---- */
.section { max-width: 1280px; margin: 0 auto; padding: 72px 24px; }
.section-title { font-size: 30px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.5px; color: var(--fg); }
.section-sub { color: var(--fg-muted); margin-bottom: 36px; font-size: 16px; }

/* ---- Mission/Vision cards ---- */
.mv-grid { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .mv-grid { grid-template-columns: 1fr; } }
.mv-card { border: 1px solid var(--border-light); border-left: 4px solid var(--primary); border-radius: var(--radius-lg); padding: 28px; background: var(--bg-card); box-shadow: var(--shadow-sm); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.mv-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.mv-card h3 { color: var(--primary-dark); margin-bottom: 10px; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.mv-card .mv-icon { width: 44px; height: 44px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 22px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 4px 12px -2px rgba(26,82,118,.3); }
.mv-card.gold { border-left-color: var(--accent); }
.mv-card.gold .mv-icon { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); box-shadow: 0 4px 12px -2px rgba(212,160,23,.3); }
.mv-card.gold h3 { color: var(--accent-fg); }

/* ---- How it works ---- */
.how-section { background: linear-gradient(180deg, var(--primary-lighter), var(--bg)); }
.how-grid { display: grid; gap: 24px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 768px) { .how-grid { grid-template-columns: 1fr; } }
.how-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.how-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.how-icon { width: 56px; height: 56px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 16px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 6px 16px -4px rgba(26,82,118,.35), inset 0 1px 0 rgba(255,255,255,.15); }
.how-card h3 { margin-bottom: 8px; font-size: 17px; font-weight: 700; }

/* ---- News cards ---- */
.news-grid { display: grid; gap: 24px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 768px) { .news-grid { grid-template-columns: 1fr; } }
.news-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.news-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.news-card-body { padding: 22px; flex: 1; }
.news-card h3 { font-size: 16px; margin-bottom: 8px; font-weight: 700; }
.news-meta { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; flex-wrap: wrap; }

/* ---- Schools directory ---- */
.schools-toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 0; align-items: center; }
.schools-toolbar input, .schools-toolbar select { width: auto; min-width: 180px; }
.schools-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .schools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .schools-grid { grid-template-columns: 1fr; } }
.school-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 18px; cursor: pointer; transition: all .2s var(--ease); box-shadow: var(--shadow-sm); }
.school-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary); }
.school-card h3 { font-size: 16px; margin-bottom: 4px; font-weight: 700; }
.school-meta { font-size: 13px; color: var(--fg-muted); margin-bottom: 12px; }
.school-info { font-size: 13px; color: var(--fg-muted); }
.school-info div { margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }

/* ---- Footer ---- */
.site-footer { margin-top: auto; border-top: 1px solid var(--border-light); background: linear-gradient(180deg, var(--primary-lighter), var(--primary-light)); }
.footer-grid { max-width: 1280px; margin: 0 auto; display: grid; gap: 32px; padding: 48px 24px; grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-logo { height: 56px; margin-bottom: 12px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.05)); }
.footer-col h4 { font-size: 14px; margin-bottom: 14px; color: var(--fg); font-weight: 700; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: 14px; color: var(--fg-muted); transition: color .15s var(--ease); }
.footer-col a:hover { color: var(--primary-dark); }
.footer-col p { font-size: 13px; color: var(--fg-muted); line-height: 1.7; }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 24px; text-align: center; font-size: 12px; color: var(--fg-muted); background: rgba(255,255,255,.3); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary-lighter) 0%, var(--bg) 50%, var(--accent-light) 100%); padding: 20px; }
.login-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); max-width: 440px; width: 100%; overflow: hidden; }
.login-logo { text-align: center; padding: 28px 24px 0; }
.login-logo img { height: 68px; margin: 0 auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,.08)); }
.login-logo p { font-size: 12px; color: var(--fg-muted); margin-top: 10px; font-weight: 500; }
.login-body { padding: 24px 28px 28px; }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dashboard-body { background: var(--bg); }
.dash-layout { display: flex; flex-direction: column; min-height: 100vh; }
.dash-topbar { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-light); box-shadow: 0 1px 3px rgba(14,61,94,.04); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 24px; max-width: 1500px; margin: 0 auto; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-logo { height: 38px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.05)); }
.topbar-title { display: flex; flex-direction: column; line-height: 1.2; border-left: 1px solid var(--border); padding-left: 12px; }
.tt-title { font-size: 14px; font-weight: 700; color: var(--fg); }
.tt-sub { font-size: 11px; color: var(--fg-muted); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-info { text-align: right; }
.user-name { font-size: 13px; font-weight: 600; display: block; color: var(--fg); }
.sidebar-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 8px; }
.sidebar-toggle span { display: block; width: 22px; height: 2px; background: var(--fg); border-radius: 1px; }

.dash-body { display: flex; flex: 1; max-width: 1500px; margin: 0 auto; width: 100%; }
.dash-sidebar { width: 248px; flex-shrink: 0; border-right: 1px solid var(--border-light); background: var(--bg-card); padding: 14px; }
.dash-nav { display: flex; flex-direction: column; gap: 4px; }
.dash-nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; font-size: 14px; font-weight: 500; color: var(--fg); border-radius: var(--radius); transition: all .15s var(--ease); position: relative;
}
.dash-nav a:hover { background: var(--primary-lighter); color: var(--primary-dark); text-decoration: none; }
.dash-nav a.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: var(--primary-fg); box-shadow: 0 4px 12px -2px rgba(26,82,118,.3); }
.nav-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-badge { margin-left: auto; background: var(--accent); color: var(--primary-fg); font-size: 11px; padding: 2px 8px; border-radius: var(--radius-full); font-weight: 700; box-shadow: 0 2px 6px -1px rgba(212,160,23,.4); }
.dash-nav a.active .nav-badge { background: rgba(255,255,255,.25); color: var(--primary-fg); box-shadow: none; }

.dash-main { flex: 1; padding: 20px; min-width: 0; }

@media (max-width: 768px) {
  .sidebar-toggle { display: flex; }
  .topbar-title { display: none; }
  .dash-sidebar { display: none; position: fixed; top: 65px; left: 0; bottom: 0; width: 260px; z-index: 200; box-shadow: var(--shadow-lg); }
  body.sidebar-open .dash-sidebar { display: block; }
  .dash-main { padding: 18px; }
}

/* ---- Page header ---- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.page-header h1 { font-size: 24px; font-weight: 800; letter-spacing: -.4px; color: var(--fg); }
.page-desc { font-size: 14px; color: var(--fg-muted); margin-top: 5px; }
.page-action { display: flex; gap: 8px; }

/* ---- Stat cards ---- */
.stat-cards { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); margin-bottom: 24px; }
@media (max-width: 900px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-sm); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card .sc-icon { width: 48px; height: 48px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 22px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 4px 12px -2px rgba(26,82,118,.3), inset 0 1px 0 rgba(255,255,255,.1); flex-shrink: 0; }
.stat-card .sc-value { font-size: 26px; font-weight: 800; line-height: 1; color: var(--fg); }
.stat-card .sc-label { font-size: 12px; color: var(--fg-muted); font-weight: 500; margin-top: 3px; }

/* ---- Dashboard grids ---- */
.dash-grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; margin-bottom: 16px; }
@media (max-width: 900px) { .dash-grid-2 { grid-template-columns: 1fr; } }

/* ---- Report list ---- */
.report-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-light); border-radius: var(--radius); margin-bottom: 8px; font-size: 14px; transition: all .15s var(--ease); background: var(--bg-card); }
.report-row:hover { background: var(--primary-lighter); border-color: var(--primary); box-shadow: var(--shadow-xs); }

/* ---- Hierarchy cards ---- */
.hier-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.hier-card.chief { border-color: var(--primary); border-width: 2px; box-shadow: 0 4px 16px -4px rgba(26,82,118,.15); }
.dept-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); margin-bottom: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.dept-card .card-header { display: flex; align-items: center; gap: 10px; background: var(--primary-lighter); }
.inspector-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.inspector-card:hover { box-shadow: var(--shadow); }
.inspector-card .ic-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.inspector-card .ic-avatar { width: 42px; height: 42px; border-radius: var(--radius-full); background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; box-shadow: 0 4px 10px -2px rgba(26,82,118,.25); }
.inspector-card .ic-info { font-size: 13px; color: var(--fg-muted); }
.inspector-card .ic-info div { margin-bottom: 5px; display: flex; align-items: center; gap: 6px; }

/* ---- Messaging ---- */
.msg-layout { display: grid; grid-template-columns: 280px 1fr; gap: 12px; height: calc(100vh - 160px); min-height: 400px; }
@media (max-width: 768px) { .msg-layout { grid-template-columns: 1fr; height: auto; } }
.msg-list-panel { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-sm); }
.msg-thread-panel { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-sm); }
.msg-search { padding: 14px; border-bottom: 1px solid var(--border-light); }
.msg-contacts { flex: 1; overflow-y: auto; }
.msg-contact { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-bottom: 1px solid var(--border-light); cursor: pointer; transition: background .15s var(--ease); }
.msg-contact:hover { background: var(--bg-hover); }
.msg-contact.active { background: var(--primary-lighter); border-left: 3px solid var(--primary); }
.msg-contact .mc-name { font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.msg-contact .mc-sub { font-size: 11px; color: var(--fg-muted); }
.msg-contact .mc-preview { font-size: 11px; color: var(--fg-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-thread { flex: 1; overflow-y: auto; padding: 12px; background: var(--bg); }
.msg-bubble { max-width: 80%; padding: 8px 12px; border-radius: var(--radius); font-size: 13px; margin-bottom: 6px; word-wrap: break-word; box-shadow: var(--shadow-xs); }
.msg-bubble.mine { margin-left: auto; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: var(--primary-fg); border-bottom-right-radius: 4px; }
.msg-bubble.theirs { background: var(--bg-card); border: 1px solid var(--border-light); border-bottom-left-radius: 4px; }
.msg-bubble .mb-subject { font-size: 11px; font-weight: 700; opacity: .85; margin-bottom: 2px; }
.msg-bubble .mb-time { font-size: 10px; opacity: .6; margin-top: 3px; }
.msg-bubble a { color: inherit; text-decoration: underline; }
.msg-compose { padding: 10px 12px; border-top: 1px solid var(--border-light); background: var(--primary-lighter); }

/* ---- Department breakdown (chief) ---- */
.dept-stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 768px) { .dept-stat-grid { grid-template-columns: 1fr; } }
.dept-stat { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 16px; background: var(--bg-card); transition: box-shadow .2s var(--ease); }
.dept-stat:hover { box-shadow: var(--shadow-sm); }
.dept-stat h4 { font-size: 14px; margin-bottom: 10px; color: var(--primary-dark); }
.dept-stat-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.dept-stat-row:last-child { border-bottom: none; }
.dept-stat-row span:last-child { font-weight: 700; color: var(--primary); }

/* ---- Region bar chart ---- */
.region-bar { margin-bottom: 14px; }
.region-bar .rb-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; font-weight: 500; }
.region-bar .rb-track { height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; }
.region-bar .rb-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); border-radius: 4px; transition: width .5s var(--ease); }

/* ---- Activity log items ---- */
.activity-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; }

/* ---- Level banner (inspector) ---- */
.level-banner { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--primary); border-left: 4px solid var(--primary); border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--primary-lighter), var(--primary-light)); margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.level-banner .lb-icon { width: 52px; height: 52px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 26px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 4px 12px -2px rgba(26,82,118,.3); flex-shrink: 0; }

/* ---- Modal ---- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(10,63,94,.5); backdrop-filter: blur(4px); z-index: 300; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.open { display: flex; }
.modal-card { background: var(--bg-card); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; }

/* ---- Utilities ---- */
.text-muted { color: var(--fg-muted); }
.text-light { color: var(--fg-light); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.font-mono { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; }
.font-bold { font-weight: 700; }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }
.shadow { box-shadow: var(--shadow); }
