/* =============================================================
   AI-Supported Attendance Management System
   Bestlink College of the Philippines
   Modern Design System — Tokens, Typography, Elevation & Glassmorphism
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* ── Color Tokens & Design System ─────────────────────────── */
:root {
  --color-primary:      #1e3b8a;
  --color-primary-600:  #1e3b8a;
  --color-primary-500:  #2563eb;
  --color-primary-400:  #38bdf8;
  --color-primary-hover: #172554;
  --color-primary-light: #dbeafe;

  --color-sky-500: #0ea5e9;
  --color-sky-400: #38bdf8;
  --color-sky-300: #7dd3fc;
  --color-sky-200: #bae6fd;
  --color-sky-100: #e0f2fe;

  --color-navy-950: #1e3b8a;
  --color-navy-900: #172554;
  --color-navy-800: #1e40af;
  --color-navy-700: #3b82f6;
  
  --color-blue-700: #1e3b8a;
  --color-blue-600: #2563eb;
  --color-blue-500: #3b82f6;
  --color-indigo-600: #1e3b8a;
  --color-emerald-600: #059669;
  --color-emerald-500: #10B981;
  --color-amber-500: #F59E0B;
  --color-rose-500: #F43F5E;
  --color-rose-600: #E11D48;

  --color-surface:      #f2f6fa;
  --color-surface-card: #FFFFFF;
  --color-border:       #E2E8F0;
  --color-border-light: #F1F5F9;

  --color-text-primary:   #0F172A;
  --color-text-secondary: #475569;
  --color-text-muted:     #94A3B8;

  --color-present: #10B981;
  --color-tardy:   #F59E0B;
  --color-absent:  #EF4444;
  --color-excused: #3B82F6;
  --color-no-data: #E2E8F0;

  /* Premium Elevation & Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 12px 28px -6px rgba(15, 23, 42, 0.08), 0 8px 12px -6px rgba(15, 23, 42, 0.04);
  --shadow-modal: 0 25px 60px -15px rgba(15, 23, 42, 0.25);
  --shadow-glow-teal: 0 0 25px -4px rgba(14, 165, 233, 0.4);
  --shadow-glow-blue: 0 0 25px -4px rgba(30, 59, 138, 0.4);
  --shadow-glow-emerald: 0 0 25px -4px rgba(16, 185, 129, 0.4);
  --shadow-glow-rose: 0 0 25px -4px rgba(244, 63, 94, 0.4);

  /* Layout Constants */
  --sidebar-width: 268px;
  --topbar-height: 64px;
}

/* ── Universal Brand Color Utilities & Explicit Utility Classes ── */
.bg-\[\#1e3b8a\],
[class~="bg-[#1e3b8a]"],
.bg-primary-blue {
  background-color: #1e3b8a !important;
}

.hover\:bg-\[\#172554\]:hover,
[class~="hover:bg-[#172554]"]:hover,
.bg-primary-blue-hover:hover {
  background-color: #172554 !important;
}

.hover\:bg-\[\#1e3b8a\]:hover,
[class~="hover:bg-[#1e3b8a]"]:hover {
  background-color: #1e3b8a !important;
}

.group:hover .group-hover\:bg-\[\#1e3b8a\] {
  background-color: #1e3b8a !important;
}

.group:hover .group-hover\:text-white {
  color: #ffffff !important;
}

.bg-\[\#0284c7\],
[class~="bg-[#0284c7]"],
.bg-sky-primary {
  background-color: #0284c7 !important;
}

.text-\[\#1e3b8a\],
[class~="text-[#1e3b8a]"],
.text-primary-blue {
  color: #1e3b8a !important;
}

.border-\[\#1e3b8a\],
[class~="border-[#1e3b8a]"],
.border-primary-blue {
  border-color: #1e3b8a !important;
}

/* ── App Layout Structure ──────────────────────────────────── */
.app-layout {
  display: flex !important;
  min-height: 100vh !important;
  width: 100% !important;
  background-color: var(--color-surface);
  position: relative;
}

.main-content {
  flex: 1 1 0% !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  background-color: var(--color-surface);
}

.page-body {
  flex: 1 1 0% !important;
  padding: 2rem 2.25rem !important;
  background-color: var(--color-surface);
}

@media (max-width: 768px) {
  .page-body {
    padding: 1.25rem 1rem !important;
  }
}

/* ── Glassmorphism Styles ─────────────────────────────────── */
.glass-panel {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.85);
}

.glass-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(51, 65, 85, 0.6);
}

h1, h2, h3, h4, h5, h6,
.font-display {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

/* ── Stat Number ──────────────────────────────────────────── */
.stat-number {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 1.1;
}

/* ── Elevation ────────────────────────────────────────────── */
.shadow-card  { box-shadow: var(--shadow-card); }
.shadow-modal { box-shadow: var(--shadow-modal); }

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  background: #1e3b8a !important;
  background-color: #1e3b8a !important;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.25s ease;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 40;
}

#sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  color: rgba(224, 242, 254, 0.85);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  position: relative;
}

#sidebar .nav-item:hover {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #FFFFFF !important;
}

#sidebar .nav-item.active {
  background: #0284c7 !important;
  background-color: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px -2px rgba(2, 132, 199, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

#sidebar .nav-item.active svg {
  color: #ffffff !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

#sidebar .nav-section {
  padding: 0.375rem 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #bae6fd;
  margin-top: 1rem;
}

#sidebar .nav-sub {
  padding-left: 2.25rem;
}

/* ── Topbar ───────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

/* ── Status Badges ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border-width: 1px;
  border-style: solid;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.badge-present { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.badge-tardy   { background: #FFFBEB; color: #B45309; border-color: #FDE68A; }
.badge-absent  { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.badge-excused { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.badge-pending { background: #F8FAFC; color: #475569; border-color: #E2E8F0; }
.badge-approved{ background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.badge-rejected{ background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.badge-high    { background: #FEF2F2; color: #991B1B; border-color: #F87171; box-shadow: 0 0 10px -2px rgba(239, 68, 68, 0.3); }
.badge-medium  { background: #FFFBEB; color: #B45309; border-color: #FDE68A; }
.badge-sent    { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
/* ── CSS Grid & Layout Utilities (Failsafe & Zero-dependency) ── */
.grid { display: grid !important; }
.grid-cols-1  { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
.grid-cols-2  { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.grid-cols-3  { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.grid-cols-4  { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)) !important; }

.col-span-1  { grid-column: span 1 / span 1 !important; }
.col-span-2  { grid-column: span 2 / span 2 !important; }
.col-span-3  { grid-column: span 3 / span 3 !important; }
.col-span-4  { grid-column: span 4 / span 4 !important; }
.col-span-6  { grid-column: span 6 / span 6 !important; }
.col-span-12 { grid-column: span 12 / span 12 !important; }

.gap-1   { gap: 0.25rem !important; }
.gap-1\.5 { gap: 0.375rem !important; }
.gap-2   { gap: 0.5rem !important; }
.gap-3   { gap: 0.75rem !important; }
.gap-4   { gap: 1rem !important; }
.gap-5   { gap: 1.25rem !important; }
.gap-6   { gap: 1.5rem !important; }

@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

@media (min-width: 768px) {
  .md\:grid-cols-2  { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .md\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)) !important; }
  .md\:col-span-6   { grid-column: span 6 / span 6 !important; }
  .md\:col-span-12  { grid-column: span 12 / span 12 !important; }
  .md\:flex-row     { flex-direction: row !important; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

/* ── Modern Buttons & Loading Effects ─────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.125rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.btn:active:not(:disabled):not(.is-loading) {
  transform: scale(0.97);
}

.btn:disabled,
.btn[disabled],
.btn.is-loading,
.btn[data-loading="true"] {
  opacity: 0.72;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Spinner Icon */
.btn-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.65s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}

@keyframes btn-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Ripple Click Wave Effect */
.btn-ripple-wave {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: btn-ripple-anim 0.55s ease-out;
  background-color: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.btn-secondary .btn-ripple-wave,
.btn-ghost .btn-ripple-wave {
  background-color: rgba(15, 23, 42, 0.12);
}

@keyframes btn-ripple-anim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.btn-primary {
  background-color: #1e3b8a;
  background: #1e3b8a;
  color: #FFFFFF;
  border-color: #1e3b8a;
  box-shadow: 0 2px 8px -2px rgba(30, 59, 138, 0.4);
}
.btn-primary:hover {
  background-color: #172554;
  background: #172554;
  border-color: #172554;
  box-shadow: 0 4px 14px -3px rgba(30, 59, 138, 0.5);
}

.btn-secondary {
  background: #FFFFFF;
  color: #1E293B;
  border-color: #CBD5E1;
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
  color: #0F172A;
}

.btn-danger {
  background-color: #ef4444;
  background: #ef4444;
  color: #FFFFFF;
  border-color: #ef4444;
  box-shadow: 0 2px 8px -2px rgba(239, 68, 68, 0.4);
}
.btn-danger:hover {
  background-color: #dc2626;
  background: #dc2626;
  border-color: #dc2626;
  box-shadow: 0 4px 14px -3px rgba(239, 68, 68, 0.5);
}

.btn-ghost {
  background: transparent;
  color: #1e3b8a;
}
.btn-ghost:hover {
  background: #eff6ff;
  color: #172554;
}

.btn-sm  { padding: 0.35rem 0.85rem; font-size: 0.8125rem; border-radius: 0.5rem; }
.btn-lg  { padding: 0.75rem 1.625rem; font-size: 1rem; border-radius: 0.75rem; }

/* ── Modern Form Fields ──────────────────────────────────── */
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  border: 1px solid #CBD5E1;
  border-radius: 0.625rem;
  padding: 0.6rem 0.875rem;
  font-size: 0.875rem;
  color: #0F172A;
  background: #FFFFFF;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-input:hover {
  border-color: #94A3B8;
}

.form-input:focus {
  border-color: #1e3b8a;
  box-shadow: 0 0 0 3px rgba(30, 59, 138, 0.18);
  background-color: #FFFFFF;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.form-error  { font-size: 0.75rem; color: #DC2626; margin-top: 0.25rem; font-weight: 500; }
.form-helper { font-size: 0.75rem; color: #64748B; margin-top: 0.25rem; }

/* ── Modal & Backdrops ───────────────────────────────────── */
#modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: modalFadeIn 0.2s ease-out;
}

#modal-backdrop.hidden {
  display: none !important;
}

.modal-box {
  background: #FFFFFF;
  border-radius: 1rem;
  box-shadow: var(--shadow-modal);
  border: 1px solid rgba(226, 232, 240, 0.9);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Modern Data Tables ──────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  background: #F8FAFC;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #E2E8F0;
  white-space: nowrap;
}

.data-table td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover td {
  background-color: #F8FAFC;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ── Award Card ───────────────────────────────────────────── */
.award-card {
  border:1px solid #fde68a;
  border-top:4px solid #d97706;
  background:#fffbeb;
  border-radius:0.5rem;
  padding:1.25rem;
  box-shadow: var(--shadow-card);
}

/* ── Slide Panel (Excuse Review) ─────────────────────────── */
#slide-panel {
  position:fixed;
  top:0; right:0;
  height:100vh;
  width:420px;
  background:#fff;
  box-shadow: var(--shadow-modal);
  z-index:40;
  transform:translateX(100%);
  transition:transform 0.25s ease;
  overflow-y:auto;
  padding:1.5rem;
}
#slide-panel.open { transform:translateX(0); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width:1023px) {
  #sidebar {
    position:fixed;
    top:0; left:0;
    height:100vh;
    z-index:50;
    transform:translateX(-100%);
  }
  #sidebar.open { transform:translateX(0); }
  #sidebar-overlay {
    display:none;
    position:fixed; inset:0;
    background:rgba(0,0,0,0.4);
    z-index:49;
  }
  #sidebar-overlay.open { display:block; }
}

/* ── Reduced Motion ───────────────────────────────────────── */
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { transition:none !important; animation:none !important; }
}

/* ── Universal Backdrop Blur Utilities ───────────────────── */
.backdrop-blur-xs {
  backdrop-filter: blur(2px) !important;
  -webkit-backdrop-filter: blur(2px) !important;
}
.backdrop-blur-sm {
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}
.backdrop-blur {
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}
.backdrop-blur-md {
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}
.backdrop-blur-lg {
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

/* ── Universal Confirmation Modal Supreme Front & Full-Window Blur ──── */
#global-confirm-modal {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  background-color: rgba(15, 23, 42, 0.72) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

#confirm-modal-box {
  position: relative !important;
  z-index: 1000000 !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15) !important;
}

/* Blur the header/navbar, sidebar, and whole application layout behind modal */
body.confirm-modal-open {
  overflow: hidden !important;
}

body.confirm-modal-open .app-layout,
body.confirm-modal-open #topbar,
body.confirm-modal-open #sidebar,
body.confirm-modal-open .main-content,
body.confirm-modal-open .page-body {
  filter: blur(6px) !important;
  -webkit-filter: blur(6px) !important;
  transition: filter 0.25s ease-out !important;
  pointer-events: none !important;
  user-select: none !important;
}

/* Ensure modal contents and toast notifications remain razor-sharp */
#global-confirm-modal,
#global-confirm-modal *,
#sonner-toast-container,
#sonner-toast-container * {
  filter: none !important;
  -webkit-filter: none !important;
}

/* ── Global Loading Screen (Preloader & Screen Transitions) ──── */
.global-preloader {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s ease-out;
  background-color: #090e17 !important;
}

.global-preloader.preloader-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.loader-progress-bar-shimmer {
  width: 50%;
  animation: loaderShimmer 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes loaderShimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(300%);
  }
}

/* ── Dynamic Anti-Screenshot QR Blurry Loading Overlay ─────── */
.qr-card-blur-overlay {
  background-color: rgba(255, 255, 255, 0.86) !important;
  backdrop-filter: blur(8px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(8px) saturate(180%) !important;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s ease;
  pointer-events: auto;
}

.qr-card-blur-overlay.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ── Alignment Utilities ──────────────────────────────────── */
.text-center { text-align: center !important; }
.text-left   { text-align: left !important; }
.text-right  { text-align: right !important; }

/* ── 5-Column Responsive KPI Grid ─────────────────────────── */
.kpi-row-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.875rem;
}

@media (max-width: 1100px) {
  .kpi-row-5 {
    gap: 0.625rem;
  }
}

@media (max-width: 900px) {
  .kpi-row-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
  }
}

@media (max-width: 640px) {
  .kpi-row-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
  }
}

@media (max-width: 420px) {
  .kpi-row-5 {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* ── SPA Router — Top Progress Bar ─────────────────────────── */
#spa-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  height: 3px;
  width: 0%;
  opacity: 0;
  background: linear-gradient(90deg, #2563eb 0%, #38bdf8 50%, #14b8a6 100%);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.6), 0 0 4px rgba(20, 184, 166, 0.4);
  pointer-events: none;
  transition: width 0.25s ease, opacity 0.3s ease;
}

/* ── SPA Navigation Page Blur Transition ─────────────────── */
.spa-page-blur-overlay {
  position: fixed;
  inset: 0;
  background: rgba(241, 245, 249, 0.4);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 99998;
  opacity: 0;
  pointer-events: all;
  animation: spaBlurFadeIn 0.12s ease forwards;
}

@keyframes spaBlurFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

main.spa-loading-blur {
  filter: blur(4px);
  opacity: 0.7;
  pointer-events: none;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

/* Main content fade transition on SPA swap */
main {
  position: relative;
  transition: opacity 0.18s ease, filter 0.18s ease;
}

/* Tooltip hover helper */
.group\/tooltip:hover > div,
[class*="group/tooltip"]:hover > div {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Dropzone hover transition */
#dropzone-area {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#dropzone-area:hover {
  border-color: #1e3b8a !important;
  background-color: rgba(239, 246, 255, 0.6) !important;
  transform: translateY(-1px);
}

/* ── Stepper & Flex Helpers ────────────────────────────────── */
.justify-between,
[class*="justify-between"] {
  justify-content: space-between !important;
}

.stepper-flex-between {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  gap: 1rem !important;
}

/* ── Form Row Layout Helpers for Import Roster & Forms ─────── */
.step1-grid {
  display: grid !important;
  grid-template-columns: 1.35fr 1fr !important;
  gap: 1.5rem !important;
  align-items: start !important;
  width: 100% !important;
}
.step1-grid > * {
  width: 100% !important;
  min-width: 0 !important;
}

@media (max-width: 1024px) {
  .step1-grid {
    grid-template-columns: 1fr !important;
  }
}

.form-row-2 {
  display: flex !important;
  flex-direction: row !important;
  gap: 1rem !important;
  width: 100% !important;
}
.form-row-2 > * {
  flex: 1 1 0% !important;
  min-width: 0 !important;
}

.form-row-code-title {
  display: flex !important;
  flex-direction: row !important;
  gap: 1rem !important;
  width: 100% !important;
}
.form-row-code-title > .col-code {
  flex: 0 0 35% !important;
  max-width: 35% !important;
  min-width: 0 !important;
}
.form-row-code-title > .col-title {
  flex: 1 1 0% !important;
  min-width: 0 !important;
}

.form-row-3 {
  display: flex !important;
  flex-direction: row !important;
  gap: 1rem !important;
  width: 100% !important;
}
.form-row-3 > * {
  flex: 1 1 0% !important;
  min-width: 0 !important;
}

@media (max-width: 640px) {
  .form-row-2,
  .form-row-code-title,
  .form-row-3 {
    flex-direction: column !important;
    gap: 0.875rem !important;
  }
  .form-row-code-title > .col-code,
  .form-row-code-title > .col-title {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
}


