/* Atak v4 · estilos. Editorial y ordenado: Fraunces para titulares, Figtree para todo lo demás, grilla de 8 px, un acento. */

@font-face { font-family: "Fraunces"; src: url("fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --bg: #F3F0E8;
  --sidebar: #ECE8DE;
  --surface: #FCFBF7;
  --surface-2: #ECE8DE;
  --hover: #EFEBE2;
  --line: #E0DACD;
  --line-2: #CFC8B8;
  --ink: #16140F;
  --ink-2: #5A554C;
  --ink-3: #8D877B;
  --accent: #2E3BDB;
  --accent-hover: #2430C4;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3E5FA;
  --accent-text: #2832C2;
  --live: #1F8A57;
  --shadow-sm: 0 1px 2px rgba(40, 32, 20, .06);
  --shadow: 0 1px 2px rgba(40, 32, 20, .05), 0 12px 32px -16px rgba(40, 32, 20, .22);
  --shadow-lg: 0 2px 6px rgba(40, 32, 20, .08), 0 30px 70px -24px rgba(40, 32, 20, .35);
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --top-h: 64px;
  --tab-h: 0px;
  --w: 1040px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0F12; --sidebar: #131418; --surface: #16171B; --surface-2: #1E1F24; --hover: #1D1E23;
    --line: #26272D; --line-2: #35363D; --ink: #F1EEE7; --ink-2: #AAA59B; --ink-3: #75716A;
    --accent: #8F99FF; --accent-hover: #A6AEFF; --accent-ink: #0B0E2E; --accent-soft: rgba(143, 153, 255, .13); --accent-text: #AEB5FF;
    --live: #3CCB8A;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -20px rgba(0, 0, 0, .8);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 30px 70px -16px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0F12; --sidebar: #131418; --surface: #16171B; --surface-2: #1E1F24; --hover: #1D1E23;
  --line: #26272D; --line-2: #35363D; --ink: #F1EEE7; --ink-2: #AAA59B; --ink-3: #75716A;
  --accent: #8F99FF; --accent-hover: #A6AEFF; --accent-ink: #0B0E2E; --accent-soft: rgba(143, 153, 255, .13); --accent-text: #AEB5FF;
  --live: #3CCB8A;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -20px rgba(0, 0, 0, .8);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 30px 70px -16px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11"; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 32px; font-weight: 650; letter-spacing: -.015em; }
h2 { font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 15px; line-height: 22px; font-weight: 600; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
b, strong { font-weight: 600; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
kbd { font: 500 11px/1 var(--sans); color: var(--ink-3); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 3px 5px; background: var(--surface); }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--r); }
.skip:focus { left: 8px; }
.grow { flex: 1; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.soft-text, .hint { color: var(--ink-3); font-size: 13px; font-weight: 400; }
.num { font-variant-numeric: tabular-nums; }
.sep { color: var(--ink-3); margin: 0 6px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 32px; padding: 0 12px; border-radius: var(--r); border: 1px solid transparent;
  font: 550 14px/1 var(--sans); color: var(--ink); background: none; cursor: pointer; white-space: nowrap;
  text-decoration: none !important; transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:not(:disabled):hover { background: var(--accent-hover); }
.btn-secondary, .btn-soft { background: var(--surface); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn-secondary:not(:disabled):hover, .btn-soft:not(:disabled):hover { background: var(--hover); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--hover); color: var(--ink); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn-lg, .btn-big { height: 40px; padding: 0 16px; font-size: 15px; }
.btn-block { width: 100%; }
.btn svg { width: 16px; height: 16px; }
.btn-primary svg { stroke-width: 2; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r); border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.link-btn { background: none; border: 0; padding: 0; font: 500 14px/1.5 var(--sans); color: var(--ink-2); cursor: pointer; }
.link-btn:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Estructura ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 max(24px, calc((100vw - var(--w)) / 2));
  background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.top-left { display: flex; align-items: center; min-width: 0; }
.top-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font: 600 20px/1 var(--display); letter-spacing: -.01em; text-decoration: none !important; }
.brand-mark { display: grid; place-items: center; width: 24px; height: 24px; color: var(--accent); }
.brand-mark svg { width: 24px; height: 24px; stroke: none; }
.nav { display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.nav a { height: 32px; display: flex; align-items: center; padding: 0 16px; border-radius: 999px; color: var(--ink-2); font-size: 14px; font-weight: 550; text-decoration: none !important; }
.nav a:hover { color: var(--ink); }
.nav a.active { background: var(--ink); color: var(--bg); }
.capture { position: relative; display: flex; align-items: center; width: 260px; }
.capture svg { position: absolute; left: 12px; width: 14px; height: 14px; color: var(--ink-3); pointer-events: none; }
.topbar .capture input { height: 36px; padding: 0 44px 0 34px; border-radius: 999px; background: var(--surface); box-shadow: none; font-size: 14px; }
.capture kbd { position: absolute; right: 10px; pointer-events: none; }
.capture-open { display: none; }
.timer-pill {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; max-width: 240px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 600;
  text-decoration: none !important; min-width: 0;
}
.timer-pill .t-time { font-variant-numeric: tabular-nums; }
.timer-pill .t-name { color: var(--ink-2); font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.timer-pill.is-break .status-dot { background: var(--ink-3); animation: none; }
.tabbar { display: none; }

.main { padding: 48px 24px 120px; outline: none; }
.view { max-width: var(--w); margin: 0 auto; animation: enter .25s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } }
.loading { height: 40vh; }

/* ---------- Encabezados ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.page-head h1 { overflow-wrap: anywhere; }
.page-head .sub { margin-top: 4px; color: var(--ink-2); font-size: 14px; }
.page-head .sub a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.page-head .sub a:hover { color: var(--ink); }
.head-stat { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.head-stat .k { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.head-stat .v { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.back:hover { color: var(--ink); text-decoration: none; }
.back svg { width: 14px; height: 14px; }

.section { margin-top: 32px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; min-height: 24px; }
.section-title { font-size: 13px; line-height: 20px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; text-transform: none; }
.panel .section-title { margin-bottom: 12px; }
.section-meta { font-size: 13px; color: var(--ink-3); }
.section-meta a { color: var(--ink-2); font-weight: 500; }
.group { margin-top: 24px; }
.group:first-child { margin-top: 0; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.empty-text { color: var(--ink-3); font-size: 14px; padding: 12px 0; }
.page-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- Tarjeta de foco (Hoy) ---------- */
.focus {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 24px; transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.focus.leaving { opacity: 0; transform: translateY(-6px); }
.focus-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; min-height: 20px; }
.focus-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--accent-text); }
.focus.calm .focus-label, .focus.is-break .focus-label { color: var(--ink-2); }
.focus-label svg { width: 14px; height: 14px; }
.focus-count { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.focus-title { font-size: 22px; line-height: 30px; font-weight: 650; letter-spacing: -.015em; overflow-wrap: anywhere; }
.focus-meta { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.focus-actions { display: flex; align-items: center; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.clock { margin-top: 20px; font-size: 56px; line-height: 1; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.is-break .clock { margin-top: 4px; color: var(--ink-2); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.status-dot.live { background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 22%, transparent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--live) 8%, transparent); } }
.is-running .focus-label { color: var(--live); }
.hoy-foot { display: flex; justify-content: center; margin-top: 24px; }

/* ---------- Listas ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 16px; border-top: 1px solid var(--line); transition: background .12s, opacity .25s, transform .25s; }
.row:first-child { border-top: 0; }
.row.clickable { cursor: pointer; }
.row.clickable:hover { background: var(--hover); }
.row.is-current { background: var(--accent-soft); }
.row.is-current .row-title { font-weight: 600; }
.row.collapsing { opacity: 0; transform: translateX(8px); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 14px; line-height: 20px; font-weight: 500; overflow-wrap: anywhere; }
.row-sub { color: var(--ink-2); font-weight: 400; }
.row-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; font-size: 13px; color: var(--ink-3); }
.row-meta:empty { display: none; }
.row-meta .tag { color: var(--ink-2); }
.row-side { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row.is-done .row-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.list.is-waiting .row-title { color: var(--ink-2); }
.row-more {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 36px; margin-top: 4px; padding: 0 16px;
  background: none; border: 0; border-radius: var(--r); font: 500 13px/1 var(--sans); color: var(--ink-2); cursor: pointer;
}
.row-more:hover { background: var(--hover); color: var(--ink); }
.row-more svg { width: 14px; height: 14px; }

.check {
  display: grid; place-items: center; width: 18px; height: 18px; flex: none; padding: 0;
  border: 1.5px solid var(--line-2); border-radius: 50%; background: var(--surface); color: transparent; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.check:hover { border-color: var(--accent); }
.check svg { width: 12px; height: 12px; stroke-width: 2.6; }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.badge, .chip, .tag {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 550; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.row-meta .tag { height: auto; padding: 0; background: none; border: 0; font-size: 13px; font-weight: 500; }
.badge.accent, .chip.accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }

.today-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; flex: none;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-2);
  font: 550 12px/1 var(--sans); cursor: pointer; opacity: .9;
}
.today-btn svg { width: 12px; height: 12px; stroke-width: 2.2; }
.today-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.today-btn.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.plain-list li:first-child { border-top: 0; padding-top: 0; }
.plain-list li:last-child { padding-bottom: 0; }

/* ---------- Paneles y tarjetas ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.panel-head { margin-bottom: 16px; }
.panel-title { font-size: 17px; line-height: 24px; font-weight: 650; }
.panel-sub { margin-top: 2px; font-size: 14px; color: var(--ink-2); }
.panel-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-row p { font-size: 14px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.two > .panel + .panel { margin-top: 0; }
.notes-text { white-space: pre-wrap; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.notes-panel summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.notes-panel summary::-webkit-details-marker { display: none; }
.notes-panel summary::after { content: "+"; font-size: 16px; color: var(--ink-3); }
.notes-panel[open] summary::after { content: "−"; }
.notes-panel[open] summary { margin-bottom: 12px; }

/* Proyectos y clientes como lista */
.cards { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.card { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none !important; transition: background .12s; }
.card:first-child { border-top: 0; }
.card:hover { background: var(--hover); }
.card h3 { font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.card .meta { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.card .bar { display: none; }

.hitos .plain-list li .grow { line-height: 1.4; }

/* Ideas sueltas */
.inbox-card { margin-bottom: 32px; }
.inbox-card > .inbox-item:first-of-type { border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg); border-top: 1px solid var(--line); }
.inbox-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; background: var(--surface); border: 1px solid var(--line); border-top: 0; font-size: 14px; }
.inbox-item:last-child { border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); }
.inbox-item p { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.inline-actions { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; flex-wrap: wrap; }

/* ---------- Ritual de inicio ---------- */
.ritual { padding: 0; overflow: hidden; }
.ritual .panel-head { padding: 20px 20px 0; }
.callout { margin: 0 20px 16px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); font-size: 14px; }
.callout-k { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 2px; }
.pick-list { border-top: 1px solid var(--line); }
.pick-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 20px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; -webkit-tap-highlight-color: transparent; }
.pick-row:hover { background: var(--hover); }
.pick-row.on { background: var(--accent-soft); }
.pick-n { display: grid; place-items: center; width: 20px; height: 20px; flex: none; border: 1.5px solid var(--line-2); border-radius: var(--r-sm); font-size: 12px; font-weight: 700; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.pick-row.on .pick-n { background: var(--accent); border-color: var(--accent); }
.pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pick-title { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.pick-row.on .pick-title { font-weight: 600; }
.pick-meta { font-size: 13px; color: var(--ink-3); }
.pick-meta .why { color: var(--ink-2); }
.more-wrap { padding: 8px 20px; border-bottom: 1px solid var(--line); }
.ritual .add-inline { padding: 12px 20px; border-bottom: 1px solid var(--line); }
.ritual-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; background: var(--surface-2); }
.ritual-count { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.slots { display: inline-flex; gap: 4px; }
.slots i { width: 16px; height: 4px; border-radius: 2px; background: var(--line-2); }
.slots i.on { background: var(--accent); }

/* ---------- Formularios ---------- */
.add-inline { display: flex; gap: 8px; align-items: center; }
.add-inline input { flex: 1; min-width: 0; }
.section > .add-inline { margin-bottom: 24px; }
input[type="text"], input[type="password"], input[type="date"], input[type="number"], input[type="url"], input:not([type]), select, textarea {
  width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font: 400 14px/1.4 var(--sans); box-shadow: var(--shadow-sm);
  transition: border-color .12s, box-shadow .12s; -webkit-appearance: none; appearance: none;
}
select { padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238D8D96' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; }
textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="date"] { min-width: 0; display: block; }
input[type="file"] { display: block; width: 100%; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.form { display: flex; flex-direction: column; gap: 16px; }
.form label, .field { display: block; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.form label > input, .form label > select, .form label > textarea { margin-top: 6px; }
.form label .hint { margin-left: 4px; }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.toggles { display: flex; flex-direction: column; gap: 10px; }
.form label.check, label.check { display: flex; align-items: center; gap: 10px; width: auto; height: auto; border: 0; border-radius: 0; background: none; font-size: 14px; font-weight: 400; color: var(--ink); cursor: pointer; }
label.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; }
.form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }

/* Segmentado */
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); flex: none; }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: none; font: 500 13px/1 var(--sans); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.seg.wide { margin-bottom: 24px; }
.seg.moods button { min-width: 96px; }

/* ---------- Cifras ---------- */
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.stat { background: var(--surface); padding: 16px 20px; }
.stat .k { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.stat .v { margin-top: 4px; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 12px; }
.totals + .panel, .totals + .two { margin-top: 16px; }
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar-top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 6px; }
.hbar-top span:last-child { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar-sub { font-size: 12px; color: var(--ink-3); }
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.vbars { display: flex; align-items: flex-end; gap: 8px; height: 160px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.vbar .col { flex: 1; width: 100%; max-width: 36px; display: flex; align-items: flex-end; }
.vbar .col i { display: block; width: 100%; background: var(--accent); opacity: .85; border-radius: 4px 4px 2px 2px; }
.vbar .col i.zero { background: var(--line-2); opacity: 1; }
.vbar.today .col i { opacity: 1; }
.vbar .val { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; min-height: 14px; white-space: nowrap; }
.vbar .lab { font-size: 12px; color: var(--ink-2); }
.vbar.today .lab { color: var(--ink); font-weight: 600; }
.review-line { font-size: 16px; line-height: 1.6; }

/* Cobranza */
.row.inv { align-items: center; }
.row.inv .row-title { font-size: 15px; }
.row.inv .row-title .num { font-weight: 650; }

/* Notas y avisos */
.note-card { padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); font-size: 14px; margin-bottom: 16px; }
.note-k { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 2px; }

/* ---------- Hoja (diálogo) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 10, 14, .45); z-index: 40; animation: fade .15s both; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 50%; top: 12vh; transform: translateX(-50%); z-index: 41;
  width: min(560px, calc(100vw - 32px)); max-height: 76vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 20px 24px 24px; animation: pop .18s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, 6px) scale(.99); } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.sheet-head h2 { font-size: 17px; overflow-wrap: anywhere; }
.sheet .section-title { margin-bottom: 8px; }

/* ---------- Aviso ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--tab-h) + env(safe-area-inset-bottom)); transform: translate(-50%, 8px); z-index: 60;
  max-width: min(480px, calc(100vw - 32px)); padding: 10px 14px; border-radius: var(--r);
  background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: none; border: 0; color: inherit; font: 650 14px/1 var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; margin-left: 8px; padding: 2px; }

/* ---------- Entrada e instalador ---------- */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 32px 16px; background: var(--sidebar); }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 32px; }
.auth-card .brand-mark { width: 32px; height: 32px; }
.auth-card .brand-mark svg { width: 32px; height: 32px; }
.auth-card h1 { margin: 20px 0 4px; font-size: 22px; line-height: 30px; }
.auth-card > .muted { margin-bottom: 24px; font-size: 14px; }
.auth-card .btn-block { margin-top: 4px; height: 36px; }
.note { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin: 0 0 16px; font-size: 14px; }
.checks { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.checks .ok span { color: var(--live); font-weight: 600; }
.checks .no { color: var(--ink); }

/* ---------- Celular ---------- */
@media (max-width: 760px) {
  :root { --tab-h: 60px; }
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 20; height: var(--top-h);
    padding: 0 max(8px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
    padding-top: env(safe-area-inset-top); height: calc(var(--top-h) + env(safe-area-inset-top));
    background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent; transition: border-color .2s;
  }
  .topbar.scrolled { border-bottom-color: var(--line); }
  .topbar .brand { padding: 0 4px; }
  .topbar .timer-pill { margin: 0 0 0 4px; max-width: 46vw; }
  .icon-btn { width: 40px; height: 40px; }
  .icon-btn svg { width: 20px; height: 20px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: 0 8px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-3); font-size: 11px; font-weight: 600; text-decoration: none !important; -webkit-tap-highlight-color: transparent; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--ink); }
  .tabbar a.active svg { color: var(--accent-text); }
  .main { margin-left: 0; padding: 16px 16px calc(var(--tab-h) + 40px + env(safe-area-inset-bottom)); min-height: 0; }
  h1 { font-size: 22px; line-height: 28px; }
  .page-head { margin-bottom: 20px; align-items: flex-end; }
  .page-head > div:first-child { flex-basis: 0; }
  .focus { padding: 20px 16px; }
  .focus-title { font-size: 20px; line-height: 28px; }
  .clock { font-size: 48px; }
  .focus-actions .btn-lg { flex: 1 1 calc(50% - 4px); }
  .focus-actions .btn-hero, .focus-actions .done-cta { flex-basis: 100%; height: 44px; }
  .focus-actions .grow { display: none; }
  .row { padding: 10px 12px; gap: 10px; }
  .row.wrap, .row.inv { flex-wrap: wrap; }
  .row.inv .seg, .row .seg { margin-left: 28px; }
  .row.inv .seg { margin-left: 0; }
  .pick-row { padding: 10px 16px; }
  .ritual .panel-head, .ritual .add-inline, .ritual-foot, .more-wrap { padding-left: 16px; padding-right: 16px; }
  .callout { margin-left: 16px; margin-right: 16px; }
  .ritual-foot .btn { flex: 1; }
  .two, .form-row { grid-template-columns: minmax(0, 1fr); }
  .panel-row { flex-direction: column; align-items: flex-start; }
  .card { flex-direction: column; align-items: flex-start; gap: 2px; }
  .sheet { top: auto; bottom: 0; left: 0; transform: none; width: 100%; max-height: 88vh; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); animation-name: up; }
  @keyframes up { from { transform: translateY(16px); opacity: 0; } }
  .seg.wide { display: flex; overflow-x: auto; }
  .seg.moods { display: flex; }
  .seg.moods button { flex: 1; min-width: 0; }
  .page-foot .btn { flex: 1; }
  .stat { padding: 12px 16px; }
  .stat .v { font-size: 20px; line-height: 28px; }
  .totals { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Metadatos en una sola línea, sin desbordar */
.row-meta { gap: 2px 0; }
.row-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.row-meta span + span::before { content: "·"; margin: 0 6px; color: var(--ink-3); }
.row.inv .row-meta span { white-space: normal; }
.pick-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-card .section-head + .inbox-item { border-top: 1px solid var(--line); border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg); }
.row.inv .row-meta { flex-direction: column; }
.row.inv .row-meta span + span::before { content: none; }
@media (max-width: 760px) {
  .row.inv { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px; }
  .row.inv .seg { display: flex; }
  .row.inv .seg button { flex: 1; }
  .row.wrap .row-main, .row:has(.seg) .row-main { flex-basis: 100%; }
}


/* ================= v4 · lenguaje editorial ================= */
h1, .page-head h1 { font-family: var(--display); font-weight: 450; font-variation-settings: "SOFT" 100, "opsz" 96; letter-spacing: -.02em; }
.page-head { align-items: flex-end; padding-bottom: 24px; margin-bottom: 32px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: 48px; line-height: 1.05; }
.page-head .sub { margin-top: 12px; font-size: 15px; }
.back { margin-bottom: 16px; }
.section { margin-top: 48px; }
.section-head { margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.section-title, .panel .section-title { font: 650 11.5px/16px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.panel .section-title { margin-bottom: 16px; }
.group { margin-top: 40px; }
.panel { border-radius: var(--r-lg); padding: 24px; }
.list, .cards { border-radius: var(--r-lg); }

/* Hoy: portada */
.mast { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; margin-bottom: 40px; }
.kicker { font: 650 12px/16px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text); }
.mast-date { margin-top: 12px; font: 400 104px/.95 var(--display); letter-spacing: -.035em; font-variation-settings: "SOFT" 100, "WONK" 0, "opsz" 144; }
.mast-line { margin-top: 16px; font-size: 17px; color: var(--ink-2); }
.mast-stat { margin: 0; text-align: right; padding-bottom: 6px; }
.mast-stat dt { font: 650 11.5px/16px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.mast-stat dd { margin: 6px 0 0; font: 400 32px/1 var(--display); font-variant-numeric: tabular-nums; }

/* Tarjeta Lo siguiente: dominante */
.focus { position: relative; padding: 48px 56px 48px; border-radius: var(--r-xl); min-height: 380px; display: flex; flex-direction: column; overflow: hidden; }
.focus::before { content: ""; position: absolute; left: 56px; top: 0; width: 72px; height: 4px; border-radius: 0 0 4px 4px; background: var(--accent); }
.focus.calm::before, .focus.is-break::before { background: var(--line-2); }
.focus.is-running::before { background: var(--live); width: 100%; left: 0; border-radius: 0; height: 3px; }
.focus-top { margin-bottom: 24px; }
.focus-label { font: 650 12px/16px var(--sans); letter-spacing: .16em; text-transform: uppercase; }
.focus-label svg { width: 14px; height: 14px; }
.focus-count { font: 600 13px/16px var(--sans); letter-spacing: .08em; }
.focus-title { font: 400 52px/1.05 var(--display); letter-spacing: -.025em; font-variation-settings: "SOFT" 100, "opsz" 144; max-width: 18ch; }
.focus-meta { margin-top: 16px; font-size: 16px; }
.focus-actions { margin-top: auto; padding-top: 40px; gap: 12px; }
.btn-hero { height: 64px; padding: 0 36px 0 28px; border-radius: 999px; font-size: 19px; font-weight: 650; gap: 12px; }
.btn-hero svg { width: 20px; height: 20px; }
.focus .btn-lg { height: 64px; padding: 0 24px; border-radius: 999px; font-size: 16px; }
.focus .btn-ghost.btn-lg { color: var(--ink-2); }
.clock { margin-top: 32px; font: 400 120px/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; font-variation-settings: "opsz" 144; }
.is-break .clock { margin-top: 0; }
.focus-count[data-nudge] { letter-spacing: 0; font-weight: 500; }

/* Plan de hoy: tres columnas numeradas */
.plan { margin-top: 48px; }
.plan-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan-cell { display: flex; flex-direction: column; min-height: 148px; padding: 20px 20px 18px; border-top: 2px solid var(--line-2); background: none; cursor: pointer; transition: background .15s, border-color .15s; border-radius: 0; }
.plan-cell:hover { background: var(--hover); }
.plan-cell.is-current { border-top-color: var(--accent); }
.plan-cell.is-done { border-top-color: var(--live); }
.plan-cell.is-empty { cursor: default; }
.plan-cell.is-empty:hover { background: none; }
.plan-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.plan-n { font: 400 28px/1 var(--display); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.plan-cell.is-current .plan-n { color: var(--accent-text); }
.plan-title { font-size: 15px; line-height: 1.4; font-weight: 550; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.plan-cell.is-done .plan-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.plan-cell.is-empty .plan-title a { color: var(--ink-3); font-weight: 500; }
.plan-state { margin-top: auto; padding-top: 12px; font: 650 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.plan-cell.is-current .plan-state { color: var(--accent-text); }
.plan-cell.is-done .plan-state { color: var(--live); }
.hoy-foot { justify-content: flex-start; margin-top: 32px; }

/* Ritual */
.ritual { border-radius: var(--r-xl); }
.ritual .panel-head { padding: 40px 40px 24px; }
.panel-title { font: 400 40px/1.08 var(--display); letter-spacing: -.02em; font-variation-settings: "SOFT" 100, "opsz" 96; }
.panel-sub { margin-top: 12px; font-size: 16px; }
.pick-row { padding: 16px 40px; min-height: 64px; gap: 16px; }
.pick-n { width: 28px; height: 28px; border-radius: 50%; font: 500 14px/1 var(--display); }
.pick-title { font-size: 16px; }
.more-wrap, .ritual .add-inline, .ritual-foot { padding-left: 40px; padding-right: 40px; }
.ritual-foot { padding-top: 20px; padding-bottom: 20px; }
.ritual-foot .btn { height: 52px; padding: 0 28px; border-radius: 999px; font-size: 16px; }
.callout { margin: 0 40px 24px; }

/* Listas, tablas y tarjetas */
.row { min-height: 56px; padding: 12px 20px; }
.row-title { font-size: 15px; }
.card { min-height: 64px; padding: 16px 20px; }
.card h3 { font: 450 20px/1.25 var(--display); letter-spacing: -.01em; }
.card .meta { font-size: 13px; }
.row.inv .row-title .num { font: 400 22px/1.2 var(--display); letter-spacing: -.01em; }
.stat { padding: 20px 24px; }
.stat .k { font: 650 11.5px/16px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.stat .v { margin-top: 8px; font: 400 36px/1.1 var(--display); letter-spacing: -.02em; }
.btn-primary { box-shadow: 0 10px 24px -14px var(--accent); }
.page-foot .btn-lg, .page-head .btn { border-radius: 999px; }
.btn-lg { height: 44px; padding: 0 20px; }
.notes-panel summary { font: 650 11.5px/16px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.sheet-head h2 { font: 450 26px/1.15 var(--display); }
.sheet { border-radius: var(--r-xl); padding: 24px 28px 28px; }
.auth-card h1 { font-size: 36px; line-height: 1.1; }
.auth-card { border-radius: var(--r-xl); padding: 40px; }

@media (max-width: 1100px) {
  .capture { width: 200px; }
}
@media (max-width: 960px) {
  .capture { display: none; }
  .capture-open { display: inline-grid; }
}
@media (max-width: 760px) {
  :root { --tab-h: 60px; }
  .topbar { display: flex; grid-template-columns: none; gap: 4px; height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); border-bottom-color: transparent; }
  .topbar.scrolled { border-bottom-color: var(--line); }
  .top-left { flex: none; }
  .top-right { flex: 1; }
  .nav { display: none; }
  .timer-pill { max-width: 44vw; margin-right: auto; margin-left: 8px; }
  .main { padding: 16px 16px calc(var(--tab-h) + 40px + env(safe-area-inset-bottom)); }
  .mast { grid-template-columns: 1fr; gap: 16px; margin-bottom: 24px; }
  .mast-date { font-size: 64px; margin-top: 8px; }
  .mast-line { margin-top: 12px; font-size: 16px; }
  .mast-stat { text-align: left; display: flex; align-items: baseline; gap: 12px; padding: 0; }
  .mast-stat dd { margin: 0; font-size: 22px; }
  .focus { padding: 32px 20px 24px; min-height: 0; border-radius: var(--r-lg); }
  .focus::before { left: 20px; }
  .focus-title { font-size: 34px; }
  .focus-actions { padding-top: 32px; }
  .focus-actions .btn-hero, .focus-actions .done-cta { flex: 1 1 100%; height: 60px; }
  .focus .btn-lg { flex: 1 1 calc(50% - 6px); height: 52px; }
  .clock { font-size: 84px; margin-top: 24px; }
  .plan { margin-top: 32px; }
  .plan-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .plan-cell { min-height: 0; flex-direction: row; align-items: center; gap: 16px; padding: 14px 4px; border-top-width: 1px; }
  .plan-cell.is-current, .plan-cell.is-done { border-top-width: 1px; }
  .plan-top { margin: 0; order: 0; gap: 16px; flex-direction: row-reverse; }
  .plan-n { font-size: 22px; width: 30px; }
  .plan-title { flex: 1; font-size: 15px; -webkit-line-clamp: 2; }
  .plan-state { margin: 0; padding: 0; }
  .page-head { padding-bottom: 16px; margin-bottom: 24px; }
  .page-head h1 { font-size: 34px; }
  .ritual .panel-head { padding: 28px 20px 20px; }
  .panel-title { font-size: 30px; }
  .pick-row { padding: 14px 20px; }
  .more-wrap, .ritual .add-inline, .ritual-foot { padding-left: 20px; padding-right: 20px; }
  .callout { margin-left: 20px; margin-right: 20px; }
  .card h3 { font-size: 18px; }
  .stat .v { font-size: 26px; }
  .section { margin-top: 36px; }
  .sheet { border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
}
.panel.ritual { padding: 0; }
.clock { font: 300 112px/1 var(--sans); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .clock { font-size: 76px; } }
@media (max-width: 760px) { .plan .section-head { border-bottom: 0; margin-bottom: 4px; } }

/* ================= v4.1 · archivos y notas ================= */
.files.is-compact .section-head { margin-bottom: 12px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 136px; padding: 24px; border: 1.5px dashed var(--line-2); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: var(--ink-3); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); color: var(--accent-text); margin-bottom: 4px; }
.drop-ico svg { width: 20px; height: 20px; }
.drop-text { font-size: 15px; }
.drop-text b { color: var(--ink); font-weight: 600; }
.drop-hint { font-size: 13px; color: var(--ink-3); max-width: 52ch; }
.is-compact .dropzone { min-height: 104px; padding: 16px; }
.files-forms { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.files-forms .btn svg { width: 14px; height: 14px; }
.is-compact .files-forms { grid-template-columns: minmax(0, 1fr); }
.files-list { margin-top: 16px; }
.file-row { gap: 14px; }
.file-ico { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--r); background: var(--surface-2); color: var(--ink-2); }
.file-ico svg { width: 18px; height: 18px; }
a.file-name { display: block; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.file-name:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.note-body { font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.file-row .icon-btn { flex: none; }
.file-row .icon-btn.confirm { color: var(--accent-text); background: var(--accent-soft); }
@media (max-width: 760px) {
  .files-forms { grid-template-columns: minmax(0, 1fr); }
  .dropzone { min-height: 112px; }
}
.file-row .row-meta { flex-wrap: nowrap; overflow: hidden; }
.file-row .row-meta span:last-child { min-width: 0; }

/* ================= v5 · Command Center: oscuro, verde lima, sans contemporánea ================= */
:root {
  --bg: #F4F5F1; --sidebar: #ECEDE8; --surface: #FFFFFF; --surface-2: #EEF0EA; --hover: #F0F1EC;
  --line: #E1E3DC; --line-2: #CDD0C6; --ink: #0F1112; --ink-2: #4E5450; --ink-3: #848A85;
  --accent: #C8F031; --accent-hover: #D5F75A; --accent-ink: #0B0D0F; --accent-soft: rgba(132, 170, 0, .12); --accent-text: #4C6B00;
  --live: #4C6B00;
  --display: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --w: 1200px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0D0F; --sidebar: #101316; --surface: #13171A; --surface-2: #1A1F23; --hover: #1A1F23;
    --line: #22282C; --line-2: #2F363B; --ink: #F2F4F1; --ink-2: #A3ABA6; --ink-3: #6C7570;
    --accent: #C8F031; --accent-hover: #D7FA5C; --accent-ink: #0B0D0F; --accent-soft: rgba(200, 240, 49, .10); --accent-text: #C8F031; --live: #C8F031;
  }
}
:root[data-theme="dark"] {
  --bg: #0B0D0F; --sidebar: #101316; --surface: #13171A; --surface-2: #1A1F23; --hover: #1A1F23;
  --line: #22282C; --line-2: #2F363B; --ink: #F2F4F1; --ink-2: #A3ABA6; --ink-3: #6C7570;
  --accent: #C8F031; --accent-hover: #D7FA5C; --accent-ink: #0B0D0F; --accent-soft: rgba(200, 240, 49, .10); --accent-text: #C8F031; --live: #C8F031;
}
.btn-primary { box-shadow: none; font-weight: 650; }
.btn-primary svg { stroke-width: 2.2; }

/* titulares: sans apretada, sin serif */
h1, .page-head h1 { font-family: var(--display); font-weight: 650; font-variation-settings: normal; letter-spacing: -.035em; }
.page-head h1 { font-size: 44px; line-height: 1.04; }
.mast-date { font: 650 88px/.95 var(--display); letter-spacing: -.045em; font-variation-settings: normal; }
.focus-title { font: 650 46px/1.05 var(--display); letter-spacing: -.035em; font-variation-settings: normal; }
.clock { font: 300 112px/1 var(--display); letter-spacing: -.04em; font-variation-settings: normal; }
.panel-title { font: 650 34px/1.08 var(--display); letter-spacing: -.03em; font-variation-settings: normal; }
.card h3 { font: 650 19px/1.25 var(--display); letter-spacing: -.02em; }
.stat .v { font: 650 34px/1.1 var(--display); letter-spacing: -.035em; }
.sheet-head h2 { font: 650 24px/1.15 var(--display); letter-spacing: -.025em; }
.plan-n, .mast-stat dd, .pick-n, .row.inv .row-title .num { font-family: var(--display); font-variation-settings: normal; }
.plan-n { font-weight: 600; }
.mast-stat dd { font-weight: 600; letter-spacing: -.02em; }
.kicker { font: 600 12px/16px var(--mono); letter-spacing: .14em; color: var(--accent-text); }
.kicker a { color: inherit; }
.page-head .kicker { margin-bottom: 10px; }
.page-head > div:first-child { min-width: 0; }

/* marca */
.brand { gap: 12px; font-family: var(--sans); }
.brand-badge { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: 750 13px/1 var(--sans); letter-spacing: .02em; }
.brand-text { display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.brand-word { font: 700 15px/1 var(--sans); letter-spacing: -.01em; }
.brand-sub { font: 500 11px/1 var(--mono); color: var(--accent-text); letter-spacing: .02em; }
.topbar { grid-template-columns: auto 1fr auto; gap: 24px; }
.nav { justify-self: center; border: 0; background: none; padding: 0; gap: 4px; }
.nav a { height: 36px; padding: 0 12px; border-radius: 8px; font-size: 14px; }
.nav a:hover { background: var(--hover); }
.nav a.active { background: none; color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.capture { width: 220px; }
@media (max-width: 1240px) { .topbar .capture { display: none; } .capture-open { display: inline-grid; } .nav a { padding: 0 10px; } }
@media (max-width: 1000px) and (min-width: 761px) { .brand-text { display: none; } .nav a { padding: 0 8px; font-size: 13.5px; } }
@media (max-width: 760px) {
  .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; background: none; color: var(--ink-3); font: 600 11px/1 var(--sans); -webkit-tap-highlight-color: transparent; }
  .tabbar button svg { width: 22px; height: 22px; }
  .tabbar button.active { color: var(--ink); }
  .tabbar button.active svg, .tabbar a.active svg { color: var(--accent); }
  .page-head h1 { font-size: 32px; }
  .mast-date { font-size: 52px; }
  .focus-title { font-size: 28px; line-height: 1.1; }
  .brand-sub { display: none; }
}
.tabbar button { cursor: pointer; }

/* pestañas de espacio de trabajo */
.ws-head { display: flex; align-items: flex-end; gap: 20px; padding-bottom: 24px; }
.ws-main { flex: 1; min-width: 0; }
.ws-main h1 { font-size: 44px; line-height: 1.04; margin-top: 8px; }
.ws-main .sub { margin-top: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 32px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; color: var(--ink-2); font-weight: 550; text-decoration: none !important; box-shadow: inset 0 -2px 0 transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.tab-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 650; }
.tabs a.on .tab-n { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 760px) {
  .ws-head { flex-wrap: wrap; gap: 14px; }
  .ws-head .inline-actions { width: 100%; flex-wrap: wrap; }
  .ws-main h1 { font-size: 30px; }
  .tabs { margin: 0 -16px 24px; padding: 0 8px; }
}

/* logos y avatares */
.logo { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.logo b { font: 700 14px/1 var(--sans); color: var(--ink-2); letter-spacing: .02em; }
.logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.logo.sm { width: 26px; height: 26px; border-radius: 6px; }
.logo.sm b { font-size: 10px; }
.logo.lg { width: 72px; height: 72px; border-radius: 14px; }
.logo.lg b { font-size: 22px; }
.avatar { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink); font: 650 12px/1 var(--sans); }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatars { display: flex; margin-top: 14px; }
.avatars .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }

/* tarjetas */
.pcard, .ccard { min-height: 0; }
.pcard { display: flex; flex-direction: column; align-items: stretch; }
.pcard-top { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; min-width: 0; }
.pcard-top .eyebrow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.ccard { display: flex; flex-direction: row !important; align-items: center !important; gap: 14px !important; }
.status { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font: 600 12px/1 var(--sans); background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.s-activo { color: var(--accent-text); background: var(--accent-soft); }
.status.s-recurrente { color: var(--ink); }
.stat.link { text-decoration: none !important; color: inherit; display: block; transition: border-color .15s, background .15s; }
.stat.link:hover { border-color: var(--line-2); background: var(--hover); }
.kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 16px; }
@media (max-width: 960px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
.cc-mast { align-items: end; }
.cc-mast .mast-date { font-size: 64px; }
@media (max-width: 760px) { .cc-mast .mast-date { font-size: 38px; } }
.cc-grid { margin-top: 16px; }
.cc-grid .panel { margin: 0; }
.li-title { display: block; font-weight: 550; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.plain-list li .soft-text { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.plain-list li.clickable { cursor: pointer; margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 8px; }
.plain-list li.clickable:hover { background: var(--hover); }
.plain-list li .grow { min-width: 0; }
.date-tag { flex: none; width: 44px; text-align: center; font: 600 10.5px/1.1 var(--mono); text-transform: uppercase; color: var(--ink-3); letter-spacing: .06em; }
.date-tag b { display: block; font: 650 20px/1 var(--display); color: var(--ink); letter-spacing: -.02em; margin-bottom: 3px; }
.activity li { align-items: flex-start; }
.activity .act-d { color: var(--ink-2); }
.activity .soft-text { font-size: 12.5px; }
.chip.ok { color: var(--accent-text); background: var(--accent-soft); }
.tag.hi { color: var(--accent-ink); background: var(--accent); }
.empty-box { padding: 40px 24px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); text-align: center; display: grid; justify-items: center; gap: 16px; color: var(--ink-2); }
.empty-box p { max-width: 52ch; }

/* pares clave/valor */
.kv { margin: 0; display: grid; gap: 0; }
.kv > div { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.kv > div:first-child { border-top: 0; padding-top: 0; }
.kv dt { color: var(--ink-3); font-size: 13.5px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.roles-help .kv > div { grid-template-columns: 180px 1fr; }
@media (max-width: 760px) { .kv > div, .roles-help .kv > div { grid-template-columns: 1fr; gap: 2px; } }

/* accesos */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
@media (max-width: 760px) { .acc-grid { grid-template-columns: 1fr; } }
.acc { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; display: grid; gap: 16px; transition: border-color .15s; min-width: 0; }
.acc:hover { border-color: var(--line-2); }
.acc-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.acc-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); font: 700 13px/1 var(--sans); }
.acc-main { flex: 1; min-width: 0; }
.acc-main h3 { font-size: 15.5px; }
.acc-main .soft-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc .kv dt, .acc .kv dd { font-size: 13px; }
.acc-foot { display: flex; flex-wrap: wrap; gap: 6px; }
.access-note { margin-top: 20px; }

/* solicitudes */
.req-list { display: grid; gap: 12px; }
.req { padding: 20px 22px; border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); display: grid; gap: 10px; }
.req.pendiente { border-left-color: var(--accent); }
.req-head { display: flex; align-items: center; gap: 10px; }
.req h3 { font: 650 18px/1.3 var(--display); letter-spacing: -.015em; }
.req-body { color: var(--ink-2); white-space: pre-wrap; }
.req-resp { padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); white-space: pre-wrap; }
.req-resp .section-title { margin-bottom: 6px; }
.req .form-actions { margin-top: 4px; }

/* decisiones */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline li.clickable { cursor: pointer; }
.timeline li.clickable:hover .tl-title { text-decoration: underline; text-underline-offset: 3px; }
.tl-date { font: 600 12px/22px var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.tl-title { font-weight: 600; }
.tl-body { margin-top: 4px; color: var(--ink-2); white-space: pre-wrap; }
@media (max-width: 760px) { .timeline li { grid-template-columns: 1fr; gap: 4px; } }

/* biblioteca */
.lib-up { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; margin-bottom: 24px; align-items: stretch; }
.lib-up .dropzone { min-height: 100%; }
.lib-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.lib-opts > label { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 550; }
.lib-opts .add-inline { grid-column: 1 / -1; margin: 0; }
@media (max-width: 860px) { .lib-up { grid-template-columns: 1fr; } }
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; }
.fchip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: none; color: var(--ink-2); font: 550 13px/1 var(--sans); cursor: pointer; }
.fchip:hover { color: var(--ink); }
.fchip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.vis-filter { width: auto; height: 32px; font-size: 13px; padding: 0 30px 0 10px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
@media (max-width: 760px) { .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.lib-card { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); cursor: pointer; transition: border-color .15s, transform .15s; min-width: 0; }
.lib-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.thumb { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.is-icon { gap: 6px; align-content: center; color: var(--ink-3); }
.thumb.is-icon svg { width: 34px; height: 34px; stroke-width: 1.4; }
.thumb.is-icon span { font: 600 11px/1 var(--mono); letter-spacing: .08em; }
.thumb-badge { position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(0, 0, 0, .6); color: #fff; }
.lib-meta { padding: 12px 14px 14px; display: grid; gap: 4px; }
.lib-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-meta .soft-text { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-tags { display: flex; gap: 8px; align-items: center; min-width: 0; margin-top: 4px; }
.lib-tags .soft-text { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vis { flex: none; font: 600 11px/1 var(--sans); padding: 4px 7px; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); }
.vis.v-cliente, .vis.v-entregable { background: var(--accent-soft); color: var(--accent-text); }
.vis.v-confidencial { background: var(--ink); color: var(--bg); }
.preview { border-radius: var(--r-lg); overflow: hidden; background: #000; display: grid; place-items: center; margin-bottom: 16px; }
.preview img { max-width: 100%; max-height: 62vh; display: block; }
.preview.video { aspect-ratio: 16 / 9; }
.preview.video iframe, .preview.video video { width: 100%; height: 100%; border: 0; display: block; }
.preview.pdf { height: 62vh; background: var(--surface-2); }
.preview.pdf iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.preview.is-icon { background: var(--surface-2); padding: 40px 24px; gap: 14px; color: var(--ink-3); text-align: center; }
.preview.is-icon svg { width: 40px; height: 40px; }

/* hoja de tarea */
.sheet { width: min(720px, calc(100vw - 32px)); }
.input-lg { font-size: 18px !important; font-weight: 600; height: 48px !important; }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .form-row.three { grid-template-columns: 1fr; } }
.parent-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.checklist { list-style: none; margin: 0 0 12px; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist li.done .grow { color: var(--ink-3); text-decoration: line-through; }
.sub-list { margin-bottom: 12px; }
.mods { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 0; display: grid; gap: 8px; }
.mods legend { padding: 0 6px; font-size: 13px; color: var(--ink-2); font-weight: 550; }
.more-fields { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.more-fields summary { cursor: pointer; font-weight: 550; color: var(--ink-2); }
.more-fields[open] summary { margin-bottom: 14px; }
.more-fields > * + * { margin-top: 14px; }
.more-nav { display: grid; }
.more-nav a { display: flex; align-items: center; justify-content: space-between; padding: 16px 4px; border-top: 1px solid var(--line); color: var(--ink); font-size: 17px; font-weight: 550; text-decoration: none !important; }
.more-nav a:first-child { border-top: 0; }
.more-nav a svg { transform: rotate(180deg); color: var(--ink-3); }
.file-row.clickable { cursor: pointer; }
.auth-card .kicker { margin-bottom: 14px; }
.ws-head { align-items: center; }
.panel .form-actions { margin-top: 16px; }
.panel > .kv + .form-actions, .panel > p + .form-actions { margin-top: 18px; }

/* ================= v5.1 · Portal del cliente (panel interno) ================= */
:root { --warn: #B26A00; --warn-soft: rgba(230, 150, 30, .14); }
:root[data-theme="dark"] { --warn: #F2B544; --warn-soft: rgba(242, 181, 68, .12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --warn: #F2B544; --warn-soft: rgba(242, 181, 68, .12); } }
.chip.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.note-warn { margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--ink); font-size: 14px; line-height: 1.45; }
.portal-status { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 22px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin-bottom: 16px; }
.portal-status.on { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.portal-status h2 { font: 650 26px/1.15 var(--display); letter-spacing: -.025em; margin: 6px 0 4px; }
.portal-status .section-title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); margin-right: 8px; vertical-align: 1px; }
.portal-status.on .section-title::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.portal-status > div:first-child { flex: 1 1 360px; min-width: 0; }
.portal-alerts { margin-bottom: 16px; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.portal-alerts li .btn { flex: none; }
.panel-list { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 4px 18px; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.unit-card { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); color: inherit; cursor: pointer; font: inherit; }
.unit-card:hover { border-color: var(--line-2); }
.unit-card.is-hidden { opacity: .55; }
.unit-cover { aspect-ratio: 16 / 9; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); overflow: hidden; }
.unit-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.unit-cover svg { width: 26px; height: 26px; }
.unit-body { display: grid; gap: 2px; padding: 12px 14px 14px; }
.unit-zone { font: 600 11px/14px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.unit-name { font: 650 17px/1.25 var(--display); letter-spacing: -.015em; }
.unit-area { font-size: 13px; color: var(--accent-text); font-weight: 600; }
.cover-pick { display: grid; gap: 12px; }
.cover-now { width: 100%; max-height: 240px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.cover-opt { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; cursor: pointer; aspect-ratio: 1; }
.cover-opt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-opt.on { border-color: var(--accent); }
.big-check { align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.big-check input { margin-top: 3px; }

/* flujo de publicación */
.stepper { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.stepper li { display: grid; gap: 6px; font-size: 11px; color: var(--ink-3); }
.stepper li span { display: block; height: 4px; border-radius: 2px; background: var(--line); font-size: 0; }
.stepper li.done span { background: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.stepper li.cur span { background: var(--accent); }
.stepper li.cur { color: var(--ink); font-weight: 600; }
.stepper em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-title { font: 650 20px/1.2 var(--display); letter-spacing: -.02em; margin: 0 0 4px; }
.pick-list { display: grid; gap: 8px; max-height: 360px; overflow: auto; padding: 2px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pick-thumb { width: 64px; flex: none; }
.pick-thumb .thumb { border-radius: 6px; aspect-ratio: 4 / 3; }
.pick-thumb .thumb.is-icon span { display: none; }
.pick-name { display: grid; min-width: 0; font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.pick-name small { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.upload-inline { align-self: flex-start; }
.choice-list { display: grid; gap: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 15px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: 4px; accent-color: var(--accent); }
.pv-frame { padding: 14px; border-radius: 14px; background: #0B0D0F; border: 1px solid #22282C; }
.pv-label { margin: 0 0 10px; font: 600 11px/14px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #6C7570; }
.pv-card { padding: 18px 20px; border-radius: 12px; background: #13171A; border: 1px solid #22282C; border-left: 3px solid #C8F031; color: #F2F4F1; }
.pv-card.is-live { margin: 14px 0; }
.pv-kicker { margin: 0 0 6px; font: 600 11px/14px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #C8F031; }
.pv-card h3 { margin: 0 0 8px; font: 650 20px/1.2 var(--display); letter-spacing: -.02em; }
.pv-summary { margin: 0; color: #A3ABA6; line-height: 1.55; white-space: pre-line; }
.pv-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pf-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font-size: 13px; text-decoration: none; }
.pv-card .pf-chip { border-color: #2F363B; background: #1A1F23; color: #F2F4F1; }
.pf-chip svg { width: 15px; height: 15px; flex: none; }
.pf-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-chip small { color: var(--ink-3); }
a.pf-chip:hover { border-color: var(--accent); }
.pv-actions { display: flex; gap: 8px; margin-top: 16px; pointer-events: none; }
.pub-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.resp-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.resp { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.resp.cliente { border-left: 3px solid var(--ink-3); }
.resp.cliente.aprobado { border-left-color: var(--accent); }
.resp.cliente.correcciones { border-left-color: var(--warn); }
.resp.agencia { background: var(--surface-2); }
.resp-head { margin: 0 0 4px; font-size: 14px; }
.resp-body { margin: 0 0 8px; white-space: pre-line; line-height: 1.5; }
@media (max-width: 760px) {
  .stepper em { display: none; }
  .portal-status { padding: 18px; }
  .portal-status .inline-actions { width: 100%; }
}
.form label.pick, .form label.choice { display: flex; flex-direction: row; color: var(--ink); font-weight: 400; }
.form label.pick { align-items: center; }
.form label.pick > input, .form label.choice > input { margin-top: 0; flex: none; }
.form label.choice > input { margin-top: 4px; }
.form label.big-check { align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.form label.big-check > input { margin-top: 3px; }
.pick-thumb { height: 48px; border-radius: 6px; overflow: hidden; }
.pick-thumb .thumb { height: 100%; aspect-ratio: auto; }

/* ---------- v5.2 · leads, resultados, presupuesto y calendario ---------- */
.growth-head { display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; }
.growth-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.growth-head h2 { font: 650 30px/1.1 var(--display); letter-spacing: -.03em; margin: 6px 0 4px; }
.funnel { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.funnel-step { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px 18px 16px; border: 0; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; font: inherit; transition: background .15s; }
.funnel-step:hover { background: var(--hover); }
.funnel-step.on { background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.funnel-n { font: 650 32px/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.funnel-l { font: 650 11px/14px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.funnel-bar { width: 100%; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.funnel-bar i { display: block; height: 100%; background: var(--accent); }
.funnel + .two { margin-top: 16px; }
.two.cc-grid > .panel:only-child { grid-column: 1 / -1; }
.section-head.wrap { flex-wrap: wrap; align-items: center; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; }
.filters select { height: 36px; font-size: 13px; min-width: 0; width: auto; max-width: 240px; }
.lead-av { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); font: 650 12px/1 var(--sans); color: var(--ink-2); }
.li-co { color: var(--ink-3); font-weight: 400; }
.chip.lst-nuevo { color: var(--accent-ink); background: var(--accent); border-color: transparent; }
.chip.lst-calificado, .chip.lst-visita, .chip.lst-propuesta, .chip.lst-ganado { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
.chip.lst-perdido, .chip.lst-descartado { color: var(--ink-3); }
.chip.q-alta { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
.chip.q-baja { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.client-fb { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface-2); margin-bottom: 18px; }
.client-fb p:last-child { margin: 6px 0 0; line-height: 1.5; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 12px 16px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.data thead th { font: 650 11px/14px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); }
table.data th:first-child { text-align: left; }
table.data tbody th { font-weight: 600; }
table.data tbody tr:last-child > * { border-bottom: 0; }
table.data tr.total > * { font-weight: 700; background: var(--accent-soft); }
.table-note { margin: 10px 2px 0; }
.section-head + .table-note { margin: -6px 2px 12px; }
.period + .period { margin-top: 16px; }
.period-h { margin: 0 0 8px; font: 600 12px/16px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.budget-list li { align-items: center; }
.budget-list .grow { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: center; }
.budget-list .grow > .soft-text { grid-column: 1; }
.budget-list .budget-amt, .budget-list .budget-bar { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-variant-numeric: tabular-nums; }
.budget-amt s { color: var(--ink-3); font-size: 12px; }
.budget-bar { display: grid; gap: 6px; min-width: 220px; }
.budget-nums { font-size: 13px; color: var(--ink-2); }
.budget-nums b { color: var(--ink); }
.stat .v.neg { color: var(--warn); }
.page-head .cal-tools { flex-wrap: wrap; }
.cal-tools select { height: 34px; font-size: 13px; max-width: 220px; }
.cal-nav { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.cal-nav button { height: 32px; min-width: 36px; padding: 0 12px; border: 0; background: none; color: var(--ink); font: 600 13px/1 var(--sans); cursor: pointer; display: grid; place-items: center; }
.cal-nav button + button { border-left: 1px solid var(--line); }
.cal-nav button:hover { background: var(--hover); }
.cal-nav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cal-nav .flip svg { transform: scaleX(-1); }
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.cal { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-head span { padding: 10px 12px; font: 650 11px/14px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-day { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-height: 112px; padding: 8px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: var(--hover); }
.cal-day.out { color: var(--ink-3); background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-n { font: 600 13px/22px var(--sans); width: 24px; height: 24px; text-align: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.cal-day.today .cal-n { background: var(--accent); color: var(--accent-ink); }
.cal-pills { display: grid; gap: 3px; min-width: 0; }
.cal-pill { display: block; padding: 3px 6px; border-radius: 5px; font-size: 11.5px; line-height: 15px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; background: var(--surface-2); border-left: 2px solid var(--ink-3); color: var(--ink); }
.cal-pill b { font-weight: 650; font-variant-numeric: tabular-nums; }
.cal-more { font-size: 11px; color: var(--ink-3); padding-left: 6px; }
.cal-dots { display: none; gap: 3px; justify-content: center; }
.cal-dots i, .cal-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); flex: none; }
.cal-dot { margin-right: 8px; vertical-align: 1px; }
.cal-pill.k-reunion { border-left-color: var(--accent); background: var(--accent-soft); }
.k-reunion.cal-dot, .cal-dots i.k-reunion { background: var(--accent); }
.cal-pill.k-hito { border-left-color: #7AA2FF; } .k-hito.cal-dot, .cal-dots i.k-hito { background: #7AA2FF; }
.cal-pill.k-compromiso { border-left-color: #C39BFF; } .k-compromiso.cal-dot, .cal-dots i.k-compromiso { background: #C39BFF; }
.cal-pill.k-vencimiento { border-left-color: var(--warn); } .k-vencimiento.cal-dot, .cal-dots i.k-vencimiento { background: var(--warn); }
.cal-pill.k-entrega { border-left-color: #3FC1A5; } .k-entrega.cal-dot, .cal-dots i.k-entrega { background: #3FC1A5; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.cal-side { position: sticky; top: calc(var(--top-h) + 16px); padding: 20px; }
.cal-side .plain-list li { padding-top: 10px; padding-bottom: 10px; }
.cal-time { flex: none; width: 44px; font: 600 12px/20px var(--mono); color: var(--ink-2); }
.cal-li .li-title { display: flex; align-items: center; }
.meets .meet-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.meet { display: grid; gap: 6px; align-content: start; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-align: left; font: inherit; cursor: pointer; border-top: 3px solid var(--accent); transition: border-color .15s, background .15s; }
.meet:hover { background: var(--hover); }
.meet-when { font: 600 12px/16px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.meet-title { font: 650 17px/1.25 var(--display); letter-spacing: -.015em; }
.meet-empty { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px; }
.meet-empty .muted { margin: 0; }
.meets { margin-bottom: 8px; }
@media (max-width: 1100px) {
  .cal-wrap { grid-template-columns: minmax(0, 1fr); }
  .cal-side { position: static; }
  .meets .meet-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .funnel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .funnel-step { padding: 14px; }
  .funnel-n { font-size: 26px; }
  .growth-head h2 { font-size: 24px; }
  .growth-head .inline-actions { width: 100%; }
  .filters { width: 100%; }
  .filters select { flex: 1 1 140px; max-width: none; }
  .cal-day { min-height: 54px; padding: 6px 2px; align-items: center; }
  .cal-pills { display: none; }
  .cal-dots { display: flex; }
  .cal-head span { padding: 8px 0; text-align: center; letter-spacing: .04em; }
  .cal-legend { gap: 6px 12px; }
  .meets .meet-row { grid-template-columns: minmax(0, 1fr); }
  .budget-list .grow { grid-template-columns: minmax(0, 1fr); }
  .budget-list .budget-amt, .budget-list .budget-bar { grid-column: 1; grid-row: auto; text-align: left; margin-top: 6px; }
  .budget-bar { min-width: 0; }
}
.budget-amt { white-space: nowrap; }
.kv + .budget-list { margin-top: 14px; padding-top: 6px; border-top: 1px solid var(--line); }
