/* ============================================================
   SchoolSync - Premium Dark Theme Design System
   ============================================================ */

/* ---- CSS Variables / Design Tokens ---- */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --bg-tertiary: #1a1a3e;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);

  --text-primary: #f0f0ff;
  --text-main: #f0f0ff;
  --text-secondary: #a0a0c0;
  --text-muted: #6060a0;

  --accent-primary: #7c3aed;
  --accent-primary-light: #8b5cf6;
  --accent-secondary: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #7c3aed, #06b6d4);
  --accent-gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444);

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.3);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-width: 280px;
  --sidebar-collapsed: 80px;
  --header-height: 72px;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124,58,237,0.5); }

::selection {
  background: rgba(124, 58, 237, 0.4);
  color: #fff;
}

a { color: var(--accent-primary-light); text-decoration: none; }
a:hover { color: var(--accent-secondary); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a103a 50%, #0a1a2a 100%);
  position: relative;
  overflow: hidden;
}

.login-bg-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
}

.shape-1 {
  width: 400px; height: 400px;
  background: var(--accent-primary);
  top: -100px; right: -100px;
  animation: float 8s ease-in-out infinite;
}
.shape-2 {
  width: 300px; height: 300px;
  background: var(--accent-secondary);
  bottom: -80px; left: -80px;
  animation: float 10s ease-in-out infinite reverse;
}
.shape-3 {
  width: 200px; height: 200px;
  background: var(--warning);
  top: 50%; left: 20%;
  animation: float 12s ease-in-out infinite 2s;
}
.shape-4 {
  width: 150px; height: 150px;
  background: var(--accent-primary-light);
  top: 20%; right: 30%;
  animation: pulse 6s ease-in-out infinite;
}
.shape-5 {
  width: 250px; height: 250px;
  background: var(--info);
  bottom: 20%; right: -50px;
  animation: float 14s ease-in-out infinite 1s;
}

.login-card {
  background: rgba(18, 18, 42, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(124,58,237,0.1);
  animation: fadeInUp 0.6s ease;
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-img {
  height: 120px;
  width: auto;
  object-fit: contain;
  margin-bottom: 16px;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.15));
}

.login-title {
  font-size: 28px;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.login-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  padding: 4px;
}

.login-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.login-tab .material-icons-round { font-size: 18px; }

.login-tab.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(124,58,237,0.4);
}

.login-tab:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

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

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

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 20px;
  pointer-events: none;
  transition: color var(--transition-normal);
}

.input-wrapper .form-input {
  padding-left: 44px;
}

.input-wrapper .form-input:focus ~ .input-icon,
.input-wrapper .form-input:focus + .input-icon {
  color: var(--accent-primary-light);
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  transition: color var(--transition-fast);
}
.password-toggle:hover { color: var(--text-primary); }
.password-toggle .material-icons-round { font-size: 20px; }

.btn-login {
  margin-top: 8px;
  padding: 14px;
  font-size: 16px;
  gap: 8px;
}

.login-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 24px;
  padding: 12px 16px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.login-hint .material-icons-round {
  font-size: 16px;
  color: var(--info);
  margin-top: 1px;
  flex-shrink: 0;
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.login-card.shake { animation: shake 0.4s ease; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: linear-gradient(180deg, #0e0e24 0%, #080818 100%);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--transition-slow);
  overflow: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 20px 24px;
  border-bottom: 1px solid var(--border-color);
  min-height: 72px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  white-space: nowrap;
}

.logo-img {
  height: 35px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity var(--transition-normal);
}

.sidebar.collapsed .logo-text { opacity: 0; width: 0; }

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
}
.sidebar-toggle:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.sidebar-toggle .material-icons-round { font-size: 22px; }

.sidebar.collapsed .sidebar-toggle {
  margin: 0 auto;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-normal);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.nav-item.active {
  color: #fff;
  background: rgba(124, 58, 237, 0.15);
  box-shadow: inset 3px 0 0 var(--accent-primary);
}

.nav-item.active .nav-icon {
  color: var(--accent-primary-light);
}

.nav-icon {
  font-size: 22px;
  flex-shrink: 0;
  transition: color var(--transition-normal);
}

.nav-text {
  transition: opacity var(--transition-normal);
}

.sidebar.collapsed .nav-text { opacity: 0; width: 0; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  min-width: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  transition: opacity var(--transition-normal);
}

.sidebar.collapsed .user-info { opacity: 0; width: 0; }
.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 16px 8px; }

.user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 10px;
  width: fit-content;
}

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-slow);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed);
}

/* ---- App Header ---- */
.app-header {
  height: var(--header-height);
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(10, 10, 26, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  z-index: 50;
}

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

.header-title {
  font-size: 20px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 12px;
  transition: all var(--transition-normal);
  position: relative;
}

.header-search:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
  background: rgba(255,255,255,0.08);
}

.header-search .material-icons-round {
  font-size: 20px;
  color: var(--text-muted);
}

.header-search .form-input {
  border: none;
  background: none;
  padding: 8px 0;
  width: 200px;
  font-size: 13px;
}

.header-search .form-input:focus {
  box-shadow: none;
  border-color: transparent;
}

.notification-btn {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-avatar { cursor: pointer; }

.mobile-only { display: none; }
#mobile-menu-btn { display: none; }

/* ---- Content Area ---- */
.content-area {
  flex: 1;
  padding: 28px 32px;
}

/* ============================================================
   PAGE SECTIONS
   ============================================================ */
.page {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

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

.page-header h2 {
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-header .header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============================================================
   CARD SYSTEM
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--transition-normal);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

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

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 24px;
}

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
}

.stat-card.purple::before { background: var(--accent-primary); }
.stat-card.cyan::before { background: var(--accent-secondary); }
.stat-card.green::before { background: var(--success); }
.stat-card.amber::before { background: var(--warning); }

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon .material-icons-round { font-size: 24px; color: #fff; }

.stat-card.purple .stat-icon { background: rgba(124,58,237,0.2); }
.stat-card.purple .stat-icon .material-icons-round { color: var(--accent-primary-light); }
.stat-card.cyan .stat-icon { background: rgba(6,182,212,0.2); }
.stat-card.cyan .stat-icon .material-icons-round { color: var(--accent-secondary); }
.stat-card.green .stat-icon { background: rgba(16,185,129,0.2); }
.stat-card.green .stat-icon .material-icons-round { color: var(--success); }
.stat-card.amber .stat-icon { background: rgba(245,158,11,0.2); }
.stat-card.amber .stat-icon .material-icons-round { color: var(--warning); }

.stat-info { flex: 1; }

.stat-number {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================================
   DATA TABLES
   ============================================================ */
.table-container,
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

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

.data-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(124,58,237,0.04);
}

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

.table-student-name {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-actions {
  display: flex;
  gap: 4px;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

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

.form-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  padding: 10px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  transition: all var(--transition-normal);
  outline: none;
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
  background: rgba(255,255,255,0.08);
}

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

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236060a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  display: none;
}

.form-group.error .form-input,
.form-group.error .form-select {
  border-color: var(--danger);
}

.form-group.error .form-error {
  display: block;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn .material-icons-round {
  font-size: 18px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(124,58,237,0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(124,58,237,0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

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

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-success {
  background: rgba(16,185,129,0.15);
  color: var(--success);
  border: 1px solid rgba(16,185,129,0.2);
}

.btn-success:hover {
  background: var(--success);
  color: #fff;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

.btn-icon .material-icons-round {
  font-size: 20px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-sm .material-icons-round {
  font-size: 16px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-success {
  background: rgba(16,185,129,0.15);
  color: var(--success);
}

.badge-warning {
  background: rgba(245,158,11,0.15);
  color: var(--warning);
}

.badge-danger {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
}

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

.badge-purple {
  background: rgba(124,58,237,0.15);
  color: var(--accent-primary-light);
}

/* ============================================================
   AVATARS
   ============================================================ */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
  color: #fff;
  background: var(--accent-gradient);
}

.avatar-sm { width: 36px; height: 36px; font-size: 13px; }
.avatar-md { width: 48px; height: 48px; font-size: 16px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 80px; height: 80px; font-size: 28px; }

.avatar[data-color="1"] { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.avatar[data-color="2"] { background: linear-gradient(135deg, #06b6d4, #67e8f9); }
.avatar[data-color="3"] { background: linear-gradient(135deg, #10b981, #6ee7b7); }
.avatar[data-color="4"] { background: linear-gradient(135deg, #f59e0b, #fcd34d); }
.avatar[data-color="5"] { background: linear-gradient(135deg, #ef4444, #fca5a5); }
.avatar[data-color="6"] { background: linear-gradient(135deg, #ec4899, #f9a8d4); }
.avatar[data-color="7"] { background: linear-gradient(135deg, #3b82f6, #93c5fd); }
.avatar[data-color="8"] { background: linear-gradient(135deg, #8b5cf6, #c4b5fd); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.25s ease;
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
}

.modal-close:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

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

.modal-footer:empty { display: none; }

/* ============================================================
   CONFIRM DIALOG
   ============================================================ */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.confirm-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.confirm-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.25s ease;
}

.confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(245,158,11,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.confirm-icon .material-icons-round {
  font-size: 28px;
  color: var(--warning);
}

.confirm-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.confirm-message {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-actions .btn {
  min-width: 100px;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  position: relative;
  overflow: hidden;
  border-left: 4px solid var(--info);
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info { border-left-color: var(--info); }

.toast-icon {
  flex-shrink: 0;
}

.toast-icon .material-icons-round { font-size: 22px; }

.toast.toast-success .toast-icon .material-icons-round { color: var(--success); }
.toast.toast-error .toast-icon .material-icons-round { color: var(--danger); }
.toast.toast-warning .toast-icon .material-icons-round { color: var(--warning); }
.toast.toast-info .toast-icon .material-icons-round { color: var(--info); }

.toast-content { flex: 1; }

.toast-message {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  flex-shrink: 0;
}

.toast-close:hover { color: var(--text-primary); }
.toast-close .material-icons-round { font-size: 18px; }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 0 var(--radius-md);
  animation: progressBar linear forwards;
}

.toast.toast-success .toast-progress { background: var(--success); }
.toast.toast-error .toast-progress { background: var(--danger); }
.toast.toast-warning .toast-progress { background: var(--warning); }
.toast.toast-info .toast-progress { background: var(--info); }

.toast.removing {
  animation: slideOutRight 0.3s ease forwards;
}

/* ============================================================
   TOOLBAR / SEARCH & FILTER
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 14px;
  flex: 1;
  max-width: 400px;
  transition: all var(--transition-normal);
}

.search-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

.search-wrapper .material-icons-round {
  font-size: 20px;
  color: var(--text-muted);
}

.search-wrapper input {
  border: none;
  background: none;
  padding: 10px 0;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  outline: none;
  width: 100%;
}

.search-wrapper input::placeholder {
  color: var(--text-muted);
}

.filter-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-group .form-select {
  width: auto;
  min-width: 130px;
  padding: 9px 36px 9px 12px;
  font-size: 13px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .material-icons-round {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 14px;
  max-width: 400px;
  margin: 0 auto;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
  margin-right: auto;
}

.pagination-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.pagination-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-btn .material-icons-round {
  font-size: 18px;
}

/* ============================================================
   BULK ACTIONS BAR
   ============================================================ */
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  animation: fadeInDown 0.3s ease;
}

.bulk-actions .selected-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary-light);
  margin-right: auto;
}

/* ============================================================
   ATTENDANCE STYLES
   ============================================================ */
.attendance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.attendance-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  transition: all var(--transition-normal);
  border-left: 4px solid transparent;
}

.attendance-card.present { border-left-color: var(--success); }
.attendance-card.absent { border-left-color: var(--danger); }
.attendance-card.late { border-left-color: var(--warning); }

.attendance-card .student-name {
  font-size: 14px;
  font-weight: 600;
}

.attendance-card .student-roll {
  font-size: 12px;
  color: var(--text-muted);
}

.status-buttons {
  display: flex;
  gap: 8px;
}

.status-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: transparent;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-btn:hover { transform: scale(1.1); }

.status-btn.present-btn { color: var(--success); border-color: rgba(16,185,129,0.3); }
.status-btn.present-btn.active { background: var(--success); color: #fff; border-color: var(--success); box-shadow: 0 4px 12px rgba(16,185,129,0.4); }

.status-btn.absent-btn { color: var(--danger); border-color: rgba(239,68,68,0.3); }
.status-btn.absent-btn.active { background: var(--danger); color: #fff; border-color: var(--danger); box-shadow: 0 4px 12px rgba(239,68,68,0.4); }

.status-btn.late-btn { color: var(--warning); border-color: rgba(245,158,11,0.3); }
.status-btn.late-btn.active { background: var(--warning); color: #fff; border-color: var(--warning); box-shadow: 0 4px 12px rgba(245,158,11,0.4); }

.attendance-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.summary-dot.green { background: var(--success); }
.summary-dot.red { background: var(--danger); }
.summary-dot.amber { background: var(--warning); }

/* ============================================================
   CHART CONTAINERS
   ============================================================ */
.chart-container {
  position: relative;
  padding: 16px 0;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  padding: 0 8px;
}

.chart-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  max-width: 40px;
  border-radius: 6px 6px 0 0;
  background: var(--accent-gradient);
  transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-height: 4px;
  cursor: pointer;
}

.chart-bar:hover {
  opacity: 0.85;
  transform: scaleX(1.05);
}

.chart-bar-value {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.chart-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

/* Donut chart */
.donut-chart {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  position: relative;
  margin: 0 auto;
}

.donut-center {
  position: absolute;
  inset: 25%;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-center .donut-value {
  font-size: 24px;
  font-weight: 800;
}

.donut-center .donut-label {
  font-size: 11px;
  color: var(--text-muted);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent-gradient);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   TEACHER CARDS GRID
   ============================================================ */
.teachers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.teacher-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.teacher-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  border-color: var(--border-light);
}

.teacher-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.teacher-card-info { flex: 1; }

.teacher-card-name {
  font-size: 16px;
  font-weight: 700;
}

.teacher-card-subject {
  font-size: 13px;
  color: var(--text-secondary);
}

.teacher-card-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.teacher-card-detail .material-icons-round {
  font-size: 16px;
  color: var(--text-muted);
}

.teacher-card-classes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.teacher-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

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

.status-dot.active { background: var(--success); box-shadow: 0 0 8px rgba(16,185,129,0.5); }
.status-dot.inactive { background: var(--danger); }

/* ============================================================
   TAB NAVIGATION (Admin)
   ============================================================ */
.tab-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.03); }

.tab-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(124,58,237,0.3);
}

.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

/* ============================================================
   DANGER ZONE
   ============================================================ */
.danger-zone {
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: rgba(239,68,68,0.03);
}

.danger-zone h3 {
  color: var(--danger);
  font-size: 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.danger-zone .btn {
  margin-top: 8px;
}

/* ============================================================
   CLASS ASSIGNMENT GRID
   ============================================================ */
.class-grid {
  display: grid;
  grid-template-columns: auto repeat(3, 60px);
  gap: 4px;
  margin: 8px 0;
  font-size: 13px;
}

.class-grid-header {
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  padding: 8px;
}

.class-grid-label {
  padding: 8px;
  font-weight: 500;
  color: var(--text-secondary);
}

.class-grid-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.class-grid-cell input[type="checkbox"] {
  appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-light);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.class-grid-cell input[type="checkbox"]:checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.class-grid-cell input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.class-grid-cell input[type="checkbox"]:hover {
  border-color: var(--accent-primary-light);
}

/* ============================================================
   VIEW MODE TOGGLE
   ============================================================ */
.view-toggle {
  display: flex;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.view-toggle-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-toggle-btn.active {
  background: var(--accent-primary);
  color: #fff;
}

.view-toggle-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

/* ============================================================
   DASHBOARD SPECIFIC
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon.green { background: rgba(16,185,129,0.15); }
.activity-icon.blue { background: rgba(59,130,246,0.15); }
.activity-icon.purple { background: rgba(124,58,237,0.15); }
.activity-icon.amber { background: rgba(245,158,11,0.15); }

.activity-icon .material-icons-round { font-size: 18px; }
.activity-icon.green .material-icons-round { color: var(--success); }
.activity-icon.blue .material-icons-round { color: var(--info); }
.activity-icon.purple .material-icons-round { color: var(--accent-primary-light); }
.activity-icon.amber .material-icons-round { color: var(--warning); }

.activity-text {
  flex: 1;
  font-size: 13px;
  line-height: 1.5;
}

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

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.quick-action-btn:hover {
  background: rgba(124,58,237,0.08);
  border-color: rgba(124,58,237,0.2);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.quick-action-btn .material-icons-round {
  font-size: 28px;
  color: var(--accent-primary-light);
}

/* ============================================================
   DETAIL VIEW (Student/Teacher Details)
   ============================================================ */
.detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.detail-name {
  font-size: 22px;
  font-weight: 700;
}

.detail-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.detail-item-value {
  font-size: 14px;
  color: var(--text-primary);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.w-full { width: 100%; }

/* ============================================================
   ANIMATIONS / KEYFRAMES
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-100px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(20px, -30px) rotate(5deg); }
  50% { transform: translate(-10px, -50px) rotate(-3deg); }
  75% { transform: translate(15px, -20px) rotate(3deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.08; }
  50% { transform: scale(1.15); opacity: 0.12; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes progressBar {
  from { width: 100%; }
  to { width: 0%; }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

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

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

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */
.mobile-sub-header { display: none; }

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
  .sidebar {
    width: var(--sidebar-collapsed);
  }

  .sidebar .logo-text,
  .sidebar .nav-text,
  .sidebar .user-info {
    opacity: 0;
    width: 0;
  }

  .sidebar .nav-item {
    justify-content: center;
    padding: 12px;
  }

  .sidebar .sidebar-footer {
    justify-content: center;
    padding: 16px 8px;
  }

  .main-content {
    margin-left: var(--sidebar-collapsed);
  }

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

@media (max-width: 768px) {
  #mobile-menu-btn {
    display: flex !important;
  }
  .sidebar-toggle {
    display: none !important;
  }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Off-Canvas Sliding Sidebar Drawer */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: min(280px, 85vw) !important;
    height: 100vh !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1000 !important;
    background: linear-gradient(180deg, #0e0e24 0%, #080818 100%) !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5) !important;
    border-right: 1px solid var(--border-color) !important;
    border-top: none !important;
    bottom: auto !important;
    right: auto !important;
    padding: 0 !important;
    overflow-y: auto !important;
  }

  /* When the sidebar is active/toggled on mobile */
  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  /* Ensure sidebar header is visible in mobile drawer */
  .sidebar-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 20px 20px 20px 24px !important;
    border-bottom: 1px solid var(--border-color) !important;
    min-height: 72px !important;
  }

  /* Ensure sidebar nav and footer are in normal block/flex flow */
  .sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    padding: 16px 12px !important;
    flex: 1 !important;
    overflow-y: auto !important;
  }

  .sidebar-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 16px 20px !important;
    border-top: 1px solid var(--border-color) !important;
  }

  .sidebar-footer .user-profile {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
  }

  /* Navigation items in the drawer - restore standard layout */
  .sidebar-nav .nav-item {
    display: flex !important;
    flex-direction: row !important; /* normal horizontal row alignment */
    align-items: center !important;
    gap: 14px !important;
    padding: 12px 16px !important;
    border-radius: var(--radius-md) !important;
    width: 100% !important;
    height: auto !important;
    color: var(--text-secondary) !important;
    justify-content: flex-start !important;
    margin-bottom: 4px !important;
  }

  .sidebar-nav .nav-item .nav-icon {
    font-size: 22px !important;
    color: var(--text-muted) !important;
  }

  .sidebar-nav .nav-item.active {
    background: rgba(124, 58, 237, 0.1) !important;
    color: var(--text-primary) !important;
  }

  .sidebar-nav .nav-item.active .nav-icon {
    color: var(--accent-primary-light) !important;
  }

  /* Restore nav-text labels next to icons */
  .sidebar-nav .nav-item .nav-text,
  .sidebar .nav-text,
  .nav-text {
    display: block !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    opacity: 1 !important;
    width: auto !important;
  }

  .sidebar-nav .nav-item::before,
  .sidebar-nav .nav-item::after {
    display: none !important;
  }

  /* Logout button in the footer drawer */
  .sidebar-footer #logout-btn {
    background: none !important;
    border: none !important;
    color: var(--danger) !important;
    cursor: pointer !important;
    padding: 6px !important;
    border-radius: var(--radius-sm) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
  }

  /* Sidebar backdrop overlay styling */
  .sidebar-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    z-index: 999 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
  }

  #sidebar.mobile-open ~ .sidebar-overlay {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Main layout offset adjustments */
  .main-content {
    margin-left: 0 !important;
    margin-bottom: 0 !important; /* completely remove bottom bar spacing */
  }

  .mobile-only {
    display: flex !important; /* show hamburger toggle menu button */
  }

  .content-area {
    padding: 16px 12px 24px !important;
  }

  body, html, .app-layout, #app-layout, .main-content, .page {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .app-header {
    padding: 0 16px !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    overflow: visible !important;
  }

  .header-left {
    min-width: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    flex-shrink: 1 !important;
    gap: 8px !important;
  }

  .header-title {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

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

  .mobile-sub-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 8px 16px !important;
    background: rgba(10, 10, 26, 0.6) !important;
    border-bottom: 1px solid var(--border-color) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .mobile-school-name {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
  }

  .header-search { display: none; }

  /* Stack forms vertically for responsive screen wrapping */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .form-group {
    width: 100% !important;
  }

  /* Tap friendly larger form targets */
  .form-input,
  .form-select,
  .form-textarea {
    padding: 12px 14px !important;
    font-size: 15px !important; /* Prevent automatic iOS zooming on focus */
    min-height: 44px !important;
  }

  /* Fix for login page icons overlap. Keep left padding at 48px inside input wrappers and offset absolute icons/buttons */
  .input-wrapper .form-input {
    padding-left: 48px !important;
    padding-right: 48px !important;
  }

  .input-wrapper .input-icon {
    left: 16px !important;
  }

  .input-wrapper .password-toggle {
    right: 16px !important;
  }

  /* Compliance for tap targets size */
  .btn {
    padding: 12px 20px !important;
    font-size: 14px !important;
    min-height: 46px !important;
  }

  .btn-sm {
    padding: 8px 14px !important;
    font-size: 13px !important;
    min-height: 36px !important;
  }

  .table-actions .btn-icon,
  .table-actions .btn-sm {
    min-width: 38px !important;
    min-height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px !important;
  }

  .search-wrapper {
    max-width: 100%;
    min-height: 44px !important;
  }

  .filter-group {
    flex-wrap: wrap;
    width: 100% !important;
    gap: 8px !important;
  }

  .filter-group .form-select {
    flex: 1 !important;
    min-width: 120px !important;
  }

  .teachers-grid {
    grid-template-columns: 1fr;
  }

  .attendance-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px !important;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 32px 20px;
    margin: 16px;
    width: 100% !important;
    max-width: 400px !important;
  }

  .modal-container {
    margin: 16px;
    max-height: 85vh;
  }

  /* Table Horizontal Scrolling Optimization - Keep tables scrollable with fixed min-width to avoid column compression */
  .table-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important; /* momentum physics-enabled scroll */
  }

  .data-table {
    min-width: 800px !important; /* Forces table to not squish, enabling scroll container */
    width: 100% !important;
    table-layout: auto !important;
  }

  .data-table th, 
  .data-table td {
    padding: 12px !important;
    font-size: 13px !important;
    white-space: nowrap !important; /* Prevents text cells wrapping/squishing */
  }

  /* Specific mobile override to stack ledger mini stats cards */
  .student-ledger-view .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}

@media (max-width: 576px) {
  .stats-grid { grid-template-columns: 1fr; }
  .quick-actions-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header .header-actions { width: 100%; }
  .tab-nav { overflow-x: auto; }
}

/* ============================================================
   CLASS PROMOTION STYLES
   ============================================================ */
.promotion-card-item {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid var(--border-color) !important;
  padding: 10px 12px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all var(--transition-fast) !important;
}

.promotion-card-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(124, 58, 237, 0.3) !important;
}

.promotion-card-item:has(input[type="checkbox"]:checked) {
  background: rgba(124, 58, 237, 0.08) !important;
  border-color: rgba(124, 58, 237, 0.4) !important;
}

@media (max-width: 576px) {
  .promotion-grid {
    grid-template-columns: 1fr !important;
  }
}

.exams-filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
}

@media (max-width: 768px) {
  .exams-filter-grid {
    grid-template-columns: 1fr !important;
  }
}

.normal-notice {
  background: rgba(124, 58, 237, 0.04) !important;
  border-left-color: var(--accent-primary) !important;
}
.urgent-notice {
  background: rgba(239, 68, 68, 0.06) !important;
  border-left-color: var(--danger) !important;
  animation: pulse-border 2s infinite ease-in-out !important;
}

@keyframes pulse-border {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2);
  }
  50% {
    box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.4);
  }
}

/* Fix Admin Panel Horizontal Overflow */
body, .app-layout, #app-layout, .main-content, .content-area {
  max-width: 100% !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

.page, .admin-content, .card, .tab-content {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Ensure data tables inside cards are scrollable and do not overflow card borders */
.card-body {
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: auto !important;
}

/* Fix flex wrapping on buttons and headers to prevent pushing container widths */
.card-header, .flex, .tab-nav, .table-actions, .header-actions, .confirm-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  max-width: 100% !important;
  gap: 8px !important;
  box-sizing: border-box !important;
}

/* Ensure input containers and form grids fit within viewports */
.form-grid, .detail-grid {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  html, body {
    width: 210mm;
    height: 297mm;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .sidebar,
  .app-header,
  .btn,
  .toast-container,
  .modal-overlay,
  .confirm-overlay,
  .toolbar {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card {
    background: #fff;
    border: 1px solid #ddd;
  }

  .data-table th {
    background: #f0f0f0;
    color: #333;
  }

  .data-table td {
    color: #333;
    border-color: #ddd;
  }

  .report-card {
    border: 3px double #000 !important;
    box-shadow: none !important;
    padding: 12mm !important;
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }

  .data-table, .marks-table {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    page-break-inside: avoid !important;
  }

  .marks-table th, .marks-table td {
    padding: 16px 10px !important;
    font-size: 14px !important;
  }

  .student-details {
    padding: 12px 16px !important;
    margin-bottom: 20px !important;
    font-size: 14px !important;
  }

  .summary-footer {
    padding: 12px 16px !important;
    margin-bottom: 20px !important;
    font-size: 14px !important;
  }

  .signatures {
    display: flex !important;
    justify-content: space-between !important;
    margin-top: auto !important;
  }

  .signature-box {
    width: 200px !important;
    height: 85px !important;
    border: 2px solid #000 !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    padding-bottom: 10px !important;
    font-weight: bold !important;
    border-radius: 6px !important;
    background: #fafafa !important;
  }
}

/* Compact Table Layout for Student and Fee Lists */
#page-students .data-table th,
#page-students .data-table td,
#page-fees .data-table th,
#page-fees .data-table td {
  padding: 8px 12px !important;
  line-height: 1.3 !important;
}

/* Sidebar Footer UI Fix */
.sidebar-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.sidebar-footer .logout-btn,
.sidebar-footer #logout-btn {
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  color: var(--danger) !important;
  border-radius: var(--radius-sm) !important;
  cursor: pointer !important;
  transition: all var(--transition-fast) !important;
}

.sidebar-footer .logout-btn:hover,
.sidebar-footer #logout-btn:hover {
  background: rgba(239, 68, 68, 0.1) !important;
}

/* Hide logout button when sidebar is collapsed to prevent overlapping */
.sidebar.collapsed .sidebar-footer .logout-btn,
.sidebar.collapsed .sidebar-footer #logout-btn {
  display: none !important;
}

/* ============================================================
   SUPPORT CHATBOT WIDGET
   ============================================================ */
.svm-chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  font-family: var(--font-family);
}

.chatbot-toggle-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4), 0 0 15px rgba(124, 58, 237, 0.2);
  transition: all var(--transition-normal);
}

.chatbot-toggle-btn:hover {
  transform: scale(1.08) rotate(5deg);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.6), 0 0 25px rgba(124, 58, 237, 0.4);
}

.chatbot-toggle-btn .material-icons-round {
  font-size: 28px;
}

.chatbot-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 360px;
  height: 480px;
  background: rgba(15, 15, 35, 0.92);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-lg), 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1001;
  animation: chatbot-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 0.3s ease;
}

@keyframes chatbot-slide-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chatbot-window.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.chatbot-header {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-header-info .header-icon {
  font-size: 24px;
  color: var(--accent-primary-light);
  background: rgba(124, 58, 237, 0.15);
  padding: 6px;
  border-radius: 50%;
}

.chatbot-header-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.chatbot-header-status {
  font-size: 11px;
  color: var(--success);
  margin: 2px 0 0 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chatbot-header-status .status-dot {
  width: 6px;
  height: 6px;
  background-color: var(--success);
  border-radius: 50%;
  display: inline-block;
  animation: chatbot-pulse 1.5s infinite;
}

@keyframes chatbot-pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.chatbot-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.chatbot-close-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.chatbot-close-btn .material-icons-round {
  font-size: 20px;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chatbot-message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.bot-message {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.user-message {
  background: var(--accent-gradient);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.2);
}

.chatbot-input-area {
  padding: 12px;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.01);
  display: flex;
  gap: 8px;
  align-items: center;
}

.chatbot-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 13px;
  outline: none;
  transition: all var(--transition-normal);
}

.chatbot-input:focus {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.05);
}

.chatbot-send-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.chatbot-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.chatbot-send-btn .material-icons-round {
  font-size: 16px;
}

/* Typing Indicator Animation */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  display: inline-block;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

/* Responsive adjustment for small viewports */
@media (max-width: 480px) {
  .chatbot-window {
    width: calc(100vw - 32px);
    height: 400px;
    right: 16px;
    bottom: 80px;
  }
  .svm-chatbot-widget {
    right: 16px;
    bottom: 16px;
  }
}

/* ============================================================
   HELP CENTER / SUPPORT PORTAL
   ============================================================ */
.support-hero {
  padding: 40px 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.support-hero h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-primary), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.support-search-bar {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
}

.support-search-bar .material-icons-round {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  font-size: 24px;
}

.support-search-bar input {
  width: 100%;
  padding: 16px 16px 16px 52px;
  font-size: 15px;
  background: rgba(15, 15, 35, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-normal);
}

.support-search-bar input:focus {
  border-color: var(--accent-primary);
  background: rgba(15, 15, 35, 0.8);
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.2);
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .support-grid {
    grid-template-columns: 1fr;
  }
  .support-card[data-category="teachers"] {
    grid-column: span 1 !important;
  }
}

.support-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.support-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 15px rgba(124, 58, 237, 0.1);
}

.support-card-icon {
  font-size: 36px;
  margin-bottom: 16px;
}

.support-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.support-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.support-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.support-detail-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.support-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.accordion-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.accordion-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.accordion-trigger:hover {
  background: rgba(255, 255, 255, 0.02);
}

.accordion-trigger .arrow-icon {
  color: var(--text-muted);
  transition: transform var(--transition-normal);
}

.accordion-panel {
  padding: 0 20px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  animation: slideDown 0.25s ease-out;
}

.accordion-panel.hidden {
  display: none;
}

.accordion-panel.active {
  display: block !important;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.accordion-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding-top: 16px;
}

.step-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.step-bullet {
  color: var(--accent-primary-light);
  font-weight: bold;
}

.support-guide-video {
  margin-top: 16px;
  border: 1.5px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.support-guide-video:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--accent-primary-light);
  color: var(--text-primary);
}

.support-guide-video .material-icons-round {
  font-size: 24px;
  color: var(--accent-primary-light);
}

/* Floating Contact Admin Button */
.contact-admin-btn {
  position: fixed;
  bottom: 24px;
  right: 96px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(30, 30, 50, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: none; /* Hidden by default - router toggles display: flex on support page */
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  z-index: 1000;
}

.contact-admin-btn:hover {
  transform: scale(1.08);
  border-color: var(--accent-primary-light);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.2);
  color: var(--accent-primary-light);
}

.contact-admin-btn .material-icons-round {
  font-size: 26px;
}

/* Mobile responsive float adjust */
@media (max-width: 480px) {
  .contact-admin-btn {
    bottom: 16px;
    right: 84px;
  }
}

/* Chatbot Option Buttons */
.chatbot-opt-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  font-size: 12.5px;
  font-family: var(--font-family);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
  width: 100%;
}

.chatbot-opt-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-primary-light);
  transform: translateX(4px);
}

/* Global Search Dropdown Results styles */
.global-search-results {
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  background: rgba(22, 22, 33, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 1001;
  margin-top: 8px;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.global-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition-normal);
}

.global-search-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.global-search-item .avatar {
  flex-shrink: 0;
}

.global-search-item .info {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.global-search-item .name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-search-item .role {
  font-size: 11.5px;
  color: var(--text-muted);
}

.global-search-no-results {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ==================== TEACHER ATTENDANCE GPS GEOFENCE MODULE ==================== */
.punch-card-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 500px;
  margin: 0 auto 32px auto;
  text-align: center;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.punch-clock {
  font-size: 42px;
  font-family: monospace;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.punch-date {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.punch-buttons {
  display: flex;
  gap: 20px;
  width: 100%;
  margin-bottom: 8px;
}

.btn-punch {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  transition: all var(--transition-normal);
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 14.5px;
}

.btn-punch:hover:not(:disabled) {
  transform: translateY(-4px);
}

.btn-punch:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  transform: none;
}

.btn-punch-in {
  border-color: rgba(16, 185, 129, 0.25);
}

.btn-punch-in:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--success);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.15);
}

.btn-punch-in .material-icons-round {
  font-size: 36px;
  color: var(--success);
}

.btn-punch-out {
  border-color: rgba(239, 68, 68, 0.25);
}

.btn-punch-out:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--danger);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.15);
}

.btn-punch-out .material-icons-round {
  font-size: 36px;
  color: var(--danger);
}

.punch-status-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.geofence-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.geofence-badge.inside {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.geofence-badge.outside {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.geofence-badge .material-icons-round {
  font-size: 16px;
}

.gps-info-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Tab buttons for Admin dashboard */
.teacher-att-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.teacher-att-tab {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.teacher-att-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.teacher-att-tab.active {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

/* Support Ticket Form Dropdown Dark Theme UI Fix */
#ticket-category {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

#ticket-category option {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

/* ============================================================
   ADMIN PANEL TWO-COLUMN LAYOUT
   ============================================================ */
.admin-panel-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 30px;
  align-items: start;
  margin-top: 20px;
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.01);
  border-right: 1px solid var(--border-light);
  padding-right: 20px;
  position: sticky;
  top: 90px;
}

.admin-sidebar .tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  transition: all var(--transition-normal);
  white-space: normal;
}

.admin-sidebar .tab-btn .material-icons-round {
  font-size: 20px;
  color: var(--text-muted);
  transition: color var(--transition-normal);
}

.admin-sidebar .tab-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.admin-sidebar .tab-btn:hover .material-icons-round {
  color: var(--text-primary);
}

.admin-sidebar .tab-btn.active {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.25);
}

.admin-sidebar .tab-btn.active .material-icons-round {
  color: #ffffff;
}

.admin-content-area {
  min-width: 0;
}

/* ============================================================
   ADMIN FORM GRID & MODERN TOGGLE CHIPS
   ============================================================ */
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.chip-toggle-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.chip-toggle {
  cursor: pointer;
  position: relative;
  user-select: none;
}

.chip-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.chip-label {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  transition: all var(--transition-fast);
}

.chip-toggle:hover .chip-label {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.chip-checkbox:checked + .chip-label {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.2);
}

.chip-checkbox:checked + .chip-label.cyan {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(6, 182, 212, 0.2);
}

@media (max-width: 992px) {
  .admin-panel-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .admin-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding-right: 0;
    padding-bottom: 16px;
    flex-direction: row;
    overflow-x: auto;
    position: static;
    white-space: nowrap;
  }
  .admin-sidebar .tab-btn {
    width: auto;
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  .admin-form-grid,
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  .notification-dropdown {
    position: fixed !important;
    top: 76px !important; /* 72px header height + 4px gap */
    right: 16px !important;
    left: auto !important;
    width: calc(100vw - 32px) !important;
    max-width: 380px !important;
    z-index: 9999 !important;
    transform: none !important;
  }

  .table-container,
  .table-wrapper {
    overflow-x: auto !important;
    display: block !important;
    white-space: nowrap !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .table-container table,
  .table-wrapper table {
    width: 100% !important;
    min-width: 600px !important;
  }
}

/* ============================================================
   PASSWORD FIELD VISIBILITY TOGGLE STYLES
   ============================================================ */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-wrapper .form-input {
  padding-right: 40px; /* Leave space for eye icon */
}

.password-wrapper .toggle-password {
  position: absolute;
  right: 14px;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 2;
  font-size: 14px;
  transition: color var(--transition-fast);
}

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

/* ============================================================
   PREMIUM LIGHT THEME DESIGN SYSTEM OVERRIDES
   ============================================================ */
:root.light-theme,
body.light-theme,
body.sa-light-theme,
[data-theme="light"],
.light-theme {
  --bg-primary: #f4f7f6;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e9ecef;
  --bg-card: #ffffff;
  --bg-card-hover: rgba(0, 0, 0, 0.04);
  --bg-glass: rgba(0, 0, 0, 0.02);
  --border-color: rgba(0, 0, 0, 0.12);
  --border-light: rgba(0, 0, 0, 0.18);

  --text-primary: #333333;
  --text-main: #333333;
  --text-secondary: #555555;
  --text-muted: #777777;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

/* Explicit element overrides for light theme to ensure completeness */
body.light-theme {
  background-color: #f4f7f6 !important;
  background: #f4f7f6 !important;
  color: #333333 !important;
}

body.light-theme .sidebar {
  background: #ffffff !important;
  border-right: 1px solid rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .sidebar-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .sidebar-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .app-header {
  background: rgba(244, 247, 246, 0.9) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .card,
body.light-theme .stat-card,
body.light-theme .attendance-card,
body.light-theme .teacher-card,
body.light-theme .support-card,
body.light-theme .modal-container,
body.light-theme .confirm-container {
  background-color: #ffffff !important;
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #333333 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .card-header,
body.light-theme .modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: #333333 !important;
}

body.light-theme .form-input,
body.light-theme .form-select,
body.light-theme .form-textarea {
  background-color: #ffffff !important;
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  color: #333333 !important;
}

body.light-theme .form-input:focus,
body.light-theme .form-select:focus,
body.light-theme .form-textarea:focus {
  border-color: var(--accent-primary) !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15) !important;
}

body.light-theme .form-label {
  color: #555555 !important;
}

body.light-theme .nav-item {
  color: #555555 !important;
}

body.light-theme .nav-item:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #333333 !important;
}

body.light-theme .nav-item.active {
  color: var(--accent-primary) !important;
  background: rgba(124, 58, 237, 0.08) !important;
}

body.light-theme .data-table th {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  border-bottom: 2px solid rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .data-table td {
  color: #333333 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .data-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.04) !important;
}

body.light-theme .chip-label {
  background-color: #f1f5f9 !important;
  background: #f1f5f9 !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #555555 !important;
}

body.light-theme .chip-toggle:hover .chip-label {
  background-color: #e2e8f0 !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
  color: #333333 !important;
}

body.light-theme .notification-dropdown,
body.light-theme .profile-dropdown {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1) !important;
}

body.light-theme .notification-dropdown a,
body.light-theme .profile-dropdown a {
  color: #333333 !important;
}

body.light-theme .notification-dropdown a:hover,
body.light-theme .profile-dropdown a:hover {
  background: rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .chatbot-window {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .bot-message {
  background: #f1f5f9 !important;
  color: #333333 !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .chatbot-input-area {
  background: #f8fafc !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .data-table th {
  background: rgba(0, 0, 0, 0.02) !important;
}

/* ============================================================
   HIDE DUMMY SUPPORT WIDGET
   ============================================================ */
#svm-chatbot-widget,
.svm-chatbot-widget {
  display: none !important;
}

/* ============================================================
   FEE LEDGER PRINT RECEIPT STYLES
   ============================================================ */
.print-receipt-container {
  display: none;
  font-family: 'Inter', sans-serif;
  padding: 30px;
  background: #ffffff;
  color: #000000;
  border-radius: 8px;
  max-width: 500px;
  margin: 20px auto;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
}

.receipt-header {
  text-align: center;
  margin-bottom: 25px;
  border-bottom: 2px dashed #cbd5e1;
  padding-bottom: 15px;
}

.receipt-header h2 {
  margin: 0 0 5px 0;
  color: #1e293b;
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
}

.receipt-header p {
  margin: 0 0 10px 0;
  color: #64748b;
  font-size: 14px;
}

.receipt-header h3 {
  margin: 0;
  color: #334155;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.receipt-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 25px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  padding: 4px 0;
}

.receipt-row .label {
  color: #64748b;
  font-weight: 500;
}

.receipt-row .value {
  color: #0f172a;
  font-weight: 600;
}

.receipt-row.amount-row {
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 0;
  margin-top: 8px;
}

.receipt-row.amount-row .label {
  font-size: 18px;
  color: #0f172a;
  font-weight: 700;
}

.receipt-row.amount-row .value {
  font-size: 20px;
  color: #10b981;
  font-weight: 800;
}

.receipt-footer {
  text-align: center;
  margin-top: 20px;
}

.receipt-footer p {
  margin: 0 0 30px 0;
  color: #64748b;
  font-style: italic;
  font-size: 14px;
}

.signature-area {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: 20px;
}

.signature-line {
  width: 180px;
  border-bottom: 1px solid #0f172a;
  margin-bottom: 5px;
}

.signature-area p {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  margin: 0;
  text-align: center;
  width: 180px;
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  
  .login-page, 
  .app-layout, 
  .modal-overlay, 
  .confirm-overlay, 
  .toast-container, 
  .support-chatbot-toggle, 
  .support-chatbot-window {
    display: none !important;
  }
  
  .print-receipt-container {
    display: block !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 450px !important;
  }
}

/* ============================================================
   SAAS TENANT & UPSELL PAYWALL ANIMATIONS
   ============================================================ */
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
    filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.6));
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

.badge-secondary {
  background-color: rgba(100, 116, 139, 0.2) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(100, 116, 139, 0.4) !important;
}

/* ========================================
   IMPERSONATION BANNER
   ======================================== */
.impersonation-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1a1a2e;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.4);
  animation: impBannerSlideDown 0.3s ease-out;
}

@keyframes impBannerSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.imp-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 20px;
}

.imp-banner-icon {
  font-size: 18px;
  animation: impPulse 2s ease-in-out infinite;
}

@keyframes impPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.imp-banner-text {
  color: #1a1a2e;
}

.imp-banner-text strong {
  color: #000;
}

.imp-banner-exit {
  background: rgba(0, 0, 0, 0.2);
  color: #1a1a2e;
  border: 1px solid rgba(0, 0, 0, 0.3);
  padding: 4px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.imp-banner-exit:hover {
  background: rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

/* Super Admin specific overrides */
.sa-page {
  font-family: 'Inter', sans-serif;
}

/* ========================================
   SUPER ADMIN DASHBOARD STYLES
   ======================================== */
.sa-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

@media (max-width: 1024px) {
  .sa-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.sa-metric-card {
  background: var(--bg-card, rgba(255,255,255,0.04));
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sa-metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.15);
}

.sa-metric-value {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sa-metric-label {
  font-size: 12px;
  color: var(--text-muted, rgba(255,255,255,0.5));
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.sa-expandable-row {
  display: none;
  background: rgba(124, 58, 237, 0.05);
  border-left: 3px solid var(--accent-primary, #7c3aed);
}

.sa-expandable-row.expanded {
  display: table-row;
}

.sa-expandable-content {
  padding: 20px 24px;
}

.sa-feature-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  margin: 3px;
  background: rgba(124, 58, 237, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.sa-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 12px;
}

@media (max-width: 768px) {
  .sa-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- SCHOOL PROFILE MODAL THEME FIXES ---- */
#sa-profile-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#sa-profile-modal-overlay.active {
  display: flex;
}

#sa-profile-modal-overlay .sa-modal {
  background: var(--bg-secondary) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 20px;
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: saModalSlideIn 0.25s ease-out;
}

#sa-profile-modal-overlay .sa-modal-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border-color) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-primary) !important;
}

#sa-profile-modal-overlay .sa-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary) !important;
}

#sa-profile-modal-overlay .sa-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary) !important;
  cursor: pointer;
  font-size: 24px;
  padding: 4px;
  transition: color 0.2s;
}

#sa-profile-modal-overlay .sa-modal-close:hover {
  color: #f87171 !important;
}

#sa-profile-modal-overlay .sa-modal-body {
  padding: 24px 28px;
  color: var(--text-main) !important;
}

#sa-profile-modal-overlay .sa-modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-color) !important;
  background: transparent !important;
}

#sa-profile-modal-overlay .sa-profile-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--border-color) !important;
  margin-bottom: 24px;
  padding-bottom: 1px;
}

#sa-profile-modal-overlay .sa-profile-tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary) !important;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 4px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  font-family: 'Inter', sans-serif;
}

#sa-profile-modal-overlay .sa-profile-tab-btn:hover {
  color: var(--text-primary) !important;
}

#sa-profile-modal-overlay .sa-profile-tab-btn.active {
  color: #60a5fa !important;
}

#sa-profile-modal-overlay .sa-profile-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #2563eb;
  border-radius: 2px;
}

#sa-profile-modal-overlay .sa-profile-contact-box {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary) !important;
  background: var(--bg-card) !important;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color) !important;
}

#sa-profile-modal-overlay .sa-profile-contact-box strong {
  color: var(--text-primary) !important;
}

#sa-profile-modal-overlay .sa-audit-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

#sa-profile-modal-overlay .sa-audit-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary) !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color) !important;
}

#sa-profile-modal-overlay .sa-audit-table td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

#sa-profile-modal-overlay .sa-audit-table tr:last-child td {
  border-bottom: none;
}

/* Light theme overrides strictly nested for the School Profile modal when body has .sa-light-theme or .light-theme */
body.sa-light-theme #sa-profile-modal-overlay .sa-modal-body p,
body.light-theme #sa-profile-modal-overlay .sa-modal-body p,
[data-theme="light"] #sa-profile-modal-overlay .sa-modal-body p {
  color: var(--text-secondary) !important;
}

body.sa-light-theme #sa-profile-modal-overlay .sa-modal-body strong,
body.light-theme #sa-profile-modal-overlay .sa-modal-body strong,
[data-theme="light"] #sa-profile-modal-overlay .sa-modal-body strong {
  color: var(--text-primary) !important;
}

body.sa-light-theme #sa-profile-modal-overlay .sa-profile-contact-box,
body.light-theme #sa-profile-modal-overlay .sa-profile-contact-box,
[data-theme="light"] #sa-profile-modal-overlay .sa-profile-contact-box {
  color: var(--text-secondary) !important;
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-color) !important;
}

body.sa-light-theme #sa-profile-modal-overlay .sa-profile-contact-box strong,
body.light-theme #sa-profile-modal-overlay .sa-profile-contact-box strong,
[data-theme="light"] #sa-profile-modal-overlay .sa-profile-contact-box strong {
  color: var(--text-primary) !important;
}

body.sa-light-theme #sa-profile-modal-overlay .sa-profile-tab-btn.active,
body.light-theme #sa-profile-modal-overlay .sa-profile-tab-btn.active,
[data-theme="light"] #sa-profile-modal-overlay .sa-profile-tab-btn.active {
  color: #2563eb !important;
}

/* Badge Contrast Overrides in Light Theme */
body.sa-light-theme .sa-feature-pill,
body.light-theme .sa-feature-pill,
[data-theme="light"] .sa-feature-pill {
  background: rgba(37, 99, 235, 0.12) !important;
  color: #0a4275 !important;
  border-color: rgba(37, 99, 235, 0.25) !important;
}

body.sa-light-theme .sa-badge-premium,
body.light-theme .sa-badge-premium,
[data-theme="light"] .sa-badge-premium {
  background: rgba(37, 99, 235, 0.15) !important;
  color: #0a4275 !important;
  border-color: rgba(37, 99, 235, 0.25) !important;
}

body.sa-light-theme .sa-badge-pro,
body.light-theme .sa-badge-pro,
[data-theme="light"] .sa-badge-pro {
  background: rgba(6, 182, 212, 0.15) !important;
  color: #0e7490 !important;
  border-color: rgba(6, 182, 212, 0.25) !important;
}

body.sa-light-theme .sa-badge-active,
body.light-theme .sa-badge-active,
[data-theme="light"] .sa-badge-active {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #065f46 !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
}

body.sa-light-theme .sa-badge-paused,
body.light-theme .sa-badge-paused,
[data-theme="light"] .sa-badge-paused {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #991b1b !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}

/* Custom Selection highlights for checkbox containers, buttons, and chips */
.subject-cb-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  padding: 6px 12px;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.subject-cb-label:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.subject-cb-label:has(input.subject-cb:checked) {
  background: rgba(124, 58, 237, 0.15) !important;
  border: 2px solid var(--accent-primary) !important;
  color: var(--text-primary) !important;
  padding: 5px 11px !important;
}

body.light-theme .subject-cb-label:has(input.subject-cb:checked) {
  background: rgba(124, 58, 237, 0.12) !important;
  border: 2px solid var(--accent-primary) !important;
  color: var(--text-primary) !important;
}

/* Custom Checkbox highlights in class assign grids */
.class-grid-cell input[type="checkbox"]:checked {
  background: var(--accent-primary) !important;
  border: 2px solid var(--accent-primary-light) !important;
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.5) !important;
}

/* Class mappings row toggles inside teacher modal */
.mapping-row label:has(input[type="checkbox"]:checked) {
  background: rgba(124, 58, 237, 0.15) !important;
  border: 2px solid var(--accent-primary) !important;
  padding: 3px 7px !important;
  border-radius: 6px;
  color: var(--text-primary) !important;
}

body.light-theme .mapping-row label:has(input[type="checkbox"]:checked) {
  background: rgba(124, 58, 237, 0.1) !important;
  border: 2px solid var(--accent-primary) !important;
}

/* Promotion student select items */
.promotion-card-item:has(input[type="checkbox"]:checked) {
  background: rgba(124, 58, 237, 0.15) !important;
  border: 2px solid var(--accent-primary) !important;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.2) !important;
}

/* Super Admin Features grid checkboxes styling */
.sa-feature-toggle:has(input[type="checkbox"]:checked) {
  border: 2px solid var(--accent-primary) !important;
  background: rgba(124, 58, 237, 0.15) !important;
  color: #ffffff !important;
  padding: 7px 11px !important;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.25) !important;
}

body.light-theme .sa-feature-toggle:has(input[type="checkbox"]:checked),
body.sa-light-theme .sa-feature-toggle:has(input[type="checkbox"]:checked),
[data-theme="light"] .sa-feature-toggle:has(input[type="checkbox"]:checked) {
  border: 2px solid #2563eb !important;
  background: rgba(37, 99, 235, 0.1) !important;
  color: #1e293b !important;
  padding: 7px 11px !important;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.2) !important;
}

/* Add custom hover override for header theme icon button in light theme */
body.light-theme .btn-icon:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

/* ==================== LOADING OVERLAY STYLING ==================== */
#app-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#app-loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.app-loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: rgba(30, 30, 40, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 32px 48px;
  border-radius: 16px;
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.55);
  max-width: 320px;
  width: 90%;
  text-align: center;
}

body.light-theme .app-loader-content {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.15);
}

.app-loader-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-left-color: var(--accent-primary, #6c5ce7);
  border-radius: 50%;
  animation: app-spin 0.85s linear infinite;
}

body.light-theme .app-loader-spinner {
  border: 4px solid rgba(0, 0, 0, 0.08);
  border-left-color: var(--accent-primary, #2563eb);
}

.app-loader-text {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.5px;
}

body.light-theme .app-loader-text {
  color: #1e293b;
}

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

/* ============================================================
   Redesigned Classes, Sections, and Subjects Configuration Styles
   ============================================================ */
.class-structure-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: all var(--transition-fast);
  gap: 16px;
  flex-wrap: wrap;
}

.class-structure-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.class-structure-row .class-name-badge {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  min-width: 90px;
  text-align: center;
}

.section-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-grow: 1;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 20px;
  transition: all var(--transition-fast);
}

.section-tag:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.section-tag .settings-remove-section {
  cursor: pointer;
  margin-left: 6px;
  color: var(--text-muted);
  font-weight: bold;
  transition: color var(--transition-fast);
}

.section-tag .settings-remove-section:hover {
  color: var(--danger);
}

/* ---- Subjects Configuration Grid ---- */
.subjects-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.subject-config-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.subject-config-chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.subject-config-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject-config-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .class-structure-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .class-structure-row .class-name-badge {
    width: 100%;
  }

  .class-structure-row > div:last-child {
    justify-content: flex-end;
  }
}

/* Live Connection Indicator styles */
.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

@keyframes pulse-dot {
  0% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-dot-warning {
  0% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}


