/* ECE Management — Clean White Theme & Official Academic Aesthetic */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  /* Color Palette - Clean Academic White Theme */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.95);
  
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  /* Royal Academic Blue & Gold Accents */
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;

  --btn-black: #0f172a;
  --btn-black-hover: #1e293b;

  --accent-gold: #d97706;
  --accent-cyan: #0284c7;
  --accent-green: #16a34a;
  --accent-rose: #dc2626;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-body);
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* App Shell Layout */
#app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling - Crisp White Sidebar with Royal Blue & Gold Accents */
.sidebar {
  width: 270px;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.25rem;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 2px 0 10px rgba(0,0,0,0.03);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content {
  margin-left: 270px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Collapsed or Hidden (Login / Full Width Mode) */
#app-shell.sidebar-collapsed .sidebar {
  transform: translateX(-275px) !important;
}

#app-shell.sidebar-collapsed .main-content,
#app-sidebar[style*="display: none"] ~ .main-content,
#app-sidebar[style*="display: none"] + .main-content,
body.login-page-active .main-content,
.login-page-active .main-content {
  margin-left: 0 !important;
  width: 100% !important;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0 0.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.35rem;
  box-shadow: 0 4px 10px rgba(29, 78, 216, 0.25);
}

.brand-text h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1.2rem;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  transition: var(--transition);
}

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

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
  transform: translateX(4px);
}

.nav-link.active {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

.nav-link.active i {
  color: #ffffff;
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--border-color);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffffff;
}

.user-details h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-details span {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 600;
}

.sidebar-mobile-close {
  display: none;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: auto;
  font-size: 0.95rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.sidebar-mobile-close:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.sidebar-footer-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.btn-sidebar-logout {
  width: 100%;
  background: #fee2e2;
  color: #dc2626;
  border: 1.5px solid #fca5a5;
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.08);
}

.btn-sidebar-logout:hover,
.btn-sidebar-logout:active {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

/* Main Content Area */
.main-content {
  margin-left: 270px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Navbar - Clean White Header */
.top-navbar {
  height: 72px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

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

.badge-role {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.role-STUDENT { background: #eff6ff; color: var(--primary); border: 1px solid #bfdbfe; }
.role-TEACHER { background: #fef3c7; color: var(--accent-gold); border: 1px solid #fde68a; }
.role-HOD { background: #fef3c7; color: var(--accent-gold); border: 1px solid #fde68a; }

/* Dashboard Container */
.dashboard-container {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Stat Cards Grid - Clean White Cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.stat-info span {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-info h3 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  margin-top: 0.2rem;
  color: var(--text-main);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.icon-blue { background: #eff6ff; color: var(--primary); }
.icon-green { background: #f0fdf4; color: var(--accent-green); }
.icon-amber { background: #fffbeb; color: var(--accent-gold); }
.icon-rose { background: #fef2f2; color: var(--accent-rose); }

/* Glass Panels - Pure White with Crisp Borders */
.glass-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  color: var(--text-main);
}

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

.panel-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.panel-header h3 i {
  color: var(--primary);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.custom-table th {
  padding: 0.9rem 1.1rem;
  background: #f1f5f9;
  color: var(--text-main);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.8px;
  border-bottom: 2px solid var(--border-color);
}

.custom-table td {
  padding: 1.1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.custom-table tbody tr {
  transition: var(--transition);
}

.custom-table tbody tr:hover {
  background: #f8fafc;
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
}

.status-PENDING { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.status-APPROVED { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.status-REJECTED { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }

/* Pill Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-black {
  background: var(--btn-black);
  color: #ffffff;
}

.btn-black:hover {
  background: var(--btn-black-hover);
}

.btn-success {
  background: var(--accent-green);
  color: #ffffff;
}

.btn-danger {
  background: var(--accent-rose);
  color: #ffffff;
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
}

.btn:active {
  transform: scale(0.96) !important;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.2rem;
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  transform: scale(0.94);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
  animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes pulseGlow {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 12px rgba(37, 99, 235, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

#modal-file-preview .modal-content {
  max-width: 1040px;
  width: 95%;
  padding: 1.5rem;
}

#preview-stage-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
#preview-stage-container::-webkit-scrollbar-track {
  background: #090d16;
}
#preview-stage-container::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
}

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

/* Password Visibility Toggle */
.password-toggle-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-toggle-group .form-control {
  padding-right: 3rem !important;
}

.password-toggle-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  z-index: 5;
}

.password-toggle-btn:hover {
  color: var(--primary);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.35rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

/* Top Pill Badge */
.vibe-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.vibe-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

/* Login Page Specific - Full-Screen PC Split Layout vs Mobile Card View */
.login-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  padding: 0;
  margin: 0;
  background: #ffffff;
  box-sizing: border-box;
}

.login-container-responsive {
  display: flex;
  width: 100%;
  min-height: 100vh;
  box-sizing: border-box;
}

.login-desktop-hero {
  display: none;
}

.login-card-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1.5rem 1rem;
}

.login-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  box-sizing: border-box;
}

/* Compact Mobile Phone Adjustments (< 899px) */
@media screen and (max-width: 899px) {
  .login-wrapper {
    background: #f8fafc;
    padding: 1rem 0.6rem !important;
    align-items: flex-start !important;
  }

  .login-container-responsive {
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    min-height: auto;
  }

  .login-card-wrap {
    padding: 0;
  }

  .login-card {
    padding: 1.35rem 1rem !important;
    border-radius: 18px !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05) !important;
  }
}

/* Full Screen PC Split Layout (>= 900px) */
@media screen and (min-width: 900px) {
  .login-wrapper {
    background: radial-gradient(circle at 10% 20%, #f0f7ff 0%, #f8fafc 45%, #f1f5f9 100%);
    height: 100vh;
    max-height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
  }

  .login-container-responsive {
    flex-direction: row;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }

  .login-desktop-hero {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 52%;
    height: 100vh;
    max-height: 100vh;
    background: #f8fafc;
    background-image: radial-gradient(#cbd5e1 0.85px, transparent 0.85px);
    background-size: 24px 24px;
    border-right: 1.5px solid var(--border-color);
    color: var(--text-main);
    padding: clamp(1.2rem, 2.8vh, 2.5rem) clamp(1.75rem, 3.2vw, 3.5rem);
    box-sizing: border-box;
    position: relative;
    overflow-y: auto;
  }

  .login-desktop-hero::before {
    content: '';
    position: absolute;
    top: -15%;
    right: -15%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.18) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
  }

  .login-card-wrap {
    width: 48%;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 2vh, 1.75rem) clamp(1.5rem, 3vw, 3rem);
    box-sizing: border-box;
    overflow-y: auto;
  }

  .login-card {
    width: 100%;
    max-width: 440px;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 45px -12px rgba(30, 58, 138, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.8) inset !important;
    padding: 1.45rem 1.65rem !important;
    background: #ffffff !important;
    box-sizing: border-box;
  }
}




/* WhatsApp-Style Upper Corner Notification Badges */
.badge-whatsapp-top {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent-rose);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 19px;
  height: 19px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
  border: 1.5px solid #ffffff;
  line-height: 1;
  z-index: 10;
}

.badge-whatsapp-nav {
  margin-left: auto;
  background: var(--accent-rose);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
  line-height: 1;
}

/* Toast Banners */
/* Premium Modern Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  z-index: 999999;
  max-width: 380px;
  width: calc(100vw - 3rem);
  pointer-events: none;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(50px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.toast {
  pointer-events: auto;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 500;
  font-size: 0.88rem;
  animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.toast-success::before { background: #16a34a; }
.toast-error::before { background: #dc2626; }
.toast-warning::before { background: #d97706; }
.toast-info::before { background: #2563eb; }
.toast-loading::before { background: #2563eb; }

.toast-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-success .toast-icon-wrap { color: #16a34a; }
.toast-error .toast-icon-wrap { color: #dc2626; }
.toast-warning .toast-icon-wrap { color: #d97706; }
.toast-info .toast-icon-wrap { color: #2563eb; }
.toast-loading .toast-icon-wrap { color: #2563eb; }

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

.toast-title {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.25;
}

.toast-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  line-height: 1.35;
}

.toast-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: 1;
  transition: color 0.15s ease;
}

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

/* ==================================================== */
/* MOBILE & APP RESPONSIVE DRAWER & BREAKPOINTS */
/* ==================================================== */

.mobile-overlay-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 95;
}

.mobile-overlay-backdrop.active {
  display: block;
}

.mobile-hamburger {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.35rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.4rem;
}

@media screen and (max-width: 900px) {
  #btn-sidebar-collapse {
    display: none !important;
  }

  .sidebar-mobile-close {
    display: inline-flex !important;
  }

  .mobile-hamburger {
    display: inline-flex !important;
  }

  .sidebar {
    width: min(300px, 85vw);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    z-index: 1000;
    overflow-y: auto;
  }

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

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

  .top-navbar {
    padding: 0 0.85rem !important;
  }

  .dashboard-container {
    padding: 1rem 0.75rem !important;
    gap: 1rem !important;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.85rem !important;
  }
}

@media screen and (max-width: 640px) {
  /* Prevent iOS zoom jumps on focus */
  input, select, textarea {
    font-size: 16px !important;
  }

  .stat-grid {
    grid-template-columns: 1fr !important;
  }

  .top-navbar {
    height: 56px !important;
    padding: 0 0.5rem !important;
    gap: 0.4rem !important;
  }

  .navbar-actions {
    gap: 0.35rem !important;
    flex-shrink: 0 !important;
    margin-left: auto;
  }

  .navbar-actions .btn {
    padding: 0.4rem 0.55rem !important;
    font-size: 0.75rem !important;
  }

  #btn-universal-edit-profile-nav .btn-text {
    display: none !important;
  }

  #btn-universal-edit-profile-nav {
    padding: 0.4rem 0.6rem !important;
    border-radius: var(--radius-md) !important;
  }

  #btn-logout {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border: 1.5px solid #fca5a5 !important;
    font-weight: 800 !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    padding: 0.4rem 0.65rem !important;
  }

  #btn-logout:hover,
  #btn-logout:active {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
  }

  .page-title {
    font-size: 0.95rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
  }

  .btn {
    padding: 0.55rem 0.9rem;
    font-size: 0.85rem;
  }

  .panel-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  .panel-header h3 {
    font-size: 1.1rem !important;
    line-height: 1.35 !important;
  }

  .panel-header .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .login-card {
    padding: 1.5rem 1.1rem !important;
    border-radius: var(--radius-md) !important;
  }

  .login-wrapper {
    padding: 1rem 0.5rem !important;
  }

  .modal-content {
    width: 95% !important;
    max-width: 95% !important;
    margin: 1rem auto !important;
    padding: 1.35rem 1rem !important;
    max-height: 88vh !important;
  }

  .table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
    margin-bottom: 0.75rem !important;
  }

  .custom-table th, 
  .custom-table td {
    padding: 0.65rem 0.75rem !important;
    font-size: 0.82rem !important;
  }
}

@media screen and (max-width: 480px) {
  .page-title {
    max-width: 85px;
    font-size: 0.88rem !important;
  }

  #navbar-role-badge {
    font-size: 0.65rem !important;
    padding: 0.18rem 0.35rem !important;
  }

  .navbar-actions .btn {
    padding: 0.38rem 0.5rem !important;
    font-size: 0.72rem !important;
  }

  .dashboard-container {
    padding: 0.85rem 0.5rem !important;
  }

  .glass-panel {
    padding: 1rem 0.75rem !important;
  }

  .timetable-header-info {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  .timetable-header-info h2 {
    font-size: 1.25rem !important;
  }
}

/* ==================================================== */
/* OFFICIAL PDF & PRINT STYLING - ULTRA COMPACT SINGLE PAGE */
/* ==================================================== */
/* WhatsApp Style Red Notification Badges */
.badge-whatsapp-nav {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: #ef4444;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  animation: pulse-red-badge 2s infinite;
}

.badge-whatsapp-top {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

@keyframes pulse-red-badge {
  0% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-50%) scale(1.08); }
  100% { transform: translateY(-50%) scale(1); }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 7mm 6mm;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 9.5px !important;
    width: 100% !important;
  }
  
  .sidebar, .top-navbar, .no-print, .btn, .modal-overlay,
  #btn-report-div-a, #btn-report-div-b, #btn-report-div-all {
    display: none !important;
  }

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

  .dashboard-container {
    padding: 0 !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .print-only-header {
    display: block !important;
    margin-bottom: 12px !important;
    padding-bottom: 6px !important;
    border-bottom: 2px solid #000000 !important;
    text-align: center !important;
  }

  .print-only-header h3 {
    font-size: 15px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    margin: 0 !important;
  }

  .print-only-header h4 {
    font-size: 12px !important;
    font-weight: 700 !important;
    margin: 3px 0 0 !important;
  }

  .print-only-header p {
    font-size: 10px !important;
    color: #333333 !important;
    margin: 2px 0 0 !important;
  }

  .glass-panel {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 0 1.5rem 0 !important;
    background: #ffffff !important;
  }

  /* CRITICAL: Unset scroll container so ALL student rows from Roll 1 to 81 print without clipping */
  .attendance-matrix-scroll-container,
  .table-responsive {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    border: none !important;
    box-shadow: none !important;
    display: block !important;
    width: 100% !important;
  }

  .attendance-matrix-scroll-container table,
  .custom-table,
  .print-clean-table {
    width: 100% !important;
    min-width: 100% !important;
    border-collapse: collapse !important;
    page-break-inside: auto !important;
    font-size: 8.5px !important;
  }

  .attendance-matrix-scroll-container thead {
    display: table-header-group !important;
    position: static !important;
  }

  .attendance-matrix-scroll-container thead tr,
  .attendance-matrix-scroll-container thead th,
  .custom-table th {
    position: static !important;
    box-shadow: none !important;
    top: auto !important;
    background: #f1f5f9 !important;
    color: #000000 !important;
    border: 1px solid #64748b !important;
    padding: 4px 3px !important;
    font-weight: 800 !important;
  }

  .attendance-matrix-scroll-container tbody tr,
  .custom-table tbody tr {
    page-break-inside: avoid !important;
    page-break-after: auto !important;
  }

  .attendance-matrix-scroll-container tbody td,
  .custom-table td {
    border: 1px solid #94a3b8 !important;
    color: #000000 !important;
    padding: 3px 2px !important;
    font-size: 8.5px !important;
    line-height: 1.15 !important;
  }

  .attendance-matrix-scroll-container tfoot {
    display: table-footer-group !important;
    position: static !important;
  }

  .attendance-matrix-scroll-container tfoot tr,
  .attendance-matrix-scroll-container tfoot td {
    position: static !important;
    box-shadow: none !important;
    bottom: auto !important;
    border: 1.5px solid #000000 !important;
    font-weight: 800 !important;
    font-size: 9px !important;
    background: #e2e8f0 !important;
    color: #000000 !important;
  }

  /* Clean section breaks in print */
  #section-report-div-a {
    display: block !important;
    page-break-after: always !important;
  }

  #section-report-div-b {
    display: block !important;
    page-break-after: always !important;
  }


}

/* ==========================================================================
   High-Performance Route Transition Buffer & Modern Glassmorphism Loader
   ========================================================================== */
.app-route-loader {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 15, 30, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease-in-out;
}

.app-route-loader.active {
  opacity: 1;
  pointer-events: all;
}

.loader-card {
  position: relative;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 1.5px solid rgba(96, 165, 250, 0.35);
  border-radius: 24px;
  padding: 2.2rem 2.8rem;
  text-align: center;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.75), 0 0 35px rgba(37, 99, 235, 0.25);
  max-width: 380px;
  width: 90%;
  animation: erpLoaderCardPop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes erpLoaderCardPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.loader-logo-ring {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 1.25rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-icon {
  font-size: 2.2rem;
  color: #38bdf8;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.6));
  animation: erpPulseScale 1.8s ease-in-out infinite alternate;
}

.orbital-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: #38bdf8;
  border-right-color: #818cf8;
  border-bottom-color: #06b6d4;
  animation: erpSpinOrbital 1.1s linear infinite;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

@keyframes erpSpinOrbital {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes erpPulseScale {
  0% { transform: scale(0.95); opacity: 0.85; }
  100% { transform: scale(1.08); opacity: 1; }
}

.loader-text {
  margin-bottom: 1.2rem;
}

.loader-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.loader-subtitle {
  font-size: 0.84rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.loader-shimmer-bar {
  width: 100%;
  height: 4px;
  background: rgba(51, 65, 85, 0.6);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.loader-shimmer-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 50%;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #38bdf8);
  border-radius: 9999px;
  animation: erpShimmerSlide 1.2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

@keyframes erpShimmerSlide {
  0% { left: -50%; width: 40%; }
  50% { width: 65%; }
  100% { left: 100%; width: 40%; }
}

/* Smooth Content Entrance Animation for All View Mounts */
.erp-fade-in {
  animation: erpContentFadeIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes erpContentFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
/* ==========================================================================
   User-Designed First-Time Loading & Welcome Experience ("ECE ERP")
   ========================================================================== */
#app-first-load-splash, #app-welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999999;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(76, 126, 255, .13), transparent 36%),
    radial-gradient(ellipse at 90% 80%, rgba(46, 103, 240, .10), transparent 34%),
    #f7f9ff;
  overflow: hidden;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.45s;
}

#app-first-load-splash.splash-hidden, #app-welcome-overlay.welcome-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-welcome-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  border: 1px solid rgba(36, 87, 232, .12);
  z-index: -1;
  animation: splashOrbFloat 7s ease-in-out infinite;
}

.splash-welcome-orb.orb-one {
  width: 260px;
  height: 260px;
  top: 8%;
  left: -90px;
}

.splash-welcome-orb.orb-two {
  width: 340px;
  height: 340px;
  right: -140px;
  bottom: 5%;
  animation-delay: -3s;
}

.splash-welcome-panel {
  width: min(100%, 520px);
  text-align: center;
  padding: clamp(28px, 6vw, 52px) clamp(22px, 5vw, 48px);
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(213, 225, 250, .92);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(32, 67, 147, .12), 0 3px 12px rgba(32, 67, 147, .04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: splashPanelIn .8s cubic-bezier(.2, .8, .2, 1) both;
}

.splash-logo-wrap {
  width: 96px;
  height: 96px;
  margin: 0 auto 25px;
  position: relative;
  display: grid;
  place-items: center;
}

.splash-logo-wrap::before, .splash-logo-wrap::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 1.5px solid rgba(36, 87, 232, .28);
  border-radius: 28px;
  animation: splashPulse 2.2s ease-out infinite;
}

.splash-logo-wrap::after {
  animation-delay: 1.1s;
}

.splash-chip-logo {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 23px;
  box-shadow: 0 12px 26px rgba(36, 87, 232, .24);
  animation: splashLogoFloat 3s ease-in-out infinite;
}

.splash-eyebrow {
  color: #2457e8;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  font-weight: 800;
  margin: 0 0 11px;
}

.splash-headline {
  margin: 0;
  font-size: clamp(2.05rem, 7vw, 2.9rem);
  font-family: var(--font-heading);
  letter-spacing: -.055em;
  line-height: 1.1;
  color: #101a32;
  font-weight: 800;
}

.splash-headline span {
  color: #2457e8;
}

.splash-subtitle {
  margin: 13px auto 0;
  max-width: 370px;
  color: #66738b;
  line-height: 1.65;
  font-size: .98rem;
  font-weight: 500;
}

.splash-loader-area {
  margin: 34px auto 0;
  max-width: 330px;
}

.splash-loader-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .77rem;
  color: #66738b;
  margin-bottom: 10px;
}

.splash-loader-label strong {
  color: #2457e8;
  font-weight: 750;
}

.splash-track {
  height: 7px;
  border-radius: 99px;
  background: #e9effd;
  overflow: hidden;
}

.splash-progress {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4c7dff, #2457e8, #79a2ff);
  box-shadow: 0 0 14px rgba(36, 87, 232, .28);
  transition: width .12s linear;
}

.splash-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 24px;
}

.splash-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b8c9f5;
  animation: splashDot 1s ease-in-out infinite;
  display: inline-block;
}

.splash-dots i:nth-child(2) { animation-delay: .15s; }
.splash-dots i:nth-child(3) { animation-delay: .3s; }

.splash-status {
  margin-top: 12px;
  color: #7b88a0;
  font-size: .78rem;
  min-height: 1.2em;
}

.splash-enter-btn {
  display: none;
  margin: 25px auto 0;
  border: 0;
  border-radius: 14px;
  padding: 13px 24px;
  color: white;
  background: #2457e8;
  font: inherit;
  font-size: .9rem;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 9px 22px rgba(36, 87, 232, .25);
  transition: transform .2s, background .2s;
  text-decoration: none;
}

.splash-enter-btn:hover {
  background: #163bb2;
  transform: translateY(-2px);
}

.splash-enter-btn:focus-visible {
  outline: 3px solid #9bb6ff;
  outline-offset: 3px;
}

.splash-footer {
  margin-top: 30px;
  color: #94a0b5;
  font-size: .72rem;
  letter-spacing: .08em;
  font-weight: 600;
}

.splash-welcome-panel.welcome .splash-loader-area,
.splash-welcome-panel.welcome .splash-dots,
.splash-welcome-panel.welcome .splash-status {
  display: none;
}

.splash-welcome-panel.welcome .splash-enter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: splashButtonIn .45s ease both;
}

.splash-welcome-panel.welcome .splash-logo-wrap::before {
  animation-duration: 3.2s;
}

.splash-welcome-panel.welcome .splash-subtitle {
  animation: splashFadeUp .6s .1s both;
}

@keyframes splashPulse { 0% { transform: scale(.82); opacity: .8; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes splashLogoFloat { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(-2deg); } }
@keyframes splashPanelIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes splashFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes splashButtonIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes splashOrbFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
@keyframes splashDot { 0%,80%,100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

@media (max-width: 520px) {
  .splash-welcome-panel { border-radius: 23px; padding: 32px 18px; }
  .splash-headline { font-size: 2.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .splash-welcome-orb, .splash-welcome-panel, .splash-logo-wrap::before, .splash-logo-wrap::after, .splash-chip-logo, .splash-dots i, .splash-enter-btn {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ==========================================================================
   Certificate File Preview Opening Animation (Laser Scanner & Vault Loading)
   ========================================================================== */
.cert-file-loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 3rem 1.5rem;
  background: radial-gradient(circle at 50% 45%, #0f172a 0%, #020617 100%);
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.7);
}

.cert-doc-scanner-frame {
  position: relative;
  width: 140px;
  height: 175px;
  background: rgba(15, 23, 42, 0.92);
  border: 2px solid rgba(56, 189, 248, 0.5);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.4rem;
  overflow: hidden;
}

.cert-doc-scanner-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(56, 189, 248, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.08) 1px, transparent 1px);
  background-size: 14px 14px;
  pointer-events: none;
}

.cert-laser-beam {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #38bdf8, #22d3ee, #38bdf8, transparent);
  box-shadow: 0 0 12px #38bdf8, 0 0 24px #22d3ee;
  animation: certLaserScan 1.5s ease-in-out infinite alternate;
  z-index: 5;
}

@keyframes certLaserScan {
  0% { top: 6%; opacity: 0.4; }
  50% { opacity: 1; }
  100% { top: 92%; opacity: 0.4; }
}

.cert-doc-icon {
  font-size: 3.6rem;
  color: #60a5fa;
  filter: drop-shadow(0 0 16px rgba(96, 165, 250, 0.55));
  z-index: 2;
  animation: certIconFloat 2s ease-in-out infinite alternate;
}

@keyframes certIconFloat {
  0% { transform: translateY(-3px) scale(0.98); }
  100% { transform: translateY(3px) scale(1.02); }
}

.cert-loader-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.cert-loader-title {
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.cert-loader-subtitle {
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 600;
  max-width: 320px;
  text-align: center;
  margin-bottom: 1.25rem;
}

.cert-loader-progress {
  width: 180px;
  height: 4px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.cert-loader-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 9999px;
  animation: certProgressSlide 1.1s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
}

@keyframes certProgressSlide {
  0% { left: -40%; width: 35%; }
  50% { width: 55%; }
  100% { left: 100%; width: 35%; }
}




/* ==========================================================================
   Attendance Matrix Locked Sticky Header on Scroll (Permanent Section & Subject Headers)
   ========================================================================== */
.attendance-matrix-scroll-container {
  width: 100%;
  max-height: 72vh;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  background: #ffffff;
  margin-bottom: 2rem;
  position: relative;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
}

.attendance-matrix-scroll-container.expanded-view {
  max-height: none !important;
  overflow-y: visible !important;
}

.attendance-matrix-scroll-container table {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  min-width: 950px;
}

.attendance-matrix-scroll-container thead {
  position: sticky;
  top: 0;
  z-index: 30;
}

/* Tier 1 Header: Section Names (Student Info, Theory, Labs, Total Summary) */
.attendance-matrix-scroll-container thead tr:first-child th {
  position: sticky !important;
  top: 0 !important;
  z-index: 30 !important;
  height: 36px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Tier 2 Header: Subject Columns (Roll, Name, PRN, SS, DSA, SDC, etc.) */
.attendance-matrix-scroll-container thead tr:nth-child(2) th {
  position: sticky !important;
  top: 36px !important;
  z-index: 29 !important;
  height: 34px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Total row sits naturally AT THE VERY LAST of the student list */
.attendance-matrix-scroll-container tfoot {
  position: static !important;
}

.attendance-matrix-scroll-container tfoot tr td {
  position: static !important;
  bottom: auto !important;
  box-shadow: none !important;
}
