/* ============================================================
   MOE Executive Dashboard — Professional Design System
   Ministry of Education, Kuwait
   ============================================================ */

/* ── Design Tokens ── */
:root {
  /* Brand palette */
  --navy-900: #081a35;
  --navy-800: #0f2d56;
  --navy-700: #0d3a6e;
  --navy-600: #0a4a8f;
  --brand:     #0d63c9;
  --brand-400: #2d7fe0;
  --brand-300: #5ba0f0;
  --accent:    #38a0ff;

  /* Surfaces */
  --surface:        #ffffff;
  --surface-alt:    #f4f8fe;
  --surface-border: rgba(13, 99, 201, 0.10);
  --surface-hover:  rgba(13, 99, 201, 0.04);

  /* Text */
  --ink:   #0d2340;
  --ink-2: #2e4a6a;
  --muted: #6b82a0;

  /* Sidebar */
  --sidebar-bg: linear-gradient(180deg, #0b1f3d 0%, #0f2d56 60%, #112f5c 100%);
  --sidebar-active-bg: rgba(255,255,255,0.10);
  --sidebar-hover-bg:  rgba(255,255,255,0.07);
  --sidebar-border-active: #38a0ff;
  --sidebar-text: rgba(255,255,255,0.82);
  --sidebar-text-active: #ffffff;
  --sidebar-width: 260px;

  /* Shadows */
  --shadow-xs:  0 1px 3px rgba(13,99,201,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:  0 4px 12px rgba(13,99,201,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-md:  0 8px 24px rgba(13,99,201,0.10), 0 4px 8px rgba(0,0,0,0.06);
  --shadow-lg:  0 20px 48px rgba(13,99,201,0.14), 0 8px 16px rgba(0,0,0,0.06);
  --shadow-xl:  0 32px 64px rgba(13,99,201,0.18), 0 12px 24px rgba(0,0,0,0.08);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  /* Transitions */
  --trans-fast: 0.15s ease;
  --trans-med:  0.25s ease;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 1200px) { html { font-size: 16px; } }

body {
  margin: 0;
  font-family: "Cairo", sans-serif;
  color: var(--ink);
  background: #edf3fb;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── Auth pages ── */
.auth-page {
  display: flex;
  align-items: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top right, rgba(56,160,255,0.20) 0%, transparent 60%),
    radial-gradient(ellipse at bottom left, rgba(13,99,201,0.16) 0%, transparent 60%),
    linear-gradient(135deg, #f0f7ff 0%, #e2eeff 100%);
}

/* ── Portal shell ── */
.portal-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(56,160,255,0.12) 0%, transparent 50%),
    linear-gradient(160deg, #edf3fb 0%, #e4eef9 100%);
}

/* ── Top Header ── */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-700) 40%, var(--brand) 100%);
  box-shadow: 0 2px 24px rgba(11,31,61,0.28);
  border-bottom: 1px solid rgba(56,160,255,0.25);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 1.75rem;
  height: 68px;
  max-width: 1920px;
  margin: 0 auto;
  width: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-shrink: 0;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.22);
  font-size: 1.4rem;
  color: #fff;
}

.brand-text { display: flex; flex-direction: column; }

.ministry-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.portal-subtitle {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.72);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.academic-year {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.year-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.65);
  font-weight: 600;
}

.year-value {
  font-size: 0.9rem;
  color: #fff;
  font-weight: 800;
}

.header-divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.20);
}

.user-section {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.user-role {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.68);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  cursor: pointer;
  transition: background var(--trans-fast);
}
.btn-logout:hover { background: rgba(255,255,255,0.22); }

/* ── Layout ── */
.portal-layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 68px);
}

/* ── Sidebar ── */
.portal-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-left: 1px solid rgba(255,255,255,0.06);
  min-height: calc(100vh - 68px);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 1.2rem 0 2rem;
  height: 100%;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 1.2rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 0.5rem;
}

.sidebar-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: rgba(255,255,255,0.75);
}

.sidebar-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item { position: relative; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 0.9rem;
  border-radius: var(--r-sm);
  color: var(--sidebar-text);
  font-size: 0.88rem;
  font-weight: 600;
  transition: background var(--trans-fast), color var(--trans-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

.nav-link i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity var(--trans-fast);
}

.nav-link:hover {
  background: var(--sidebar-hover-bg);
  color: #fff;
}
.nav-link:hover i { opacity: 1; }

.nav-item.active > .nav-link {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  border-color: rgba(56,160,255,0.18);
  box-shadow: inset 3px 0 0 var(--sidebar-border-active);
}
.nav-item.active > .nav-link i { opacity: 1; }

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 0.6rem 0.9rem;
}

/* ── Main content area ── */
.portal-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  flex: 1;
  padding: 1.75rem 2rem;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* ── Footer ── */
.portal-footer {
  background: var(--navy-800);
  border-top: 1px solid rgba(56,160,255,0.15);
  color: rgba(255,255,255,0.65);
}

.footer-container {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-text {
  margin: 0;
  font-size: 0.82rem;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.page-title-section { flex: 1; }

.page-title {
  margin: 0 0 0.3rem;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.page-title i {
  font-size: 1.4rem;
  color: var(--brand);
}

.page-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

.page-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 0.2rem;
}

/* ── Metric cards grid ── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md);
  padding: 1.4rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--trans-med), box-shadow var(--trans-med);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--brand-400) 0%, var(--brand-300) 100%);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, rgba(13,99,201,0.10) 0%, rgba(56,160,255,0.08) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--brand);
  flex-shrink: 0;
}

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.metric-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.metric-value {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

/* ── KPI Grid (Dashboard) ── */
.kpi-section { margin-bottom: 1.75rem; }
.kpi-section .container-fluid,
.quick-access-section .container-fluid {
  max-width: 100%;
  padding: 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.kpi-card-wrapper { width: 100%; }

.executive-kpi,
.kpi-card {
  border-radius: var(--r-md);
  padding: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  transition: transform var(--trans-med), box-shadow var(--trans-med);
}
.executive-kpi:hover, .kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.executive-kpi--primary {
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--brand) 100%);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

.executive-kpi__label, .metric-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.executive-kpi--primary .executive-kpi__label { color: rgba(255,255,255,0.72); }

.executive-kpi__value {
  display: block;
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -1px;
  line-height: 1.05;
  margin: 0.7rem 0;
}
.executive-kpi--primary .executive-kpi__value { color: #fff; }

.executive-kpi__meta {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}
.executive-kpi--primary .executive-kpi__meta { color: rgba(255,255,255,0.72); }

/* ── Quick access section ── */
.quick-access-section { margin-bottom: 1.75rem; }
.quick-access-section .section-header { margin-bottom: 1.25rem; }

.quick-access-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.quick-access-card-wrapper { width: 100%; }

/* ── Nav cards (Quick access) ── */
.nav-card {
  display: block;
  border-radius: var(--r-md);
  padding: 1.4rem;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--trans-med), box-shadow var(--trans-med), border-color var(--trans-med);
  position: relative;
  overflow: hidden;
}
.nav-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(13,99,201,0.20);
}

.nav-card__body {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  height: 100%;
}

.nav-card__icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, rgba(13,99,201,0.10) 0%, rgba(56,160,255,0.08) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-card__icon i { font-size: 1.65rem; color: var(--brand); }

.nav-card__title {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}

.nav-card__desc {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Reports/Admin nav-card badge variant */
.nav-card-icon {
  font-size: 1.8rem;
  color: var(--brand);
  flex-shrink: 0;
  width: 40px;
}
.nav-card-body { flex: 1; }
.nav-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 0.25rem;
}
.nav-card-desc {
  font-size: 0.84rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}
.nav-card-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(13,99,201,0.08);
  color: var(--brand);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  align-self: flex-start;
}
.nav-card-link { position: absolute; inset: 0; }

/* ── Content section card ── */
.content-section {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--surface-border);
  gap: 1rem;
}

.section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.section-subtitle {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Data table ── */
.table-responsive { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
  font-weight: 600;
}

.data-table thead tr {
  border-bottom: 2px solid var(--surface-border);
}

.data-table thead th {
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  background: var(--surface-alt);
}

.data-table tbody tr {
  border-bottom: 1px solid rgba(13,99,201,0.06);
  transition: background var(--trans-fast);
}

.data-table tbody tr:last-child { border-bottom: none; }

.data-table tbody tr:hover { background: var(--surface-hover); }

.data-table tbody td {
  padding: 0.85rem 1.25rem;
  color: var(--ink-2);
  vertical-align: middle;
}

/* ── Stats list ── */
.stats-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid rgba(13,99,201,0.05);
  transition: background var(--trans-fast);
}
.stats-row:last-child { border-bottom: none; }
.stats-row:hover { background: var(--surface-hover); }

.stats-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
}

.stats-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brand);
}

/* ── Page content two-column grid ── */
.page-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ── Chart containers ── */
.chart-surface {
  width: 100%;
  min-height: 340px;
}
.chart-surface--medium { min-height: 300px; }
.chart-surface--large  { min-height: 420px; }

.chart-section {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ── Filters ── */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-xs);
}

.filter-form {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 180px;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.filter-select {
  border: 1.5px solid rgba(13,99,201,0.14);
  border-radius: var(--r-xs);
  padding: 0.6rem 0.9rem;
  font-family: "Cairo", sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  background: #fff;
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
  min-height: 40px;
}
.filter-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13,99,201,0.10);
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  padding-bottom: 1px;
}

/* ── Buttons ── */
.btn { border-radius: var(--r-sm); font-family: "Cairo", sans-serif; }

.btn-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--brand-400) 0%, var(--navy-700) 100%);
  border: 0;
  color: #fff;
  border-radius: var(--r-sm);
  font-weight: 700;
  padding: 0.6rem 1.2rem;
  font-size: 0.88rem;
  box-shadow: 0 4px 12px rgba(13,99,201,0.25);
  transition: all var(--trans-fast);
}
.btn-brand:hover, .btn-brand:focus { color: #fff; opacity: 0.92; }

.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.84rem;
  border-radius: var(--r-xs);
  transition: all var(--trans-fast);
}

/* ── Forms ── */
.form-control,
.form-select {
  min-height: 2.8rem;
  border-radius: var(--r-sm);
  border: 1.5px solid rgba(13,99,201,0.14);
  padding-inline: 1rem;
  font-family: "Cairo", sans-serif;
  background: rgba(255,255,255,0.92);
  font-size: 0.9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13,99,201,0.10);
}

/* ── Surface card (generic) ── */
.surface-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info    { background: #cfe2ff; color: #084298; }
.badge-success { background: #d1e7dd; color: #0f5132; }
.badge-danger  { background: #f8d7da; color: #842029; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

/* ── Chart placeholder ── */
.chart-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: var(--surface-alt);
  border-radius: var(--r-sm);
  border: 2px dashed rgba(13,99,201,0.12);
  margin: 1rem 1.5rem;
}
.placeholder-content {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}
.placeholder-content i { font-size: 2.5rem; opacity: 0.4; }
.placeholder-content p { margin: 0.75rem 0 0; font-size: 0.9rem; }

/* ── Dashboard-specific ── */
.dashboard-page { display: flex; flex-direction: column; gap: 0; }

/* ── Analytics (legacy classes kept working) ── */
.dashboard-hero { margin-bottom: 1.75rem; }

.dashboard-panel {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.6rem;
}

.dashboard-panel--accent {
  background: linear-gradient(135deg, rgba(12,56,108,0.97) 0%, rgba(13,99,201,0.94) 60%, rgba(56,160,255,0.88) 100%);
  color: #fff;
  border: none;
  border-radius: var(--r-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.dashboard-panel--accent::after {
  content: "";
  position: absolute;
  left: -60px;
  top: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  pointer-events: none;
}

.dashboard-title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 900;
  margin: 0.75rem 0 0.5rem;
}

.dashboard-subtitle { color: rgba(255,255,255,0.78); margin: 0; }

.dashboard-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

.meta-pill {
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
  font-weight: 700;
  font-size: 0.84rem;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  font-size: 0.8rem;
  font-weight: 800;
}

.filter-card {
  padding: 1.4rem;
}

.chart-panel {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  padding: 1.4rem;
  margin-bottom: 1rem;
}

/* ── Schools map ── */
.map-panel {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}

.map-frame, #schoolsMap {
  border-radius: var(--r-sm);
  overflow: hidden;
  min-height: 540px;
  background: #d9ebfb;
  width: 100%;
}

.area-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  background: rgba(13,99,201,0.08);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.82rem;
}

.school-table { --bs-table-bg: transparent; margin: 0; }
.school-table thead th {
  color: var(--muted);
  font-weight: 800;
  border-bottom-width: 1px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.school-table tbody tr:hover { background: var(--surface-hover); }
.school-table-panel { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--r-md); box-shadow: var(--shadow-xs); padding: 1.5rem; }

/* ── Leaflet ── */
.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup-content { font-family: "Cairo", sans-serif; margin: 0.9rem 1rem; }
.map-popup h6 { margin-bottom: 0.5rem; color: var(--brand); font-weight: 800; }
.map-popup p { margin-bottom: 0.25rem; font-size: 0.88rem; }

/* ── Login (legacy kept for compatibility) ── */
.login-shell { max-width: 1100px; margin: 0 auto; }
.login-copy, .muted-text { color: var(--muted); }
.validation-summary-errors ul { margin: 0; padding-right: 1rem; }

/* ── MOE Login Page ── */
.moe-login {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.moe-login__hero {
  flex: 1 1 55%;
  background: linear-gradient(150deg, #081c3a 0%, var(--navy-800) 40%, var(--brand) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
  color: #fff;
  gap: 1.5rem;
}
.moe-login__hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 80%, rgba(56,160,255,0.18) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.moe-login__logo {
  width: 88px;
  height: 88px;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.3));
}
.moe-login__logo svg { width: 100%; height: 100%; }

.moe-login__brand { text-align: center; }
.moe-login__ministry {
  font-size: 1.9rem;
  font-weight: 900;
  margin: 0 0 0.2rem;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.moe-login__country {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.72);
  letter-spacing: 0.3px;
}

.moe-login__building {
  width: min(340px, 90%);
  opacity: 0.85;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.3));
}
.moe-login__building svg { width: 100%; height: auto; }

.moe-login__tagline {
  text-align: center;
}
.moe-login__tagline p {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}
.moe-login__tagline-sub {
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  color: rgba(255,255,255,0.6) !important;
  margin-top: 0.25rem !important;
}

/* Form panel */
.moe-login__form-panel {
  flex: 0 0 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  box-shadow: -4px 0 32px rgba(0,0,0,0.08);
  padding: 2.5rem;
}

.moe-login__form-inner {
  width: 100%;
  max-width: 340px;
}

.moe-login__form-header { text-align: center; margin-bottom: 2rem; }

.moe-login__form-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--navy-700) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 16px rgba(13,99,201,0.3);
}
.moe-login__form-icon i { font-size: 1.6rem; color: #fff; }

.moe-login__form-title {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--ink);
  margin: 0 0 0.4rem;
}

.moe-login__form-subtitle {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0;
}

.moe-login__form { display: flex; flex-direction: column; gap: 1.25rem; }

.moe-login__field { display: flex; flex-direction: column; gap: 0.4rem; }

.moe-login__label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.moe-login__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.moe-login__input-icon {
  position: absolute;
  right: 0.9rem;
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
}

.moe-login__input {
  width: 100%;
  padding: 0.7rem 2.5rem 0.7rem 0.9rem;
  border: 1.5px solid rgba(13,99,201,0.18);
  border-radius: var(--r-sm);
  font-family: "Cairo", sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
  text-align: right;
}
.moe-login__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13,99,201,0.12);
}
.moe-login__input::placeholder { color: var(--muted); font-size: 0.9rem; }

.moe-login__btn {
  width: 100%;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--brand-400) 0%, var(--navy-700) 100%);
  color: #fff;
  font-family: "Cairo", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 4px 16px rgba(13,99,201,0.3);
  transition: opacity var(--trans-fast), transform var(--trans-fast);
  margin-top: 0.5rem;
}
.moe-login__btn:hover { opacity: 0.92; transform: translateY(-1px); }
.moe-login__btn:active { transform: translateY(0); }

.moe-login__footer-note {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

@media (max-width: 900px) {
  .moe-login { flex-direction: column; min-height: auto; }
  .moe-login__hero { flex: none; padding: 2.5rem 1.5rem; min-height: 300px; }
  .moe-login__building { display: none; }
  .moe-login__form-panel { flex: none; box-shadow: none; padding: 2rem 1.5rem 3rem; }
}

/* ── Responsive ── */
@media (max-width: 1399px) {
  .kpi-grid, .quick-access-grid, .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1199px) {
  .portal-sidebar { width: 220px; }
  --sidebar-width: 220px;
}

@media (max-width: 991px) {
  .portal-layout { flex-direction: column; }
  .portal-sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
  .nav-menu { flex-direction: row; flex-wrap: wrap; }
  .nav-item { flex: 0 0 auto; }
  .sidebar-header { display: none; }
  .sidebar-nav { padding: 0.75rem; }
  .nav-divider { display: none; }
  .content-wrapper { padding: 1.25rem; }
  .page-content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .metrics-grid, .kpi-grid, .quick-access-grid { grid-template-columns: 1fr; }
  .header-container { padding: 0 1rem; height: 58px; }
  .academic-year { display: none; }
  .header-divider { display: none; }
  .content-wrapper { padding: 1rem; }
  .section-header { padding: 1rem 1.25rem; }
  .data-table thead th, .data-table tbody td { padding: 0.7rem 1rem; }
  .charts-row { flex-direction: column; }
  .chart-section-half { width: 100%; }
}

/* ── Two-column charts row ── */
.charts-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0;
}
.chart-section-half {
  flex: 1 1 0;
  min-width: 0;
}

/* ── Chart empty state ── */
.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 200px;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 1.5rem;
}
.chart-empty i { font-size: 2rem; opacity: 0.35; }

/* ── Table utilities ── */
.row-index {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  width: 40px;
}
.text-center { text-align: center; }

.pct-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(13,99,201,0.08);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
}

.data-table tfoot tr.table-total {
  border-top: 2px solid var(--surface-border);
  background: var(--surface-alt);
}
.data-table tfoot .table-total td {
  padding: 0.85rem 1.25rem;
  color: var(--ink);
  font-size: 0.97rem;
  font-weight: 700;
}

/* ── Section badge ── */
.section-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(13,99,201,0.08);
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

/* ── Filter reset link ── */
.filter-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: var(--r-sm);
  border: 1.5px solid rgba(13,99,201,0.18);
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 700;
  background: transparent;
  text-decoration: none;
  transition: background var(--trans-fast), border-color var(--trans-fast);
  white-space: nowrap;
  align-self: flex-end;
}
.filter-reset:hover {
  background: rgba(13,99,201,0.06);
  border-color: var(--brand);
  color: var(--brand);
}
@font-face {
    font-family: "Material Symbols Rounded";
    src: url("/fonts/MaterialSymbolsRounded.woff2") format("woff2");
    font-weight: 100 700;
    font-style: normal;
}

.material-symbols-rounded {
    font-family: "Material Symbols Rounded" !important;
    font-weight: normal;
    font-style: normal;
    font-size: 40px;
    line-height: 1;
    display: inline-block;
    white-space: nowrap;
    letter-spacing: normal;
    text-transform: none;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}