/* ═══════════════════════════════════════════
   LIFE ORGANIZER — styles.css
   Variables, utilidades, layout shell
   ═══════════════════════════════════════════ */

/* ── CSS Variables / Themes ── */
:root {
  --primary:       #6366f1;
  --primary-soft:  #818cf8;
  --accent:        #a78bfa;
  --accent-soft:   #c4b5fd;
  --bg:            #f8f8fc;
  --bg-card:       rgba(255,255,255,0.82);
  --bg-glass:      rgba(255,255,255,0.55);
  --surface:       #ffffff;
  --surface2:      #f1f1f8;
  --border:        rgba(99,102,241,0.13);
  --border-soft:   rgba(0,0,0,0.07);
  --text:          #18181b;
  --text-muted:    #71717a;
  --text-soft:     #a1a1aa;
  --shadow-color:  99,102,241;
  --neon-glow:     0 0 24px rgba(99,102,241,0.18), 0 2px 8px rgba(0,0,0,0.07);
  --card-shadow:   0 4px 24px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.05);
  --sidebar-w:     248px;
  --header-h:      58px;
  --radius:        14px;
  --radius-sm:     9px;
  --radius-lg:     20px;
  --transition:    0.22s cubic-bezier(0.4,0,0.2,1);
}

/* Ocean */
[data-theme="ocean"] {
  --primary:       #0ea5e9;
  --primary-soft:  #38bdf8;
  --accent:        #06b6d4;
  --accent-soft:   #67e8f9;
  --bg:            #f0f9ff;
  --bg-card:       rgba(255,255,255,0.80);
  --bg-glass:      rgba(240,249,255,0.60);
  --surface2:      #e0f2fe;
  --border:        rgba(14,165,233,0.14);
  --shadow-color:  14,165,233;
  --neon-glow:     0 0 24px rgba(14,165,233,0.2), 0 2px 8px rgba(0,0,0,0.07);
}

/* Sunset */
[data-theme="sunset"] {
  --primary:       #f97316;
  --primary-soft:  #fb923c;
  --accent:        #ec4899;
  --accent-soft:   #f472b6;
  --bg:            #fff7ed;
  --bg-card:       rgba(255,255,255,0.82);
  --bg-glass:      rgba(255,247,237,0.65);
  --surface2:      #fed7aa;
  --border:        rgba(249,115,22,0.14);
  --shadow-color:  249,115,22;
  --neon-glow:     0 0 24px rgba(249,115,22,0.18), 0 2px 8px rgba(0,0,0,0.07);
}

/* Monochrome */
[data-theme="mono"] {
  --primary:       #27272a;
  --primary-soft:  #52525b;
  --accent:        #3f3f46;
  --accent-soft:   #71717a;
  --bg:            #fafafa;
  --bg-card:       rgba(255,255,255,0.88);
  --bg-glass:      rgba(250,250,250,0.70);
  --surface2:      #f4f4f5;
  --border:        rgba(0,0,0,0.10);
  --shadow-color:  39,39,42;
  --neon-glow:     0 0 20px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
}

/* Dark (default) */
.dark {
  --primary:       #818cf8;
  --primary-soft:  #6366f1;
  --accent:        #a78bfa;
  --accent-soft:   #7c3aed;
  --bg:            #0f0f14;
  --bg-card:       rgba(22,22,32,0.85);
  --bg-glass:      rgba(22,22,32,0.60);
  --surface:       #16161f;
  --surface2:      #1e1e2a;
  --border:        rgba(129,140,248,0.12);
  --border-soft:   rgba(255,255,255,0.06);
  --text:          #e4e4ef;
  --text-muted:    #8b8ba8;
  --text-soft:     #5c5c78;
  --neon-glow:     0 0 32px rgba(99,102,241,0.22), 0 2px 12px rgba(0,0,0,0.35);
  --card-shadow:   0 4px 28px rgba(0,0,0,0.35), 0 1px 4px rgba(0,0,0,0.2);
}
.dark[data-theme="ocean"] {
  --primary:       #38bdf8;
  --primary-soft:  #0ea5e9;
  --accent:        #22d3ee;
  --bg:            #0a1628;
  --surface:       #0f1e35;
  --surface2:      #162440;
  --border:        rgba(56,189,248,0.12);
  --neon-glow:     0 0 32px rgba(14,165,233,0.25), 0 2px 12px rgba(0,0,0,0.35);
}
.dark[data-theme="sunset"] {
  --primary:       #fb923c;
  --primary-soft:  #f97316;
  --accent:        #f472b6;
  --bg:            #180d05;
  --surface:       #231208;
  --surface2:      #2e1a0e;
  --border:        rgba(251,146,60,0.12);
  --neon-glow:     0 0 32px rgba(249,115,22,0.22), 0 2px 12px rgba(0,0,0,0.35);
}
.dark[data-theme="mono"] {
  --primary:       #a1a1aa;
  --primary-soft:  #71717a;
  --accent:        #d4d4d8;
  --bg:            #09090b;
  --surface:       #111113;
  --surface2:      #18181b;
  --border:        rgba(255,255,255,0.08);
  --neon-glow:     0 0 20px rgba(255,255,255,0.06), 0 2px 12px rgba(0,0,0,0.5);
}

/* ── Global Reset / Base ── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%; margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Selection */
::selection { background: var(--primary); color: #fff; }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ══════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════ */

.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--border);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--neon-glow); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(var(--shadow-color),0.3);
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(var(--shadow-color),0.4); }
.btn-primary:active { transform: translateY(0); opacity: 1; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); border-color: var(--primary); }

.icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface2); color: var(--primary); }
.icon-btn svg { width: 18px; height: 18px; }

.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--surface2);
  color: var(--text-muted);
}
.badge-primary { background: rgba(var(--shadow-color),0.15); color: var(--primary); }

.divider { height: 1px; background: var(--border-soft); margin: 16px 0; }

.color-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.prog-bar-wrap { height: 5px; background: var(--surface2); border-radius: 99px; overflow: hidden; }
.prog-bar { height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }

kbd {
  display: inline-flex; align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* ══════════════════════════════
   ANIMATIONS
   ══════════════════════════════ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

.anim-fade-up  { animation: fadeUp 0.32s cubic-bezier(0.4,0,0.2,1) both; }
.anim-fade-in  { animation: fadeIn 0.25s ease both; }
.anim-scale-in { animation: scaleIn 0.28s cubic-bezier(0.4,0,0.2,1) both; }
.anim-slide-r  { animation: slideRight 0.28s cubic-bezier(0.4,0,0.2,1) both; }

.stagger-1 { animation-delay: 0.04s; }
.stagger-2 { animation-delay: 0.08s; }
.stagger-3 { animation-delay: 0.13s; }
.stagger-4 { animation-delay: 0.18s; }
.stagger-5 { animation-delay: 0.23s; }

/* ══════════════════════════════
   LAYOUT SHELL
   ══════════════════════════════ */

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header */
#header {
  height: var(--header-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  position: relative;
}

/* Body row */
#body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* Main scroll area */
#main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  min-width: 0;
}

#main:has(#page-dashboard.active) {
  overflow: hidden;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
}

#main:not(:has(#page-dashboard.active)) {
  overflow-y: auto;
  display: block;
  padding: 24px;
}

/* Footer */
#footer {
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-soft);
  font-size: 11px;
  color: var(--text-soft);
  gap: 12px;
}

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100%;
  background: var(--bg-card);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--transition), opacity var(--transition);
  position: relative;
  z-index: 50;
}
#sidebar.collapsed { width: 56px; }
#sidebar.mobile-hidden { width: 0; opacity: 0; pointer-events: none; }

.sidebar-footer {
  flex-shrink: 0;
  background: var(--bg-card);
}

.sidebar-header {
  height: var(--header-h);
  display: flex; align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-soft);
  gap: 8px;
  flex-shrink: 0;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 9px;
  flex: 1; min-width: 0; overflow: hidden;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 14px 12px 5px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}
#sidebar.collapsed .nav-section-title { opacity: 0; height: 0; padding: 4px 0; }

.nav-items-wrap { padding: 4px 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  font-size: 13.5px;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  position: relative;
}
.nav-item:hover  { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(var(--shadow-color),0.12); color: var(--primary); }
.nav-item svg    { width: 18px; height: 18px; flex-shrink: 0; }

.nav-label { transition: opacity var(--transition), width var(--transition); }
#sidebar.collapsed .nav-label  { opacity: 0; width: 0; }
#sidebar.collapsed .nav-item   { padding: 9px 0; justify-content: center; }

/* Active dot when collapsed */
#sidebar.collapsed .nav-item.active::after {
  content: '';
  width: 4px; height: 4px;
  background: var(--primary);
  border-radius: 50%;
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
}

/* Tooltip on collapsed sidebar */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: var(--card-shadow);
  z-index: 400;
}
#sidebar.collapsed [data-tip]:hover::after { opacity: 1; }

/* Mobile overlay */
#sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 49;
  backdrop-filter: blur(2px);
}
#sidebar-overlay.visible { display: block; animation: fadeIn 0.2s ease both; }

/* ── Header elements ── */
.logo {
  display: flex; align-items: center; gap: 9px;
  cursor: pointer; user-select: none; flex-shrink: 0;
  text-decoration: none; color: var(--text);
}
.logo-mark {
  width: 30px; height: 30px;
  background: var(--primary);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(var(--shadow-color),0.35);
}
.logo-mark svg { width: 17px; height: 17px; color: #fff; }
.logo-text { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.logo-text span { color: var(--primary); }

.search-wrap { flex: 1; max-width: 380px; position: relative; }
.search-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 7px 12px 7px 34px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.search-input::placeholder { color: var(--text-soft); }
.search-input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(var(--shadow-color),0.12);
}
.search-icon {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft); pointer-events: none;
}
.search-icon svg { width: 15px; height: 15px; }

#search-results {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  z-index: 200;
  overflow: hidden;
  display: none;
}
#search-results.visible { display: block; animation: scaleIn 0.18s ease both; }
.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition);
  font-size: 13px;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface2); }
.search-result-icon {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.dark-toggle {
  width: 42px; height: 24px;
  background: var(--surface2);
  border-radius: 99px;
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}
.dark-toggle.on { background: var(--primary); border-color: transparent; }
.dark-toggle::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.dark-toggle.on::after { transform: translateX(18px); }

/* Dropdown */
.dropdown {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  z-index: 300;
  overflow: hidden;
  min-width: 180px;
  animation: scaleIn 0.18s cubic-bezier(0.4,0,0.2,1) both;
  transform-origin: top right;
}
.dropdown-item {
  padding: 9px 14px;
  cursor: pointer;
  display: flex; align-items: center; gap: 9px;
  font-size: 13px;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  border: none; background: transparent; width: 100%; text-align: left;
  font-family: inherit;
}
.dropdown-item:hover  { background: var(--surface2); color: var(--text); }
.dropdown-item.active { color: var(--primary); }
.dropdown-sep { height: 1px; background: var(--border-soft); margin: 4px 0; }
.theme-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }

/* ══════════════════════════════
   PAGES
   ══════════════════════════════ */

.page { display: none; }
.page.active { display: block; animation: fadeUp 0.3s cubic-bezier(0.4,0,0.2,1) both; }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 12px;
}
.section-title   { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.section-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px;
  padding: 56px 24px;
  color: var(--text-soft);
  text-align: center;
}
.empty-state svg { width: 40px; height: 40px; opacity: 0.35; }
.empty-state p { font-size: 14px; max-width: 240px; line-height: 1.5; }

/* ── Dashboard ── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.greeting     { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.greeting span { color: var(--primary); }
.greeting-sub { font-size: 13.5px; color: var(--text-muted); margin-top: 3px; }

.stat-card   { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.stat-label  { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-soft); }
.stat-value  { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; color: var(--text); line-height: 1; }
.stat-sub    { font-size: 12px; color: var(--text-muted); }
.stat-icon   { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-icon svg { width: 18px; height: 18px; }

/* ══════════════════════════════
   MODALS
   ══════════════════════════════ */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease both;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,0.35);
  width: 100%;
  max-width: 480px;
  animation: scaleIn 0.22s cubic-bezier(0.4,0,0.2,1) both;
  overflow: hidden;
}
.modal-header {
  padding: 18px 20px 14px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
}
.modal-title  { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.modal-body   { padding: 18px 20px; }
.modal-footer {
  padding: 12px 20px; border-top: 1px solid var(--border-soft);
  display: flex; gap: 8px; justify-content: flex-end;
}

.field-label  { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; display: block; letter-spacing: 0.02em; }
.field-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--shadow-color),0.12);
}
.field-input::placeholder { color: var(--text-soft); }

/* ── Quick-add type buttons ── */
.quick-type-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--shadow-color),0.08);
}

/* ══════════════════════════════
   FAB
   ══════════════════════════════ */

#fab {
  position: fixed;
  bottom: 44px; right: 24px;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(var(--shadow-color),0.45);
  transition: transform var(--transition), box-shadow var(--transition);
  z-index: 200;
}
#fab:hover { transform: scale(1.1) rotate(45deg); box-shadow: 0 6px 28px rgba(var(--shadow-color),0.6); }
#fab svg { width: 22px; height: 22px; }

/* ══════════════════════════════
   TOAST
   ══════════════════════════════ */

#toast-wrap {
  position: fixed;
  bottom: 48px; left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 13px; font-weight: 500;
  color: var(--text);
  box-shadow: var(--card-shadow);
  animation: fadeUp 0.25s ease both;
  display: flex; align-items: center; gap: 8px;
  max-width: 320px;
}
.toast.success { border-color: #22c55e; color: #22c55e; }
.toast.error   { border-color: #ef4444; color: #ef4444; }
.toast.leaving { animation: fadeIn 0.25s ease reverse both; }

/* ══════════════════════════════
   SETTINGS PAGE
   ══════════════════════════════ */

.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 4px 20px;
  margin-bottom: 16px;
}
.settings-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text-soft);
  padding: 14px 0 10px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-soft);
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: 13.5px; font-weight: 500; color: var(--text); }
.settings-desc  { font-size: 12px; color: var(--text-soft); margin-top: 1px; }

.theme-card {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-soft);
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface2);
}
.theme-card.active { border-color: var(--primary); }
.theme-card:hover  { transform: translateY(-2px); border-color: var(--primary); }
.theme-preview {
  height: 32px; border-radius: 7px;
  display: flex; overflow: hidden;
}
.theme-preview-swatch { flex: 1; }
.theme-name { font-size: 12px; font-weight: 600; color: var(--text-muted); }

.font-opt {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer; font-size: 13px; color: var(--text-muted);
  background: var(--surface2);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  font-family: inherit;
}
.font-opt.active {
  border-color: var(--primary); color: var(--primary);
  background: rgba(var(--shadow-color),0.08);
}

/* ══════════════════════════════
   RESPONSIVE
   ══════════════════════════════ */

@media (max-width: 768px) {
  #sidebar { position: fixed; left: 0; top: 0; height: 100%; z-index: 50; }
  #sidebar:not(.mobile-hidden) { width: var(--sidebar-w) !important; opacity: 1 !important; }
  #main { padding: 16px; }
  .dash-grid { grid-template-columns: 1fr; }
  #dash-lower { grid-template-columns: 1fr !important; }
}

/* ══════════════════════════════════════════════
   DASHBOARD — Etapa 2
   ══════════════════════════════════════════════ */

/* ── Greeting row ── */
.dash-greeting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.dash-greeting-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dash-greeting-actions .btn-ghost {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  padding: 6px 12px;
}
.dash-greeting-actions .btn-ghost svg {
  width: 14px; height: 14px; flex-shrink: 0;
}

/* ── Stat cards row ── */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  min-height: 120px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { transform: translateY(-2px); }
.stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.stat-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}
.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 16px; height: 16px; }

/* ── Main grid ── */
.dash-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: start;
}
.dash-col-left,
.dash-col-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Generic widget ── */
.dash-widget {
  padding: 0;
  overflow: hidden;
}
.dash-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-soft);
}
.dash-widget-icon {
  display: flex;
  align-items: center;
  color: var(--primary);
}
.dash-widget-icon svg { width: 16px; height: 16px; }
.dash-widget-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.dash-widget-action {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  padding: 0;
  transition: opacity var(--transition);
}
.dash-widget-action:hover { opacity: 0.7; }
.dash-widget-action svg { width: 13px; height: 13px; }

/* Warn variant */
.dash-widget-warn {
  border-color: rgba(239,68,68,0.2);
}
.dash-widget-warn .dash-widget-header {
  background: rgba(239,68,68,0.04);
  border-bottom-color: rgba(239,68,68,0.12);
}
.dash-widget-warn .dash-widget-icon { color: #ef4444; }
.dash-widget-warn .dash-widget-title { color: #ef4444; }

/* ── Widget empty ── */
.widget-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  color: var(--text-soft);
  font-size: 13px;
}

/* ── Agenda ── */
.agenda-list { padding: 4px 0 8px; }
.agenda-item {
  display: grid;
  grid-template-columns: 52px 22px 1fr 4px;
  align-items: start;
  gap: 0;
  padding: 8px 12px 8px 14px;
  transition: background var(--transition);
  position: relative;
}
.agenda-item:hover { background: var(--surface2); }
.agenda-past { opacity: 0.5; }
.agenda-current { background: rgba(var(--shadow-color), 0.05); }
.agenda-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 10px;
  padding-top: 2px;
  gap: 1px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
}
.agenda-dot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 5px;
  gap: 0;
}
.agenda-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px currentColor;
  z-index: 1;
}
.agenda-line {
  flex: 1;
  width: 2px;
  background: var(--border-soft);
  min-height: 20px;
  margin-top: 3px;
}
.agenda-body {
  padding: 0 0 10px 10px;
}
.agenda-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.agenda-title.line-through { text-decoration: line-through; }
.agenda-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 3px;
}
.agenda-meta svg { width: 11px; height: 11px; flex-shrink: 0; }
.agenda-color-bar {
  width: 4px;
  height: 100%;
  border-radius: 0 2px 2px 0;
  position: absolute;
  right: 0; top: 0; bottom: 0;
  opacity: 0.7;
}

/* ── Task list ── */
.task-list { padding: 4px 0; }
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition);
}
.task-item:last-child { border-bottom: none; }
.task-item:hover { background: var(--surface2); }
.task-item:hover .task-actions { opacity: 1; }

.task-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--transition), background var(--transition);
  color: var(--text-soft);
  font-size: 11px;
}
.task-check:hover { border-color: var(--primary); }
.task-check-prog { border-color: #f59e0b; background: #f59e0b18; color: #f59e0b; }
.task-check-warn { border-color: #ef4444; background: #ef444418; }

.task-body { flex: 1; min-width: 0; }
.task-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 3px;
}
.task-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--transition);
  flex-shrink: 0;
}
.task-actions .icon-btn svg { width: 14px; height: 14px; }

/* ── Inline add ── */
.dash-inline-add {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dash-inline-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.dash-inline-input::placeholder { color: var(--text-soft); }
.dash-inline-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--shadow-color), 0.12);
}

/* ── Upcoming events ── */
.upcoming-list { padding: 4px 0; }
.upcoming-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background var(--transition);
}
.upcoming-item:last-child { border-bottom: none; }
.upcoming-item:hover { background: var(--surface2); }

.upcoming-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 36px;
  flex-shrink: 0;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 4px 2px;
  border: 1px solid var(--border-soft);
}
.upcoming-today {
  background: rgba(var(--shadow-color), 0.12);
  border-color: var(--primary);
}
.upcoming-day   { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; color: var(--text); }
.upcoming-month { font-size: 9px;  font-weight: 700; letter-spacing: 0.05em;  text-transform: uppercase; color: var(--text-soft); }
.upcoming-today .upcoming-day   { color: var(--primary); }
.upcoming-today .upcoming-month { color: var(--primary); }

.upcoming-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.upcoming-body { flex: 1; min-width: 0; }
.upcoming-title {
  font-size: 13px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.upcoming-meta { font-size: 11px; color: var(--text-soft); margin-top: 1px; }

/* ── Pinned notes grid ── */
.pinned-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 14px;
}
.pinned-card {
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  border: 1px solid var(--border-soft);
  transition: transform var(--transition), box-shadow var(--transition);
}
.pinned-card:hover { transform: translateY(-2px); box-shadow: var(--neon-glow); }
.pinned-title {
  font-size: 12.5px; font-weight: 700;
  color: var(--text); margin-bottom: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pinned-body {
  font-size: 11.5px;
  color: var(--text-muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.5;
}

/* ── Activity list ── */
.activity-list { padding: 4px 0; }
.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition);
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--surface2); }
.activity-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.activity-icon svg { width: 13px; height: 13px; }
.activity-body { flex: 1; min-width: 0; font-size: 12.5px; }
.activity-title {
  color: var(--text); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.activity-action { color: var(--text-soft); font-size: 11px; }
.activity-time { font-size: 11px; color: var(--text-soft); flex-shrink: 0; font-family: 'DM Mono', monospace; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .dash-main-grid { grid-template-columns: 1fr; }
  .dash-col-right { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}
@media (max-width: 860px) {
  .dash-stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .dash-stats-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dash-col-right { grid-template-columns: 1fr; }
  .dash-greeting-actions { display: none; }
  .pinned-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   SIDEBAR COLLAPSIBLE SECTIONS — Etapa 9
   ══════════════════════════════════════════════ */

.nav-section { border-bottom: 1px solid var(--border-soft); }

/* Row wrapping the navigate button + expand chevron */
.nav-section-header-row {
  display: flex;
  align-items: stretch;
}

.nav-section-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-align: left;
}
.nav-section-toggle:hover { background: var(--surface2); color: var(--text); }
.nav-section-toggle.active { color: var(--primary); background: rgba(var(--shadow-color), 0.06); }

/* Dashboard: direct button takes full row */
.nav-section-direct {
  width: 100%;
}

.nav-section-icon { display:flex; align-items:center; flex-shrink:0; }
.nav-section-icon svg { width:16px; height:16px; }
.nav-section-label { flex:1; }

/* Chevron expand button — separate from the label */
.nav-section-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  flex-shrink: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-soft);
  transition: background var(--transition), color var(--transition);
  border-left: 1px solid var(--border-soft);
}
.nav-section-expand-btn:hover { background: var(--surface2); color: var(--primary); }
.nav-section-expand-btn svg {
  transition: transform var(--transition);
}
.nav-section-expand-btn.expanded svg { transform: rotate(0deg); }
.nav-section-expand-btn:not(.expanded) svg { transform: rotate(-90deg); }

.nav-section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1);
}
.nav-section-body.open { max-height: 600px; }

/* Sub items inside sections */
.nav-sub-item {
  padding: 6px 12px 6px 30px !important;
  font-size: 12.5px !important;
  font-weight: 400 !important;
}
.nav-sub-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-soft);
  flex-shrink: 0;
  margin-right: 2px;
}
.nav-sub-item.active .nav-sub-dot { background: var(--primary); }

.nav-sub-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 3px 30px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.nav-icon-action {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  border: none; background: transparent; cursor: pointer;
  border-radius: 4px; color: var(--text-soft);
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
  opacity: 0;
}
.nav-sidebar-item:hover .nav-icon-action,
.nav-sub-section-label .nav-icon-action { opacity: 1; }
.nav-sub-section-label .nav-icon-action { opacity: 0.7; }
.nav-icon-edit:hover { background: var(--surface2); color: var(--primary); }
.nav-icon-del:hover  { background: #fee2e2; color: #ef4444; }

/* Sidebar list items */
.nav-sidebar-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px 5px 30px;
  transition: background var(--transition);
}
.nav-sidebar-item:hover { background: var(--surface2); }
.nav-sidebar-dot {
  width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0;
}
.nav-sidebar-name {
  flex: 1; font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-muted);
}
.nav-sidebar-count {
  font-size: 10px;
  color: var(--text-soft);
  flex-shrink: 0;
  min-width: 14px;
  text-align: right;
}
.nav-sidebar-nogroup { opacity: 0.5; }

/* Collapsed sidebar */
#sidebar.collapsed .nav-section-body { max-height: 0 !important; }
#sidebar.collapsed .nav-section-label { opacity: 0; width: 0; }
#sidebar.collapsed .nav-section-expand-btn { display: none; }
#sidebar.collapsed .nav-section-toggle { padding: 9px 0; justify-content: center; }
#sidebar.collapsed .nav-section-direct { padding: 9px 0; justify-content: center; }

/* ══════════════════════════════════════════════
   DASHBOARD 3-COLUMN LAYOUT — Etapa 9
   ══════════════════════════════════════════════ */

/* Top section: compact greeting + stats */
.dash-top {
  flex-shrink: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 12px;
}
.dash-top .dash-greeting-row { margin-bottom: 12px; }
.dash-top .dash-stats-row {
  grid-template-columns: repeat(4,1fr);
  gap: 10px;
  margin-bottom: 0;
}
.dash-top .stat-card {
  min-height: 90px;
  padding: 12px 14px 10px;
  gap: 4px;
}
.dash-top .stat-value { font-size: 24px; }

/* Make page-dashboard flex column so bottom fills remaining height */
#page-dashboard.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* Bottom: 3 equal columns each with independent scroll */
.dash-bottom-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.dash-bottom-col {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 0;
}

.dash-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  background: var(--surface2);
}
.dash-col-sub-header {
  display: flex;
  align-items: center;
  padding: 7px 12px;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  background: var(--surface2);
}
.dash-col-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dash-col-title svg { width: 13px; height: 13px; color: var(--primary); }

.dash-col-scroll-inner {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 0;
}
.dash-col-scroll-inner::-webkit-scrollbar { width: 3px; }

/* Mini calendar in dashboard */
.dash-mini-cal-wrap {
  flex-shrink: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.dash-mini-cal-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
}
.dash-mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dash-mini-dow {
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  color: var(--text-soft);
  padding: 2px 0;
  letter-spacing: 0.04em;
}
.dash-mini-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 3px 1px;
  border-radius: 4px;
  cursor: default;
  transition: background var(--transition);
}
.dash-mini-day span:first-child {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1;
}
.dash-mini-day.is-today { background: var(--primary); }
.dash-mini-day.is-today span:first-child { color: #fff; font-weight: 700; }
.dash-mini-day.is-other span:first-child { opacity: 0.3; }
.dash-mini-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--primary);
}
.dash-mini-day.is-today .dash-mini-dot { background: rgba(255,255,255,0.7); }

/* Compact upcoming events */
.dash-upcoming-compact {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background var(--transition);
}
.dash-upcoming-compact:last-child { border-bottom: none; }
.dash-upcoming-compact:hover { background: var(--surface2); }
.dash-upcoming-dot {
  width: 6px; height: 6px;
  border-radius: 50%; flex-shrink: 0;
  margin-top: 5px;
}
.dash-upcoming-body { flex: 1; min-width: 0; }
.dash-upcoming-title {
  font-size: 12.5px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dash-upcoming-meta {
  font-size: 10.5px; color: var(--text-soft); margin-top: 1px;
}

/* Notes in dashboard column */
.dash-note-card {
  margin: 5px 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
}
.dash-note-card:hover { box-shadow: var(--neon-glow); transform: translateX(2px); }
.dash-note-title {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 3px;
}
.dash-note-preview {
  font-size: 11px; color: var(--text-muted); line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.dash-note-tags { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 4px; }

/* Tasks in dashboard column */
.dash-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition);
}
.dash-task-row:last-child { border-bottom: none; }
.dash-task-row:hover { background: var(--surface2); }
.dash-task-overdue { border-left: 2px solid #ef4444; }
.dash-task-body { flex: 1; min-width: 0; }
.dash-task-title {
  font-size: 12.5px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dash-task-meta {
  display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-top: 2px;
}

/* Empty state for columns */
.dash-col-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px;
  padding: 32px 16px;
  color: var(--text-soft); text-align: center;
  font-size: 12px;
}

/* Responsive */
@media (max-width: 1100px) {
  .dash-bottom-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .dash-bottom-grid { grid-template-columns: 1fr; }
  #page-dashboard { height: auto; overflow: visible; }
  .dash-bottom-col { min-height: 300px; max-height: 50vh; }
}
@media (max-width: 860px) {
  .dash-top .dash-stats-row { grid-template-columns: 1fr 1fr; }
}
   ══════════════════════════════════════════════ */

/* ── Toolbar ── */
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.cal-toolbar-left  { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.cal-toolbar-right { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.cal-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 6px;
  white-space: nowrap;
}

/* Filter buttons */
.cal-filter-row   { display:flex; gap:6px; flex-wrap:wrap; }
.cal-filter-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), opacity var(--transition);
  font-family: inherit;
}
.cal-filter-btn.active { border-color: var(--cal-color, var(--primary)); background: color-mix(in srgb, var(--cal-color, var(--primary)) 12%, transparent); color: var(--text); }
.cal-filter-btn:not(.active) { opacity: 0.55; }
.cal-filter-dot  { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.cal-filter-name { white-space:nowrap; }

/* View tabs */
.cal-view-tabs { display:flex; border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; }
.cal-view-tab {
  padding: 5px 12px;
  font-size: 12.5px; font-weight: 500;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); font-family: inherit;
  transition: background var(--transition), color var(--transition);
  border-right: 1px solid var(--border);
}
.cal-view-tab:last-child { border-right: none; }
.cal-view-tab:hover  { background: var(--surface2); color: var(--text); }
.cal-view-tab.active { background: var(--primary); color: #fff; }

/* Container */
.cal-view-container { position: relative; }

/* ── Vista Mes ── */
.cal-month { display:flex; flex-direction:column; border:1px solid var(--border-soft); border-radius:var(--radius); overflow:hidden; background:var(--bg-card); }

.cal-month-header {
  display: grid; grid-template-columns: repeat(7,1fr);
  background: var(--surface2);
  border-bottom: 1px solid var(--border-soft);
}
.cal-month-dow {
  padding: 8px 0;
  text-align: center;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-soft);
}

.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  grid-auto-rows: minmax(96px, auto);
}

.cal-day {
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 4px;
  min-height: 96px;
  background: var(--surface);
  transition: background var(--transition);
  position: relative;
}
.cal-day:nth-child(7n) { border-right:none; }
.cal-day:hover { background: var(--surface2); }
.cal-day.cal-day-other { opacity: 0.45; }
.cal-day.cal-day-today { background: rgba(var(--shadow-color),0.04); }

.cal-day-num {
  font-size: 12.5px; font-weight: 700;
  color: var(--text-muted);
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
}
.cal-day-num:hover { background: var(--primary); color: #fff; }
.cal-day-today .cal-day-num {
  background: var(--primary); color: #fff;
}

.cal-day-events { display:flex; flex-direction:column; gap:2px; }

.cal-event-chip {
  display: flex; align-items: center; gap: 3px;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 11px; font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}
.cal-event-chip:hover { opacity: 0.85; transform: translateX(1px); }
.cal-chip-task { border-style: dashed !important; }
.chip-time { font-size: 9px; opacity: .7; font-family:'DM Mono',monospace; flex-shrink:0; }
.chip-title { overflow:hidden; text-overflow:ellipsis; }

.cal-more {
  font-size: 11px; color: var(--text-soft);
  padding: 1px 5px; cursor: pointer;
  border-radius: 4px;
  transition: background var(--transition);
}
.cal-more:hover { background: var(--surface2); color: var(--text); }

/* ── Vista Semana / Día ── */
.cal-week, .cal-day-view { display:flex; flex-direction:column; border:1px solid var(--border-soft); border-radius:var(--radius); overflow:hidden; background:var(--bg-card); }

.cal-week-header, .cal-day-view > .cal-week-header {
  display: grid;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface2);
  position: sticky; top: 0; z-index: 5;
}
.cal-week > .cal-week-header { grid-template-columns: 56px repeat(7,1fr); }
.cal-day-view > .cal-week-header { grid-template-columns: 56px 1fr; }

.cal-week-gutter { border-right:1px solid var(--border-soft); }

.cal-week-day-hdr {
  display: flex; flex-direction:column; align-items:center;
  padding: 8px 4px;
  border-right: 1px solid var(--border-soft);
  gap: 2px;
}
.cal-week-day-hdr:last-child { border-right:none; }
.cal-week-today-hdr { background: rgba(var(--shadow-color),0.07); }

.cal-week-dow { font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--text-soft); }
.cal-week-num { font-size:18px; font-weight:800; color:var(--text-muted); line-height:1; }
.cal-week-num-today {
  width:32px; height:32px; border-radius:50%;
  background:var(--primary); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-size:15px;
}

.cal-week-body {
  display: grid;
  grid-template-columns: 56px repeat(7,1fr);
  overflow-y: auto;
  max-height: calc(100vh - 280px);
}
.cal-week-body::-webkit-scrollbar { width:4px; }

.cal-week-hours { border-right:1px solid var(--border-soft); }
.cal-hour-label {
  height: 56px;
  display: flex; align-items: flex-start;
  justify-content: flex-end;
  padding: 4px 8px 0;
  font-size: 10px; font-weight: 600;
  color: var(--text-soft);
  font-family: 'DM Mono', monospace;
  border-bottom: 1px solid var(--border-soft);
}

.cal-week-col {
  position: relative;
  border-right: 1px solid var(--border-soft);
  min-height: calc(17*56px);
}
.cal-week-col:last-child { border-right:none; }
/* Hour lines */
.cal-week-col::before {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    to bottom, transparent, transparent 55px,
    var(--border-soft) 55px, var(--border-soft) 56px
  );
  pointer-events: none;
}

.cal-week-allday, .cal-allday-task {
  font-size: 11px; font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 2px 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}
.cal-allday-task { border-style: dashed; }

.cal-week-event {
  position: absolute;
  left: 3px; right: 3px;
  border-radius: 6px;
  padding: 4px 7px;
  display: flex; flex-direction: column; gap: 1px;
  cursor: pointer;
  overflow: hidden;
  transition: opacity var(--transition), box-shadow var(--transition);
  z-index: 2;
  user-select: none;
}
.cal-week-event:hover { opacity: 0.88; box-shadow: 0 2px 8px rgba(0,0,0,.15); }

.cal-now-line {
  position: absolute; left: 0; right: 0;
  height: 2px; background: #ef4444;
  z-index: 10; border-radius: 1px;
}
.cal-now-line::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  position: absolute; left: -4px; top: -3px;
}

.cal-day-allday {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; flex-wrap:wrap; gap: 4px;
  background: var(--surface2);
}

/* ── Vista Agenda ── */
.cal-agenda { display:flex; flex-direction:column; gap:0; }

.cal-agenda-group { margin-bottom: 0; }

.cal-agenda-date {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px 6px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-soft);
  position: sticky; top: 0; z-index: 2;
  background: var(--bg);
}
.cal-agenda-today { color: var(--primary); }

.cal-agenda-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  background: var(--bg-card);
  transition: background var(--transition);
}
.cal-agenda-item:hover { background: var(--surface2); }
.cal-agenda-item:hover .cal-agenda-actions { opacity: 1; }
.cal-agenda-task { opacity: 0.75; }

.cal-agenda-time {
  display: flex; flex-direction:column; align-items:flex-end;
  width: 52px; flex-shrink: 0;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  gap: 2px;
}
.cal-agenda-endtime { font-size:10px; opacity:.6; }

.cal-agenda-color-bar {
  width: 4px; min-height: 36px;
  border-radius: 2px; flex-shrink: 0;
}

.cal-agenda-body { flex:1; min-width:0; }
.cal-agenda-title { font-size:13.5px; font-weight:500; color:var(--text); }
.cal-agenda-meta {
  display: flex; align-items:center; gap:4px;
  font-size: 11px; color: var(--text-soft); margin-top:2px;
}
.cal-agenda-meta svg { flex-shrink:0; }

.cal-agenda-actions {
  display: flex; gap:2px;
  opacity: 0;
  transition: opacity var(--transition);
  flex-shrink: 0;
}

/* ── Color swatches del modal ── */
.cal-color-sw {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}
.cal-color-sw:hover { transform: scale(1.2); }
.cal-color-sw.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor;
}

/* Responsive */
@media (max-width: 768px) {
  .cal-toolbar { flex-direction:column; align-items:flex-start; }
  .cal-toolbar-right { flex-wrap:wrap; }
  .cal-month-grid { grid-auto-rows: minmax(64px,auto); }
  .cal-day { min-height:64px; }
  .cal-week-body { max-height:60vh; }
  .cal-filter-name { display:none; }
}

/* ══════════════════════════════════════════════
   NOTAS — Etapa 4
   ══════════════════════════════════════════════ */

/* ── Toolbar ── */
.notes-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.notes-toolbar-left  { display:flex; align-items:center; gap:8px; }
.notes-toolbar-right { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

.notes-search-wrap  { position:relative; }
.notes-search-icon  { position:absolute; left:9px; top:50%; transform:translateY(-50%); color:var(--text-soft); display:flex; }
.notes-search-input {
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 6px 10px 6px 30px;
  font-family: inherit; font-size: 13px; color: var(--text);
  outline: none; width: 200px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.notes-search-input:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(var(--shadow-color),.1); }
.notes-search-input::placeholder { color:var(--text-soft); }

/* Note tag dot (small indicator left of title in cards) */
.note-tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* Tags bar */
.notes-tags-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.notes-tags-label { font-size:11px; color:var(--text-soft); display:flex; align-items:center; gap:4px; }
.notes-tag-btn {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px; font-weight: 500;
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  cursor: pointer; font-family: inherit;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.notes-tag-btn:hover  { background:var(--surface); color:var(--text); }
.notes-tag-btn.active { background:rgba(var(--shadow-color),.12); color:var(--primary); border-color:var(--primary); }

/* Section labels */
.notes-section-label {
  display: flex; align-items:center; gap:6px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.notes-section-label svg { opacity:.6; }

/* ── Grid ── */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 4px;
}

/* Note card */
.note-card {
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  box-shadow: var(--card-shadow);
  position: relative;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.note-card:hover { box-shadow: var(--neon-glow); transform: translateY(-2px); }
.note-card:hover .note-card-actions { opacity:1; }
.note-card:hover .note-color-dots   { opacity:1; }

.note-card-actions {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap:2px;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 2;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  padding: 2px;
  border: 1px solid var(--border-soft);
}
.note-action-btn { width:26px; height:26px; color:var(--text-muted); }
.note-action-btn:hover { color:var(--primary); }
.note-action-del:hover { color:#ef4444 !important; }
.note-pinned { color:var(--primary) !important; }

/* Color dots row (bottom of card) */
.note-color-dots {
  display: flex; gap:4px;
  padding: 6px 12px;
  opacity: 0;
  transition: opacity var(--transition);
  border-top: 1px solid var(--border-soft);
  background: rgba(0,0,0,.03);
}
.note-color-dot-btn {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.note-color-dot-btn:hover { transform:scale(1.3); }
.note-color-dot-btn.active { border-color: var(--text); }

.note-card-inner { padding: 14px; flex:1; }

.note-card-title {
  font-size: 13.5px; font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  overflow: hidden; display:-webkit-box;
  -webkit-line-clamp:2; -webkit-box-orient:vertical;
}
.note-card-preview {
  font-size: 12px; color: var(--text-muted);
  line-height: 1.5; margin-bottom: 8px;
  overflow: hidden; display:-webkit-box;
  -webkit-line-clamp:4; -webkit-box-orient:vertical;
}
.note-card-tags   { display:flex; gap:4px; flex-wrap:wrap; margin-bottom:8px; }
.note-card-date   { font-size:10px; color:var(--text-soft); }

/* ── Lista ── */
.notes-list { display:flex; flex-direction:column; gap:0; border-radius:var(--radius); overflow:hidden; border:1px solid var(--border-soft); }

.note-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition);
  cursor: pointer;
}
.note-list-item:last-child { border-bottom:none; }
.note-list-item:hover { filter:brightness(.97); }
.note-list-item:hover .note-list-actions { opacity:1; }

.note-list-body { flex:1; min-width:0; }
.note-list-header {
  display: flex; align-items:center; gap:6px;
  flex-wrap: wrap; margin-bottom:3px;
}
.note-list-title {
  font-size: 13.5px; font-weight: 600; color:var(--text);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  flex:1; min-width:0;
}
.note-list-date  { font-size:11px; color:var(--text-soft); white-space:nowrap; }
.note-list-preview { font-size:12px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.note-list-actions {
  display: flex; gap:2px;
  opacity: 0;
  transition: opacity var(--transition);
  flex-shrink: 0;
}

/* ── Daily note ── */
.notes-daily-wrap { max-width: 720px; margin: 0 auto; }
.notes-daily-header {
  display: flex; align-items:flex-start; justify-content:space-between;
  margin-bottom: 16px;
}
.notes-daily-editor {
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 400px;
  display: flex; flex-direction:column;
}
.notes-daily-title-row { padding:16px 20px 0; }
.notes-daily-title-input {
  width:100%; border:none; outline:none;
  font-size:22px; font-weight:800; letter-spacing:-0.02em;
  background:transparent; font-family:inherit; color:var(--text);
}
.notes-daily-empty {
  flex:1; display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  padding:48px; text-align:center;
}

/* ── Rich editor ── */
.notes-rich-editor {
  flex: 1;
  padding: 16px 20px;
  outline: none;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text);
  min-height: 200px;
}
.notes-rich-editor h2 { font-size:1.4em; font-weight:700; margin:.6em 0 .3em; }
.notes-rich-editor h3 { font-size:1.15em; font-weight:600; margin:.5em 0 .25em; }
.notes-rich-editor p  { margin:.25em 0; }
.notes-rich-editor ul, .notes-rich-editor ol { padding-left:1.4em; margin:.4em 0; }
.notes-rich-editor li { margin:.2em 0; }
.notes-rich-editor a  { color:var(--primary); text-decoration:underline; }
.notes-rich-editor:empty::before {
  content: attr(placeholder);
  color: var(--text-soft);
  pointer-events: none;
}

/* Rich toolbar */
.rich-toolbar {
  display: flex; align-items:center; gap:2px;
  padding: 6px 12px;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface2);
  flex-wrap: wrap;
}
.rich-btn {
  width: 28px; height: 28px;
  display:flex; align-items:center; justify-content:center;
  border:none; background:transparent;
  border-radius: 6px;
  font-size: 12.5px; font-weight:700;
  color: var(--text-muted);
  cursor: pointer; font-family:inherit;
  transition: background var(--transition), color var(--transition);
}
.rich-btn:hover { background:var(--surface); color:var(--text); }
.rich-sep { width:1px; height:18px; background:var(--border); margin:0 3px; flex-shrink:0; }

/* ── Editor modal (full-screen style) ── */
.notes-editor-box {
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px rgba(0,0,0,.3);
  display: flex; flex-direction:column;
  overflow: hidden;
  animation: scaleIn .22s cubic-bezier(.4,0,.2,1) both;
}

.notes-editor-header {
  display: flex; align-items:center; justify-content:space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.notes-editor-header-left { display:flex; align-items:center; gap:6px; }
.notes-editor-header-right { display:flex; align-items:center; gap:4px; }

.ned-color-row { display:flex; gap:5px; }

.ned-title-input {
  width:100%; border:none; outline:none; padding:14px 20px 8px;
  font-size:20px; font-weight:800; letter-spacing:-0.02em;
  background:transparent; font-family:inherit; color:var(--text);
  flex-shrink: 0;
}
.ned-title-input::placeholder { color:var(--text-soft); }

.ned-tags-row {
  display: flex; align-items:center; gap:6px; flex-wrap:wrap;
  padding: 4px 20px 10px; flex-shrink:0;
}
.ned-tag {
  display:inline-flex; align-items:center; gap:4px;
  background:rgba(var(--shadow-color),.1);
  color:var(--primary);
  border-radius:99px; padding:2px 8px;
  font-size:12px; font-weight:500;
}
.ned-tag button {
  border:none; background:none; color:inherit; cursor:pointer;
  font-size:14px; line-height:1; padding:0; margin-left:2px;
  opacity:.6;
}
.ned-tag button:hover { opacity:1; }
.ned-tag-input {
  border:none; outline:none; background:transparent;
  font-size:12.5px; color:var(--text); font-family:inherit;
  min-width:140px;
}
.ned-tag-input::placeholder { color:var(--text-soft); }

.ned-editor-area {
  flex:1; overflow-y:auto;
  min-height: 200px;
}

.ned-footer {
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 20px;
  border-top:1px solid var(--border-soft);
  flex-shrink:0;
}

/* Opacity helper */
.opacity-60 { opacity:.6; }

/* Responsive */
@media (max-width: 768px) {
  .notes-grid { grid-template-columns: 1fr 1fr; }
  .notes-toolbar { flex-direction:column; align-items:flex-start; }
  .notes-editor-box { max-height:100vh; border-radius:0; }
}
@media (max-width: 480px) {
  .notes-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   TO-DO — Etapa 5
   ══════════════════════════════════════════════ */

/* ── Layout principal ── */
.todo-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: start;
  min-height: calc(100vh - var(--header-h) - 32px - 48px);
}

/* ── Sidebar proyectos ── */
.todo-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 8px;
  position: sticky;
  top: 0;
  align-self: stretch;
}

.todo-sidebar-header {
  display: flex; align-items:center; justify-content:space-between;
  padding: 6px 8px 8px;
}

.todo-sidebar-sep { height:1px; background:var(--border-soft); margin:6px 4px; }

.todo-proj-item {
  display: flex; align-items:center; gap:8px;
  width: 100%; padding:7px 8px;
  border-radius:var(--radius-sm);
  border:none; background:transparent;
  font-family:inherit; font-size:13px;
  color:var(--text-muted); cursor:pointer; text-align:left;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.todo-proj-item:hover { background:var(--surface2); color:var(--text); }
.todo-proj-item.active { background:rgba(var(--shadow-color),.1); color:var(--primary); }
.todo-proj-item:hover .todo-proj-del { opacity:1; }

.todo-proj-dot  { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.todo-proj-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.todo-proj-del {
  width:18px; height:18px;
  display:flex; align-items:center; justify-content:center;
  border:none; background:transparent; cursor:pointer;
  color:#ef4444; border-radius:4px; opacity:0;
  transition: opacity var(--transition), background var(--transition);
  flex-shrink:0;
}
.todo-proj-del:hover { background:#fee2e2; }

.todo-proj-prog {
  height: 3px; margin: 1px 8px 4px 24px;
  background: var(--surface2); border-radius:99px; overflow:hidden;
}
.todo-proj-prog div { height:100%; border-radius:99px; transition:width .5s ease; }

.todo-filter-item { color:var(--text-muted); }
.todo-status-disabled { opacity: 0.35; pointer-events: none; }

/* ── Main ── */
.todo-main { display:flex; flex-direction:column; gap:14px; min-width:0; }

.todo-header {
  display: flex; align-items:center; justify-content:space-between;
  gap:12px; flex-wrap:wrap;
}
.todo-header-left  { display:flex; align-items:center; gap:8px; }
.todo-header-right { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

.todo-proj-color-pill { width:4px; height:22px; border-radius:2px; flex-shrink:0; }
.todo-global-prog { display:flex; align-items:center; gap:8px; }

/* ── Quick add ── */
.todo-quick-add {
  display: flex; align-items:center; gap:8px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 8px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.todo-quick-add:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--shadow-color),.1);
}
.todo-quick-check {
  width: 18px; height:18px;
  border-radius:50%; border:2px solid var(--border);
  flex-shrink:0;
}
.todo-quick-input {
  flex:1; border:none; outline:none; background:transparent;
  font-family:inherit; font-size:13.5px; color:var(--text);
}
.todo-quick-input::placeholder { color:var(--text-soft); }

/* ── Lista de tareas ── */
.todo-list { display:flex; flex-direction:column; gap:0; }

.todo-group-header {
  display: flex; align-items:center; justify-content:space-between;
  padding: 10px 14px 6px;
  font-size: 11px; font-weight:700;
  letter-spacing:.06em; text-transform:uppercase;
  color: var(--text-soft);
  position: sticky; top:0; z-index:2;
  background: var(--bg);
}
.todo-group-done { color:var(--text-soft); opacity:.7; }

.todo-row {
  display: flex; align-items:flex-start; gap:10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-top:none;
  transition: background var(--transition), box-shadow var(--transition);
  position:relative;
}
.todo-row:first-of-type { border-top:1px solid var(--border-soft); border-radius:var(--radius) var(--radius) 0 0; }
.todo-row:last-of-type  { border-radius:0 0 var(--radius) var(--radius); }
.todo-row:only-of-type  { border-radius:var(--radius); border-top:1px solid var(--border-soft); }
.todo-row:hover { background:var(--surface2); }
.todo-row:hover .todo-row-actions { opacity:1; }
.todo-row:hover .todo-drag-handle { opacity:1; }

.todo-row-done    { opacity:.6; }
.todo-row-overdue { border-left:3px solid #ef4444; }

.todo-drag-handle {
  color:var(--text-soft); cursor:grab; flex-shrink:0;
  margin-top:3px; opacity:0;
  transition:opacity var(--transition);
}
.todo-drag-handle:active { cursor:grabbing; }

/* Checkbox estado */
.todo-check {
  width:20px; height:20px; border-radius:50%;
  border:2px solid var(--border);
  background:transparent; cursor:pointer; flex-shrink:0;
  margin-top:2px;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; color:transparent;
  transition:border-color var(--transition), background var(--transition), color var(--transition);
  font-family:inherit;
}
.todo-check:hover { border-color:var(--primary); }
.todo-check-pending { border-color:var(--border); }
.todo-check-done    { background:var(--primary); border-color:var(--primary); color:#fff; }

.todo-row-body { flex:1; min-width:0; }
.todo-row-top { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:2px; }
.todo-row-title {
  font-size:13.5px; font-weight:500; color:var(--text);
  overflow:hidden; text-overflow:ellipsis;
}
.todo-title-done { text-decoration:line-through; color:var(--text-muted); }
.todo-row-desc { font-size:12px; color:var(--text-muted); margin-bottom:4px; }
.todo-row-meta { display:flex; align-items:center; gap:5px; flex-wrap:wrap; margin-top:4px; }

.todo-meta-chip {
  display:inline-flex; align-items:center; gap:3px;
  padding:2px 7px; border-radius:99px;
  font-size:11px; font-weight:500;
  background:var(--surface2); color:var(--text-muted);
  border:1px solid var(--border-soft);
}
.todo-meta-chip svg { flex-shrink:0; }
.todo-chip-today   { background:#dbeafe; color:#1d4ed8; border-color:#bfdbfe; }
.todo-chip-overdue { background:#fee2e2; color:#ef4444; border-color:#fecaca; }
.todo-sub-chip { cursor:pointer; }
.todo-sub-chip:hover { border-color:var(--primary); color:var(--primary); }
.todo-sub-fold { display:inline-flex; transition:transform .2s; }
.todo-sub-fold.expanded { transform:rotate(90deg); }

.todo-row-actions {
  display:flex; gap:2px; flex-shrink:0;
  opacity:0; transition:opacity var(--transition);
}
.todo-action-btn { width:26px; height:26px; }

/* ── Subtareas ── */
.todo-subtasks {
  margin-top:8px; padding:8px 10px;
  background:var(--surface2); border-radius:var(--radius-sm);
  display:flex; flex-direction:column; gap:4px;
}
.todo-subtask {
  display:flex; align-items:center; gap:8px;
  font-size:13px; color:var(--text);
}
.todo-sub-check {
  width:16px; height:16px; border-radius:50%;
  border:2px solid var(--border);
  background:transparent; cursor:pointer; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  color:transparent; transition:all var(--transition);
  font-family:inherit;
}
.todo-sub-check.done { background:var(--primary); border-color:var(--primary); color:#fff; }
.todo-sub-check:hover { border-color:var(--primary); }

.todo-subtask-add { margin-top:4px; }
.todo-sub-input {
  width:100%; border:none; outline:none; background:transparent;
  font-size:12.5px; font-family:inherit; color:var(--text);
  padding:2px 0;
}
.todo-sub-input::placeholder { color:var(--text-soft); }

/* ── Kanban ── */
.todo-kanban {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 14px;
  align-items: start;
}

.kanban-col {
  background: var(--surface2);
  border-radius: var(--radius);
  overflow:hidden;
  border:1px solid var(--border-soft);
  min-height:300px;
  display:flex; flex-direction:column;
}
.kanban-col-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 12px;
  background:var(--bg-card);
  border-bottom:1px solid var(--border-soft);
  flex-shrink:0;
}
.kanban-col-title { font-size:13px; font-weight:700; color:var(--text); }

.kanban-col-body {
  flex:1; padding:8px; display:flex; flex-direction:column; gap:8px;
  min-height:120px;
}

.kanban-empty {
  flex:1; display:flex; align-items:center; justify-content:center;
  padding:24px;
}

.kanban-card {
  background:var(--bg-card);
  border:1px solid var(--border-soft);
  border-radius:var(--radius-sm);
  padding:12px;
  cursor:grab; user-select:none;
  transition:box-shadow var(--transition), transform var(--transition);
}
.kanban-card:hover { box-shadow:var(--neon-glow); transform:translateY(-1px); }
.kanban-card:hover .kanban-card-actions { opacity:1; }
.kanban-card:active { cursor:grabbing; }
.kanban-card-overdue { border-left:3px solid #ef4444; }

.kanban-card-top { display:flex; align-items:flex-start; gap:6px; margin-bottom:4px; }
.kanban-card-title { font-size:13px; font-weight:500; color:var(--text); flex:1; line-height:1.4; }
.kanban-card-actions { display:flex; gap:2px; opacity:0; transition:opacity var(--transition); flex-shrink:0; }
.kanban-card-desc { font-size:11.5px; color:var(--text-muted); margin-bottom:6px; line-height:1.4; }
.kanban-card-meta { display:flex; gap:4px; flex-wrap:wrap; margin-bottom:4px; }
.kanban-prog { display:flex; align-items:center; gap:6px; margin-top:6px; }

/* Modal subtask row */
.tm-subtask-row {
  display:flex; align-items:center; gap:8px;
  padding:4px 0;
  border-bottom:1px solid var(--border-soft);
}
.tm-subtask-row:last-child { border-bottom:none; }

/* Responsive */
@media (max-width:900px) {
  .todo-layout { grid-template-columns:1fr; }
  .todo-sidebar { position:static; }
  .todo-kanban  { grid-template-columns:1fr; }
}
@media (max-width:640px) {
  .todo-header  { flex-direction:column; align-items:flex-start; }
  .todo-quick-add .field-input { display:none; }
}

/* ══════════════════════════════════════════════
   SEARCH PANEL — Etapa 6
   ══════════════════════════════════════════════ */

#search-panel {
  position: fixed; inset: 0;
  z-index: 800;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
}
#search-panel.visible {
  opacity: 1;
  pointer-events: all;
}

.sp-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sp-box {
  position: relative;
  width: 100%;
  max-width: 580px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px rgba(0,0,0,.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
  animation: scaleIn .2s cubic-bezier(.4,0,.2,1) both;
  transform-origin: top center;
}

.sp-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.sp-icon { color: var(--text-soft); flex-shrink: 0; width:18px; height:18px; }
.sp-input {
  flex: 1;
  border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 16px;
  color: var(--text);
  caret-color: var(--primary);
}
.sp-input::placeholder { color: var(--text-soft); }
.sp-esc-hint {
  font-size: 11px; opacity: .5; flex-shrink: 0;
  padding: 2px 6px; border-radius: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.sp-results {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}
.sp-results::-webkit-scrollbar { width: 4px; }

.sp-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border-top: 1px solid var(--border-soft);
  font-size: 11px;
  color: var(--text-soft);
  flex-shrink: 0;
  background: var(--surface2);
}
.sp-footer kbd {
  background: var(--surface);
  border-color: var(--border);
  padding: 1px 5px;
  font-size: 10px;
}

/* Grupos */
.sp-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 8px 16px 3px;
}

/* Item */
.sp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background var(--transition);
  border-radius: 0;
}
.sp-item:hover,
.sp-item.selected { background: var(--surface2); }

.sp-item-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sp-item-body { flex: 1; min-width: 0; }
.sp-item-title {
  font-size: 13.5px; font-weight: 500;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sp-item-title.line-through { text-decoration: line-through; color: var(--text-muted); }
.sp-item-sub {
  font-size: 11.5px; color: var(--text-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 1px;
}
.sp-color-dot {
  width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0;
}

/* Highlight */
.search-hl {
  background: rgba(var(--shadow-color), .22);
  color: var(--primary);
  border-radius: 2px;
  padding: 0 1px;
  font-style: normal;
}

/* Empty / no results */
.sp-empty { padding: 8px 0; }
.sp-shortcuts { padding: 0 8px; }
.sp-shortcut-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-soft);
  padding: 6px 6px 2px;
}

.sp-no-results {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  padding: 32px 20px;
  color: var(--text-soft);
  text-align: center;
}
.sp-no-results svg { opacity: .3; }
.sp-actions-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

/* ══════════════════════════════════════════════
   FAB MENU — Etapa 6
   ══════════════════════════════════════════════ */

#fab-menu {
  position: fixed;
  z-index: 210;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px 8px 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--transition), transform var(--transition), background var(--transition);
  animation: slideRight .18s cubic-bezier(.4,0,.2,1) both;
  white-space: nowrap;
}
.fab-menu-item:hover {
  background: var(--surface2);
  transform: translateX(-2px);
  box-shadow: var(--neon-glow);
}

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

/* Responsive */
@media (max-width: 640px) {
  #search-panel { padding-top: 0; align-items: flex-end; }
  .sp-box { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 85vh; }
}

/* ── Filtro de rango de eventos ── */
.dash-range-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  background: var(--surface2);
}
.dash-range-tab {
  flex: 1;
  padding: 6px 4px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  text-align: center;
}
.dash-range-tab:hover  { color: var(--text); background: var(--surface); }
.dash-range-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Fila de evento en dashboard ── */
.dash-event-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition);
  cursor: default;
}
.dash-event-row:last-child { border-bottom: none; }
.dash-event-row:hover { background: var(--surface2); }
.dash-event-row:hover .dash-item-actions { opacity: 1; }

.dash-event-color-bar {
  width: 4px;
  min-height: 36px;
  border-radius: 0 2px 2px 0;
  flex-shrink: 0;
  margin-right: 10px;
  align-self: stretch;
}

.dash-event-body {
  flex: 1;
  min-width: 0;
}
.dash-event-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.dash-event-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--text-soft);
}

/* ── Acciones inline (comunes a eventos, notas, tareas) ── */
.dash-item-actions {
  display: flex;
  gap: 1px;
  opacity: 0;
  transition: opacity var(--transition);
  flex-shrink: 0;
  align-items: center;
}
.dash-item-actions .icon-btn { width: 24px; height: 24px; }
.dash-item-actions .icon-btn svg { width: 13px; height: 13px; }

/* ── Tarjeta de nota en dashboard ── */
.dash-note-card {
  margin: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
}
.dash-note-card:hover { box-shadow: var(--neon-glow); transform: translateX(2px); }
.dash-note-card:hover .dash-item-actions { opacity: 1; }

.dash-note-card-inner {
  padding: 8px 10px;
  cursor: pointer;
}
.dash-note-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}
.dash-note-preview {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.dash-note-tags {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.dash-note-actions {
  padding: 4px 6px;
  border-top: 1px solid var(--border-soft);
  background: rgba(0,0,0,.02);
  justify-content: flex-end;
  opacity: 0;
}
.dash-note-card:hover .dash-note-actions { opacity: 1; }

/* ── Fila de tarea en dashboard ── */
.dash-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition);
}
.dash-task-row:last-child { border-bottom: none; }
.dash-task-row:hover { background: var(--surface2); }
.dash-task-row:hover .dash-item-actions { opacity: 1; }
.dash-task-overdue { border-left: 2px solid #ef4444; }

/* Checkbox de tarea en dashboard: solo pending / done */
.dash-task-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  font-family: inherit;
}
.dash-task-check:hover { border-color: var(--primary); }
.dash-task-check-done  { background: var(--primary); border-color: var(--primary); color: #fff; }
.dash-task-check svg   { width: 10px; height: 10px; }

.dash-task-body {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.dash-task-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-task-title-done {
  text-decoration: line-through;
  color: var(--text-muted);
}
.dash-task-meta {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* ══════════════════════════════════════════════
   CALENDAR v19 — agregar al final de styles.css
   ══════════════════════════════════════════════ */
 
/* 1. Vista mes ocupa todo el alto disponible */
.cal-view-container {
  display: flex;
  flex-direction: column;
  /* Llena el alto restante del main después del toolbar */
  height: calc(100vh - var(--header-h) - 32px - 80px);
  min-height: 0;
}
 
.cal-month-full {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
 
.cal-month-grid-full {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
 
/* 3. Chips de la vista mes: ancho fijo, no se expanden */
.cal-event-chip {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  /* Ancho fijo: no se estira más allá del contenedor */
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
  box-sizing: border-box;
}
.cal-event-chip:hover { opacity: 0.85; transform: translateX(1px); }
.cal-chip-task { border-style: dashed !important; }
 
/* Icono diferenciador adelante del texto */
.chip-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.85;
}
.chip-icon svg { display: block; }
 
.chip-time {
  font-size: 9px;
  opacity: .7;
  font-family: 'DM Mono', monospace;
  flex-shrink: 0;
}
.chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
 
/* 2. Eventos superpuestos en semana: position absolute con left calculado */
.cal-week-col { position: relative; }
.cal-week-event {
  position: absolute;
  /* left y width se calculan inline por JS */
  border-radius: 6px;
  padding: 4px 7px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  cursor: pointer;
  overflow: hidden;
  transition: opacity var(--transition), box-shadow var(--transition);
  z-index: 2;
  user-select: none;
  box-sizing: border-box;
}
.cal-week-event:hover { opacity: 0.88; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 3; }
