:root {
    --bg-color: #030712;
    --glass-bg: rgba(17, 24, 39, 0.5);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary-cyan: #00f0ff;
    --primary-purple: #b026ff;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --input-bg: rgba(255, 255, 255, 0.03);
    --input-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding: 2rem 0;
}

/* Background Elements */
.background-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

#particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.gradient-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out alternate;
}

.sphere-1 {
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, var(--primary-cyan) 0%, transparent 70%);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.sphere-2 {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--primary-purple) 0%, transparent 70%);
    bottom: -20%;
    right: -10%;
    animation-delay: -5s;
}

.sphere-3 {
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, #022550 0%, transparent 70%);
    top: 40%;
    left: 40%;
    opacity: 0.6;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(5%, 5%) scale(1.1); }
    100% { transform: translate(-5%, 10%) scale(0.9); }
}

/* Authentication Container */
.auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 460px;
    padding: 20px;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-container {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 1.2rem;
}

.logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-glow {
    position: absolute;
    inset: -5px;
    background: linear-gradient(45deg, var(--primary-cyan), var(--primary-purple));
    border-radius: 22px;
    filter: blur(15px);
    opacity: 0.7;
    z-index: 1;
    animation: pulse 4s infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.5; filter: blur(15px); }
    100% { opacity: 0.8; filter: blur(20px); }
}

.app-name {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0;
    background: linear-gradient(to right, var(--primary-cyan), var(--primary-purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 2px;
    margin-top: 0.5rem;
    text-transform: uppercase;
}

/* Forms */
.form-wrapper {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
}

.auth-form {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.auth-form.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: all;
}

/* Inputs */
.input-group {
    position: relative;
    margin-bottom: 1.25rem;
    border-radius: 12px;
    overflow: hidden;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    transition: border-color 0.3s ease, background 0.3s ease;
}

.input-group:focus-within {
    border-color: rgba(0, 240, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.input-group input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 1.5rem 3rem 0.6rem 1.2rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}

.input-group label {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    pointer-events: none;
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
    top: 0.8rem;
    font-size: 0.75rem;
    color: var(--primary-cyan);
}

.focus-glow {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-purple));
    transition: width 0.4s ease;
}

.input-group input:focus ~ .focus-glow {
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
    user-select: none;
    z-index: 5;
    background: transparent;
}

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

/* Utilities */
.form-options {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
    margin-top: -0.25rem;
}

.forgot-password {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-cyan);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(90deg, #00d2ff, #3a7bd5);
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-purple));
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-top: 0.5rem;
    box-shadow: 0 4px 15px rgba(176, 38, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 240, 255, 0.35);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-text {
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: skewX(-20deg);
    transition: 0s;
    z-index: 1;
}

.btn-primary:hover .btn-glow {
    animation: shine 1.2s ease-in-out;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* Toggle & Divider */
.toggle-mode {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.text-btn {
    background: none;
    border: none;
    color: var(--primary-cyan);
    font-family: inherit;
    font-size: inherit;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-left: 0.3rem;
    transition: all 0.3s ease;
}

.text-btn:hover {
    color: var(--primary-purple);
    text-shadow: 0 0 10px rgba(176, 38, 255, 0.4);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--glass-border);
}

.divider span {
    padding: 0 1rem;
}

/* Responsive */
@media (max-width: 480px) {
    .glass-panel {
        padding: 2.5rem 1.5rem;
        border-radius: 20px;
    }
    
    .app-name {
        font-size: 1.8rem;
    }
}

/* Attendance Module Styles */

.class-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px 0;
  justify-content: flex-start;
}

.class-tab {
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.class-tab:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--primary-cyan);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 240, 255, 0.25);
}

.class-tab.active {
  background: linear-gradient(90deg, var(--primary-cyan), var(--primary-purple));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.4);
  transform: translateY(-2px);
}

.holiday-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 10px 15px;
  margin: 10px 0;
  color: #856404;
  font-weight: 600;
}

.attendance-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
}

.attendance-table th,
.attendance-table td {
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 14px;
}

.attendance-table th {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
}

.attendance-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.status-btn {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.2s ease;
  min-width: 40px;
}

.status-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.present-btn.selected {
  background: #10b981;
  color: white;
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.absent-btn.selected {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.late-btn.selected {
  background: #f59e0b;
  color: white;
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.status-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin: 15px 0;
}

.cal-header {
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  padding: 5px;
  color: #666;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #eee;
}

.cal-day.present { background: #d4edda; color: #155724; }
.cal-day.missing { background: #f8d7da; color: #721c24; }
.cal-day.holiday { background: #fff3cd; color: #856404; }
.cal-day.future { background: #f8f9fa; color: #aaa; }
.cal-day.empty { border: none; background: transparent; }

.month-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.month-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.month-card-header h3 {
  margin: 0;
  font-size: 18px;
}

.month-percentage {
  font-size: 20px;
  font-weight: 700;
}

.month-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
  font-size: 14px;
}

.view-details-btn {
  width: 100%;
  padding: 8px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  text-align: center;
}

.daily-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}

.daily-table th,
.daily-table td {
  padding: 8px;
  border: 1px solid #eee;
  text-align: left;
}

.daily-table th {
  background: #f8f9fa;
}

.overall-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.overall-card h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-item {
  text-align: center;
  flex: 1;
  min-width: 60px;
}

.stat-number {
  display: block;
  font-size: 22px;
  font-weight: 700;
}

.stat-label {
  font-size: 11px;
  opacity: 0.85;
}

.profile-section {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.user-photo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ddd;
}

.user-info h2 {
  margin: 0 0 5px 0;
  font-size: 18px;
}

.user-info p {
  margin: 0;
  color: #666;
  font-size: 13px;
}

.holiday-btn {
  padding: 8px 16px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #856404;
  margin: 8px 0;
}

.mark-all-btn {
  padding: 8px 16px;
  background: #d4edda;
  border: 1px solid #28a745;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #155724;
  margin: 8px 0;
}

@media (max-width: 480px) {
  .attendance-table th,
  .attendance-table td {
    padding: 6px 4px;
    font-size: 12px;
  }
  
  .status-btn {
    padding: 4px 6px;
    min-width: 28px;
    font-size: 11px;
  }
  
  .stats-row {
    gap: 5px;
  }
  
  .stat-number {
    font-size: 18px;
  }
}

#attendanceTableContainer {
  overflow-x: auto;
  margin-top: 15px;
  -webkit-overflow-scrolling: touch;
}

/* ──────────────────────────────────────────────────────────────────────────
   PREMIUM MOBILE RESPONSIVENESS & TOUCH OPTIMIZATIONS (GLOBAL)
   ────────────────────────────────────────────────────────────────────────── */

/* Custom Premium Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-cyan), var(--primary-purple));
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-cyan);
}

/* Scrollable Container Touch Feedback */
#attendanceTableContainer, 
.table-responsive,
[style*="overflow-x:auto"],
[style*="overflow-y:auto"] {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-cyan) transparent;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}

/* Premium Glass panels responsive padding */
@media (max-width: 768px) {
  .glass-panel {
    padding: 1.75rem 1.25rem;
    border-radius: 16px;
  }
  .page-wrap {
    padding: 16px 12px 32px !important;
  }
}

/* Forms and interactive scaling on mobile */
@media (max-width: 480px) {
  /* Tap Target Optimizations */
  button, 
  .btn-primary, 
  .btn-submit, 
  .btn-preview-act,
  .btn-save-all,
  .status-btn,
  .tab-btn,
  .class-tab {
    min-height: 42px; /* Ensure comfortable tap area */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, background-color 0.2s ease !important;
  }
  
  button:active, 
  .btn-primary:active, 
  .btn-submit:active,
  .class-tab:active {
    transform: scale(0.96) !important;
  }

  /* Form spacing adjustments */
  .controls-card {
    padding: 14px !important;
    gap: 12px !important;
  }
  .control-group {
    min-width: 100% !important;
  }
  .btn-load {
    width: 100%;
    margin-top: 4px;
  }
  
  /* Text and headers spacing */
  .page-title {
    font-size: 20px !important;
  }
  .page-sub {
    font-size: 12px !important;
  }
}

/* 3D ID Card Preview Scaling to prevent horizontal clipping */
@media (max-width: 480px) {
  .id-card-wrapper {
    transform: scale(0.88);
    transform-origin: center top;
    margin-bottom: -50px !important; /* Offset visual collapse */
  }
}
@media (max-width: 360px) {
  .id-card-wrapper {
    transform: scale(0.78);
    transform-origin: center top;
    margin-bottom: -95px !important; /* Offset visual collapse */
  }
}

/* Ensure report table & marks sheet displays cleanly on mobile */
@media (max-width: 600px) {
  .results-table th, .results-table td {
    padding: 8px 4px !important;
    font-size: 11px !important;
  }
  .subject-input {
    width: 42px !important;
    padding: 4px 2px !important;
    font-size: 11px !important;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   FEES MODULE — Status Badges & Utility Styles
   ────────────────────────────────────────────────────────────────────────── */

/* Fees status badge (used in student-fees.html) */
.fee-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.fee-badge.paid      { background: rgba(0,200,100,0.14);  border: 1px solid rgba(0,200,100,0.3);  color: #00cc66; }
.fee-badge.unpaid    { background: rgba(255,60,60,0.14);   border: 1px solid rgba(255,60,60,0.3);   color: #ff4444; }
.fee-badge.due       { background: rgba(255,170,0,0.14);   border: 1px solid rgba(255,170,0,0.3);   color: #ffaa00; }
.fee-badge.concession { background: rgba(80,150,255,0.14); border: 1px solid rgba(80,150,255,0.3); color: #5096ff; }

/* Fees table scrollable container */
#feesTableContainer {
  overflow-x: auto;
  margin-top: 15px;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}

/* Mark-all-paid button (fees page variant) */
.mark-all-paid-btn {
  padding: 9px 16px;
  background: rgba(0,200,100,0.1);
  border: 1px solid rgba(0,200,100,0.25);
  color: #00cc66;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.mark-all-paid-btn:hover { background: rgba(0,200,100,0.18); }

/* Fees period navigation */
.period-nav-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  font-family: inherit;
}
.period-nav-btn:hover { background: rgba(255,255,255,0.12); }

/* ──────────────────────────────────────────────────────────────────────────
   RESULTS MODULE — Marks Table, Grade Badges, AB Button, Result Card
   ────────────────────────────────────────────────────────────────────────── */

/* Marks table horizontal scroll wrapper */
.marks-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-cyan) transparent;
  border-radius: 10px;
}

/* Sticky first two columns — Roll No and Name — always visible on mobile scroll */
.marks-table .col-sticky-0,
.marks-table .col-sticky-1 {
  position: sticky;
  background: #0e1118;
  z-index: 2;
}
.marks-table .col-sticky-0 { left: 0; min-width: 48px; }
.marks-table .col-sticky-1 { left: 48px; min-width: 100px; }
.marks-table thead .col-sticky-0,
.marks-table thead .col-sticky-1 { z-index: 3; background: #0b0d14; }

/* Grade badge colors (results module) */
.grade-badge-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.grade-aplus { background: #1a3d2b; color: #00e87a; border: 1px solid rgba(0,232,122,0.3); }
.grade-a     { background: #1a3522; color: #28e060; border: 1px solid rgba(40,224,96,0.3); }
.grade-b     { background: #0f2a30; color: #00d4cc; border: 1px solid rgba(0,212,204,0.3); }
.grade-c     { background: #302a00; color: #ffd700; border: 1px solid rgba(255,215,0,0.3); }
.grade-d     { background: #302008; color: #ff9900; border: 1px solid rgba(255,153,0,0.3); }
.grade-f     { background: #30080e; color: #ff4d6d; border: 1px solid rgba(255,77,109,0.3); }

/* Marks input cells */
.marks-cell-input {
  width: 60px;
  min-height: 44px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  text-align: center;
  outline: none;
  font-family: inherit;
  padding: 4px;
  transition: border-color 0.2s, background 0.2s;
}
.marks-cell-input:focus { border-color: var(--primary-cyan); background: rgba(0,240,255,0.05); }
.marks-cell-input.error { border-color: #ff4d4d !important; background: rgba(255,77,77,0.09) !important; }
.marks-cell-input:disabled { opacity: 0.4; cursor: not-allowed; }

/* AB (Absent) button */
.btn-ab {
  background: transparent;
  border: 1px solid #ff9900;
  color: #ff9900;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  display: block;
  margin: 4px auto 0;
}
.btn-ab:hover { background: rgba(255,153,0,0.1); }
.btn-ab.absent-active { background: rgba(255,153,0,0.15); }
.absent-label { color: #ff9900; font-weight: 700; font-size: 12px; }

/* Result Card — clean printable-style with white background */
.result-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  color: #1a1a1a;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  font-family: 'Poppins', 'Outfit', sans-serif;
}
.result-card .rc-marks-table td,
.result-card .rc-marks-table th { color: #1a1a1a; }

/* Result card fail row highlight */
.rc-marks-table tr.fail-row td { background: rgba(255,77,77,0.06); }
.rc-marks-table tr.fail-row td:first-child { border-left: 3px solid #ff4d6d; padding-left: 11px; }

/* Mobile result card stacks vertically */
@media (max-width: 520px) {
  .rc-student-section { flex-direction: column; align-items: center; text-align: center; }
  .rc-detail-row { justify-content: center; }
  .rc-footer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile marks table adjustments */
@media (max-width: 480px) {
  .marks-cell-input { width: 48px; font-size: 11px; min-height: 42px; }
  .marks-table .col-sticky-1 { min-width: 80px; }
}





/* ──────────────────────────────────────────────────────────────────────────
   AI HELPER MODULE & CHAT INTERFACE
   ────────────────────────────────────────────────────────────────────────── */

/* Root and Shell styles for Chat Page */
.ai-status-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.ai-status-bar.enabled .status-dot {
  background: #00ffaa;
  box-shadow: 0 0 8px #00ffaa;
}
.ai-status-bar.disabled .status-dot {
  background: #ff4d6d;
  box-shadow: 0 0 8px #ff4d6d;
}

/* Chat Header and navigation controls */
.header-actions-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.btn-settings-gear {
  background: none;
  border: none;
  color: var(--text-muted, #888);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-settings-gear:hover {
  color: var(--primary-cyan, #00f0ff);
  background: rgba(255, 255, 255, 0.05);
  transform: rotate(45deg);
}

/* Sidebar Recent Chats List */
.sidebar-chats-container {
  flex: 1;
  overflow-y: auto;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-chat-item {
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.sidebar-chat-item:hover, .sidebar-chat-item.active {
  background: rgba(0, 240, 255, 0.06);
  border-color: rgba(0, 240, 255, 0.15);
}
.sidebar-chat-item h6 {
  margin: 0 0 4px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-chat-item span {
  font-size: 10px;
  color: var(--text-muted, #888);
}
.btn-new-chat {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-cyan, #00f0ff), var(--primary-purple, #b026ff));
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.2);
  transition: all 0.2s;
}
.btn-new-chat:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.35);
}

/* Chat Welcome Container / Empty State */
.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: auto;
  max-width: 440px;
  padding: 40px 20px;
  animation: bubbleSlideIn 0.4s ease forwards;
}
.empty-state-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12) 0%, rgba(176, 38, 255, 0.12) 100%);
  border: 1px solid rgba(0, 240, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--primary-cyan, #00f0ff);
  margin-bottom: 20px;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}
.chat-empty-state h4 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: #fff;
}
.chat-empty-state p {
  font-size: 13.5px;
  color: var(--text-muted, #888);
  margin: 0 0 24px 0;
  line-height: 1.5;
}

/* Coming Soon Screen for Students & Teachers */
.ai-coming-soon-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
  width: 100vw;
  padding: 24px;
  background: radial-gradient(circle at top, #091324 0%, #030712 100%);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
}
.coming-soon-icon {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  color: var(--primary-cyan, #00f0ff);
  margin-bottom: 24px;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.15);
  animation: pulseAI 2s infinite alternate ease-in-out;
}
@keyframes pulseAI {
  0% { transform: scale(1); box-shadow: 0 0 20px rgba(0, 240, 255, 0.1); }
  100% { transform: scale(1.06); box-shadow: 0 0 40px rgba(0, 240, 255, 0.3); }
}
.ai-coming-soon-container h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 12px 0;
  background: linear-gradient(90deg, var(--primary-cyan, #00f0ff), var(--primary-purple, #b026ff));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ai-coming-soon-container p {
  font-size: 15px;
  color: var(--text-muted, #888);
  max-width: 420px;
  margin: 0 0 32px 0;
  line-height: 1.6;
}
.btn-coming-soon-back {
  padding: 12px 28px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-coming-soon-back:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Chat bubble overrides & helper elements */
.ai-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-cyan, #00f0ff), var(--primary-purple, #b026ff));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}
.message-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 75%;
}
.message-wrap.bot {
  align-self: flex-start;
}
.message-wrap.user {
  align-self: flex-end;
  flex-direction: row-reverse;
  max-width: 70%;
}
.chat-usage-header {
  position: absolute;
  top: 80px;
  right: 24px;
  font-size: 11px;
  color: var(--text-muted, #888);
  background: rgba(10, 15, 30, 0.6);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
  z-index: 5;
}

/* Settings Slidout Panel */
.ai-settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  max-width: 90vw;
  background: rgba(7, 11, 22, 0.85);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}
.ai-settings-panel.active {
  transform: translateX(0);
}
.settings-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.settings-panel-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.btn-settings-close {
  background: none;
  border: none;
  color: var(--text-muted, #888);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}
.btn-settings-close:hover {
  color: #fff;
}
.settings-group {
  margin-bottom: 20px;
}
.settings-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.settings-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  margin-bottom: 8px;
}
.settings-row-item span {
  font-size: 13.5px;
  font-weight: 500;
}

/* Switch styling */
.switch-control {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .25s;
  border-radius: 24px;
}
.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: .25s;
  border-radius: 50%;
}
.switch-control input:checked + .switch-slider {
  background-color: var(--primary-cyan, #00f0ff);
}
.switch-control input:checked + .switch-slider:before {
  transform: translateX(20px);
}

/* Statistics Grid */
.stats-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stats-info-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  text-align: center;
}
.stats-info-card strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-cyan, #00f0ff);
  margin-bottom: 2px;
}
.stats-info-card span {
  font-size: 10px;
  color: var(--text-muted, #888);
  text-transform: uppercase;
}

/* Special Message Bubble Types */
.message.bot .msg-bubble.error-bubble {
  background: rgba(255, 77, 109, 0.08);
  border: 1px solid rgba(255, 77, 109, 0.25);
  color: #ffb3c1;
  box-shadow: 0 4px 15px rgba(255, 77, 109, 0.05);
}
.message.bot .msg-bubble.limit-bubble {
  background: rgba(255, 170, 0, 0.08);
  border: 1px solid rgba(255, 170, 0, 0.25);
  color: #ffe6b3;
  box-shadow: 0 4px 15px rgba(255, 170, 0, 0.05);
}

/* Chat History Overlay / Simple Page */
.chat-history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.chat-history-overlay.active {
  display: flex;
}
.chat-history-modal {
  width: 500px;
  max-width: 100%;
  max-height: 80vh;
  background: rgba(10, 15, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}
.history-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.history-modal-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.history-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.history-group-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  margin-top: 10px;
  margin-bottom: 6px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}
.history-group-date:first-child {
  margin-top: 0;
}
.history-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.history-item-row:hover {
  background: rgba(0, 240, 255, 0.04);
  border-color: rgba(0, 240, 255, 0.15);
}
.history-item-text {
  flex: 1;
  min-width: 0;
  margin-right: 12px;
}
.history-item-text p {
  margin: 0 0 2px 0;
  font-size: 13.5px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item-text span {
  font-size: 10px;
  color: var(--text-muted, #888);
}
.btn-delete-history-item {
  background: none;
  border: none;
  color: var(--text-muted, #888);
  font-size: 14px;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.2s;
}
.btn-delete-history-item:hover {
  color: #ff4b4b;
  background: rgba(255, 75, 75, 0.1);
}

/* ── AI Helper Layout Styles ── */
.ai-helper-dashboard {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  background: var(--bg-color, #030712);
}

.ai-sidebar {
  width: 280px;
  height: 100%;
  background: rgba(10, 15, 30, 0.75);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  padding: 20px;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.ai-chat-canvas {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background: radial-gradient(circle at center, #0b1528 0%, #030712 100%);
  overflow: hidden;
}

.chat-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 15, 30, 0.4);
  backdrop-filter: blur(10px);
  z-index: 5;
  height: 70px;
}

.sidebar-toggle-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  margin-right: 12px;
  display: none;
  align-items: center;
  justify-content: center;
}

.chat-agent-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-purple));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.chat-agent-info h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: #fff;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

/* Scrollbar styling for message box */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Quick Suggestion Chips */
.action-chips-container {
  display: flex;
  gap: 8px;
  padding: 10px 24px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.action-chips-container::-webkit-scrollbar {
  display: none;
}
.chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  padding: 8px 16px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chip:hover {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.2);
  color: var(--primary-cyan);
  transform: translateY(-1px);
}

/* Chat Input Footer Area */
.chat-input-area {
  padding: 10px 24px 24px;
  background: linear-gradient(to top, #030712 60%, transparent);
  flex-shrink: 0;
  z-index: 5;
}

.chat-input-wrapper {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 4px 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: all 0.3s;
}

.chat-input-wrapper:focus-within {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

#chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 14px 110px 14px 16px;
  color: #fff;
  font-size: 14.5px;
  font-family: inherit;
}

.btn-send-modern {
  position: absolute;
  right: 8px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-purple));
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(0, 240, 255, 0.2);
}

.btn-send-modern:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 15px rgba(0, 240, 255, 0.35);
}

/* Voice Input Microphone Button */
.btn-mic-modern {
  position: absolute;
  right: 56px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}

.btn-mic-modern:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-mic-modern.recording {
  background: #ff4d6d;
  color: #fff;
  border-color: #ff4d6d;
  box-shadow: 0 0 15px rgba(255, 77, 109, 0.5);
  animation: pulseMic 1.5s infinite ease-in-out;
}

@keyframes pulseMic {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.6); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255, 77, 109, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 109, 0); }
}

/* Chat bubble styling */
.msg-bubble {
  padding: 12px 18px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.55;
  position: relative;
  color: #f3f4f6;
  max-width: 100%;
  word-break: break-word;
}

.message.bot .msg-bubble {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom-left-radius: 4px;
}

.message.user .msg-bubble {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12) 0%, rgba(176, 38, 255, 0.12) 100%);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-bottom-right-radius: 4px;
  color: #ffffff;
}

.msg-time {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 6px;
  display: block;
  text-align: right;
  opacity: 0.7;
}

/* Message styling helper formatting */
.msg-bubble p {
  margin-bottom: 8px;
}
.msg-bubble p:last-child {
  margin-bottom: 0;
}
.msg-bubble ul, .msg-bubble ol {
  margin-left: 20px;
  margin-bottom: 8px;
}
.msg-bubble li {
  margin-bottom: 4px;
}
.msg-bubble .info-key {
  font-weight: 700;
  color: var(--primary-cyan);
}
.msg-bubble .info-val {
  color: #fff;
}
.msg-heading {
  font-size: 14px;
  font-weight: 700;
  margin-top: 12px;
  margin-bottom: 6px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 3px;
}
.msg-heading:first-child {
  margin-top: 0;
}

/* Typing indicator dots */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  align-items: center;
  height: 18px;
}
.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite;
  opacity: 0.4;
}
.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 1; }
}

/* ── Downloadable AI Reports Cards ── */
.ai-report-download-card {
  margin-top: 14px;
  background: rgba(10, 15, 30, 0.6);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: bubbleSlideIn 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  max-width: 100%;
}

.ai-report-download-card h5 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
}

.download-buttons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.btn-report-download {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 6px;
  color: #e5e7eb;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
}

.btn-report-download i {
  font-size: 16px;
}

.btn-report-download:hover {
  transform: translateY(-1px);
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.btn-report-download.pdf-btn {
  border-color: rgba(239, 68, 68, 0.2);
}
.btn-report-download.pdf-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #f87171;
}

.btn-report-download.docx-btn {
  border-color: rgba(59, 130, 246, 0.2);
}
.btn-report-download.docx-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
  color: #60a5fa;
}

.btn-report-download.excel-btn {
  border-color: rgba(16, 185, 129, 0.2);
}
.btn-report-download.excel-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
  color: #34d399;
}

.btn-report-download.csv-btn {
  border-color: rgba(245, 158, 11, 0.2);
}
.btn-report-download.csv-btn:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
  color: #fbbf24;
}

.btn-report-download.loading {
  opacity: 0.5;
  pointer-events: none;
  cursor: default;
}

/* Sidebar Profile Widget styling in style.css */
.sidebar-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
}
.profile-avatar-wrap {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-purple));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}
.profile-info-wrap {
  display: flex;
  flex-direction: column;
}
.profile-info-wrap h5 {
  margin: 0;
  font-weight: 600;
  color: #fff;
}
.role-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 2px;
  align-self: flex-start;
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
  .ai-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }
  .ai-sidebar.active {
    transform: translateX(0);
  }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  .chat-messages {
    padding: 16px;
    gap: 16px;
  }
  .chat-input-area {
    padding: 10px 16px 16px;
  }
  #chat-input {
    padding-right: 105px;
    font-size: 13.5px;
  }
  .btn-send-modern {
    right: 6px;
    width: 38px;
    height: 38px;
  }
  .btn-mic-modern {
    right: 50px;
    width: 38px;
    height: 38px;
  }
  .download-buttons-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Header Back Button */
.btn-nav-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  margin-right: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.btn-nav-back:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary-cyan);
  border-color: rgba(0, 240, 255, 0.2);
  transform: translateX(-1px);
}

/* --- PREMIUM AI HELPER OVERLAYS & REDESIGN --- */

.sidebar-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  margin-bottom: 24px;
}
.logo-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.logo-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}
.logo-subtitle {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary-cyan, #00f0ff);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.btn-new-chat {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15) 0%, rgba(176, 38, 255, 0.15) 100%);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}
.btn-new-chat:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25) 0%, rgba(176, 38, 255, 0.25) 100%);
  border-color: var(--primary-cyan, #00f0ff);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.15);
}

/* Chat container max-width centering */
.chat-messages {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}
.action-chips-container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

/* Suggestion prompt cards layout */
.empty-welcome-text {
  font-size: 14.5px !important;
  color: var(--text-muted, #888) !important;
  max-width: 480px !important;
  margin: 0 auto 36px !important;
  line-height: 1.6;
}
.empty-quick-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 760px;
  margin-top: 10px;
}
.quick-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 20px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quick-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(0, 240, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}
.quick-card .card-icon {
  font-size: 20px;
  margin-bottom: 6px;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.quick-card .purple-gradient-icon {
  background-image: linear-gradient(135deg, #00f0ff, #b026ff);
  color: #b026ff; /* fallback */
}
.quick-card .cyan-gradient-icon {
  background-image: linear-gradient(135deg, #00f0ff, #007aff);
  color: #00f0ff;
}
.quick-card .blue-gradient-icon {
  background-image: linear-gradient(135deg, #007aff, #3b82f6);
  color: #3b82f6;
}
.quick-card .orange-gradient-icon {
  background-image: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #f59e0b;
}
.quick-card h5 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.quick-card p {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-muted, #888);
  line-height: 1.5;
}

/* Chat Input Overhaul */
.chat-input-wrapper {
  background: rgba(10, 15, 30, 0.6) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 28px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4) !important;
  padding: 6px 8px !important;
}
#chat-input {
  padding: 12px 110px 12px 18px !important;
  font-size: 14px !important;
}
.btn-send-modern, .btn-mic-modern {
  border-radius: 50% !important;
  width: 38px !important;
  height: 38px !important;
}
.btn-send-modern {
  right: 8px !important;
}
.btn-mic-modern {
  right: 52px !important;
}

/* Error/Retry card handling */
.chat-error-card {
  background: rgba(255, 77, 109, 0.04);
  border: 1px solid rgba(255, 77, 109, 0.15);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  max-width: 440px;
  margin: 40px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  animation: bubbleSlideIn 0.3s ease;
}
.chat-error-card .error-icon {
  font-size: 26px;
  color: #ff4d6d;
}
.chat-error-card p {
  margin: 0;
  font-size: 13.5px;
  color: #ffb3c1;
  line-height: 1.6;
}
.btn-error-retry {
  background: rgba(255, 77, 109, 0.15);
  border: 1px solid rgba(255, 77, 109, 0.3);
  color: #ffb3c1;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-error-retry:hover {
  background: rgba(255, 77, 109, 0.25);
  border-color: #ff4d6d;
  color: #fff;
  transform: translateY(-0.5px);
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .empty-quick-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .sidebar-toggle-btn {
    display: flex !important;
  }
  .chat-navbar {
    padding: 0 16px;
  }
}

/* ==========================================================================
   COMMON & MEMBER-VIEW LIGHT THEME OVERRIDES (INSTUTECH - Premium Lavender)
   ========================================================================== */

body.light-theme {
  background: #f5f3fa !important;
  color: #2b223d !important;
}

body.light-theme .background-container {
  background: #f5f3fa !important;
}

body.light-theme .gradient-sphere {
  opacity: 0.15;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.25) 0%, transparent 70%) !important;
}

/* General Layout & Navigation in Member View */
body.light-theme .top-nav-center-school {
  color: #2b223d !important;
}

body.light-theme .back-link {
  color: #8b5cf6 !important;
}

body.light-theme .nav-icon-btn,
body.light-theme #btn-theme-menu {
  background: rgba(43, 34, 61, 0.04) !important;
  border: 1px solid rgba(43, 34, 61, 0.08) !important;
  color: #2b223d !important;
}

body.light-theme .nav-icon-btn:hover {
  background: rgba(43, 34, 61, 0.08) !important;
}

/* Sidebar Tab Buttons */
body.light-theme .tab-btn {
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid rgba(43, 34, 61, 0.08) !important;
  color: rgba(43, 34, 61, 0.6) !important;
}

body.light-theme .tab-btn:hover,
body.light-theme .tab-btn.active {
  background: rgba(168, 85, 247, 0.08) !important;
  border-color: rgba(168, 85, 247, 0.25) !important;
  color: #8b5cf6 !important;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.06) !important;
}

/* Modules Container Box */
body.light-theme .modules-container {
  background: rgba(255, 255, 255, 0.8) !important;
  border: 1px solid rgba(43, 34, 61, 0.08) !important;
  box-shadow: 0 10px 30px rgba(43, 34, 61, 0.04) !important;
}

body.light-theme .pane-title {
  color: #2b223d !important;
}

body.light-theme .pane-desc {
  color: rgba(43, 34, 61, 0.6) !important;
}

/* Profile / Identity Card in Member View */
body.light-theme .profile-card {
  background: linear-gradient(135deg, #fbfafd, #f2effc, #e9e5f7) !important;
  border: 1px solid rgba(168, 85, 247, 0.15) !important;
  box-shadow: 0 10px 30px rgba(43, 34, 61, 0.05) !important;
}

body.light-theme .profile-name {
  color: #2b223d !important;
}

body.light-theme .role-badge {
  background: rgba(168, 85, 247, 0.1) !important;
  color: #8b5cf6 !important;
  border-color: rgba(168, 85, 247, 0.25) !important;
}

body.light-theme .profile-detail-item {
  background: rgba(43, 34, 61, 0.03) !important;
}

body.light-theme .profile-detail-label {
  color: #8b5cf6 !important;
}

body.light-theme .profile-detail-value {
  color: #2b223d !important;
}

body.light-theme .app-name {
  color: #8b5cf6 !important;
}

body.light-theme .app-subtitle {
  color: rgba(43, 34, 61, 0.5) !important;
}

/* Attendance log/stats card in Member View */
body.light-theme .att-stat-card {
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid rgba(43, 34, 61, 0.08) !important;
}

body.light-theme .att-stat-val {
  color: #2b223d !important;
}

body.light-theme .att-stat-label {
  color: rgba(43, 34, 61, 0.6) !important;
}

body.light-theme .att-log-item {
  background: rgba(255, 255, 255, 0.6) !important;
  border: 1px solid rgba(43, 34, 61, 0.05) !important;
  border-left-width: 4px !important;
}

body.light-theme .att-log-date {
  color: #2b223d !important;
}

/* AI chat bubble panel (pane-ai) */
body.light-theme .chat-widget-pane {
  background: rgba(255, 255, 255, 0.6) !important;
  border: 1px solid rgba(43, 34, 61, 0.08) !important;
}

body.light-theme .chat-input-row {
  border-top: 1px solid rgba(43, 34, 61, 0.08) !important;
}

body.light-theme .chat-widget-input {
  background: rgba(43, 34, 61, 0.03) !important;
  color: #2b223d !important;
  border: 1px solid rgba(43, 34, 61, 0.08) !important;
}

body.light-theme .chat-widget-input:focus {
  border-color: rgba(168, 85, 247, 0.3) !important;
}

body.light-theme .chat-widget-send {
  background: #8b5cf6 !important;
  color: #fff !important;
}

body.light-theme .chat-widget-send:hover {
  background: #7c3aed !important;
}

/* Modals, popups and sheets */
body.light-theme .confirm-modal {
  background: #ffffff !important;
  border: 1px solid rgba(43, 34, 61, 0.12) !important;
  box-shadow: 0 15px 35px rgba(43, 34, 61, 0.15) !important;
}

body.light-theme .confirm-modal h3 {
  color: #2b223d !important;
}

body.light-theme .confirm-modal p {
  color: rgba(43, 34, 61, 0.7) !important;
}

body.light-theme .confirm-modal label {
  color: rgba(43, 34, 61, 0.6) !important;
}

body.light-theme .btn-cancel {
  background: rgba(43, 34, 61, 0.04) !important;
  border: 1px solid rgba(43, 34, 61, 0.08) !important;
  color: #2b223d !important;
}

body.light-theme .btn-cancel:hover {
  background: rgba(43, 34, 61, 0.08) !important;
}

body.light-theme .filter-tab {
  background: rgba(43, 34, 61, 0.03) !important;
  border: 1px solid rgba(43, 34, 61, 0.08) !important;
  color: rgba(43, 34, 61, 0.6) !important;
}

body.light-theme .filter-tab.active {
  background: rgba(168, 85, 247, 0.08) !important;
  border-color: rgba(168, 85, 247, 0.25) !important;
  color: #8b5cf6 !important;
}

/* Explicit select and option tag overrides globally for Light Theme */
body.light-theme select {
  background-color: #ffffff !important;
  color: #2b223d !important;
  border: 1px solid rgba(43, 34, 61, 0.15) !important;
}

body.light-theme select option {
  background-color: #ffffff !important;
  color: #2b223d !important;
}

/* Custom theme dropdown selection menu item overrides globally */
body.light-theme .theme-dropdown .dropdown-item {
  color: #2b223d !important;
  background: transparent !important;
}

body.light-theme .theme-dropdown .dropdown-item:hover {
  background: rgba(168, 85, 247, 0.08) !important;
}

body.light-theme .theme-dropdown .dropdown-item[data-theme="light"] {
  background: rgba(168, 85, 247, 0.12) !important;
  color: #8b5cf6 !important;
  font-weight: 700 !important;
}

body.light-theme .theme-dropdown .dropdown-item[data-theme="dark"] {
  background: transparent !important;
  color: #2b223d !important;
  font-weight: 500 !important;
}

/* ==========================================================================
   ASSIGN ROLE MODAL CENTERED / FIXED STYLING
   ========================================================================== */

#assign-role-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 30, 0.8) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

#assign-role-modal.active,
#assign-role-modal[style*="display: block"],
#assign-role-modal[style*="display: flex"] {
  display: flex !important;
}

#assign-role-modal .confirm-modal {
  background: #16171d !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 20px !important;
  padding: 24px !important;
  width: 90% !important;
  max-width: 400px !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 240, 255, 0.05) !important;
  box-sizing: border-box !important;
  text-align: left !important;
}

body.light-theme #assign-role-modal .confirm-modal {
  background: #ffffff !important;
  border: 1px solid rgba(43, 34, 61, 0.12) !important;
  box-shadow: 0 20px 40px rgba(43, 34, 61, 0.1) !important;
}

#assign-role-modal select {
  width: 100% !important;
  padding: 12px 14px !important;
  height: 48px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  background: #1f2026 !important;
  color: #fff !important;
  font-family: inherit !important;
  font-size: 14px !important;
  outline: none !important;
  cursor: pointer !important;
}

body.light-theme #assign-role-modal select {
  background: #ffffff !important;
  color: #2b223d !important;
  border: 1px solid rgba(43, 34, 61, 0.15) !important;
}

#assign-role-modal button {
  height: 48px !important;
  min-height: 48px !important;
}

#assign-role-modal .filter-tab {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #aaa !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

#assign-role-modal .filter-tab.active {
  background: rgba(0, 240, 255, 0.15) !important;
  border-color: rgba(0, 240, 255, 0.35) !important;
  color: #00f0ff !important;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.3) !important;
}

body.light-theme #assign-role-modal .filter-tab {
  background: rgba(43, 34, 61, 0.03) !important;
  border: 1px solid rgba(43, 34, 61, 0.08) !important;
  color: rgba(43, 34, 61, 0.6) !important;
}

body.light-theme #assign-role-modal .filter-tab.active {
  background: rgba(168, 85, 247, 0.08) !important;
  border-color: rgba(168, 85, 247, 0.25) !important;
  color: #8b5cf6 !important;
}

#assign-role-modal .btn-confirm-remove {
  background: linear-gradient(90deg, #00f0ff, #7b2fff) !important;
  color: #000 !important;
  border: none !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

#assign-role-modal .btn-confirm-remove:hover {
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3) !important;
}

#assign-role-modal .btn-cancel {
  border-radius: 10px !important;
}

/* ==========================================================================
   MOBILE BOTTOM SHEETS FOR SCREENS < 768px
   ========================================================================== */

@media (max-width: 768px) {
  html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  /* Disable backdrop-filter on mobile headers to prevent child positioning containment locks */
  .top-nav-bar,
  .admin-top-nav {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding-left: calc(10px + env(safe-area-inset-left)) !important;
    padding-right: calc(12px + env(safe-area-inset-right)) !important;
    gap: 8px !important;
  }

  /* Theme selection dropdown menu as a bottom sheet */
  .theme-dropdown {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    background: #1e1f26 !important;
    border-radius: 20px 20px 0 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5) !important;
    z-index: 1000 !important;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom)) 20px !important;
    box-sizing: border-box !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    animation: slideUpSheet 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
  }
  
  body.light-theme .theme-dropdown {
    background: #ffffff !important;
    border-top: 1px solid rgba(43, 34, 61, 0.1) !important;
    box-shadow: 0 -10px 30px rgba(43, 34, 61, 0.15) !important;
  }

  .theme-dropdown::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin: 0 auto 16px auto;
  }

  body.light-theme .theme-dropdown::before {
    background: rgba(43, 34, 61, 0.15);
  }

  .theme-dropdown .dropdown-item {
    font-size: 15px !important;
    padding: 14px 20px !important;
    border-radius: 12px !important;
    margin-bottom: 8px !important;
  }
  
  .theme-dropdown::after {
    content: 'Cancel';
    display: block;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    padding: 14px 0;
    cursor: pointer;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  
  body.light-theme .theme-dropdown::after {
    color: rgba(43, 34, 61, 0.5);
    border-top: 1px solid rgba(43, 34, 61, 0.08);
  }
  
  /* Submissions list card menu dropdown bottom sheet */
  .card-menu-dropdown {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    z-index: 1000 !important;
    padding: 16px 20px 32px 20px !important;
    box-sizing: border-box !important;
    background: #1e1f26 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5) !important;
    animation: slideUpSheet 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
  }
  
  body.light-theme .card-menu-dropdown {
    background: #ffffff !important;
    border-top: 1px solid rgba(43, 34, 61, 0.1) !important;
    box-shadow: 0 -10px 30px rgba(43, 34, 61, 0.15) !important;
  }

  .card-menu-dropdown::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin: 0 auto 16px auto;
  }

  body.light-theme .card-menu-dropdown::before {
    background: rgba(43, 34, 61, 0.15);
  }

  .card-menu-dropdown button {
    font-size: 15px !important;
    padding: 14px 20px !important;
    border-radius: 12px !important;
    margin-bottom: 8px !important;
  }
  
  .card-menu-dropdown::after {
    content: 'Cancel';
    display: block;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    padding: 14px 0;
    cursor: pointer;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  
  body.light-theme .card-menu-dropdown::after {
    color: rgba(43, 34, 61, 0.5);
    border-top: 1px solid rgba(43, 34, 61, 0.08);
  }
  
  @keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
}

/* ==========================================================================
   MOBILE SCROLLABLE TABS RESPONSIVENESS OVERRIDES (MEMBER VIEW)
   ========================================================================== */
@media (max-width: 800px) {
  .sidebar-tabs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 10px !important;
    width: 100% !important;
    padding-bottom: 8px !important;
    box-sizing: border-box !important;
  }
  .tab-btn {
    flex-shrink: 0 !important;
    padding: 10px 16px !important;
    border-radius: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
  }
}

/* ==========================================================================
   GLOBAL LIGHT THEME OVERRIDES FOR READABILITY ACROSS ALL FEATURES
   ========================================================================== */
body.light-theme {
    --bg-color: #f5f3fa !important;
    --bg-dark: #f5f3fa !important;
    --bg: #f5f3fa !important;
    --bg-card: rgba(255, 255, 255, 0.85) !important;
    --bg-solid: #ffffff !important;
    --bg-input: rgba(43, 34, 61, 0.03) !important;
    --bg-hover: rgba(43, 34, 61, 0.05) !important;
    
    --glass-bg: rgba(255, 255, 255, 0.85) !important;
    --glass-border: rgba(139, 92, 246, 0.12) !important;
    --border: rgba(139, 92, 246, 0.12) !important;
    --border-hi: rgba(139, 92, 246, 0.2) !important;
    
    --primary-cyan: #8b5cf6 !important;
    --primary-purple: #a855f7 !important;
    --cyan: #8b5cf6 !important;
    --purple: #a855f7 !important;
    --gradient: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%) !important;
    
    --text-main: #2b223d !important;
    --text-muted: #6b5f8a !important;
    --t1: #2b223d !important;
    --t2: #6b5f8a !important;
    --t3: #9b8ebb !important;
    
    --input-bg: rgba(43, 34, 61, 0.03) !important;
    --input-border: rgba(43, 34, 61, 0.12) !important;
    
    background: #f5f3fa !important;
    background-color: #f5f3fa !important;
    color: #2b223d !important;
}

/* Base typography elements in Light Theme */
body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6,
body.light-theme .pane-title,
body.light-theme .page-title,
body.light-theme .card-title,
body.light-theme .report-header h2,
body.light-theme .report-meta-item h4,
body.light-theme .exam-card-name,
body.light-theme .rc-student-details h3,
body.light-theme .rc-school-info h2,
body.light-theme .section-heading {
    color: #1a0f30 !important;
}

body.light-theme p,
body.light-theme label,
body.light-theme li,
body.light-theme td,
body.light-theme th,
body.light-theme .receipt-row span {
    color: #3b324d !important;
}

body.light-theme .text-muted,
body.light-theme .page-sub,
body.light-theme .pane-desc,
body.light-theme .card-desc,
body.light-theme .profile-detail-label,
body.light-theme .exam-card-meta,
body.light-theme .session-label {
    color: #6b5f8a !important;
}

/* Card layout containers in Light Theme */
body.light-theme .card,
body.light-theme .card-shell,
body.light-theme .module-card,
body.light-theme .form-card,
body.light-theme .report-card-shell,
body.light-theme .fee-card,
body.light-theme .receipt-box,
body.light-theme .stats-card,
body.light-theme .setup-card,
body.light-theme .session-drawer,
body.light-theme .exam-card,
body.light-theme .att-stat-card,
body.light-theme .att-log-item,
body.light-theme .chat-widget-pane,
body.light-theme .confirm-modal {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(139, 92, 246, 0.12) !important;
    box-shadow: 0 8px 30px rgba(43, 34, 61, 0.04) !important;
    color: #2b223d !important;
}

/* Specific Card Hover States */
body.light-theme .module-card.functional-module:hover,
body.light-theme .exam-card:hover {
    border-color: rgba(139, 92, 246, 0.3) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.08) !important;
}

/* Table cells and borders in Light Theme */
body.light-theme table {
    border-color: rgba(139, 92, 246, 0.1) !important;
}
body.light-theme th,
body.light-theme .report-table th,
body.light-theme .rc-marks-table th {
    color: #1a0f30 !important;
    background: rgba(139, 92, 246, 0.05) !important;
    border-bottom: 2px solid rgba(139, 92, 246, 0.15) !important;
}
body.light-theme td,
body.light-theme .report-table td,
body.light-theme .rc-marks-table td {
    color: #3b324d !important;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08) !important;
}
body.light-theme tr:hover {
    background: rgba(139, 92, 246, 0.02) !important;
}

/* Form Controls & Inputs in Light Theme */
body.light-theme input,
body.light-theme textarea,
body.light-theme select,
body.light-theme .form-input-custom,
body.light-theme .chat-widget-input {
    background: #ffffff !important;
    color: #2b223d !important;
    border: 1px solid rgba(139, 92, 246, 0.18) !important;
}
body.light-theme input:focus,
body.light-theme textarea:focus,
body.light-theme select:focus,
body.light-theme .form-input-custom:focus,
body.light-theme .chat-widget-input:focus {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
}
body.light-theme input::placeholder,
body.light-theme textarea::placeholder {
    color: #9b8ebb !important;
}

/* Option tags inside select element */
body.light-theme select option {
    background-color: #ffffff !important;
    color: #2b223d !important;
}

/* Buttons in Light Theme */
body.light-theme .btn-gradient,
body.light-theme .btn-action-primary,
body.light-theme .primary-btn,
body.light-theme .btn-module,
body.light-theme .btn-session-settings {
    background: linear-gradient(135deg, #8b5cf6, #a855f7) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2) !important;
}
body.light-theme .btn-gradient:hover,
body.light-theme .btn-action-primary:hover,
body.light-theme .primary-btn:hover,
body.light-theme .btn-module:hover,
body.light-theme .btn-session-settings:hover {
    background: linear-gradient(135deg, #7c3aed, #9333ea) !important;
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.3) !important;
    color: #ffffff !important;
}

/* Secondary & Cancel Buttons in Light Theme */
body.light-theme .btn-cancel,
body.light-theme .btn-modal-cancel,
body.light-theme .btn-action.secondary,
body.light-theme .btn-session-settings.secondary {
    background: rgba(43, 34, 61, 0.04) !important;
    border: 1px solid rgba(43, 34, 61, 0.12) !important;
    color: #2b223d !important;
}
body.light-theme .btn-cancel:hover,
body.light-theme .btn-modal-cancel:hover,
body.light-theme .btn-action.secondary:hover {
    background: rgba(43, 34, 61, 0.08) !important;
}

/* Top Sticky Navigation Bars in Light Theme */
body.light-theme .top-nav,
body.light-theme .admin-top-nav,
body.light-theme .top-bar,
body.light-theme .brand-bar {
    background: rgba(245, 243, 250, 0.85) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border-bottom: 1px solid rgba(139, 92, 246, 0.12) !important;
    box-shadow: 0 4px 15px rgba(43, 34, 61, 0.04) !important;
}

body.light-theme .top-nav-center-school,
body.light-theme .admin-branding,
body.light-theme .admin-logo-text,
body.light-theme .group-name-nav,
body.light-theme .admin-title-badge,
body.light-theme .top-nav .nav-icon-btn,
body.light-theme .admin-top-nav .nav-icon-btn,
body.light-theme #btn-theme-menu,
body.light-theme #top-nav-school-name {
    color: #2b223d !important;
}

body.light-theme .top-nav .back-link,
body.light-theme .admin-top-nav .back-link,
body.light-theme .top-bar .back-link,
body.light-theme .brand-bar .back-link {
    color: #8b5cf6 !important;
    border-color: rgba(139, 92, 246, 0.25) !important;
}
body.light-theme .top-nav .back-link i,
body.light-theme .admin-top-nav .back-link i,
body.light-theme .top-bar .back-link i,
body.light-theme .brand-bar .back-link i {
    color: #8b5cf6 !important;
}

/* Search bar elements in Light Theme */
body.light-theme .search-container input {
    background: #ffffff !important;
    color: #2b223d !important;
    border: 1px solid rgba(139, 92, 246, 0.18) !important;
}
body.light-theme .search-container input::placeholder {
    color: #9b8ebb !important;
}
body.light-theme .search-icon {
    color: #8b5cf6 !important;
}
body.light-theme .search-dropdown {
    background: #ffffff !important;
    border: 1px solid rgba(139, 92, 246, 0.15) !important;
    box-shadow: 0 10px 25px rgba(43, 34, 61, 0.1) !important;
}
body.light-theme .search-result-item {
    color: #2b223d !important;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08) !important;
}
body.light-theme .search-result-item:hover {
    background: rgba(139, 92, 246, 0.05) !important;
}

/* Dropdown Menu overrides */
body.light-theme .dropdown-menu,
body.light-theme .theme-dropdown {
    background: #ffffff !important;
    border: 1px solid rgba(139, 92, 246, 0.15) !important;
    box-shadow: 0 10px 25px rgba(43, 34, 61, 0.1) !important;
}
body.light-theme .dropdown-menu button,
body.light-theme .theme-dropdown .dropdown-item {
    color: #2b223d !important;
}
body.light-theme .dropdown-menu button:hover,
body.light-theme .theme-dropdown .dropdown-item:hover {
    background: rgba(139, 92, 246, 0.05) !important;
}

/* Session row items (Results Management) */
body.light-theme .session-item-row {
    background: rgba(43, 34, 61, 0.02) !important;
    border: 1px solid rgba(43, 34, 61, 0.08) !important;
}
body.light-theme .session-item-row:hover {
    background: rgba(43, 34, 61, 0.05) !important;
    border-color: rgba(43, 34, 61, 0.15) !important;
}
body.light-theme .session-item-row.active-session {
    background: rgba(139, 92, 246, 0.08) !important;
    border-color: rgba(139, 92, 246, 0.25) !important;
}
body.light-theme .session-status-tag {
    background: rgba(43, 34, 61, 0.05) !important;
    border: 1px solid rgba(43, 34, 61, 0.1) !important;
    color: #6b5f8a !important;
}
body.light-theme .active-session .session-status-tag {
    background: rgba(139, 92, 246, 0.12) !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
    color: #8b5cf6 !important;
}

/* ==========================================================================
   TOP BAR OVERFLOW PREVENTION AND FLEXBOX LAYOUT CONSTRAINTS (TASK 4)
   ========================================================================== */
.top-nav-bar {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px calc(24px + env(safe-area-inset-right)) 10px calc(16px + env(safe-area-inset-left)) !important;
  background: rgba(8,14,30,0.8) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
  backdrop-filter: blur(10px) !important;
  width: 100% !important;
  max-width: 100vw !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 999 !important;
  box-sizing: border-box !important;
  gap: 8px !important;
}

.top-nav-center-school {
  flex: 1 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  min-width: 0 !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  color: #fff !important;
  text-align: center !important;
}

.top-nav-right-container {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

#btn-theme-menu {
  flex-shrink: 0 !important;
  width: 40px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: none !important;
  border: none !important;
  color: #fff !important;
  font-size: 16px !important;
  cursor: pointer !important;
  padding: 6px !important;
}

#member-lang-select {
  flex-shrink: 0 !important;
  max-width: 120px !important;
  min-width: 80px !important;
  background: rgba(255,255,255,0.05) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 20px !important;
  padding: 4px 10px !important;
  outline: none !important;
  cursor: pointer !important;
  font-family: inherit !important;
  font-size: 12.5px !important;
}

/* Group Admin Top Right Buttons Constraints */
.admin-nav-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

.admin-nav-right button,
.admin-nav-right .theme-menu-container,
.admin-nav-right #btn-theme-menu,
.admin-nav-right #btn-delete-top {
  flex-shrink: 0 !important;
}

/* Ensure mobile header backdrop-filter overrides are applied last to win specificity */
@media (max-width: 768px) {
  .top-nav-bar,
  .admin-top-nav {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(8, 14, 30, 0.98) !important;
  }
}

body.light-theme .modal-header {
  background: rgba(255, 255, 255, 0.98) !important;
  border-bottom: 1px solid rgba(43, 34, 61, 0.08) !important;
}

@media (max-width: 480px) {
  .nav-subtitle {
    display: none !important;
  }
}

/* Student Selector Section */
.student-selector-container {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  margin: 16px 0 20px 0 !important;
  padding: 12px !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(10px) !important;
}

.student-pill {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: flex-start !important;
  padding: 8px 16px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
  color: rgba(255, 255, 255, 0.7) !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  min-width: 140px !important;
}

.student-pill:hover:not(.pending) {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
  transform: translateY(-1px) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.student-pill.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(176, 38, 255, 0.1)) !important;
  border-color: #00f0ff !important;
  color: #00f0ff !important;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15) !important;
}

.student-pill.pending {
  opacity: 0.55 !important;
  border-style: dashed !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  cursor: not-allowed !important;
}

.student-pill-title {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  margin-bottom: 2px !important;
}

.student-pill-subtitle {
  font-size: 10.5px !important;
  opacity: 0.8 !important;
  font-weight: 500 !important;
}

.student-pill.active .student-pill-subtitle {
  color: #00ff88 !important;
}

.student-selector-empty {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 24px 16px !important;
  text-align: center !important;
}

.student-selector-empty i {
    border: 1px solid rgba(43, 34, 61, 0.1) !important;
    color: #6b5f8a !important;
}
body.light-theme .active-session .session-status-tag {
    background: rgba(139, 92, 246, 0.12) !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
    color: #8b5cf6 !important;
}

/* ==========================================================================
   TOP BAR OVERFLOW PREVENTION AND FLEXBOX LAYOUT CONSTRAINTS (TASK 4)
   ========================================================================== */
.top-nav-bar {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px calc(24px + env(safe-area-inset-right)) 10px calc(16px + env(safe-area-inset-left)) !important;
  background: rgba(8,14,30,0.8) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
  backdrop-filter: blur(10px) !important;
  width: 100% !important;
  max-width: 100vw !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 999 !important;
  box-sizing: border-box !important;
  gap: 8px !important;
}

.top-nav-center-school {
  flex: 1 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  min-width: 0 !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  color: #fff !important;
  text-align: center !important;
}

.top-nav-right-container {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

#btn-theme-menu {
  flex-shrink: 0 !important;
  width: 40px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: none !important;
  border: none !important;
  color: #fff !important;
  font-size: 16px !important;
  cursor: pointer !important;
  padding: 6px !important;
}

#member-lang-select {
  flex-shrink: 0 !important;
  max-width: 120px !important;
  min-width: 80px !important;
  background: rgba(255,255,255,0.05) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 20px !important;
  padding: 4px 10px !important;
  outline: none !important;
  cursor: pointer !important;
  font-family: inherit !important;
  font-size: 12.5px !important;
}

/* Group Admin Top Right Buttons Constraints */
.admin-nav-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

.admin-nav-right button,
.admin-nav-right .theme-menu-container,
.admin-nav-right #btn-theme-menu,
.admin-nav-right #btn-delete-top {
  flex-shrink: 0 !important;
}

/* Ensure mobile header backdrop-filter overrides are applied last to win specificity */
@media (max-width: 768px) {
  .top-nav-bar,
  .admin-top-nav {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(8, 14, 30, 0.98) !important;
  }
}

body.light-theme .modal-header {
  background: rgba(255, 255, 255, 0.98) !important;
  border-bottom: 1px solid rgba(43, 34, 61, 0.08) !important;
}

@media (max-width: 480px) {
  .nav-subtitle {
    display: none !important;
  }
}

/* Student Selector Section */
.student-selector-container {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  margin: 16px 0 20px 0 !important;
  padding: 12px !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(10px) !important;
}

.student-pill {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: flex-start !important;
  padding: 8px 16px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
  color: rgba(255, 255, 255, 0.7) !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  min-width: 140px !important;
}

.student-pill:hover:not(.pending) {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
  transform: translateY(-1px) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.student-pill.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(176, 38, 255, 0.1)) !important;
  border-color: #00f0ff !important;
  color: #00f0ff !important;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15) !important;
}

.student-pill.pending {
  opacity: 0.55 !important;
  border-style: dashed !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  cursor: not-allowed !important;
}

.student-pill-title {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  margin-bottom: 2px !important;
}

.student-pill-subtitle {
  font-size: 10.5px !important;
  opacity: 0.8 !important;
  font-weight: 500 !important;
}

.student-pill.active .student-pill-subtitle {
  color: #00ff88 !important;
}

.student-selector-empty {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 24px 16px !important;
  text-align: center !important;
}

.student-selector-empty i {
  font-size: 24px !important;
  color: #888 !important;
  margin-bottom: 8px !important;
}

.student-selector-empty p {
  font-size: 13px !important;
  color: #aaa !important;
  margin: 0 0 12px 0 !important;
}

@media (max-width: 400px) {
  #add-student-text {
    display: none !important;
  }
  .top-nav-center-school {
    font-size: 14px !important;
  }
  .top-nav-bar {
    padding: 10px 12px !important;
  }
}
