/* ==========================================================================
   APEX 11th — Design System & Custom Styles
   Tailored for High School Executive Function & Visual Engagement
   ========================================================================== */

:root {
  /* Core Palette */
  --bg-app: #0a0d14;
  --bg-card: #121724;
  --bg-card-hover: #192033;
  --bg-glass: rgba(18, 23, 36, 0.75);
  --bg-elevated: #1e2638;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.4);

  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  /* Accent & Action Colors */
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-glow: rgba(99, 102, 241, 0.25);
  
  /* Status Colors */
  --status-urgent: #ff4757;
  --status-urgent-glow: rgba(255, 71, 87, 0.25);
  --status-warning: #ffa502;
  --status-warning-glow: rgba(255, 165, 2, 0.2);
  --status-success: #2ed573;
  --status-success-glow: rgba(46, 213, 115, 0.2);
  --status-info: #1e90ff;

  /* Course Badges */
  --color-chem: #ec4899;
  --color-calc: #3b82f6;
  --color-hist: #f59e0b;
  --color-eng: #10b981;
  --color-span: #a855f7;
  --color-cs: #06b6d4;

  /* Shadows & Glassmorphism */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
  --shadow-neon: 0 0 20px rgba(99, 102, 241, 0.35);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;

  /* Fonts */
  --font-heading: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 40%);
}

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

/* ==========================================================================
   Header & Academic Health Bar
   ========================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 1.5rem;
}

.brand-zone {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-neon);
}

.logo-icon {
  font-size: 1.35rem;
  color: #fff;
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-grade {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

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

/* Metric Chips */
.header-metrics {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.metric-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.metric-chip:hover {
  background: rgba(255, 255, 255, 0.07);
}

.metric-chip .chip-label {
  color: var(--text-muted);
}

.metric-chip strong {
  font-family: var(--font-mono);
  font-weight: 600;
}

.alert-chip {
  background: rgba(255, 71, 87, 0.12);
  border-color: rgba(255, 71, 87, 0.35);
  color: #ff7675;
  animation: pulse-alert 2.5s infinite;
}

@keyframes pulse-alert {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 71, 87, 0); }
  50% { box-shadow: 0 0 12px var(--status-urgent-glow); }
}

.focus-chip {
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.time-chip {
  border-color: rgba(6, 182, 212, 0.3);
  color: #38bdf8;
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
  filter: brightness(1.15);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-focus {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn-focus:hover {
  filter: brightness(1.12);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: #252f44;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--border-active);
  background: rgba(99, 102, 241, 0.08);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 0.8rem 1.75rem;
  font-size: 1rem;
}

.btn-xs {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.btn-xs:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   Navigation Tabs & Controls
   ========================================================================== */
.view-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: rgba(18, 23, 36, 0.5);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.84rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  color: #fff;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.select-control {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.45rem 1rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.select-control:focus {
  border-color: var(--accent-primary);
}

.select-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
}

/* ==========================================================================
   View Containers
   ========================================================================== */
.app-main {
  flex: 1;
  padding: 1.5rem 2rem 3rem;
}

.view-container {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.view-container.active-view {
  display: block;
}

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

/* ==========================================================================
   VIEW 1: KANBAN BOARD
/* ==========================================================================
   Tonight's Best Use of Time (Academic ROI & Executive Advisor)
   ========================================================================== */
.advisor-banner {
  background: linear-gradient(135deg, rgba(28, 25, 60, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.advisor-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #f59e0b, #ef4444, #8b5cf6, #06b6d4);
}

.advisor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.advisor-title-group {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.advisor-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
  flex-shrink: 0;
}

.advisor-title {
  font-family: var(--font-heading);
  font-size: 1.12rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.advisor-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.btn-advisor-plan {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 700;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.btn-advisor-plan:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.55);
}

.advisor-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.advisor-card {
  background: rgba(18, 23, 36, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.advisor-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.advisor-card.rank-1 {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, rgba(18, 23, 36, 0.95) 32%);
}

.advisor-card.rank-2 {
  border-color: rgba(6, 182, 212, 0.4);
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.08) 0%, rgba(18, 23, 36, 0.95) 32%);
}

.advisor-card.rank-3 {
  border-color: rgba(139, 92, 246, 0.4);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.08) 0%, rgba(18, 23, 36, 0.95) 32%);
}

.advisor-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.advisor-rank-badge {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-gold {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.badge-silver {
  background: rgba(6, 182, 212, 0.22);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.45);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

.badge-bronze {
  background: rgba(168, 85, 247, 0.22);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.25);
}

.advisor-roi-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.advisor-card-course {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.advisor-grade-pill {
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.grade-f {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.grade-d {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.grade-c {
  background: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.45);
}

.grade-b {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.grade-a {
  background: rgba(46, 213, 115, 0.25);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.45);
}

.advisor-task-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 0.6rem;
}

.advisor-metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.advisor-metric-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.metric-bump {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 700;
}

.metric-time {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.metric-missing {
  background: rgba(239, 68, 68, 0.22);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
  font-weight: 700;
}

.advisor-rationale {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
  margin-bottom: 0.95rem;
  flex: 1;
}

.advisor-card-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

.advisor-btn {
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, transform 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 38px;
}

.advisor-btn-focus {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}
.advisor-btn-focus:hover {
  background: rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.advisor-btn-sprint {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.35);
}
.advisor-btn-sprint:hover {
  background: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.advisor-btn-luci {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.12);
}
.advisor-btn-luci:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

/* Luci AI Evening Focus Strategy Drawer */
.advisor-ai-drawer {
  margin-top: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: slideDownFade 0.25s ease-out;
}

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

.ai-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
}

.ai-drawer-badge-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ai-drawer-badge {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: #a5b4fc;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.ai-drawer-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.ai-drawer-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem;
}

.ai-drawer-close:hover {
  color: #fff;
}

.ai-drawer-body {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.ai-loading-spinner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--accent-cyan);
  font-style: italic;
  padding: 1rem 0;
}

.ai-plan-step {
  margin-bottom: 0.85rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 8px 8px 0;
}

.ai-plan-step strong {
  color: #fff;
}

.ai-plan-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.75rem;
}

.btn-accept-plan {
  background: linear-gradient(135deg, #2ed573 0%, #10b981 100%);
  color: #0f172a;
  border: none;
  font-weight: 700;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(46, 213, 115, 0.3);
}

/* ==========================================================================
   Kanban Board Columns (6-Column Layout)
   ========================================================================== */
.kanban-columns-container {
  display: grid;
  grid-template-columns: repeat(6, minmax(240px, 1fr));
  gap: 1.25rem;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 1.5rem;
}

.kanban-col {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 600px;
  max-height: calc(100vh - 220px);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.kanban-col.col-alert {
  border-color: rgba(239, 68, 68, 0.45);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08) 0%, var(--bg-card) 24%);
}

.kanban-col.col-highlight {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.04) 0%, var(--bg-card) 20%);
}

.col-header {
  padding: 1rem 1.15rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.col-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.col-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.45rem;
}

.dot-missing { background: #ef4444; box-shadow: 0 0 10px rgba(239, 68, 68, 0.65); }
.dot-backlog { background: var(--text-muted); }
.dot-this-week { background: var(--accent-cyan); }
.dot-in-progress { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.dot-review { background: #a855f7; }
.dot-completed { background: #10b981; }

.col-alert-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.col-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  flex: 1;
}

.col-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.col-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.col-limit-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cards-list {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  flex: 1;
}

.cards-list.drag-over {
  background: rgba(99, 102, 241, 0.05);
  border-radius: var(--radius-md);
}

/* Kanban Assignment Card */
.task-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: grab;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.task-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-md);
}

.task-card.dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.course-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
}

.course-chem { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }
.course-calc { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.course-hist { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.course-eng  { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.course-span { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.course-cs   { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }

.source-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
}

.task-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.35;
}

.missing-warning-tag {
  background: rgba(255, 71, 87, 0.2);
  color: #ff6b81;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid rgba(255, 71, 87, 0.35);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.due-pill {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.due-pill.urgent-due {
  color: #ff7675;
  font-weight: 600;
}

.card-actions-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.card-btn-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.78rem;
  transition: all 0.15s;
}

.card-btn-action:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   VIEW 2: TIME BLOCKER
   ========================================================================== */
.schedule-intro-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.06));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.banner-text h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.banner-text p {
  color: var(--text-secondary);
  max-width: 650px;
}

.time-budget-summary {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.budget-stat {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.budget-stat .stat-number {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}

.budget-stat .stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.budget-stat.buffer-positive .stat-number {
  color: #10b981;
}

.time-block-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.time-slot {
  display: grid;
  grid-template-columns: 160px 1fr;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s ease;
}

.slot-time {
  background: rgba(0, 0, 0, 0.25);
  border-right: 1px solid var(--border-subtle);
  padding: 1.2rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-content {
  padding: 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.slot-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 0.25rem;
}

.slot-badge.fixed { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.slot-badge.focus { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
.slot-badge.break { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.slot-badge.family { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.slot-badge.shutdown { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; }

.slot-content h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

.slot-content p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.active-work-slot {
  border-color: rgba(99, 102, 241, 0.3);
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.04) 0%, var(--bg-card) 40%);
}

.slot-card-holder {
  margin-top: 0.65rem;
  min-height: 48px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  display: flex;
  align-items: center;
}

/* ==========================================================================
   VIEW 3: EISENHOWER MATRIX
   ========================================================================== */
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.matrix-quadrant {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 1.35rem;
  min-height: 380px;
  display: flex;
  flex-direction: column;
}

.q1-urgent-important {
  border-color: rgba(255, 71, 87, 0.3);
  background: radial-gradient(circle at top right, rgba(255, 71, 87, 0.07) 0%, var(--bg-card) 60%);
}

.q2-important-not-urgent {
  border-color: rgba(99, 102, 241, 0.3);
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.07) 0%, var(--bg-card) 60%);
}

.q3-urgent-low-impact {
  border-color: rgba(245, 158, 11, 0.3);
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.07) 0%, var(--bg-card) 60%);
}

.q4-low-impact {
  border-color: rgba(148, 163, 184, 0.2);
}

.quadrant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.q-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.q-title-wrap h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
}

.q-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.q-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.quadrant-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

/* ==========================================================================
   VIEW 4: GRADEBOOK & MISSING WORK RADAR
   ========================================================================== */
.gradebook-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.gradebook-header h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
}

.gradebook-header p {
  color: var(--text-muted);
}

.missing-alert-box {
  background: rgba(255, 71, 87, 0.12);
  border: 1px solid rgba(255, 71, 87, 0.4);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.alert-icon-wrap {
  font-size: 2rem;
}

.alert-content h4 {
  font-family: var(--font-heading);
  color: #ff7675;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.alert-content p {
  color: #cbd5e1;
  font-size: 0.84rem;
}

.courses-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.course-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.course-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.course-grade-big {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
}

.grade-a { color: #10b981; }
.grade-b { color: #3b82f6; }
.grade-c { color: #f59e0b; }
.grade-warning { color: #ef4444; }

.missing-pill-flag {
  background: rgba(255, 71, 87, 0.2);
  color: #ff6b81;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 71, 87, 0.3);
}

.upcoming-exam-banner {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   VIEW 5: SYNC & ICAL HUB
   ========================================================================== */
.sync-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.sync-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
}

.sync-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
}

.sync-card-icon {
  font-size: 1.75rem;
}

.sync-card-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input, 
.form-group textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.95rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.84rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-primary);
}

.input-with-button {
  display: flex;
  gap: 0.5rem;
}

.input-with-button input {
  flex: 1;
}

.field-hint {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.sync-status-indicator {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sync-status-indicator.success {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
}

.bookmarklet-install-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed var(--border-active);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.bookmarklet-badge {
  display: inline-block;
  margin-top: 0.85rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  cursor: grab;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.bookmarklet-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.step-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* ==========================================================================
   MODAL WINDOWS & OVERLAYS
   ========================================================================== */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 12, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.show {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

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

.modal-subtitle {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 1.5rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.modal-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* Focus Pomodoro Modal */
.modal-focus-card {
  max-width: 680px;
  background: radial-gradient(circle at top center, rgba(99, 102, 241, 0.15) 0%, var(--bg-card) 60%);
  border-color: rgba(99, 102, 241, 0.35);
}

.focus-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  gap: 1rem;
}

.focus-tag {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fbbf24;
}

.focus-title-group h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0.25rem 0;
}

.focus-title-group p {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.sound-toggle-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
}

.pomodoro-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.5rem 0 2rem;
}

.timer-circle-wrap {
  position: relative;
  width: 220px;
  height: 220px;
}

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

.timer-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 6;
}

.timer-progress {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.timer-text-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer-time {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.timer-phase {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pomodoro-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.timer-preset-btns {
  display: flex;
  gap: 0.5rem;
}

.focus-subtasks {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid var(--border-subtle);
}

.focus-subtasks h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.subtask-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.subtask-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.84rem;
  cursor: pointer;
}

.subtask-item input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 16px;
  height: 16px;
}

/* Deconstruct Chunker Modal */
.deconstruct-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chunker-icon {
  font-size: 2rem;
}

.chunk-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chunk-left {
  display: flex;
  flex-direction: column;
}

.chunk-left strong {
  font-size: 0.85rem;
}

.chunk-left span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.chunk-time-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
}

/* Sunday 30 Wizard */
.modal-wizard-card {
  max-width: 650px;
}

.wizard-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #a5b4fc;
  margin-bottom: 0.35rem;
}

.wizard-header h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
}

.wizard-header p {
  color: var(--text-muted);
  font-size: 0.84rem;
  margin-bottom: 1.5rem;
}

.wizard-steps-indicator {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.step-bubble {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.45rem 0.5rem;
  text-align: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.step-bubble.active {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.4);
}

.wizard-body {
  min-height: 220px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
}

/* Toast */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.35rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: none;
  align-items: center;
  gap: 0.65rem;
  z-index: 2000;
  animation: slideToast 0.3s ease;
}

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

/* Utility Screen-Reader Class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Server Sync Indicator */
.server-chip {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
  color: #34d399;
}

/* Touch Move Modal for iPad */
.modal-sm-card {
  max-width: 440px;
}

.touch-move-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}

.btn-touch-target {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.15rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 54px; /* Apple HIG minimum touch target */
}

.btn-touch-target:hover,
.btn-touch-target:active {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: scale(1.02);
}

.touch-text {
  display: flex;
  flex-direction: column;
}

.touch-text strong {
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

.touch-text span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Responsive & iPad Breakpoints */
@media (max-width: 1200px) {
  .kanban-columns-container {
    grid-template-columns: repeat(6, 290px);
  }
}

/* iPad Specific Optimization (768px - 1366px portrait & landscape) */
@media screen and (min-width: 768px) and (max-width: 1366px) {
  .kanban-columns-container {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding-bottom: 2rem;
  }

  .kanban-col {
    scroll-snap-align: start;
    min-width: 290px;
  }

  /* Increase button touch padding for Apple Pencil / finger */
  .btn {
    min-height: 44px;
    padding: 0.6rem 1.1rem;
  }

  .card-btn-action {
    padding: 0.4rem 0.65rem;
    font-size: 0.82rem;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
  }

  /* Keep inputs at 16px to prevent iOS Safari auto-zoom */
  input, select, textarea {
    font-size: 16px !important;
  }

  .nav-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .nav-tab {
    min-height: 44px;
    white-space: nowrap;
  }
}

@media (max-width: 900px) {
  .advisor-cards-row {
    grid-template-columns: 1fr;
  }
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }
  .header-actions {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }
  .matrix-grid, .sync-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Luci AI Engine & Study Coach Styling
   ========================================================================== */
.ai-chip {
  border-color: rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.08);
  color: #c084fc;
}
.ai-chip.online {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
}
.ai-chip.fallback {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
}

.btn-card-tutor {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}
.btn-card-tutor:hover {
  background: rgba(168, 85, 247, 0.25);
  color: #fff;
}

.luci-chat-messages {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 0;
  margin: 0.5rem 0;
}

.luci-bubble {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 88%;
}

.luci-bubble.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-left: 3px solid #a855f7;
}

.luci-bubble.user {
  align-self: flex-end;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #fff;
}

.luci-input-bar {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.luci-input-bar input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: #fff;
}

/* ==========================================================================
   Multi-User Profile Switcher (Header)
   ========================================================================== */
.user-switcher-container {
  position: relative;
  margin-left: 1rem;
}

.user-active-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  color: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-active-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-primary);
}

.user-active-btn .user-avatar {
  font-size: 1.1rem;
}

.user-active-btn .user-arrow {
  font-size: 0.7rem;
  opacity: 0.6;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  width: 240px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  z-index: 1200;
  display: none;
  flex-direction: column;
  padding: 0.4rem;
  gap: 0.25rem;
}

.user-dropdown-menu.show {
  display: flex;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.user-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.user-dropdown-item.active {
  background: rgba(139, 92, 246, 0.15);
  color: #fff;
  font-weight: 600;
}

.user-item-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.user-item-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.user-item-grade {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.25rem 0;
}

/* ==========================================================================
   Parent Flight Control & Family Radar View (Dad's Laptop)
   ========================================================================== */
.parent-radar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.parent-radar-title-zone h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0.35rem 0;
  color: #fff;
}

.parent-radar-title-zone p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 680px;
}

.radar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 9999px;
  color: #60a5fa;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.parent-radar-actions {
  display: flex;
  gap: 0.75rem;
}

.family-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.family-stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

.family-stat-card.stat-alert {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
}

.family-stat-card.stat-exams {
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.06);
}

.family-stat-card.stat-tasks {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.06);
}

.family-stat-card .stat-icon {
  font-size: 2rem;
}

.family-stat-card .stat-data {
  display: flex;
  flex-direction: column;
}

.family-stat-card .stat-data strong {
  font-size: 1.85rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.family-stat-card .stat-data span {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Tri-Son 3-Column Grid */
.tri-son-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.son-radar-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.son-radar-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
}

.son-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.son-header-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.son-header-avatar {
  font-size: 1.6rem;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
}

.son-header-text h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
}

.son-header-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.son-grade-badge {
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.son-card-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
}

/* Missing Work Section */
.radar-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.radar-missing-box {
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
}

.radar-missing-box.clean {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.85rem;
}

.radar-missing-item {
  font-size: 0.85rem;
  color: #fca5a5;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Courses mini list */
.radar-courses-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radar-course-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.radar-course-name {
  color: var(--text-primary);
  font-weight: 500;
}

.radar-course-grade {
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
}

.radar-course-grade.grade-a { color: #34d399; }
.radar-course-grade.grade-b { color: #60a5fa; }
.radar-course-grade.grade-c { color: #fbbf24; }

/* Exams list */
.radar-exams-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.radar-exam-item {
  font-size: 0.825rem;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.08);
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid #a855f7;
}

.son-card-footer {
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 1024px) {
  .tri-son-grid, .family-stats-row {
    grid-template-columns: 1fr;
  }
}



