body.dark-mode {
  --nr: #ff4d6d;
  --ng: #00e5a0;
  --nb: #4dc8ff;
  --np: #c044ff;
  --no: #ff9f43;
  --ny: #ffd166;

  --glass-bg:  rgba(20,12,35,0.92);
  --glass-bg2: rgba(14,7,26,0.97);
  --glass-b:   rgba(255,255,255,0.08);
  --rim:
    inset 0 1.5px 0 rgba(255,255,255,0.10),
    inset 1.5px 0   rgba(255,255,255,0.06),
    inset 0 -1px 0  rgba(255,255,255,0.04);
  --glow-r: 0 0 22px rgba(255,77,109,0.30), 0 0 48px rgba(255,77,109,0.12);
  --glow-p: 0 0 22px rgba(192,68,255,0.30), 0 0 48px rgba(192,68,255,0.12);
  --glow-b: 0 0 22px rgba(77,200,255,0.28), 0 0 48px rgba(77,200,255,0.10);
  --glow-g: 0 0 22px rgba(0,229,160,0.28),  0 0 48px rgba(0,229,160,0.10);
  --shadow: 0 8px 32px rgba(0,0,0,0.60), 0 2px 8px rgba(0,0,0,0.40);
  --blur:  blur(14px) saturate(1.5);
  --blur2: blur(18px) saturate(1.6);
}

body.dark-mode .settings-card,
body.dark-mode .week-navigation,
body.dark-mode .stats-bar,
body.dark-mode .schedule-wrapper,
body.dark-mode .mobile-day,
body.dark-mode .lesson,
body.dark-mode .mobile-lesson,
body.dark-mode .calendar-container,
body.dark-mode .teacher-modal-content,
body.dark-mode .filter-group select,
body.dark-mode .search-input,
body.dark-mode .time-cell,
body.dark-mode .schedule-cell {
  transition:
    background-color .32s ease,
    color            .26s ease,
    border-color     .30s ease !important;
}

body.dark-mode {
  background: #0a0812 !important;
  color: #f0ecff !important;
  min-height: 100vh !important;
}

@keyframes rgb-slide {
  0%   { transform: translateX(-101%); }
  100% { transform: translateX(101%);  }
}
@keyframes rgb-h {
  0%   { background-position: 0%   50%; }
  100% { background-position: 200% 50%; }
}

body.dark-mode .header {
  background:
    linear-gradient(135deg,
      rgba(12,4,24,0.95) 0%,
      rgba(8,2,18,0.98)  100%
    ) !important;
  backdrop-filter: var(--blur2) !important;
  -webkit-backdrop-filter: var(--blur2) !important;
  border-bottom: none !important;
  box-shadow:
    inset 0 1px 0 rgba(255,100,130,0.12),
    0 4px 40px rgba(0,0,0,0.60) !important;
  position: relative !important;
  overflow: hidden !important;
}

body.dark-mode .header::before {
  content: '';
  position: absolute;
  top: -60%; left: -10%; right: -10%;
  height: 120%;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(255,77,109,0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 50%, rgba(192,68,255,0.07) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body.dark-mode .header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}
body.dark-mode .header::after {
  background: linear-gradient(90deg,
    #ff4d6d 0%, #ff8c42 16%, #ffd166 32%,
    #00e5a0 48%, #4dc8ff 64%, #c044ff 80%, #ff4d6d 100%
  );
  background-size: 200% 100%;
  animation: rgb-h 4s linear infinite;
  box-shadow: 0 0 8px rgba(192,68,255,0.35);
}

body.dark-mode .header-content { position: relative; z-index: 2; }

body.dark-mode .header h1 {
  color: #fff !important;
  text-shadow:
    0 0 20px rgba(255,77,109,0.45),
    0 0 40px rgba(255,77,109,0.18) !important;
  letter-spacing: -0.02em !important;
}
body.dark-mode .header p {
  color: rgba(200,180,240,0.75) !important;
}
body.dark-mode .week-navigation,
body.dark-mode .schedule-wrapper,
body.dark-mode .stats-bar,
body.dark-mode .message {
  background: var(--glass-bg) !important;
  backdrop-filter: var(--blur) !important;
  -webkit-backdrop-filter: var(--blur) !important;
  border: 0px solid var(--glass-b) !important;
  box-shadow: var(--rim), var(--shadow) !important;
  position: relative !important;
  overflow: hidden !important;
}

body.dark-mode .settings-card {
  background: var(--glass-bg) !important;
  backdrop-filter: var(--blur) !important;
  -webkit-backdrop-filter: var(--blur) !important;
  border: 0px solid var(--glass-b) !important;
  box-shadow: var(--rim), var(--shadow) !important;
  overflow: hidden !important;
}
@media (min-width: 769px) {
  body.dark-mode .settings-card { position: relative !important; }
}
@media (max-width: 768px) {
  body.dark-mode .settings-card {
    position: fixed !important;
    top: 0 !important; left: 0.6rem !important; right: 0.6rem !important;
  }
}

body.dark-mode .settings-card::before,
body.dark-mode .week-navigation::before,
body.dark-mode .schedule-wrapper::before,
body.dark-mode .stats-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1.5px;
  background: linear-gradient(90deg,
    transparent 0%,
    #ff4d6d 15%, #ff9f43 30%, #ffd166 45%,
    #00e5a0 55%, #4dc8ff 70%, #c044ff 85%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 10;
}

body.dark-mode .settings-card:hover {
  box-shadow:
    var(--rim), var(--shadow),
    0 0 0 1px rgba(192,68,255,0.18),
    var(--glow-p) !important;
}

body.dark-mode .settings-card h2 {
  color: var(--nr) !important;
  text-shadow: 0 0 16px rgba(255,77,109,0.40) !important;
}
body.dark-mode label,
body.dark-mode .role-option label       { color: rgba(200,185,240,0.90) !important; }
body.dark-mode .filter-group label      { color: rgba(144,128,184,0.80) !important; }

body.dark-mode .filter-group select,
body.dark-mode .search-input {
  background: rgba(12,6,22,0.80) !important;
  color: #f0ecff !important;
  border: 1px solid rgba(120,80,200,0.25) !important;
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.18) !important;
  border-radius: 10px !important;
}
body.dark-mode .filter-group select:hover,
body.dark-mode .search-input:hover { border-color: rgba(192,68,255,0.35) !important; }
body.dark-mode .filter-group select:focus,
body.dark-mode .search-input:focus {
  border-color: rgba(255,77,109,0.60) !important;
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.06),
    0 0 0 3px rgba(255,77,109,0.12) !important;
  outline: none !important;
}
body.dark-mode .filter-group select:disabled { opacity: 0.35 !important; }
body.dark-mode select option { background: #160e28 !important; color: #f0ecff !important; }
body.dark-mode .search-icon { color: rgba(144,128,184,0.50) !important; }

body.dark-mode .week-navigation  { border-radius: 18px !important; }
body.dark-mode .week-dates       { color: #f0ecff !important; font-weight: 500 !important; }
body.dark-mode .week-label       { color: rgba(144,128,184,0.60) !important; }
body.dark-mode .week-arrow-btn {
  color: rgba(160,120,220,0.40) !important;
  background: transparent !important;
}
body.dark-mode .week-arrow-btn:hover {
  color: var(--np) !important;
  background: rgba(192,68,255,0.10) !important;
  box-shadow: 0 0 14px rgba(192,68,255,0.22) !important;
}
body.dark-mode .week-dates:hover {
  color: var(--np) !important;
  text-shadow: 0 0 14px rgba(192,68,255,0.55) !important;
  background: rgba(192,68,255,0.08) !important;
}
body.dark-mode .week-today-btn {
  border-left: 1px solid rgba(255,77,109,0.14) !important;
  background: rgba(255,77,109,0.10) !important;
  color: var(--nr) !important;
  text-shadow: 0 0 10px rgba(255,77,109,0.40) !important;
}
body.dark-mode .week-today-btn svg { color: var(--nr) !important; }
body.dark-mode .week-today-btn:hover {
  background: rgba(255,77,109,0.78) !important;
  color: #fff !important;
  text-shadow: none !important;
}
body.dark-mode .week-day-dot              { background: rgba(255,255,255,0.07) !important; }
body.dark-mode .week-day-dot.has-lessons  { background: rgba(255,77,109,0.55) !important; }
body.dark-mode .week-day-dot.today        { background: var(--nr) !important; }

body.dark-mode .stats-bar { border-radius: 16px !important; }
body.dark-mode .stats-toggle-btn {
  background: rgba(12,6,22,0.70) !important;
  border: 1px solid rgba(255,77,109,0.32) !important;
  color: var(--nr) !important;
}
body.dark-mode .stats-toggle-btn:hover {
  background: rgba(255,77,109,0.78) !important;
  color: #fff !important;
}
body.dark-mode .stats-toggle-mobile-btn {
  background: rgba(12,6,22,0.70) !important;
  border: 1.5px solid rgba(255,77,109,0.32) !important;
  color: var(--nr) !important;
  box-shadow: 0 2px 8px rgba(255,77,109,0.10) !important;
}
body.dark-mode .stat-icon { border: 1px solid rgba(255,255,255,0.07) !important; }
body.dark-mode .stat-icon.lectures  { background: rgba(255,77,109,0.13) !important; color: var(--nr) !important; }
body.dark-mode .stat-icon.practices { background: rgba(0,229,160,0.11) !important;  color: var(--ng) !important; }
body.dark-mode .stat-icon.labs      { background: rgba(77,200,255,0.11) !important;  color: var(--nb) !important; }
body.dark-mode .stat-value {
  color: var(--nr) !important;
  text-shadow: 0 0 10px rgba(255,77,109,0.32) !important;
}
body.dark-mode .stat-done {
  color: var(--nr) !important;
  text-shadow: 0 0 14px rgba(255,77,109,0.42) !important;
}
body.dark-mode .stat-label     { color: rgba(144,128,184,0.75) !important; }
body.dark-mode .stat-sem-total { color: rgba(144,128,184,0.70) !important; }
body.dark-mode .stat-sep-slash { color: rgba(120,80,200,0.45) !important; }
body.dark-mode .stat-progress-bar-track { background: rgba(255,77,109,0.09) !important; }
body.dark-mode .stat-progress-bar-fill {
  background: linear-gradient(90deg, #ff4d6d 0%, #c044ff 60%, #4dc8ff 100%) !important;
  box-shadow: 0 0 10px rgba(255,77,109,0.40) !important;
  transition: width 0.5s ease !important;
}
body.dark-mode .stat-divider { background: rgba(180,140,255,0.30) !important; }
body.dark-mode .stat-divider-desktop { background: rgba(255,77,109,0.30) !important; }
body.dark-mode .week-stats-divider { background: rgba(180,140,255,0.25) !important; }

body.dark-mode #export-ics-btn,
body.dark-mode #export-print-btn,
body.dark-mode #mobile-theme-btn,
body.dark-mode #print-btn {
  background: rgba(12,6,22,0.75) !important;
  border: 1px solid rgba(255,77,109,0.25) !important;
  color: var(--nr) !important;
}
body.dark-mode #export-ics-btn:hover,
body.dark-mode #export-print-btn:hover,
body.dark-mode #mobile-theme-btn:hover,
body.dark-mode #print-btn:hover {
  background: rgba(255,77,109,0.14) !important;
  border-color: rgba(255,77,109,0.55) !important;
}

body.dark-mode .schedule-wrapper { border-radius: 20px !important; }
body.dark-mode .schedule-grid    { border-color: rgba(120,80,200,0.14) !important; }
body.dark-mode .time-header {
  background: linear-gradient(155deg,
    rgba(16,8,30,0.96) 0%, rgba(10,5,20,0.99) 100%
  ) !important;
  backdrop-filter: blur(12px) !important;
  border-right: 1px solid rgba(192,68,255,0.12) !important;
}
body.dark-mode .day-header {
  background: linear-gradient(155deg,
    rgba(45,8,16,0.94) 0%, rgba(30,5,10,0.97) 100%
  ) !important;
  border-right: 1px solid rgba(255,77,109,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,100,130,0.10) !important;
}
body.dark-mode .current-day,
body.dark-mode .day-header.today-col {
  background: linear-gradient(155deg,
    rgba(12,28,60,0.94) 0%, rgba(8,18,45,0.97) 100%
  ) !important;
}
body.dark-mode .time-cell {
  background: rgba(12,6,22,0.65) !important;
  border-right: 1px solid rgba(120,80,200,0.12) !important;
  color: rgba(144,128,184,0.80) !important;
}
body.dark-mode .slot-start { color: rgba(200,185,240,0.90) !important; }
body.dark-mode .slot-end   { color: rgba(144,128,184,0.65) !important; }
body.dark-mode .schedule-cell {
  background: rgba(18,10,32,0.55) !important;
  border-right: 1px solid rgba(120,80,200,0.09) !important;
  border-bottom: 1px solid rgba(120,80,200,0.09) !important;
}
body.dark-mode .schedule-cell:hover,
body.dark-mode .lesson-cell:hover { background: rgba(192,68,255,0.06) !important; }

body.dark-mode .lesson {
  background: rgba(28,15,46,0.92) !important;
  border: 1px solid rgba(255,255,255,0.05) !important;
  border-left: 3px solid var(--nr) !important;
  border-radius: 10px !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 2px 12px rgba(0,0,0,0.40) !important;
  color: #f0ecff !important;
  position: relative;
}
body.dark-mode .lesson::before {
  content: '';
  position: absolute;
  top: 0; left: 3px; right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
  border-radius: 0 10px 0 0;
  pointer-events: none;
}
body.dark-mode .lesson:hover {
  background: rgba(38,20,60,0.95) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.09),
    0 6px 22px rgba(255,77,109,0.18) !important;
  transform: translateY(-2px) scale(1.01) !important;
}
body.dark-mode .lesson.lecture  { border-left-color: var(--nr) !important; }
body.dark-mode .lesson.practice { border-left-color: var(--ng) !important; }
body.dark-mode .lesson.lab      { border-left-color: var(--nb) !important; }
body.dark-mode .lesson.exam {
  border-left-color: var(--np) !important;
  background: rgba(32,10,52,0.93) !important;
}
body.dark-mode .lesson-subject { color: #f0ecff !important; }
body.dark-mode .lesson-info    { color: rgba(144,128,184,0.80) !important; }
body.dark-mode .lesson-teacher { color: rgba(144,128,184,0.75) !important; }
body.dark-mode .lesson-type.lecture  { background: rgba(255,77,109,0.14) !important; color: #ff8099 !important; }
body.dark-mode .lesson-type.practice { background: rgba(0,229,160,0.12) !important;  color: #00e5a0 !important; }
body.dark-mode .lesson-type.lab      { background: rgba(77,200,255,0.12) !important;  color: #4dc8ff !important; }
body.dark-mode .lesson-type.exam     { background: rgba(192,68,255,0.12) !important;  color: #c044ff !important; }

body.dark-mode .lesson-type-badge.lecture  { background: rgba(255,77,109,0.18) !important;  color: #ff8099 !important; }
body.dark-mode .lesson-type-badge.practice { background: rgba(0,229,160,0.15) !important;   color: #00e5a0 !important; }
body.dark-mode .lesson-type-badge.lab      { background: rgba(77,200,255,0.15) !important;   color: #4dc8ff !important; }
body.dark-mode .lesson-type-badge.exam     { background: rgba(192,68,255,0.15) !important;   color: #c044ff !important; }

body.dark-mode .message { border-radius: 18px !important; }
body.dark-mode .message h3   { color: rgba(200,185,240,0.90) !important; }
body.dark-mode .message p    { color: rgba(144,128,184,0.70) !important; }
body.dark-mode .message-icon { color: var(--nr) !important; opacity: 0.55 !important; }

body.dark-mode .mobile-day {
  background: rgba(22,12,38,0.98) !important;
  border: 1px solid rgba(255,255,255,0.07) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.50) !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  position: relative !important;
  contain: layout style;
}

body.dark-mode .mobile-day::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1.5px;
  background: linear-gradient(90deg,
    transparent 0%, #ff4d6d 15%, #ffd166 35%, #00e5a0 50%,
    #4dc8ff 65%, #c044ff 85%, transparent 100%
  );
  pointer-events: none;
  z-index: 3;
}
body.dark-mode .mobile-day-header {
  background: linear-gradient(135deg,
    rgba(45,8,16,0.92) 0%, rgba(30,5,10,0.96) 100%
  ) !important;
  border-bottom: 1px solid rgba(255,77,109,0.10) !important;
}
body.dark-mode .mobile-day-header.current-day {
  background: linear-gradient(135deg,
    rgba(12,28,60,0.92) 0%, rgba(8,18,45,0.96) 100%
  ) !important;
}
body.dark-mode .mobile-slot {
  background: rgba(18,10,32,0.55) !important;
  border-bottom: 1px solid rgba(120,80,200,0.09) !important;
}
body.dark-mode .mobile-time {
  background: rgba(12,6,22,0.68) !important;
  border-right: 1px solid rgba(120,80,200,0.12) !important;
}
body.dark-mode .mobile-time .slot-start { color: rgba(200,185,240,0.90) !important; }
body.dark-mode .mobile-time .slot-sep   { color: rgba(120,80,200,0.28) !important; }
body.dark-mode .mobile-time .slot-end   { color: rgba(144,128,184,0.65) !important; }
body.dark-mode .mobile-lesson {
  background: rgba(28,15,46,0.92) !important;
  border-left-color: var(--nr) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 1px 6px rgba(0,0,0,0.30) !important;
  color: #f0ecff !important;
}
body.dark-mode .mobile-lesson-subject { color: #f0ecff !important; }
body.dark-mode .mobile-lesson-meta    { color: rgba(144,128,184,0.75) !important; }
body.dark-mode .mobile-day-empty {
  background: rgba(12,6,22,0.45) !important;
  color: rgba(144,128,184,0.45) !important;
}
body.dark-mode .mobile-lesson-type.lecture  { background: rgba(255,77,109,0.80) !important; }
body.dark-mode .mobile-lesson-type.practice { background: rgba(0,185,120,0.80) !important; }
body.dark-mode .mobile-lesson-type.lab      { background: rgba(0,160,220,0.80) !important; }
body.dark-mode .mobile-lesson-type.exam     { background: rgba(170,50,220,0.80) !important; }
body.dark-mode .mobile-lesson-badge.lecture  { background: rgba(255,77,109,0.80) !important; }
body.dark-mode .mobile-lesson-badge.practice { background: rgba(0,185,120,0.80) !important; }
body.dark-mode .mobile-lesson-badge.lab      { background: rgba(0,160,220,0.80) !important; }
body.dark-mode .mobile-lesson-badge.exam     { background: rgba(170,50,220,0.80) !important; }

body.dark-mode .calendar-popup {
  background: rgba(4,1,10,0.80) !important;
  backdrop-filter: blur(14px) !important;
}
body.dark-mode .calendar-container {
  background: rgba(16,8,30,0.96) !important;
  backdrop-filter: var(--blur2) !important;
  -webkit-backdrop-filter: var(--blur2) !important;
  border: 1px solid rgba(192,68,255,0.20) !important;
  box-shadow:
    var(--rim),
    0 0 50px rgba(192,68,255,0.15),
    0 40px 80px rgba(0,0,0,0.70) !important;
  border-radius: 24px !important;
  position: relative; overflow: hidden;
}
body.dark-mode .calendar-container::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1.5px;
  background: linear-gradient(90deg,
    transparent 0%, #ff4d6d 20%, #c044ff 50%, #4dc8ff 80%, transparent 100%
  );
  pointer-events: none; z-index: 3;
}
body.dark-mode .calendar-container > * { position: relative; z-index: 1; }
body.dark-mode .calendar-header         { border-bottom-color: rgba(192,68,255,0.16) !important; }
body.dark-mode .calendar-month-year     { color: var(--np) !important; text-shadow: 0 0 14px rgba(192,68,255,0.45) !important; }
body.dark-mode .calendar-weekday        { color: rgba(144,128,184,0.65) !important; }
body.dark-mode .calendar-day {
  background: rgba(30,16,52,0.75) !important;
  color: rgba(200,185,240,0.90) !important;
  border-color: rgba(120,80,200,0.10) !important;
}
body.dark-mode .calendar-day.other-month {
  background: rgba(14,8,24,0.40) !important;
  color: rgba(120,80,200,0.28) !important;
  border-color: transparent !important;
}
body.dark-mode .calendar-day:not(.other-month):hover {
  background: rgba(192,68,255,0.20) !important;
  color: #e8d8ff !important;
  border-color: rgba(192,68,255,0.25) !important;
}
body.dark-mode .calendar-weekday { color: rgba(144,100,200,0.65) !important; }
body.dark-mode .calendar-day.today {
  background: linear-gradient(135deg, rgba(0,175,100,0.78), rgba(0,130,70,0.90)) !important;
  box-shadow: 0 0 16px rgba(0,229,160,0.40) !important;
}
body.dark-mode .calendar-day.selected {
  background: linear-gradient(135deg, rgba(255,77,109,0.84), rgba(180,20,50,0.94)) !important;
  box-shadow: 0 0 18px rgba(255,77,109,0.45) !important;
}
body.dark-mode .calendar-day.has-lessons::after    { background: var(--nr) !important; }
body.dark-mode .calendar-day.has-lessons.selected::after,
body.dark-mode .calendar-day.has-lessons.today::after { background: #fff !important; }
body.dark-mode .calendar-nav-btn {
  background: linear-gradient(135deg, rgba(192,68,255,0.72), rgba(140,20,210,0.88)) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), var(--glow-p) !important;
}
body.dark-mode .calendar-nav-btn:hover { transform: scale(1.10) !important; }
body.dark-mode .calendar-close {
  background: linear-gradient(135deg, rgba(255,77,109,0.80), rgba(180,20,50,0.94)) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), var(--glow-r) !important;
  border-radius: 14px !important;
}
body.dark-mode .calendar-close:hover { transform: translateY(-2px) !important; }

body.dark-mode .teacher-modal {
  background: rgba(4,1,10,0.78) !important;
  backdrop-filter: blur(14px) !important;
}
body.dark-mode .teacher-modal-content {
  background: rgba(16,8,30,0.96) !important;
  backdrop-filter: var(--blur2) !important;
  -webkit-backdrop-filter: var(--blur2) !important;
  border: 1px solid rgba(255,77,109,0.12) !important;
  box-shadow:
    var(--rim),
    0 0 44px rgba(255,77,109,0.12),
    0 40px 80px rgba(0,0,0,0.70) !important;
  position: relative; overflow: hidden;
}
body.dark-mode .teacher-modal-content::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1.5px;
  background: linear-gradient(90deg,
    transparent 0%, #ff4d6d 20%, #ff9f43 40%,
    #c044ff 60%, #4dc8ff 80%, transparent 100%
  );
  pointer-events: none; z-index: 10;
}
body.dark-mode .teacher-photo-wrapper  { background: #08041a !important; }
body.dark-mode .teacher-modal-close {
  background: rgba(25,14,44,0.90) !important;
  border: 1px solid rgba(255,77,109,0.20) !important;
  color: var(--nr) !important;
}
body.dark-mode .teacher-modal-close:hover {
  background: rgba(255,77,109,0.78) !important;
  color: #fff !important;
}
body.dark-mode .teacher-modal-body   { background: transparent !important; }
body.dark-mode .tm-surname           { color: #f0ecff !important; }
body.dark-mode .tm-nameparts         { color: rgba(144,128,184,0.80) !important; }
body.dark-mode .teacher-position {
  color: var(--nr) !important;
  text-shadow: 0 0 12px rgba(255,77,109,0.38) !important;
  border-bottom-color: rgba(255,77,109,0.12) !important;
}
body.dark-mode .tm-dept { color: rgba(144,128,184,0.50) !important; }
body.dark-mode .teacher-contact-item {
  background: rgba(12,6,22,0.75) !important;
  border: 1px solid rgba(120,80,200,0.16) !important;
  border-left: 3px solid var(--nr) !important;
}
body.dark-mode .teacher-contact-item:hover { background: rgba(255,77,109,0.08) !important; }
body.dark-mode .teacher-contact-link,
body.dark-mode .teacher-contact-item span  { color: rgba(200,185,240,0.88) !important; }
body.dark-mode .teacher-contact-item svg   { color: var(--nr) !important; }
body.dark-mode .teacher-contact-link:hover { color: var(--nr) !important; }
body.dark-mode .teacher-profile-btn {
  background: linear-gradient(135deg, rgba(255,77,109,0.82), rgba(180,20,50,0.94)) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), var(--glow-r) !important;
}
body.dark-mode .teacher-profile-btn:hover { transform: translateY(-2px) !important; }
body.dark-mode .teacher-modal-content::-webkit-scrollbar-thumb {
  background: rgba(255,77,109,0.32) !important;
}

body.dark-mode .support-widget {
  z-index: 10000 !important;
}
body.dark-mode .support-button {
  background: linear-gradient(135deg, rgba(220,60,80,0.92) 0%, rgba(160,16,40,0.96) 100%) !important;
  border: 1px solid rgba(255,130,150,0.28) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    0 0 22px rgba(255,77,109,0.40),
    0 4px 18px rgba(0,0,0,0.50) !important;
  z-index: 10001 !important;
}
body.dark-mode .support-chat-header {
  background: linear-gradient(135deg, rgba(45,8,16,0.98) 0%, rgba(25,4,10,0.99) 100%) !important;
  border-bottom: 1px solid rgba(255,77,109,0.15) !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.40) !important;
}
body.dark-mode .sp-tab { color: rgba(255,150,170,0.55) !important; }
body.dark-mode .sp-tab.active {
  color: #fff !important;
  border-bottom-color: var(--nr) !important;
}
body.dark-mode .sp-tab:hover:not(.active) { color: rgba(255,150,170,0.85) !important; }

body.dark-mode .support-badge {
  background: #ff4d6d !important;
  color: #fff !important;
  border-color: #1a0a28 !important;
  box-shadow: 0 2px 8px rgba(255,77,109,0.5) !important;
}

body.dark-mode .sp-tab-badge {
  background: #ff4d6d !important;
  color: #fff !important;
}

body.dark-mode .support-button.has-unread::before {
  border-color: #ff4d6d !important;
}
body.dark-mode .support-button.has-unread::after {
  border-color: rgba(255,77,109,0.4) !important;
}
body.dark-mode .support-chat {
  background: rgba(16,8,30,0.98) !important;
  backdrop-filter: var(--blur2) !important;
  border: 1px solid rgba(192,68,255,0.16) !important;
  box-shadow: 0 24px 60px rgba(0,0,0,0.70), var(--glow-p) !important;
  border-radius: 20px !important;
  overflow: hidden;
}
body.dark-mode .support-chat::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1.5px;
  background: linear-gradient(90deg,
    transparent, #ff4d6d 25%, #c044ff 50%, #4dc8ff 75%, transparent
  );
  pointer-events: none; z-index: 3;
}
body.dark-mode .support-chat > *             { position: relative; z-index: 1; }
body.dark-mode .support-chat-body            { background: transparent !important; }
body.dark-mode .support-form-group label     { color: rgba(144,128,184,0.80) !important; }
body.dark-mode .support-form-group select,
body.dark-mode .support-form-group textarea {
  background: rgba(12,6,22,0.80) !important;
  color: #f0ecff !important;
  border-color: rgba(120,80,200,0.24) !important;
}
body.dark-mode .support-form-group select:focus,
body.dark-mode .support-form-group textarea:focus { border-color: rgba(255,77,109,0.55) !important; }
body.dark-mode .support-submit {
  background: linear-gradient(135deg, rgba(255,77,109,0.82), rgba(180,20,50,0.94)) !important;
  box-shadow: var(--glow-r) !important;
}
body.dark-mode .support-success h4 { color: #f0ecff !important; }
body.dark-mode .support-success p  { color: rgba(144,128,184,0.75) !important; }

body.dark-mode .support-ticket-item {
  background: rgba(22,12,38,0.85) !important;
  border: 1px solid rgba(120,80,200,0.20) !important;
}
body.dark-mode .support-ticket-item:hover {
  background: rgba(255,77,109,0.14) !important;
  border-color: rgba(255,77,109,0.45) !important;
  box-shadow: 0 4px 12px rgba(255,77,109,0.2) !important;
}
body.dark-mode .support-ticket-id   { color: var(--nr) !important; }
body.dark-mode .support-ticket-date-small { color: rgba(120,80,200,0.55) !important; }
body.dark-mode .sw-waiting { background: rgba(255,77,109,0.16) !important; color: var(--nr) !important; }
body.dark-mode .sw-replied { background: rgba(0,229,160,0.12) !important;  color: #00e5a0 !important; }
body.dark-mode .support-empty-tickets { color: rgba(120,80,200,0.50) !important; }

body.dark-mode .sw-back-btn { color: var(--nr) !important; }
body.dark-mode .sw-back-btn:hover { color: rgba(255,120,150,1) !important; }

body.dark-mode .sw-user .sw-bubble {
  background: rgba(255,77,109,0.10) !important;
  border-left-color: var(--nr) !important;
  color: #f0ecff !important;
}
body.dark-mode .sw-admin .sw-bubble {
  background: rgba(0,229,160,0.10) !important;
  border-right-color: var(--ng) !important;
  color: rgba(200,255,230,0.92) !important;
}
body.dark-mode .sw-time { color: rgba(120,80,200,0.50) !important; }

body.dark-mode .sw-input-row {
  border-top-color: rgba(120,80,200,0.18) !important;
}
body.dark-mode .sw-input-row textarea {
  background: rgba(12,6,22,0.80) !important;
  border-color: rgba(120,80,200,0.25) !important;
  color: #f0ecff !important;
}
body.dark-mode .sw-input-row textarea:focus {
  border-color: rgba(255,77,109,0.55) !important;
  box-shadow: 0 0 0 3px rgba(255,77,109,0.10) !important;
}
body.dark-mode .sw-input-row textarea::placeholder { color: rgba(120,80,200,0.45) !important; }
body.dark-mode .sw-chat-full::-webkit-scrollbar-thumb { background: rgba(255,77,109,0.30) !important; }

body.dark-mode .sp-body::-webkit-scrollbar-thumb { background: rgba(192,68,255,0.30) !important; }

body.dark-mode .btn-primary {
  background: linear-gradient(135deg, rgba(255,77,109,0.84), rgba(180,20,50,0.95)) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), var(--glow-r) !important;
}
body.dark-mode .btn-primary:hover:not(:disabled) { transform: translateY(-2px) !important; }

body.dark-mode .theme-toggle-track {
  background: linear-gradient(145deg,
    rgba(192,68,255,0.22), rgba(100,30,180,0.14),
    rgba(150,50,220,0.18)
  ) !important;
  border-color: rgba(192,68,255,0.38) !important;
  box-shadow:
    inset 0 1.5px 0 rgba(210,170,255,0.32),
    0 0 24px rgba(192,68,255,0.25),
    0 4px 20px rgba(0,0,0,0.38) !important;
}
body.dark-mode .theme-toggle.is-dark .theme-toggle-track {
  background: linear-gradient(145deg,
    rgba(192,68,255,0.32), rgba(130,40,220,0.22),
    rgba(170,60,255,0.28)
  ) !important;
  border-color: rgba(192,68,255,0.52) !important;
  box-shadow:
    inset 0 1.5px 0 rgba(220,180,255,0.42),
    0 0 30px rgba(192,68,255,0.44),
    0 4px 22px rgba(0,0,0,0.42) !important;
}

body.dark-mode ::-webkit-scrollbar { width: 5px; height: 5px; }
body.dark-mode ::-webkit-scrollbar-track {
  background: rgba(12,6,22,0.55); border-radius: 3px;
}
body.dark-mode ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255,77,109,0.55), rgba(192,68,255,0.55));
  border-radius: 3px;
}
body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255,77,109,0.80), rgba(192,68,255,0.80));
}

body.dark-mode .today-indicator {
  background: var(--ng) !important;
  box-shadow: 0 0 8px rgba(0,229,160,0.65) !important;
}
body.dark-mode .stats-container {
  background: var(--glass-bg) !important;
  border-color: var(--glass-b) !important;
  backdrop-filter: var(--blur) !important;
}

@media (max-width: 768px) {

  body.dark-mode .header::after,
  body.dark-mode .header::before,
  body.dark-mode .settings-card::before,
  body.dark-mode .settings-card::after,
  body.dark-mode .week-navigation::before,
  body.dark-mode .week-navigation::after,
  body.dark-mode .schedule-wrapper::before,
  body.dark-mode .stats-bar::before,
  body.dark-mode .stats-bar::after,
  body.dark-mode .calendar-container::before,
  body.dark-mode .teacher-modal-content::before,
  body.dark-mode .support-chat::before {
    animation: none !important;
  }

  body.dark-mode .week-navigation,
  body.dark-mode .schedule-wrapper,
  body.dark-mode .stats-bar,
  body.dark-mode .settings-card,
  body.dark-mode .stats-container {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--glass-bg2) !important;
  }

  body.dark-mode {
    --blur:  blur(8px) saturate(1.3);
    --blur2: blur(12px) saturate(1.4);
  }

  body.dark-mode .lesson:hover {
    transform: none !important;
  }
}

body.dark-mode #export-ics-btn.btn-hovered,
body.dark-mode #export-print-btn.btn-hovered,
body.dark-mode #mobile-theme-btn.btn-hovered {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(255,77,109,0.3) !important;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  body.dark-mode .support-chat {
    border-radius: 0 !important;
  }
  body.dark-mode .support-chat.active {
    border-radius: 0 !important;
  }
  
  body.dark-mode .support-widget::before,
  body.dark-mode .support-widget::after {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.dark-mode *,
  body.dark-mode *::before,
  body.dark-mode *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 768px) {
  body.dark-mode .mobile-week-expand-btn {
    background: transparent !important;
    border-color: rgba(255,77,109,0.30) !important;
    color: #ff7090 !important;
  }
  body.dark-mode .mobile-week-expand-btn:active {
    background: rgba(255,77,109,0.12) !important;
  }
  
  body.dark-mode .mobile-schedule.show-past .mobile-week-expand-btn {
    background: transparent !important;  
    border-color: rgba(255,77,109,0.30) !important;  
    color: #ff7090 !important;  
  }
  body.dark-mode #mobile-cap-badge {
    background: rgba(12,6,22,0.80) !important;
    border-color: rgba(255,77,109,0.45) !important;
    color: var(--nr) !important;
  }
}
