/* ========== LIQUID GLASS DESIGN SYSTEM ========== */
:root {
  /* Light Mode (Default) */
  --bg-main: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-sidebar: rgba(241, 245, 249, 0.8);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --border: rgba(0, 0, 0, 0.05);
  --glass-blur: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  --nav-bg: rgba(248, 250, 252, 0.92);
}

.dark {
  /* Dark Mode */
  --bg-main: #0a0f1c;
  --bg-card: rgba(17, 24, 39, 0.6);
  --bg-sidebar: rgba(13, 18, 32, 0.8);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.25);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  --nav-bg: rgba(10, 15, 28, 0.92);
}

.dark body {
  background: linear-gradient(180deg, #0a0f1c, #020617);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  background-image: radial-gradient(circle at 70% 10%, var(--accent-glow), transparent 40%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color var(--transition), color var(--transition);
}

/* Glassmorphism Utility */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 20px;
}

body::after {
  content: '';
  position: fixed;
  bottom: -10%;
  left: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle at center, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.3;
}

/* ========== GLASS CARD SYSTEM ========== */
.glass-card {
  background: var(--bg-card) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
  border-radius: 16px !important;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition) !important;
}

.glass-card:hover {
  border-color: rgba(59, 130, 246, 0.25) !important;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2) !important;
  transform: scale(1.02);
}
.glass-card:active {
  transform: scale(0.98);
}

/* ========== GLOBAL DASHBOARD LAYOUT (STRICT) ========== */
#app-root {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-main);
  position: relative;
}

/* ========== CORE COMPONENTS ========== */
.sidebar {
  width: 250px;
  height: 100%;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: background var(--transition), transform var(--transition);
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover, .glass-card:hover {
  transform: scale(1.02);
  transition: all 0.2s ease;
  box-shadow: 0 0 25px rgba(59,130,246,0.25) !important;
}

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

/* 2. Main Viewport: Remaining Space */
#main-viewport {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Viewport itself doesn't scroll */
  position: relative;
}

/* 3. Scrollable Content Area */
#scroll-content {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* 4. Safe Content Wrapper (Centered) */
.content-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 100px;
  position: relative;
}

/* 5. Ribbon Alignment (Glass) */
.semester-ribbon {
  width: 100%;
  flex-shrink: 0;
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition), border var(--transition);
}

/* 6. Screen Behavior (No Overlap) */
.screen {
  display: none;
  width: 100%;
  animation: fadeIn 0.4s ease-out;
}

.screen.active {
  display: block;
}

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

/* ========== REMOVE POSITIONING HACKS ========== */
.calendar-section, .dashboard-stats, .agenda-list, .shortcut-grid {
  position: relative;
  left: auto;
  right: auto;
  margin-left: auto;
  margin-right: auto;
  transform: none !important;
}

.screen.active {
  display: block; /* Show active screen */
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Mobile Adjustments */
@media (max-width: 767px) {
  .sidebar {
    display: none;
  }
  
  .screen {
    padding-bottom: 90px; /* Extra space for bottom nav */
  }
}

/* ========== HEADER & TYPOGRAPHY ========== */
.screen-header { padding: 8px 0 24px; }

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.04em;
}

.logo span { font-weight: 300; opacity: 0.8; }

.screen-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.screen-subtitle {
  font-size: .85rem;
  color: var(--text-secondary);
  font-weight: 500;
  opacity: 0.8;
  margin-top: 2px;
}

/* ========== GLASS CARD ========== */
.glass-card {
  background: linear-gradient(145deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 16px rgba(0,0,0,.2), 0 0 0 0.5px rgba(255,255,255,.03) inset;
}

/* ========== CALENDAR ========== */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  margin-bottom: 14px;
}
.month-label {
  font-size: 1rem;
  font-weight: 600;
  color: #cbd5e1;
}
.icon-btn {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.07);
  color: var(--accent);
  width: 36px; height: 36px;
  border-radius: 10px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
}
.icon-btn:active { transform: scale(.9); background: rgba(255,255,255,.1); }

.calendar-grid { padding: 14px 10px 10px; margin-bottom: 8px; }
.cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: .68rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 10px;
  letter-spacing: .5px;
}
.cal-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all .15s ease;
  color: #8892a8;
  gap: 2px;
}
.cal-cell.empty { cursor: default; }
.cal-cell:not(.empty):active { transform: scale(.9); }
.cal-cell.today {
  background: rgba(59, 130, 246, 0.12);
  color: #a5b4fc;
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px rgba(129,140,248,.25);
}
.cal-cell.selected {
  background: rgba(129,140,248,.28);
  color: #e0e7ff;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(129,140,248,.2), inset 0 0 0 1.5px rgba(129,140,248,.3);
}
.cal-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  margin-top: 1px;
}
.cal-dot.green { background: #34d399; }
.cal-dot.red { background: #f87171; }
.cal-dot.purple { background: #a78bfa; }
.cal-dot.grey { background: #475569; }

/* Calendar Legend */
.cal-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 0 4px;
  margin-top: 4px;
}
.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .62rem;
  font-weight: 600;
  color: #475569;
  letter-spacing: .3px;
}
.cal-legend-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-legend-dot.green { background: #34d399; }
.cal-legend-dot.red { background: #f87171; }
.cal-legend-dot.purple { background: #a78bfa; }
.cal-legend-dot.grey { background: #475569; }

/* ========== DAY VIEW ========== */
.day-view {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(8,8,20,.97);
  border-top: 1px solid rgba(255,255,255,.07);
  border-radius: 22px 22px 0 0;
  padding: 8px 16px 24px;
  max-height: 72vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.32,.72,.0,1);
  z-index: 10;
  scrollbar-width: none;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.day-view::-webkit-scrollbar { display: none; }
.day-view.open { transform: translateY(0); }
.day-view-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,.12);
  border-radius: 2px;
  margin: 0 auto 12px;
}
.day-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.day-view-header h3 { font-size: 1rem; font-weight: 600; color: #e2e8f0; }
.close-btn { width: 32px; height: 32px; font-size: .85rem; color: #64748b; }
.day-view-content { padding-bottom: 8px; }

/* Day Subject Cards */
.day-subject-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  transition: all .2s ease;
}
.day-subject-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.day-subject-name { font-size: .9rem; font-weight: 600; color: #f1f5f9; }
.day-subject-pct {
  font-size: .75rem;
  font-weight: 600;
  color: #a5b4fc;
  background: rgba(129,140,248,.1);
  padding: 3px 8px;
  border-radius: 8px;
}
.day-subject-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.mark-btn {
  flex: 1 1 calc(25% - 4px);
  padding: 9px 0;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  background: rgba(255,255,255,.02);
  color: #64748b;
  min-width: 0;
}
.mark-btn:active { transform: scale(.94); }
.mark-btn.present { color: #34d399; border-color: rgba(52,211,153,.15); }
.mark-btn.present.active { background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.35); color: #6ee7b7; }
.mark-btn.absent { color: #f87171; border-color: rgba(248,113,113,.15); }
.mark-btn.absent.active { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.35); color: #fca5a5; }
.mark-btn.off { color: #64748b; border-color: rgba(100,116,139,.15); }
.mark-btn.off.active { background: rgba(100,116,139,.12); border-color: rgba(100,116,139,.35); color: #94a3b8; }
.mark-btn.clear { color: #475569; border-color: rgba(255,255,255,.06); border-style: dashed; }
.mark-btn.clear:active { color: #94a3b8; }

.day-view-bulk-actions { display: flex; gap: 8px; margin-top: 6px; }
.mark-all-btn, .clear-all-btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.mark-all-btn {
  border: 1px solid rgba(52,211,153,.18);
  background: linear-gradient(135deg, rgba(52,211,153,.1), rgba(52,211,153,.05));
  color: #34d399;
}
.clear-all-btn {
  border: 1px dashed rgba(255,255,255,.1);
  background: rgba(255,255,255,.02);
  color: #64748b;
}
.mark-all-btn:active, .clear-all-btn:active { transform: scale(.96); }

.empty-day {
  text-align: center;
  padding: 32px 16px;
  color: #334155;
  font-size: .84rem;
}

/* ========== TODAY SCREEN ========== */
.today-date {
  font-size: .8rem;
  color: #818cf8;
  font-weight: 500;
  margin-top: 4px;
}
.today-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card {
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.stat-ring-wrap { margin-bottom: 4px; }
.stat-icon-wrap {
  color: #34d399;
  margin-bottom: 4px;
}
.stat-label {
  font-size: .65rem;
  color: #475569;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-value.target-val {
  background: linear-gradient(135deg, #34d399, #6ee7b7);
  -webkit-background-clip: text;
  background-clip: text;
}
.section-label {
  font-size: .7rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 10px;
  padding-left: 2px;
}
.today-subjects { padding-bottom: 16px; }

/* Today Prediction Summary */
.today-prediction {
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .82rem;
  color: #cbd5e1;
  font-weight: 500;
  line-height: 1.4;
}
.today-prediction:empty { display: none; }
.today-prediction .pred-icon { font-size: 1.1rem; flex-shrink: 0; }
.today-prediction .pred-text { flex: 1; }
.today-prediction .pred-val { font-weight: 700; }
.today-prediction .pred-val.good { color: #34d399; }
.today-prediction .pred-val.warn { color: #fbbf24; }

/* ========== SUBJECT HISTORY MODAL ========== */
.history-modal {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.history-stats {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.history-stat-chip {
  font-size: .68rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  color: #94a3b8;
}
.history-stat-chip span { font-weight: 700; }
.history-stat-chip.green span { color: #34d399; }
.history-stat-chip.red span { color: #f87171; }
.history-stat-chip.grey span { color: #64748b; }

.history-list {
  overflow-y: auto;
  max-height: 50vh;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.history-list::-webkit-scrollbar { display: none; }

.history-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 10px;
}
.history-date {
  font-size: .76rem;
  font-weight: 600;
  color: #94a3b8;
  min-width: 90px;
}
.history-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.history-btn {
  width: 30px; height: 28px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 7px;
  font-size: .68rem;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,.02);
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .12s ease;
}
.history-btn:active { transform: scale(.9); }
.history-btn.present { color: #34d399; }
.history-btn.present.active { background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.3); }
.history-btn.absent { color: #f87171; }
.history-btn.absent.active { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.3); }
.history-btn.off { color: #64748b; }
.history-btn.off.active { background: rgba(100,116,139,.12); border-color: rgba(100,116,139,.3); }
.history-btn.clear { color: #334155; border-style: dashed; }

.history-empty {
  text-align: center;
  padding: 24px;
  color: #334155;
  font-size: .82rem;
}

/* ========== TIMETABLE ========== */
.timetable-grid { display: flex; flex-direction: column; gap: 8px; }
.tt-day-row {
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all .15s ease;
}
.tt-day-row:active { transform: scale(.98); background: rgba(255,255,255,.05); }
.tt-day-label {
  font-size: .72rem;
  font-weight: 700;
  color: #a5b4fc;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 6px;
}
.tt-day-subjects { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.tt-chip {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.12);
  color: var(--accent-glow);
  font-size: .73rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 8px;
}
.tt-empty { font-size: .73rem; color: #262f42; font-style: italic; padding: 4px 0; }

/* ========== SUBJECTS ========== */
.subjects-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 80px; }
.subject-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  transition: all .15s ease;
}
.subject-card:active { transform: scale(.98); }

/* Attendance Ring */
.att-ring { width: 48px; height: 48px; position: relative; flex-shrink: 0; }
.att-ring svg { transform: rotate(-90deg); }
.att-ring-bg { stroke: rgba(255,255,255,.06); }
.att-ring-fg { transition: stroke-dashoffset .6s cubic-bezier(.4,0,.2,1); }
.att-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  color: #e2e8f0;
}

.subject-info { flex: 1; min-width: 0; }
.subject-info-name {
  font-size: .88rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.subject-info-prediction { font-size: .7rem; color: #475569; font-weight: 500; }
.subject-info-prediction .can-miss { color: #34d399; font-weight: 600; }
.subject-info-prediction .must-attend { color: #fbbf24; font-weight: 600; }
.subject-info-prediction .on-track { color: #818cf8; font-weight: 600; }

.subject-stats { display: flex; gap: 8px; margin-top: 5px; }
.subject-stat-item {
  font-size: .6rem;
  color: #334155;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.subject-stat-item span { color: #64748b; font-weight: 700; }

.subject-delete {
  background: none;
  border: none;
  color: #334155;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all .15s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.subject-delete:active { color: #f87171; transform: scale(.85); }

/* FAB */
.fab {
  position: fixed;
  bottom: 90px; right: 20px;
  width: 52px; height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #818cf8, #a78bfa);
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(129,140,248,.25), 0 0 0 0 rgba(129,140,248,.2);
  transition: all .2s ease;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fab:active { transform: scale(.88) rotate(90deg); }

/* ========== MODALS ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  width: calc(100% - 48px);
  max-width: 360px;
  padding: 22px;
  transform: scale(.94) translateY(10px);
  transition: transform .28s cubic-bezier(.32,.72,.0,1);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-title { font-size: 1.05rem; font-weight: 700; color: #f1f5f9; }
.modal-x-btn { width: 30px; height: 30px; color: #475569; }
.modal-body { margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; }
.modal-close-btn { width: 100%; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.form-group input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  color: #e2e8f0;
  font-size: .88rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease;
}
.form-group input:focus { border-color: rgba(129,140,248,.35); }
.form-group input::placeholder { color: #262f42; }

/* Buttons */
.btn {
  flex: 1;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s ease;
  font-family: inherit;
}
.btn:active { transform: scale(.95); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 15px var(--accent-glow); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.btn-danger { background: #ef4444; color: #fff; box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2); }
.btn-sm { padding: 7px 12px; font-size: .75rem; flex: 0; border-radius: 8px; }

/* TT Modal Subject Toggle */
.tt-subject-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer;
}
.tt-subject-toggle:last-child { border-bottom: none; }
.tt-toggle-check {
  width: 22px; height: 22px;
  border-radius: 7px;
  border: 2px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  transition: all .15s ease;
  flex-shrink: 0;
  color: transparent;
}
.tt-toggle-check.checked {
  background: linear-gradient(135deg, #818cf8, #a78bfa);
  border-color: #818cf8;
  color: var(--text-primary);
}
.tt-toggle-name { font-size: .86rem; font-weight: 500; color: #cbd5e1; }

/* ========== SETTINGS ========== */
.settings-list { display: flex; flex-direction: column; gap: 12px; }
.settings-group { padding: 16px; }
.settings-group-title {
  font-size: .68rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: .86rem;
  color: #cbd5e1;
}
.setting-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.setting-input {
  width: 56px;
  padding: 6px 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: .86rem;
  font-family: inherit;
  text-align: center;
  outline: none;
}
.setting-input:focus { border-color: rgba(129,140,248,.35); }
.setting-unit { font-size: .78rem; color: #475569; font-weight: 600; }
.setting-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 0;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: #cbd5e1;
  font-size: .86rem;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s ease;
}
.setting-btn:last-of-type { border-bottom: none; }
.setting-btn:active { opacity: .6; }
.setting-btn.danger { color: #f87171; }
.setting-btn svg { opacity: .4; }

.about-card { text-align: center; }
.about-info { padding: 8px 0; }
.about-logo {
  font-size: 1.15rem;
  font-weight: 800;
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.about-logo span { font-weight: 400; }
.about-tagline { font-size: .76rem; color: #475569; margin-top: 4px; }
.about-version { font-size: .64rem; color: #475569; margin-top: 6px; }

/* Dev Profile */
.dev-profile {
  text-align: center;
  padding: 8px 0;
}
.dev-avatar-wrap {
  width: 84px;
  height: 84px;
  margin: 0 auto 16px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #818cf8, #a78bfa);
  box-shadow: 0 4px 15px rgba(129,140,248,0.25);
}
.dev-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #06060f;
}
.dev-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #f1f5f9;
  margin-bottom: 6px;
}
.dev-detail {
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 2px;
}
.dev-description {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.5;
  margin-top: 14px;
  padding: 0 6px;
  font-style: italic;
}

/* Semester */
.date-input {
  width: auto;
  min-width: 120px;
  padding: 6px 10px;
  font-size: .78rem;
  color-scheme: dark;
}
.holidays-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.holidays-list:empty { display: none; }
.holiday-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.12);
  color: #fca5a5;
  font-size: .68rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 7px;
}
.holiday-chip-x {
  cursor: pointer;
  opacity: .6;
  font-size: .75rem;
  margin-left: 2px;
}
.holiday-chip-x:hover { opacity: 1; }
.sem-summary {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: 10px;
  font-size: .76rem;
  color: #94a3b8;
  line-height: 1.6;
}
.sem-summary:empty { display: none; }
.sem-summary strong { color: var(--accent-glow); font-weight: 700; }
.settings-list { padding-bottom: 16px; }

/* ========== BOTTOM NAV ========== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 70px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-around;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
  padding-bottom: constant(safe-area-inset-bottom);
}

#bulkBar {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 15, 30, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 12px 16px;
  display: none; /* Controlled by JS */
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(59, 130, 246, 0.2);
  width: 90%;
  max-width: 400px;
}

.bulk-count-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #60a5fa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bulk-btns {
  display: flex;
  gap: 8px;
  width: 100%;
}

.bulk-btns button {
  flex: 1;
  padding: 10px 6px;
  border: none;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all var(--transition);
}

.bulk-btn-p { background: rgba(52, 211, 153, 0.2); color: #34d399 !important; border: 1px solid rgba(52, 211, 153, 0.3) !important; }
.bulk-btn-a { background: rgba(248, 113, 113, 0.2); color: #f87171 !important; border: 1px solid rgba(248, 113, 113, 0.3) !important; }
.bulk-btn-o { background: rgba(148, 163, 184, 0.2); color: #94a3b8 !important; border: 1px solid rgba(148, 163, 184, 0.3) !important; }
.bulk-btn-c { background: rgba(255, 255, 255, 0.05); color: #cbd5e1 !important; border: 1px solid rgba(255, 255, 255, 0.1) !important; }
.bulk-btn-x { background: rgba(59, 130, 246, 0.15); color: #60a5fa !important; border: 1px solid rgba(59, 130, 246, 0.2) !important; }

.bulk-btns button:active { transform: scale(0.92); }

.cal-cell.selected-date {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: rgba(59, 130, 246, 0.15) !important;
  z-index: 2;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: #334155;
  cursor: pointer;
  padding: 6px 0;
  font-family: inherit;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.nav-item:active { transform: scale(0.92); }
.nav-item.active { color: var(--accent); }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 0 10px var(--accent-glow);
}
.nav-icon { width: 22px; height: 22px; }
.nav-item span {
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .3px;
}

/* ========== TOAST ========== */
.toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(15,15,30,.9);
  border: 1px solid rgba(59, 130, 246, 0.15);
  backdrop-filter: blur(16px);
  color: var(--accent-glow);
  padding: 10px 20px;
  border-radius: 12px;
  font-size: .8rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all .3s cubic-bezier(.32,.72,.0,1);
  z-index: 200;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ========== CONFIRM DIALOG ========== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.confirm-overlay.open { opacity: 1; pointer-events: auto; }
.confirm-dialog {
  width: calc(100% - 56px);
  max-width: 320px;
  padding: 28px 24px 22px;
  text-align: center;
  transform: scale(.94);
  transition: transform .28s cubic-bezier(.32,.72,.0,1);
}
.confirm-overlay.open .confirm-dialog { transform: scale(1); }
.confirm-icon { font-size: 2rem; margin-bottom: 12px; }
.confirm-title { font-size: 1rem; font-weight: 700; color: #f1f5f9; margin-bottom: 6px; }
.confirm-msg { font-size: .82rem; color: #64748b; margin-bottom: 18px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 10px; }

/* ========== EMPTY STATE ========== */
.empty-state { text-align: center; padding: 40px 20px; color: #262f42; }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .5; }
.empty-state-text { font-size: .84rem; line-height: 1.6; }

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp .3s ease forwards; }
/* ========== RESPONSIVE DESIGN (DESKTOP) ========== */
@media (min-width: 768px) {
  .desktop-only { display: block; }
  .mobile-only { display: none; }
  .bottom-nav { display: none; }

  .sidebar {
    padding: 32px 20px;
    background: rgba(13, 18, 32, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .sidebar-logo {
    margin-bottom: 40px;
    padding-left: 10px;
  }

  .sidebar-tagline {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .sidebar .nav-item {
    padding: 14px 16px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
    font-weight: 500;
    font-size: 0.95rem;
  }

  .sidebar .nav-item .nav-icon {
    width: 22px;
    height: 22px;
    margin-bottom: 0;
    color: #64748b;
  }

  .sidebar .nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #f1f5f9;
    transform: translateX(4px);
  }

  .sidebar .nav-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    border-left: 3px solid var(--accent);
    border-radius: 0 12px 12px 0; /* Flat edge on left for the border */
    font-weight: 700;
  }

  .sidebar .nav-item.active .nav-icon {
    color: var(--accent);
    filter: drop-shadow(0 0 5px var(--accent-glow));
  }

  /* Main Area */
  .main-wrapper {
    flex-grow: 1;
    height: 100vh;
    position: relative;
    overflow: visible;
  }

  .screen {
    bottom: 0;
    padding: 40px 60px;
    max-width: 1200px;
    margin: 0 auto;
  }

  /* Desktop Improvements */
  .calendar-section {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
  }

  .calendar-container {
    width: 100%;
  }

  .day-view {
    position: static;
    transform: none !important;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    height: auto;
    max-height: 85vh;
    border-radius: 24px;
    padding: 24px;
    opacity: 1;
    pointer-events: auto;
    display: none; /* Only show when date selected */
  }

  .day-view.open {
    display: block;
  }

  .day-view-handle { display: none; }

  .subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }

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

  .screen-header {
    margin-bottom: 32px;
  }

  .screen-title {
    font-size: 2.2rem;
  }
}

@media (max-width: 767px) {
  .desktop-only { display: none; }
}

/* APK Download Button */
.apk-download-section {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.apk-download-btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: white !important;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.apk-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.apk-download-btn:active {
  transform: translateY(0);
}

.apk-info {
  font-size: 0.85rem;
  color: #94a3b8;
  max-width: 250px;
  line-height: 1.4;
}

/* Floating Action Button */
.apk-float-btn {
  position: fixed;
  bottom: 90px; /* Above bottom nav */
  right: 20px;
  width: 56px;
  height: 56px;
  background: var(--accent);
  color: white !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  z-index: 1000;
  transition: all var(--transition);
  text-decoration: none;
}

#installBtn {
  position: fixed;
  bottom: 90px;
  right: 20px;
  background: var(--accent);
  color: white;
  border-radius: 50px;
  padding: 12px 20px;
  z-index: 999;
  border: none;
  font-family: inherit;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
  transition: all var(--transition);
}

#installBtn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.5);
}

#installBtn:active {
  transform: scale(0.95);
}

button:active {
  transform: scale(0.97) !important;
}

.apk-float-btn:hover {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.5);
}

.apk-float-btn:active {
  transform: scale(0.95);
}

/* Universal Install Modal */
.install-modal {
  max-width: 340px;
  width: 100%;
  padding: 32px 24px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transform: translateY(20px);
  animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
}

.install-modal-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.4));
}

.install-modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  margin-bottom: 8px;
}

.install-modal-text {
  font-size: 0.95rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 28px;
}

.install-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.install-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-decoration: none;
  width: 100%;
}

.install-btn .btn-icon {
  font-size: 1.2rem;
}

.install-btn.android {
  background: linear-gradient(135deg, #3ddc84, #1de9b6);
  color: #0b0f1a !important;
}

.install-btn.windows {
  background: linear-gradient(135deg, #0078d4, #00bcf2);
  color: white !important;
}

.install-btn.ios {
  background: linear-gradient(135deg, #333, #000);
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.install-btn:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.1);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.install-btn:active {
  transform: scale(0.98);
}

.install-close-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.install-close-btn:hover {
  color: white;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  to { transform: translateY(0); }
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .apk-float-btn {
    bottom: 85px;
    right: 15px;
    width: 50px;
    height: 50px;
  }
}

/* Semester Ribbon (Modern SaaS Style) */
.semester-ribbon {
  width: 100%;
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  position: sticky;
  top: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ribbon-left, .ribbon-center, .ribbon-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ribbon-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ribbon-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 700;
}

.ribbon-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f1f5f9;
}

.ribbon-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
}

.ribbon-att-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Attendance Status Colors */
.att-good { color: #34d399 !important; }
.att-warn { color: #fbbf24 !important; }
.att-bad  { color: #f87171 !important; }
.att-neutral { color: #94a3b8 !important; }

.att-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.dot-good { background-color: #34d399; color: #34d399; }
.dot-warn { background-color: #fbbf24; color: #fbbf24; }
.dot-bad  { background-color: #f87171; color: #f87171; }
.dot-neutral { background-color: #475569; color: transparent; box-shadow: none; }

.ribbon-action-btn {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.ribbon-action-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

.ribbon-action-btn:active {
  transform: translateY(0);
}

/* Responsive Ribbon */
@media (max-width: 600px) {
  .semester-ribbon {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .ribbon-left {
    gap: 14px;
  }
  
  .ribbon-divider {
    display: none;
  }
  
  .ribbon-label {
    font-size: 0.6rem;
  }
  
  .ribbon-value {
    font-size: 0.8rem;
  }
}

/* ========== PREMIUM HOME DASHBOARD ========== */
.home-animated-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 20px;
}

/* Staggered Animations */
.animate-card {
opacity: 0;
transform: translateY(30px) scale(0.98);
animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fadeUp {
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}

/* STRONG STAGGER (VISIBLE) */
.animate-card:nth-child(1) { animation-delay: 0.1s; }
.animate-card:nth-child(2) { animation-delay: 0.2s; }
.animate-card:nth-child(3) { animation-delay: 0.3s; }
.animate-card:nth-child(4) { animation-delay: 0.4s; }
.animate-card:nth-child(5) { animation-delay: 0.5s; }

/* CARD INTERACTION */
.card {
transition: all 0.25s ease;
border-radius: 16px;
}

.card:hover {
transform: translateY(-6px) scale(1.02);
box-shadow: 0 20px 40px rgba(59,130,246,0.25);
}

/* BUTTON FEEDBACK */
button {
transition: all 0.15s ease;
}

button:active {
transform: scale(0.94);
}

body {
background:
radial-gradient(circle at top right, rgba(59,130,246,0.15), transparent 40%),
#0a0f1c;
}

/* Scroll Reveal Classes */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 1. Dynamic Header Card */
.dynamic-header-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(17, 24, 39, 0.4));
  border: 1px solid rgba(59, 130, 246, 0.2) !important;
}

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

.greeting {
  font-size: 1.6rem;
  font-weight: 800;
  color: #f1f5f9;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

body:not(.dark) .greeting { color: #0f172a; }

.current-date {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 500;
  margin-bottom: 16px;
}

.semester-att-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body:not(.dark) .semester-att-info {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.05);
}

.sem-info-label { font-size: 0.7rem; color: #cbd5e1; font-weight: 600; text-transform: uppercase; }
body:not(.dark) .sem-info-label { color: #475569; }
.sem-info-val { font-size: 0.85rem; color: #60a5fa; font-weight: 800; }

.header-glow {
  position: absolute;
  top: -50%;
  right: -20%;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, transparent 70%);
  filter: blur(30px);
  z-index: 1;
  animation: pulseGlow 4s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
  from { transform: scale(1); opacity: 0.6; }
  to { transform: scale(1.2); opacity: 0.9; }
}

/* 2. Attendance Overview Card */
.att-overview-card {
  display: flex;
  align-items: center;
  padding: 20px;
  gap: 24px;
}

.att-circular-progress {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.att-circular-progress svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.att-circular-progress circle {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
}

.att-circular-progress .bg { stroke: rgba(255, 255, 255, 0.05); }
body:not(.dark) .att-circular-progress .bg { stroke: rgba(0, 0, 0, 0.05); }
.att-circular-progress .fg { 
  stroke: var(--accent);
  transition: stroke-dashoffset 1s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

.att-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: #f1f5f9;
}
body:not(.dark) .att-val { color: #0f172a; }

.att-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.att-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
body:not(.dark) .att-stat { border-color: rgba(0, 0, 0, 0.05); }
.att-stat:last-child { border-bottom: none; padding-bottom: 0; }

.att-stat .lbl { font-size: 0.75rem; color: #94a3b8; font-weight: 600; }
body:not(.dark) .att-stat .lbl { color: #64748b; }

.att-stat .val { font-size: 1rem; font-weight: 800; }
.present-val { color: #34d399; }
.absent-val { color: #f87171; }
.total-val { color: #cbd5e1; }
body:not(.dark) .total-val { color: #475569; }

/* 3. Insight Card */
.insight-card-animated {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.08), transparent);
  border-left: 4px solid var(--accent) !important;
}

.pulse-anim { animation: gentlePulse 2s infinite; font-size: 1.4rem; }
@keyframes gentlePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.insight-text { font-size: 0.85rem; color: #e2e8f0; font-weight: 500; line-height: 1.5; }
body:not(.dark) .insight-text { color: #1e293b; }

/* 4. Today's Classes */
.today-classes-card { padding: 20px; }
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-title { font-size: 1.05rem; font-weight: 700; color: #f1f5f9; }
body:not(.dark) .section-title { color: #0f172a; }

.count-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.today-list { display: flex; flex-direction: column; gap: 10px; }

.today-agenda-item {
  display: flex;
  align-items: center;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: transform 0.2s ease, background 0.2s ease;
}
body:not(.dark) .today-agenda-item {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.04);
}

.today-agenda-item:active { transform: scale(0.98); }

.agenda-time-dot {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; margin-right: 12px; flex-shrink: 0;
}

.agenda-subj-info { flex: 1; }
.agenda-subj-name { font-size: 0.9rem; font-weight: 600; color: #f1f5f9; }
body:not(.dark) .agenda-subj-name { color: #1e293b; }
.agenda-subj-status { font-size: 0.7rem; color: #94a3b8; margin-top: 2px; }

.q-action-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  border: none; cursor: pointer; transition: transform 0.2s;
  margin-left: 6px;
}
.q-action-btn:active { transform: scale(0.9); }
.q-btn-p { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.q-btn-a { background: rgba(248, 113, 113, 0.15); color: #f87171; }

.empty-agenda-msg {
  text-align: center; padding: 24px 0; color: #64748b; font-size: 0.85rem;
}

/* 5. Quick Actions */
.quick-actions-row {
  display: flex; gap: 12px;
}
.action-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 16px 8px;
  border: none;
  background: rgba(255, 255, 255, 0.02);
  color: #cbd5e1;
  font-size: 0.75rem; font-weight: 600; cursor: pointer;
  border-radius: 14px;
  transition: all var(--transition);
}
body:not(.dark) .action-btn { color: #475569; }
.action-btn:active { transform: scale(0.95); }
.action-btn .icon { font-size: 1.4rem; }

/* ============================================================
   LIGHT MODE OVERRIDES
   All component styles that used hardcoded dark colors
   are corrected here for body:not(.dark) (light mode).
   ============================================================ */
body:not(.dark) {
  background-image: radial-gradient(circle at 70% 10%, rgba(59, 130, 246, 0.06), transparent 40%);
}

body:not(.dark)::after {
  background: radial-gradient(circle at center, rgba(37, 99, 235, 0.04) 0%, transparent 70%);
}

/* Glass cards in light mode */
body:not(.dark) .glass-card {
  background: rgba(255, 255, 255, 0.65) !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06) !important;
}

body:not(.dark) .glass-card:hover {
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.08) !important;
  border-color: rgba(59, 130, 246, 0.12) !important;
}

/* Calendar */
body:not(.dark) .month-label { color: #1e293b; }
body:not(.dark) .icon-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--accent);
}
body:not(.dark) .icon-btn:active { background: rgba(0, 0, 0, 0.08); }
body:not(.dark) .cal-cell { color: #475569; }
body:not(.dark) .cal-cell.today {
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
  box-shadow: inset 0 0 0 1.5px rgba(59, 130, 246, 0.2);
}
body:not(.dark) .cal-cell.selected {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.1), inset 0 0 0 1.5px rgba(59, 130, 246, 0.25);
}
body:not(.dark) .cal-header { color: #64748b; }

/* Day View */
body:not(.dark) .day-view {
  background: rgba(248, 250, 252, 0.97);
  border-color: rgba(0, 0, 0, 0.06);
}
body:not(.dark) .day-view-handle { background: rgba(0, 0, 0, 0.12); }
body:not(.dark) .day-view-header h3 { color: #0f172a; }
body:not(.dark) .close-btn { color: #94a3b8; }

/* Day Subject Cards */
body:not(.dark) .day-subject-card {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}
body:not(.dark) .day-subject-name { color: #0f172a; }
body:not(.dark) .day-subject-pct {
  color: #2563eb;
  background: rgba(59, 130, 246, 0.08);
}
body:not(.dark) .mark-btn {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
  color: #64748b;
}
body:not(.dark) .mark-btn.present { color: #059669; border-color: rgba(5, 150, 105, 0.2); }
body:not(.dark) .mark-btn.present.active { background: rgba(5, 150, 105, 0.08); border-color: rgba(5, 150, 105, 0.3); color: #047857; }
body:not(.dark) .mark-btn.absent { color: #dc2626; border-color: rgba(220, 38, 38, 0.2); }
body:not(.dark) .mark-btn.absent.active { background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.3); color: #b91c1c; }
body:not(.dark) .mark-btn.off { color: #64748b; border-color: rgba(100, 116, 139, 0.2); }
body:not(.dark) .mark-btn.off.active { background: rgba(100, 116, 139, 0.08); border-color: rgba(100, 116, 139, 0.3); }
body:not(.dark) .mark-btn.clear { color: #94a3b8; border-color: rgba(0, 0, 0, 0.08); }

/* Bulk Actions */
body:not(.dark) .mark-all-btn {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.08), rgba(5, 150, 105, 0.04));
  border-color: rgba(5, 150, 105, 0.15);
  color: #059669;
}
body:not(.dark) .clear-all-btn {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.1);
  color: #64748b;
}
body:not(.dark) .empty-day { color: #94a3b8; }

/* Today Screen */
body:not(.dark) .today-date { color: #2563eb; }
body:not(.dark) .today-prediction { color: #334155; }

/* Subject Cards */
body:not(.dark) .subject-card {
  background: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.06);
}
body:not(.dark) .att-ring-bg { stroke: rgba(0, 0, 0, 0.06); }
body:not(.dark) .att-ring-text { color: #0f172a; }
body:not(.dark) .subject-info-name { color: #0f172a; }
body:not(.dark) .subject-info-prediction { color: #64748b; }
body:not(.dark) .subject-info-prediction .can-miss { color: #059669; }
body:not(.dark) .subject-info-prediction .must-attend { color: #d97706; }
body:not(.dark) .subject-stat-item { color: #94a3b8; }
body:not(.dark) .subject-stat-item span { color: #475569; }
body:not(.dark) .subject-delete { color: #94a3b8; }
body:not(.dark) .subject-delete:active { color: #dc2626; }

/* Timetable */
body:not(.dark) .tt-day-row {
  background: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.06);
}
body:not(.dark) .tt-day-row:active { background: rgba(0, 0, 0, 0.03); }
body:not(.dark) .tt-day-label { color: #2563eb; }
body:not(.dark) .tt-chip {
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}
body:not(.dark) .tt-empty { color: #cbd5e1; }
body:not(.dark) .tt-subject-toggle { border-color: rgba(0, 0, 0, 0.05); }
body:not(.dark) .tt-toggle-check { border-color: rgba(0, 0, 0, 0.15); }
body:not(.dark) .tt-toggle-name { color: #1e293b; }

/* Modal */
body:not(.dark) .modal-overlay { background: rgba(0, 0, 0, 0.3); }
body:not(.dark) .modal-title { color: #0f172a; }
body:not(.dark) .modal-x-btn { color: #94a3b8; }

/* Forms */
body:not(.dark) .form-group input {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: #0f172a;
}
body:not(.dark) .form-group input::placeholder { color: #cbd5e1; }
body:not(.dark) .form-group input:focus { border-color: rgba(59, 130, 246, 0.4); }
body:not(.dark) .form-group label { color: #64748b; }

/* Settings */
body:not(.dark) .setting-item { color: #1e293b; }
body:not(.dark) .setting-input {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: #0f172a;
}
body:not(.dark) .setting-input:focus { border-color: rgba(59, 130, 246, 0.4); }
body:not(.dark) .setting-btn {
  color: #1e293b;
  border-color: rgba(0, 0, 0, 0.06);
}
body:not(.dark) .setting-btn.danger { color: #dc2626; }
body:not(.dark) .dev-name { color: #0f172a; }
body:not(.dark) .dev-detail { color: #475569; }
body:not(.dark) .dev-description { color: #64748b; }
body:not(.dark) .dev-avatar { border-color: #f8fafc; }
body:not(.dark) .date-input { color-scheme: light; }

/* History */
body:not(.dark) .history-stat-chip {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
  color: #475569;
}
body:not(.dark) .history-entry {
  background: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.06);
}
body:not(.dark) .history-date { color: #475569; }
body:not(.dark) .history-btn {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
  color: #94a3b8;
}
body:not(.dark) .history-btn.present { color: #059669; }
body:not(.dark) .history-btn.present.active { background: rgba(5, 150, 105, 0.08); border-color: rgba(5, 150, 105, 0.25); }
body:not(.dark) .history-btn.absent { color: #dc2626; }
body:not(.dark) .history-btn.absent.active { background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.25); }
body:not(.dark) .history-btn.off { color: #64748b; }
body:not(.dark) .history-btn.off.active { background: rgba(100, 116, 139, 0.08); border-color: rgba(100, 116, 139, 0.25); }
body:not(.dark) .history-btn.clear { color: #cbd5e1; }
body:not(.dark) .history-empty { color: #94a3b8; }

/* Bottom Nav */
body:not(.dark) .bottom-nav {
  background: var(--nav-bg);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
body:not(.dark) .nav-item { color: #94a3b8; }
body:not(.dark) .nav-item.active { color: var(--accent); }

/* Toast */
body:not(.dark) .toast {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(59, 130, 246, 0.15);
  color: #2563eb;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Confirm Dialog */
body:not(.dark) .confirm-title { color: #0f172a; }
body:not(.dark) .confirm-msg { color: #64748b; }

/* Empty States */
body:not(.dark) .empty-state { color: #94a3b8; }

/* Semester Ribbon */
body:not(.dark) .semester-ribbon {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
body:not(.dark) .ribbon-value { color: #0f172a; }
body:not(.dark) .ribbon-divider { background: rgba(0, 0, 0, 0.08); }

/* Calendar Legend */
body:not(.dark) .cal-legend-item { color: #64748b; }

/* Stat Values in Today */
body:not(.dark) .stat-value {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
}
body:not(.dark) .stat-value.target-val {
  background: linear-gradient(135deg, #059669, #10b981);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Stat progress bar */
body:not(.dark) .stat-progress { background: rgba(0, 0, 0, 0.04); }

/* Agenda items */
body:not(.dark) .agenda-item {
  background: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.06);
}
body:not(.dark) .empty-agenda {
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.08);
}

/* Holidays */
body:not(.dark) .holiday-chip {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

/* Sem summary */
body:not(.dark) .sem-summary {
  background: rgba(59, 130, 246, 0.04);
  border-color: rgba(59, 130, 246, 0.08);
  color: #475569;
}
body:not(.dark) .sem-summary strong { color: #2563eb; }

/* Install Modal */
body:not(.dark) .install-modal-title { color: #0f172a; }
body:not(.dark) .install-modal-text { color: #64748b; }
body:not(.dark) .install-modal {
  border-color: rgba(0, 0, 0, 0.08);
}

/* Desktop sidebar in light mode */
@media (min-width: 768px) {
  body:not(.dark) .sidebar {
    background: rgba(241, 245, 249, 0.8);
    border-color: rgba(0, 0, 0, 0.06);
  }
  body:not(.dark) .sidebar .nav-item .nav-icon { color: #94a3b8; }
  body:not(.dark) .sidebar .nav-item:hover {
    background: rgba(0, 0, 0, 0.03);
    color: #0f172a;
  }
  body:not(.dark) .sidebar .nav-item.active {
    background: rgba(59, 130, 246, 0.08);
  }
  body:not(.dark) .day-view {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.06);
  }
}

.modal-overlay.open {
display: flex !important;
z-index: 9999;
}
