:root {
  --student-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --student-bg: linear-gradient(135deg, #f5f7ff 0%, #e0e7ff 50%, #ede9fe 100%);
  --student-text: #1f2933;
  --student-text-soft: #4b5563;
  --student-text-muted: #6b7280;
  --student-surface: rgba(255, 255, 255, 0.9);
  --student-surface-alt: rgba(255, 255, 255, 0.6);
  --student-card-bg: rgba(255, 255, 255, 0.95);
  --student-card-border: rgba(99, 102, 241, 0.15);
  --student-card-shadow: 0 15px 50px rgba(15, 23, 42, 0.12);
  --student-card-shadow-hover: 0 25px 70px rgba(79, 70, 229, 0.25);
  --student-border: rgba(255, 255, 255, 0.35);
  --student-nav-bg: rgba(255, 255, 255, 0.1);
  --student-button-bg: rgba(255, 255, 255, 0.2);
  --student-button-hover: rgba(255, 255, 255, 0.35);
  --student-card-hover-lift: -10px;
  --student-card-text: #1f2933;
  --student-card-meta: #596377;
  --student-card-icon-bg: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --student-card-icon-shadow: 0 12px 30px rgba(99, 102, 241, 0.4);
  --student-success: #34d399;
  --student-danger: #f87171;
  --student-warning: #fbbf24;
  --student-badge-shadow: rgba(52, 211, 153, 0.5);
  --student-cache-fresh: #34d399;
  --student-cache-cached: #f97316;
  --student-modal-backdrop: rgba(15, 23, 42, 0.55);
  --student-modal-bg: rgba(255, 255, 255, 0.95);
  --student-scrollbar: rgba(99, 102, 241, 0.35);
  --student-card-border-radius: 22px;
}

[data-student-theme="dark"] {
  --student-bg: radial-gradient(circle at top, #1b1f3a 0%, #0a0f1f 55%, #05070f 100%);
  --student-text: #f4f7ff;
  --student-text-soft: #c7d2fe;
  --student-text-muted: #94a3b8;
  --student-surface: rgba(15, 23, 42, 0.8);
  --student-surface-alt: rgba(15, 23, 42, 0.6);
  --student-card-bg: rgba(15, 23, 42, 0.85);
  --student-card-border: rgba(99, 102, 241, 0.25);
  --student-card-shadow: 0 20px 60px rgba(2, 6, 23, 0.7);
  --student-card-shadow-hover: 0 30px 80px rgba(79, 70, 229, 0.45);
  --student-border: rgba(255, 255, 255, 0.1);
  --student-nav-bg: rgba(15, 23, 42, 0.65);
  --student-button-bg: rgba(255, 255, 255, 0.15);
  --student-button-hover: rgba(255, 255, 255, 0.25);
  --student-card-text: #f8fafc;
  --student-card-meta: #cbd5f5;
  --student-card-icon-bg: linear-gradient(135deg, #7c3aed 0%, #4338ca 100%);
  --student-card-icon-shadow: 0 15px 35px rgba(99, 102, 241, 0.45);
  --student-success: #4ade80;
  --student-danger: #f87171;
  --student-warning: #facc15;
  --student-badge-shadow: rgba(34, 197, 94, 0.5);
  --student-cache-fresh: #22c55e;
  --student-cache-cached: #fb923c;
  --student-modal-bg: rgba(15, 23, 42, 0.95);
  --student-scrollbar: rgba(99, 102, 241, 0.5);
}

[data-student-theme="default"] {
  --student-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --student-text: #ffffff;
  --student-text-soft: #e0e7ff;
  --student-text-muted: #c7d2fe;
  --student-surface: rgba(255, 255, 255, 0.15);
  --student-surface-alt: rgba(255, 255, 255, 0.1);
  --student-card-bg: rgba(255, 255, 255, 0.95);
  --student-card-border: rgba(255, 255, 255, 0.2);
  --student-card-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  --student-card-shadow-hover: 0 30px 80px rgba(0, 0, 0, 0.4);
  --student-border: rgba(255, 255, 255, 0.2);
  --student-nav-bg: rgba(255, 255, 255, 0.1);
  --student-button-bg: rgba(255, 255, 255, 0.2);
  --student-button-hover: rgba(255, 255, 255, 0.3);
  --student-card-text: #1f2933;
  --student-card-meta: #596377;
  --student-card-icon-bg: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --student-card-icon-shadow: 0 12px 30px rgba(99, 102, 241, 0.4);
  --student-success: #10b981;
  --student-danger: #ef4444;
  --student-warning: #f59e0b;
  --student-badge-shadow: rgba(16, 185, 129, 0.5);
  --student-cache-fresh: #10b981;
  --student-cache-cached: #f97316;
  --student-modal-bg: rgba(255, 255, 255, 0.95);
  --student-scrollbar: rgba(102, 126, 234, 0.5);
}

body.student-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--student-font);
  background: var(--student-bg);
  color: var(--student-text);
  transition: background 0.4s ease, color 0.2s ease;
  padding-bottom: 80px;
}

body.student-page::-webkit-scrollbar {
  width: 10px;
}

body.student-page::-webkit-scrollbar-thumb {
  background: var(--student-scrollbar);
  border-radius: 999px;
}

.student-navbar,
.student-page .navbar {
  background: var(--student-nav-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--student-border);
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.student-navbar .container-fluid,
.student-page .navbar .container-fluid {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-back {
  background: var(--student-button-bg);
  border: 1px solid transparent;
  color: var(--student-text);
  padding: 10px 22px;
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  transition: all 0.25s ease;
}

.btn-back:hover {
  background: var(--student-button-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--student-text);
  font-weight: 500;
}

.user-info .user-name {
  font-weight: 600;
  letter-spacing: 0.4px;
}

.btn-logout,
.student-theme-toggle {
  background: var(--student-button-bg);
  border: 1px solid transparent;
  color: var(--student-text);
  padding: 8px 18px;
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-logout:hover,
.student-theme-toggle:hover {
  background: var(--student-button-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.student-theme-toggle {
  width: 38px;
  height: 38px;
  padding: 0;
}

.student-theme-toggle .fa-sun,
.student-theme-toggle .fa-moon {
  font-size: 1rem;
}

.student-fixed-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--student-surface);
  border: 1px solid var(--student-border);
  border-radius: 999px;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--student-text);
  backdrop-filter: blur(12px);
  box-shadow: var(--student-card-shadow);
  z-index: 100;
}

.student-floating-back {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
}

.portal-container,
.student-container,
.container-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 58px 24px 24px;
}

.portal-header,
.page-header {
  text-align: center;
  color: var(--student-text);
  margin-bottom: 2.5rem;
}

.portal-header h1,
.page-header h1 {
  font-size: clamp(2rem, 3vw, 3.5rem);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.portal-header p,
.page-header p {
  margin: 0;
  font-size: 1.1rem;
  color: var(--student-text-muted);
}

.portal-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.6rem;
}

.portal-card {
  background: var(--student-card-bg);
  border-radius: var(--student-card-border-radius);
  padding: 1.8rem;
  text-decoration: none;
  color: var(--student-card-text);
  border: 1px solid var(--student-card-border);
  box-shadow: var(--student-card-shadow);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.5rem;
}

.portal-card:hover {
  transform: translateY(var(--student-card-hover-lift));
  box-shadow: var(--student-card-shadow-hover);
  border-color: rgba(255, 255, 255, 0.35);
}

.portal-card-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  background: var(--student-card-icon-bg);
  box-shadow: var(--student-card-icon-shadow);
  margin-bottom: 0.5rem;
}

.portal-card h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.portal-card p {
  margin: 0;
  color: var(--student-card-meta);
  font-size: 0.95rem;
}

.tutor-announcement-card .announcements-snippet {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
  color: var(--student-card-text);
}

.announcement-snippet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--student-card-border);
  border-radius: 10px;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}

.announcement-snippet-item .announcement-date {
  font-weight: 600;
  color: var(--student-card-meta);
  margin-right: 0.5rem;
}

.announcement-snippet-item .announcement-title {
  flex: 1;
  margin-right: 0.5rem;
}

.points-value {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 0.4rem;
}

.achievement-card .points-value {
  color: var(--student-success);
}

.behaviour-card .points-value {
  color: var(--student-danger);
}

.attendance-card .points-value {
  color: var(--student-warning);
}

.timetable-card .points-value {
  color: #a855f7;
}

.tutor-card .points-value {
  color: #a855f7;
}

.notification-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: linear-gradient(135deg, #34d399, #10b981);
  color: white;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 3px solid var(--student-card-bg);
  box-shadow: 0 10px 20px var(--student-badge-shadow);
  animation: pulse-glow-green 2.4s infinite ease-in-out;
}

.notification-badge.single-digit {
  min-width: 32px;
  text-align: center;
}

@keyframes pulse-glow-green {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1.12);
    box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.cache-indicator {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--student-surface);
  border: 1px solid var(--student-border);
  box-shadow: var(--student-card-shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--student-text);
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
  z-index: 90;
}

.cache-indicator.fresh {
  border-left: 3px solid var(--student-cache-fresh);
}

.cache-indicator.cached {
  border-left: 3px solid var(--student-cache-cached);
}

.data-dump {
  background: var(--student-surface);
  border-radius: 16px;
  padding: 1.5rem;
  color: var(--student-text);
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9rem;
  border: 1px solid var(--student-border);
  box-shadow: var(--student-card-shadow);
  margin-top: 3rem;
}

.data-dump pre {
  background: rgba(0, 0, 0, 0.65);
  color: #a7f3d0;
  padding: 1rem;
  border-radius: 12px;
  overflow-x: auto;
}

.student-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: var(--student-modal-backdrop);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.student-modal.active {
  display: flex;
}

.student-modal .modal-content {
  background: var(--student-modal-bg);
  border-radius: 18px;
  padding: 2rem;
  width: min(500px, 90vw);
  box-shadow: var(--student-card-shadow);
  color: var(--student-text);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-close {
  border: none;
  background: transparent;
  color: var(--student-text);
  font-size: 1.4rem;
  cursor: pointer;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.theme-option {
  border: 1px solid var(--student-card-border);
  border-radius: 14px;
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--student-surface);
  color: var(--student-card-text);
}

.theme-option i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.theme-option .theme-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--student-card-text);
  margin-bottom: 0.25rem;
}

.theme-option small {
  display: block;
  font-size: 0.875rem;
  color: var(--student-card-meta);
}

.theme-option.active {
  border-color: #818cf8;
  box-shadow: 0 10px 30px rgba(129, 140, 248, 0.25);
}

.theme-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.info-note {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid #818cf8;
  background: var(--student-surface);
  color: var(--student-card-text);
  border-radius: 8px;
  font-size: 0.9rem;
}

.info-note i {
  margin-right: 0.5rem;
  color: #818cf8;
}

.coming-soon-card {
  background: var(--student-card-bg);
  border-radius: 24px;
  padding: clamp(2rem, 4vw, 4rem);
  text-align: center;
  box-shadow: var(--student-card-shadow);
  border: 1px solid var(--student-card-border);
}

.coming-soon-icon {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: var(--student-card-icon-shadow);
}

.coming-soon-card h2 {
  margin-bottom: 0.75rem;
  font-size: 1.8rem;
  color: var(--student-card-text);
}

.coming-soon-card p {
  color: var(--student-card-meta);
  margin: 0 auto;
  max-width: 560px;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 2rem auto;
  max-width: 420px;
  text-align: left;
}

.feature-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--student-card-meta);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.feature-list li i {
  color: var(--student-success);
  margin-top: 3px;
}

.settings-card {
  background: var(--student-card-bg);
  border-radius: 24px;
  padding: 2.25rem;
  border: 1px solid var(--student-card-border);
  box-shadow: var(--student-card-shadow);
}

.settings-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  color: var(--student-card-text);
}

.settings-card p {
  color: var(--student-card-meta);
}

footer.student-footer,
.student-page footer {
  background: var(--student-nav-bg);
  color: var(--student-text-muted);
  border-top: 1px solid var(--student-border);
  padding: 1.8rem 0;
  text-align: center;
}

footer.student-footer p,
.student-page footer p {
  margin: 0.3rem 0;
}

@media (max-width: 768px) {
  .portal-cards {
    grid-template-columns: 1fr;
  }

  .student-fixed-panel {
    position: static;
    margin: 16px;
  }

  .user-info {
    gap: 10px;
  }

  .btn-back {
    padding: 8px 16px;
  }

  .portal-card {
    padding: 1.5rem;
  }
}

/* Legacy student sub-page overrides */
[data-student-theme="dark"] .header {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(15, 23, 42, 0.95)) !important;
  color: var(--student-text);
  border-bottom: 1px solid var(--student-border);
}

[data-student-theme="dark"] .header h1,
[data-student-theme="dark"] .header p,
[data-student-theme="dark"] .header span,
[data-student-theme="dark"] .header button {
  color: var(--student-text) !important;
}

[data-student-theme="dark"] .lesson-card {
  background: var(--student-card-bg) !important;
  border-left: 4px solid rgba(99, 102, 241, 0.6) !important;
  color: var(--student-text) !important;
  box-shadow: var(--student-card-shadow);
}

[data-student-theme="dark"] .lesson-card.current-lesson {
  background: rgba(255, 193, 7, 0.08) !important;
  border-color: #facc15 !important;
  box-shadow: 0 20px 40px rgba(250, 204, 21, 0.25) !important;
}

[data-student-theme="dark"] .lesson-title,
[data-student-theme="dark"] .lesson-time-range,
[data-student-theme="dark"] .lesson-time-period,
[data-student-theme="dark"] .lesson-info,
[data-student-theme="dark"] .lesson-footer {
  color: var(--student-text) !important;
}

[data-student-theme="dark"] .lesson-note {
  background: rgba(255, 255, 255, 0.05) !important;
  border-left-color: #8b5cf6 !important;
  color: var(--student-text-soft) !important;
}

[data-student-theme="dark"] .btn-add-note,
[data-student-theme="dark"] .btn-save {
  background: linear-gradient(135deg, #7c3aed, #4338ca) !important;
  color: #fff !important;
}

[data-student-theme="dark"] .btn-cancel,
[data-student-theme="dark"] .btn-outline-secondary {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--student-text) !important;
  border: 1px solid var(--student-border) !important;
}

[data-student-theme="dark"] .note-modal {
  background: rgba(5, 7, 15, 0.8) !important;
}

[data-student-theme="dark"] .note-modal-content,
[data-student-theme="dark"] .password-modal {
  background: var(--student-card-bg) !important;
  color: var(--student-text) !important;
  border: 1px solid var(--student-border);
  box-shadow: var(--student-card-shadow);
}

[data-student-theme="dark"] .note-modal textarea,
[data-student-theme="dark"] .form-control {
  background: rgba(15, 23, 42, 0.6) !important;
  color: var(--student-text) !important;
  border: 1px solid var(--student-border) !important;
}

[data-student-theme="dark"] .requirements,
[data-student-theme="dark"] .confirmation-box,
[data-student-theme="dark"] .requirements h6,
[data-student-theme="dark"] .requirement-item,
[data-student-theme="dark"] .confirmation-box p {
  background: var(--student-card-bg) !important;
  color: var(--student-text) !important;
  border-color: var(--student-border) !important;
}

[data-student-theme="dark"] .requirement-item.valid i {
  color: var(--student-success) !important;
}

[data-student-theme="dark"] .btn-submit,
[data-student-theme="dark"] .btn-confirm-ok,
[data-student-theme="dark"] .btn-custom {
  background: linear-gradient(135deg, #7c3aed, #4338ca) !important;
  color: #fff !important;
}

[data-student-theme="dark"] #btnDay,
[data-student-theme="dark"] #btnWeek,
[data-student-theme="dark"] #btn2Week {
  color: var(--student-text) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

[data-student-theme="dark"] .date-nav,
[data-student-theme="dark"] .view-toggle {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid var(--student-border) !important;
}

[data-student-theme="dark"] .filter-pill,
[data-student-theme="dark"] .active-filter-badge {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--student-text) !important;
  border-color: var(--student-border) !important;
}

[data-student-theme="dark"] .announcements-section,
[data-student-theme="dark"] .coming-soon-card,
[data-student-theme="dark"] .feature-card,
[data-student-theme="dark"] .announcement-card {
  background: var(--student-card-bg) !important;
  color: var(--student-text) !important;
  border-color: var(--student-border) !important;
  box-shadow: var(--student-card-shadow);
}

[data-student-theme="dark"] .announcement-card.priority-high {
  border-left-color: #f87171 !important;
  background: rgba(248, 113, 113, 0.08) !important;
}

[data-student-theme="dark"] .announcement-card.priority-urgent {
  border-left-color: #fdba74 !important;
  background: rgba(253, 186, 116, 0.08) !important;
}

[data-student-theme="dark"] .priority-badge.priority-normal {
  background: rgba(125, 211, 252, 0.15) !important;
  color: #38bdf8 !important;
}

[data-student-theme="dark"] .priority-badge.priority-high {
  background: rgba(248, 113, 113, 0.15) !important;
  color: #fca5a5 !important;
}

[data-student-theme="dark"] .priority-badge.priority-urgent {
  background: rgba(251, 191, 36, 0.15) !important;
  color: #facc15 !important;
}

[data-student-theme="dark"] .no-announcements,
[data-student-theme="dark"] .announcement-message,
[data-student-theme="dark"] .announcement-meta {
  color: var(--student-text-soft) !important;
}

/* Summary Cards - Theme-aware styling */
.summary-card {
  transition: all 0.3s ease;
  background: var(--student-card-bg) !important;
  border-color: var(--student-card-border) !important;
}

.summary-card .card-body {
  background: transparent !important;
  color: var(--student-card-text) !important;
}

.summary-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.summary-icon-primary {
  color: #6366f1;
}

.summary-icon-success {
  color: var(--student-success);
}

.summary-icon-info {
  color: #3b82f6;
}

.summary-icon-warning {
  color: var(--student-warning);
}

[data-student-theme="dark"] .summary-card {
  background: var(--student-card-bg) !important;
  border-color: var(--student-card-border) !important;
}

[data-student-theme="dark"] .summary-card .card-body {
  background: transparent !important;
  color: var(--student-card-text) !important;
}

[data-student-theme="dark"] .summary-icon-primary {
  color: #a5b4fc;
}

[data-student-theme="dark"] .summary-icon-success {
  color: #4ade80;
}

[data-student-theme="dark"] .summary-icon-info {
  color: #7dd3fc;
}

[data-student-theme="dark"] .summary-icon-warning {
  color: #fde047;
}

.summary-value {
  color: var(--student-card-text) !important;
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

[data-student-theme="dark"] .summary-value {
  color: #ffffff !important;
  font-weight: 800;
}

.summary-label {
  color: var(--student-card-meta) !important;
  font-size: 0.9rem;
  margin: 0;
}

[data-student-theme="dark"] .summary-label {
  color: #cbd5f5 !important;
  font-weight: 500;
}

/* Filter and Chart Cards - Dark mode styling */
[data-student-theme="dark"] .card.student-card {
  background: var(--student-card-bg) !important;
  border-color: var(--student-card-border) !important;
  color: var(--student-card-text) !important;
}

[data-student-theme="dark"] .card.student-card .card-body {
  background: transparent !important;
  color: var(--student-card-text) !important;
}

[data-student-theme="dark"] .card.student-card .card-header {
  background: transparent !important;
  border-bottom-color: var(--student-border) !important;
  color: var(--student-card-text) !important;
}

[data-student-theme="dark"] .card.student-card .form-label {
  color: var(--student-card-text) !important;
}

[data-student-theme="dark"] .card.student-card .form-select,
[data-student-theme="dark"] .card.student-card select {
  background: rgba(15, 23, 42, 0.6) !important;
  border-color: var(--student-border) !important;
  color: var(--student-card-text) !important;
}

[data-student-theme="dark"] .card.student-card .form-select:focus,
[data-student-theme="dark"] .card.student-card select:focus {
  background: rgba(15, 23, 42, 0.8) !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
  color: var(--student-card-text) !important;
}

[data-student-theme="dark"] .card.student-card h5,
[data-student-theme="dark"] .card.student-card h6 {
  color: var(--student-card-text) !important;
}

[data-student-theme="dark"] .card.student-card .text-muted {
  color: var(--student-card-meta) !important;
}

/* Timetable Page Styles */
.day-section {
  margin-bottom: 2rem;
}

.day-header {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--student-card-text);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--student-border);
}

.day-subtitle {
  font-size: 0.95rem;
  color: var(--student-card-meta);
  margin-bottom: 1rem;
}

.lesson-card {
  background: var(--student-card-bg);
  border: 1px solid var(--student-card-border);
  border-left: 4px solid rgba(99, 102, 241, 0.6);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--student-card-shadow);
  transition: all 0.2s ease;
}

.lesson-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--student-card-shadow-hover);
}

.lesson-card.current-lesson {
  background: rgba(255, 193, 7, 0.08);
  border-left-color: #facc15;
  box-shadow: 0 20px 40px rgba(250, 204, 21, 0.25);
}

.lesson-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.lesson-time {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 100px;
}

.lesson-time-range {
  font-weight: 700;
  font-size: 1rem;
  color: var(--student-card-text);
}

.lesson-time-period {
  font-size: 0.85rem;
  color: var(--student-card-meta);
}

.lesson-info {
  flex: 1;
}

.lesson-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--student-card-text);
  margin-bottom: 0.25rem;
}

.lesson-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--student-border);
}

.lesson-room {
  font-size: 0.9rem;
  color: var(--student-card-meta);
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(99, 102, 241, 0.1);
  color: var(--student-card-text);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.filter-pill:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

.filter-pill.active {
  background: rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.5);
}

.active-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--student-card-bg);
  border-radius: 12px;
  border: 1px solid var(--student-card-border);
}

.active-filter-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--student-card-text);
}

.active-filter-badge i {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.active-filter-badge i:hover {
  opacity: 1;
}

[data-student-theme="dark"] .day-header {
  color: var(--student-card-text) !important;
  border-bottom-color: var(--student-border) !important;
}

[data-student-theme="dark"] .day-subtitle {
  color: var(--student-card-meta) !important;
}

/* Category Legend Styling */
.category-legend-list {
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  column-gap: 1rem;
}

.category-legend-item {
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--student-border);
}

.category-legend-item:last-child,
.category-legend-item:nth-last-child(2) {
  border-bottom: none;
}

.category-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.category-name {
  color: var(--student-card-text);
  font-weight: 500;
  font-size: 0.85rem;
}

.category-points {
  color: var(--student-card-text);
  font-size: 0.85rem;
}

.category-points strong {
  color: var(--student-card-text);
  font-size: 0.9rem;
}

[data-student-theme="dark"] .category-legend-item {
  border-bottom-color: var(--student-border);
}

[data-student-theme="dark"] .category-name {
  color: var(--student-card-text) !important;
}

[data-student-theme="dark"] .category-points {
  color: var(--student-card-text) !important;
}

[data-student-theme="dark"] .category-points strong {
  color: #ffffff !important;
}

/* Collapsible timeline day headers */
[data-bs-toggle="collapse"] .fa-chevron-down {
  transition: transform 0.3s ease;
}

[data-bs-toggle="collapse"][aria-expanded="false"] .fa-chevron-down {
  transform: rotate(-90deg);
}

