/* ═══════════════════════════════════════════════════════════════
   RADAR — Design System v1.0
   Nothing Brand × Linear × ADHD-Optimized
   Mobile First | Mono + Sans | Premium Minimal
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&family=DM+Sans:opsz,wght@9..40,300;400;500;600;700&display=swap');

/* ─── TOKENS ──────────────────────────────────────────────── */
:root {
  /* Base */
  --bg:          #0a0a0a;
  --bg-1:        #111111;
  --bg-2:        #161616;
  --bg-3:        #1c1c1c;
  --bg-4:        #242424;
  --border:      rgba(255,255,255,0.07);
  --border-md:   rgba(255,255,255,0.12);
  --border-hi:   rgba(255,255,255,0.2);

  /* Text */
  --text:        #f0f0f0;
  --text-2:      #a0a0a0;
  --text-3:      #606060;
  --text-inv:    #0a0a0a;

  /* Accent (dynamic per workspace) */
  --accent:      #f97316;
  --accent-dim:  rgba(249,115,22,0.15);
  --accent-glow: rgba(249,115,22,0.3);

  /* Semantic */
  --success:     #22c55e;
  --warning:     #f59e0b;
  --danger:      #ef4444;
  --info:        #3b82f6;
  --muted:       #484848;

  /* Priority */
  --p-low:       #64748b;
  --p-medium:    #3b82f6;
  --p-high:      #f59e0b;
  --p-critical:  #ef4444;

  /* Status */
  --s-pending:   #606060;
  --s-today:     #f97316;
  --s-progress:  #3b82f6;
  --s-paused:    #8b5cf6;
  --s-done:      #22c55e;
  --s-cancelled: #374151;

  /* Energy */
  --e-deep:      #8b5cf6;
  --e-light:     #06b6d4;
  --e-quick:     #22c55e;
  --e-admin:     #6b7280;

  /* Radius */
  --r-xs:   4px;
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-full: 999px;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Font */
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-sans: 'DM Sans', system-ui, sans-serif;

  /* Sidebar */
  --sidebar-w: 240px;
  --header-h:  56px;

  /* Transitions */
  --t-fast:   120ms ease;
  --t-base:   200ms ease;
  --t-slow:   350ms cubic-bezier(0.4,0,0.2,1);

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-pop: 0 20px 60px rgba(0,0,0,0.7);
}

/* Light mode (optional future) */
[data-theme="light"] {
  --bg: #f8f8f8; --bg-1: #ffffff; --bg-2: #f2f2f2; --bg-3: #e8e8e8;
  --border: rgba(0,0,0,0.07); --border-md: rgba(0,0,0,0.12);
  --text: #0a0a0a; --text-2: #5a5a5a; --text-3: #999;
}

/* ─── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }
svg { display: block; }

/* ─── TYPOGRAPHY ──────────────────────────────────────────── */
.mono  { font-family: var(--font-mono); }
.sans  { font-family: var(--font-sans); }

.text-xs  { font-size: 11px; line-height: 1.4; }
.text-sm  { font-size: 13px; line-height: 1.5; }
.text-md  { font-size: 15px; line-height: 1.6; }
.text-lg  { font-size: 18px; line-height: 1.5; }
.text-xl  { font-size: 22px; line-height: 1.3; }
.text-2xl { font-size: 28px; line-height: 1.2; }
.text-3xl { font-size: 36px; line-height: 1.1; }

.text-muted   { color: var(--text-2); }
.text-faint   { color: var(--text-3); }
.text-accent  { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }

.fw-300 { font-weight: 300; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ─── LAYOUT ──────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100dvh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform var(--t-slow);
  overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }

.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 199;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base);
}
.sidebar-overlay.visible { opacity: 1; pointer-events: all; }

.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Tablet+ */
@media (min-width: 768px) {
  .sidebar { transform: translateX(0); }
  .sidebar-overlay { display: none; }
  .main-content { margin-left: var(--sidebar-w); }
}

/* Desktop */
@media (min-width: 1200px) {
  :root { --sidebar-w: 260px; }
}

/* ─── HEADER ──────────────────────────────────────────────── */
.top-bar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 100;
  gap: var(--space-3);
}

.menu-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.menu-btn:hover { background: var(--bg-3); color: var(--text); }
@media (min-width: 768px) { .menu-btn { display: none; } }

.top-bar-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text);
}

.top-bar-actions {
  margin-left: auto;
  display: flex; align-items: center; gap: var(--space-2);
}

/* ─── SIDEBAR CONTENT ─────────────────────────────────────── */
.sidebar-logo {
  padding: var(--space-5) var(--space-5) var(--space-4);
  display: flex; align-items: center; gap: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.logo-mark {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 700;
  color: #000; letter-spacing: -0.05em;
}
.logo-text {
  font-family: var(--font-mono);
  font-size: 16px; font-weight: 700;
  letter-spacing: 0.1em;
}

.sidebar-section { padding: var(--space-4) var(--space-3); }
.sidebar-label {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 var(--space-2) var(--space-2);
}

.nav-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  position: relative;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-icon { width: 16px; height: 16px; opacity: 0.7; flex-shrink: 0; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-full);
  min-width: 18px; text-align: center;
}
.nav-badge.muted { background: var(--bg-4); color: var(--text-3); }

/* Workspace pills */
.ws-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast);
  text-decoration: none;
  color: var(--text-2);
  font-size: 13px; font-weight: 500;
}
.ws-item:hover { background: var(--bg-3); color: var(--text); }
.ws-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ws-icon { font-size: 14px; flex-shrink: 0; }

/* ─── PAGE SHELL ──────────────────────────────────────────── */
.page-wrap {
  flex: 1;
  padding: var(--space-5) var(--space-4);
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .page-wrap { padding: var(--space-8) var(--space-6); }
}
@media (min-width: 1200px) {
  .page-wrap { padding: var(--space-8) var(--space-10); max-width: 1040px; }
}

.page-header {
  margin-bottom: var(--space-6);
}
.page-title {
  font-family: var(--font-mono);
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-sub {
  color: var(--text-2);
  font-size: 14px;
  margin-top: var(--space-1);
}

/* ─── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  transition: border-color var(--t-base);
}
.card:hover { border-color: var(--border-md); }
.card-sm { padding: var(--space-4); border-radius: var(--r-md); }

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
@media (min-width: 600px) {
  .card-grid-2 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .card-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .card-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

/* ─── STAT CARDS ──────────────────────────────────────────── */
.stat-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--t-base);
}
.stat-card:hover::before { opacity: 1; }
.stat-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat-label {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─── TASK CARDS ──────────────────────────────────────────── */
.task-item {
  display: flex; align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-1);
  cursor: pointer;
  transition: border-color var(--t-base), background var(--t-fast), transform var(--t-base);
  position: relative;
  overflow: hidden;
}
.task-item:hover {
  border-color: var(--border-md);
  background: var(--bg-2);
  transform: translateY(-1px);
}
.task-item.completed { opacity: 0.5; }
.task-item.completed .task-title { text-decoration: line-through; }

.task-check {
  width: 20px; height: 20px; flex-shrink: 0;
  border: 1.5px solid var(--border-hi);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-base);
  cursor: pointer;
  margin-top: 2px;
}
.task-check:hover { border-color: var(--accent); background: var(--accent-dim); }
.task-check.checked { background: var(--success); border-color: var(--success); }
.task-check.checked svg { opacity: 1; }
.task-check svg { opacity: 0; width: 10px; height: 10px; color: #fff; }

.task-body { flex: 1; min-width: 0; }
.task-title {
  font-size: 14px; font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2);
  margin-top: var(--space-2);
}

.task-priority {
  width: 3px; height: 100%;
  position: absolute; left: 0; top: 0;
  border-radius: var(--r-xs) 0 0 var(--r-xs);
}

/* ─── BADGES / PILLS ──────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11px; font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge-priority-low      { background: rgba(100,116,139,0.15); color: var(--p-low); }
.badge-priority-medium   { background: rgba(59,130,246,0.15);  color: var(--p-medium); }
.badge-priority-high     { background: rgba(245,158,11,0.15);  color: var(--p-high); }
.badge-priority-critical { background: rgba(239,68,68,0.15);   color: var(--p-critical); }

.badge-status-pending    { background: rgba(96,96,96,0.15);    color: var(--s-pending); }
.badge-status-today      { background: rgba(249,115,22,0.15);  color: var(--s-today); }
.badge-status-progress   { background: rgba(59,130,246,0.15);  color: var(--s-progress); }
.badge-status-paused     { background: rgba(139,92,246,0.15);  color: var(--s-paused); }
.badge-status-done       { background: rgba(34,197,94,0.15);   color: var(--s-done); }

.badge-energy-deep  { background: rgba(139,92,246,0.12); color: var(--e-deep); }
.badge-energy-light { background: rgba(6,182,212,0.12);  color: var(--e-light); }
.badge-energy-quick { background: rgba(34,197,94,0.12);  color: var(--e-quick); }
.badge-energy-admin { background: rgba(107,114,128,0.12);color: var(--e-admin); }

/* Deadline badges */
.deadline-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
}
.deadline-badge.overdue  { color: var(--danger); }
.deadline-badge.urgent   { color: var(--danger); animation: pulse-urgent 1s ease-in-out infinite; }
.deadline-badge.soon     { color: var(--warning); }
.deadline-badge.ok       { color: var(--text-3); }

@keyframes pulse-urgent {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ─── PROGRESS BAR ────────────────────────────────────────── */
.progress-bar {
  height: 3px;
  background: var(--bg-4);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-full);
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}
.progress-fill.success { background: var(--success); }

.progress-ring { position: relative; display: inline-flex; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring circle { transition: stroke-dashoffset 0.5s ease; }
.progress-ring-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
}

/* ─── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 0 var(--space-4);
  height: 40px;
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  font-family: var(--font-sans);
  border: none;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, white); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-3); border-color: var(--border-md); color: var(--text); }

.btn-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-sm { height: 32px; padding: 0 var(--space-3); font-size: 13px; border-radius: var(--r-sm); }
.btn-xs { height: 26px; padding: 0 var(--space-2); font-size: 11px; border-radius: var(--r-xs); }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--r-sm); }
.btn-icon.sm { width: 28px; height: 28px; }

/* ─── FORMS ───────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }
.form-label {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.form-input, .form-select, .form-textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 14px;
  padding: 10px var(--space-4);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  width: 100%;
  -webkit-appearance: none;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-3); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}
.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23606060'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

.form-error { color: var(--danger); font-size: 12px; }
.form-hint  { color: var(--text-3); font-size: 12px; }

/* Inline edit */
.inline-edit {
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 2px 6px;
  margin: -2px -6px;
  transition: all var(--t-fast);
  cursor: text;
}
.inline-edit:hover { border-color: var(--border-md); background: var(--bg-3); }
.inline-edit:focus { outline: none; border-color: var(--accent); background: var(--bg-2); }

/* ─── MODALS ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base);
}
.modal-backdrop.visible { opacity: 1; pointer-events: all; }

@media (min-width: 600px) {
  .modal-backdrop { align-items: center; padding: var(--space-5); }
}

.modal {
  background: var(--bg-1);
  border: 1px solid var(--border-md);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  padding: var(--space-6);
  transform: translateY(100%);
  transition: transform var(--t-slow);
  position: relative;
}
.modal-backdrop.visible .modal {
  transform: translateY(0);
}
@media (min-width: 600px) {
  .modal {
    max-width: 520px;
    border-radius: var(--r-xl);
    transform: scale(0.95) translateY(10px);
    box-shadow: var(--shadow-pop);
  }
  .modal-backdrop.visible .modal { transform: scale(1) translateY(0); }
}
@media (min-width: 900px) {
  .modal { max-width: 640px; }
}

.modal-handle {
  width: 40px; height: 4px;
  background: var(--bg-4);
  border-radius: var(--r-full);
  margin: 0 auto var(--space-5);
}
@media (min-width: 600px) { .modal-handle { display: none; } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-5);
}
.modal-title {
  font-family: var(--font-mono);
  font-size: 16px; font-weight: 700;
  letter-spacing: -0.01em;
}

/* ─── QUICK CAPTURE ───────────────────────────────────────── */
.capture-btn {
  position: fixed;
  bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
  right: var(--space-5);
  width: 52px; height: 52px;
  background: var(--accent);
  color: #000;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px var(--accent-glow), 0 2px 8px rgba(0,0,0,0.4);
  cursor: pointer;
  z-index: 300;
  transition: all var(--t-fast);
  font-size: 22px; font-weight: 700;
  border: none;
}
.capture-btn:hover { transform: scale(1.08); }
.capture-btn:active { transform: scale(0.95); }
@media (min-width: 768px) {
  .capture-btn { right: var(--space-8); bottom: var(--space-8); }
}

/* ─── NOTIFICATION BELL ───────────────────────────────────── */
.notif-btn {
  position: relative;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.notif-btn:hover { background: var(--bg-3); color: var(--text); }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid var(--bg);
}

/* ─── TODAY'S GREETING ────────────────────────────────────── */
.greeting {
  margin-bottom: var(--space-8);
}
.greeting-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.greeting-headline {
  font-family: var(--font-mono);
  font-size: clamp(22px, 5vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.greeting-headline .accent { color: var(--accent); }
.greeting-sub {
  margin-top: var(--space-2);
  color: var(--text-2);
  font-size: 14px;
}

/* ─── STATS ROW ───────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
@media (min-width: 600px) {
  .stats-row { grid-template-columns: repeat(4, 1fr); }
}

/* ─── SECTION HEADER ──────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-4);
}
.section-title {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex; align-items: center; gap: var(--space-2);
}
.section-title::before {
  content: '';
  width: 3px; height: 12px;
  background: var(--accent);
  border-radius: var(--r-full);
  display: block;
}

/* ─── ADHD MODE ───────────────────────────────────────────── */
.adhd-banner {
  background: linear-gradient(135deg, rgba(249,115,22,0.1), rgba(249,115,22,0.05));
  border: 1px solid rgba(249,115,22,0.2);
  border-radius: var(--r-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  display: flex; align-items: center; gap: var(--space-3);
}
.adhd-pill {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--accent);
  color: #000;
  padding: 3px 8px;
  border-radius: var(--r-full);
}

/* ─── TASK DETAIL PANEL ───────────────────────────────────── */
.task-panel {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: min(480px, 100vw);
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  z-index: 400;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--t-slow);
  padding: var(--space-6);
  padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
}
.task-panel.open { transform: translateX(0); }
.task-panel-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 399;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base);
}
.task-panel-overlay.visible { opacity: 1; pointer-events: all; }

/* ─── NOTES TIMELINE ──────────────────────────────────────── */
.note-timeline { display: flex; flex-direction: column; gap: var(--space-3); }
.note-item {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--space-3) var(--space-4);
  position: relative;
}
.note-item::before {
  content: '';
  position: absolute; left: -1px; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent-dim);
  border-radius: 2px;
}
.note-time {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--text-3);
  margin-bottom: var(--space-1);
}
.note-content { font-size: 13px; line-height: 1.6; }

/* ─── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-12) var(--space-5);
  text-align: center;
  color: var(--text-3);
  gap: var(--space-3);
}
.empty-state-icon {
  font-size: 40px;
  opacity: 0.3;
  margin-bottom: var(--space-2);
}
.empty-state-title {
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 600;
  color: var(--text-2);
}
.empty-state-sub { font-size: 13px; max-width: 260px; }

/* ─── CANVAS DRAWING ──────────────────────────────────────── */
.canvas-wrap {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  touch-action: none;
}
#idea-canvas { display: block; cursor: crosshair; }
.canvas-toolbar {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.color-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.color-swatch.active, .color-swatch:hover {
  transform: scale(1.2);
  border-color: var(--border-hi);
}
.brush-btn {
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: 11px; font-weight: 600;
  font-family: var(--font-mono);
  background: var(--bg-3);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid transparent;
}
.brush-btn.active { background: var(--accent-dim); color: var(--accent); border-color: rgba(249,115,22,0.3); }

/* ─── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ─── DIVIDER ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: var(--space-4) 0; }

/* ─── UTILITIES ───────────────────────────────────────────── */
.flex  { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.mt-auto { margin-top: auto; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.p-0 { padding: 0; }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.rounded { border-radius: var(--r-md); }
.opacity-50 { opacity: 0.5; }

/* ─── TOASTS ──────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex; flex-direction: column-reverse; gap: var(--space-2);
  pointer-events: none;
}
@media (min-width: 768px) {
  .toast-container {
    bottom: var(--space-6);
    right: var(--space-6);
    left: auto;
    transform: none;
  }
}
.toast {
  background: var(--bg-3);
  border: 1px solid var(--border-md);
  border-radius: var(--r-md);
  padding: var(--space-3) var(--space-4);
  font-size: 13px; font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: var(--space-3);
  animation: toast-in 0.3s cubic-bezier(0.4,0,0.2,1) forwards;
  pointer-events: all;
  min-width: 240px; max-width: 360px;
  white-space: nowrap;
}
.toast.success .toast-dot { background: var(--success); }
.toast.error   .toast-dot { background: var(--danger); }
.toast.info    .toast-dot { background: var(--info); }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── TABS ────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 2px;
  background: var(--bg-2);
  padding: 4px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.tab {
  flex: 1; text-align: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
}
.tab.active {
  background: var(--bg-4);
  color: var(--text);
}

/* ─── FILTER BAR ──────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-full);
  background: var(--bg-2);
  border: 1px solid var(--border);
  font-size: 12px; font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
}
.filter-chip:hover { border-color: var(--border-md); color: var(--text); }
.filter-chip.active {
  background: var(--accent-dim);
  border-color: rgba(249,115,22,0.3);
  color: var(--accent);
}

/* ─── AUTH PAGES ──────────────────────────────────────────── */
.auth-page {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-5);
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--space-8);
}
.auth-logo {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-8);
}
.auth-title {
  font-family: var(--font-mono);
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
}
.auth-sub { color: var(--text-2); font-size: 14px; margin-bottom: var(--space-6); }

/* ─── LOADER ──────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--bg-4);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── SCAN LINE (Nothing Brand detail) ────────────────────── */
.logo-mark::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.2);
  animation: scanline 4s linear infinite;
}
@keyframes scanline {
  0%   { top: 0; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ─── ANIMATED PULSE ──────────────────────────────────────── */
.pulse {
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ─── SAFE AREA ───────────────────────────────────────────── */
.safe-bottom {
  padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
}

/* ════════════════════════════════════════════════════════
   RADAR — Calendar additions
   Pega esto al final de public/assets/css/app.css
════════════════════════════════════════════════════════ */

/* Mobile: ocultar sidebar del calendario en pantallas pequeñas */
@media (max-width: 900px) {
  .cal-wrap            { grid-template-columns: 1fr !important; }
  .cal-sidebar         { display: none !important; }
  .cal-day             { min-height: 60px !important; }
  .cal-event-chip      { display: none; }
  .cal-more-chip       { display: block; font-size: 8px; }
}

/* Toast types por si no están en app.css */
.toast-success { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.3); color: #86efac; }
.toast-error   { background: rgba(239,68,68,0.15);  border-color: rgba(239,68,68,0.3);  color: #fca5a5; }
.toast-info    { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.3); color: #93c5fd; }

/* Selected color swatch */
input[type="radio"]:checked + div.color-swatch {
  border-color: #fff !important;
  transform: scale(1.15);
}