/* =========================================================
   DESIGN SYSTEM — Personal 90-Day Dashboard
   Inspired by Notion / Linear / Vercel / Apple system UI.
   ========================================================= */

/* ---------- Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { min-height: 100vh; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; }

/* ---------- Theme tokens ---------- */
:root,
html[data-theme="dark"] {
  --bg: #0A0B0F;
  --bg-elevated: #111319;
  --bg-card: #14161D;
  --bg-card-hover: #191C24;
  --bg-input: #1A1D26;
  --border: #23262F;
  --border-soft: #1B1E27;
  --text-primary: #F4F5F7;
  --text-secondary: #9CA0AC;
  --text-tertiary: #63676F;
  --accent: #7C9CFF;
  --accent-strong: #5B7CFF;
  --accent-soft: rgba(124, 156, 255, 0.12);
  --success: #3DDC97;
  --success-soft: rgba(61, 220, 151, 0.12);
  --warning: #FFC55C;
  --warning-soft: rgba(255, 197, 92, 0.12);
  --danger: #FF6B6B;
  --danger-soft: rgba(255, 107, 107, 0.12);
  --purple: #B18CFF;
  --purple-soft: rgba(177, 140, 255, 0.12);
  --glass-bg: rgba(20, 22, 29, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.45);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --sidebar-w: 264px;
}

html[data-theme="light"] {
  --bg: #F5F6F8;
  --bg-elevated: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F9FAFB;
  --bg-input: #F1F2F5;
  --border: #E6E8EC;
  --border-soft: #EEF0F3;
  --text-primary: #14161D;
  --text-secondary: #5A5F6B;
  --text-tertiary: #93979F;
  --accent: #4B6FEF;
  --accent-strong: #3A5CE0;
  --accent-soft: rgba(75, 111, 239, 0.10);
  --success: #17A673;
  --success-soft: rgba(23, 166, 115, 0.10);
  --warning: #B9790A;
  --warning-soft: rgba(185, 121, 10, 0.10);
  --danger: #E0453A;
  --danger-soft: rgba(224, 69, 58, 0.10);
  --purple: #7C5CE0;
  --purple-soft: rgba(124, 92, 224, 0.10);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(20, 22, 29, 0.06);
  --shadow-sm: 0 1px 2px rgba(20,22,29,0.06);
  --shadow-md: 0 8px 24px rgba(20,22,29,0.08);
  --shadow-lg: 0 16px 48px rgba(20,22,29,0.12);
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  transition: background 0.25s ease, color 0.25s ease;
}

.mono { font-family: 'JetBrains Mono', monospace; }

/* ---------- Background ambience ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px circle at 10% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(500px circle at 100% 0%, var(--purple-soft), transparent 55%);
  pointer-events: none;
}

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* =========================================================
   LAYOUT
   ========================================================= */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 22px;
}
.sidebar-brand .logo-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 14px;
  box-shadow: 0 4px 14px rgba(124,156,255,0.35);
}
.sidebar-brand .brand-text { display: flex; flex-direction: column; }
.sidebar-brand .brand-text strong { font-size: 13.5px; font-weight: 700; }
.sidebar-brand .brand-text span { font-size: 11px; color: var(--text-tertiary); }

.nav-section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 14px 12px 6px;
  font-weight: 600;
}

.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
  position: relative;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; stroke-width: 2; }
.nav-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.nav-item .nav-badge {
  margin-left: auto;
  font-size: 10.5px;
  background: var(--bg-input);
  color: var(--text-tertiary);
  padding: 1px 7px;
  border-radius: 20px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar h1 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.topbar .topbar-sub { font-size: 12.5px; color: var(--text-tertiary); }
.topbar-spacer { flex: 1; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: 12.5px;
  min-width: 220px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.topbar-search:hover { border-color: var(--border); }
.topbar-search kbd {
  margin-left: auto;
  font-size: 10.5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--text-tertiary);
}
.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}
.icon-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--border-soft); }
.icon-btn svg { width: 18px; height: 18px; }

.page-content { padding: 26px; max-width: 1400px; }
.hamburger-btn { display: none; }

/* =========================================================
   TYPOGRAPHY HELPERS
   ========================================================= */
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.page-subtitle { color: var(--text-secondary); font-size: 13.5px; margin-top: 4px; }
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.01em; }
.text-muted { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

/* =========================================================
   GRID / LAYOUT HELPERS
   ========================================================= */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }

/* =========================================================
   CARDS
   ========================================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.card.hoverable:hover { border-color: var(--border); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.card.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
}

.stat-card { display: flex; flex-direction: column; gap: 10px; }
.stat-card .stat-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.stat-card .stat-icon svg { width: 18px; height: 18px; }
.stat-card .stat-value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.stat-card .stat-label { font-size: 12.5px; color: var(--text-secondary); }
.stat-card .stat-trend { font-size: 11.5px; font-weight: 600; }

.icon-tint-accent { background: var(--accent-soft); color: var(--accent); }
.icon-tint-success { background: var(--success-soft); color: var(--success); }
.icon-tint-warning { background: var(--warning-soft); color: var(--warning); }
.icon-tint-purple { background: var(--purple-soft); color: var(--purple); }
.icon-tint-danger { background: var(--danger-soft); color: var(--danger); }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(124,156,255,0.25); }
.btn-primary:hover { background: var(--accent-strong); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-input); color: var(--text-primary); border-color: var(--border-soft); }
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--border); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-icon-only { padding: 8px; }

/* =========================================================
   FORMS
   ========================================================= */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.input, .textarea, .select {
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { resize: vertical; min-height: 90px; font-family: inherit; }
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox {
  width: 20px; height: 20px; flex-shrink: 0;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--bg-input);
}
.checkbox svg { width: 13px; height: 13px; color: #fff; opacity: 0; transform: scale(0.6); transition: all 0.15s ease; }
.checkbox.checked { background: var(--accent); border-color: var(--accent); }
.checkbox.checked svg { opacity: 1; transform: scale(1); }

/* toggle switch */
.switch { width: 42px; height: 24px; border-radius: 20px; background: var(--bg-input); border: 1px solid var(--border-soft); position: relative; cursor: pointer; transition: background 0.2s ease; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-tertiary); transition: all 0.2s ease; }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { left: 20px; background: #fff; }

/* =========================================================
   BADGES
   ========================================================= */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: var(--bg-input); color: var(--text-secondary); }

/* =========================================================
   PROGRESS
   ========================================================= */
.progress-bar { height: 8px; border-radius: 20px; background: var(--bg-input); overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--accent), var(--purple)); transition: width 0.4s ease; }
.progress-bar.thin { height: 5px; }

.circular-progress { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.circular-progress svg { transform: rotate(-90deg); }
.circular-progress .cp-track { fill: none; stroke: var(--bg-input); }
.circular-progress .cp-fill { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.circular-progress .cp-label { position: absolute; font-weight: 800; font-size: 15px; }

/* =========================================================
   TABLE-ish list rows
   ========================================================= */
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border-soft);
}
.list-row:last-child { border-bottom: none; }

/* =========================================================
   KANBAN
   ========================================================= */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.kanban-col { background: var(--bg-elevated); border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 14px; min-height: 200px; }
.kanban-col-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 0 4px; }
.kanban-col-header .dot { width: 8px; height: 8px; border-radius: 50%; }
.kanban-col-header strong { font-size: 13px; }
.kanban-col-header .count { margin-left: auto; font-size: 11.5px; color: var(--text-tertiary); background: var(--bg-input); padding: 1px 8px; border-radius: 20px; }
.kanban-list { display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.kanban-card:hover { border-color: var(--border); box-shadow: var(--shadow-sm); }
.kanban-card.dragging { opacity: 0.4; }
.kanban-card .kc-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.kanban-card .kc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kanban-col.drag-over { background: var(--accent-soft); border-color: var(--accent); }

/* =========================================================
   CALENDAR
   ========================================================= */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.calendar-weekday { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-tertiary); padding-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.calendar-day {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  min-height: 74px;
}
.calendar-day:hover { border-color: var(--accent); }
.calendar-day.empty { background: transparent; border-color: transparent; cursor: default; }
.calendar-day .cd-num { font-size: 12px; font-weight: 700; }
.calendar-day.today { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.calendar-day.completed { background: var(--success-soft); }
.calendar-day.completed .cd-num { color: var(--success); }
.calendar-day .cd-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); position: absolute; bottom: 8px; left: 8px; }

/* =========================================================
   HABIT GRID (contribution-style)
   ========================================================= */
.habit-heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 4px; overflow-x: auto; padding-bottom: 6px; }
.habit-heatmap .hm-cell { width: 13px; height: 13px; border-radius: 3px; background: var(--bg-input); }
.habit-heatmap .hm-cell[data-level="1"] { background: var(--success-soft); }
.habit-heatmap .hm-cell[data-level="2"] { background: color-mix(in srgb, var(--success) 50%, var(--bg-input)); }
.habit-heatmap .hm-cell[data-level="3"] { background: var(--success); }

.habit-row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--border-soft); }
.habit-row:last-child { border-bottom: none; }
.habit-row .habit-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.habit-row .habit-icon svg { width: 18px; height: 18px; }
.habit-streak { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }

/* =========================================================
   MODALS
   ========================================================= */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease;
  padding: 20px;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.18s ease;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border-soft); }
.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border-soft); display: flex; justify-content: flex-end; gap: 10px; }

/* =========================================================
   COMMAND PALETTE
   ========================================================= */
.cmdk-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 300; display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease;
}
.cmdk-overlay.open { opacity: 1; pointer-events: auto; }
.cmdk {
  width: 100%; max-width: 560px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.cmdk-input-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.cmdk-input-row svg { width: 17px; height: 17px; color: var(--text-tertiary); }
.cmdk-input-row input { flex: 1; background: transparent; border: none; outline: none; font-size: 14px; color: var(--text-primary); }
.cmdk-results { max-height: 340px; overflow-y: auto; padding: 8px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); }
.cmdk-item svg { width: 16px; height: 16px; }
.cmdk-item.active { background: var(--accent-soft); color: var(--accent); }
.cmdk-item .cmdk-hint { margin-left: auto; font-size: 10.5px; color: var(--text-tertiary); }

/* =========================================================
   TOASTS
   ========================================================= */
.toast-stack { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 400; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  min-width: 260px;
  animation: toast-in 0.25s ease;
}
.toast svg { width: 17px; height: 17px; flex-shrink: 0; }
.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--danger); }
.toast.info svg { color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   EMPTY STATES / LOADING
   ========================================================= */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 20px; color: var(--text-tertiary); gap: 10px; }
.empty-state svg { width: 40px; height: 40px; opacity: 0.5; }
.empty-state strong { color: var(--text-secondary); font-size: 13.5px; }
.empty-state p { font-size: 12.5px; max-width: 280px; }

.skeleton { background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 37%, var(--bg-input) 63%); background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius: 8px; }
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fade-in 0.3s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   LOGIN PAGE
   ========================================================= */
.login-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  padding: 20px;
}
.login-shell::before {
  content: "";
  position: absolute; inset: -20%;
  background:
    radial-gradient(600px circle at 20% 20%, rgba(124,156,255,0.16), transparent 55%),
    radial-gradient(500px circle at 80% 80%, rgba(177,140,255,0.14), transparent 55%);
  animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translate(0,0); } to { transform: translate(3%, -3%); } }
.login-card {
  position: relative;
  width: 100%; max-width: 380px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}
.login-logo { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, var(--accent), var(--purple)); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 19px; margin: 0 auto 18px; box-shadow: 0 8px 24px rgba(124,156,255,0.35); }
.login-title { font-size: 19px; font-weight: 800; text-align: center; letter-spacing: -0.02em; }
.login-subtitle { font-size: 13px; color: var(--text-secondary); text-align: center; margin-top: 6px; margin-bottom: 26px; }
.login-error { display: none; align-items: center; gap: 8px; background: var(--danger-soft); color: var(--danger); font-size: 12.5px; font-weight: 500; padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 14px; }
.login-error.show { display: flex; }
.login-error svg { width: 15px; height: 15px; flex-shrink: 0; }
.login-shell .btn-primary { width: 100%; padding: 11px; font-size: 13.5px; margin-top: 4px; }
.login-footnote { text-align: center; font-size: 11.5px; color: var(--text-tertiary); margin-top: 20px; }

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

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger-btn { display: flex; }
  .topbar-search { display: none; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 18px; }
  .sidebar-scrim { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 39; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
  .sidebar-scrim.show { opacity: 1; pointer-events: auto; }
}

@media (max-width: 560px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .page-content { padding: 14px; }
}
