/* ==========================================================================
   CSS CUSTOM VARIABLES & COLOR SCHEME DESIGN
   ========================================================================== */

/* Global base variables */
:root {
  --font-family: 'Outfit', sans-serif;
  --transition-smooth: background 0.12s ease-out, border-color 0.12s ease-out, color 0.12s ease-out, opacity 0.12s ease-out, transform 0.12s ease-out, box-shadow 0.12s ease-out;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  --sidebar-width: 280px;

  /* Safe area insets for mobile APK (status bar, notch, nav bar) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Global Success/Warning states */
  --color-success: HSL(142, 70%, 45%);
  --color-warning: HSL(38, 92%, 50%);
  --color-error: HSL(350, 89%, 60%);
  --color-info: HSL(199, 89%, 48%);
}

/* Default / Neutral Portal Theme & Enforced Unified Design System */
.theme-default,
.theme-sch001,
.theme-sch002,
.theme-sch003,
.theme-all,
:root {
  --primary-hue: 220;
  --primary-sat: 76%;
  --primary-lightness: 52%;
  --accent-hue: 195;
  --accent-sat: 90%;
  --accent-lightness: 42%;
  --bg-gradient-start: #0a0e17;
  --bg-gradient-end: #101524;
}

/* Semantic helper properties calculated from dynamic HSL */
body {
  --primary: #236fe1;
  --primary-hover: #1753bb;
  --accent: #0a3bae;

  /* Glassmorphism Surface Variables (Dark Premium aesthetic) */
  --bg-surface: rgba(17, 24, 39, 0.55);
  --bg-sidebar: rgba(13, 17, 28, 0.75);
  --bg-card: rgba(30, 41, 59, 0.35);
  --bg-modal: rgba(15, 23, 42, 0.85);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(255, 255, 255, 0.02);
  --text-main: #ffffff;
  --text-muted: #e2e8f0;
  /* WCAG AA: raised from #94a3b8 → #e2e8f0 for ≥4.5:1 contrast */
  --text-inverse: #0f172a;
}

/* ==========================================================================
   BASE STYLES & RESET
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-gradient-end);
  background-image: radial-gradient(circle at 50% 0%, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  background-repeat: no-repeat;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  transition: var(--transition-smooth);
}

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

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

/* Global Lucide SVG sizing fallback to prevent collapse inside flexboxes/resets */
svg.lucide,
svg[class*="lucide-"] {
  width: 16px;
  height: 16px;
  min-width: 14px;
  min-height: 14px;
  max-width: 100%;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  overflow: visible;
}

/* Pre-render <i> placeholder sizing */
i[data-lucide] {
  display: inline-block;
  width: 16px;
  height: 16px;
  max-width: 100%;
}



/* Custom Webkit scrollbar for premium feel */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   UTILITY CLASSES & ANIMATIONS
   ========================================================================== */
.hidden {
  display: none !important;
}

.col-span-2 {
  grid-column: span 2;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulseGlow {

  0%,
  100% {
    opacity: 0.25;
  }

  50% {
    opacity: 0.45;
  }
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 4px 14px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.35);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.45);
}

.btn-outline {
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1.5px);
}

.btn-danger-outline {
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.04);
  color: var(--color-error);
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--color-error);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
#login-container {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100000;
  background-color: #080c14;
  background-image: radial-gradient(circle at 50% 50%, #0f172a 0%, #080c14 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ==========================================================================
   LOGIN SCREEN (SABLE-BLUE RESPONSIVE REDESIGN)
   ========================================================================== */
.login-split-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
  background-color: #080c14;
}

/* --- PRESENTATION PANEL (Left Desktop, Top Background Mobile) --- */
.login-presentation {
  flex: 1.2;
  position: relative;
  background: linear-gradient(135deg, #090e1a 0%, #0f172a 60%, #1e293b 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 8%;
  overflow: hidden;
}

.presentation-bg-animated {
  position: absolute;
  top: -30%;
  left: -20%;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle at 30% 50%, rgba(37, 99, 235, 0.15), transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(59, 130, 246, 0.1), transparent 50%);
  z-index: 0;
  animation: slowPan 15s ease-in-out infinite alternate;
}

@keyframes slowPan {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.1) translate(-2%, 2%); }
}

.presentation-shapes .shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 1;
}

.shape-1 {
  width: 400px;
  height: 400px;
  background: rgba(37, 99, 235, 0.2);
  top: -100px;
  right: -100px;
}

.shape-2 {
  width: 300px;
  height: 300px;
  background: rgba(29, 78, 216, 0.15);
  bottom: -50px;
  left: -50px;
}

.presentation-content {
  position: relative;
  z-index: 5;
  max-width: 520px;
}

.presentation-logo {
  display: inline-flex;
  align-items: center;
  margin-bottom: 40px;
}

.presentation-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 40%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.presentation-subtitle {
  font-size: 1.15rem;
  color: #94a3b8;
  line-height: 1.6;
}

/* --- INTERACTION PANEL (Right Desktop, Bottom Sheet Mobile) --- */
.login-interaction {
  flex: 1;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(24px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 10;
  padding: 40px 20px;
  overflow-y: auto;
}

.interaction-card {
  width: 100%;
  max-width: 440px;
  padding: 44px 40px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.mobile-drag-handle {
  display: none;
}

.interaction-header {
  margin-bottom: 32px;
}

.interaction-heading {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.interaction-subheading {
  color: #94a3b8;
  font-size: 0.95rem;
}

.interaction-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group-modern {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group-modern label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
}

.input-modern-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  color: #64748b;
  pointer-events: none;
  transition: color 0.2s;
}

.input-modern-wrapper input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 48px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  transition: all 0.2s;
}

.input-modern-wrapper input:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
  outline: none;
}

.input-modern-wrapper input:focus~.input-icon {
  color: #3b82f6;
}

.toggle-pwd-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
}

.toggle-pwd-btn:hover {
  color: #cbd5e1;
}

.btn-modern-primary {
  height: 52px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-modern-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
}

.quick-login-divider {
  display: flex;
  align-items: center;
  margin: 24px 0 14px 0;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: center;
}

.quick-login-divider::before,
.quick-login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.quick-login-divider span {
  padding: 0 12px;
}

.quick-login-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.quick-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.quick-login-btn svg,
.quick-login-btn i {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
}

.quick-login-btn:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.4);
  color: #ffffff;
}

.quick-login-btn:active {
  transform: scale(0.96);
  background: rgba(37, 99, 235, 0.2);
}

.interaction-footer {
  margin-top: 32px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

.modern-install-btn {
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #c8d6e8;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.modern-install-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.mobile-brand-header {
  display: none;
}

/* ==========================================================================
   MOBILE LOGIN LAYOUT OVERRIDES (MINIMALIST CARD STYLE)
   ========================================================================== */
@media (max-width: 1100px) {
  .login-split-wrapper {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #080c14;
    background-image: radial-gradient(circle at 50% 30%, #0f172a 0%, #080c14 90%);
    padding: 10px 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .login-presentation {
    display: none;
  }

  .login-interaction {
    flex: none;
    width: 100%;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    margin: 0 auto;
    max-width: 440px;
  }

  .interaction-card {
    padding: 20px 16px;
  }

  .mobile-drag-handle {
    display: none;
  }

  .mobile-brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 8px;
  }

  .mobile-logo-circle {
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
  }

  .mobile-logo-circle svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
  }

  .interaction-header {
    text-align: center;
    margin-bottom: 12px;
  }

  .interaction-heading {
    font-size: 1.45rem;
    margin-bottom: 2px;
  }

  .interaction-subheading {
    font-size: 0.82rem;
  }

  .interaction-form {
    gap: 12px;
  }

  .form-group-modern {
    gap: 4px;
  }

  .input-modern-wrapper input {
    height: 44px;
    font-size: 0.9rem;
  }

  .btn-modern-primary {
    height: 44px;
    font-size: 0.95rem;
    margin-top: 4px;
  }

  .quick-login-divider {
    margin: 12px 0 8px 0;
    font-size: 0.68rem;
  }

  .quick-login-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar for a cleaner look */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .quick-login-grid::-webkit-scrollbar {
    display: none;
  }

  .quick-login-btn {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 6px 14px;
    font-size: 0.75rem;
    min-height: 38px;
    white-space: nowrap;
  }

  .interaction-footer {
    margin-top: 12px !important;
    padding: 12px 0 4px !important;
  }
}

@media (max-width: 480px) {
  .login-split-wrapper {
    padding: 8px;
  }

  .login-interaction {
    border-radius: 16px;
    max-width: 100%;
  }

  .interaction-card {
    padding: 16px 12px;
  }
}

@media (max-width: 1199px) {
  .interaction-card {
    padding: 24px 20px;
  }
  
  .interaction-header {
    margin-bottom: 20px;
  }
  
  .interaction-form {
    gap: 16px;
  }

  .quick-login-divider {
    margin: 20px 0;
  }

  .interaction-footer {
    margin-top: 24px;
  }
}

/* Bulk Status Updates */
#upload-logs {
  font-family: monospace;
  font-size: 0.8rem;
  color: #94a3b8;
}

/* --- ATTENDANCE SEGMENTED CONTROLS --- */
.att-radio-wrapper {
  cursor: pointer;
  display: inline-flex;
}

.hidden-radio {
  display: none;
}

.att-lbl {
  padding: 6px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
  user-select: none;
}

.att-radio-wrapper:hover .att-lbl {
  border-color: var(--text-muted);
}

.hidden-radio:checked+.att-present-lbl {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border-color: #16a34a;
}

.hidden-radio:checked+.att-absent-lbl {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-color: #dc2626;
}

.hidden-radio:checked+.att-sa-lbl {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border-color: #2563eb;
}

/* --- DASHBOARD GRIDS --- */
.dashboard-grid-1-2,
.dashboard-grid-2-1,
.dashboard-grid-3-2 {
  display: grid;
  gap: 24px;
  margin-bottom: 24px;
  grid-template-columns: 1fr;
}

@media (min-width: 992px) {
  .dashboard-grid-1-2 {
    grid-template-columns: 1fr 2fr;
  }

  .dashboard-grid-2-1 {
    grid-template-columns: 2fr 1fr;
  }

  .dashboard-grid-3-2 {
    grid-template-columns: 3fr 2fr;
  }
}

/* ==========================================================================
   MAIN APP GRID LAYOUT
   ========================================================================== */
#app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  animation: fadeIn 0.4s ease-out;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  backdrop-filter: blur(25px);
  display: flex;
  flex-direction: column;
  padding: calc(18px + var(--safe-top)) 16px 18px calc(16px + var(--safe-left));
  z-index: 90000;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  margin-bottom: 20px;
}

.school-branding {
  display: flex;
  align-items: center;
  gap: 12px;
}

.school-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.school-info h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

#school-id-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: hsla(var(--accent-hue), var(--accent-sat), var(--accent-lightness), 0.1);
  padding: 1px 6px;
  border-radius: 4px;
}

.sidebar-nav {
  flex-grow: 1;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  margin-right: -4px;
  padding-right: 4px;
}

.sidebar-nav::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.nav-link svg {
  transition: var(--transition-smooth);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link[title="Sign Out"]:hover,
#mob-nav-logout:hover {
  color: var(--color-error) !important;
  background: rgba(239, 68, 68, 0.08) !important;
}

.nav-link[title="Sign Out"]:hover svg,
#mob-nav-logout:hover svg {
  color: var(--color-error) !important;
  opacity: 1 !important;
}

.nav-link.active {
  background: hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.1);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.nav-link.active svg {
  color: var(--primary);
}

/* Sidebar Collapsed State (Desktop) */
/* Sidebar Collapsed State (Desktop) */
@media (min-width: 901px) {
  .sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
  }

  .sidebar .school-info,
  .sidebar .nav-link span,
  .sidebar .user-details,
  .sidebar #logout-btn span {
    transition: opacity 0.2s ease, max-width 0.2s ease, margin 0.2s ease;
    opacity: 1;
    max-width: 200px;
    overflow: hidden;
    display: inline-block;
    white-space: nowrap;
    vertical-align: middle;
  }

  .sidebar.collapsed {
    width: 88px;
    padding: 24px 16px;
  }

  .sidebar.collapsed .school-info,
  .sidebar.collapsed .nav-link span,
  .sidebar.collapsed .user-details,
  .sidebar.collapsed #logout-btn span {
    display: none !important;
  }

  .sidebar.collapsed .sidebar-header {
    justify-content: center;
  }

  .sidebar.collapsed .school-logo {
    margin: 0 auto;
    width: 58px !important;
    height: 58px !important;
  }

  .sidebar.collapsed .school-logo img {
    width: 58px !important;
    height: auto !important;
  }

  .sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
    gap: 0;
  }

  .sidebar.collapsed .nav-link svg {
    margin: 0;
  }

  .sidebar.collapsed .user-profile-badge {
    justify-content: center;
  }

  .sidebar.collapsed #logout-btn {
    padding: 10px;
    justify-content: center;
  }


}

/* Floating Desktop Toggle Button */
.sidebar-collapse-toggle {
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100000;
  color: var(--text-muted);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  transition: all 0.2s ease;
  padding: 0;
  outline: none;
}

.sidebar-collapse-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transform: translateY(-50%) scale(1.05);
}

.sidebar-collapse-toggle:active {
  transform: translateY(-50%) scale(0.95);
}

.sidebar-collapse-toggle svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.sidebar.collapsed .sidebar-collapse-toggle svg {
  transform: rotate(180deg);
}

@media (max-width: 900px) {
  .sidebar-collapse-toggle {
    display: none !important;
  }
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 0 10px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.3);
}

.user-details h4 {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

#user-role-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Main Viewport styling */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.content-header {
  padding: calc(10px + var(--safe-top)) calc(20px + var(--safe-right)) 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  background: rgba(15, 23, 42, 0.2);
  flex-shrink: 0;
  width: 100%;
  z-index: 1000;
  position: sticky;
  top: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, opacity 0.3s ease;
}

.content-header.header-shrunk {
  padding-top: calc(6px + var(--safe-top));
  padding-bottom: 6px;
  padding-left: 16px;
  padding-right: calc(16px + var(--safe-right));
  background: rgba(15, 23, 42, 0.95) !important;
}

.content-header.header-hidden {
  transform: translateY(-100%) translateY(-5px);
  opacity: 0;
  pointer-events: none;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

.header-left h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.header-left p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.api-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.online {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

.status-indicator.mock {
  background: var(--color-warning);
  box-shadow: 0 0 8px var(--color-warning);
}

.view-viewport {
  padding: 40px;
  flex-grow: 1;
}

/* view-panel styles are defined in the SMOOTH PAGE TRANSITIONS section below */
/* ==========================================================================
   UNIVERSAL SHARED COMPONENTS (Metric Grid, Section Cards, List Rows)
   — works on ALL screen sizes, not just mobile
   ========================================================================== */

.mobile-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.mobile-metric-card {
  background: rgba(22, 30, 50, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 120px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

.mobile-metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.mobile-metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.5) 50%, transparent 100%);
  border-radius: 16px 16px 0 0;
}

.mobile-metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.15);
  border: 1px solid hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.mobile-metric-card:hover .mobile-metric-icon {
  background: hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.22);
}

.mobile-metric-icon svg,
.mobile-metric-icon i {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  max-width: 100%;
  stroke: var(--primary);
  filter: drop-shadow(0 0 6px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.4));
}

.mobile-metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 5px;
}

.mobile-metric-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Attendance status color variants */
.mobile-metric-card.status-present .mobile-metric-icon {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

.mobile-metric-card.status-present .mobile-metric-icon svg {
  stroke: #10b981;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.4));
}

.mobile-metric-card.status-present .mobile-metric-value {
  color: #10b981;
}

.mobile-metric-card.status-absent .mobile-metric-icon {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.mobile-metric-card.status-absent .mobile-metric-icon svg {
  stroke: #ef4444;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.4));
}

.mobile-metric-card.status-absent .mobile-metric-value {
  color: #ef4444;
}

/* Section Cards */
.mobile-section-card {
  background: rgba(22, 30, 50, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mobile-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-section-title svg,
.mobile-section-title i {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  max-width: 100%;
  stroke: var(--primary);
}

.mobile-section-body {
  padding: 0;
}

.mobile-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
  gap: 12px;
}

.mobile-list-row:last-child {
  border-bottom: 0;
}

.mobile-list-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.mobile-list-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.mobile-list-primary {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-list-secondary {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mobile-list-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Quick Action Buttons */
.mobile-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.mobile-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  border-radius: 12px;
  background: hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.1);
  border: 1px solid hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.18);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-action-btn:hover {
  background: hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.2);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.mobile-action-btn svg,
.mobile-action-btn i {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  max-width: 100%;
  flex-shrink: 0;
}

/* Status Pills */
.att-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.att-pill.present {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.att-pill.absent {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.att-pill.late {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Tablet: 2-column metric grid */
@media (max-width: 1024px) {
  .mobile-metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .mobile-quick-actions {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   PANEL LAYOUTS AND CONTAINER CARDS
   ========================================================================== */
.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-bottom: 24px;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.panel-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

/* Grids and Stats Panels */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.stat-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==========================================================================
   ROLE-SPECIFIC COMPONENT LAYOUTS
   ========================================================================== */

/* 1. Student Dashboard Progress Rings / SVG Charts */
.student-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .student-grid {
    grid-template-columns: 1fr;
  }
}

.gpa-card {
  background: linear-gradient(135deg, hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.12) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.15);
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 30px;
}

.gpa-radial {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gpa-radial svg {
  transform: rotate(-90deg);
}

.gpa-radial circle {
  fill: none;
  stroke-width: 8;
}

.gpa-radial .bg {
  stroke: rgba(255, 255, 255, 0.05);
}

.gpa-radial .progress {
  stroke: var(--primary);
  stroke-dasharray: 251.2;
  stroke-dashoffset: calc(251.2 - (251.2 * var(--percent)) / 100);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease-in-out;
}

.gpa-radial .gpa-val {
  position: absolute;
  font-size: 1.5rem;
  font-weight: 800;
}

.gpa-info h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

/* GPA Calculator Component */
.calc-card h4 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.calc-slider-group {
  margin-top: 15px;
}

.calc-slider-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 12px;
}

.calc-slider-item label {
  font-size: 0.85rem;
  width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-slider-item input[type="range"] {
  flex-grow: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  accent-color: var(--primary);
  cursor: pointer;
}

.calc-result-pill {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 15px;
  border-radius: var(--border-radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  font-weight: 600;
  border: 1px solid var(--border-color);
}

/* 2. Parent view Children Feed & Timeline */
.parent-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.child-section-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.timeline-feed {
  position: relative;
  padding-left: 24px;
  margin-top: 20px;
}

.timeline-feed::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  width: 2px;
  height: calc(100% - 20px);
  background: rgba(255, 255, 255, 0.08);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-marker {
  position: absolute;
  top: 6px;
  left: -24px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-gradient-end);
  box-shadow: 0 0 8px var(--accent);
}

.timeline-item.excellent .timeline-marker {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

.timeline-content {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 16px 20px;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.timeline-subject {
  font-size: 0.95rem;
  font-weight: 700;
}

.timeline-score {
  font-weight: 800;
  background: rgba(255, 255, 255, 0.03);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.timeline-body {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-top: 10px;
  text-align: right;
}

/* ==========================================================================
   TABLE GRID CONTAINERS
   ========================================================================== */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 16px 20px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
}

th {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.01);
}

tr {
  transition: background var(--transition-smooth);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

/* Badges inside tables */
.badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-active,
.badge-admin {
  background: rgba(34, 197, 94, 0.1);
  color: var(--color-success);
}

.badge-suspended,
.badge-teacher {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
}

.badge-graduated,
.badge-parent {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-info);
}

.badge-student {
  background: rgba(234, 179, 8, 0.1);
  color: var(--color-warning);
}

/* Action controls in table rows */
.table-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon-edit {
  color: var(--color-info);
}

.btn-icon-delete {
  color: var(--color-error);
}

/* Spinner and Loaders */
.spinner-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 50px 0;
  width: 100%;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.06);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   MODAL WINDOWS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.7);
  backdrop-filter: blur(8px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  opacity: 1;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: var(--bg-modal);
  backdrop-filter: blur(25px);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg), 0 0 50px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.1);
  border-radius: var(--border-radius-md);
  width: 100%;
  max-width: 600px;
  padding: 30px;
  animation: scaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close-btn {
  font-size: 1.8rem;
  font-weight: 300;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  color: var(--text-main);
}

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

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.col-span-2 {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .col-span-2 {
    grid-column: span 1;
  }
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.label-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: none;
  font-weight: normal;
}

/* ==========================================================================
   RESPONSIVE DESIGN (GLOBAL)
   ========================================================================== */
@media (max-width: 768px) {
  .content-header {
    padding: 20px;
  }

  .view-viewport {
    padding: 20px;
  }

  .panel-card {
    padding: 20px;
  }

  th,
  td {
    padding: 12px 14px;
  }
}

/* ==========================================================================
   ACADEMIC SETUP & IMPORT STYLE ADDITIONS
   ========================================================================== */
.setup-tabs-header .btn-outline {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.setup-tabs-header .btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.setup-tabs-header .btn-outline.active-tab {
  background: hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.15) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  box-shadow: 0 0 10px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.15);
}

.setup-tab-panel {
  animation: fadeIn 0.35s ease-out;
}

.setup-tab-panel.hidden {
  display: none !important;
}

.import-upload-zone:hover {
  border-color: var(--primary) !important;
  background: rgba(255, 255, 255, 0.03) !important;
  box-shadow: 0 0 20px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.1);
}

.import-upload-zone svg {
  transition: var(--transition-smooth);
}

.import-upload-zone:hover svg {
  transform: translateY(-2px);
  color: var(--primary-hover);
}

#import-error-console {
  background: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.1);
}

.badge-sa {
  background: rgba(234, 88, 12, 0.1) !important;
  color: var(--color-warning) !important;
}

/* ==========================================================================
   ADVANCED SAAS & ERP DESIGN ADDITIONS
   ========================================================================== */

/* Universal Search & Command Palette */
.header-center {
  flex: 1;
  max-width: 420px;
  margin: 0 24px;
}

.universal-search-container {
  position: relative;
  width: 100%;
}

#universal-search-input {
  width: 100%;
  padding: 10px 60px 10px 45px !important;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  transition: all 0.25s ease;
}

#universal-search-input:focus {
  outline: none;
  background: rgba(15, 23, 42, 0.8);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.15);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.25s ease;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
}


#universal-search-input:focus+.search-icon {
  color: var(--primary);
}

.search-kbd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
  text-transform: uppercase;
  font-weight: 700;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  max-height: 320px;
  overflow-y: auto;
  z-index: 1000;
  animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.search-result-item:hover .search-item-title {
  color: var(--primary) !important;
}

/* Step-by-Step Wizard */
.wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.wizard-step.active {
  opacity: 1;
}

.wizard-step .step-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.wizard-step.active .step-icon {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 0 12px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.4);
}

.wizard-step .step-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.wizard-step.active .step-title {
  color: var(--primary);
}

.wizard-connector {
  flex-grow: 1;
  height: 2px;
  background: var(--border-color);
  margin: 0 12px;
  transform: translateY(-12px);
}

.wizard-section {
  display: none;
}

.wizard-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.review-panel-summary {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 20px;
}

.review-table {
  width: 100%;
  border-collapse: collapse;
}

.review-table td {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  font-size: 0.88rem;
}

.review-table tr:last-child td {
  border-bottom: none;
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   18. NEW ER-LEVEL COMPONENT STYLING (TEACHERS DIRECTORY & CLASS HUB)
   ========================================================================== */

/* Badge categories */
.badge-grade {
  background: rgba(14, 165, 233, 0.15);
  color: #0ea5e9;
  border: 1px solid rgba(14, 165, 233, 0.3);
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
}

/* Modal form assignment containers */
#hire-teacher-assignments-container span {
  animation: fadeIn 0.25s ease;
}

/* Table overrides and spacing inside modals */
#class-hub-students-body tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

#class-hub-teachers-list div {
  animation: fadeIn 0.25s ease;
  transition: var(--transition-smooth);
}

#class-hub-teachers-list div:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.15);
}

/* ==========================================================================
   19. RESPONSIVENESS & UI POLISH (PHASE 3)
   ========================================================================== */

/* Clickable Table Rows */
.clickable-row {
  transition: var(--transition-smooth);
}

.clickable-row:hover {
  background-color: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Responsive Grid / Flex Adjustments */


@media screen and (max-width: 768px) {
  .student-profile-info {
    grid-template-columns: 1fr !important;
  }

  .universal-search-container {
    display: flex;
    margin-top: 8px;
    width: 100%;
  }

  .header-center {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .table-container {
    overflow-x: auto;
  }

  /* Modals should take full width */
  .modal-content {
    width: 95%;
    margin: 2% auto;
    padding: 1.5rem;
  }

  .wizard-steps {
    flex-direction: column;
    gap: 10px;
  }

  .login-card-wrapper {
    padding: 10px;
  }

  .login-card {
    padding: 24px;
  }

  .login-title {
    font-size: 1.8rem;
  }
}

/* ==========================================================================
   14. MASTER GLOBAL DASHBOARD DESIGN SYSTEM
   ========================================================================== */

/* Progress Bar container for average grades */
.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar-outer {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Color codes based on averages */
.avg-excellent {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.avg-good {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.avg-warning {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.avg-danger {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.avg-text {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.school-summary-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-manage-context {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-manage-context:hover {
  background: var(--primary);
  color: white !important;
  border-color: var(--primary);
}

/* Grid layout for Dashboard logs and stats */
.global-dashboard-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

@media (max-width: 1024px) {
  .global-dashboard-layout {
    grid-template-columns: 1fr;
  }
}

.audit-stream-item {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  transition: background 0.2s;
}

.audit-stream-item:last-child {
  border-bottom: none;
}

.badge-school-tag {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--accent);
}

/* Custom Styles for Form Controls & Badges in Centralized Views */
.form-control {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-main);
  transition: var(--transition-smooth);
}

@media (max-width: 900px) {
  /* Sidebar: always off-canvas via transform. NEVER set display:none here. */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    width: var(--sidebar-width) !important;
    z-index: 99980 !important;
    transform: translateX(-110%) !important;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.6);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .sidebar.sidebar-open {
    transform: translateX(0) !important;
  }

  /* App container: always stays as row — sidebar is fixed overlay */
  #app-container {
    flex-direction: row !important;
  }

  /* Main content takes full width since sidebar is out of flow */
  .main-content {
    width: 100% !important;
    min-width: 0 !important;
  }

  .dashboard-grid,
  .global-dashboard-layout {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   PREMIUM TOAST NOTIFICATION SYSTEM
   ========================================================================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2147483647 !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 420px;
  width: 100%;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  color: #fff;
  font-weight: 500;
  font-size: 0.88rem;
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-visible {
  transform: translateX(0);
  opacity: 1;
}

.toast-exit {
  transform: translateX(120%) !important;
  opacity: 0 !important;
}

.toast-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.92), rgba(5, 150, 105, 0.92));
}

.toast-error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.92), rgba(220, 38, 38, 0.92));
}

.toast-info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.92), rgba(37, 99, 235, 0.92));
}

.toast-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.92), rgba(217, 119, 6, 0.92));
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-message {
  line-height: 1.4;
  display: block;
}

.toast-close {
  flex-shrink: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  padding: 6px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  pointer-events: auto;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
}

.toast-progress-bar {
  height: 100%;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 0 0 12px 12px;
  animation: toastCountdown 5s linear forwards;
}

@keyframes toastCountdown {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

/* ==========================================================================
   LOADING OVERLAY
   ========================================================================== */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 12, 22, 0.82);
  backdrop-filter: blur(15px) saturate(180%);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  z-index: 2147483646 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
}

.premium-spinner {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-ring {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid hsla(43, 96%, 56%, 0.4);
  border-radius: 50%;
  box-shadow: 0 0 20px hsla(263, 90%, 50%, 0.15);
  animation: pulse-ring-anim 2.4s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  opacity: 0;
}

.pulse-ring.delay-1 {
  animation-delay: 0.8s;
  border-color: hsla(263, 90%, 60%, 0.35);
}

.pulse-ring.delay-2 {
  animation-delay: 1.6s;
  border-color: hsla(195, 90%, 60%, 0.3);
}

.spinner-orbit {
  position: absolute;
  width: 90px;
  height: 90px;
  border: 1.5px dashed rgba(245, 158, 11, 0.35);
  border-radius: 50%;
  animation: spin-slow 10s linear infinite;
  pointer-events: none;
}

@keyframes spin-slow {
  100% {
    transform: rotate(360deg);
  }
}

.pulse-core {
  width: 58px;
  height: 58px;
  background: radial-gradient(circle, rgba(20, 26, 46, 0.95) 0%, rgba(10, 14, 26, 0.98) 100%);
  border: 2px solid hsla(43, 96%, 56%, 0.75);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.3), inset 0 0 12px rgba(245, 158, 11, 0.1);
  z-index: 2;
  animation: pulse-core-anim 2s ease-in-out infinite alternate;
}

.pulse-core svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 2px 5px rgba(245, 158, 11, 0.4));
}

@keyframes pulse-ring-anim {
  0% {
    transform: scale(0.5);
    opacity: 0.9;
  }

  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ==========================================================================
   SKELETON LOADERS
   ========================================================================== */
.skeleton {
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.03) 25%,
      rgba(255, 255, 255, 0.08) 50%,
      rgba(255, 255, 255, 0.03) 75%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-text {
  height: 20px;
  width: 100%;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-title {
  height: 32px;
  width: 50%;
  margin-bottom: 16px;
  border-radius: 6px;
}

.skeleton-card {
  height: 120px;
  width: 100%;
  border-radius: 12px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes pulse-core-anim {
  0% {
    transform: scale(0.94);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.25), inset 0 0 8px rgba(245, 158, 11, 0.05);
  }

  100% {
    transform: scale(1.06);
    box-shadow: 0 0 35px rgba(245, 158, 11, 0.55), inset 0 0 15px rgba(245, 158, 11, 0.2);
  }
}

.loading-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.6px;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
  animation: fadeInOut 2s ease-in-out infinite alternate;
}

.premium-access-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(139, 92, 246, 0.18));
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
  margin-top: -4px;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
  animation: breathe 3s infinite ease-in-out;
}

@keyframes breathe {
  0%, 100% { opacity: 0.85; transform: scale(0.97); }
  50% { opacity: 1; transform: scale(1.03); }
}

@keyframes fadeInOut {
  0% {
    opacity: 0.65;
  }

  100% {
    opacity: 1;
  }
}

/* ==========================================================================
   SMOOTH PAGE TRANSITIONS
   ========================================================================== */
.view-panel {
  display: none;
  animation: viewSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-panel.active {
  display: block;
}

@keyframes viewSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   EMPTY STATE PLACEHOLDERS
   ========================================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.88rem;
  max-width: 360px;
  line-height: 1.5;
}

/* ==========================================================================
   TABLE ROW HOVER ANIMATION (Smoother)
   ========================================================================== */
tbody tr {
  transition: background 0.2s ease, transform 0.15s ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ==========================================================================
   BUTTON LOADING STATE
   ========================================================================== */
.btn.btn-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.btn.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ==========================================================================
   MOBILE TOAST RESPONSIVE
   ========================================================================== */
/* ==========================================================================
   MOBILE TOAST RESPONSIVE
   ========================================================================== */
@media (max-width: 480px) {
  #toast-container {
    left: 12px;
    right: 12px;
    bottom: calc(80px + var(--safe-bottom));
    max-width: 100%;
  }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.85rem;
}

.text-md {
  font-size: 1rem;
}

.text-lg {
  font-size: 1.25rem;
}

.text-xl {
  font-size: 1.5rem;
}

.text-2xl {
  font-size: 2rem;
}

.font-normal {
  font-weight: 400;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.font-extrabold {
  font-weight: 800;
}

.text-primary {
  color: var(--primary);
}

.text-muted {
  color: var(--text-muted);
}

.text-main {
  color: var(--text-main);
}

.text-white {
  color: #fff;
}

.text-error {
  color: var(--color-error);
}

.uppercase {
  text-transform: uppercase;
}

.italic {
  font-style: italic;
}

.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

.mb-1 {
  margin-bottom: 4px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 12px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mt-1 {
  margin-top: 4px;
}

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 12px;
}

.mt-4 {
  margin-top: 16px;
}

.btn-error {
  color: var(--color-error);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-error:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--color-error);
}

/* ==========================================================================
   NOTIFICATIONS DRAWER
   ========================================================================== */
.notifications-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: var(--bg-modal);
  backdrop-filter: blur(25px);
  border-left: 1px solid var(--border-color);
  z-index: 100000;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notifications-drawer:not(.hidden) {
  transform: translateX(0);
}

.notifications-drawer.hidden {
  display: block !important;
  transform: translateX(100%);
}

.notification-item {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s;
}

.notification-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.notification-item.unread {
  background: rgba(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.05);
  border-left: 3px solid var(--primary);
}

.notification-item.master-admin-alert {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(245, 158, 11, 0.1));
  border-left: 4px solid var(--color-danger);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.notification-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.notification-message {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.notification-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  user-select: none;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION — FULL REDESIGN FROM SCRATCH
   ========================================================================== */

/* Hidden by default on desktop */
.mobile-bottom-nav {
  display: none;
}

/* Mobile-only/desktop-only utilities hidden by default */
.mobile-only {
  display: none;
}

/* ============================================================
   MOBILE BREAKPOINT — Everything below 900px
   ============================================================ */
@media (max-width: 900px) {

  /* Hide Search Bar on Mobile for every role */
  #global-search-container,
  .universal-search-container,
  .header-center {
    display: none !important;
  }

  /* ---- Layout Shell ---- */
  .sidebar {
    display: none !important;
  }

  .desktop-only {
    display: none !important;
  }
  .sidebar .desktop-only {
    display: block !important;
  }

  .mobile-only {
    display: block !important;
  }

  /* ---- App Content Area ---- */
  .main-content {
    padding-bottom: calc(76px + var(--safe-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ---- Top Header (Slim Mobile Header - Stable & Jitter-free) ---- */
  .content-header {
    display: flex;
    padding: calc(6px + var(--safe-top)) 10px 6px 10px !important;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    background: rgba(10, 14, 26, 0.8) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    position: sticky;
    top: 0;
    z-index: 500;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: padding 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, backdrop-filter 0.2s ease, border-color 0.2s ease !important;
  }

  /* Scrolled/Shrunk header on mobile */
  .content-header.header-scrolled {
    padding-top: calc(3px + var(--safe-top)) !important;
    padding-bottom: 3px !important;
    background: rgba(10, 14, 26, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
  }

  .content-header.header-shrunk,
  .content-header.header-hidden {
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .header-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 0 1 auto !important;
  }

  .header-left h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    transition: font-size 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .content-header.header-scrolled .header-left h2 {
    font-size: 1.05rem;
  }

  .header-left p {
    display: none;
    /* hide subtitle on mobile to save space */
  }

  .header-center {
    display: none !important;
  }

  .header-right {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    position: static !important;
    width: auto !important;
    margin-left: auto !important;
    justify-content: flex-end !important;
    transform: none !important;
  }

  .notification-container {
    order: 2 !important;
  }

  .profile-dropdown-container {
    order: 1 !important;
  }

  /* ---- View Viewport Padding ---- */
  .view-viewport {
    padding: 16px;
  }

  /* ---- Panel Cards ---- */
  .panel-card {
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 14px;
    background: rgba(22, 30, 50, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  }

  .panel-card:hover {
    transform: none;
    /* disable hover lift on touch to avoid stuck states */
  }

  /* ---- Panel Header ---- */
  .panel-header {
    margin-bottom: 16px;
  }

  .panel-header h3 {
    font-size: 1rem;
    font-weight: 700;
  }

  /* ---- Buttons ---- */
  .btn {
    padding: 13px 18px;
    font-size: 0.92rem;
    min-height: 48px;
    border-radius: 12px;
    font-weight: 600;
  }

  .btn-xs {
    padding: 8px 12px;
    font-size: 0.78rem;
    min-height: 36px;
    border-radius: 8px;
  }

  .btn-sm {
    padding: 10px 14px;
    font-size: 0.85rem;
    min-height: 42px;
  }

  /* ---- Form Controls ---- */
  .form-control,
  input,
  select,
  textarea {
    min-height: 52px;
    font-size: 1rem;
    border-radius: 12px;
    padding: 14px 16px;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .form-group label {
    font-size: 0.78rem;
    margin-bottom: 6px;
  }

  /* ---- Tables → Stacked Cards ---- */
  table {
    border: 0;
    width: 100%;
  }

  table thead {
    display: none;
  }

  table tr {
    display: block;
    background: rgba(22, 30, 50, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    margin-bottom: 12px;
    padding: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.2s ease;
  }

  table tr:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  }

  table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 0;
    font-size: 0.88rem;
    gap: 8px;
  }

  table td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  table td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    max-width: 45%;
  }

  /* ---- Modal as Bottom Sheet ---- */
  .modal-overlay {
    align-items: flex-end;
  }

  .modal-card,
  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 24px 24px 0 0 !important;
    max-height: 92vh;
    overflow-y: auto;
    padding: 24px 20px;
    padding-bottom: calc(24px + var(--safe-bottom));
    animation: slideUpSheet 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes slideUpSheet {
    from {
      transform: translateY(100%);
      opacity: 0;
    }

    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  /* ---- Login Screen Mobile ---- */
  .login-card-wrapper {
    padding: 16px;
    align-items: flex-end;
  }

  .login-card {
    border-radius: 24px 24px 0 0;
    padding: 28px 24px;
    padding-bottom: calc(28px + var(--safe-bottom));
    min-height: 60vh;
    margin-bottom: 0;
  }

  .login-title {
    font-size: 2rem;
  }

  /* ---- Attendance Segmented Controls ---- */
  .att-lbl {
    font-size: 0.78rem;
    padding: 10px 8px;
    min-height: 48px;
    border-radius: 10px;
  }

  /* ---- Wizard Steps ---- */
  .wizard-steps {
    gap: 6px;
  }

  .wizard-step .step-title {
    display: none;
  }

  /* ---- Gradebook ---- */
  .gb-marks,
  .gb-remarks {
    text-align: right;
  }

  /* ---- Dashboard grids collapse ---- */
  .dashboard-grid-1-2,
  .dashboard-grid-2-1,
  .dashboard-grid-3-2 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* ---- Student profile grid ---- */
  .student-profile-info {
    grid-template-columns: 1fr !important;
  }

  /* ---- Stat cards go full width ---- */
  .grid-stats {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 18px 16px;
    border-radius: 14px;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR — Premium Redesign
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  /* hidden by default on desktop */
}

@media (max-width: 900px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: calc(68px + var(--safe-bottom, 0px));
    padding: 0 8px;
    padding-bottom: var(--safe-bottom, 0px);
    background: #0b0f19;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 99990;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  }

  .mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #b0bec5;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    min-width: 0;
    height: 100%;
    position: relative;
    padding: 8px 4px 4px 4px;
    border-radius: 0;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
  }
  
  .mobile-nav-link span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
    text-align: center;
  }

  /* Icon wrapper — the pill that lights up */
  .mobile-nav-link .nav-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 30px;
    border-radius: 15px;
    background: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
  }

  .mobile-nav-link svg,
  .mobile-nav-link i,
  .mobile-nav-link [data-lucide] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    max-width: 100%;
    stroke-width: 1.8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Active State — glowing pill + colored icon */
  .mobile-nav-link.active {
    color: var(--primary);
  }

  .mobile-nav-link.active .nav-icon-wrap {
    background: hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.18);
    box-shadow: 0 0 14px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.35),
      inset 0 0 0 1px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.25);
  }

  .mobile-nav-link.active svg,
  .mobile-nav-link.active i {
    stroke: var(--primary);
    filter: drop-shadow(0 0 5px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.5));
  }

  /* Tap animation */
  .mobile-nav-link:active {
    transform: scale(0.92);
  }

  .mobile-nav-link:active .nav-icon-wrap {
    background: hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.25);
    transform: scale(1.05);
  }

  /* Top indicator bar on active item */
  .mobile-nav-link.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 0 8px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.6);
    animation: indicatorIn 0.25s ease;
  }

  @keyframes indicatorIn {
    from {
      width: 0;
      opacity: 0;
    }

    to {
      width: 28px;
      opacity: 1;
    }
  }
}

/* ==========================================================================
   MOBILE STUDENT DASHBOARD CARDS — Premium Grid Design
   ========================================================================== */
@media (max-width: 900px) {

  /* Hero welcome card */
  .mobile-hero-card {
    background: linear-gradient(135deg,
        hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.25) 0%,
        hsla(var(--accent-hue), var(--accent-sat), var(--accent-lightness), 0.12) 100%);
    border: 1px solid hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.25);
    border-radius: 20px;
    padding: 22px 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  }

  .mobile-hero-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.06);
    pointer-events: none;
  }

  .mobile-hero-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.3px;
    margin-bottom: 4px;
  }

  .mobile-hero-sub {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
  }

  .mobile-hero-sub span {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .mobile-hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.18);
    color: var(--primary);
    border: 1px solid hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.3);
    margin-top: 10px;
  }

  /* 2-column metric grid */
  .mobile-metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
  }

  .mobile-metric-card {
    background: rgba(22, 30, 50, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 130px;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: default;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-metric-card:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  /* Subtle gradient corner glow on metric card */
  .mobile-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.5) 50%,
        transparent 100%);
    border-radius: 18px 18px 0 0;
  }

  .mobile-metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.15);
    border: 1px solid hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
  }

  .mobile-metric-icon svg,
  .mobile-metric-icon i {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    max-width: 100%;
    stroke: var(--primary);
    filter: drop-shadow(0 0 6px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.4));
  }

  .mobile-metric-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 4px;
  }

  .mobile-metric-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
  }

  /* Attendance status colors */
  .mobile-metric-card.status-present .mobile-metric-icon {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
  }

  .mobile-metric-card.status-present .mobile-metric-icon svg {
    stroke: #10b981;
    filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.4));
  }

  .mobile-metric-card.status-present .mobile-metric-value {
    color: #10b981;
  }

  .mobile-metric-card.status-absent .mobile-metric-icon {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
  }

  .mobile-metric-card.status-absent .mobile-metric-icon svg {
    stroke: #ef4444;
    filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.4));
  }

  .mobile-metric-card.status-absent .mobile-metric-value {
    color: #ef4444;
  }

  /* Full-width section card (for content lists) */
  .mobile-section-card {
    background: rgba(22, 30, 50, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .mobile-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .mobile-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-section-title svg {
    width: 16px;
    height: 16px;
    stroke: var(--primary);
  }

  .mobile-section-body {
    padding: 0;
  }

  /* List rows inside section cards */
  .mobile-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease;
    gap: 12px;
  }

  .mobile-list-row:last-child {
    border-bottom: 0;
  }

  .mobile-list-row:active {
    background: rgba(255, 255, 255, 0.04);
  }

  .mobile-list-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .mobile-list-primary {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-list-secondary {
    font-size: 0.75rem;
    color: var(--text-muted);
  }

  .mobile-list-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  /* Quick action buttons row */
  .mobile-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
  }

  .mobile-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    border-radius: 14px;
    background: hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.12);
    border: 1px solid hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.2);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-action-btn:active {
    transform: scale(0.95);
    background: hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.22);
  }

  .mobile-action-btn svg,
  .mobile-action-btn i {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    max-width: 100%;
    flex-shrink: 0;
  }

  /* Announcement/notification banner strip */
  .mobile-announcement-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg,
        hsla(var(--accent-hue), var(--accent-sat), var(--accent-lightness), 0.18),
        hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.12));
    border: 1px solid hsla(var(--accent-hue), var(--accent-sat), var(--accent-lightness), 0.25);
    margin-bottom: 16px;
    font-size: 0.82rem;
    color: var(--text-main);
    font-weight: 500;
  }

  .mobile-announcement-strip svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: var(--accent);
  }

  /* Attendance status pill */
  .att-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  .att-pill.present {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
  }

  .att-pill.absent {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
  }

  .att-pill.late {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
  }
}

/* ==========================================================================
   ATTENDANCE BUTTON CONTROLS (mobile-enhanced)
   ========================================================================== */
.att-radio-wrapper {
  position: relative;
  display: inline-block;
  flex: 1;
}

.hidden-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.att-lbl {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  min-height: 48px;
}

.hidden-radio:checked+.att-present-lbl {
  background: rgba(34, 197, 94, 0.2);
  border-color: var(--color-success);
  color: var(--color-success);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

.hidden-radio:checked+.att-absent-lbl {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--color-error);
  color: var(--color-error);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.hidden-radio:checked+.att-sa-lbl {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--color-info);
  color: var(--color-info);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}


/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.85rem;
}

.text-md {
  font-size: 1rem;
}

.text-lg {
  font-size: 1.25rem;
}

.text-xl {
  font-size: 1.5rem;
}

.text-2xl {
  font-size: 2rem;
}

.font-normal {
  font-weight: 400;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.font-extrabold {
  font-weight: 800;
}

.text-primary {
  color: var(--primary);
}

.text-muted {
  color: var(--text-muted);
}

.text-main {
  color: var(--text-main);
}

.text-white {
  color: #fff;
}

.text-error {
  color: var(--color-error);
}

.uppercase {
  text-transform: uppercase;
}

.italic {
  font-style: italic;
}

.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

.mb-1 {
  margin-bottom: 4px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 12px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mt-1 {
  margin-top: 4px;
}

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 12px;
}

.mt-4 {
  margin-top: 16px;
}

.btn-error {
  color: var(--color-error);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-error:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--color-error);
}

/* ==========================================================================
   NOTIFICATIONS DRAWER
   ========================================================================== */
.notifications-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: var(--bg-modal);
  backdrop-filter: blur(25px);
  border-left: 1px solid var(--border-color);
  z-index: 100000;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notifications-drawer:not(.hidden) {
  transform: translateX(0);
}

.notifications-drawer.hidden {
  display: block !important;
  /* Override .hidden display:none to allow animation */
  transform: translateX(100%);
}

.notification-item {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s;
}

.notification-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.notification-item.unread {
  background: rgba(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.05);
  border-left: 3px solid var(--primary);
}

.notification-item.master-admin-alert {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(245, 158, 11, 0.1));
  border-left: 4px solid var(--color-danger);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.notification-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.notification-message {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.notification-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
}



/* Mobile-only elements — hidden on desktop by default */
.mobile-only {
  display: none;
}

@media (max-width: 900px) {

  /* Mobile bottom nav shown */
  .mobile-bottom-nav {
    display: flex;
  }

  /* Adjust main content for bottom nav */
  .main-content {
    padding-bottom: calc(65px + var(--safe-bottom));
  }

  /* Make tap targets bigger */
  .btn,
  .form-control,
  select {
    min-height: 48px;
  }

  .content-header {
    padding: calc(15px + var(--safe-top)) 15px 15px 15px;
  }

  .header-left h2 {
    font-size: 1.2rem;
  }

  /* Search bar mobile display */
  .universal-search-container {
    display: flex;
    margin: 8px 0;
  }

  /* Desktop Only Elements */
  .desktop-only {
    display: none !important;
  }

  /* Mobile Only Elements - shown only on mobile */
  .mobile-only {
    display: block !important;
  }

  /* =======================================================
     MOBILE CARDS (Transform LOGS Table into Stacked Cards)
     ======================================================= */
  #logs-table {
    border: 0;
  }

  #logs-table thead {
    display: none;
  }

  #logs-table tr {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    margin-bottom: 12px;
    padding: 12px;
  }

  #logs-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 0;
  }

  #logs-table td:last-child {
    border-bottom: 0;
  }

  #logs-table td::before {
    content: attr(data-label);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
  }

  /* Make non-logs tables responsive and keep their header layout */
  table:not(#logs-table) {
    min-width: 600px;
  }

  /* Better inputs for Gradebook on Mobile */
  .gb-marks,
  .gb-remarks {
    text-align: right;
  }
}

/* =======================================================
   PREMIUM ATTENDANCE UI (Progress Rings, Timelines, Toggles)
   ======================================================= */
/* Teacher Roster Toggles */
.att-toggle-group {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.att-radio-wrapper {
  position: relative;
  display: flex;
  flex: 1;
}

.hidden-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.att-lbl {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
}

.hidden-radio:checked+.att-present-lbl {
  background: var(--color-success);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
  transform: scale(1.05);
}

.hidden-radio:checked+.att-absent-lbl {
  background: var(--color-error);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  transform: scale(1.05);
}

.hidden-radio:checked+.att-late-lbl,
.hidden-radio:checked+.att-sa-lbl {
  background: var(--color-warning);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  transform: scale(1.05);
}

/* Dashboard Progress Rings */
.progress-ring-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
}

.progress-ring {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.progress-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 8;
}

.progress-ring-circle {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-out;
}

.progress-ring-circle.success {
  stroke: var(--color-success);
}

.progress-ring-circle.warning {
  stroke: var(--color-warning);
}

.progress-ring-circle.danger {
  stroke: var(--color-error);
}

.progress-ring-text {
  position: absolute;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.progress-ring-text span {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Yearly Calendar View */
.yearly-calendar-container {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  padding: 8px 4px 16px 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.yearly-calendar-container::-webkit-scrollbar {
  height: 6px;
}

.yearly-calendar-container::-webkit-scrollbar-thumb {
  background-color: var(--primary);
  border-radius: 4px;
}

.mini-calendar {
  flex: 0 0 auto;
  width: 180px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
}

.mini-calendar-title {
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

.mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.mini-calendar-dow {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 4px;
}

.mini-calendar-cell {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  cursor: default;
}

.mini-calendar-cell.empty {
  background: transparent;
}

.mini-calendar-cell.present {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  font-weight: 800;
}

.mini-calendar-cell.absent {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  font-weight: 800;
}

.mini-calendar-cell.late {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  font-weight: 800;
}

.mini-calendar-cell.today {
  border: 1px solid var(--primary);
  color: var(--text-main);
}

/* Dashboard Visual Timeline */
.timeline-container {
  position: relative;
  padding-left: 20px;
  margin-top: 10px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 6px;
  height: 100%;
  width: 2px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--border-radius-sm);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
}

.timeline-icon {
  position: absolute;
  left: -24px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

.timeline-icon svg {
  width: 12px;
  height: 12px;
}

.timeline-icon.present {
  color: var(--color-success);
  background: rgba(34, 197, 94, 0.1);
}

.timeline-icon.absent {
  color: var(--color-error);
  background: rgba(239, 68, 68, 0.1);
}

.timeline-icon.late {
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.1);
}

.timeline-content {
  display: flex;
  flex-direction: column;
}

.timeline-date {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.timeline-remarks {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.mobile-only {
  display: none;
}

/* =======================================================
   HEADER POPUP MENU & DRAWER TABS
   ======================================================= */
.popup-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: var(--bg-modal);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10000;
  transform-origin: top right;
  animation: scaleFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.popup-menu.hidden {
  display: none !important;
}

@keyframes scaleFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-5px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.popup-menu-item a:hover {
  background: rgba(255, 255, 255, 0.05);
}

.drawer-tab:hover {
  color: var(--text-main) !important;
}

/* Profile Dropdown Z-Index Fix */
.popup-menu {
  z-index: 1000000 !important;
}

.profile-dropdown-container {
  z-index: 1000000 !important;
}

/* Custom Select Dropdown Styling */
select.form-control,
select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px !important;
}

/* Smooth Transitions for Popup Menus & Drawers */
.popup-menu,
.search-dropdown,
.notifications-drawer {
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s ease;
}

/* Notifications Drawer Specific Styles */
.notifications-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-modal);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-left: 1px solid var(--border-color);
  z-index: 10000000 !important;
  /* Extremely high z-index to stay above sidebars & modall overlays */
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
}

.notifications-drawer:not(.hidden) {
  transform: translateX(0);
}

.notifications-drawer.hidden {
  display: block !important;
  /* Keep block display to allow transition animations */
  transform: translateX(100%);
  pointer-events: none;
}

/* Logs Table Layout Optimization (Auto-fit & Truncation) */
#logs-table.logs-table-full {
  table-layout: fixed;
  width: 100%;
}

#logs-table.logs-table-full th:nth-child(1),
#logs-table.logs-table-full td:nth-child(1) {
  width: 15%;
}

/* Timestamp */
#logs-table.logs-table-full th:nth-child(2),
#logs-table.logs-table-full td:nth-child(2) {
  width: 13%;
}

/* Performed By */
#logs-table.logs-table-full th:nth-child(3),
#logs-table.logs-table-full td:nth-child(3) {
  width: 10%;
}

/* User Role */
#logs-table.logs-table-full th:nth-child(4),
#logs-table.logs-table-full td:nth-child(4) {
  width: 8%;
}

/* School */
#logs-table.logs-table-full th:nth-child(5),
#logs-table.logs-table-full td:nth-child(5) {
  width: 9%;
}

/* Action */
#logs-table.logs-table-full th:nth-child(6),
#logs-table.logs-table-full td:nth-child(6) {
  width: 11%;
}

/* Target Table */
#logs-table.logs-table-full th:nth-child(7),
#logs-table.logs-table-full td:nth-child(7) {
  width: 9%;
}

/* Record ID */
#logs-table.logs-table-full th:nth-child(8),
#logs-table.logs-table-full td:nth-child(8) {
  width: 25%;
}

/* Details */

#logs-table {
  width: 100%;
}

#logs-table td {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  vertical-align: middle;
  padding: 12px 14px;
}

#logs-table td span.log-details-span {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  cursor: pointer;
}

#logs-table td span.log-details-span:hover {
  white-space: normal;
  word-break: break-all;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 10px;
  border-radius: 8px;
  position: absolute;
  z-index: 100;
  max-width: 340px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

/* Hide non-critical columns on medium screen sizes for full logs table */
@media (max-width: 1200px) {
  #logs-table.logs-table-full th:nth-child(4),
  #logs-table.logs-table-full td:nth-child(4),
  /* School */
  #logs-table.logs-table-full th:nth-child(7),
  #logs-table.logs-table-full td:nth-child(7)

  /* Record ID */
    {
    display: none !important;
  }

  #logs-table.logs-table-full th:nth-child(1),
  #logs-table.logs-table-full td:nth-child(1) {
    width: 20%;
  }

  #logs-table.logs-table-full th:nth-child(2),
  #logs-table.logs-table-full td:nth-child(2) {
    width: 16%;
  }

  #logs-table.logs-table-full th:nth-child(3),
  #logs-table.logs-table-full td:nth-child(3) {
    width: 14%;
  }

  #logs-table.logs-table-full th:nth-child(5),
  #logs-table.logs-table-full td:nth-child(5) {
    width: 12%;
  }

  #logs-table.logs-table-full th:nth-child(6),
  #logs-table.logs-table-full td:nth-child(6) {
    width: 16%;
  }

  #logs-table.logs-table-full th:nth-child(8),
  #logs-table.logs-table-full td:nth-child(8) {
    width: 22%;
  }
}

@media (max-width: 900px) {

  /* On mobile stacked view, let details flow normally */
  #logs-table td {
    white-space: normal !important;
    text-overflow: clip !important;
    overflow: visible !important;
  }

  #logs-table td span.log-details-span {
    white-space: normal !important;
    text-overflow: clip !important;
    overflow: visible !important;
  }
}

/* ==========================================================================
   GLOBAL FORM FIELDS & DROPDOWNS LAYOUT FIXES
   ========================================================================== */
.form-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin-bottom: 20px !important;
  width: 100% !important;
  align-items: stretch !important;
}

.form-group label {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  display: block !important;
  margin-bottom: 0 !important;
  text-align: left !important;
}

.form-control,
select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
textarea {
  display: block !important;
  width: 100% !important;
  height: 48px !important;
  padding: 10px 16px !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  color: var(--text-main) !important;
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius-sm) !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
}

.form-control:focus,
select:focus,
input:focus,
textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.15) !important;
  background: rgba(15, 23, 42, 0.8) !important;
  outline: none !important;
}

textarea.form-control,
textarea {
  height: auto !important;
  min-height: 100px !important;
}

/* ==========================================================================
   DATE & TIME PICKERS & CONTRAST WIDGET OPTIMIZATIONS
   ========================================================================== */
input[type="date"],
input[type="time"] {
  color-scheme: dark !important;
  /* Tells browser to natively render light icons and text for dark background */
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
.form-control::-webkit-calendar-picker-indicator,
input::-webkit-calendar-picker-indicator {
  filter: invert(1) !important;
  /* Forces dark icons to white for dark backgrounds */
  cursor: pointer !important;
  opacity: 1 !important;
  transition: transform 0.2s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input::-webkit-calendar-picker-indicator:hover {
  transform: scale(1.1) !important;
}

/* SVG & Lucide Icon Visibility Enhancements */
.input-modern-wrapper i[data-lucide],
.input-modern-wrapper svg,
.input-icon,
.universal-search-container .search-icon,
.notification-container svg {
  color: #b0bec5 !important;
  stroke-width: 2.2px !important;
  opacity: 1;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.input-modern-wrapper input:focus~i[data-lucide],
.input-modern-wrapper input:focus~svg,
#universal-search-input:focus+.search-icon {
  color: var(--primary) !important;
  opacity: 1;
}

/* Sidebar and general layout SVGs */
.nav-link svg,
.sidebar-collapse-toggle svg,
.panel-header svg,
.modal-header svg {
  color: #c8d6e8;
  opacity: 1;
}

.nav-link:hover svg,
.nav-link.active svg {
  color: var(--primary) !important;
  opacity: 1;
}

/* ==========================================================================
   UI FIXES & PATCHES (ATTENDANCE, LOGIN ICONS, PICKER BACKGROUNDS)
   ========================================================================== */
/* Fix Attendance Circle Text Overlap */
.progress-ring-text {
  /* Scale down the entire container to prevent overlapping the circle */
  transform: scale(0.65);
}

.progress-ring-text span {
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Fix Login Icons Overlapping Text */
.input-modern-wrapper input {
  padding-left: 2.5rem !important;
}

/* Provide missing surface variables for custom pickers */
:root,
body {
  --surface-2: var(--bg-modal);
  --surface-3: rgba(255, 255, 255, 0.1);
  --text-primary: var(--text-main);
  --text-secondary: var(--text-muted);
}

/* Ensure picker dropdowns stay on top of everything */
.custom-picker-dropdown {
  z-index: 999999 !important;
}

/* ==========================================================================
   CUSTOM DATE & TIME PICKERS
   ========================================================================== */

/* Hide native inputs that are wrapped */
.custom-picker-wrapper input[type="date"],
.custom-picker-wrapper input[type="time"] {
  display: none !important;
}

/* Wrapper to hold trigger and dropdown */
.custom-picker-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

/* Trigger button imitating an input field */
.custom-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-family);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.custom-picker-trigger:hover {
  border-color: var(--primary);
  background: var(--surface-3);
}

.custom-picker-trigger:focus,
.custom-picker-trigger.active {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lit), 0.15);
  background: var(--surface-2);
}

.custom-picker-trigger .picker-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-picker-trigger .picker-placeholder {
  color: var(--text-muted);
}

.custom-picker-trigger svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-left: 0.5rem;
  transition: transform 0.3s ease;
}

.custom-picker-trigger.active svg {
  color: var(--primary);
  transform: rotate(180deg);
}

/* Common Dropdown Container */
.custom-picker-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 9999;
  background: var(--surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px inset rgba(255, 255, 255, 0.05);
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  min-width: min(320px, 90vw);
  max-width: 90vw;
}

.custom-picker-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Date Picker Layout */
.custom-date-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.custom-date-header .month-year-display {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.custom-date-header button {
  background: var(--surface-3);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.custom-date-header button:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-on-primary);
}

.custom-date-header button svg {
  width: 16px;
  height: 16px;
}

.custom-date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.custom-date-day-name {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding-bottom: 0.5rem;
  text-transform: uppercase;
}

.custom-date-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-primary);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  border: 1px solid transparent;
}

.custom-date-day:hover:not(.empty) {
  background: var(--surface-3);
  border-color: var(--border-color);
}

.custom-date-day.today {
  color: var(--primary);
  font-weight: 600;
  border-color: var(--primary);
}

.custom-date-day.selected {
  background: var(--primary);
  color: var(--text-on-primary);
  border-color: var(--primary);
  font-weight: 600;
  box-shadow: 0 4px 12px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lit), 0.4);
}

.custom-date-day.empty {
  cursor: default;
}

/* Time Picker Layout */
.custom-time-layout {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  height: 200px;
}

.custom-time-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--border-color);
  padding-right: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.custom-time-column::-webkit-scrollbar {
  width: 4px;
}

.custom-time-column::-webkit-scrollbar-track {
  background: transparent;
}

.custom-time-column::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 4px;
}

.custom-time-column:last-child {
  border-right: none;
  padding-right: 0;
}

.custom-time-item {
  padding: 0.5rem;
  text-align: center;
  cursor: pointer;
  border-radius: var(--border-radius-sm);
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: all 0.2s;
  margin-bottom: 2px;
}

.custom-time-item:hover {
  background: var(--surface-3);
  color: var(--text-primary);
}

.custom-time-item.selected {
  background: var(--primary);
  color: var(--text-on-primary);
  font-weight: 600;
}

.custom-time-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.custom-picker-btn {
  background: var(--primary);
  color: var(--text-on-primary);
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.custom-picker-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Mobile Responsiveness for Bottom Sheet & Dropdowns */
@media (max-width: 768px) {
  .custom-picker-dropdown {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0 !important;
    padding: 1.5rem !important;
    transform: translateY(100%) !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    background: rgba(15, 23, 42, 0.96) !important;
  }

  .custom-picker-dropdown.show {
    transform: translateY(0) !important;
  }

  /* Overlay backdrop for mobile */
  .custom-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .custom-picker-overlay.show {
    opacity: 1;
    visibility: visible;
  }
}

/* ==========================================================================
   GLOBAL UX POLISH & CONTRAST PATCHES
   ========================================================================== */

/* High contrast primary buttons */
.btn-primary {
  color: #ffffff !important;
}

/* High contrast input placeholder styling */
::placeholder,
.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: #94a3b8 !important;
  opacity: 0.8 !important;
}

/* Scrollable Modal Overlays (No Top/Bottom Clipping) */
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(3, 7, 18, 0.75) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  overflow-y: auto !important;
  padding: 40px 20px !important;
}

.modal-card {
  margin: auto !important;
  max-height: none !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: visible !important;
}

/* Universal Header Grid Layout for Mobile & Tablet Views */
@media (max-width: 900px) {
  .content-header {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    gap: 12px !important;
    padding: calc(15px + var(--safe-top)) 15px 15px 15px !important;
  }

  .header-left {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: flex !important;
    align-items: center !important;
  }

  #mobile-menu-btn {
    display: flex !important;
  }

  .header-right {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: auto !important;
    margin-left: auto !important;
    gap: 12px !important;
    justify-content: flex-end !important;
  }

  .header-center {
    display: block !important;
    grid-column: 1 / span 2 !important;
    grid-row: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  /* Hide Ctrl K Badge on mobile inputs */
  .search-kbd {
    display: none !important;
  }

  #universal-search-input {
    padding-right: 20px !important;
  }

  .search-dropdown {
    max-height: 280px !important;
    overflow-y: auto !important;
  }
}

/* ==========================================================================
   PERFORMANCE & RENDERING OPTIMIZATIONS
   ========================================================================== */
/* Hardware accelerate animated presentation background */
.presentation-bg-animated {
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

/* Optimize blur filters and backdrop filters for rendering performance */
.presentation-shapes .shape {
  filter: blur(20px) !important;
  opacity: 0.08 !important;
}

/* Disable or reduce backdrop filters globally to prevent CPU/GPU repaint lag */
.sidebar,
.content-header,
.popup-menu,
.search-dropdown,
.notifications-drawer,
.custom-picker-dropdown,
.panel-card,
.toast,
.modal-overlay,
.login-interaction {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Adjust background opacities to maintain premium contrast without blur */
.sidebar {
  background: rgba(13, 17, 28, 0.96) !important;
}

.content-header {
  background: rgba(15, 23, 42, 0.96) !important;
}

.popup-menu,
.search-dropdown,
.notifications-drawer {
  background: rgba(15, 23, 42, 0.98) !important;
}

.panel-card {
  background: rgba(23, 31, 48, 0.85) !important;
}

.custom-picker-dropdown {
  background: rgba(15, 23, 42, 0.99) !important;
}

.toast {
  background: rgba(30, 41, 59, 0.98) !important;
}

.login-interaction {
  background: rgba(15, 23, 42, 0.98) !important;
}

/* Simplify expensive transitions and shadow effects */
.btn,
.nav-link,
.nav-link svg,
.form-control,
.quick-login-btn,
.modern-install-btn {
  transition: background-color 0.1s ease-out, border-color 0.1s ease-out, color 0.1s ease-out, opacity 0.1s ease-out, transform 0.1s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn:hover,
.quick-login-btn:hover,
.modern-install-btn:hover {
  transform: none !important;
}

.btn:active,
.quick-login-btn:active,
.modern-install-btn:active {
  transform: scale(0.95) !important;
}

/* Optimize shadows to single layer for faster rasterization */
:root {
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.25) !important;
}

.btn-primary {
  box-shadow: 0 3px 8px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.25) !important;
}

.btn-primary:hover {
  box-shadow: 0 5px 12px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.35) !important;
}

.btn-modern-primary {
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25) !important;
}

.btn-modern-primary:hover {
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.35) !important;
}

/* Force hide all text labels and branding details in collapsed sidebar mode */
.sidebar.collapsed .school-info,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .user-details,
.sidebar.collapsed #logout-btn span,
.sidebar.collapsed h3,
.sidebar.collapsed h4,
.sidebar.collapsed span {
  display: none !important;
  opacity: 0 !important;
  width: 0 !important;
  max-width: 0 !important;
  visibility: hidden !important;
  overflow: hidden !important;
}

/* ==========================================================================
   MOBILE STUDENT PROFILE & DETAILS RESPONSIVENESS
   ========================================================================== */
@media (max-width: 768px) {

  /* Student profile overview responsiveness */
  .student-profile-info {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    padding: 1rem !important;
  }

  .student-profile-info>div[style*="display: grid"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }

  /* Make setup/hub tabs stack nicely or look like standard mobile pills */
  .setup-tabs-header {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .setup-tabs-header .btn {
    flex: 1 1 calc(50% - 6px) !important;
    padding: 8px 12px !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
  }

  /* Tables layout collapse for mobile (Grades and Attendance history) */
  #grades-table,
  #attendance-table {
    display: block !important;
    width: 100% !important;
  }

  #grades-table thead,
  #attendance-table thead {
    display: none !important;
    /* Hide column headers in card mode */
  }

  #grades-table tbody,
  #attendance-table tbody {
    display: block !important;
    width: 100% !important;
  }

  #grades-table tr {
    display: block !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    margin-bottom: 12px !important;
    padding: 12px 16px !important;
  }

  #grades-table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    padding: 8px 0 !important;
    font-size: 0.85rem !important;
    text-align: right !important;
  }

  #grades-table td:last-child {
    border-bottom: none !important;
  }

  /* Construct custom labels for mobile card layout */
  #grades-table td::before {
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    content: attr(data-label) !important;
    text-align: left !important;
    font-size: 0.8rem !important;
    margin-right: 12px !important;
  }

  #attendance-table tr {
    display: block !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    margin-bottom: 10px !important;
    padding: 12px 16px !important;
  }

  #attendance-table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    padding: 8px 0 !important;
    font-size: 0.85rem !important;
  }

  #attendance-table td:last-child {
    border-bottom: none !important;
  }

  #attendance-table td::before {
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    content: attr(data-label) !important;
    font-size: 0.8rem !important;
  }

  /* Make actions wrapper mobile-friendly */
  #grades-table td.admin-only,
  #grades-table td.teacher-only,
  #attendance-table td.admin-only,
  #attendance-table td.teacher-only {
    display: flex !important;
    gap: 8px !important;
    justify-content: flex-end !important;
  }

  #attendance-status-banner {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding: 12px !important;
    font-size: 0.85rem !important;
  }

  #attendance-status-banner span {
    margin-left: 0 !important;
    display: block !important;
  }
}

/* ==========================================
   SPLASH SCREEN & VERSIONING (v2.0.0)
   ========================================== */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at center, #0f172a 0%, #0a0e17 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* ==========================================
   LOGO-FREE MODERN LOADING / SPLASH SCREEN
   ========================================== */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  background: #080c14;
  background-image: radial-gradient(circle at 50% 45%, #0f172a 0%, #080c14 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

#splash-screen::before {
  content: '';
  position: absolute;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.2) 0%, rgba(59, 130, 246, 0.1) 40%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: blur(50px);
  animation: glowPulse 4s infinite alternate ease-in-out;
}

@keyframes glowPulse {
  0% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.85); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

#splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  position: relative;
  z-index: 10;
  animation: splashEnter 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes splashEnter {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modern Logo-Free Animated Loading Spinner */
.splash-spinner-container {
  position: relative;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.splash-spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3.5px solid transparent;
  border-top-color: #2563eb;
  border-right-color: #3b82f6;
  animation: spinnerRotate 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  filter: drop-shadow(0 0 10px rgba(37, 99, 235, 0.5));
}

.splash-spinner-ring-inner {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-bottom-color: #60a5fa;
  border-left-color: rgba(37, 99, 235, 0.35);
  animation: spinnerRotateReverse 0.9s linear infinite;
}

.splash-spinner-core {
  width: 14px;
  height: 14px;
  background: #2563eb;
  border-radius: 50%;
  box-shadow: 0 0 16px #3b82f6, 0 0 32px #2563eb;
  animation: corePulse 1.5s ease-in-out infinite alternate;
}

@keyframes spinnerRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes spinnerRotateReverse {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

@keyframes corePulse {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.25); opacity: 1; }
}

.splash-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 40%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.splash-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: #94a3b8;
  margin: 0 0 24px 0;
  letter-spacing: 0.3px;
}

.splash-loader-bar {
  width: 160px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.splash-loader-bar .splash-loader-fill,
.splash-loader-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  border-radius: 10px;
  animation: slideLoader 1.4s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideLoader {
  0% { left: -40%; }
  100% { left: 100%; }
}

@keyframes slideLoader {
  0% { left: -40%; }
  100% { left: 100%; }
}

.splash-footer {
  position: absolute;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: fadeInFooter 1.5s ease-out forwards;
}

@keyframes fadeInFooter {
  0% { opacity: 0; }
  100% { opacity: 0.6; }
}

.splash-attribution {
  font-size: 0.75rem;
  color: #cbd5e1;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.splash-version {
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Version Badge on Login Screen */
.version-badge {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  z-index: 10;
}

@media (max-width: 768px) {
  .version-badge {
    top: 16px;
    right: 16px;
  }
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.7;
}

/* TensorHub attribution link styling */
.attribution a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.attribution a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ==========================================
   NOTIFICATION BELL ANIMATION
   ========================================== */
.bell-ringing {
  animation: ringBell 2s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
  transform-origin: top center;
  color: var(--color-error) !important;
}

@keyframes ringBell {
  0%, 100% { transform: rotate(0); }
  10% { transform: rotate(15deg); }
  20% { transform: rotate(-10deg); }
  30% { transform: rotate(10deg); }
  40% { transform: rotate(-5deg); }
  50% { transform: rotate(2deg); }
  60% { transform: rotate(0); }
}

/* ==========================================
   PREMIUM PUSH PERMISSION PROMPT BANNER
   ========================================== */
#push-permission-banner {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  z-index: 999999;
  width: 92%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease-out;
  overflow: hidden;
}

#push-permission-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

#push-permission-banner.hide {
  opacity: 0;
  transform: translateX(-50%) translateY(-30px);
  pointer-events: none;
}

.push-banner-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.push-banner-icon-wrapper {
  background: rgba(35, 111, 225, 0.15);
  color: #236fe1;
  padding: 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(35, 111, 225, 0.1);
}

.push-banner-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #cbd5e1;
  font-weight: 500;
}

.push-banner-text strong {
  color: #fff;
  font-weight: 600;
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.push-banner-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.push-banner-btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.push-banner-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.push-banner-btn-primary {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(10, 59, 174, 0.3);
  transition: var(--transition-smooth);
}

.push-banner-btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(10, 59, 174, 0.4);
}

.push-banner-btn-primary:disabled {
  background: #051d54;
  color: #236fe1;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.push-banner-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #06b6d4);
  width: 100%;
  transform-origin: left;
  animation: countdownProgress 8s linear forwards;
}

@keyframes countdownProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ==========================================
   PREMIUM TOAST NOTIFICATIONS
   ========================================== */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999999;
  width: 90%;
  max-width: 380px;
  pointer-events: none;
}

@media (max-width: 576px) {
  #toast-container {
    top: 20px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

.toast {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  color: #fff;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease-out;
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.toast.toast-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.toast-exit {
  opacity: 0;
  transform: translateY(-20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045), opacity 0.3s ease-out;
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--color-success, #22c55e); }
.toast-error .toast-icon { color: var(--color-error, #ef4444); }
.toast-warning .toast-icon { color: var(--color-warning, #f59e0b); }
.toast-info .toast-icon { color: var(--color-info, #3b82f6); }

.toast-body {
  flex-grow: 1;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  color: #e2e8f0;
}

.toast-close {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.toast-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left;
  animation: toastCountdown 5s linear forwards;
}

.toast-success .toast-progress-bar { background: var(--color-success, #22c55e); }
.toast-error .toast-progress-bar { background: var(--color-error, #ef4444); }
.toast-warning .toast-progress-bar { background: var(--color-warning, #f59e0b); }
.toast-info .toast-progress-bar { background: var(--color-info, #3b82f6); }

@keyframes toastCountdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ==========================================================================
   FILTER BAR STANDARDIZATION & OVERRIDES (REDESIGNED FOR PREMIUM LOOK)
   ========================================================================== */
.filter-bar {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 12px !important;
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  padding: 14px 18px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25) !important;
  transition: all 0.3s ease !important;
}

.filter-bar select,
.filter-bar input[type="text"],
.filter-bar select.form-control,
.filter-bar input.form-control {
  display: inline-block !important;
  width: auto !important;
  max-width: 100% !important;
  height: 38px !important;
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
  line-height: 1.5 !important;
  vertical-align: middle !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
  color: #fff !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.filter-bar select:hover,
.filter-bar input[type="text"]:hover,
.filter-bar select.form-control:hover,
.filter-bar input.form-control:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.filter-bar select:focus,
.filter-bar input[type="text"]:focus,
.filter-bar select.form-control:focus,
.filter-bar input.form-control:focus {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--primary, #6366f1) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
  outline: none !important;
}

.filter-bar select {
  width: 145px !important;
}

/* Custom picker integration in filter-bars */
.filter-bar .custom-picker-wrapper {
  display: inline-block !important;
  width: 140px !important;
  position: relative !important;
}

.filter-bar .custom-picker-wrapper input[type="date"],
.filter-bar .custom-picker-wrapper input[type="time"] {
  display: none !important;
}

.filter-bar .custom-picker-trigger {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  height: 38px !important;
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
  color: var(--text-main) !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
}

.filter-bar .custom-picker-trigger:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.filter-bar .custom-picker-trigger i,
.filter-bar .custom-picker-trigger svg {
  width: 14px !important;
  height: 14px !important;
  color: var(--text-muted) !important;
}

/* Fallback for uninitialized date pickers */
.filter-bar input[type="date"]:not(.picker-initialized) {
  display: inline-block !important;
  width: 140px !important;
  height: 38px !important;
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
  color: #fff !important;
}

.filter-bar .search-wrapper,
.filter-bar div[style*="flex-grow"],
.filter-bar div[style*="flex: 1"] {
  flex-grow: 1 !important;
  display: flex !important;
  align-items: center !important;
}

.filter-bar .search-wrapper input,
.filter-bar div[style*="flex-grow"] input,
.filter-bar div[style*="flex: 1"] input {
  width: 100% !important;
  height: 38px !important;
  padding-left: 40px !important;
}

.filter-bar .btn {
  height: 38px !important;
  padding: 0 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.85rem !important;
  border-radius: 10px !important;
  transition: all 0.2s ease !important;
}

.filter-bar .btn:hover {
  transform: translateY(-1px) !important;
}

@media (max-width: 768px) {
  .filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 14px !important;
  }
  
  .filter-bar select,
  .filter-bar input[type="text"],
  .filter-bar select.form-control,
  .filter-bar input.form-control,
  .filter-bar .custom-picker-wrapper,
  .filter-bar input[type="date"]:not(.picker-initialized),
  .filter-bar .btn {
    width: 100% !important;
    height: 42px !important;
  }
  
  .filter-bar .custom-picker-trigger {
    height: 42px !important;
  }
  
  .filter-bar div[style*="flex-grow"],
  .filter-bar div[style*="flex: 1"] {
    width: 100% !important;
  }
}

/* Custom grid layouts for student profile details */
.student-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  flex: 1;
  min-width: 250px;
}

@media (max-width: 576px) {
  .student-profile-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
}

/* Custom class hub modal grid */
.class-hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .class-hub-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Prevent text overflow in notification messages list */
.notification-message {
  word-break: break-word !important;
  overflow-wrap: break-word !important;
}

/* Restore premium mobile bottom sheet modal animations & placement */
@media screen and (max-width: 900px) {
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
    overflow-y: hidden !important;
  }
  
  .modal-card,
  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 24px 24px 0 0 !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
    padding: 24px 20px !important;
    padding-bottom: calc(24px + var(--safe-bottom)) !important;
    animation: slideUpSheet 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  /* Fixed mobile sidebar overlay */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: var(--sidebar-width) !important;
    height: 100vh !important;
    z-index: 999990 !important;
    transform: translateX(-110%) !important;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .sidebar.sidebar-open {
    transform: translateX(0) !important;
  }
}

/* Full-width native layout for mobile login screens */
@media (max-width: 576px) {
  .login-split-wrapper {
    padding: 0 !important;
    background: #0b0f19 !important;
    background-image: radial-gradient(circle at 50% 30%, #111827 0%, #030712 100%) !important;
  }

  .login-interaction {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 100vh !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  .interaction-card {
    padding: 24px 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
}

/* ==========================================================================
   REFINE PORTAL SEARCH BARS (ICON ALIGNMENT & PRESENTATION)
   ========================================================================== */
#global-search-input,
#students-search-input,
#users-search-input,
#logs-search-input,
#acc-students-search,
#acc-history-search {
  padding-left: 40px !important;
  padding-right: 12px !important;
}

/* Ensure search icons are consistently positioned, centered and on top */
#global-search-container [data-lucide="search"],
.form-group [data-lucide="search"],
div[style*="position: relative"] [data-lucide="search"],
div[style*="position:relative"] [data-lucide="search"] {
  position: absolute !important;
  left: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 15px !important;
  height: 15px !important;
  color: var(--text-muted) !important;
  pointer-events: none !important;
  z-index: 10 !important;
  margin: 0 !important;
}

/* ==========================================================================
   STAFF ATTENDANCE REDESIGN FOR MOBILE (TOUCH-FRIENDLY & PREMIUM LOOK)
   ========================================================================== */
.staff-checkin-card {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.6));
  border: 1px solid var(--border-color);
  border-radius: 16px;
}
.checkin-info {
  display: flex;
  align-items: center;
  gap: 16px;
}
.checkin-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.checkin-icon-wrap i {
  width: 28px;
  height: 28px;
}
.checkin-text-wrap h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.checkin-text-wrap p {
  margin: 4px 0 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.checkin-actions {
  display: flex;
  gap: 12px;
}
.checkin-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  font-weight: 700;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.checkin-actions button i {
  width: 18px;
  height: 18px;
}

/* Mobile responsive adjustments */
@media (max-width: 900px) {
  .staff-checkin-card {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 18px;
  }
  .checkin-info {
    text-align: left;
  }
  .checkin-actions {
    flex-direction: row;
    gap: 12px;
    width: 100%;
  }
  .checkin-actions button {
    flex: 1;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .checkin-actions {
    flex-direction: column;
  }
}

/* Mobile Attendance Sheet Card Layout */
.mobile-att-card {
  background: rgba(30, 41, 59, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.mobile-att-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}
.mobile-att-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 8px;
}
.mobile-att-header .date {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}
.mobile-att-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 0.85rem;
}
.mobile-att-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.mobile-att-val {
  font-weight: 600;
  color: var(--text-main);
}
.mobile-att-location {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.15);
  padding: 8px;
  border-radius: 6px;
  margin-top: 4px;
}
.mobile-att-loc-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}
.mobile-att-loc-label {
  color: var(--text-muted);
}
.mobile-att-loc-val {
  font-family: monospace;
  color: var(--text-main);
}

/* ==========================================================================
   PARENT PORTAL GENERAL DESIGN SYSTEM CLASSES
   ========================================================================== */
.parent-child-card {
  margin: 0;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.4);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.parent-child-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.parent-child-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.parent-child-actions {
  display: flex;
  gap: 8px;
}
.parent-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* ==========================================================================
   MOBILE HEADER OPTIMIZATIONS (SLIM SIZE & SMOOTH SCROLL SHRINK ANIMATION)
   ========================================================================== */
@media (max-width: 900px) {
  .content-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0 !important;
    padding: calc(6px + var(--safe-top)) 12px 6px 12px !important;
    background: rgba(10, 14, 26, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: padding 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease, border-color 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease !important;
  }

  .content-header.header-scrolled {
    padding-top: calc(3px + var(--safe-top)) !important;
    padding-bottom: 3px !important;
    background: rgba(10, 14, 26, 0.98) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
  }

  .content-header.header-shrunk {
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .content-header.header-hidden {
    transform: translateY(-100%) translateY(-10px) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .header-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 0 1 auto !important;
  }

  .header-left h2 {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.3px !important;
    transition: font-size 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .content-header.header-scrolled .header-left h2 {
    font-size: 1.0rem !important;
  }

  .header-right {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-left: auto !important;
    justify-content: flex-end !important;
  }

  .header-center {
    display: none !important;
  }

  /* Parent Portal Mobile Optimized Card Rules */
  .parent-child-card {
    margin: 0 !important;
    padding: 16px !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(15, 23, 42, 0.55) !important;
    backdrop-filter: blur(16px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
  }
  .parent-child-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    padding-bottom: 12px !important;
    margin-bottom: 16px !important;
  }
  .parent-child-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
  }
  .parent-child-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .parent-dashboard-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .desktop-only-table {
    display: none !important;
  }
  .mobile-only-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 16px !important;
  }
}
.mobile-only-list {
  display: none;
}

/* ==========================================================================
   FILTER BAR STANDARDIZATION & OVERRIDES
   ========================================================================== */
.filter-bar {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px !important;
  background: rgba(255, 255, 255, 0.02) !important;
  padding: 12px !important;
  border-radius: var(--border-radius-sm, 8px) !important;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06)) !important;
}

.filter-bar select,
.filter-bar input[type="text"],
.filter-bar select.form-control,
.filter-bar input.form-control {
  display: inline-block !important;
  width: auto !important;
  max-width: 100% !important;
  height: 38px !important;
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
  line-height: 1.5 !important;
  vertical-align: middle !important;
}

.filter-bar select {
  width: 140px !important;
}

/* Custom picker integration in filter-bars */
.filter-bar .custom-picker-wrapper {
  display: inline-block !important;
  width: 140px !important;
  position: relative !important;
}

.filter-bar .custom-picker-wrapper input[type="date"],
.filter-bar .custom-picker-wrapper input[type="time"] {
  display: none !important;
}

.filter-bar .custom-picker-trigger {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  height: 38px !important;
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
  color: var(--text-main) !important;
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius-sm, 8px) !important;
  cursor: pointer !important;
}

.filter-bar .custom-picker-trigger i,
.filter-bar .custom-picker-trigger svg {
  width: 14px !important;
  height: 14px !important;
  color: var(--text-muted) !important;
}

/* Fallback for uninitialized date pickers */
.filter-bar input[type="date"]:not(.picker-initialized) {
  display: inline-block !important;
  width: 140px !important;
  height: 38px !important;
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
}

.filter-bar .search-wrapper,
.filter-bar div[style*="flex-grow"],
.filter-bar div[style*="flex: 1"] {
  flex-grow: 1 !important;
  display: flex !important;
  align-items: center !important;
}

.filter-bar .search-wrapper input,
.filter-bar div[style*="flex-grow"] input,
.filter-bar div[style*="flex: 1"] input {
  width: 100% !important;
  height: 38px !important;
  padding-left: 36px !important;
}

.filter-bar .btn {
  height: 38px !important;
  padding: 0 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.85rem !important;
}

@media (max-width: 768px) {
  .filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  
  .filter-bar select,
  .filter-bar input[type="text"],
  .filter-bar select.form-control,
  .filter-bar input.form-control,
  .filter-bar .custom-picker-wrapper,
  .filter-bar input[type="date"]:not(.picker-initialized),
  .filter-bar .btn {
    width: 100% !important;
    height: 42px !important;
  }
  
  .filter-bar .custom-picker-trigger {
    height: 42px !important;
  }
  
  .filter-bar div[style*="flex-grow"],
  .filter-bar div[style*="flex: 1"] {
    width: 100% !important;
  }
}

/* ==========================================================================
   DROPDOWN SELECT & OPTION CONTRAST FIXES
   ========================================================================== */
select, select.form-control {
  background-color: #1e293b !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}
select option, select.form-control option {
  background-color: #1e293b !important;
  color: #ffffff !important;
}

body.theme-light select,
body.theme-light select.form-control,
.theme-light select,
.theme-light select.form-control,
body.light-mode select,
body.light-mode select.form-control,
.light-mode select,
.light-mode select.form-control {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
}
body.theme-light select option,
body.theme-light select.form-control option,
.theme-light select option,
.theme-light select.form-control option,
body.light-mode select option,
body.light-mode select.form-control option,
.light-mode select option,
.light-mode select.form-control option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

/* ==========================================================================
   SCHOOL SETUP "SETTINGS HUB" LAYOUT
   ========================================================================== */

#setup-hub-view {
  animation: fadeIn 0.25s ease-out;
}

.setup-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.setup-hub-title h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0 0 4px 0;
  color: #fff;
  font-family: 'Inter', sans-serif;
}

.setup-hub-title p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  font-family: 'Inter', sans-serif;
}

.setup-hub-search {
  position: relative;
  width: 320px;
  max-width: 100%;
}

.setup-hub-search i, .setup-hub-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.setup-hub-search input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}

.setup-hub-search input:focus {
  outline: none;
  border-color: hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.5);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.15);
}

.setup-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.setup-hub-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-height: 160px;
  font-family: 'Inter', sans-serif;
}

.setup-hub-card > i:first-child, .setup-hub-card > svg:first-child {
  width: 32px;
  height: 32px;
  color: var(--text-main);
  margin-bottom: 16px;
  transition: color 0.2s ease;
}

.setup-card-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 8px 0;
}

.setup-card-content p {
  font-size: 0.85rem;
  font-weight: 400;
  color: #64748b; /* slate-500 */
  margin: 0;
  line-height: 1.4;
}

.setup-card-arrow {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 18px;
  height: 18px;
  color: var(--primary);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.2s ease-out;
}

.setup-hub-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.setup-hub-card:hover .setup-card-arrow {
  opacity: 1;
  transform: translateX(0);
}

.setup-hub-card:hover > i:first-child, .setup-hub-card:hover > svg:first-child {
  color: var(--primary);
}

.setup-hub-card:active {
  transform: scale(0.98);
}

/* Panel Header inside Setup */
.setup-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-back-hub {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 8px 12px;
  margin-left: -12px;
  border-radius: 8px;
  transition: background 0.2s;
  font-family: 'Inter', sans-serif;
}

.btn-back-hub i, .btn-back-hub svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.btn-back-hub:hover {
  background: hsla(var(--primary-hue), var(--primary-sat), var(--primary-lightness), 0.1);
}

.btn-back-hub:hover i, .btn-back-hub:hover svg {
  transform: translateX(-4px);
}

.setup-breadcrumb {
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
}

#setup-panels-container {
  animation: fadeIn 0.2s ease-out;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .setup-hub-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .setup-hub-grid {
    grid-template-columns: 1fr;
  }
  .setup-hub-card {
    min-height: auto;
    padding: 20px;
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }
  .setup-hub-card > i:first-child, .setup-hub-card > svg:first-child {
    margin-bottom: 0;
  }
  .setup-card-arrow {
    bottom: 50%;
    transform: translateY(50%) translateX(-8px);
  }
  .setup-hub-card:hover .setup-card-arrow {
    transform: translateY(50%) translateX(0);
  }
  
  .setup-panel-header {
    position: sticky;
    top: 0;
    background: var(--bg-main);
    z-index: 10;
    padding-top: 16px;
    margin-top: -16px;
  }
}

/* Student Portal Redesign Animations */
@keyframes modalPopIn {
  0% { opacity: 0; transform: scale(0.95) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
#student-modal .modal-card {
  animation: modalPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
#student-modal details > summary::-webkit-details-marker {
  display: none;
}
#student-modal details > summary {
  list-style: none;
}
#student-modal details[open] summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
#student-modal input[type='file']::file-selector-button {
  display: none;
}
#student-modal .form-control {
  transition: all 0.2s ease;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.06);
}
#student-modal .form-control:focus {
  transform: translateY(-1px);
  background: rgba(0,0,0,0.3);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2), inset 0 2px 4px rgba(0,0,0,0.1);
}

/* Wizard Parent Cards Premium Styles */
#student-modal .parent-type-card:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(99,102,241,0.4) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  background: linear-gradient(145deg, rgba(99,102,241,0.05) 0%, rgba(255,255,255,0.02) 100%) !important;
}
#student-modal .parent-type-card.selected {
  border-color: var(--primary) !important;
  background: linear-gradient(145deg, rgba(99,102,241,0.1) 0%, rgba(99,102,241,0.02) 100%) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
#student-modal .parent-type-card:hover .card-icon-container {
  background: rgba(99,102,241,0.2) !important;
}
#student-modal .parent-type-card:hover .card-icon-container i {
  color: var(--primary) !important;
}
#student-modal .parent-type-card.selected .selected-badge {
  opacity: 1 !important;
  transform: scale(1) !important;
}
#student-modal .parent-type-card .selected-badge {
  box-shadow: 0 4px 10px rgba(99,102,241,0.4);
}

/* Photo Upload Section Glowing Effect */
#student-wizard-photo-section {
  transition: all 0.3s ease;
}
#student-wizard-photo-section:hover {
  border-color: rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.2);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* Enforce frameless/borderless/transparent style and circular crop on the school logo images */
.school-logo,
.school-branding .school-logo {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.school-logo img,
.school-branding .school-logo img,
.presentation-logo img,
.mobile-logo-circle img {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Validation Error Input Highlight */
.border-error,
input.border-error,
select.border-error,
textarea.border-error {
  border-color: var(--color-error, #ef4444) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
  animation: shakeError 0.3s ease-in-out;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Onboarding Wizard Interactive Animations */
.wizard-step-indicator {
  transition: all 0.25s ease;
  user-select: none;
}
.wizard-step-indicator:hover .step-circle {
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
}
.wizard-step-indicator.active .step-circle {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.3), 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* ==========================================
 * ROLE-BASED VISIBILITY RULES (CSS-Driven)
 * Replaces slow DOM traversal on mobile devices.
 * ========================================== */

/* Default: Hide all role-restricted elements */
.admin-only, 
.teacher-only, 
.master-admin-only, 
.student-only, 
.parent-only, 
.accountant-only {
  display: none !important;
}

/* Master Admin & Developer */
body[data-role="Master Admin"] .master-admin-only,
body[data-role="Developer"] .master-admin-only {
  display: block !important;
}
/* Master Admin exception: Can see admin elements in specific views AND their respective navigation tabs */
body[data-role="Master Admin"] #users-view .admin-only,
body[data-role="Developer"] #users-view .admin-only,
body[data-role="Master Admin"] #logs-view .admin-only,
body[data-role="Developer"] #logs-view .admin-only,
body[data-role="Master Admin"] #import-view .admin-only,
body[data-role="Developer"] #import-view .admin-only,
body[data-role="Master Admin"] li:has(a[data-view="users-view"]),
body[data-role="Developer"] li:has(a[data-view="users-view"]),
body[data-role="Master Admin"] #nav-audit-logs,
body[data-role="Developer"] #nav-audit-logs,
body[data-role="Master Admin"] #nav-bulk-import,
body[data-role="Developer"] #nav-bulk-import {
  display: block !important;
}
/* Admin */
body[data-role="Admin"] .admin-only {
  display: block !important;
}

/* Teacher */
body[data-role="Teacher"] .teacher-only {
  display: block !important;
}

/* Student */
body[data-role="Student"] .student-only {
  display: block !important;
}

/* Parent */
body[data-role="Parent"] .parent-only {
  display: block !important;
}

/* Accountant */
body[data-role="Accountant"] .accountant-only {
  display: block !important;
}

/* Mobile Nav Flex Overrides */
body[data-role="Master Admin"] .master-admin-only.mobile-nav-link,
body[data-role="Developer"] .master-admin-only.mobile-nav-link,
body[data-role="Admin"] .admin-only.mobile-nav-link,
body[data-role="Teacher"] .teacher-only.mobile-nav-link,
body[data-role="Student"] .student-only.mobile-nav-link,
body[data-role="Parent"] .parent-only.mobile-nav-link,
body[data-role="Accountant"] .accountant-only.mobile-nav-link {
  display: flex !important;
}

/* --- COMPREHENSIVE SPLIT-SCREEN LOGIN & MFA LAYOUT (RESPONSIVE) --- */
.login-split-wrapper {
  display: flex !important;
  width: 100% !important;
  min-height: 100vh !important;
  background-color: #080c14 !important;
}

.login-presentation {
  flex: 1.2 !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: flex-start !important;
  padding: 60px 8% !important;
  background: linear-gradient(135deg, #090e1a 0%, #0f172a 60%, #1e293b 100%) !important;
  overflow: hidden !important;
}

.login-interaction {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  padding: 40px 20px !important;
  background: rgba(15, 23, 42, 0.85) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
  position: relative !important;
  z-index: 10 !important;
  overflow: auto !important;
}

.login-interaction::before,
.login-interaction::after {
  content: "" !important;
  flex: 1 1 auto !important;
  min-height: 20px !important;
}

.interaction-card {
  flex: 0 0 auto !important;
  width: 100% !important;
  max-width: 440px !important;
  background: rgba(15, 23, 42, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding: 44px 40px !important;
  border-radius: 24px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4) !important;
}

.mobile-brand-header {
  display: none !important;
}

/* Tablet / Small Desktop (max-width: 1100px) */
@media (max-width: 1100px) {
  .login-split-wrapper {
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px !important;
    background-image: radial-gradient(circle at 50% 30%, #0f172a 0%, #080c14 90%) !important;
  }
  .login-presentation {
    display: none !important;
  }
  .login-interaction {
    flex: none !important;
    width: 100% !important;
    display: flex !important;
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
  }
  .interaction-card {
    margin: auto !important;
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
  }
  .mobile-brand-header {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-bottom: 24px !important;
  }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .login-split-wrapper {
    padding: 16px 12px !important;
  }
  .interaction-card {
    padding: 28px 16px !important;
  }
}

/* --- HEIGHT-BASED MEDIA QUERIES TO COMPRESS LAYOUT ON ZOOM & SHORT SCREENS (DESKTOP ONLY) --- */
@media (min-width: 1101px) and (max-height: 850px) {
  .login-presentation {
    padding: 30px 6% !important;
  }
  .presentation-title {
    font-size: 2.8rem !important;
    margin-bottom: 12px !important;
  }
  .presentation-logo {
    margin-bottom: 24px !important;
  }
  .login-interaction {
    padding: 20px 20px !important;
  }
  .interaction-card {
    padding: 30px 24px !important;
  }
  .interaction-header {
    margin-bottom: 20px !important;
  }
  .interaction-heading {
    font-size: 1.7rem !important;
    margin-bottom: 4px !important;
  }
  .interaction-form {
    gap: 12px !important;
  }
  .quick-login-divider {
    margin: 16px 0 !important;
  }
  .quick-login-grid {
    gap: 6px !important;
    margin-bottom: 6px !important;
  }
  .quick-login-btn {
    min-height: 38px !important;
    padding: 8px 6px !important;
  }
}

@media (min-width: 1101px) and (max-height: 720px) {
  .presentation-title {
    font-size: 2.2rem !important;
  }
  .presentation-subtitle {
    font-size: 1rem !important;
  }
  .presentation-features {
    display: none !important;
  }
  .login-interaction {
    padding: 10px 16px !important;
  }
  .interaction-card {
    padding: 20px 20px !important;
    border-radius: 16px !important;
  }
  .interaction-header {
    margin-bottom: 12px !important;
  }
  .interaction-heading {
    font-size: 1.4rem !important;
  }
  .interaction-subheading {
    font-size: 0.85rem !important;
  }
  .quick-login-divider {
    margin: 10px 0 !important;
  }
  .quick-login-grid {
    gap: 4px !important;
  }
  .quick-login-btn {
    min-height: 32px !important;
    padding: 6px 4px !important;
    font-size: 0.72rem !important;
  }
  .btn-primary {
    padding: 8px 14px !important;
    font-size: 0.85rem !important;
  }
}

@media (min-width: 1101px) and (max-height: 600px) {
  .login-presentation {
    display: none !important;
  }
  .login-interaction {
    flex: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .interaction-card {
    max-width: 400px !important;
    padding: 12px 16px !important;
  }
  .interaction-header {
    margin-bottom: 8px !important;
  }
  .interaction-heading {
    font-size: 1.2rem !important;
  }
  .interaction-subheading {
    display: none !important;
  }
  .form-group-modern {
    gap: 4px !important;
  }
  .form-group-modern label {
    font-size: 0.75rem !important;
  }
  .input-modern-wrapper input {
    padding: 8px 12px 8px 40px !important;
    font-size: 0.85rem !important;
  }
  .input-icon {
    width: 16px !important;
    height: 16px !important;
    left: 12px !important;
  }
  .quick-login-divider {
    display: none !important;
  }
  .quick-login-grid {
    display: none !important;
  }
  #install-app-btn-container {
    display: none !important;
  }
}

/* Ensure role-based visibility rules do not override mobile hiding */
@media (max-width: 768px) {
  body[data-role] .desktop-only {
    display: none !important;
  }
}