/* Campaign Manager · sistema visual: blancos y grises cálidos, paleta oficial (#EA0617, #AE0000, #640000, #FF8080, #C3FFFF), Inter. */
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --brand: #ea0617; --primary: #ae0000; --primary-hover: #640000; --primary-soft: #ffecec; --on-primary: #fff;
  --accent2: #c3ffff; --accent2-ink: #0b4f55;
  --ink: #0f0f0f; --ink2: #55554f; --ink3: #7a7a72;
  --surface: #f8f8f5; --surface2: #f1f1ec; --line: #e5e5e0; --line2: #d6d6cf; --bg: #fff;
  --good: #15803d; --good-soft: #e9f7ee; --bad: #c2410c; --bad-soft: #fdf0e9; --warn: #b45309; --warn-soft: #fef5e7;
  /* Marcas de datos: validadas para daltonismo sobre blanco. El cian solo es fondo (contraste 1,1:1 con el blanco). */
  --data: #ea0617; --data-ink: #640000;
  --via-d4t: #640000; --via-rm: #ae0000; --via-td: #ff8080;
  --st-plan: #ff8080; --st-appr: #ea0617; --st-live: #ae0000; --st-done: #640000;
  --radius: 16px; --radius-sm: 10px; --label-w: 236px;
  --shadow-sm: 0 1px 2px rgba(15, 15, 15, .04); --shadow: 0 1px 2px rgba(15, 15, 15, .04), 0 8px 24px -12px rgba(15, 15, 15, .1);
  --ease: cubic-bezier(.2, .7, .2, 1);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; color: var(--ink);
  font-feature-settings: "cv11", "ss03"; -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
h1 { font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -.03em; margin: 0; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 600; letter-spacing: -.015em; margin: 0 0 14px; }
p { margin: 0 0 10px; }
button, input, select { font: inherit; color: inherit; }
svg.lucide { width: 18px; height: 18px; flex: none; stroke-width: 1.75; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.boot { padding: 48px; color: var(--ink3); }
.muted { color: var(--ink3); } .small { font-size: 12.5px; } .nowrap { white-space: nowrap; } .spacer { flex: 1; }
.bad { color: var(--bad); } .good { color: var(--good); }

/* Marco */
.shell { display: flex; min-height: 100vh; }
.side { width: 248px; flex: none; background: var(--surface); border-right: 1px solid var(--line); padding: 22px 14px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.02em; padding: 0 8px; }
.logo-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: var(--on-primary); font-size: 12px; font-weight: 800; letter-spacing: -.02em; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav-secondary { border-top: 1px solid var(--line); padding-top: 14px; }
.nav-link { display: flex; align-items: center; gap: 11px; background: none; border: 0; text-align: left; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--ink2); cursor: pointer; font-weight: 500; transition: background .16s var(--ease), color .16s var(--ease); }
.nav-link:hover { background: var(--surface2); color: var(--ink); }
.nav-link.active { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 2px; border-top: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent2); color: var(--accent2-ink); border: 1px solid var(--line); font-size: 12px; font-weight: 600; flex: none; }
.me-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.me-text strong { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text span { color: var(--ink3); font-size: 12.5px; }
.main { flex: 1; min-width: 0; padding: 34px 40px 64px; }
.main.enter .page { animation: rise .32s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page { display: flex; flex-direction: column; gap: 20px; max-width: 1440px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.lede { color: var(--ink2); font-size: 15.5px; margin: 6px 0 0; letter-spacing: -.005em; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.demo-banner { display: flex; align-items: center; gap: 10px; background: var(--accent2); color: var(--ink); padding: 7px 18px; font-size: 13px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.demo-banner strong { background: var(--ink); color: #fff; padding: 1px 7px; border-radius: 6px; font-size: 11px; letter-spacing: .04em; }
.demo-banner select { padding: 3px 28px 3px 10px; }

/* Controles */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line2); background: var(--bg); border-radius: var(--radius-sm); padding: 8px 14px; cursor: pointer; font-weight: 500; white-space: nowrap; transition: background .16s var(--ease), border-color .16s var(--ease), transform .12s var(--ease); }
.btn:hover { background: var(--surface); border-color: var(--line2); }
.btn:active { transform: scale(.98); }
.btn svg.lucide { width: 16px; height: 16px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.page-head .btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.page-head .btn.primary:hover { background: #2b2b28; border-color: #2b2b28; }
.btn.danger { color: var(--bad); border-color: #f5d0bd; } .btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 4px 10px; font-size: 12.5px; border-radius: 8px; } .btn.block { width: 100%; padding: 10px 14px; }
.btn.link { border: 0; background: none; color: var(--ink); padding: 6px 4px; font-weight: 500; }
.btn.link:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }
.btn.square { padding: 4px; width: 30px; height: 30px; }
.btn.disabled, .btn:disabled { opacity: .4; pointer-events: none; }
.icon-btn { display: grid; place-items: center; border: 0; background: none; cursor: pointer; color: var(--ink3); width: 32px; height: 32px; border-radius: 8px; flex: none; transition: background .16s var(--ease), color .16s var(--ease); }
.icon-btn:hover { background: var(--surface2); color: var(--ink); }
input:not([type=checkbox]):not([type=file]), select { border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: 8px 12px; background: var(--bg); min-width: 0; transition: border-color .16s var(--ease), box-shadow .16s var(--ease); }
input:not([type=checkbox]):not([type=file]):focus, select:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2355554f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input[type=checkbox] { accent-color: var(--primary); width: 16px; height: 16px; margin: 0; }
input[type=file] { font-size: 13px; }
input[type=file]::file-selector-button { font: inherit; font-weight: 500; border: 1px solid var(--line2); background: var(--bg); border-radius: 8px; padding: 4px 10px; margin-right: 8px; cursor: pointer; }
select.on { border-color: var(--accent2-ink); background-color: var(--accent2); color: var(--accent2-ink); font-weight: 500; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select { max-width: 220px; } .filters input[type=search] { min-width: 320px; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.segmented { display: inline-flex; border-radius: var(--radius-sm); background: var(--surface2); padding: 3px; gap: 2px; }
.segmented button { border: 0; background: none; padding: 5px 12px; cursor: pointer; border-radius: 8px; color: var(--ink2); font-weight: 500; transition: background .16s var(--ease), color .16s var(--ease); }
.segmented button:hover { color: var(--ink); }
.segmented button.active { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-sm); }
.stepper { display: inline-flex; align-items: center; gap: 6px; } .stepper strong { min-width: 138px; text-align: center; font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--ink3); font-weight: 500; margin-bottom: -1px; transition: color .16s var(--ease); }
.tabs button:hover { color: var(--ink); }
.tabs button.active { border-color: var(--ink); color: var(--ink); font-weight: 600; }

/* Tarjetas y tablas */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; min-width: 0; box-shadow: var(--shadow-sm); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; } .card-head h2 { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.grid-chart { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); gap: 16px; }
.table-wrap { overflow-x: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card .table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--ink3); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--surface2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td, .table.compact th { padding: 8px 8px; }
.card .table td:first-child, .card .table th:first-child { padding-left: 0; }
.card .table td:last-child, .card .table th:last-child { padding-right: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.clickable { cursor: pointer; } tr.clickable td { transition: background .14s var(--ease); } tr.clickable:hover td { background: var(--surface); }
.totals { text-align: right; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--surface2); color: var(--ink2); white-space: nowrap; margin-right: 4px; }
.chip.good { background: var(--good-soft); color: var(--good); } .chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip[class*="via-"] { background: var(--surface2); color: var(--ink); }
.chip[class*="via-"]::before { content: ""; width: 8px; height: 8px; border-radius: 2px; }
.chip.via-d4t::before { background: var(--via-d4t); } .chip.via-rm::before { background: var(--via-rm); } .chip.via-td::before { background: var(--via-td); }
.chip[class*="st-"]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.chip.st-planificado { background: var(--surface2); color: var(--ink2); } .chip.st-planificado::before { background: var(--st-plan); }
.chip.st-en_marcha { background: var(--primary-soft); color: var(--primary); } .chip.st-en_marcha::before { background: var(--st-live); }
.chip.st-finalizado { background: var(--surface2); color: var(--ink); } .chip.st-finalizado::before { background: var(--st-done); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; } .chips.big .chip { font-size: 13px; padding: 5px 13px; }
.warn-dot { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); font-size: 11px; font-weight: 700; margin-left: 7px; cursor: help; }
.empty { background: var(--surface); border: 1px dashed var(--line2); border-radius: var(--radius); padding: 44px; text-align: center; color: var(--ink2); }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 14px; color: var(--ink2); margin: 0; }
.note.good { background: var(--good-soft); border-color: transparent; color: var(--good); } .note.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); font-weight: 500; }
.errs { margin: 0; padding-left: 16px; }
.steps { margin: 0 0 14px; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.link-more { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink2); padding: 2px 0; transition: color .16s var(--ease), gap .16s var(--ease); }
.link-more:hover { color: var(--ink); gap: 8px; } .link-more svg.lucide { width: 15px; height: 15px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 14px; }
.kpi { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi-label { color: var(--ink2); font-weight: 500; }
.kpi-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); color: var(--ink2); flex: none; } .kpi-icon svg.lucide { width: 16px; height: 16px; }
.kpi strong { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; margin-top: 4px; }
.kpi.good .kpi-icon { background: var(--accent2); color: var(--accent2-ink); }
.kpi.bad strong { color: var(--bad); } .kpi.bad .kpi-icon { background: var(--bad-soft); color: var(--bad); }
.hint { color: var(--ink3); font-size: 12.5px; }
.progress { height: 6px; border-radius: 999px; background: var(--surface2); overflow: hidden; flex: 1; min-width: 40px; }
.progress span { display: block; height: 100%; border-radius: 999px; background: var(--data); transition: width .4s var(--ease); }
.kpi .progress { margin-top: 8px; flex: none; }
.progress.over span { background: var(--bad); }
.meter { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; margin: 4px 0 10px; }
.meter .seg { transition: width .4s var(--ease); min-width: 0; }
.meter .seg.consumed { background: var(--st-done); } .meter .seg.pending { background: var(--data); } .meter .seg.free { background: var(--surface2); flex: 1; }
.legend { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink2); }
.legend > span.item { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none; }
.dot.consumed { background: var(--st-done); } .dot.pending, .dot.planned { background: var(--data); } .dot.free { background: var(--surface2); border: 1px solid var(--line2); }
.dot.via-d4t { background: var(--via-d4t); } .dot.via-rm { background: var(--via-rm); } .dot.via-td { background: var(--via-td); }
.dot.st-planificado { background: var(--st-plan); } .dot.st-en_marcha { background: var(--st-live); } .dot.st-finalizado { background: var(--st-done); }
.legend .sep { width: 1px; height: 14px; background: var(--line2); }
.swatch { width: 22px; height: 10px; border-radius: 3px; display: inline-block; background-color: var(--ink3); }
.bar-cell { width: 34%; min-width: 48px; }
.grid3 .table td:first-child { white-space: normal; }
.bar2 { display: flex; flex-direction: column; gap: 2px; }
.bar2 .b { height: 5px; border-radius: 3px; min-width: 2px; } .bar2 .planned { background: var(--data); } .bar2 .consumed { background: var(--st-done); }

/* Gráfico de barras por mes */
.chart { position: relative; height: 236px; padding-left: 46px; }
.chart-grid { position: absolute; left: 0; right: 0; top: 18px; bottom: 26px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid div { position: relative; height: 1px; background: var(--surface2); }
.chart-grid div span { position: absolute; left: 0; top: -9px; font-size: 11.5px; color: var(--ink3); background: var(--bg); padding-right: 6px; font-variant-numeric: tabular-nums; }
.chart-grid div.base { background: var(--line2); }
.chart-cols { position: relative; height: 100%; display: grid; grid-template-columns: repeat(12, 1fr); }
.chart-col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-top: 18px; outline-offset: -2px; border-radius: 8px; cursor: default; }
.chart-plot { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-height: 0; position: relative; }
.chart-bar { width: min(58%, 34px); border-radius: 4px 4px 0 0; background: var(--data); min-height: 0; transition: filter .16s var(--ease); }
.main.enter .chart-bar { animation: grow .5s var(--ease) both; transform-origin: bottom; }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }
.chart-col.current .chart-bar { background: var(--data-ink); }
.chart-col:hover .chart-bar, .chart-col:focus-visible .chart-bar { filter: brightness(.9); }
.chart-val { font-size: 11.5px; font-weight: 600; margin-bottom: 3px; white-space: nowrap; }
.chart-x { height: 26px; line-height: 26px; font-size: 12px; color: var(--ink3); }
.chart-tip { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s var(--ease); z-index: 5; }
.chart-tip strong { display: block; font-weight: 600; }
.chart-col.edge-l .chart-tip { left: 0; transform: none; } .chart-col.edge-r .chart-tip { left: auto; right: 0; transform: none; }
.chart-col:hover .chart-tip, .chart-col:focus-visible .chart-tip { opacity: 1; }
.chart-table { margin-top: 10px; font-size: 13px; } .chart-table summary { cursor: pointer; color: var(--ink3); font-size: 12.5px; }
.chart-table .table-wrap { margin-top: 8px; max-height: 220px; overflow-y: auto; }

/* Anillo por estado */
.donut-wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; justify-content: center; padding-top: 8px; }
.donut { position: relative; width: 168px; height: 168px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 14; transition: stroke-width .16s var(--ease); cursor: default; }
.donut circle:hover { stroke-width: 18; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center strong { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.donut-center span { color: var(--ink3); font-size: 12.5px; }
.donut-legend { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 10px; }
.donut-legend div { display: flex; align-items: center; gap: 9px; }
.donut-legend b { margin-left: auto; font-weight: 500; color: var(--ink2); font-variant-numeric: tabular-nums; }

/* Listas de campañas y actividad */
.rows { display: flex; flex-direction: column; }
.row-item { display: grid; grid-template-columns: 34px minmax(90px, 1fr) minmax(70px, 1.1fr) 44px 86px; align-items: center; gap: 12px; padding: 9px 8px; margin: 0 -8px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: var(--radius-sm); transition: background .14s var(--ease); }
.row-item:hover { background: var(--surface); }
.row-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent2); color: var(--accent2-ink); flex: none; } .row-icon svg.lucide { width: 16px; height: 16px; }
.row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink2); }
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--surface2); align-items: flex-start; }
.feed-item:last-child { border-bottom: 0; }
.feed-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); color: var(--ink2); flex: none; } .feed-icon svg.lucide { width: 15px; height: 15px; }
.feed-text { min-width: 0; line-height: 1.35; } .feed-text span { display: block; color: var(--ink3); font-size: 12.5px; margin-top: 2px; }

/* Línea temporal */
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tl { overflow-x: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card .tl { border: 0; border-radius: 0; box-shadow: none; }
.tl-inner { min-width: calc(var(--label-w) + var(--weeks) * var(--week-px)); }
.tl-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--surface2); min-height: 38px; }
.tl-row:last-child { border-bottom: 0; }
.tl-label { width: var(--label-w); flex: none; position: sticky; left: 0; z-index: 3; background: var(--bg); border-right: 1px solid var(--line); padding: 6px 12px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; white-space: nowrap; }
.tl-name { overflow: hidden; text-overflow: ellipsis; } .tl-sub { font-size: 11.5px; color: var(--ink3); }
.tl-row.item .tl-label { padding-left: 30px; color: var(--ink2); font-size: 13px; }
.tl-row.group { background: var(--surface); } .tl-row.group .tl-label { background: var(--surface); }
.tl-toggle { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.tl-toggle strong { font-weight: 600; }
.tl-track { flex: 1; position: relative; display: flex; min-width: 0;
  background-image: repeating-linear-gradient(to right, var(--surface2) 0, var(--surface2) 1px, transparent 1px, transparent calc(100% / var(--weeks))); }
.tl-head { position: sticky; top: 0; background: var(--bg); z-index: 4; min-height: 0; }
.tl-head .tl-track { background-image: none; }
.tl-month { flex-basis: 0; text-align: center; font-weight: 600; font-size: 12.5px; padding: 8px 2px; border-right: 1px solid var(--line); overflow: hidden; white-space: nowrap; }
.tl-week { flex: 1 1 0; text-align: center; font-size: 10.5px; padding: 4px 0; border-right: 1px solid var(--surface2); display: flex; flex-direction: column; color: var(--ink3); line-height: 1.25; min-width: 0; }
.tl-week b { color: var(--ink2); font-weight: 600; } .tl-week.now { background: var(--accent2); color: var(--accent2-ink); } .tl-week.now b { color: var(--accent2-ink); }
.tl.dense .tl-week { font-size: 9px; letter-spacing: -.02em; }
.tl-body { position: relative; }
.tl-today-wrap { position: absolute; inset: 0; display: flex; pointer-events: none; z-index: 2; }
.tl-today-wrap .tl-label { visibility: hidden; } .tl-today-wrap .tl-track { background-image: none; }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--brand); opacity: .8; }
.tl-bar { position: absolute; top: 8px; height: 22px; border-radius: 6px; border: 0; padding: 0 8px; color: #fff; font-size: 11.5px; font-weight: 600; text-align: left; overflow: hidden; display: flex; align-items: center; min-width: 5px; z-index: 1; transition: filter .16s var(--ease), transform .16s var(--ease); }
button.tl-bar { cursor: pointer; } button.tl-bar:hover { filter: brightness(1.08); transform: translateY(-1px); }
.tl-bar-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-bar-out { position: absolute; top: 11px; font-size: 11.5px; color: var(--ink2); padding: 0 6px; white-space: nowrap; z-index: 1; pointer-events: none; }
.tl-bar.cut-start { border-top-left-radius: 0; border-bottom-left-radius: 0; } .tl-bar.cut-end { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tl-bar.camp { background: var(--ink); }
.tl-bar.via-d4t { background-color: var(--via-d4t); } .tl-bar.via-rm { background-color: var(--via-rm); } .tl-bar.via-td { background-color: var(--via-td); color: #640000; }
.st-planificado.tl-bar { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.4) 0, rgba(255,255,255,.4) 4px, transparent 4px, transparent 8px); }
.swatch.st-planificado { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.55) 0, rgba(255,255,255,.55) 3px, transparent 3px, transparent 6px); }
.st-finalizado.tl-bar, .swatch.st-finalizado { filter: grayscale(.75); opacity: .7; }

/* Modal y formularios */
.modal { border: 0; border-radius: 18px; padding: 0; width: min(580px, calc(100vw - 32px)); max-height: calc(100vh - 40px); box-shadow: 0 24px 70px -12px rgba(15,15,15,.3); animation: pop .22s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal::backdrop { background: rgba(15,15,15,.32); backdrop-filter: blur(2px); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 1; }
.modal header h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px 22px; }
.form { display: flex; flex-direction: column; gap: 14px; } .form > div:first-child { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 500; color: var(--ink2); }
.row { display: flex; gap: 12px; } .row > * { flex: 1; }
.output { padding: 8px 12px; background: var(--surface); border-radius: var(--radius-sm); font-variant-numeric: tabular-nums; font-weight: 600; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0; }
legend { font-size: 12.5px; font-weight: 500; color: var(--ink2); padding: 0 4px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.form-error { background: var(--bad-soft); color: var(--bad); border-radius: var(--radius-sm); padding: 9px 13px; margin: 10px 0 0; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 100; box-shadow: var(--shadow); max-width: 80vw; font-weight: 500; animation: toast .26s var(--ease) both; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast.error { background: var(--bad); }

/* Seguridad */
.sec-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sec { display: flex; flex-direction: column; padding: 11px 14px; background: var(--surface); border-radius: var(--radius-sm); } .sec strong { font-weight: 600; } .sec span { color: var(--ink2); }
.sec.pending { background: var(--warn-soft); }

/* Acceso */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--surface); }
.auth-card { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 32px; width: min(420px, 100%); display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); animation: rise .32s var(--ease) both; }
.auth-card .logo { padding: 0; } .auth-card h1 { font-size: 26px; }
.qr { align-self: center; border: 1px solid var(--line); border-radius: 10px; }
.secret { display: block; word-break: break-all; background: var(--surface); padding: 9px; border-radius: 8px; }
.code { font-size: 20px; letter-spacing: .3em; text-align: center; }

@media (max-width: 1100px) { .grid-chart { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .shell { flex-direction: column; } .side { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .side nav { flex-direction: row; flex-wrap: wrap; } .nav-secondary { border: 0; padding: 0; } .me { margin: 0; border: 0; padding: 0; }
  .main { padding: 20px 16px 48px; } .row { flex-direction: column; } h1 { font-size: 28px; } :root { --label-w: 150px; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } .row-item { grid-template-columns: 34px 1fr 44px 86px; } .row-item .progress { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.grid3 .table td:first-child .chip { white-space: normal; }
.table td strong { white-space: nowrap; }
.table td .chip { margin-right: 0; }

/* Campañas en bloques */
.camp-year { display: flex; flex-direction: column; gap: 12px; }
.year-title { font-size: 22px; margin: 6px 0 0; }
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.camp-card { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px 18px; display: flex; flex-direction: column; gap: 14px; cursor: pointer; box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease); }
.camp-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line2); }
.camp-card.live::before { background: var(--brand); } .camp-card.next::before { background: var(--st-plan); }
.camp-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--line2); }
.camp-card.past { background: var(--surface); }
.camp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.camp-title { display: flex; flex-direction: column; min-width: 0; }
.camp-title h3 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; overflow-wrap: anywhere; }
.camp-timing { font-size: 12.5px; font-weight: 500; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--surface2); color: var(--ink2); }
.camp-timing.live { background: var(--primary-soft); color: var(--primary); } .camp-timing.next { background: var(--accent2); color: var(--accent2-ink); }
.camp-dates { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; } .camp-dates strong { font-weight: 600; }
.camp-dates svg.lucide { width: 17px; height: 17px; color: var(--ink2); }
.camp-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding-top: 14px; border-top: 1px solid var(--surface2); }
.camp-metrics div { display: flex; flex-direction: column; min-width: 0; }
.camp-metrics span { font-size: 12px; color: var(--ink3); }
.camp-metrics strong { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camp-progress { display: flex; align-items: center; gap: 10px; }
.camp-foot { display: flex; justify-content: flex-end; }

/* Tabla densa de aterrizajes */
.table.dense th { padding: 8px 8px; font-size: 12px; }
.table.dense td { padding: 5px 8px; font-size: 12.5px; white-space: nowrap; line-height: 1.35; }
.table.dense .chip { font-size: 12px; padding: 1px 8px; }
.table.dense td.clip { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.table.dense td.clip-s { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.table.dense .chip { font-size: 11.5px; padding: 1px 7px; gap: 5px; }
.table.dense .warn-dot { width: 15px; height: 15px; font-size: 10px; }
.table.dense td, .table.dense th { padding-left: 6px; padding-right: 6px; }
.table.dense .chip[class*="via-"] { background: none; padding: 0; }
.table.dense td.clip { max-width: 150px; }
@media (min-width: 861px) { .main { padding-left: 30px; padding-right: 30px; } }
.total-row td { font-weight: 600; background: var(--surface); }
.budget-alerts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.budget-alert { display: flex; align-items: center; gap: 4px; text-align: left; border: 0; background: var(--warn-soft); color: var(--ink); padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; }
.budget-alert .warn-dot { margin: 0 6px 0 0; background: var(--bg); }

/* Estado «Aprobado» */
.chip.st-aprobado { background: var(--primary-soft); color: var(--primary); } .chip.st-aprobado::before { background: var(--st-appr); }
.dot.st-aprobado { background: var(--st-appr); }
.st-aprobado.tl-bar { box-shadow: inset 0 0 0 2px rgba(255,255,255,.75); }
.swatch.st-aprobado { box-shadow: inset 0 0 0 2px rgba(255,255,255,.8); }
fieldset.money { display: flex; flex-direction: column; gap: 10px; }
.field input:not([type=checkbox]), .field select, .field output { width: 100%; }
