/* ==========================================================================
   COSMAT BASIC ACADEMY — INSTITUTIONAL CANTEEN & BURSARY MANAGEMENT SYSTEM
   World-Class Fintech Design System • Dual Theme (Day / Night)
   Ultra-Responsive • Accessible • Scalable Across All Modern Devices
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS & SYSTEM VARIABLES
   -------------------------------------------------------------------------- */
:root {
  /* Brand Core Palette */
  --brand-navy-950: #050a14;
  --brand-navy-900: #0a1124;
  --brand-navy-850: #0e172e;
  --brand-navy-800: #14203d;
  --brand-navy-700: #1d2d52;
  --brand-navy-600: #293e6d;
  
  /* Primary Royal Sapphire Accent */
  --primary-600: #1d4ed8;
  --primary-500: #2563eb;
  --primary-400: #3b82f6;
  --primary-300: #60a5fa;
  --primary-200: #93c5fd;
  --primary-100: #dbeafe;
  --primary-50:  #eff6ff;
  
  /* Financial States */
  --emerald-600: #059669;
  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-100: #d1fae5;
  --emerald-50:  #ecfdf5;

  --amber-600:   #d97706;
  --amber-500:   #f59e0b;
  --amber-400:   #fbbf24;
  --amber-100:   #fef3c7;
  --amber-50:    #fffbeb;

  --rose-600:    #dc2626;
  --rose-500:    #ef4444;
  --rose-400:    #f87171;
  --rose-100:    #fee2e2;
  --rose-50:     #fef2f2;

  --indigo-500:  #6366f1;
  --indigo-100:  #e0e7ff;

  /* Neutral Slate Scale */
  --slate-950:   #020617;
  --slate-900:   #0f172a;
  --slate-850:   #152033;
  --slate-800:   #1e293b;
  --slate-700:   #334155;
  --slate-600:   #475569;
  --slate-500:   #64748b;
  --slate-400:   #94a3b8;
  --slate-300:   #cbd5e1;
  --slate-200:   #e2e8f0;
  --slate-100:   #f1f5f9;
  --slate-50:    #f8fafc;
  --white:       #ffffff;

  /* Typography */
  --font-heading: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-body:    'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s var(--ease-smooth);
  --transition-normal: 0.25s var(--ease-smooth);
  --transition-spring: 0.35s var(--ease-spring);
}

/* --------------------------------------------------------------------------
   THEME MATRICES (NIGHT MODE DEFAULT & DAY MODE)
   -------------------------------------------------------------------------- */
/* Night Mode (Default) */
:root,
html[data-theme="dark"] {
  --bg-app: #080d19;
  --bg-app-radial-1: rgba(37, 99, 235, 0.08);
  --bg-app-radial-2: rgba(16, 185, 129, 0.06);

  --surface-header: rgba(10, 17, 34, 0.88);
  --surface-card: #0d1629;
  --surface-card-subtle: #111c33;
  --surface-card-elevated: #152340;
  --surface-toolbar: #0f1a30;
  --surface-input: #080e1c;
  --surface-hover: rgba(37, 99, 235, 0.12);

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-card: rgba(255, 255, 255, 0.10);
  --border-focus: var(--primary-400);

  --text-main: #f8fafc;
  --text-heading: #ffffff;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.6);
  --shadow-glow-primary: 0 0 24px rgba(37, 99, 235, 0.35);
  --shadow-glow-emerald: 0 0 24px rgba(16, 185, 129, 0.3);

  --table-head-bg: #091021;
  --table-row-hover: rgba(37, 99, 235, 0.09);
  --table-border: rgba(255, 255, 255, 0.06);
}

/* Day Mode (Crisp Porcelain & Navy High Contrast) */
html[data-theme="light"] {
  --bg-app: #f4f6fa;
  --bg-app-radial-1: rgba(37, 99, 235, 0.04);
  --bg-app-radial-2: rgba(16, 185, 129, 0.03);

  --surface-header: rgba(10, 25, 49, 0.98);
  --surface-card: #ffffff;
  --surface-card-subtle: #f8fafc;
  --surface-card-elevated: #ffffff;
  --surface-toolbar: #ffffff;
  --surface-input: #f8fafc;
  --surface-hover: rgba(37, 99, 235, 0.06);

  --border-subtle: #e2e8f0;
  --border-card: #e2e8f0;
  --border-focus: var(--primary-500);

  --text-main: #1e293b;
  --text-heading: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 20px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 14px 34px -4px rgba(15, 23, 42, 0.12);
  --shadow-glow-primary: 0 0 20px rgba(37, 99, 235, 0.18);
  --shadow-glow-emerald: 0 0 20px rgba(16, 185, 129, 0.16);

  --table-head-bg: #f8fafc;
  --table-row-hover: #f1f5f9;
  --table-border: #e2e8f0;
}

/* --------------------------------------------------------------------------
   2. GLOBAL RESET & BASE STYLES
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: var(--bg-app);
  background-image: 
    radial-gradient(at 0% 0%, var(--bg-app-radial-1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, var(--bg-app-radial-2) 0px, transparent 50%);
  background-attachment: fixed;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

body.auth-locked {
  overflow: hidden;
}

body.mobile-drawer-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

img, svg {
  vertical-align: middle;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: transparent;
}

a {
  color: var(--primary-400);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-300);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.25;
}

/* Modern Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.45);
}

/* --------------------------------------------------------------------------
   3. EXECUTIVE TOP HEADER & APP BAR
   -------------------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--surface-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  padding: 10px 24px;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Brand Logo & Name */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  padding: 8px;
  transition: all var(--transition-fast);
}

.mobile-hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

body.mobile-drawer-open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.mobile-drawer-open .hamburger-line:nth-child(2) {
  opacity: 0;
}
body.mobile-drawer-open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-400) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
  margin: 0;
  line-height: 1.15;
}

.brand-text p {
  font-size: 11.5px;
  color: var(--primary-200);
  margin: 2px 0 0;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Header Controls & User Widget */
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Day / Night Mode Toggle */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  padding: 4px 10px 4px 4px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.theme-toggle-track {
  width: 44px;
  height: 24px;
  background: #0d172b;
  border-radius: var(--radius-full);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  padding: 2px;
}

.theme-toggle-thumb {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: transform var(--transition-spring);
  transform: translateX(20px);
}

.theme-toggle-thumb .icon-sun {
  display: none;
}
.theme-toggle-thumb .icon-moon {
  display: flex;
}

.theme-toggle-btn:not(.is-dark) .theme-toggle-thumb {
  transform: translateX(0);
  background: linear-gradient(135deg, var(--amber-400), var(--amber-600));
}

.theme-toggle-btn:not(.is-dark) .theme-toggle-thumb .icon-sun {
  display: flex;
}
.theme-toggle-btn:not(.is-dark) .theme-toggle-thumb .icon-moon {
  display: none;
}

.theme-mode-text {
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}

/* Institutional Live Clock */
.header-clock {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

/* Cloud / MySQL Sync Badge */
.cloud-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-heading);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

.cloud-pill.online {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.35);
  color: #34d399;
}

.cloud-pill.offline,
.cloud-pill.demo {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fbbf24;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
  display: inline-block;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  animation: pulsePing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes pulsePing {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* User Profile Widget */
.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-heading);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
}

.user-info-text {
  display: flex;
  flex-direction: column;
}

.user-display-name {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.15;
}

.user-role-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--primary-300);
  letter-spacing: 0.06em;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 11.5px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-logout:hover {
  background: var(--rose-600);
  color: #ffffff;
  border-color: var(--rose-600);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

/* --------------------------------------------------------------------------
   4. DESKTOP NAVIGATION TABS (SEGMENTED CONTROL BAR)
   -------------------------------------------------------------------------- */
.app-nav {
  max-width: 1400px;
  margin: 18px auto 0;
  padding: 0 24px;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 6px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-tab .tab-icon {
  font-size: 15px;
  line-height: 1;
}

.nav-tab:hover {
  color: var(--text-main);
  background: var(--surface-hover);
}

.nav-tab.active {
  background: var(--primary-500);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

/* --------------------------------------------------------------------------
   5. MOBILE NAVIGATION DRAWER & BACKDROP
   -------------------------------------------------------------------------- */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.mobile-nav-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--surface-card);
  border-right: 1px solid var(--border-card);
  box-shadow: var(--shadow-xl);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--transition-spring);
  overflow-y: auto;
}

.mobile-nav-drawer.is-open {
  transform: translateX(0);
}

.mobile-drawer-header {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-title {
  font-size: 14px;
  font-weight: 800;
  margin: 0;
  color: var(--text-heading);
}

.drawer-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.mobile-drawer-close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--surface-hover);
  color: var(--text-muted);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.mobile-drawer-close:hover {
  color: var(--text-heading);
  background: rgba(239, 68, 68, 0.15);
}

.mobile-drawer-user-card {
  padding: 16px 20px;
  margin: 14px 16px;
  background: var(--surface-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.drawer-user-info strong {
  display: block;
  font-size: 13px;
  color: var(--text-heading);
}

.drawer-user-info span {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary-400);
}

.drawer-status-pill {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.mobile-drawer-nav {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.mobile-nav-link:hover {
  background: var(--surface-hover);
  color: var(--text-heading);
}

.mobile-nav-link.active {
  background: var(--primary-500);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.mobile-drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-drawer-sync-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  color: var(--primary-400);
  font-size: 13px;
  font-weight: 700;
}

.mobile-drawer-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 13px;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   6. MAIN VIEW LAYOUT & CONTAINERS
   -------------------------------------------------------------------------- */
.app-main {
  max-width: 1400px;
  margin: 22px auto 60px;
  padding: 0 24px;
}

.page-view {
  display: none;
  animation: viewFadeIn 0.3s var(--ease-spring);
}

.page-view.active {
  display: block;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* View Headers */
.view-header,
.learners-view-header {
  margin-bottom: 22px;
}

.learners-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.view-header-center {
  text-align: left;
}

.view-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--primary-400);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.view-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.view-title,
.view-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-heading);
}

.view-subtitle,
.view-header p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 780px;
}

.view-header-badge,
.live-pos-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--primary-300);
}

/* --------------------------------------------------------------------------
   7. CARDS, FORMS & INPUT CONTROLS
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Alert Banner */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(37, 99, 235, 0.09);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  margin-bottom: 22px;
}

.alert-icon-box {
  color: var(--primary-400);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.alert-content {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.45;
}

.alert-title-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--primary-500);
  color: #ffffff;
  margin-right: 8px;
  letter-spacing: 0.05em;
}

/* Form Fields */
.field-wrap {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.field-wrap label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.field-wrap label::after {
  content: '';
}

input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  transition: all var(--transition-fast);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

input::placeholder, textarea::placeholder {
  color: var(--text-dim);
}

.readonly-field {
  background: var(--surface-card-subtle) !important;
  color: var(--primary-300) !important;
  font-weight: 700;
  cursor: default;
}

/* Form Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-2-custom {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 700;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-500) 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-400) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--surface-card-subtle);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--primary-400);
}

.btn-pdf-export {
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.btn-pdf-export:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.45);
}

.pdf-tag {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   8. VIEW 2: CASHIER REGISTER POS TERMINAL
   -------------------------------------------------------------------------- */
/* Class Filter Bar */
.class-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}

.filter-chip {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  border-color: var(--primary-400);
  color: var(--text-heading);
}

.filter-chip.active {
  background: var(--primary-500);
  border-color: var(--primary-500);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
}

/* POS Layout (2 Columns) */
.pos-card {
  padding: 28px;
  margin-bottom: 28px;
  background: var(--surface-card);
  border: 1px solid var(--border-card);
}

.pos-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
}

/* Left Column: Student Lookup & Profile */
.lookup-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.lookup-input-box input {
  padding-right: 70px;
}

.shortcut-badge {
  position: absolute;
  right: 36px;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lookup-status-icon {
  position: absolute;
  right: 12px;
  color: var(--text-dim);
  display: flex;
}

.matches-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface-card-elevated);
  border: 1.5px solid var(--border-focus);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
}

.matches-dropdown .match {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.matches-dropdown .match:hover {
  background: var(--surface-hover);
}

/* Unselected Placeholder */
.learner-empty-placeholder {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface-card-subtle);
  border: 1.5px dashed var(--border-subtle);
  margin-bottom: 18px;
}

.placeholder-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--surface-hover);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-text strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
}

.placeholder-text span {
  font-size: 11.5px;
  color: var(--text-dim);
}

/* Active Selected Student Badge */
.learner-pos-badge {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1.5px solid rgba(59, 130, 246, 0.35);
  margin-bottom: 18px;
  animation: slideFadeDown 0.25s var(--ease-spring);
}

@keyframes slideFadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.learner-avatar-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-400));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.learner-avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.learner-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.learner-name-row h4 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-heading);
}

.learner-verified-chip {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pill-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.pill-class {
  background: var(--surface-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.pill-plan {
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--primary-300);
}

.pill-family {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: #c4b5fd;
}

.pill-bus {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--amber-400);
}

/* Right Column: Financial POS Totalizer */
.pos-totals-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.total-block {
  background: var(--surface-card-subtle);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
}

.total-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.total-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.total-value {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  width: 100%;
}

.total-expected {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(37, 99, 235, 0.08);
}
.total-expected .total-label,
.total-expected .total-header {
  color: var(--primary-300);
}
.total-expected .total-value {
  color: var(--primary-300);
}

.total-paid {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}
.total-paid .total-label,
.total-paid .total-header {
  color: var(--emerald-400);
}

.currency-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.currency-prefix {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  color: var(--emerald-400);
}

.total-value-input {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--emerald-400) !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  width: 100%;
}

.total-balance {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}
.total-balance .total-label,
.total-balance .total-header {
  color: var(--rose-400);
}
.total-balance .total-value {
  color: var(--rose-400);
}

/* Fast-Click Cash Chips */
.fast-cash-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.fast-cash-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.fast-cash-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cash-chip {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--surface-card-subtle);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-heading);
  transition: all var(--transition-fast);
}

.cash-chip:hover {
  background: var(--surface-hover);
  border-color: var(--primary-400);
  transform: translateY(-1px);
}

.cash-chip:active {
  transform: scale(0.96);
}

.chip-exact {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--emerald-400);
}

.chip-clear {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--rose-400);
}

.remarks-wrap textarea {
  resize: vertical;
  min-height: 54px;
}

/* POS Action Strip */
.pos-action-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.btn-pos-save {
  padding: 12px 26px;
  font-size: 14.5px;
}

.kbd-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.pos-feedback {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* --------------------------------------------------------------------------
   9. DATA TABLES & LISTS
   -------------------------------------------------------------------------- */
.table-card {
  padding: 0;
  overflow: hidden;
}

.card-toolbar {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.card-toolbar h3 {
  font-size: 16px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.badge-count {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: var(--surface-card-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--primary-300);
}

.table-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 380px;
}

.search-box input {
  padding-left: 36px;
  border-radius: var(--radius-full);
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  pointer-events: none;
}

.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: var(--table-head-bg);
  padding: 13px 18px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1.5px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 18px;
  font-size: 13.5px;
  color: var(--text-main);
  border-bottom: 1px solid var(--table-border);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--table-row-hover);
}

.data-table .empty {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
  font-style: italic;
}

.text-right {
  text-align: right;
}

/* Learner Cell in Table */
.table-learner-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-avatar-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-subtle);
}

.mini-learner-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-400));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.learner-cell-name {
  display: block;
  font-weight: 700;
  color: var(--text-heading);
}

.learner-cell-id {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--primary-400);
}

.table-class-pill {
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: var(--surface-card-subtle);
  border: 1px solid var(--border-subtle);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
}

.table-action-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.btn-icon-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-card-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon-action:hover {
  background: var(--surface-hover);
  color: var(--primary-400);
  border-color: var(--primary-400);
}

.btn-icon-action.text-red:hover {
  color: var(--rose-400);
  border-color: var(--rose-400);
  background: rgba(239, 68, 68, 0.15);
}

.receipt-row-btn {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-card-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--primary-400);
  font-size: 12px;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.receipt-row-btn:hover {
  background: var(--primary-500);
  color: #ffffff;
  border-color: var(--primary-500);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.edit-button {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--amber-400);
  font-size: 11.5px;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.edit-button:hover {
  background: var(--amber-500);
  color: #ffffff;
}

.void-button {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--rose-400);
  font-size: 11.5px;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.void-button:hover {
  background: var(--rose-600);
  color: #ffffff;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-green {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--emerald-400);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--amber-400);
}

.badge-red {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--rose-400);
}

.badge-blue {
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--primary-300);
}

/* Financial Color Utilities */
.text-green { color: var(--emerald-400) !important; font-weight: 700; }
.text-red   { color: var(--rose-400) !important; font-weight: 700; }
.text-amber { color: var(--amber-400) !important; font-weight: 700; }
.font-bold  { font-weight: 800 !important; }

/* --------------------------------------------------------------------------
   10. VIEW 1: LEARNERS KPI TILES
   -------------------------------------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all var(--transition-fast);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 255, 255, 0.15);
}

.metric-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.metric-num {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1;
  display: block;
  margin-bottom: 4px;
}

.metric-subtext {
  font-size: 12px;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   11. VIEW 3 & 4: AUDIT, RECONCILIATION & EXECUTIVE REPORTS
   -------------------------------------------------------------------------- */
.toolbar-card {
  padding: 20px 24px;
  margin-bottom: 24px;
}

.tracking-toolbar-grid,
.reports-toolbar-grid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tracking-date-group {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.date-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.date-calendar-icon {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  pointer-events: none;
}

.date-input-wrapper input {
  padding-left: 36px;
}

.quick-date-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-date-btn {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--surface-card-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.quick-date-btn:hover {
  background: var(--surface-hover);
  border-color: var(--primary-400);
}

.school-day-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

.school-day-indicator.active {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--emerald-400);
}

.school-day-indicator.inactive {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--amber-400);
}

.tracking-actions-group,
.reports-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 6-Card Balanced Audit KPI Grid */
.audit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.audit-kpi-card {
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
}

.audit-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.audit-kpi-label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.audit-kpi-val {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}

.audit-kpi-subtext {
  font-size: 12px;
  color: var(--text-dim);
}

.kpi-theme-paid .audit-kpi-val,
.kpi-theme-collected .audit-kpi-val {
  color: var(--emerald-400);
}

.kpi-theme-absent .audit-kpi-val {
  color: var(--amber-400);
}

.kpi-theme-owing .audit-kpi-val,
.kpi-theme-debt .audit-kpi-val {
  color: var(--rose-400);
}

.kpi-theme-expected .audit-kpi-val {
  color: var(--primary-300);
}

/* Audit Table Footer */
.audit-table-foot tr td {
  background: var(--surface-card-subtle);
  border-top: 2px solid var(--border-card);
  padding: 16px 18px;
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   12. SCHOOL SETTINGS & TARIFFS CONFIGURATION SUITE
   -------------------------------------------------------------------------- */
.settings-wrap {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.settings-form-layout {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.settings-section-card {
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.settings-section-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.45);
}

.form-card-header-simple {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 10px;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-heading);
}

.form-section-title svg {
  color: var(--primary-400);
  flex-shrink: 0;
}

.sub-notice {
  font-size: 12px;
  color: var(--text-dim);
}

.field-hint {
  display: block;
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.4;
}

/* Currency & Percentage Input Addon Wrappers */
.input-addon-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-input);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-addon-wrap:focus-within {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.addon-prefix {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.05);
  border-right: 1.5px solid var(--border-subtle);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 13.5px;
  color: var(--primary-300);
  letter-spacing: 0.04em;
  user-select: none;
}

.input-addon-wrap input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  padding: 11px 14px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main) !important;
  font-family: var(--font-mono, monospace);
  outline: none !important;
  box-shadow: none !important;
}

/* Live Tariff Calculation Preview Strip */
.tariff-live-preview-box {
  margin-top: 20px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(124, 58, 237, 0.06) 100%);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-400);
  margin-bottom: 14px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.preview-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
}

.preview-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-value {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text-main);
  margin: 2px 0;
}

.preview-value small {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  font-family: var(--font-sans);
}

.preview-note {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--emerald-400);
}

/* Bus Route Examples Strip */
.route-examples-strip {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.strip-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.route-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.route-sample-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-main);
  font-weight: 500;
  transition: border-color var(--transition-fast);
}

.route-sample-pill .pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b82f6;
  flex-shrink: 0;
}

.route-sample-pill strong {
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
}

/* School Days Checkboxes */
.school-days-group {
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-top: 18px;
}

.school-days-group legend {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0 8px;
}

.days-checkbox-grid {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-500);
  cursor: pointer;
}

/* Docked Sticky Save Action Bar */
.settings-save-dock {
  position: sticky;
  bottom: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 26px;
  background: rgba(13, 22, 41, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.75), 0 0 20px rgba(37, 99, 235, 0.15);
}

.save-dock-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.save-dock-info svg {
  color: var(--primary-400);
  flex-shrink: 0;
}

.save-dock-info strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.save-dock-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.btn-save-tariff {
  padding: 13px 26px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

@media (max-width: 768px) {
  .settings-save-dock {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .save-dock-info {
    flex-direction: column;
    text-align: center;
  }
  .btn-save-tariff {
    width: 100%;
    justify-content: center;
  }
}

/* Light Mode Overrides for Settings & Tariffs */
html[data-theme="light"] .settings-save-dock {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.12), 0 0 20px rgba(37, 99, 235, 0.1);
}

html[data-theme="light"] .save-dock-info strong {
  color: #0f172a;
}

html[data-theme="light"] .save-dock-info p {
  color: #64748b;
}

html[data-theme="light"] .addon-prefix {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1d4ed8;
}

html[data-theme="light"] .preview-item {
  background: #ffffff;
  border-color: #e2e8f0;
}

html[data-theme="light"] .route-sample-pill {
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* --------------------------------------------------------------------------
   13. MASTER ADMINISTRATOR LOGIN OVERLAY
   -------------------------------------------------------------------------- */
.login-portal-wrapper {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #060b17;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

body:not(.auth-locked) .login-portal-wrapper {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

/* Ambient Canteen Background */
.canteen-bg-ambient {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.canteen-subtle-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

.canteen-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
}

.orb-1 {
  width: 450px;
  height: 450px;
  background: #2563eb;
  top: -100px;
  left: -100px;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: #7c3aed;
  bottom: -150px;
  right: -100px;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: #059669;
  top: 50%;
  left: 60%;
}

.floating-canteen-symbol {
  position: absolute;
  color: rgba(255, 255, 255, 0.06);
  animation: floatSlow 14s ease-in-out infinite alternate;
}

.f-sym-1 { top: 12%; left: 8%; animation-delay: 0s; }
.f-sym-2 { top: 22%; right: 12%; animation-delay: 2s; }
.f-sym-3 { bottom: 18%; left: 14%; animation-delay: 4s; }
.f-sym-4 { bottom: 25%; right: 18%; animation-delay: 1s; }
.f-sym-5 { top: 65%; left: 6%; animation-delay: 3s; }
.f-sym-6 { top: 40%; right: 8%; animation-delay: 5s; }
.f-sym-7 { top: 8%; right: 35%; animation-delay: 2.5s; }

@keyframes floatSlow {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-24px) rotate(8deg); }
}

/* Login Card Container */
.login-portal-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 980px;
  background: rgba(13, 22, 41, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-2xl);
  box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.75), 0 0 30px rgba(37, 99, 235, 0.2);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  overflow: hidden;
  animation: modalScaleUp 0.4s var(--ease-spring);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Left Hero Pane */
.login-hero-pane {
  padding: 44px;
  background: linear-gradient(135deg, rgba(14, 25, 48, 0.95) 0%, rgba(10, 17, 34, 0.95) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.login-crest-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary-600), var(--primary-400));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

.login-school-title {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
}

.login-portal-sub {
  font-size: 11.5px;
  color: var(--primary-300);
}

.login-terminal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--primary-200);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 18px;
}

.login-hero-desc {
  font-size: 13.5px;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 28px;
}

.login-status-strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 28px;
}

.login-status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.status-key {
  color: #64748b;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.05em;
}

.status-val {
  color: #e2e8f0;
  font-weight: 600;
}

.login-hero-footer small {
  font-size: 11px;
  color: #475569;
}

/* Right Form Pane */
.login-form-pane {
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.login-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
}

.terminal-lock-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.15);
  color: var(--primary-400);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 20px;
}

.admin-portal-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  margin-bottom: 22px;
}

.admin-badge-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-500);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-badge-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.04em;
}

.admin-badge-sub {
  font-size: 11px;
  color: var(--primary-200);
}

.admin-root-pill {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-leading-icon {
  position: absolute;
  left: 14px;
  color: #64748b;
  pointer-events: none;
}

.input-icon-wrap input {
  padding-left: 40px;
  padding-right: 40px;
  background: #090e1c !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

.btn-toggle-pwd {
  position: absolute;
  right: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: color var(--transition-fast);
}

.btn-toggle-pwd:hover {
  color: #ffffff;
}

.login-form-actions {
  margin-top: 18px;
}

.btn-login-submit {
  width: 100%;
  padding: 13px;
  font-size: 14.5px;
}

.quick-demo-login-box {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.quick-demo-title {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.admin-single-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px dashed rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
  text-align: left;
}

.admin-single-btn:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: var(--primary-400);
}

.demo-admin-btn-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-admin-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.2);
  color: var(--amber-400);
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 10px;
  font-weight: 800;
}

.demo-admin-user strong {
  display: block;
  font-size: 12.5px;
  color: #ffffff;
}

.demo-admin-user small {
  font-size: 11px;
  color: #94a3b8;
}

.admin-arrow-icon {
  color: #64748b;
}

.login-security-notice {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

.login-err-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   14. MODAL DIALOGS & POPUPS
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
}

.modal-dialog-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  padding: 0;
  width: min(600px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  animation: modalScaleUp 0.28s var(--ease-spring);
}

.modal-dialog-box:not([hidden]) {
  display: block !important;
}

.modal-import-box {
  width: min(780px, 94vw);
}

.modal-title-with-icon {
  display: flex;
  align-items: center;
  gap: 14px;
}

.import-badge-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.modal-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.import-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 26px;
}

.import-step-card {
  background: var(--surface-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.template-download-card {
  justify-content: space-between;
  flex-wrap: wrap;
}

.step-badge {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.15);
  color: var(--primary-300);
  border: 1px solid rgba(59, 130, 246, 0.3);
  flex-shrink: 0;
}

.step-content strong {
  display: block;
  font-size: 13.5px;
  color: var(--text-heading);
}

.step-content p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.step-content code {
  background: var(--surface-hover);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.btn-template-download {
  font-size: 12.5px;
  padding: 9px 16px;
  white-space: nowrap;
}

/* Upload Dropzone */
.upload-zone-card {
  flex-direction: column;
  align-items: flex-start;
}

.import-drop-zone {
  margin-top: 10px;
  width: 100%;
  border: 2px dashed rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  background: var(--surface-hover);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.import-drop-zone:hover,
.import-drop-zone.dragover {
  border-color: var(--primary-400);
  background: rgba(37, 99, 235, 0.14);
  transform: translateY(-1px);
}

.drop-icon {
  color: var(--primary-400);
}

.drop-main-text {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-heading);
}

.drop-sub-text {
  display: block;
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Import Preview Section */
.import-preview-section {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--surface-card);
  animation: slideFadeDown 0.25s var(--ease-spring);
}

.preview-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.preview-header-bar strong {
  font-size: 13.5px;
  color: var(--text-heading);
  margin-right: 10px;
}

.btn-clear-import {
  font-size: 12px;
  color: var(--rose-400);
  text-decoration: underline;
  cursor: pointer;
}

.btn-clear-import:hover {
  color: var(--rose-300);
}

.import-preview-table-wrap {
  max-height: 230px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.import-table th {
  padding: 10px 14px;
  font-size: 11px;
}

.import-table td {
  padding: 10px 14px;
  font-size: 12.5px;
}

.modal-header-bar {
  padding: 20px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header-bar h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-heading);
}

.btn-modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--surface-hover);
  color: var(--text-muted);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--rose-400);
}

.modal-learner-dialog {
  width: min(680px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
}

.modal-header-executive {
  padding: 20px 26px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(13, 22, 41, 0.95) 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-badge-learner {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.modal-form-body {
  padding: 24px 26px;
}

.modal-form-learner {
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Biometric Photo Uploader Card */
.learner-photo-upload-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-bottom: 4px;
}

.learner-avatar-frame {
  width: 78px;
  height: 78px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface-card-subtle);
  border: 2px dashed rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: border-color var(--transition-fast);
}

.learner-avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.learner-avatar-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
}

.photo-upload-details {
  flex: 1;
  min-width: 0;
}

.photo-details-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
}

.photo-details-header strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-heading);
}

.optional-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.photo-details-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 10px;
  line-height: 1.4;
}

.photo-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-upload-learner-photo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-text-danger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: var(--rose-400);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-text-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ffffff;
}

/* Modal Form Section Blocks */
.modal-section-block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-300);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2px;
}

.modal-section-title .sec-number {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.25);
  color: #38bdf8;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
}

/* Modal Live Daily Charge Estimator */
.modal-charge-preview-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(16, 185, 129, 0.09) 100%);
  border: 1px solid rgba(59, 130, 246, 0.32);
  border-radius: var(--radius-md);
  padding: 11px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.charge-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.charge-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--primary-300);
}

.charge-amount {
  font-size: 17px;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--emerald-400);
}

.charge-breakdown {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Modal Footer Actions */
.modal-footer-executive {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 6px;
}

.modal-footer-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-dim);
}

.modal-footer-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-save-student {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: var(--radius-md);
}

@media (max-width: 640px) {
  .learner-photo-upload-card {
    flex-direction: column;
    text-align: center;
  }
  .photo-details-header {
    justify-content: center;
  }
  .photo-actions-row {
    justify-content: center;
  }
  .modal-footer-executive {
    flex-direction: column;
    align-items: stretch;
  }
  .modal-footer-btns {
    width: 100%;
    justify-content: space-between;
  }
  .modal-footer-btns button {
    flex: 1;
  }
}

/* Light Mode Overrides for Learner Modal */
html[data-theme="light"] .learner-photo-upload-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="light"] .modal-section-block {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="light"] .modal-header-executive {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, #ffffff 100%);
}

html[data-theme="light"] .optional-pill {
  background: #e2e8f0;
  color: #475569;
}

/* --------------------------------------------------------------------------
   15. OFFICIAL LEARNER CR80 ID PASS & THERMAL RECEIPT
   -------------------------------------------------------------------------- */
.profile-card-modal-content {
  padding: 24px;
}

.profile-header-strip h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 2px;
}

.profile-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}

.stat-box {
  background: var(--surface-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.stat-box small {
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: block;
}

.stat-box strong {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-heading);
  margin-top: 2px;
}

.profile-parent-strip {
  background: var(--surface-card-subtle);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  border: 1px solid var(--border-subtle);
}

.profile-parent-strip small {
  color: var(--text-dim);
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.profile-parent-strip strong {
  color: var(--text-heading);
  font-weight: 800;
}

.profile-parent-strip span {
  color: var(--primary-400);
  font-weight: 700;
}

.profile-qr-box {
  text-align: center;
  padding: 18px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-subtle);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.profile-qr-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #0f172a;
  margin-top: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

/* Authentic Thermal POS Paper Slip */
.thermal-receipt-paper {
  background: #ffffff;
  color: #0f172a;
  font-family: var(--font-mono);
  font-size: 12px;
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  margin-bottom: 16px;
  border: 1px solid #cbd5e1;
  position: relative;
}

.thermal-receipt-paper::before,
.thermal-receipt-paper::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background-size: 10px 4px;
}

.receipt-header-center {
  text-align: center;
  border-bottom: 1px dashed #94a3b8;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.receipt-school-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 900;
  display: block;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.receipt-sub-badge {
  display: inline-block;
  font-size: 11px;
  color: #475569;
  margin-bottom: 4px;
}

.receipt-meta-line {
  font-size: 11px;
  color: #64748b;
}

.receipt-details-block {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.receipt-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.receipt-financial-table {
  border-top: 1px dashed #94a3b8;
  border-bottom: 1px dashed #94a3b8;
  padding: 10px 0;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.receipt-fin-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.receipt-paid-row {
  font-weight: 800;
  font-size: 13.5px;
  color: #047857;
}

.receipt-balance-row {
  font-weight: 700;
  color: #b91c1c;
}

.receipt-footer-center {
  text-align: center;
  font-size: 11px;
  color: #64748b;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0d1629;
  color: #ffffff;
  border: 1.5px solid var(--primary-500);
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(37, 99, 235, 0.35);
  z-index: 10000;
  transform: translateY(60px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--ease-spring);
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   16. PRINT ENGINE SPECIFICATIONS
   -------------------------------------------------------------------------- */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .app-header,
  .app-nav,
  .mobile-nav-drawer,
  .mobile-nav-backdrop,
  .class-filter-bar,
  .pos-card,
  .card-toolbar,
  .tracking-control-panel,
  .reports-control-panel,
  .btn,
  .table-action-btns,
  .receipt-row-btn,
  #loginOverlay,
  .modal-header-bar button,
  #printReceiptModalBtn {
    display: none !important;
  }

  .app-main {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .page-view {
    display: block !important;
  }

  .card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .data-table th,
  .data-table td {
    color: #000000 !important;
    border-bottom: 1px solid #cccccc !important;
  }

  #receiptModal {
    position: static !important;
    transform: none !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto !important;
  }

  #receiptPrintArea {
    border: 1px solid #000000 !important;
  }
}

/* --------------------------------------------------------------------------
   17. RESPONSIVE BREAKPOINTS (ALL DEVICES & ORIENTATIONS)
   -------------------------------------------------------------------------- */
/* Large Screens (> 1200px) */
@media (min-width: 1201px) {
  .pos-layout {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

/* Laptops & Tablets Landscape (992px to 1200px) */
@media (max-width: 1200px) {
  .header-clock {
    display: none;
  }
  .pos-layout {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .pos-totals-panel {
    grid-template-columns: 1fr;
  }
  .kpi-grid,
  .audit-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablets Portrait (769px to 991px) */
@media (max-width: 991px) {
  .login-portal-card {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
  .login-hero-pane {
    display: none;
  }
  .pos-layout {
    grid-template-columns: 1fr;
  }
  .grid-2-custom {
    grid-template-columns: 1fr;
  }
}

/* Mobile Devices (< 768px) */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .app-header {
    padding: 8px 16px;
  }

  .mobile-hamburger-btn {
    display: flex;
  }

  .brand-text p {
    display: none;
  }

  .header-actions .cloud-pill,
  .header-actions .user-info-text,
  .header-actions .btn-logout {
    display: none !important;
  }

  /* Hide Desktop Nav on Mobile */
  .app-nav {
    display: none !important;
  }

  .app-main {
    margin-top: 14px;
    padding: 0 16px;
  }

  .view-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .view-title,
  .view-header h2 {
    font-size: 20px;
  }

  .learners-view-header {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-add-learner {
    width: 100%;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .pos-card {
    padding: 16px;
  }

  .kpi-grid,
  .audit-kpi-grid {
    grid-template-columns: 1fr;
  }

  .table-search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: 100%;
  }

  .tracking-toolbar-grid,
  .reports-toolbar-grid {
    flex-direction: column;
    align-items: stretch;
  }

  .tracking-actions-group,
  .reports-actions-group {
    width: 100%;
    justify-content: stretch;
  }

  .tracking-actions-group .btn,
  .reports-actions-group .btn {
    flex: 1;
  }

  .login-portal-card {
    border-radius: var(--radius-xl);
  }

  .login-form-pane {
    padding: 24px 20px;
  }

  .modal-dialog-box {
    width: 95vw;
    border-radius: var(--radius-xl);
  }

  .modal-form-body {
    padding: 18px 16px;
  }
}

/* Small Handhelds (< 480px) */
@media (max-width: 480px) {
  .fast-cash-chips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .cash-chip {
    text-align: center;
  }

  .pos-action-strip {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-pos-save {
    width: 100%;
  }
}
