/* ============================================================
   AGENT 3: Premium Design System
   Low-stress, calming dark theme with glassmorphism
   ============================================================ */

/* ==================== RESET & VARIABLES ==================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colors — calming palette */
  --bg-deep: #0a0a14;
  --bg-primary: #0f0f1e;
  --bg-secondary: #161628;
  --bg-card: rgba(22, 22, 42, 0.7);
  --bg-card-hover: rgba(30, 30, 55, 0.85);
  --bg-elevated: rgba(35, 35, 60, 0.6);

  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-hover: rgba(255, 255, 255, 0.12);

  --text-primary: #e8eaf0;
  --text-secondary: #9ea3b8;
  --text-muted: #5e6380;
  --text-inverse: #0f0f1e;

  --accent-indigo: #6366f1;
  --accent-violet: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-cyan: #06b6d4;
  --accent-orange: #f97316;

  --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
  --gradient-warm: linear-gradient(135deg, #f97316, #f43f5e);
  --gradient-cool: linear-gradient(135deg, #06b6d4, #6366f1);
  --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.15);

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

  --sidebar-width: 250px;
  --header-height: 72px;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}

/* Ambient background glow */
body::before {
  content: '';
  position: fixed;
  top: -40%;
  right: -20%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -30%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ==================== LAYOUT ==================== */
.app {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  transition: width var(--transition-slow);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.03) 0%, transparent 40%);
  pointer-events: none;
}

.sidebar.collapsed {
  width: 0;
  border: none;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--glass-border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.logo-icon {
  font-size: 1.6rem;
}

.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-accent {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mode-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--transition-base);
}

.mode-badge.learning {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.mode-badge.exam {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.2);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(244, 63, 94, 0.1); }
  50% { box-shadow: 0 0 16px rgba(244, 63, 94, 0.25); }
}

.mode-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-item:hover {
  background: var(--glass);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-indigo);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: var(--gradient-primary);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--glass-border);
}

.streak-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.15);
}

.streak-flame {
  font-size: 1.5rem;
  animation: flame-flicker 1.5s ease-in-out infinite alternate;
}

@keyframes flame-flicker {
  from { transform: scale(1) rotate(-2deg); }
  to { transform: scale(1.1) rotate(2deg); }
}

.streak-count {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-orange);
}

.streak-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.top-header {
  height: var(--header-height);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(15, 15, 30, 0.8);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

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

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.page-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.header-right {
  display: flex;
  gap: 10px;
}

/* ==================== BUTTONS ==================== */
.btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--glass-border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 12px;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--glass);
}

.btn-icon {
  background: transparent;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-danger-ghost {
  opacity: 0.4;
}
.btn-danger-ghost:hover {
  opacity: 1;
  background: rgba(244, 63, 94, 0.1);
}

/* ==================== VIEW CONTAINER ==================== */
.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  scroll-behavior: smooth;
}

.view-container::-webkit-scrollbar {
  width: 6px;
}
.view-container::-webkit-scrollbar-track {
  background: transparent;
}
.view-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}
.view-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

.view {
  display: none;
  animation: fadeIn 0.3s ease;
}
.view.active {
  display: block;
}

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

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  backdrop-filter: blur(8px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-tasks::before { background: var(--gradient-primary); }
.stat-mastery::before { background: var(--gradient-cool); }
.stat-exam::before { background: var(--gradient-warm); }
.stat-subjects::before { background: var(--gradient-success); }

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

.stat-icon {
  font-size: 2rem;
  padding-top: 2px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 20px 12px;
}

.stat-exam-name {
  position: absolute;
  bottom: 12px;
  left: 20px;
  font-size: 0.72rem;
  color: var(--text-muted);
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-ring {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
}

.mastery-ring-svg {
  width: 100%;
  height: 100%;
}

/* Progress Bar */
.progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width var(--transition-slow);
}

/* ==================== CARDS ==================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(8px);
}

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

.card-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

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

/* ==================== TASK LIST ==================== */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.task-list::-webkit-scrollbar {
  width: 4px;
}
.task-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.task-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.task-item.priority-critical::before { background: var(--accent-rose); }
.task-item.priority-high::before { background: var(--accent-orange); }
.task-item.priority-medium::before { background: var(--accent-amber); }
.task-item.priority-low::before { background: var(--accent-emerald); }
.task-item.priority-minimal::before { background: var(--text-muted); }

.task-item:hover {
  border-color: var(--glass-border-hover);
  background: var(--bg-card-hover);
}

.task-item.completed {
  opacity: 0.5;
}

.task-item.completed .task-name {
  text-decoration: line-through;
}

/* Task Checkbox */
.task-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--glass-border-hover);
  background: transparent;
  color: white;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.task-check:hover {
  border-color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.1);
}

.task-check.checked {
  background: var(--accent-indigo);
  border-color: var(--accent-indigo);
}

/* Task Content */
.task-content {
  flex: 1;
  min-width: 0;
}

.task-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.task-icon {
  font-size: 0.95rem;
}

.task-name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.task-badge-deep_study { background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo); }
.task-badge-study { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.task-badge-practice { background: rgba(139, 92, 246, 0.15); color: var(--accent-violet); }
.task-badge-revision { background: rgba(249, 115, 22, 0.15); color: var(--accent-orange); }
.task-badge-quick_study { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.task-badge-mock_test { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.task-badge-pyq { background: rgba(236, 72, 153, 0.15); color: var(--accent-pink); }
.task-badge-exam-mode {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
  animation: pulse-glow 2s ease-in-out infinite;
}

.task-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.task-subject {
  position: relative;
  padding-left: 10px;
}
.task-subject::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--subject-color, var(--accent-indigo));
}

.task-duration {
  white-space: nowrap;
}

.task-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Priority Badge */
.task-priority-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.priority-critical { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.priority-high { background: rgba(249, 115, 22, 0.15); color: var(--accent-orange); }
.priority-medium { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.priority-low { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.priority-minimal { background: rgba(94, 99, 128, 0.15); color: var(--text-muted); }

/* ==================== MASTERY BARS ==================== */
.mastery-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.mastery-item {
  padding: 4px 0;
}

.mastery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.mastery-subject {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.mastery-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.mode-tag {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
}

.exam-tag {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
}

.learn-tag {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
}

.mastery-percent {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.mastery-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.mastery-fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--transition-slow);
  position: relative;
}

.mastery-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2));
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.mastery-detail {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==================== EXAM TIMELINE ==================== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.timeline-item:hover {
  border-color: var(--glass-border-hover);
}

.timeline-item.urgent {
  border-left: 3px solid var(--accent-rose);
}
.timeline-item.warning {
  border-left: 3px solid var(--accent-orange);
}
.timeline-item.soon {
  border-left: 3px solid var(--accent-amber);
}
.timeline-item.relaxed {
  border-left: 3px solid var(--accent-emerald);
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.timeline-content {
  flex: 1;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.timeline-top strong {
  font-size: 0.9rem;
}

.timeline-days {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
}

.timeline-days.urgent { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.timeline-days.warning { background: rgba(249, 115, 22, 0.15); color: var(--accent-orange); }
.timeline-days.soon { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.timeline-days.relaxed { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }

.timeline-bottom {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==================== SCHEDULE VIEW ==================== */
.schedule-controls {
  margin-bottom: 20px;
}

.schedule-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.schedule-date {
  font-size: 1.2rem;
  font-weight: 700;
  min-width: 200px;
  text-align: center;
}

.schedule-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.schedule-group {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.schedule-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(99, 102, 241, 0.05);
  border-bottom: 1px solid var(--glass-border);
}

.schedule-group-label {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-indigo);
}

.schedule-group-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.schedule-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--transition-fast);
}

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

.schedule-item:hover {
  background: var(--glass);
}

.schedule-item.completed {
  opacity: 0.4;
}

.schedule-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.schedule-item-icon {
  font-size: 1.2rem;
}

.schedule-item-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.schedule-item-subject {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-left: 10px;
  position: relative;
}

.schedule-item-subject::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--subject-color, var(--accent-indigo));
}

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

.schedule-item-duration {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ==================== SUBJECTS VIEW ==================== */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.subject-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.subject-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent, var(--accent-indigo));
}

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

.subject-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.subject-card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.subject-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.subject-stat {
  text-align: center;
  padding: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

.subject-stat-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.subject-stat-label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.topic-list {
  margin-top: 16px;
}

.topic-list h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.topic-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.85rem;
}

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

.topic-item.mastered {
  opacity: 0.6;
}

.topic-status {
  font-size: 0.8rem;
  width: 20px;
  text-align: center;
}

.topic-name {
  flex: 1;
}

.topic-info {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.subject-exam-info {
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.08);
  font-size: 0.8rem;
  color: var(--accent-amber);
  font-weight: 500;
}

/* ==================== PRIORITY MATRIX ==================== */
.priority-header {
  margin-bottom: 20px;
}

.priority-description {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.priority-table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
}

.priority-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.priority-table thead {
  background: rgba(99, 102, 241, 0.05);
}

.priority-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

.priority-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--glass-border);
}

.priority-row:hover {
  background: var(--glass);
}

.priority-row:last-child td {
  border-bottom: none;
}

.rank {
  font-weight: 700;
  color: var(--text-muted);
  width: 30px;
}

.topic-col {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.topic-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.mastered-badge {
  font-size: 0.7rem;
}

.priority-score-cell {
  font-size: 1rem;
  color: var(--accent-indigo);
}

/* Score bars */
.score-bar {
  display: inline-block;
  width: 60px;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
}

.score-fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--transition-slow);
}

.score-fill.urgency { background: var(--accent-rose); }
.score-fill.difficulty { background: var(--accent-orange); }
.score-fill.weightage { background: var(--accent-indigo); }

.mode-pill {
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}
.mode-pill.exam { background: rgba(244, 63, 94, 0.12); color: var(--accent-rose); }
.mode-pill.learning { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); }

.level-badge {
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.level-critical { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.level-high { background: rgba(249, 115, 22, 0.15); color: var(--accent-orange); }
.level-medium { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.level-low { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.level-minimal { background: rgba(94, 99, 128, 0.15); color: var(--text-muted); }

.empty-table {
  text-align: center;
  padding: 40px !important;
  color: var(--text-muted);
}

/* ==================== CALENDAR ==================== */
.calendar-header-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}

.calendar-month {
  font-size: 1.2rem;
  font-weight: 700;
  min-width: 200px;
  text-align: center;
}

.calendar-grid {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cal-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: rgba(99, 102, 241, 0.05);
  border-bottom: 1px solid var(--glass-border);
}

.cal-header-cell {
  padding: 10px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cal-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-cell {
  min-height: 80px;
  padding: 8px;
  border-bottom: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  transition: background var(--transition-fast);
  position: relative;
}

.cal-cell:nth-child(7n) {
  border-right: none;
}

.cal-cell:hover {
  background: var(--glass);
}

.cal-cell.empty {
  background: transparent;
}

.cal-cell.today {
  background: rgba(99, 102, 241, 0.08);
}

.cal-cell.today .cal-day {
  background: var(--gradient-primary);
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cal-cell.has-exam {
  border-bottom: 2px solid var(--accent-rose);
}

.cal-day {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.cal-exam-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.7rem;
}

.cal-tasks-info {
  margin-top: 6px;
}

.cal-task-count {
  font-size: 0.68rem;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-indigo);
  font-weight: 600;
}

.cal-revision-dot {
  font-size: 0.65rem;
  margin-top: 3px;
}

/* ==================== MODALS ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 500px;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-slow);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--glass);
  color: var(--text-primary);
}

/* ==================== FORMS ==================== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.label-hint {
  font-weight: 400;
  color: var(--text-muted);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

.form-group input[type="range"] {
  width: calc(100% - 40px);
  accent-color: var(--accent-indigo);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.range-value {
  display: inline-block;
  width: 28px;
  text-align: center;
  font-weight: 700;
  color: var(--accent-indigo);
  font-size: 0.9rem;
  vertical-align: middle;
}

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

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

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

.empty-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 10px;
  opacity: 0.6;
}

.empty-state p {
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: block;
  }

  .top-header {
    padding: 0 16px;
  }

  .view-container {
    padding: 16px;
  }

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

  .header-right {
    gap: 6px;
  }

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

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

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ==================== UTILITY ==================== */
.hidden {
  display: none !important;
}

/* ==================== AUTH PAGE ==================== */
.auth-page {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  overflow: hidden;
}

.auth-page.hidden {
  display: none !important;
}

/* Animated background orbs */
.auth-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}

.auth-orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25), transparent 70%);
  top: -10%;
  right: -5%;
  animation: orb-float-1 12s ease-in-out infinite alternate;
}

.auth-orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.2), transparent 70%);
  bottom: -15%;
  left: -5%;
  animation: orb-float-2 15s ease-in-out infinite alternate;
}

.auth-orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15), transparent 70%);
  top: 40%;
  left: 50%;
  animation: orb-float-3 10s ease-in-out infinite alternate;
}

@keyframes orb-float-1 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-60px, 40px) scale(1.15); }
}
@keyframes orb-float-2 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(50px, -30px) scale(1.1); }
}
@keyframes orb-float-3 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-40px, -50px) scale(1.2); }
}

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 16px;
}

.auth-card {
  background: rgba(22, 22, 42, 0.75);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.06);
  animation: card-entrance 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes card-entrance {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 8px;
  animation: logo-bounce 2s ease-in-out infinite;
}

@keyframes logo-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.auth-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.auth-tab:hover {
  color: var(--text-secondary);
}

.auth-tab.active {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* Auth Forms */
.auth-form {
  display: none;
  animation: fadeIn 0.25s ease;
}

.auth-form.active {
  display: block;
}

.auth-form .form-group {
  margin-bottom: 14px;
}

.auth-form .form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
  display: block;
}

.auth-form .form-group input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition-fast);
}

.auth-form .form-group input:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

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

.auth-error {
  color: var(--accent-rose);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 10px;
  min-height: 1.2em;
  text-align: center;
}

.btn-full {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 0.95rem;
  margin-top: 6px;
}

.btn-full:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.auth-switch {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 18px;
}

.auth-switch a {
  color: var(--accent-indigo);
  text-decoration: none;
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ==================== USER GREETING (sidebar) ==================== */
.user-greeting {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  width: 100%;
  justify-content: center;
  margin-top: 10px;
  padding: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.btn-logout:hover {
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.2);
  background: rgba(244, 63, 94, 0.06);
}

/* ==================== FORGOT PASSWORD FLOW ==================== */
.auth-forgot {
  text-align: right;
  margin-top: -4px;
  margin-bottom: 8px;
}

.auth-forgot a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.auth-forgot a:hover {
  color: var(--accent-indigo);
}

/* Forgot Steps */
.forgot-step {
  display: none;
  animation: stepSlideIn 0.3s ease;
}

.forgot-step.active {
  display: block;
}

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

.forgot-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.forgot-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.forgot-back {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.forgot-back:hover {
  background: var(--glass);
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
}

.forgot-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.forgot-desc strong {
  color: var(--accent-indigo);
}

/* OTP Input Group */
.otp-input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.otp-digit {
  width: 46px;
  height: 54px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: 'Inter', monospace;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
  caret-color: var(--accent-indigo);
}

.otp-digit:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: rgba(99, 102, 241, 0.06);
}

.otp-digit.filled {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.06);
}

.otp-separator {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 2px;
  user-select: none;
}

.otp-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--accent-amber);
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.12);
  min-height: 0;
  transition: all var(--transition-fast);
}

.otp-hint:empty {
  display: none;
}

/* Success State */
.forgot-success {
  text-align: center;
  padding: 20px 0;
}

.forgot-success h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.forgot-success p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.success-checkmark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gradient-success);
  color: white;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  animation: successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

@keyframes successPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ==================== AUTH SEPARATOR & SOCIAL ==================== */
.auth-separator {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.auth-separator::before,
.auth-separator::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--glass-border);
}
.auth-separator span {
  padding: 0 10px;
}

.btn-google {
  background: white;
  color: #3c4043;
  border: 1px solid #dadce0;
  justify-content: center;
  font-weight: 500;
}
.btn-google:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   NEW FEATURE STYLES: Analytics, Confidence, Resources, etc.
   ============================================================ */

/* ==================== DAILY ANALYTICS BANNER ==================== */
.analytics-banner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 28px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08), rgba(6, 182, 212, 0.06));
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  animation: bannerSlideIn 0.5s ease;
}

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

.analytics-streak {
  display: flex;
  align-items: center;
  gap: 12px;
}

.analytics-streak-flame {
  font-size: 2.2rem;
  animation: flame-flicker 1.5s ease-in-out infinite alternate;
}

.analytics-streak-info {
  display: flex;
  flex-direction: column;
}

.analytics-streak-count {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f97316, #f43f5e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.analytics-streak-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.analytics-divider {
  width: 1px;
  height: 48px;
  background: rgba(255, 255, 255, 0.08);
}

.analytics-completion {
  flex: 1;
}

.analytics-completion-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.analytics-completion-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.analytics-completion-pct {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.analytics-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.analytics-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a855f7, #06b6d4);
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.analytics-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmerProgress 2.5s ease-in-out infinite;
}

@keyframes shimmerProgress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.analytics-today {
  display: flex;
  align-items: center;
  gap: 10px;
}

.analytics-today-icon {
  font-size: 1.6rem;
}

.analytics-today-info {
  display: flex;
  flex-direction: column;
}

.analytics-today-count {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.analytics-today-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

/* ==================== CONFIDENCE TRAFFIC LIGHTS ==================== */
.confidence-lights {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-right: 6px;
}

.confidence-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  opacity: 0.4;
}

.confidence-btn:hover {
  opacity: 0.85;
  transform: scale(1.15);
}

.confidence-btn.active {
  opacity: 1;
  transform: scale(1.2);
}

.confidence-red.active {
  background: rgba(244, 63, 94, 0.2);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.3);
  animation: confidencePulseRed 2s ease-in-out infinite;
}

.confidence-yellow.active {
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.confidence-green.active {
  background: rgba(16, 185, 129, 0.2);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

@keyframes confidencePulseRed {
  0%, 100% { box-shadow: 0 0 8px rgba(244, 63, 94, 0.2); }
  50% { box-shadow: 0 0 16px rgba(244, 63, 94, 0.4); }
}

/* Inline confidence for schedule view */
.confidence-lights-inline {
  display: flex;
  gap: 3px;
  margin-right: 8px;
}

.cl-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.35;
  transition: all var(--transition-fast);
}

.cl-btn:hover {
  opacity: 0.8;
  transform: scale(1.2);
}

.cl-btn.active {
  opacity: 1;
  transform: scale(1.15);
}

/* ==================== TASK RESOURCE INPUT ==================== */
.task-resource-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.task-resource-input {
  flex: 1;
  padding: 4px 10px;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
  min-width: 0;
}

.task-resource-input::placeholder {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.task-resource-input:focus {
  border-color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.04);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.08);
}

.task-resource-link {
  font-size: 0.85rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.task-resource-link:hover {
  background: rgba(99, 102, 241, 0.1);
  transform: scale(1.1);
}

/* ==================== CATCH-UP BUTTON ==================== */
.btn-catch-up {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(244, 63, 94, 0.15));
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.2);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-catch-up:hover {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.25), rgba(244, 63, 94, 0.25));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

.btn-catch-up.has-missed {
  animation: catchUpPulse 2s ease-in-out infinite;
  border-color: rgba(244, 63, 94, 0.4);
}

@keyframes catchUpPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(244, 63, 94, 0.15); }
  50% { box-shadow: 0 0 20px rgba(244, 63, 94, 0.35); }
}

.btn-catch-up:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
  animation: none !important;
}

/* ==================== MULTI-SELECT SUBJECTS ==================== */
.multi-select-container {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  padding: 6px;
  min-height: 44px;
}

.multi-select-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.multi-select-tags:empty {
  margin-bottom: 0;
}

.multi-select-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.12);
  color: var(--text-primary);
  border-left: 3px solid var(--tag-color, var(--accent-indigo));
  animation: tagPop 0.2s ease;
}

@keyframes tagPop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.tag-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color var(--transition-fast);
}

.tag-remove:hover {
  color: var(--accent-rose);
}

.multi-select-container select {
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

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

/* ==================== TEMPLATE SELECTOR ==================== */
.template-selector {
  margin-bottom: 24px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(6, 182, 212, 0.04));
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-lg);
}

.template-header {
  margin-bottom: 14px;
}

.template-header h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.template-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.template-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.template-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.template-btn:hover {
  border-color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.template-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.template-icon {
  font-size: 1.3rem;
}

.template-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==================== INLINE TOPIC ADD/DELETE ==================== */
.topic-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.topic-list-header h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-add-topic {
  background: none;
  border: 1px dashed rgba(99, 102, 241, 0.3);
  color: var(--accent-indigo);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.btn-add-topic:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--accent-indigo);
}

.btn-delete-topic {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition-fast);
  padding: 2px 6px;
  border-radius: 4px;
}

.topic-item:hover .btn-delete-topic {
  opacity: 0.6;
}

.btn-delete-topic:hover {
  opacity: 1 !important;
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.08);
}

.add-topic-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  animation: fadeIn 0.2s ease;
}

.add-topic-inline.hidden {
  display: none;
}

.add-topic-input {
  flex: 1;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
}

.add-topic-input:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.btn-add-topic-submit {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-primary);
  color: white;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-add-topic-submit:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ==================== RESPONSIVE ADDITIONS ==================== */
@media (max-width: 1100px) {
  .analytics-banner {
    flex-wrap: wrap;
    gap: 16px;
  }
  .analytics-divider {
    display: none;
  }
  .analytics-streak,
  .analytics-today {
    flex: 0 0 auto;
  }
  .analytics-completion {
    flex: 1 1 100%;
  }
}

@media (max-width: 768px) {
  .analytics-banner {
    padding: 14px 16px;
    gap: 12px;
  }
  .analytics-streak-count {
    font-size: 1.5rem;
  }
  .analytics-streak-flame {
    font-size: 1.6rem;
  }
  .confidence-lights {
    flex-direction: row;
    margin-right: 4px;
  }
  .confidence-btn {
    width: 24px;
    height: 24px;
    font-size: 0.65rem;
  }
  .task-resource-row {
    display: none;
  }
  .header-right {
    flex-wrap: wrap;
  }
  .template-buttons {
    flex-direction: column;
  }
  .template-btn {
    width: 100%;
  }
}
