/* =========================================================
   Mi espacio — estilos
   ========================================================= */
:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --surface-3: #e8e4db;
  --border: #e2ded4;
  --text: #1f1d1a;
  --muted: #6d685e;
  --faint: #a39d92;
  --accent: #2f6f5e;
  --accent-hover: #275e50;
  --accent-soft: #e2efea;
  --accent-text: #ffffff;
  --danger: #b9472f;
  --warn: #c98a2c;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(40, 35, 25, 0.05), 0 6px 20px rgba(40, 35, 25, 0.05);
  --shadow-lg: 0 10px 40px rgba(30, 25, 15, 0.18);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #141413;
  --surface: #1c1c1a;
  --surface-2: #242421;
  --surface-3: #383630;
  --border: #33322d;
  --text: #ebe7df;
  --muted: #a09a8f;
  --faint: #6f6a61;
  --accent: #6cbfa3;
  --accent-hover: #82cdb3;
  --accent-soft: #1e3530;
  --accent-text: #0f1d19;
  --danger: #e07a5f;
  --warn: #e0a84f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
kbd {
  font: 11px/1 var(--font);
  padding: 3px 5px;
  border-radius: 5px;
  border: 1px solid var(--border);
  color: var(--faint);
  background: var(--surface);
}
.ic { flex: none; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Estructura ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; height: 100vh; }
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 14px 16px;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--accent);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; left: 10px; top: 9px; width: 13px; height: 7px;
  border-left: 3px solid var(--accent-text); border-bottom: 3px solid var(--accent-text);
  transform: rotate(-45deg); border-radius: 1px;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-family: var(--font-display); font-size: 18px; line-height: 1.1; }
.brand-text span { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.new-btn { justify-content: center; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav a span { flex: 1; }
.nav a kbd { opacity: 0; transition: opacity 0.15s; }
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a:hover kbd { opacity: 1; }
.nav a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.nav a.active .ic { color: var(--accent); }
.nav-sep { height: 1px; background: var(--border); margin: 8px 10px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 6px; }
.save-note { font-size: 11.5px; color: var(--faint); }
.timer-badge {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm);
  padding: 8px; font-variant-numeric: tabular-nums; font-weight: 600;
}
.timer-badge[hidden] { display: none; }
.timer-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: pulse 1.6s infinite; }
.timer-badge.break .dot { background: var(--accent); }
@keyframes pulse { 50% { opacity: 0.35; } }

.main { overflow-y: auto; padding: 34px 44px 80px; }
.view { max-width: 1260px; margin: 0 auto; }
.mobile-bar { display: none; }
.scrim { display: none; }

/* ---------- Encabezados de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-display); font-size: 32px; font-weight: 600; line-height: 1.15; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.eyebrow { color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0.02em; margin-bottom: 4px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tip {
  max-width: 360px; color: var(--muted); font-size: 13.5px; font-style: italic;
  border-left: 2px solid var(--accent); padding-left: 12px;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  font-weight: 500; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.on { color: var(--accent); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 500; }
.link-btn:hover { text-decoration: underline; }

/* Casilla de verificación */
.cb {
  flex: none; width: 20px; height: 20px; border-radius: 6px; padding: 0;
  border: 1.6px solid var(--faint); background: transparent; color: transparent;
  display: inline-grid; place-items: center; transition: all 0.15s;
}
.cb:hover { border-color: var(--accent); }
.cb.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.cb.round { border-radius: 50%; }
.cb.sm { width: 17px; height: 17px; border-radius: 5px; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow); min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ic { color: var(--accent); }
.card-head .count { color: var(--faint); font-weight: 500; font-size: 13px; }
.empty { color: var(--faint); font-size: 13.5px; padding: 8px 0; }
.empty-big { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-big .ic { color: var(--faint); margin-bottom: 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.spacer { flex: 1; }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; flex: 1; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea {
  width: 100%; padding: 9px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > * { flex: 1 1 140px; }
.check { display: inline-flex; align-items: center; gap: 8px; margin: 0 16px 14px 0; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.day-picks { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pick input { position: absolute; opacity: 0; pointer-events: none; }
.day-pick span {
  display: inline-grid; place-items: center; min-width: 44px; padding: 6px 8px; border-radius: 8px;
  border: 1px solid var(--border); font-size: 13px; font-weight: 500; cursor: pointer; color: var(--muted);
}
.day-pick input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.day-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.inline-add { display: flex; gap: 8px; }
.inline-add input { flex: 1; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--c); cursor: pointer; border: 3px solid transparent; box-shadow: 0 0 0 1px var(--border); }
.swatch input:checked + span { border-color: var(--surface); box-shadow: 0 0 0 2px var(--c); }

/* ---------- Modal ---------- */
dialog {
  border: 0; padding: 0; background: transparent; color: var(--text);
  width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
}
dialog.wide { width: min(720px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(20, 18, 14, 0.45); backdrop-filter: blur(2px); }
dialog[open] { animation: pop 0.18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 8px; }
.modal-head h2 { font-family: var(--font-display); font-size: 21px; }
.modal-body { padding: 10px 20px 4px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; align-items: center; padding: 12px 20px 18px; border-top: 1px solid var(--border); margin-top: 6px; }

/* ---------- Menú rápido ---------- */
.quick-menu {
  position: fixed; z-index: 50; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; display: flex; flex-direction: column;
  animation: pop 0.15s ease-out;
}
.quick-menu[hidden] { display: none; }
.quick-menu button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: transparent; border-radius: 8px; text-align: left; font-weight: 500; }
.quick-menu button span { flex: 1; }
.quick-menu button:hover { background: var(--surface-2); }
.quick-menu .ic { color: var(--accent); }

/* ---------- Avisos ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; align-items: flex-end; }
.toast {
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg);
  max-width: 380px; font-weight: 500; opacity: 0; transform: translateY(8px); transition: all 0.25s;
}
.toast.in { opacity: 1; transform: none; }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- Chips y etiquetas ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.tag.c { background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: color-mix(in srgb, var(--c) 75%, var(--text)); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--faint)); flex: none; display: inline-block; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 99px; transition: width 0.3s; }
.overdue { color: var(--danger) !important; }

/* =========================================================
   HOY
   ========================================================= */
.hoy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.hoy-grid .span-2 { grid-column: span 2; }
.hoy-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.prio-list { display: flex; flex-direction: column; gap: 4px; }
.prio { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.prio .num { font-family: var(--font-display); font-size: 22px; color: var(--faint); width: 18px; text-align: center; }
.prio input { border: 0 !important; border-bottom: 1px dashed var(--border) !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; padding: 8px 2px !important; font-size: 15.5px; }
.prio input:focus { border-bottom-color: var(--accent) !important; }
.prio.done input { text-decoration: line-through; color: var(--faint); }
.mood-row { display: flex; justify-content: space-between; gap: 4px; }
.mood-btn {
  flex: 1; font-size: 24px; border: 1px solid transparent; background: var(--surface-2); border-radius: 10px; padding: 6px 0;
  filter: grayscale(0.85); opacity: 0.75; transition: all 0.15s;
}
.mood-btn:hover { filter: none; opacity: 1; }
.mood-btn.on { filter: none; opacity: 1; background: color-mix(in srgb, var(--c) 20%, var(--surface)); border-color: var(--c); }
.water { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.water button {
  width: 28px; height: 34px; border-radius: 4px 4px 9px 9px; border: 1.5px solid color-mix(in srgb, #4f8fd0 55%, var(--border));
  background: transparent; padding: 0; position: relative; overflow: hidden;
}
.water button.on { background: color-mix(in srgb, #4f8fd0 70%, transparent); }
.sub-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 14px 0 8px; display: flex; justify-content: space-between; }
.sub-label:first-child { margin-top: 0; }

.agenda { display: flex; flex-direction: column; gap: 6px; }
.agenda-item {
  display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer;
  background: color-mix(in srgb, var(--c) 9%, var(--surface)); border-left: 3px solid var(--c);
}
.agenda-item:hover { background: color-mix(in srgb, var(--c) 15%, var(--surface)); }
.agenda-item .time { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted); width: 82px; flex: none; padding-top: 1px; }
.agenda-item .title { font-weight: 500; }
.agenda-item.past { opacity: 0.55; }
.agenda-item.now { box-shadow: 0 0 0 1.5px var(--c); }

.task-mini { display: flex; flex-direction: column; }
.tm { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.tm:last-child { border-bottom: 0; }
.tm .t { flex: 1; min-width: 0; cursor: pointer; }
.tm.done .t { text-decoration: line-through; color: var(--faint); }
.tm .meta { font-size: 12px; color: var(--faint); }

.habit-pills { display: flex; flex-direction: column; gap: 6px; }
.habit-pill {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent; text-align: left; width: 100%; transition: all 0.15s;
}
.habit-pill:hover { border-color: var(--c); }
.habit-pill .em { font-size: 18px; }
.habit-pill .n { flex: 1; font-weight: 500; }
.habit-pill .st { font-size: 12px; color: var(--faint); }
.habit-pill.on { background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.habit-pill .chk { width: 22px; height: 22px; border-radius: 50%; border: 1.6px solid var(--faint); display: grid; place-items: center; color: transparent; }
.habit-pill.on .chk { background: var(--c); border-color: var(--c); color: #fff; }

.routine-mini { display: flex; flex-direction: column; gap: 12px; }
.routine-mini a { text-decoration: none; color: inherit; display: block; }
.routine-mini .rm-top { display: flex; justify-content: space-between; margin-bottom: 6px; font-weight: 500; }
.routine-mini .rm-top span:last-child { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.capture-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.capture-list div { font-size: 13px; color: var(--muted); padding: 6px 10px; background: var(--surface-2); border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.upcoming { display: flex; flex-direction: column; gap: 10px; }
.up-day h4 { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.up-item { display: flex; gap: 8px; align-items: center; font-size: 13.5px; padding: 2px 0; cursor: pointer; }
.up-item .tm-time { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; width: 40px; }

.banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  margin-bottom: 16px; font-size: 14px;
}
.banner .spacer { flex: 1; }

/* =========================================================
   CALENDARIO
   ========================================================= */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.cal-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-toolbar h2 { font-family: var(--font-display); font-size: 24px; min-width: 210px; }
.month { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.month-head, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-head div { padding: 9px 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); }
.mcell {
  min-height: 108px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; transition: background 0.12s;
}
.mcell:nth-child(7n) { border-right: 0; }
.mcell:hover { background: var(--surface-2); }
.mcell.other { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.mcell.other .dnum { color: var(--faint); }
.mcell.sel { background: var(--accent-soft); }
.mcell .dnum { font-size: 13px; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.mcell.today .dnum { background: var(--accent); color: var(--accent-text); }
.mtop { display: flex; justify-content: space-between; align-items: center; }
.mtasks { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 3px; }
.chip {
  font-size: 12px; line-height: 1.35; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: color-mix(in srgb, var(--c) 70%, var(--text));
  border-left: 2.5px solid var(--c);
}
.chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.more { font-size: 11.5px; color: var(--muted); padding-left: 4px; }

.day-panel { position: sticky; top: 0; }
.day-panel h3 { font-family: var(--font-display); font-size: 20px; }
.day-panel .actions { display: flex; gap: 8px; margin: 12px 0 14px; flex-wrap: wrap; }

.week { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.week-head { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.week-head > div { padding: 8px 6px; text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; cursor: pointer; }
.week-head .wd-num { display: block; font-size: 20px; font-weight: 600; color: var(--text); font-family: var(--font-display); }
.week-head .today .wd-num { color: var(--accent); }
.week-allday { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); min-height: 30px; }
.week-allday > div { padding: 3px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--border); min-width: 0; }
.week-allday > div:first-child { border-left: 0; font-size: 10.5px; color: var(--faint); align-items: flex-end; justify-content: center; padding-right: 8px; }
.week-scroll { height: calc(100vh - 290px); min-height: 380px; overflow-y: auto; }
.week-body { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); position: relative; }
.hours div { height: 48px; font-size: 11px; color: var(--faint); text-align: right; padding-right: 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.wcol {
  position: relative; border-left: 1px solid var(--border); cursor: copy;
  background-image: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px 48px);
}
.wcol.today { background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.wev {
  position: absolute; border-radius: 6px; padding: 3px 6px; font-size: 12px; line-height: 1.3; overflow: hidden; cursor: pointer;
  background: color-mix(in srgb, var(--c) 22%, var(--surface)); border-left: 3px solid var(--c); color: color-mix(in srgb, var(--c) 60%, var(--text));
  box-shadow: 0 0 0 1px var(--surface);
}
.wev:hover { z-index: 3; background: color-mix(in srgb, var(--c) 32%, var(--surface)); }
.wev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wev span { font-size: 11px; opacity: 0.85; font-variant-numeric: tabular-nums; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 4; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* =========================================================
   TAREAS
   ========================================================= */
.tasks-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.filters { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.filters button {
  display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 7px 10px; border-radius: 8px;
  text-align: left; color: var(--muted); font-weight: 500;
}
.filters button span { flex: 1; }
.filters button em { font-style: normal; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.filters button:hover { background: var(--surface-2); color: var(--text); }
.filters button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.filters h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); margin: 14px 10px 4px; }
.task-add { display: flex; gap: 8px; margin-bottom: 16px; }
.task-add input { flex: 1; padding: 11px 14px !important; font-size: 15px; }
.task-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.task-group-title { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 14px 16px 4px; }
.task {
  display: flex; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); align-items: flex-start;
}
.task:last-child { border-bottom: 0; }
.task .cb { margin-top: 1px; }
.task-main { flex: 1; min-width: 0; cursor: pointer; }
.task-title { font-weight: 500; }
.task.done .task-title { text-decoration: line-through; color: var(--faint); }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--muted); margin-top: 3px; align-items: center; }
.task-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.subtasks { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.subtask { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.subtask.done span { text-decoration: line-through; color: var(--faint); }
.prio-flag { width: 4px; align-self: stretch; border-radius: 4px; background: var(--c); margin: 2px -4px 2px -8px; }

.matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.quad { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); padding: 14px; min-height: 220px; box-shadow: var(--shadow); transition: box-shadow 0.15s; }
.quad.over { box-shadow: 0 0 0 2px var(--c); }
.quad h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.quad h3::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.quad p.q-sub { font-size: 12.5px; color: var(--muted); margin: 2px 0 10px; }
.qitem {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; background: var(--surface-2);
  margin-bottom: 6px; cursor: grab; font-size: 13.5px;
}
.qitem:active { cursor: grabbing; }
.qitem .t { flex: 1; min-width: 0; }
.qitem .d { font-size: 11.5px; color: var(--faint); }

/* =========================================================
   HÁBITOS
   ========================================================= */
.habit-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.habit-table th { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px 10px; text-align: center; }
.habit-table th:first-child { text-align: left; }
.habit-table th.today { color: var(--accent); }
.habit-table th small { display: block; font-size: 16px; color: var(--text); font-family: var(--font-display); }
.habit-table th.today small { color: var(--accent); }
.habit-table td { padding: 6px 4px; border-top: 1px solid var(--border); text-align: center; }
.habit-table td:first-child { text-align: left; }
.hname { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 180px; }
.hname .em { font-size: 20px; width: 28px; text-align: center; }
.hname b { font-weight: 500; display: block; }
.hname small { color: var(--faint); font-size: 12px; }
.hcell {
  width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--border); background: transparent;
  display: inline-grid; place-items: center; color: transparent; transition: all 0.12s;
}
.hcell:hover:not(:disabled) { border-color: var(--c); }
.hcell.on { background: var(--c); border-color: var(--c); color: #fff; }
.hcell.off { border-style: dashed; opacity: 0.45; }
.hcell:disabled { opacity: 0.25; cursor: default; }
.streak { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rate { font-variant-numeric: tabular-nums; color: var(--muted); }
.heat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 18px; }
.heat { display: grid; grid-template-rows: repeat(7, 11px); grid-auto-flow: column; grid-auto-columns: 11px; gap: 3px; margin-top: 10px; }
.heat i { border-radius: 3px; background: var(--surface-3); }
.heat i.on { background: var(--c); }
.heat i.off { background: transparent; box-shadow: inset 0 0 0 1px var(--surface-3); }
.heat i.fut { background: transparent; }

/* =========================================================
   RUTINAS
   ========================================================= */
.routine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.routine-card .r-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.routine-card .r-emoji { font-size: 28px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); }
.routine-card h3 { font-size: 17px; }
.routine-card .r-sub { font-size: 12.5px; color: var(--muted); }
.r-items { display: flex; flex-direction: column; margin: 12px 0 6px; }
.r-item { display: flex; align-items: center; gap: 11px; padding: 8px 2px; border-bottom: 1px dashed var(--border); cursor: pointer; }
.r-item:last-child { border-bottom: 0; }
.r-item.done span { text-decoration: line-through; color: var(--faint); }
.r-hist { display: flex; gap: 4px; align-items: center; margin-top: 10px; font-size: 11.5px; color: var(--faint); }
.r-hist i { width: 14px; height: 14px; border-radius: 4px; background: var(--surface-3); display: inline-block; }
.r-hist i.full { background: var(--accent); }
.r-hist i.part { background: color-mix(in srgb, var(--accent) 40%, var(--surface-3)); }
.r-complete { font-size: 13px; color: var(--accent); font-weight: 600; }
.tag-off { opacity: 0.6; }

/* =========================================================
   NOTAS
   ========================================================= */
.notes-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0; height: calc(100vh - 170px); min-height: 460px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.notes-side { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
.notes-search { padding: 12px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--border); }
.search-box { position: relative; }
.search-box .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search-box input { padding-left: 34px !important; }
.tag-filter { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-filter button { border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 2px 9px; font-size: 12px; color: var(--muted); }
.tag-filter button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.notes-list { overflow-y: auto; flex: 1; }
.note-item { padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; border-left: 3px solid transparent; }
.note-item:hover { background: var(--surface-2); }
.note-item.sel { background: var(--surface); border-left-color: var(--accent); }
.note-item .ni-title { font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-item .ni-title .ic { color: var(--accent); }
.note-item .ni-snip { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.note-item .ni-date { font-size: 11.5px; color: var(--faint); margin-top: 4px; }
.note-editor { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ne-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.ne-bar .meta { font-size: 12px; color: var(--faint); margin-right: auto; }
.ne-title { border: 0 !important; box-shadow: none !important; font-family: var(--font-display); font-size: 26px; font-weight: 600; padding: 18px 24px 4px !important; background: transparent !important; }
.ne-tags { border: 0 !important; box-shadow: none !important; padding: 2px 24px 10px !important; font-size: 13px; color: var(--muted); background: transparent !important; }
.ne-body { flex: 1; border: 0 !important; border-top: 1px solid var(--border) !important; border-radius: 0 !important; box-shadow: none !important; padding: 18px 24px !important; resize: none; font-size: 15px; line-height: 1.65; background: transparent !important; }
.md { padding: 18px 24px 40px; overflow-y: auto; flex: 1; border-top: 1px solid var(--border); line-height: 1.65; font-size: 15px; }
.md h1, .md h2, .md h3 { font-family: var(--font-display); margin: 18px 0 8px; }
.md h1 { font-size: 24px; } .md h2 { font-size: 20px; } .md h3 { font-size: 17px; }
.md > :first-child { margin-top: 0; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md ul.md-tasks { list-style: none; padding-left: 0; }
.md ul.md-tasks li { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.md ul.md-tasks li.done span { text-decoration: line-through; color: var(--faint); }
.md code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.md blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--accent); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* =========================================================
   DIARIO
   ========================================================= */
.journal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.date-nav { display: flex; align-items: center; gap: 6px; }
.date-nav h2 { font-family: var(--font-display); font-size: 22px; min-width: 230px; text-align: center; }
.prompt-card { background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.prompt-card p { font-family: var(--font-display); font-size: 18px; }
.grat { display: flex; flex-direction: column; gap: 6px; }
.grat label { display: flex; align-items: center; gap: 10px; }
.grat label b { color: var(--faint); font-family: var(--font-display); font-size: 18px; width: 14px; }
.mood-strip { display: grid; grid-template-columns: repeat(15, 1fr); gap: 4px; }
.mood-strip i { aspect-ratio: 1; border-radius: 4px; background: var(--surface-3); display: block; cursor: pointer; }
.past-list { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; }
.past-list button { display: flex; gap: 10px; align-items: center; border: 0; background: transparent; text-align: left; padding: 7px 8px; border-radius: 8px; }
.past-list button:hover { background: var(--surface-2); }
.past-list .pl-date { font-size: 12.5px; color: var(--muted); width: 72px; flex: none; }
.past-list .pl-text { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.stat-row { display: flex; gap: 10px; }
.stat { flex: 1; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.stat b { font-size: 22px; font-family: var(--font-display); display: block; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--muted); }

/* =========================================================
   ENFOQUE
   ========================================================= */
.focus-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.focus-main { display: flex; flex-direction: column; align-items: center; padding: 30px 20px; }
.ring-wrap { position: relative; width: 300px; height: 300px; margin: 24px 0; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-bg { stroke: var(--surface-3); }
.ring-fg { stroke: var(--accent); transition: stroke-dashoffset 0.5s linear; }
.focus-main.break .ring-fg { stroke: #4f8fd0; }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-time { font-size: 64px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1; }
.ring-label { color: var(--muted); margin-top: 8px; font-size: 14px; }
.focus-controls { display: flex; gap: 10px; align-items: center; }
.focus-controls .big { width: 64px; height: 64px; border-radius: 50%; justify-content: center; padding: 0; }
.focus-task { width: min(420px, 100%); margin-top: 22px; text-align: center; }
.cycle-dots { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }
.cycle-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); }
.cycle-dots i.on { background: var(--accent); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin-top: 8px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars i { width: 100%; background: var(--accent); border-radius: 5px 5px 2px 2px; min-height: 2px; opacity: 0.85; }
.bars span { font-size: 11px; color: var(--faint); }
.bars em { font-size: 10.5px; color: var(--muted); font-style: normal; }
.session-list { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.session-list div { display: flex; justify-content: space-between; gap: 10px; }

/* =========================================================
   METAS
   ========================================================= */
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.goal-card h3 { font-size: 17px; margin: 8px 0 4px; }
.goal-card .why { font-size: 13.5px; color: var(--muted); font-style: italic; margin-bottom: 12px; }
.goal-card .g-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.goal-card .g-progress { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.goal-card .g-progress .bar { flex: 1; height: 8px; }
.goal-card .g-progress b { font-variant-numeric: tabular-nums; font-size: 13px; }
.milestones { display: flex; flex-direction: column; gap: 2px; }
.milestone { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; cursor: pointer; }
.milestone.done span { text-decoration: line-through; color: var(--faint); }
.goal-card.complete { opacity: 0.75; }
.goal-card .deadline { font-size: 12.5px; color: var(--muted); }

/* =========================================================
   AJUSTES
   ========================================================= */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.settings-grid .card p { color: var(--muted); font-size: 13.5px; margin-bottom: 12px; }
.data-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1180px) {
  .hoy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-layout, .journal-layout, .focus-layout { grid-template-columns: minmax(0, 1fr); }
  .day-panel { position: static; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%);
    transition: transform 0.22s ease; box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 30; }
  .main { padding: 0 16px 60px; }
  .mobile-bar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; background: var(--bg); padding: 10px 0; z-index: 10; margin-bottom: 8px; }
  .hoy-grid { grid-template-columns: minmax(0, 1fr); }
  .hoy-grid .span-2 { grid-column: auto; }
  .tasks-layout, .notes-layout { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; flex-direction: row; flex-wrap: wrap; }
  .filters h4 { width: 100%; }
  .notes-layout { height: auto; }
  .notes-side { max-height: 300px; border-right: 0; border-bottom: 1px solid var(--border); }
  .note-editor { min-height: 480px; }
  .matrix { grid-template-columns: 1fr; }
  .mcell { min-height: 72px; }
  .mcell .chip { display: none; }
  .page-head h1 { font-size: 26px; }
  .habit-wrap { overflow-x: auto; }
  .nav a kbd { display: none; }
}
/* =========================================================
   AMPLIACIÓN: menú, buscador, archivo, secciones nuevas
   ========================================================= */
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--faint); font-weight: 600; margin: 12px 10px 4px; }
.nav-group:first-child { margin-top: 0; }
.nav a { padding: 7px 10px; }
.side-actions { display: flex; gap: 6px; }
.side-actions .new-btn { flex: 1; }
.search-btn { padding: 8px 11px; color: var(--muted); }
#file-status .fs { display: flex; align-items: center; gap: 7px; font-size: 12px; }
#file-status .fs.ok { color: var(--accent); }
#file-status .fs.warn {
  width: 100%; border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 12%, var(--surface));
  color: var(--text); border-radius: var(--radius-sm); padding: 7px 9px; font-weight: 500; text-align: left;
}
.banner.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.banner .btn { text-decoration: none; color: var(--text); }

/* "También hoy" */
.extra-list { display: flex; flex-direction: column; gap: 6px; }
.extra {
  display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 0; width: 100%;
  background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: 13.5px;
}
.extra:hover { background: var(--surface-3); }
.extra .em { font-size: 16px; line-height: 1.3; }
.extra.ok { opacity: 0.7; }

/* Planificar arrastrando */
.plan-list { display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow-y: auto; }
.plan-task {
  display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 8px; font-size: 13px;
  background: var(--surface-2); border: 1px dashed var(--border); cursor: grab;
}
.plan-task .ic { color: var(--accent); }
.plan-task span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-task em { font-style: normal; font-size: 11.5px; color: var(--faint); }
.plan-task:active { cursor: grabbing; }
.drop-over { background-color: color-mix(in srgb, var(--accent) 14%, transparent) !important; box-shadow: inset 0 0 0 2px var(--accent); }
.wev[draggable="true"] { cursor: grab; }
.wev.task-done { opacity: 0.55; }
.wev.task-done b { text-decoration: line-through; }

/* Buscador */
.search-dialog { width: min(640px, calc(100vw - 24px)); margin-top: 12vh; }
.search-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.search-box.big { padding: 6px; border-bottom: 1px solid var(--border); }
.search-box.big .ic { left: 20px; }
.search-box.big input { border: 0 !important; box-shadow: none !important; font-size: 16px; padding: 12px 12px 12px 42px !important; }
.search-results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.sr { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; text-align: left; }
.sr.on, .sr:hover { background: var(--surface-2); }
.sr.on { box-shadow: inset 3px 0 0 var(--accent); }
.sr-ic { width: 22px; text-align: center; font-size: 15px; }
.sr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sr-main b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-main small { color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-type { font-size: 11.5px; color: var(--muted); background: var(--surface-2); border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.search-foot { display: flex; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--faint); }

/* Comunes nuevos */
.section-title { font-size: 17px; margin: 28px 0 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi b { display: block; font-family: var(--font-display); font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.pos { color: var(--accent); }
.neg { color: var(--danger); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.tx-main b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-main small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 6px; font-size: 13.5px; }
.cb-top span:first-child { display: inline-flex; align-items: center; gap: 7px; }

/* Revisión */
.rating { display: flex; gap: 5px; flex-wrap: wrap; }
.rating button { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; color: var(--muted); }
.rating button:hover { border-color: var(--accent); }
.rating button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.save-row { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; }
.past-reviews { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.past-review { text-align: left; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.past-review:hover { border-color: var(--accent); }

/* Finanzas */
.type-seg label { position: relative; }
.type-seg input { position: absolute; opacity: 0; }
.type-seg span { display: inline-block; padding: 5px 16px; border-radius: 7px; color: var(--muted); font-weight: 500; cursor: pointer; }
.type-seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.budget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.cat-bars { display: flex; flex-direction: column; gap: 12px; }
.duo-pair { display: flex; gap: 3px; align-items: flex-end; width: 100%; height: calc(100% - 18px); }
.duo-pair i { flex: 1; }
.duo-pair i.neg { background: var(--danger); }
.fin-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tx-list { display: flex; flex-direction: column; max-height: 560px; overflow-y: auto; }
.tx { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.tx:hover { background: var(--surface-2); }
.tx:last-child { border-bottom: 0; }
.tx-date { font-size: 12px; color: var(--faint); width: 48px; flex: none; }
.tx-amt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.sub-list, .sav-list { display: flex; flex-direction: column; gap: 10px; }
.sub-row { display: flex; align-items: center; gap: 10px; }

/* Comidas */
.meals-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.meal-grid { display: grid; grid-template-columns: 54px repeat(3, minmax(0, 1fr)); gap: 6px; align-items: center; }
.mg-head { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding-left: 4px; }
.mg-day { display: flex; flex-direction: column; line-height: 1.1; }
.mg-day b { font-size: 13px; }
.mg-day small { font-family: var(--font-display); font-size: 17px; color: var(--muted); }
.mg-day.today b, .mg-day.today small { color: var(--accent); }
.meal-in { padding: 8px 10px !important; font-size: 13.5px; }
.meal-in.is-recipe { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)) !important; background: var(--accent-soft) !important; }
.shopping { position: sticky; top: 0; }
.shop-list { display: flex; flex-direction: column; }
.shop-list .icon-btn { width: 26px; height: 26px; opacity: 0; }
.shop-list .tm:hover .icon-btn { opacity: 1; }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.recipe { text-align: left; display: flex; flex-direction: column; gap: 4px; }
.recipe:hover { border-color: var(--accent); }

/* Estudio */
.exam-list, .topic-list, .subject-list, .people { display: flex; flex-direction: column; gap: 8px; }
.exam, .person { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.exam:hover, .person:hover { background: var(--surface-3); }
.exam.past { background: transparent; border-bottom: 1px solid var(--border); border-radius: 0; padding: 6px 4px; }
.countdown { width: 48px; height: 48px; flex: none; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.countdown b { font-family: var(--font-display); font-size: 19px; }
.countdown small { font-size: 10.5px; color: var(--muted); }
.countdown.soon { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.topic { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.topic:last-child { border-bottom: 0; }
.topic.later { cursor: pointer; }
.schedule { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sch-day b { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }
.sch-item { font-size: 13px; padding: 5px 8px; border-radius: 7px; background: color-mix(in srgb, #7a5ea8 13%, var(--surface)); border-left: 3px solid #7a5ea8; margin-bottom: 4px; cursor: pointer; }
.sch-item .tm-time { display: block; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.subject { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.subject:last-child { border-bottom: 0; }

/* Salud */
.line-chart { width: 100%; height: auto; display: block; }
.line-chart .grid { stroke: var(--border); stroke-dasharray: 3 4; }
.line-chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.line-chart text { font-size: 11px; fill: var(--faint); font-family: var(--font); }
.line-chart text.last { fill: var(--text); font-weight: 600; font-size: 12px; }

/* Listas */
.filters .em { width: 16px; text-align: center; }
.coll-items { display: flex; flex-direction: column; }
.coll-item { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--border); }
.coll-item:last-child { border-bottom: 0; }
.coll-item.listo .tx-main b { color: var(--muted); }
.status-pill { border: 0; border-radius: 99px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; width: 84px; flex: none; }
.status-pill.pendiente { background: var(--surface-3); color: var(--muted); }
.status-pill.curso { background: color-mix(in srgb, #4f7cac 22%, var(--surface)); color: color-mix(in srgb, #4f7cac 70%, var(--text)); }
.status-pill.listo { background: var(--accent-soft); color: var(--accent); }
.stars { color: #d9a52c; letter-spacing: 1px; font-size: 13px; white-space: nowrap; }

@media (max-width: 1180px) {
  .two-col, .fin-layout, .meals-layout { grid-template-columns: minmax(0, 1fr); }
  .shopping { position: static; }
}
@media (max-width: 860px) {
  .meal-grid { grid-template-columns: 40px repeat(3, minmax(0, 1fr)); gap: 4px; }
  .meal-in { padding: 6px !important; font-size: 12.5px; }
  .search-dialog { margin-top: 4vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
