/* ============================================
   StudyFlow — Premium Design System
   ============================================ */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Brand */
  --brand-50:  #EEF2FF;
  --brand-100: #E0E7FF;
  --brand-200: #C7D2FE;
  --brand-400: #818CF8;
  --brand-500: #6366F1;
  --brand-600: #4F46E5;
  --brand-700: #4338CA;
  --brand-800: #3730A3;
  --brand-900: #312E81;

  /* Accent */
  --accent-400: #34D399;
  --accent-500: #10B981;
  --accent-600: #059669;

  /* Amber */
  --amber-400: #FBBF24;
  --amber-500: #F59E0B;
  --amber-600: #D97706;

  /* Red */
  --red-400: #F87171;
  --red-500: #EF4444;
  --red-600: #DC2626;

  /* Light theme */
  --bg-base:       #F8F9FE;
  --bg-surface:    #FFFFFF;
  --bg-elevated:   #FFFFFF;
  --bg-subtle:     #F1F3FB;
  --bg-muted:      #E8EAEF;

  --text-primary:  #0F0E1A;
  --text-secondary:#4B5268;
  --text-muted:    #8B92A5;
  --text-inverse:  #FFFFFF;

  --border-soft:   rgba(79, 70, 229, 0.08);
  --border-medium: rgba(79, 70, 229, 0.15);
  --border-strong: rgba(79, 70, 229, 0.25);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.10);

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-2xl: 28px;

  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.32s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-w: 260px;
  --topbar-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root { --theme: dark; }
}

[data-theme="dark"],
.dark {
  --bg-base:       #0C0B14;
  --bg-surface:    #131220;
  --bg-elevated:   #1B1930;
  --bg-subtle:     #1F1D2E;
  --bg-muted:      #282640;

  --text-primary:  #F0EFFF;
  --text-secondary:#9B97C4;
  --text-muted:    #5C5880;

  --border-soft:   rgba(129, 140, 248, 0.06);
  --border-medium: rgba(129, 140, 248, 0.12);
  --border-strong: rgba(129, 140, 248, 0.22);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.5);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.6);
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

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

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-logo {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.sidebar-logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.sidebar-logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 12px 6px;
}

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

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

.nav-item.active {
  background: var(--brand-50);
  color: var(--brand-600);
  font-weight: 600;
}

.dark .nav-item.active {
  background: rgba(99,102,241,0.12);
  color: var(--brand-400);
}

.nav-item .nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--red-500);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border-soft);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}

.user-card:hover { background: var(--bg-subtle); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 11px; color: var(--text-muted); }

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

.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-body {
  padding: 32px;
  flex: 1;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.card-body { padding: 20px 24px; }

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- Metric Cards ---- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.metric-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.metric-card.brand::before { background: linear-gradient(90deg, var(--brand-500), var(--brand-400)); }
.metric-card.success::before { background: linear-gradient(90deg, var(--accent-500), var(--accent-400)); }
.metric-card.warning::before { background: linear-gradient(90deg, var(--amber-500), var(--amber-400)); }
.metric-card.danger::before { background: linear-gradient(90deg, var(--red-500), var(--red-400)); }

.metric-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-primary);
  line-height: 1;
}

.metric-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--brand-600);
  color: white;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.btn-primary:hover {
  background: var(--brand-700);
  box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
  background: var(--bg-muted);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--red-500);
  color: white;
}

.btn-danger:hover { background: var(--red-600); }

.btn-success {
  background: var(--accent-500);
  color: white;
}

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

.btn-lg {
  padding: 13px 28px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

/* ---- Forms ---- */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.1px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  transition: all var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.form-control:hover { border-color: var(--border-strong); }
.form-control:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* ---- Range Slider ---- */
.range-group { display: flex; align-items: center; gap: 12px; }

input[type=range] {
  -webkit-appearance: none;
  flex: 1;
  height: 4px;
  background: var(--bg-muted);
  border-radius: 2px;
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--brand-500);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(99,102,241,0.35);
  transition: all var(--transition);
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(99,102,241,0.45);
}

.range-value {
  min-width: 32px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-600);
}

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

.badge-brand { background: var(--brand-50); color: var(--brand-700); }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-muted { background: var(--bg-muted); color: var(--text-secondary); }

.dark .badge-success { background: rgba(16,185,129,0.15); color: var(--accent-400); }
.dark .badge-warning { background: rgba(245,158,11,0.15); color: var(--amber-400); }
.dark .badge-danger { background: rgba(239,68,68,0.15); color: var(--red-400); }

/* ---- Wizard ---- */
.wizard-container {
  max-width: 720px;
  margin: 0 auto;
}

.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 36px;
  gap: 0;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  position: relative;
}

.wizard-step:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border-soft);
  margin: 0 4px;
  transition: background var(--transition-slow);
}

.wizard-step.completed::after { background: var(--brand-500); }

.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--transition-slow);
  border: 2px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-muted);
}

.wizard-step.active .step-circle {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: white;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.15);
}

.wizard-step.completed .step-circle {
  background: var(--accent-500);
  border-color: var(--accent-500);
  color: white;
}

.step-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.wizard-step.active .step-label { color: var(--brand-600); font-weight: 600; }
.wizard-step.completed .step-label { color: var(--accent-600); }

.wizard-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  box-shadow: var(--shadow-md);
}

.wizard-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.wizard-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ---- Subject Row (wizard) ---- */
.subject-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  transition: all var(--transition);
}

.subject-row:hover { border-color: var(--border-medium); background: var(--bg-muted); }

.subject-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.subject-sliders {
  display: flex;
  gap: 20px;
  flex: 2;
}

.slider-group { flex: 1; }

.slider-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ---- Calendar ---- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
}

.cal-day {
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  min-height: 80px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  transition: all var(--transition);
  cursor: default;
  position: relative;
}

.cal-day:hover { border-color: var(--border-medium); background: var(--bg-subtle); }

.cal-day-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}

.cal-day.today .cal-day-num {
  color: var(--brand-600);
}

.cal-day.today::after {
  content: '';
  position: absolute;
  top: 4px; right: 4px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand-500);
}

.study-block-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity var(--transition);
}

.study-block-pill:hover { opacity: 0.8; }

.study-block-pill.completed { background: #D1FAE5; color: #065F46; }
.study-block-pill.pending { background: var(--brand-50); color: var(--brand-700); }
.study-block-pill.missed { background: #FEE2E2; color: #991B1B; }
.study-block-pill.partial { background: #FEF3C7; color: #92400E; }

.exam-marker {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--red-500);
  color: white;
  display: block;
  margin-bottom: 2px;
}

/* ---- Progress ---- */
.progress-bar-wrap {
  background: var(--bg-muted);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar.brand { background: linear-gradient(90deg, var(--brand-500), var(--brand-400)); }
.progress-bar.success { background: linear-gradient(90deg, var(--accent-500), var(--accent-400)); }
.progress-bar.warning { background: linear-gradient(90deg, var(--amber-500), var(--amber-400)); }
.progress-bar.danger { background: linear(90deg, var(--red-500), var(--red-400)); }

/* ---- Today's blocks ---- */
.block-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: all var(--transition);
}

.block-item:hover {
  border-color: var(--border-medium);
  background: var(--bg-muted);
}

.block-subject-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.block-info { flex: 1; }
.block-subject { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.block-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.block-actions {
  display: flex;
  gap: 6px;
}

/* ---- Status indicator ---- */
.feasibility-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
}

.feasibility-indicator.success {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.feasibility-indicator.warning {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.feasibility-indicator.danger {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.dark .feasibility-indicator.success {
  background: rgba(16,185,129,0.1);
  color: var(--accent-400);
  border-color: rgba(16,185,129,0.2);
}

/* ---- Notifications ---- */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 200;
  overflow: hidden;
}

.notif-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: background var(--transition);
}

.notif-item:hover { background: var(--bg-subtle); }
.notif-item:last-child { border-bottom: none; }

/* ---- Table ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-soft);
}

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

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

.data-table tr:hover td { background: var(--bg-subtle); }

/* ---- Login page ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}

.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  padding: 40px;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
}

/* ---- Coach message ---- */
.coach-bubble {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.dark .coach-bubble {
  background: rgba(99,102,241,0.08);
  border-color: rgba(99,102,241,0.15);
}

.coach-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.coach-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-danger { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-info { background: var(--brand-50); color: var(--brand-800); border: 1px solid var(--brand-100); }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }

/* ---- Planning card ---- */
.planning-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

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

.planning-card-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.planning-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ---- Subject color dots ---- */
.subject-colors {
  --c1: #6366F1; --c2: #10B981; --c3: #F59E0B; --c4: #EF4444;
  --c5: #8B5CF6; --c6: #06B6D4; --c7: #EC4899; --c8: #84CC16;
  --c9: #F97316; --c10: #14B8A6; --c11: #6366F1; --c12: #A855F7;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-body { padding: 20px 16px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .wizard-steps { display: none; }
  .wizard-card { padding: 24px 20px; }
}

/* ---- Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.anim-fadeup { animation: fadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both; }
.anim-fadein { animation: fadeIn 0.3s ease both; }

.anim-delay-1 { animation-delay: 0.05s; }
.anim-delay-2 { animation-delay: 0.10s; }
.anim-delay-3 { animation-delay: 0.15s; }
.anim-delay-4 { animation-delay: 0.20s; }

/* ---- Utility ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
