/* ============================================================
   NSD — Premium Glassmorphic Dark-Mode Design System
   Higher Education Authority of Zambia — QAMIS Platform
   Theme: Galactic Obsidian, Neon Emerald & Zambia Sun-Gold
============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');
@import url('hea-loader.css');

/* ── Design System Variables ───────────────────────────────── */
:root {
  /* Color Palette */
  --primary:       #1e40af; /* HEA Corporate Royal Blue */
  --primary-dark:  #1e3a8a; /* HEA Corporate Navy Blue */
  --primary-light: #3b82f6; /* Vibrant Accent Blue */
  --accent:        #e8a020; /* Zambia Sun-Gold */
  --accent-dark:   #b45309;
  --success:       #10b981;
  --danger:        #ef4444;
  --warning:       #f59e0b;
  --info:          #3b82f6;

  /* Theme Surfaces - Clean Blue & White light theme by default */
  --bg:            #f8fafc; /* Slate 50 */
  --surface:       #ffffff; /* Pristine White */
  --surface-hover: #f1f5f9; /* Slate 100 */
  --surface-card:  #ffffff; 
  --border:        #e2e8f0; /* Slate 200 */
  --border-focus:  rgba(30, 64, 175, 0.4);
  
  /* Typography Colors */
  --text:          #0f172a; /* Slate 900 */
  --text-muted:    #475569; /* Slate 600 */
  --text-light:    #64748b; /* Slate 500 */

  /* Layout Configurations */
  --sidebar-w:     270px;
  --header-h:      72px;
  --radius:        18px;
  --radius-sm:     10px;
  
  /* Delicate Shadows & Transitions */
  --shadow:        0 10px 30px -10px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.03);
  --shadow-glow:   0 0 15px rgba(30, 64, 175, 0.1);
  --shadow-lg:     0 20px 40px -15px rgba(15, 23, 42, 0.12);
  --transition:    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Global Reset & Ambient Glow Backdrops ───────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Radial Glow Blobs in the Background */
body::before {
  content: '';
  position: fixed; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.07) 0%, rgba(0,0,0,0) 70%);
  top: -200px; right: -100px; z-index: -2;
  pointer-events: none;
  animation: floatAmbient 12s infinite alternate;
}
body::after {
  content: '';
  position: fixed; width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(232, 160, 32, 0.04) 0%, rgba(0,0,0,0) 70%);
  bottom: -150px; left: -100px; z-index: -2;
  pointer-events: none;
  animation: floatAmbient 18s infinite alternate-reverse;
}

@keyframes floatAmbient {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(40px) scale(1.1); }
}

/* Scrollbar Customization */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.03); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-light); }
img { max-width: 100%; }
ul { list-style: none; }
button, input, select, textarea { font-family: inherit; }

/* ── Layout & Structure ──────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

/* ── Premium Glassmorphic Sidebar ─────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  max-height: 100vh;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-right: 1px solid var(--border);
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-logo {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  background: rgba(30, 64, 175, 0.02);
  flex-shrink: 0;
}

.sidebar-logo .logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--primary), #059669);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 22px; font-weight: 800; color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.sidebar-logo .logo-text { font-family: 'Outfit', sans-serif; font-size: 0.9rem; line-height: 1.3; }
.sidebar-logo .logo-text strong { display: block; font-size: 1.1rem; color: var(--text); letter-spacing: 0.5px; }
.sidebar-logo .logo-text span { color: var(--primary); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: #64748b; }

@media (max-height: 850px) {
  .sidebar-logo { padding: 12px 16px; }
  .sidebar-logo .logo-icon { width: 34px; height: 34px; font-size: 18px; }
  .nav-section { padding: 8px 10px 4px; font-size: 0.68rem; }
  .nav-item { padding: 8px 12px; margin: 2px 0; font-size: 0.85rem; }
  .sidebar-footer { padding: 10px 16px; font-size: 0.7rem; }
}

.nav-section {
  padding: 14px 12px 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted);
  opacity: 0.6;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; margin: 4px 0;
  font-size: 0.92rem; font-weight: 500;
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(30, 64, 175, 0.05);
  color: var(--primary);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(30, 64, 175, 0.08) 0%, rgba(30, 64, 175, 0.02) 100%);
  color: var(--primary);
  font-weight: 600;
  border-left-color: var(--primary);
  box-shadow: inset 1px 0 0 rgba(255,255,255,0.05);
}

.nav-item .nav-icon { font-size: 1.15rem; width: 22px; text-align: center; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #000; font-size: 0.68rem;
  padding: 2px 7px; border-radius: 20px; font-weight: 800;
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--text-muted);
  background: rgba(248, 250, 252, 0.95);
}

/* ── Main Content Area ───────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1 1 0%;
  min-width: 0;
  width: calc(100% - var(--sidebar-w));
  max-width: calc(100% - var(--sidebar-w));
  display: flex; flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* ── Glassmorphic Glass-Blur Header (Topbar) ────────────────── */
.topbar {
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 clamp(14px, 2vw, 24px);
  gap: 16px;
  position: sticky; top: 0; z-index: 90;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;
}

.topbar-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1rem, 2vw, 1.3rem); font-weight: 700; flex: 1;
  color: var(--text); letter-spacing: 0.5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-title span { font-weight: 400; color: var(--text-muted); font-size: 0.95rem; }

.topbar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 14px;
  background: rgba(30, 64, 175, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer; transition: var(--transition);
  flex-shrink: 0;
}

.topbar-user:hover {
  background: rgba(30, 64, 175, 0.08);
  border-color: var(--primary-light);
  transform: translateY(-1px);
}

.topbar-user .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; font-family: 'Outfit', sans-serif; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.topbar-user .user-info { line-height: 1.35; }
.topbar-user .user-info strong { font-size: 0.88rem; display: block; color: var(--text); }
.topbar-user .user-info small { color: var(--accent); font-size: 0.74rem; font-weight: 600; text-transform: uppercase; }

/* ── Page Content Layout ──────────────────────────────────── */
.page-content {
  padding: clamp(14px, 2.5vw, 32px);
  flex: 1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.page-header {
  margin-bottom: clamp(18px, 2.5vw, 30px);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
}
.page-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem); font-weight: 800;
  background: linear-gradient(135deg, var(--primary-dark) 30%, var(--primary-light) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}
.page-header p { color: var(--text-muted); margin-top: 6px; font-size: clamp(0.85rem, 1.2vw, 1.05rem); line-height: 1.5; }

/* ── Beautiful KPI Glass Cards ─────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: clamp(10px, 1.5vw, 20px);
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--surface);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
  transition: var(--transition);
  border-left: 5px solid var(--primary);
  position: relative; overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute; top: 0; right: 0; width: 60px; height: 60px;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  border-radius: 0 0 0 100px;
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(30, 64, 175, 0.15);
}

.kpi-card.accent  { border-left-color: var(--accent); }
.kpi-card.success { border-left-color: var(--success); }
.kpi-card.info    { border-left-color: var(--info); }
.kpi-card.warning { border-left-color: var(--warning); }

.kpi-card .kpi-icon { font-size: 1.8rem; margin-bottom: 2px; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2)); }
.kpi-card .kpi-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.kpi-card .kpi-value { font-family: 'Outfit', sans-serif; font-size: 2.25rem; font-weight: 800; color: var(--text); line-height: 1; }

/* ── Standard Premium Cards ────────────────────────────────── */
.card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(30, 64, 175, 0.1);
}

.card-header {
  padding: clamp(14px, 2vw, 20px) clamp(16px, 2.5vw, 24px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(30, 64, 175, 0.01);
  flex-wrap: wrap;
  gap: 12px;
}

.card-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1rem, 1.5vw, 1.15rem); font-weight: 700; color: var(--text);
  letter-spacing: 0.5px;
  min-width: 0;
  word-break: break-word;
}

.card-body {
  padding: clamp(14px, 2vw, 24px);
  min-width: 0;
  box-sizing: border-box;
}

/* ── Charts Grid ─────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(14px, 2vw, 24px);
  margin-bottom: 32px;
}

.charts-grid .card-body {
  position: relative;
  background: var(--surface-card);
}

/* ── Premium Glassmorphic Tables ───────────────────────────── */
.table-wrap, .table-responsive, .table-container, .dataTables_wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

.card-body > table,
.card > table {
  display: table;
  width: 100%;
  max-width: 100%;
}

thead tr { background: rgba(30, 64, 175, 0.02); }
th {
  padding: 14px 18px; font-weight: 700; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted);
  border-bottom: 2px solid var(--border); white-space: nowrap;
}

td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
}
tbody tr { transition: var(--transition); }
tbody tr:hover { background: rgba(30, 64, 175, 0.03); }
tbody tr:last-child td { border-bottom: none; }

/* ── High-Contrast Badges ──────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid transparent;
}
.badge::before {
  content: '';
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
}

.badge-active { background: rgba(16, 185, 129, 0.1); color: var(--primary-light); border-color: rgba(16, 185, 129, 0.2); }
.badge-active::before { background: var(--primary); }

.badge-pending { background: rgba(245, 158, 11, 0.1); color: var(--accent); border-color: rgba(245, 158, 11, 0.2); }
.badge-pending::before { background: var(--accent); }

.badge-graduated { background: rgba(59, 130, 246, 0.1); color: #60a5fa; border-color: rgba(59, 130, 246, 0.2); }
.badge-graduated::before { background: #3b82f6; }

.badge-rejected { background: rgba(239, 68, 68, 0.1); color: #f87171; border-color: rgba(239, 68, 68, 0.2); }
.badge-rejected::before { background: #ef4444; }

.badge-approved { background: rgba(16, 185, 129, 0.1); color: var(--primary-light); border-color: rgba(16, 185, 129, 0.2); }
.badge-approved::before { background: var(--primary); }

.badge-suspended { background: rgba(245, 158, 11, 0.1); color: var(--accent); border-color: rgba(245, 158, 11, 0.2); }
.badge-suspended::before { background: var(--accent); }

.badge-accredited { background: rgba(139, 92, 246, 0.1); color: #a78bfa; border-color: rgba(139, 92, 246, 0.2); }
.badge-accredited::before { background: #8b5cf6; }

/* ── State-of-the-Art Interactive Buttons ────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  border: none; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(30, 64, 175, 0.4);
  filter: brightness(1.1);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  filter: brightness(1.1);
}

.btn-success { background: var(--success); color: #000; }
.btn-danger  { background: var(--danger); color: #fff; }

.btn-outline {
  background: transparent; color: var(--primary); border: 1.5px solid var(--primary);
}
.btn-outline:hover {
  background: rgba(30, 64, 175, 0.08);
  color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-icon {
  padding: 10px; border-radius: 10px;
  background: rgba(255,255,255,0.8); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; transition: var(--transition);
}
.btn-icon:hover {
  background: rgba(30, 64, 175, 0.05);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* ── Premium Forms ────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(12px, 1.8vw, 22px);
}
.form-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.form-group label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}

.form-control {
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.85);
  transition: var(--transition);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}
.form-control::placeholder { color: var(--text-light); }

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
select.form-control option { background: #fff; color: var(--text); }

textarea.form-control { resize: vertical; min-height: 120px; }
.form-actions { display: flex; gap: 14px; justify-content: flex-end; padding-top: 14px; flex-wrap: wrap; }

/* ── Interactive Search Bar ────────────────────────────────── */
.search-bar { position: relative; flex: 1; max-width: 400px; min-width: 160px; }
.search-bar input {
  width: 100%; padding: 11px 16px 11px 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  transition: var(--transition);
  box-sizing: border-box;
}
.search-bar input:focus {
  outline: none; border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}
.search-bar .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 1.1rem;
}

/* ── Toolbar Layout ────────────────────────────────────────── */
.toolbar {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}

/* ── Interactive Toasts ────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 32px; right: 32px;
  display: flex; flex-direction: column; gap: 12px; z-index: 9999;
  max-width: calc(100vw - 32px);
}
.toast {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  min-width: min(320px, 90vw); font-size: 0.94rem; color: var(--text);
  animation: slideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
  word-break: break-word;
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(120%); opacity:0; } to { transform: translateX(0); opacity:1; } }

/* ── Premium Glassmorphic Modals ────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: clamp(12px, 3vw, 24px);
  opacity: 0; pointer-events: none; transition: var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%; max-width: min(94vw, 720px);
  max-height: min(88vh, 850px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-lg);
  transform: scale(0.93); transition: var(--transition);
  box-sizing: border-box;
}
.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.01);
}
.modal-header h3 { font-family: 'Outfit', sans-serif; font-size: 1.3rem; font-weight: 800; color: var(--text); }
.modal-body { padding: 28px; }
.modal-footer {
  padding: 18px 28px;
  border-top: 1px solid var(--border);
  display: flex; gap: 12px; justify-content: flex-end;
  background: rgba(30, 64, 175, 0.02);
}

/* ── Multi-Step Form Timeline / Wizard ──────────────────────── */
.step-wizard {
  display: flex; justify-content: space-between; position: relative;
  margin-bottom: 32px; padding: 0 10px;
}
.step-wizard::before {
  content: '';
  position: absolute; top: 15px; left: 0; right: 0; height: 3px;
  background: var(--border); z-index: 1;
}
.step-wizard-progress {
  position: absolute; top: 15px; left: 0; width: 0%; height: 3px;
  background: var(--primary); z-index: 2; transition: var(--transition);
}
.step-wizard-item {
  position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.step-wizard-dot {
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; color: var(--text-muted);
  transition: var(--transition);
}
.step-wizard-item.active .step-wizard-dot {
  background: var(--primary); border-color: var(--primary); color: #000;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}
.step-wizard-item.completed .step-wizard-dot {
  background: var(--primary-dark); border-color: var(--primary); color: #fff;
}
.step-wizard-label {
  font-size: 0.74rem; font-weight: 700; text-transform: uppercase;
  color: var(--text-muted); letter-spacing: 0.05em;
}
.step-wizard-item.active .step-wizard-label { color: #fff; }

/* ── Premium Unified Login & Form Wrapper Styles ─────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}
.login-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, rgba(0,0,0,0) 70%);
  border-radius: 50%;
  filter: blur(40px);
  z-index: 0;
  animation: orbit 8s infinite linear;
}
@keyframes orbit {
  0% { transform: translate(-100px, -100px); }
  50% { transform: translate(100px, 100px); }
  100% { transform: translate(-100px, -100px); }
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 10;
  transition: var(--transition);
}
.login-card:hover {
  border-color: rgba(30, 64, 175, 0.3);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08), 0 0 30px rgba(30, 64, 175, 0.05);
}
.login-top {
  background: linear-gradient(135deg, var(--surface), rgba(30, 64, 175, 0.02));
  border-bottom: 1px solid var(--border);
  padding: 32px 40px 24px;
  text-align: center;
  position: relative;
}
.login-top::after {
  content: '';
  position: absolute; bottom: 0; left: 10%; right: 10%; height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.login-top .zambia-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 30px;
  padding: 6px 16px;
  font-size: 0.74rem;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}
.login-top h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.login-top p {
  color: var(--text-muted);
  font-size: 0.88rem;
}
.login-bottom {
  padding: 32px 40px 36px;
}
.login-bottom h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.login-bottom .sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}
.input-group {
  position: relative;
  margin-bottom: 20px;
}
.input-group label {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.input-group input, .input-group select, .input-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
  color: var(--text);
  background: #ffffff;
  transition: var(--transition);
}
.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}
.btn-login {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 10px;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(30, 64, 175, 0.25);
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 64, 175, 0.45);
  filter: brightness(1.05);
}
.btn-login:active {
  transform: translateY(0);
}
.login-error {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.88rem;
  margin-top: 18px;
  display: none;
  animation: shake 0.4s ease-in-out;
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.menu-toggle:hover {
  background: rgba(30, 64, 175, 0.08);
  color: var(--primary);
}

/* ── Mobile Layout Adjustments ────────────────────────────── */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
    width: var(--sidebar-w);
  }
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .topbar {
    padding: 0 20px;
    justify-content: space-between;
  }
  .menu-toggle {
    display: inline-flex;
    margin-right: 12px;
  }
  .topbar-title {
    font-size: 1.15rem;
  }
  .topbar-user {
    padding: 4px 10px;
  }
  .topbar-user .user-info {
    display: none; /* Hide textual role info to save topbar space */
  }
  .page-content {
    padding: 24px 16px;
  }
  .page-header h1 {
    font-size: 1.8rem;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .charts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .form-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 600px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .login-card {
    border-radius: 16px;
  }
  .login-top {
    padding: 24px 20px 20px;
  }
  .login-bottom {
    padding: 24px 20px 24px;
  }
  .step-wizard {
    flex-wrap: wrap;
    gap: 12px;
  }
  .step-wizard::before, .step-wizard-progress {
    display: none; /* Hide line wizard on very narrow devices */
  }
  .step-wizard-item {
    flex-direction: row;
    width: 100%;
    justify-content: flex-start;
  }
}

/* ── Utility & Helper Utilities ────────────────────────────── */
.text-muted      { color: var(--text-muted); }
.text-right      { text-align: right; }
.mt-16           { margin-top: 16px; }
.mt-24           { margin-top: 24px; }
.mb-16           { margin-bottom: 16px; }
.gap-12          { gap: 12px; }
.d-flex          { display: flex; }
.align-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full          { width: 100%; }
.hidden          { display: none !important; }

/* ── Unified Blue & White Corporate Branding ── */
body.light-mode {
  /* Inherit the gorgeous default light theme */
}

/* ═══════════════════════════════════════════════════════════
   COMPREHENSIVE DEVICE RESPONSIVENESS
   Covers: phones (≤480px), tablets (≤768px), laptops (≤1024px)
═══════════════════════════════════════════════════════════ */

/* ── Tablet & Small Laptop (≤1024px) ─────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 240px; }

  .page-content { padding: 24px 20px; }

  .kpi-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }

  .charts-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .modal { max-width: 90vw; }
}

/* ── Tablet (≤768px) ─────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --header-h: 60px; }

  /* Sidebar — slide in/out */
  .sidebar {
    transform: translateX(-100%);
    width: 280px !important;
    z-index: 300;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }
  .sidebar.open { transform: translateX(0); }

  /* Overlay when sidebar is open */
  .sidebar.open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: -1;
  }

  .main-content { margin-left: 0 !important; width: 100% !important; max-width: 100% !important; }

  /* Topbar */
  .topbar {
    padding: 0 16px;
    gap: 10px;
  }
  .topbar-title { font-size: 1rem; }
  .topbar-title span { display: none; }
  .menu-toggle { display: inline-flex !important; }

  /* Page header */
  .page-content { padding: 16px 14px; }
  .page-header { margin-bottom: 20px; }
  .page-header h1 { font-size: 1.5rem; }
  .page-header p { font-size: 0.88rem; }

  /* KPI grid — 2 columns on tablet */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }
  .kpi-card { padding: 16px; }
  .kpi-card .kpi-value { font-size: 1.8rem; }

  /* Charts — single column */
  .charts-grid { grid-template-columns: 1fr; gap: 16px; }

  /* Tables — horizontal scroll with sticky first column */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
  }
  table { min-width: 600px; }
  th, td { padding: 10px 12px; font-size: 0.82rem; }

  /* Cards */
  .card-header { padding: 14px 16px; flex-wrap: wrap; gap: 8px; }
  .card-header h3 { font-size: 1rem; }
  .card-body { padding: 16px; }

  /* Forms */
  .form-grid { grid-template-columns: 1fr !important; gap: 14px; }
  .form-control { padding: 10px 12px; font-size: 0.88rem; }

  /* Modals */
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }
  .modal-header { padding: 16px 20px; }
  .modal-body { padding: 16px 20px; }
  .modal-footer { padding: 14px 20px; }

  /* Toolbar */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .toolbar .search-bar { max-width: 100%; }
  .toolbar select.form-control { width: 100%; }
  .toolbar .btn { width: 100%; justify-content: center; }

  /* Buttons */
  .btn { padding: 10px 16px; font-size: 0.85rem; }
  .btn-sm { padding: 7px 12px; font-size: 0.78rem; }

  /* Toast */
  .toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { min-width: unset; width: 100%; }

  /* Filter bars */
  .filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .filter-bar select,
  .filter-bar .search-bar { width: 100% !important; max-width: 100% !important; }
  .filter-bar .btn { width: 100%; }

  /* Pagination */
  .pagination { justify-content: center; gap: 4px; }
  .pagination button { padding: 6px 10px; font-size: 0.78rem; }

  /* Step pills (import wizard) */
  .import-steps {
    flex-wrap: wrap;
    gap: 6px;
  }
  .step-pill { font-size: 0.75rem; padding: 5px 12px; }
  .step-arrow { display: none; }

  /* HEI hero */
  .hei-hero { padding: 20px 16px; gap: 14px; }
  .hei-hero .big-year { font-size: 2.5rem; }

  /* Stat rows */
  .stat-row { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .stat-box .n { font-size: 1.5rem; }

  /* Tabs */
  .tabs, .acad-tabs, .admin-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 2px;
    padding-bottom: 2px;
  }
  .tab-btn, .acad-tab, .admin-tab {
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  /* Report grid */
  .report-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .report-stat-card { padding: 12px; }
  .report-stat-num { font-size: 1.6rem !important; }

  /* Charts 2-col → 1-col */
  .charts-2, .charts-3 { grid-template-columns: 1fr !important; }

  /* Year hero */
  .year-hero { flex-direction: column; gap: 12px; }
  .year-hero .big-year { font-size: 3rem; }

  /* Import zone */
  .upload-zone { padding: 28px 16px; }
  .upload-icon { font-size: 2rem; }

  /* Sheet mapping cards */
  .sheet-card-header { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* Mapping table — scrollable */
  .col-mapping-table { font-size: 0.78rem; }
  .col-mapping-table select { font-size: 0.78rem; }

  /* AI badge */
  .ai-badge { font-size: 0.7rem; padding: 3px 8px; }
}

/* ── Mobile Phone (≤480px) ───────────────────────────────── */
@media (max-width: 480px) {
  html { font-size: 14px; }

  .page-content { padding: 12px 10px; }
  .page-header h1 { font-size: 1.3rem; }

  /* KPI — single column on small phones */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { padding: 12px; }
  .kpi-card .kpi-value { font-size: 1.5rem; }
  .kpi-card .kpi-label { font-size: 0.68rem; }
  .kpi-card .kpi-icon { font-size: 1.4rem; }

  /* Stat row — single column */
  .stat-row { grid-template-columns: 1fr 1fr !important; }

  /* Report grid — 2 col */
  .report-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Tables */
  th, td { padding: 8px 10px; font-size: 0.78rem; }

  /* Topbar */
  .topbar { padding: 0 12px; }
  .topbar-title { font-size: 0.9rem; }
  .topbar-user { padding: 4px 8px; }
  .topbar-user .user-info { display: none; }
  .topbar-user .avatar { width: 30px; height: 30px; font-size: 0.8rem; }

  /* Buttons */
  .btn { padding: 9px 14px; font-size: 0.82rem; }

  /* Modal */
  .modal-header h3 { font-size: 1.1rem; }
  .modal-body { padding: 14px 16px; }

  /* Login card */
  .login-top { padding: 20px 16px 16px; }
  .login-bottom { padding: 20px 16px; }
  .login-top h1 { font-size: 1.3rem; }

  /* Sidebar nav items */
  .nav-item { padding: 10px 14px; font-size: 0.88rem; }

  /* Year pills */
  .year-pill { padding: 5px 12px; font-size: 0.78rem; }
  .year-pill-row { gap: 6px; }

  /* Import steps */
  .step-pill { padding: 4px 10px; font-size: 0.72rem; }

  /* Charts */
  canvas { max-height: 200px; }

  /* Pagination */
  .pagination button { padding: 5px 8px; font-size: 0.75rem; }

  /* Warn banner */
  .warn-banner { flex-direction: column; gap: 10px; padding: 14px 16px; }
  .warn-banner .wi { font-size: 1.8rem; }
  .warn-banner h2 { font-size: 1rem; }

  /* Admin tabs */
  .admin-tab { padding: 7px 12px; font-size: 0.78rem; }

  /* Danger cards */
  .danger-card { padding: 14px 16px; }
  .danger-card h4 { font-size: 0.88rem; }

  /* Import zone */
  .upload-zone { padding: 20px 12px; }
  .upload-zone h3 { font-size: 1rem; }
}

/* ── Landscape phone ─────────────────────────────────────── */
@media (max-width: 768px) and (orientation: landscape) {
  .modal-overlay { align-items: center; }
  .modal { max-height: 95vh; border-radius: 16px; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Print styles ────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .menu-toggle, .btn, .pagination,
  .filter-bar, .toolbar, #stepUpload, #stepAnalysis,
  #stepReview, #stepProgress { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}


/* ═══════════════════════════════════════════════════════════
   ADDITIONAL RESPONSIVE FIXES — July 2026
   Covers stats-mini, login, tables, KPI overflow on small phones
═══════════════════════════════════════════════════════════ */

/* Stats mini row (user-management, reports) */
.stats-mini {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.stat-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  flex: 1;
  min-width: 100px;
  text-align: center;
}
.stat-mini .n {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
}
.stat-mini .l {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Responsive: phones */
@media (max-width: 480px) {
  /* Login card — full width on phones */
  .login-wrap { padding: 12px; align-items: flex-start; padding-top: 20px; }
  .login-card { border-radius: 18px; max-width: 100%; }
  .login-top { padding: 20px 18px 16px; }
  .login-bottom { padding: 20px 18px 24px; }
  .login-top h1 { font-size: 1.2rem; }
  .login-top p { font-size: 0.82rem; }

  /* Stats mini — 2 per row */
  .stats-mini { gap: 8px; }
  .stat-mini { min-width: calc(50% - 8px); padding: 10px 12px; }
  .stat-mini .n { font-size: 1.3rem; }

  /* KPI cards — 2 per row always */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-card { padding: 12px; }
  .kpi-card .kpi-value { font-size: 1.4rem; }
  .kpi-card .kpi-icon { font-size: 1.3rem; }
  .kpi-card .kpi-label { font-size: 0.65rem; }

  /* Page header — smaller */
  .page-header h1 { font-size: 1.2rem; }
  .page-header p { font-size: 0.82rem; }

  /* Tables — hide less important columns on very small screens */
  .table-responsive-sm th:nth-child(n+5),
  .table-responsive-sm td:nth-child(n+5) { display: none; }

  /* Topbar — compact */
  .topbar { padding: 0 10px; height: 56px; }
  .topbar-title { font-size: 0.88rem; }

  /* Modals — full screen on phones */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: 20px 20px 0 0; max-height: 95vh; }

  /* Buttons — full width in toolbars */
  .toolbar { gap: 8px; }
  .toolbar .btn { font-size: 0.8rem; padding: 8px 12px; }

  /* Filter card in reports */
  .filter-card .filter-row { gap: 8px; }
  .filter-card .filter-row .form-group { min-width: 100% !important; }

  /* Report stat cards */
  .report-grid { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .report-stat-card { padding: 10px; }
  .report-stat-num { font-size: 1.4rem !important; }
  .report-stat-label { font-size: 0.68rem; }

  /* Year pills in reports */
  .year-pill-row { gap: 4px; }
  .year-pill { padding: 4px 10px; font-size: 0.72rem; }

  /* User grid — single column */
  .user-grid { grid-template-columns: 1fr !important; }
  .user-card { padding: 14px 16px; }

  /* QAMIS sync bar — stack vertically */
  #qamisSyncBar { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 14px; }
  #syncInitBtn { width: 100%; justify-content: center; }
}

/* Responsive: small tablets (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  /* Stats mini — 3 per row */
  .stats-mini { gap: 10px; }
  .stat-mini { min-width: calc(33% - 10px); }

  /* User grid — 2 columns */
  .user-grid { grid-template-columns: 1fr 1fr !important; }

  /* Reports filter row — 2 per row */
  .filter-card .filter-row .form-group { min-width: calc(50% - 7px) !important; }
}

/* Ensure all images and canvases scale on mobile */
img, canvas { max-width: 100%; height: auto; }
canvas { touch-action: none; }

/* Horizontal scroll indicator on tables */
.table-wrap { position: relative; }
@media (max-width: 768px) {
  .table-wrap::after {
    content: '← scroll horizontally →';
    display: block;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 6px;
    opacity: 0.6;
  }
}

/* ═══════════════════════════════════════════════════════════
   HEA MODERN REPORTING SUITE & UX REDESIGN STYLES
   ═══════════════════════════════════════════════════════════ */

/* Report Preset & Category Navigation */
.report-nav-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 4px 14px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--border);
  scrollbar-width: thin;
}
.report-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.report-tab-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(30, 64, 175, 0.04);
  transform: translateY(-1px);
}
.report-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.25);
}
.report-tab-btn .tab-badge {
  background: rgba(255, 255, 255, 0.25);
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
}
.report-tab-btn:not(.active) .tab-badge {
  background: var(--border);
  color: var(--text-muted);
}

/* Preset Quick Pills */
.preset-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  scrollbar-width: thin;
}
.preset-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-right: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.preset-pill {
  display: inline-flex;
  white-space: nowrap;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}
.preset-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(30, 64, 175, 0.05);
}
.preset-pill.active {
  background: #dbeafe;
  color: #1e40af;
  border-color: #3b82f6;
  font-weight: 700;
}

/* Filter Summary Bar & Chips */
.active-filters-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(30, 64, 175, 0.03);
  border: 1.5px dashed rgba(30, 64, 175, 0.25);
  border-radius: 12px;
  margin-bottom: 20px;
}
.filter-chip-removable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: #ffffff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.filter-chip-removable button {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.filter-chip-removable button:hover {
  transform: scale(1.2);
}

/* Modern Filter Drawer / Panel */
.filter-drawer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  justify-content: flex-end;
  transition: opacity 0.3s ease;
}
.filter-drawer-overlay.open {
  display: flex;
}
.filter-drawer {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  height: 100vh;
  box-shadow: -10px 0 30px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  animation: slideDrawer 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
@keyframes slideDrawer {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.filter-drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 64, 175, 0.02);
}
.filter-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
.filter-drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background: var(--surface);
}
.filter-group-heading {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-group-heading:first-child {
  margin-top: 0;
}
.filter-group-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Interactive Chart Cards & Controls */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
}
.chart-card:hover {
  box-shadow: var(--shadow-lg);
}
.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.chart-title-group h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.chart-title-group p {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.chart-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chart-tool-btn {
  padding: 5px 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.chart-tool-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #eff6ff;
}
.chart-tool-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.chart-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 280px;
  width: 100%;
}

/* Official HEA Print Report Header */
.hea-print-header {
  display: none;
}
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .sidebar, .topbar, .btn, .report-nav-tabs, .preset-bar,
  .active-filters-bar, .chart-tools, .filter-drawer-overlay,
  .rpt-pager, #filterActions, .no-print {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  .page-content {
    padding: 0 !important;
  }
  .hea-print-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #1e3a8a;
    padding-bottom: 14px;
    margin-bottom: 24px;
  }
  .hea-print-logo {
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .hea-print-logo img {
    width: 60px;
    height: 60px;
  }
  .hea-print-title h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1e3a8a;
    margin: 0;
  }
  .hea-print-title p {
    font-size: 0.82rem;
    color: #475569;
    margin: 2px 0 0;
  }
  .hea-print-meta {
    text-align: right;
    font-size: 0.75rem;
    color: #475569;
  }
  .chart-card, .card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    margin-bottom: 20px;
  }
  .charts-grid-2, .charts-grid-3 {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   ULTRA-PREMIUM EXECUTIVE INTELLIGENCE & VISUAL EXCELLENCE
   ═══════════════════════════════════════════════════════════ */

/* Executive Welcome & Report Hero Banner */
.report-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #0d9488 100%) !important;
  color: #ffffff !important;
  border-radius: 18px;
  padding: 24px 30px;
  margin-bottom: 24px;
  box-shadow: 0 12px 30px -5px rgba(30, 64, 175, 0.28);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.report-hero::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}
.report-hero-title {
  flex: 1 1 320px;
  position: relative;
  z-index: 1;
}
.report-hero-title h1 {
  font-size: 1.65rem;
  font-weight: 800;
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
  color: #ffffff !important;
  line-height: 1.25;
}
.report-hero-title p {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.92) !important;
  margin: 0;
  line-height: 1.5;
  max-width: 780px;
}
.report-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  line-height: 1.2;
}
.hero-btn:visited, .hero-btn:active, .hero-btn:focus {
  text-decoration: none !important;
}
.hero-btn-primary {
  background: #ffffff !important;
  color: #1e3a8a !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.hero-btn-primary:hover {
  background: #f8fafc !important;
  color: #1e40af !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}
.hero-btn-outline {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.38) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hero-btn-outline:hover {
  background: rgba(255, 255, 255, 0.28) !important;
  border-color: rgba(255, 255, 255, 0.65) !important;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* ── Global Topbar Workflow Launcher ──────────────────────── */
.topbar-launcher-wrap {
  flex: 1;
  max-width: 360px;
  margin: 0 16px;
}
.topbar-launcher-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 7px 14px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}
.topbar-launcher-btn:hover {
  border-color: var(--primary);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.08);
}
.launcher-search-icon {
  font-size: 0.95rem;
  opacity: 0.8;
}
.launcher-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.launcher-kbd {
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--text-muted);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ── Global Breadcrumbs Bar ───────────────────────────────── */
.global-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light, rgba(0,0,0,0.06));
}
.crumb-link {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}
.crumb-link:hover {
  color: var(--primary);
  text-decoration: underline;
}
.crumb-sep {
  color: var(--border-dark, #cbd5e1);
  font-size: 0.75rem;
  user-select: none;
}
.crumb-section {
  color: var(--text-muted);
}
.crumb-current {
  color: var(--text);
  font-weight: 700;
}
.crumb-back-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
}
.crumb-back-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(-2px);
}

/* ── Operational Workflow Journeys (Dashboard Hub) ────────── */
.journey-hub-section {
  margin-bottom: 28px;
}
.journey-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.journey-hub-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.journey-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
}
.journey-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.journey-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.journey-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.journey-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}
.journey-badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
}
.journey-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px 0;
}
.journey-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 14px;
  flex: 1;
}
.journey-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.journey-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  transition: all 0.15s;
}
.journey-link-item:hover {
  background: rgba(30, 64, 175, 0.08);
  color: var(--primary);
  transform: translateX(3px);
}
.journey-link-tag {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

@media (max-width: 768px) {
  .topbar-launcher-wrap {
    max-width: 44px;
    margin: 0 6px;
  }
  .topbar-launcher-btn {
    padding: 8px;
    justify-content: center;
  }
  .launcher-text, .launcher-kbd {
    display: none;
  }
  .global-breadcrumbs {
    font-size: 0.74rem;
    flex-wrap: wrap;
  }
}

/* KPI Metric Highlights Cards */
.kpi-highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 14px;
  margin-bottom: 24px;
  width: 100%;
  box-sizing: border-box;
}
.kpi-metric-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  min-width: 0;
}
.kpi-metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.kpi-metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kpi-metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.kpi-metric-info .val {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  margin-top: 10px;
}
.kpi-metric-info .lbl {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* Multi-chart Grid Layouts */
.charts-duo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 20px;
  margin-bottom: 24px;
  width: 100%;
  box-sizing: border-box;
}
.charts-trio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 20px;
  margin-bottom: 24px;
  width: 100%;
  box-sizing: border-box;
}

/* AI Executive Insights & Intelligence Widget */
.ai-insights-panel {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.04) 0%, rgba(13, 148, 136, 0.04) 100%);
  border: 1.5px solid rgba(59, 130, 246, 0.25);
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px -4px rgba(30, 64, 175, 0.08);
}
.ai-insights-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: linear-gradient(180deg, #3b82f6, #10b981);
}
.ai-insights-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #1e40af, #0d9488);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}
.ai-pulse-dot {
  width: 7px; height: 7px;
  background: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 8px #34d399;
  animation: pulseGlow 1.8s infinite;
}
@keyframes pulseGlow {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}
.ai-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}
.ai-insight-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.ai-insight-item:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
}
.ai-insight-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Sparklines inside KPI Cards */
.sparkline-container {
  margin-top: 10px;
  height: 32px;
  width: 100%;
}
.sparkline-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.sparkline-path {
  fill: none;
  stroke: #3b82f6;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sparkline-area {
  fill: rgba(59, 130, 246, 0.12);
}

/* Growth Delta Badges */
.metric-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 6px;
}
.metric-delta.positive {
  background: #ecfdf5;
  color: #059669;
}
.metric-delta.neutral {
  background: #eff6ff;
  color: #2563eb;
}

/* Heat Bars in Table Cells */
.heat-bar-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.heat-bar-track {
  width: 60px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}
.heat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Interactive Zambia Province SVG Map */
.zambia-map-container {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  align-items: center;
  padding: 10px;
}
@media (max-width: 900px) {
  .zambia-map-container {
    grid-template-columns: 1fr;
  }
}
.zambia-svg-wrap {
  position: relative;
  background: radial-gradient(circle, rgba(30,64,175,0.03) 0%, rgba(0,0,0,0) 70%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}
.province-node {
  cursor: pointer;
  transition: all 0.25s ease;
}
.province-node:hover {
  filter: drop-shadow(0 4px 10px rgba(30, 64, 175, 0.4));
  transform: translateY(-2px);
}
.province-leaderboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 6px;
}
.province-rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.province-rank-item:hover {
  border-color: var(--primary);
  background: #eff6ff;
}

/* Boardroom Presentation Mode */
body.boardroom-active {
  background: #090d16 !important;
  color: #f8fafc !important;
}
body.boardroom-active .app-layout {
  padding: 20px;
}
body.boardroom-active .sidebar,
body.boardroom-active .topbar,
body.boardroom-active .preset-bar,
body.boardroom-active .report-nav-tabs,
body.boardroom-active .active-filters-bar {
  display: none !important;
}
body.boardroom-active .main-content {
  margin-left: 0 !important;
}
body.boardroom-active .card,
body.boardroom-active .chart-card,
body.boardroom-active .kpi-metric-card {
  background: rgba(15, 23, 42, 0.85) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
}
body.boardroom-active .chart-title-group h3,
body.boardroom-active .kpi-metric-info .val {
  color: #ffffff !important;
}
body.boardroom-active .kpi-metric-info .lbl,
body.boardroom-active .chart-title-group p {
  color: #94a3b8 !important;
}
.boardroom-exit-btn {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 99999;
  background: #ef4444;
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
  display: none;
}
body.boardroom-active .boardroom-exit-btn {
  display: block;
}

/* ═══════════════════════════════════════════════════════════
   GLOBAL WORKFLOW COMMAND PALETTE (CTRL+K) & QUICK ACTIONS
   ═══════════════════════════════════════════════════════════ */
.cmd-palette-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.cmd-palette-overlay.open {
  display: flex;
}
.cmd-palette-card {
  width: 100%;
  max-width: 620px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 25px 60px -15px rgba(0,0,0,0.3);
  overflow: hidden;
  animation: cmdSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cmdSlideDown {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.cmd-palette-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(30, 64, 175, 0.02);
}
.cmd-palette-search input {
  flex: 1;
  border: none;
  background: none;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  outline: none;
}
.cmd-palette-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 10px 8px;
}
.cmd-group-label {
  padding: 8px 14px 4px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cmd-palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.cmd-palette-item:hover, .cmd-palette-item.active {
  background: #eff6ff;
  color: var(--primary);
  transform: translateX(4px);
}
.cmd-palette-badge {
  font-size: 0.72rem;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--text-muted);
  font-weight: 700;
}
.cmd-palette-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════
   STREAMLINED WORKFLOW & PIPELINE COMPONENTS
   ══════════════════════════════════════════════════════════════ */

/* ── Workflow Progress Rail ── */
.workflow-progress-rail {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px 22px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
}
.workflow-rail-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.workflow-rail-badge {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #fff;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.workflow-rail-bar {
  flex: 1;
  max-width: 380px;
  background: var(--border);
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.workflow-rail-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #10b981);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── 5-Stage Visual Pipeline Stepper ── */
.pipeline-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin: 16px 0 24px;
  padding: 0 10px;
}
.pipeline-stepper::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 36px;
  right: 36px;
  height: 3px;
  background: var(--border);
  z-index: 1;
}
.pipeline-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  cursor: pointer;
}
.pipeline-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.pipeline-step.completed .pipeline-dot {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}
.pipeline-step.active .pipeline-dot {
  background: var(--primary);
  border-color: #93c5fd;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.18);
  transform: scale(1.1);
}
.pipeline-step.rejected .pipeline-dot {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}
.pipeline-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.25;
  max-width: 90px;
}
.pipeline-step.active .pipeline-label {
  color: var(--primary);
  font-weight: 800;
}
.pipeline-step.completed .pipeline-label {
  color: #059669;
}

/* ── Inline NRC Live Status Pill ── */
.nrc-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-top: 4px;
  transition: all 0.2s;
}
.nrc-status-pill.validating {
  background: #f1f5f9;
  color: #475569;
}
.nrc-status-pill.valid {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.nrc-status-pill.duplicate {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.nrc-status-pill.invalid {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ── Transfer Quick Action Drawer ── */
.transfer-action-box {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 14px;
}

/* ── Printable National Student ID Card ── */
.student-id-card {
  width: 340px;
  height: 215px;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 60%, #047857 100%);
  border-radius: 14px;
  color: #fff;
  padding: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(30, 64, 175, 0.25);
  display: inline-block;
  text-align: left;
}
.student-id-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  pointer-events: none;
}
.student-id-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.25);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.student-id-body {
  display: flex;
  gap: 12px;
}
.student-id-photo {
  width: 60px;
  height: 75px;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.6);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}
.student-id-details {
  flex: 1;
  font-size: 0.72rem;
  line-height: 1.4;
}
.student-id-details strong {
  font-size: 0.84rem;
  display: block;
  color: #fff;
}
.student-id-barcode {
  font-family: 'Courier New', monospace;
  letter-spacing: 3px;
  font-weight: 800;
  font-size: 0.72rem;
  margin-top: 10px;
  opacity: 0.85;
  background: rgba(0,0,0,0.2);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}




/* ============================================================
   RESPONSIVE & PWA SYSTEM
   Mobile-first breakpoints, sidebar overlay, bottom nav,
   touch-friendly forms, offline banner, install prompt
   Breakpoints: 480 | 768 | 1024 | 1280
============================================================ */

/* ── PWA Install Prompt Banner ─────────────────────────────── */
#pwa-install-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 14px 20px;
  display: none;
  align-items: center; gap: 14px;
  box-shadow: 0 -4px 24px rgba(30,64,175,0.25);
  border-top: 1px solid rgba(255,255,255,0.15);
}
#pwa-install-banner.visible { display: flex; }
#pwa-install-banner .pwa-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
#pwa-install-banner .pwa-icon img { width: 80%; height: 80%; object-fit: contain; }
#pwa-install-banner .pwa-text { flex: 1; }
#pwa-install-banner .pwa-text strong { display: block; font-size: .9rem; font-weight: 700; }
#pwa-install-banner .pwa-text small { font-size: .77rem; opacity: .8; }
#pwa-install-btn {
  background: #fff; color: var(--primary-dark);
  border: none; border-radius: 10px;
  padding: 9px 18px; font-weight: 800; font-size: .85rem;
  cursor: pointer; flex-shrink: 0; white-space: nowrap;
  transition: all .2s;
}
#pwa-install-btn:hover { background: var(--accent); color: #fff; }
#pwa-install-dismiss {
  background: none; border: none; color: rgba(255,255,255,0.6);
  font-size: 1.3rem; cursor: pointer; flex-shrink: 0; padding: 4px 8px;
  transition: color .2s;
}
#pwa-install-dismiss:hover { color: #fff; }

/* ── Offline Banner ─────────────────────────────────────────── */
#offline-banner {
  display: none; position: fixed; top: 0; left: 0; right: 0;
  z-index: 99999;
  background: #1e293b;
  color: #fbbf24;
  padding: 10px 20px;
  font-size: .83rem; font-weight: 700;
  text-align: center;
  border-bottom: 2px solid #fbbf24;
  animation: slideDown .3s ease;
}
#offline-banner.visible { display: block; }
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* ── Hamburger Menu Button (mobile only) ──────────────────── */
.sidebar-hamburger {
  display: none;
  position: fixed; top: 16px; left: 16px; z-index: 200;
  width: 42px; height: 42px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  align-items: center; justify-content: center;
  cursor: pointer; flex-direction: column; gap: 5px;
  padding: 10px;
  transition: all .2s;
}
.sidebar-hamburger span {
  display: block; width: 100%; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: all .25s;
}
.sidebar-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sidebar-hamburger.active span:nth-child(2) { opacity: 0; }
.sidebar-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Sidebar Overlay (mobile) ──────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .25s;
}
.sidebar-overlay.visible { display: block; opacity: 1; }

/* ── Mobile Bottom Navigation ──────────────────────────────── */
.mobile-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 140;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(15,23,42,0.08);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
.mobile-bottom-nav ul {
  display: flex; list-style: none; margin: 0; padding: 0;
}
.mobile-bottom-nav ul li { flex: 1; }
.mobile-bottom-nav ul li a {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 6px 4px;
  font-size: .65rem; font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all .2s; border-radius: 10px; margin: 0 2px;
}
.mobile-bottom-nav ul li a .mbn-icon { font-size: 1.3rem; line-height: 1; }
.mobile-bottom-nav ul li a.active,
.mobile-bottom-nav ul li a:hover {
  color: var(--primary); background: rgba(30,64,175,.06);
}
.mobile-bottom-nav ul li a.active .mbn-icon { filter: drop-shadow(0 0 4px rgba(30,64,175,.4)); }

/* ── Safe area insets (notch / home bar devices) ───────────── */
.main-content { padding-bottom: env(safe-area-inset-bottom, 0); }
.sidebar { padding-top: env(safe-area-inset-top, 0); }

/* ── Responsive Form Controls (touch targets) ──────────────── */
@media (max-width: 992px) {
  input, select, textarea {
    font-size: 16px !important; /* prevents iOS auto-zoom */
    min-height: 44px;
  }
  .btn { min-height: 42px; padding: 10px 16px; }
  .btn-sm { min-height: 36px; font-size: .8rem; }
}

/* ════════════════════════════════════════════════════════════
   BREAKPOINT: LAPTOP COMPACT (max-width: 1200px)
════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  :root { --sidebar-w: 240px; }
  .topbar-title span { display: none; }
  .topbar-user .user-info { display: none; }
  .topbar-launcher-wrap { max-width: 200px; }
  .page-content { padding: 22px 18px; }
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 12px; }
}

/* ════════════════════════════════════════════════════════════
   BREAKPOINT: TABLET & COMPACT SCREENS (max-width: 992px)
   Off-canvas sidebar allows full 100% screen width for data
════════════════════════════════════════════════════════════ */
@media (max-width: 992px) {
  :root {
    --sidebar-w: 280px;
    --header-h:  62px;
  }

  /* Sidebar becomes off-canvas slide-in */
  .sidebar {
    transform: translateX(-100%);
    z-index: 160;
    box-shadow: 4px 0 24px rgba(15,23,42,0.15);
    width: var(--sidebar-w) !important;
  }
  .sidebar.mobile-open,
  .sidebar.open {
    transform: translateX(0);
  }

  /* Show hamburger button */
  .sidebar-hamburger { display: flex; }

  /* Main content takes full screen width */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Topbar accommodates hamburger */
  .topbar {
    padding: 0 16px 0 68px;
    height: var(--header-h);
    gap: 10px;
  }
  .topbar-title { font-size: 1rem; }
  .topbar-title span { display: none; }
  .topbar-user { padding: 5px 10px; }
  .topbar-user .user-info { display: none; }

  /* Page content has room for mobile bottom nav */
  .page-content { padding: 18px 16px 84px; }

  /* Page header */
  .page-header { margin-bottom: 20px; }
  .page-header h1 { font-size: 1.55rem; }
  .page-header p { font-size: .9rem; }

  /* Grids & Cards */
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin-bottom: 22px; }
  .charts-grid { grid-template-columns: 1fr; gap: 16px; }
  .card-header { padding: 14px 18px; flex-wrap: wrap; gap: 10px; }
  .card-body { padding: 16px 18px; }

  /* Tables */
  .table-wrap { border-radius: 10px; }
  table { font-size: .84rem; }
  th, td { padding: 11px 13px; }

  /* Show bottom navigation */
  .mobile-bottom-nav { display: block; }
}

/* ════════════════════════════════════════════════════════════
   BREAKPOINT: MOBILE (max-width: 768px)
════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 280px;
    --header-h:  58px;
  }

  .page-content { padding: 14px 12px 84px; }
  .page-header h1 { font-size: 1.35rem; }
  .page-header p { font-size: .84rem; }

  /* KPI cards: 2-column clean grid */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
  .kpi-card { padding: 14px; }
  .kpi-card .kpi-value { font-size: 1.6rem; }
  .kpi-card .kpi-label { font-size: .68rem; }

  /* Forms: full-width stacked */
  .form-row { flex-direction: column !important; }
  .form-group { margin-bottom: 12px; }

  /* Modals: bottom sheet */
  .modal-content {
    width: 100% !important; max-width: 100% !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    position: fixed !important; bottom: 0 !important;
    top: auto !important; margin: 0 !important;
    max-height: 90vh; overflow-y: auto;
    animation: slideUpModal .3s ease;
  }
  @keyframes slideUpModal { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .modal { align-items: flex-end !important; }

  /* Step wizard: compact horizontal pills */
  .import-steps { gap: 4px; overflow-x: auto; padding-bottom: 4px; flex-wrap: nowrap; }
  .step-pill { font-size: .72rem; padding: 6px 12px; white-space: nowrap; }
  .step-arrow { font-size: .7rem; }

  /* Pipeline steps */
  .pipeline-stepper { overflow-x: auto; padding-bottom: 8px; }
  .pipeline-label { font-size: .66rem; max-width: 70px; }

  /* Stat cards in reports & highlights */
  .report-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .kpi-highlights-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .kpi-metric-card { padding: 14px !important; }
  .kpi-metric-info .val { font-size: 1.35rem !important; }
  .kpi-metric-icon { width: 36px !important; height: 36px !important; font-size: 1.1rem !important; }

  /* Report hero & actions */
  .report-hero { padding: 18px 16px !important; border-radius: 14px !important; }
  .report-hero-title h1 { font-size: 1.3rem !important; }
  .report-hero-title p { font-size: .82rem !important; }
  .report-hero-actions { width: 100% !important; gap: 8px !important; }
  .report-hero-actions .hero-btn { flex: 1 1 calc(50% - 8px); justify-content: center; font-size: .78rem !important; padding: 8px 10px !important; }

  /* AI insights grid */
  .ai-insights-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
  .ai-insights-panel { padding: 14px 16px !important; }

  /* Student Registration & Onboarding Wizard */
  .wizard-steps {
    display: flex !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 4px !important;
    margin-bottom: 20px !important;
  }
  .wizard-steps::-webkit-scrollbar { display: none; }
  .wz-step { flex: 0 0 auto !important; min-width: 110px !important; padding: 10px 8px !important; font-size: .74rem !important; }
  .reg-section { padding: 16px 14px !important; border-radius: 12px !important; }
  .reg-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  .step-actions { flex-direction: column-reverse !important; gap: 10px !important; }
  .step-actions .btn { width: 100% !important; }
  .cert-card { padding: 20px 14px !important; border-radius: 12px !important; }
  .cert-hea { font-size: 1.6rem !important; }

  /* Filter Drawer on mobile: bottom sheet */
  .filter-drawer, .drawer-panel {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 18px 18px 0 0 !important;
    top: auto !important;
    bottom: 0 !important;
    max-height: 85vh !important;
  }

  /* PWA Install Banner positioning above bottom nav */
  #pwa-install-banner {
    bottom: calc(56px + env(safe-area-inset-bottom)) !important;
    border-radius: 14px 14px 0 0;
    padding: 12px 14px !important;
  }
  #pwa-install-banner .pwa-text strong { font-size: .84rem; }
  #pwa-install-banner .pwa-text small { font-size: .72rem; }
  #pwa-install-btn { padding: 7px 14px; font-size: .8rem; }

  /* Buttons in card headers: stack on tiny screens */
  .card-header { flex-wrap: wrap; }

  /* Show bottom nav */
  .mobile-bottom-nav { display: block; }

  /* History panel grid */
  .history-row { grid-template-columns: 1fr 1fr; }

  /* Conflict mode options: stack */
  .conflict-mode-options { flex-direction: column; }
  .conflict-opt { min-width: unset; }

  /* Heat grid: 2 cols on mobile */
  .heat-grid { grid-template-columns: repeat(2, 1fr); }

  /* Topbar search/filter buttons: icon-only */
  .topbar .btn span { display: none; }
  .topbar .btn { padding: 8px; min-width: 36px; }
}

/* ════════════════════════════════════════════════════════════
   BREAKPOINT: SMALL MOBILE (max-width: 480px)
════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  :root { font-size: 14px; }

  .page-header h1 { font-size: 1.25rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .page-header > div, .page-header .btn-group { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }

  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
  .kpi-card { padding: 12px; }
  .kpi-card .kpi-value { font-size: 1.4rem; }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
  }
  .card-header > div, .card-header .btn-group {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .card-header .btn, .card-header button {
    flex: 1 1 auto;
    text-align: center;
  }
  .card-body {
    padding: 12px 14px;
  }

  /* Toolbar & Search */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .search-bar {
    max-width: 100% !important;
    width: 100%;
  }

  /* Student ID card: scale down */
  .student-id-card { width: 100%; max-width: 320px; height: auto; }

  /* Table: allow full horizontal scroll */
  table { min-width: 480px; }

  /* Report grid: fluid */
  .report-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important; gap: 8px; }
  .report-stat-num { font-size: 1.35rem; }

  /* Import step pills: very compact */
  .step-pill { font-size: .68rem; padding: 5px 9px; }

  /* Heat grid: 2 cols */
  .heat-grid { grid-template-columns: repeat(2, 1fr); }

  /* History panel: simplified */
  .history-row { grid-template-columns: 1fr 1fr; gap: 6px; font-size: .75rem; }
}

/* ════════════════════════════════════════════════════════════
   BREAKPOINT: WIDE DESKTOP (min-width: 1440px)
════════════════════════════════════════════════════════════ */
@media (min-width: 1440px) {
  .page-content { padding: 36px 40px; }
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .charts-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Print styles ───────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .mobile-bottom-nav,
  .sidebar-hamburger, #pwa-install-banner,
  .btn, .card-header button { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; }
}

/* ── Utility: touch-action for swipeable elements ───────────── */
.sidebar-nav { touch-action: pan-y; }
.table-wrap { touch-action: pan-x; -webkit-overflow-scrolling: touch; }

/* ── Prevent body scroll when mobile menu open ──────────────── */
body.menu-open { overflow: hidden; }
