/* Bitácora · sistema de diseño */
:root {
  color-scheme: light;
  --bg: #f3f5f8; --surface: #ffffff; --surface-2: #f8fafc; --surface-3: #eef2f6;
  --border: #e2e8f0; --border-strong: #cbd5e1;
  --text: #0f172a; --text-2: #475569; --muted: #64748b;
  --accent: #0f766e; --accent-hover: #115e59; --accent-soft: #ccfbf1; --accent-ink: #ffffff; --accent-text: #0f766e;
  --ok: #15803d; --ok-soft: #dcfce7;
  --warn: #b45309; --warn-soft: #fef3c7;
  --danger: #b91c1c; --danger-soft: #fee2e2;
  --info: #1d4ed8; --info-soft: #dbeafe;
  --sb-bg: #0f172a; --sb-text: #aab6c8; --sb-hover: rgba(255,255,255,.06); --sb-active: rgba(255,255,255,.10); --sb-border: rgba(255,255,255,.08);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06); --shadow: 0 8px 28px rgba(15,23,42,.12);
  --radius: 12px; --radius-sm: 8px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --we: rgba(15,23,42,.035); --today: rgba(15,118,110,.10);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1219; --surface: #121b26; --surface-2: #162130; --surface-3: #1b2838;
  --border: #223144; --border-strong: #2f4258;
  --text: #e8eef5; --text-2: #b6c2d1; --muted: #8494a8;
  --accent: #2dd4bf; --accent-hover: #5eead4; --accent-soft: rgba(45,212,191,.14); --accent-ink: #04211d; --accent-text: #5eead4;
  --ok: #4ade80; --ok-soft: rgba(74,222,128,.14);
  --warn: #fbbf24; --warn-soft: rgba(251,191,36,.14);
  --danger: #f87171; --danger-soft: rgba(248,113,113,.15);
  --info: #7cb4ff; --info-soft: rgba(124,180,255,.15);
  --sb-bg: #0a1017; --sb-text: #92a2b8; --sb-hover: rgba(255,255,255,.05); --sb-active: rgba(255,255,255,.09); --sb-border: rgba(255,255,255,.07);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35); --shadow: 0 10px 34px rgba(0,0,0,.5);
  --we: rgba(255,255,255,.025); --today: rgba(45,212,191,.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .nowrap { white-space: nowrap; } .right { text-align: right; } .strong { font-weight: 600; }
.mono { font-family: var(--mono); }
svg.ic { flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ───────── layout ───────── */
.app { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--sb-bg); color: var(--sb-text); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px 12px; gap: 4px; overflow-y: auto; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #14b8a6, #0f766e); display: grid; place-items: center; color: #fff; box-shadow: 0 2px 8px rgba(20,184,166,.35); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6b7c93; padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--sb-text); text-decoration: none; font-weight: 500; position: relative; }
.nav a:hover { background: var(--sb-hover); color: #fff; }
.nav a[aria-current="page"] { background: var(--sb-active); color: #fff; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #2dd4bf; }
.nav .badge-count { margin-left: auto; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.sb-foot { margin-top: auto; border-top: 1px solid var(--sb-border); padding-top: 12px; position: relative; }
.user-chip { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: transparent; border: 0; cursor: pointer; text-align: left; color: var(--sb-text); }
.user-chip:hover { background: var(--sb-hover); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #1e3a46; color: #5eead4; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.user-chip .who { min-width: 0; line-height: 1.25; }
.user-chip .who b { display: block; color: #e8eef5; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who span { font-size: 12px; color: #7d8ea5; }
.menu { position: absolute; bottom: 64px; left: 4px; right: 4px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 60; }
.menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--surface-3); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu .seg { display: flex; gap: 4px; padding: 4px; }
.menu .seg button { justify-content: center; padding: 7px 4px; border: 1px solid var(--border); font-size: 12.5px; }
.menu .seg button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar-m { display: none; }
.page { padding: 26px 32px 56px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ───────── controles ───────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 32px; height: 32px; padding: 0; }
.btn.sm.icon { width: 28px; height: 28px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.input, .select, .textarea { width: 100%; height: 38px; padding: 0 11px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); outline: none; transition: border-color .12s, box-shadow .12s; }
.textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 76px; line-height: 1.45; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.input[readonly], .input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-3); color: var(--muted); }
.input.sm, .select.sm { height: 32px; font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); }
.hint.err { color: var(--danger); }
.row { display: grid; gap: 12px; }
.row.c2 { grid-template-columns: 1fr 1fr; } .row.c3 { grid-template-columns: 1fr 1fr 1fr; } .row.c4 { grid-template-columns: repeat(4, 1fr); }
.input-affix { position: relative; } .input-affix .input { padding-right: 30px; } .input-affix::after { content: attr(data-affix); position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search { position: relative; } .search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); } .search .input { padding-left: 34px; }

.segmented { display: inline-flex; background: var(--surface-3); padding: 3px; border-radius: 10px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--text-2); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 28px; height: 28px; border-radius: 50%; border: 3px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.swatches input:checked + span { border-color: var(--surface); box-shadow: 0 0 0 2px var(--text); }
.swatches input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ───────── tarjetas, KPI ───────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 15px; }
.card-body { padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); margin-bottom: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.sidebyside { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.kpi { padding: 16px 18px; }
.kpi .lab { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kpi .val { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; }
.kpi .val.pos { color: var(--ok); } .kpi .val.neg { color: var(--danger); }
.kpi .foot { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi .bar { height: 6px; border-radius: 6px; background: var(--surface-3); margin-top: 10px; overflow: hidden; } .kpi .bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }

/* ───────── etiquetas ───────── */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); } .pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent-text); } .pill.neutral { background: var(--surface-3); color: var(--text-2); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.casa-tag { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }

/* ───────── tablas ───────── */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tbody tr:hover { background: var(--surface-2); }
.t tr:last-child td { border-bottom: 0; }
.t td.num, .t th.num { text-align: right; }
.t tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border-strong); border-bottom: 0; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.toolbar .grow { flex: 1; min-width: 200px; max-width: 360px; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .big { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty .ic-wrap { width: 54px; height: 54px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; margin: 0 auto 14px; }
.empty .btn { margin-top: 16px; }

/* ───────── listas ───────── */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t1 { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .t2 { font-size: 12.5px; color: var(--muted); }
.ico-bubble { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.ico-bubble.in { background: var(--ok-soft); color: var(--ok); } .ico-bubble.out { background: var(--warn-soft); color: var(--warn); }
.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; min-width: 70px; } .progress i { display: block; height: 100%; background: var(--accent); } .progress.ok i { background: var(--ok); }

/* ───────── línea de tiempo (calendario) ───────── */
.tl { --lab: 168px; --dayw: minmax(33px, 1fr); overflow-x: auto; }
.tl-inner { min-width: calc(var(--lab) + var(--n) * 33px); }
.tl-row { display: grid; grid-template-columns: var(--lab) minmax(0, 1fr); border-bottom: 1px solid var(--border); }
.tl-row:last-child { border-bottom: 0; }
.tl-label { position: sticky; left: 0; z-index: 3; background: var(--surface); padding: 0 14px; display: flex; align-items: center; gap: 8px; font-weight: 600; border-right: 1px solid var(--border); min-height: 54px; overflow: hidden; }
.tl-label span.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-head .tl-label { min-height: 46px; background: var(--surface-2); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.tl-head .tl-days { background: var(--surface-2); }
.tl-track { position: relative; min-height: 54px; }
.tl-days { display: grid; grid-template-columns: repeat(var(--n), 1fr); height: 100%; }
.tl-days > * { border-left: 1px solid var(--border); min-width: 0; }
.tl-days > *:first-child { border-left: 0; }
.tl-hd { text-align: center; font-size: 11px; color: var(--muted); padding: 6px 0; line-height: 1.2; } .tl-hd b { display: block; font-size: 13px; color: var(--text); font-weight: 600; }
.tl-hd.we { background: var(--we); } .tl-hd.today { background: var(--today); } .tl-hd.today b { color: var(--accent-text); }
button.tl-day { background: transparent; border: 0; border-left: 1px solid var(--border); cursor: pointer; padding: 0; }
button.tl-day.we { background: var(--we); } button.tl-day.today { background: var(--today); }
button.tl-day:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
button.tl-day.blocked { background: repeating-linear-gradient(135deg, var(--surface-3) 0 5px, color-mix(in srgb, var(--muted) 30%, var(--surface-3)) 5px 10px); }
button.tl-day[disabled] { cursor: default; }
.tl-bars { position: absolute; inset: 0; display: grid; align-items: center; pointer-events: none; padding: 8px 0; }
.tl-bar { pointer-events: auto; height: 36px; border: 0; border-radius: 8px; padding: 0 9px; color: #fff; text-align: left; font-weight: 600; font-size: 12.5px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.25); margin: 0 1px; }
.tl-bar:hover { filter: brightness(1.08); box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.tl-bar.cutL { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; } .tl-bar.cutR { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.tl-bar .warn-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; flex: none; box-shadow: 0 0 0 2px rgba(220,38,38,.9); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -3px; margin-right: 6px; }
.legend i.blk { background: repeating-linear-gradient(135deg, var(--surface-3) 0 3px, var(--muted) 3px 5px); }

/* ───────── gráfico ───────── */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid-l { stroke: var(--border); stroke-width: 1; }
.chart .b-in { fill: var(--accent); } .chart .b-out { fill: var(--danger); opacity: .85; }
.chart rect:hover { opacity: .75; }

/* ───────── diálogos ───────── */
dialog { border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: hidden; }
dialog.lg { width: min(780px, calc(100vw - 24px)); } dialog.sm { width: min(440px, calc(100vw - 24px)); }
dialog[open] { display: flex; flex-direction: column; animation: pop .14s ease-out; }
dialog::backdrop { background: rgba(2, 8, 23, .55); backdrop-filter: blur(2px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 4px; }
.dlg-head h2 { font-size: 18px; }
.dlg-sub { padding: 0 22px; color: var(--muted); font-size: 13px; }
.dlg-body { padding: 16px 22px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.dlg-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--border); margin-top: 8px; background: var(--surface-2); }
.dlg-foot .left { margin-right: auto; }
.dlg-form { display: contents; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.4; }
.banner.warn { background: var(--warn-soft); color: var(--warn); } .banner.err { background: var(--danger-soft); color: var(--danger); } .banner.info { background: var(--info-soft); color: var(--info); } .banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner .btn { margin-left: auto; flex: none; }
.calc-box { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--text-2); }
.calc-box b { color: var(--text); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; font-size: 13.5px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }
.check-list label { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.check-list input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--accent); flex: none; }
.check-list .done span.tx { text-decoration: line-through; color: var(--muted); }
.check-list .who { font-size: 11.5px; color: var(--muted); margin-left: auto; text-align: right; }
.seasons-strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; } .seasons-strip div { text-align: center; font-size: 11px; padding: 6px 0; border-radius: 6px; background: var(--surface-3); color: var(--muted); font-weight: 600; } .seasons-strip div.on { color: #fff; }
.season-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr 32px; gap: 8px; align-items: end; }

/* ───────── toasts ───────── */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; pointer-events: none; }
.toast { pointer-events: auto; background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 500; max-width: 380px; display: flex; gap: 10px; align-items: flex-start; animation: pop .16s ease-out; }
.toast.err { background: var(--danger); color: #fff; } .toast.ok::before { content: "✓"; font-weight: 800; color: #4ade80; } .toast.err::before { content: "!"; font-weight: 800; }
html[data-theme="dark"] .toast.ok { background: #e8eef5; color: #0b1219; } html[data-theme="dark"] .toast.ok::before { color: #15803d; }

/* ───────── login ───────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1100px 500px at 15% -10%, color-mix(in srgb, var(--accent) 20%, transparent), transparent), radial-gradient(900px 500px at 100% 110%, color-mix(in srgb, var(--info) 14%, transparent), transparent), var(--bg); }
.login-card { width: min(420px, 100%); padding: 34px 32px 28px; }
.login-card .brand { color: var(--text); padding: 0 0 22px; font-size: 20px; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; } .login-card .sub { color: var(--muted); margin-bottom: 22px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card .btn { height: 42px; font-size: 15px; }
.pw-wrap { position: relative; } .pw-wrap .input { padding-right: 44px; } .pw-wrap button { position: absolute; right: 4px; top: 4px; height: 30px; width: 36px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 6px; }
.pw-wrap button:hover { background: var(--surface-3); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; } @keyframes spin { to { transform: rotate(360deg); } }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }

/* ───────── impresión ───────── */
#print-root { display: none; }
@media print {
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; color: #111; background: #fff; font: 12.5px/1.5 var(--font); }
  @page { margin: 16mm 15mm; }
}
.doc h1 { font-size: 22px; letter-spacing: -0.02em; } .doc h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #555; margin: 22px 0 8px; }
.doc .doc-head { display: flex; justify-content: space-between; gap: 24px; border-bottom: 2px solid #111; padding-bottom: 14px; margin-bottom: 18px; }
.doc .doc-head .emisor { line-height: 1.5; } .doc .doc-head .emisor b { font-size: 15px; } .doc .doc-head .num { text-align: right; } .doc .doc-head .num .n { font-size: 20px; font-weight: 700; }
.doc table { width: 100%; border-collapse: collapse; } .doc th, .doc td { padding: 7px 8px; border-bottom: 1px solid #ddd; text-align: left; } .doc th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #555; border-bottom: 1.5px solid #999; }
.doc td.r, .doc th.r { text-align: right; } .doc tfoot td { font-weight: 700; border-top: 1.5px solid #111; border-bottom: 0; } .doc .two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.doc .small { font-size: 11px; color: #666; } .doc .totales { margin-left: auto; width: 55%; margin-top: 12px; } .doc .totales td { border: 0; padding: 4px 8px; } .doc .totales tr.big td { font-size: 15px; font-weight: 700; border-top: 1.5px solid #111; padding-top: 8px; }

/* ───────── responsive ───────── */
@media (max-width: 1100px) { .grid.sidebyside, .grid.two { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(2,8,23,.5); z-index: 35; }
  .topbar-m { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
  .topbar-m .brand { padding: 0; color: var(--text); font-size: 16px; }
  .page { padding: 18px 14px 48px; }
  .page-head h1 { font-size: 21px; }
  .row.c4 { grid-template-columns: 1fr 1fr; } .row.c3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .row.c2, .row.c3, .row.c4 { grid-template-columns: 1fr; }
  .row.keep2 { grid-template-columns: 1fr 1fr; }
  .season-row { grid-template-columns: 1fr 1fr; } .season-row .rm { grid-column: 2; justify-self: end; }
  .dlg-head, .dlg-sub, .dlg-body, .dlg-foot { padding-left: 16px; padding-right: 16px; }
  .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.tl-track > .tl-days.fill { position: absolute; inset: 0; }
@media (max-width: 560px) { .tl { --lab: 112px; } .tl-label { padding: 0 8px; } }
