/* Piollin — herramienta de proyecciones financieras */
:root {
  --bg: #F5F2EB; --bg2: #F7F4EE; --card: #FBF9F4; --ink: #141312; --ink2: #3D3833; --muted: #6F685F; --muted2: #A39A8C;
  --line: #E4DDD0; --line2: #EFEAE1; --brand: #55762E; --brand-d: #3E5720; --brand-soft: #EDF2E2; --brand-soft2: #F2F5EA;
  --bad: #9B1C12; --bad-soft: #F6E3DD; --warn: #92400E; --warn-soft: #FEF3C7; --info: #1E40AF; --info-soft: #DBEAFE; --ok: #55762E;
  --shadow: 0 8px 24px rgba(20,19,18,.12); --font: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
  --r: 6px;
}
* { box-sizing: border-box; }
/* Barras de desplazamiento finas y discretas */
* { scrollbar-width: thin; scrollbar-color: transparent transparent; }
*:hover, *:focus-within { scrollbar-color: rgba(20,19,18,.22) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
:hover::-webkit-scrollbar-thumb, :focus-within::-webkit-scrollbar-thumb { background: rgba(20,19,18,.18); }
::-webkit-scrollbar-thumb:hover { background: rgba(20,19,18,.35) !important; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 13px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); } a:hover { color: var(--brand-d); }
h1, h2, h3, h4 { margin: 0 0 8px; letter-spacing: -.01em; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; } h4 { font-size: 13px; }
p { margin: 0 0 10px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .mono { font-family: var(--mono); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.neg { color: var(--bad); } .pos { color: var(--brand-d); }
.right { text-align: right; } .grow { flex: 1 1 auto; } .hide { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Controles */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--ink); cursor: pointer; white-space: nowrap; text-decoration: none; font-weight: 500; }
.btn:hover { background: var(--bg2); border-color: #D6CDBE; color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--card); font-weight: 600; }
.btn.dark:hover { background: #2a2826; color: #fff; }
.btn.brand { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.brand:hover { background: var(--brand-d); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line2); }
.btn.danger { color: var(--bad); }
.btn.big { min-height: 42px; padding: 0 18px; font-size: 14px; }
.btn.sm { min-height: 26px; padding: 0 8px; font-size: 12px; }
.btn.icon { width: 30px; padding: 0; }
.btn.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card); }
.seg button { min-height: 28px; padding: 0 8px; border: 0; background: transparent; cursor: pointer; color: var(--ink2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: var(--card); font-weight: 600; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tabs button { min-height: 30px; padding: 0 9px; border: 0; border-radius: var(--r); background: transparent; color: var(--ink2); cursor: pointer; }
.tabs button:hover { background: var(--line2); }
.tabs button.on { background: var(--ink); color: var(--card); font-weight: 600; }
.in, select.in, textarea.in { width: 100%; min-height: 32px; padding: 5px 9px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
textarea.in { min-height: 80px; resize: vertical; line-height: 1.5; }
.in:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.in.num { text-align: right; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink2); }
label.f .hint { font-weight: 400; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink2); }
.hint { font-size: 12px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; min-height: 28px; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.sep-v { width: 1px; height: 20px; background: var(--line); }
.badge { display: inline-flex; align-items: center; min-height: 18px; padding: 0 6px; border-radius: 9px; font-size: 11px; font-weight: 600; background: var(--line2); color: var(--ink2); white-space: nowrap; }
.badge.bad, .badge.error { background: var(--bad-soft); color: var(--bad); }
.badge.warn, .badge.advertencia { background: var(--warn-soft); color: var(--warn); }
.badge.ok { background: var(--brand-soft); color: var(--brand-d); }
.badge.info, .badge.aviso { background: var(--info-soft); color: var(--info); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); display: inline-block; }
.dot.bad { background: var(--bad); } .dot.warn { background: #D97706; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.card.pad, .pad { padding: 16px; }
.alert { padding: 9px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg2); margin-bottom: 12px; }
.alert.bad { background: var(--bad-soft); border-color: #EBC5BB; color: var(--bad); }
.alert.warn { background: var(--warn-soft); border-color: #F3D98B; color: var(--warn); }
.alert.ok { background: var(--brand-soft); border-color: #CBD9B2; color: var(--brand-d); }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: #fff; }

/* Entrar */
.auth-body { min-height: 100vh; background: linear-gradient(180deg, var(--bg2) 0%, #EFEAE1 100%); }
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 18px; gap: 26px; }
.auth-logo img { height: 44px; display: block; }
.auth-form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.auth-form .in { min-height: 42px; font-size: 14px; background: #fff; }
.auth-form label.auth-check { flex-direction: row; align-items: center; font-weight: 400; }
.auth-link.right { align-self: flex-end; font-size: 12.5px; margin-top: -4px; }
.auth-alt { text-align: center; color: var(--muted); margin: 4px 0 0; }
.auth-note { color: var(--ink2); line-height: 1.5; }
.auth-err { padding: 9px 12px; border-radius: var(--r); background: var(--bad-soft); color: var(--bad); }
.auth-title { font-size: 18px; }
.auth-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.lang-switch { display: inline-flex; gap: 8px; } .lang-switch a { color: var(--muted); text-decoration: none; } .lang-switch a.on { color: var(--ink); font-weight: 600; }

/* Estructura de la aplicación */
.app-body { height: 100vh; overflow: hidden; }
.shell { height: 100vh; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--bg2) 0%, #EFEAE1 100%); }
.top { display: flex; align-items: center; gap: 10px; padding: 0 12px; min-height: 44px; background: var(--card); border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.top-logo img { height: 22px; display: block; }
.top .sep { color: #D6CDBE; }
.top .status { display: inline-flex; align-items: center; gap: 6px; color: var(--ink2); font-size: 12px; }
.top-r { display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--line); color: var(--ink2); font-weight: 600; cursor: pointer; }
.dd { position: relative; }
.dd > button { min-height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: var(--r); background: transparent; font-weight: 600; cursor: pointer; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd > button:hover { background: var(--line2); }
.dd > button.boxed { border-color: var(--line); background: var(--bg2); font-weight: 500; }
.menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 50; min-width: 220px; max-height: 60vh; overflow: auto; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 1px; }
.menu.right { left: auto; right: 0; }
.menu button, .menu a, .menu label { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 8px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; text-decoration: none; white-space: nowrap; }
.menu button:hover, .menu a:hover, .menu label:hover { background: var(--line2); }
.menu button.on { background: var(--brand-soft); color: var(--brand-d); font-weight: 600; }
.menu .mh { padding: 6px 8px 2px; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.menu hr { border: 0; border-top: 1px solid var(--line2); margin: 4px 0; }
.body { flex: 1 1 auto; display: flex; min-height: 0; }
.side { flex: 0 0 232px; background: var(--card); border-right: 1px solid var(--line); padding: 10px 8px; overflow: auto; display: flex; flex-direction: column; gap: 1px; }
.side .sh { padding: 10px 8px 4px; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.side .sh:first-child { padding-top: 4px; }
.side a { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 30px; padding: 0 8px; border-radius: var(--r); color: var(--ink2); text-decoration: none; }
.side a:hover { background: var(--line2); color: var(--ink); }
.side a.on { background: var(--brand-soft); color: var(--brand-d); font-weight: 600; }
.side .cnt { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad-soft); color: var(--bad); font-size: 11px; font-weight: 600; text-align: center; }
.side .foot { margin-top: auto; padding: 10px 8px 2px; font-size: 11px; color: var(--muted2); }
.main { flex: 1 1 auto; min-width: 0; overflow: auto; display: flex; flex-direction: column; }
.main:focus { outline: none; }
.statusbar { flex: 0 0 auto; display: flex; align-items: center; gap: 14px; min-height: 26px; padding: 0 12px; background: var(--card); border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); overflow: hidden; white-space: nowrap; }
.statusbar b { color: var(--ink2); font-weight: 600; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 6; }
.lockbar { padding: 6px 12px; background: var(--info-soft); color: var(--info); font-size: 12.5px; border-bottom: 1px solid #C7D7F5; }
.demobar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 14px; background: #FEF3C7; color: #78350F; border-bottom: 1px solid #F3D98B; font-size: 12.5px; flex: 0 0 auto; }
.demobar[hidden] { display: none; }
.page { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.page.narrow { max-width: 980px; }
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ph h1 { margin: 0; }
.ph p { margin: 2px 0 0; color: var(--muted); }

/* Rejilla de estados financieros */
.split { flex: 1 1 auto; display: flex; min-height: 0; }
.split > .gridwrap { flex: 1 1 auto; min-width: 0; overflow: auto; background: var(--card); }
.fg { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.fg th, .fg td { padding: 0 10px; height: 28px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.fg thead th { position: sticky; top: 0; z-index: 3; background: var(--bg2); border-bottom: 1px solid var(--line); font-weight: 600; color: var(--ink2); font-size: 12px; text-align: right; cursor: pointer; user-select: none; }
.fg thead th:hover { color: var(--ink); }
.fg thead th.sorted::after { content: ' ↓'; color: var(--brand); }
.fg thead th.sorted.asc::after { content: ' ↑'; }
.fg th.lab, .fg td.lab { position: sticky; left: 0; z-index: 2; background: var(--card); text-align: left; min-width: 230px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--line); }
.fg thead th.lab { z-index: 4; background: var(--bg2); }
.fg td.v { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; min-width: 84px; cursor: cell; font-size: 12.5px; }
.fg td.v:hover { background: var(--brand-soft2); }
.fg td.v.sel { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand); }
.fg td.v.err { background: var(--bad-soft); color: var(--bad); }
.fg td.v.warn { background: #FDF6E3; }
.fg td.v.hist { color: var(--muted); }
.fg tr:not(.sub):not(.total) td.neg { color: inherit; }
.fg td.tot, .fg th.tot { background: var(--bg2); font-weight: 600; border-left: 1px solid var(--line); }
.fg td.pct { color: var(--muted); font-size: 12px; }
.fg tr.sub td { font-weight: 600; background: #F8F6F0; }
.fg tr.sub td.lab { background: #F8F6F0; }
.fg tr.total td { font-weight: 700; border-top: 1px solid var(--ink2); background: var(--bg2); }
.fg tr.total td.lab { background: var(--bg2); }
.fg tr.child td.lab { padding-left: 28px; color: var(--ink2); }
.fg tr.child2 td.lab { padding-left: 44px; color: var(--muted); font-size: 12px; }
.fg tr.hd td { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; background: var(--card); height: 30px; }
.fg tr:hover td.lab { color: var(--ink); }
.fg .tg { display: inline-block; width: 14px; color: var(--muted); cursor: pointer; }
.fg .rowmenu { visibility: hidden; float: right; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 2px; }
.fg tr:hover .rowmenu { visibility: visible; }
.fg tr.hl td { background: #FFF8DC !important; }
.panel { flex: 0 0 340px; max-width: 42vw; border-left: 1px solid var(--line); background: var(--card); overflow: auto; display: flex; flex-direction: column; }
.panel .phd { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 2; }
.panel .phd h3 { margin: 0; flex: 1; font-size: 13px; }
.panel .pbd { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.trace { font-size: 12.5px; }
.trace .formula { font-family: var(--mono); font-size: 12px; padding: 8px 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); line-height: 1.6; white-space: pre-wrap; }
.trace table { width: 100%; border-collapse: collapse; }
.trace td { padding: 4px 0; border-bottom: 1px solid var(--line2); }
.trace td:last-child { text-align: right; font-family: var(--mono); }
.trace .edit { display: flex; gap: 6px; align-items: center; }
.trace .edit input { width: 110px; }
.issue { display: flex; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; cursor: pointer; }
.issue:hover { border-color: #D6CDBE; }
.issue .ib { flex: 1; min-width: 0; }
.issue > .badge { align-self: flex-start; }
label.f .badge { align-self: flex-start; }
.issue .loc { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.issue .det { font-size: 12px; color: var(--ink2); margin-top: 4px; }
.mini-chart { height: 170px; }

/* Tablas de datos */
.dt-wrap { overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.dt { width: 100%; border-collapse: collapse; }
.dt th, .dt td { padding: 6px 10px; border-bottom: 1px solid var(--line2); text-align: left; white-space: nowrap; }
.dt th { position: sticky; top: 0; z-index: 1; background: var(--bg2); font-size: 12px; font-weight: 600; color: var(--ink2); border-bottom-color: var(--line); cursor: default; }
.dt th.sortable { cursor: pointer; } .dt th.sortable:hover { color: var(--ink); }
.dt td.num, .dt th.num { text-align: right; }
.dt tr:hover td { background: #FAF8F2; }
.dt tr.on td { background: var(--brand-soft2); }
.dt td .in { min-height: 26px; padding: 2px 6px; }
.dt td select.in { width: auto; min-width: 130px; }
.dt td.wrap { white-space: normal; }
.dt tfoot td { font-weight: 600; background: var(--bg2); }
.cell-in { width: 100%; min-width: 70px; border: 1px solid transparent; background: transparent; padding: 3px 5px; border-radius: 4px; text-align: right; font-family: var(--mono); font-size: 12px; }
.cell-in:hover { border-color: var(--line); background: #fff; }
.cell-in:focus { border-color: var(--brand); background: #fff; outline: none; }
.cell-in.txt { text-align: left; font-family: var(--font); }
.cell-in.ov { background: #FDF6E3; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kpi { padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.kpi .k { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 20px; font-weight: 700; font-family: var(--mono); letter-spacing: -.02em; margin-top: 2px; }
.kpi .s { font-size: 12px; margin-top: 2px; }
.drop { border: 1.5px dashed #D6CDBE; border-radius: 8px; padding: 18px; text-align: center; background: var(--bg2); cursor: pointer; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft2); }
.drop b { display: block; margin-bottom: 4px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.step-card { padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 8px; }
.step-card .n { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--card); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.step-card.done .n { background: var(--brand); }
.months { display: flex; flex-wrap: wrap; gap: 4px; }
.months span { padding: 3px 7px; border-radius: 4px; background: var(--brand-soft); color: var(--brand-d); font-size: 11.5px; font-family: var(--mono); }
.months span.miss { background: var(--line2); color: var(--muted2); }
.months span.bad { background: var(--bad-soft); color: var(--bad); }
.bar-in { height: 6px; border-radius: 3px; background: var(--line2); overflow: hidden; min-width: 60px; }
.bar-in i { display: block; height: 100%; background: var(--brand); }
.bar-in i.bad { background: var(--bad); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); }

/* Vistas y bloques */
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; }
.wg { background: var(--card); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; min-height: 300px; min-width: 0; }
.wg.wide { grid-column: 1 / -1; }
.wg-h { display: flex; align-items: center; gap: 6px; padding: 8px 8px 6px 12px; border-bottom: 1px solid var(--line2); }
.wg-h b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.wg-h .btn { min-height: 26px; }
.wg-b { flex: 1; padding: 8px 10px 10px; min-height: 240px; position: relative; }
.wg-b .trc { height: 260px; }
.wg.wide .wg-b .trc { height: 320px; }
.wg-err { color: var(--bad); padding: 20px; }
.editing .wg { outline: 1.5px dashed #D6CDBE; cursor: grab; }
.editing .wg.dragover { outline-color: var(--brand); }
.palettes { display: flex; flex-wrap: wrap; gap: 6px; }
.pal { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; cursor: pointer; padding: 0; background: #fff; }
.pal.on { box-shadow: 0 0 0 2px var(--ink); }
.pal i { width: 14px; height: 18px; display: block; }
.assist { display: flex; flex-direction: column; height: 100%; }
.assist .msgs { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 100%; }
.msg.user { align-self: flex-end; background: var(--ink); color: var(--card); padding: 7px 11px; border-radius: 10px 10px 2px 10px; max-width: 85%; }
.msg.assistant .tx { white-space: pre-wrap; line-height: 1.5; }
.msg .wg { min-height: 0; margin-top: 8px; }
.msg .wg-b .trc { height: 200px; }
.assist form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.assist .sugs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.chip { min-height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; font-size: 12px; color: var(--ink2); }
.chip:hover { border-color: var(--brand); color: var(--brand-d); }
.typing { color: var(--muted); font-size: 12px; }

/* Modal y avisos */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(20,19,18,.35); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow: auto; }
.modal-wrap[hidden] { display: none; }
.modal { width: 100%; max-width: 520px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.modal.wide { max-width: 860px; }
.modal-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.modal-h h2 { margin: 0; flex: 1; font-size: 15px; }
.modal-b { padding: 14px; max-height: 70vh; overflow: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.modal.full { max-width: 1200px; }
.modal.full .wg-b .trc { height: 60vh; }
.toasts { position: fixed; bottom: 36px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { padding: 8px 14px; border-radius: var(--r); background: var(--ink); color: var(--card); box-shadow: var(--shadow); pointer-events: auto; max-width: 90vw; }
.toast.bad { background: var(--bad); color: #fff; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.loading-page { padding: 60px; text-align: center; color: var(--muted); }
.prem { white-space: pre-wrap; line-height: 1.6; font-size: 13px; }
.prem h3 { margin-top: 12px; }

/* Página pública */
.lp { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.lp-nav { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.lp-nav img { height: 28px; display: block; }
.lp-nav nav { display: flex; gap: 18px; margin-left: 12px; }
.lp-nav nav a { color: var(--ink2); text-decoration: none; }
.lp-hero { padding: 64px 0 40px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.lp-hero h1 { font-size: 44px; line-height: 1.05; letter-spacing: -.03em; margin-bottom: 16px; }
.lp-hero p { font-size: 17px; color: var(--ink2); line-height: 1.55; max-width: 520px; }
.lp-shot { background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 20px 50px rgba(20,19,18,.10); overflow: hidden; font-size: 11.5px; }
.lp-shot table { width: 100%; border-collapse: collapse; font-family: var(--mono); }
.lp-shot td, .lp-shot th { padding: 5px 8px; border-bottom: 1px solid var(--line2); text-align: right; }
.lp-shot td:first-child, .lp-shot th:first-child { text-align: left; font-family: var(--font); }
.lp-shot th { background: var(--bg2); font-family: var(--font); font-weight: 600; }
.lp-shot tr.t td { font-weight: 700; background: var(--bg2); }
.lp-sys { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 0 40px; }
.lp-chip { padding: 4px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); font-size: 12.5px; color: var(--ink2); }
.lp-sec { padding: 56px 0; border-top: 1px solid var(--line); }
.lp-sec h2 { font-size: 28px; letter-spacing: -.02em; margin-bottom: 8px; }
.lp-sec > p { color: var(--ink2); font-size: 16px; max-width: 640px; }
.lp-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 24px; }
.lp-feat { padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.lp-feat h3 { font-size: 15px; }
.lp-feat p { color: var(--ink2); margin: 0; line-height: 1.5; }
.lp-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 24px; }
.lp-plan { padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 10px; }
.lp-plan.hi { border-color: var(--ink); }
.lp-plan .pr { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.lp-plan ul { margin: 0; padding-left: 18px; color: var(--ink2); line-height: 1.7; }
.lp-cmp { width: 100%; border-collapse: collapse; margin-top: 20px; background: var(--card); border: 1px solid var(--line); }
.lp-cmp th, .lp-cmp td { padding: 9px 12px; border-bottom: 1px solid var(--line2); text-align: left; }
.lp-cmp td.y { color: var(--brand-d); font-weight: 600; }
.lp-foot { padding: 30px 0 40px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }

@media (max-width: 900px) {
  .lp-hero { grid-template-columns: 1fr; padding-top: 36px; } .lp-hero h1 { font-size: 34px; } .lp-nav nav { display: none; }
  .side { position: fixed; top: 44px; bottom: 26px; left: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .panel { position: fixed; right: 0; top: 44px; bottom: 26px; z-index: 30; max-width: 92vw; width: 360px; box-shadow: var(--shadow); }
  .hide-sm { display: none !important; }
  .top { gap: 6px; padding: 0 6px; } .top .sep { display: none; } .top-logo img { height: 18px; }
  .dd > button { max-width: 120px; padding: 0 4px; } .top .status { display: none; }
  .fg th.lab, .fg td.lab { min-width: 150px; max-width: 170px; } .fg .badge { display: none; }
  .fg td.v { min-width: 70px; } .page { padding: 12px; } .fg .rowmenu { display: none; }
  .wgrid { grid-template-columns: 1fr; }
}
@media (min-width: 901px) { .only-sm { display: none !important; } }
@media print {
  .top, .side, .statusbar, .toolbar, .panel, .no-print { display: none !important; }
  .app-body, .shell, .body, .main, .split, .split > .gridwrap { height: auto; overflow: visible; display: block; background: #fff; }
  .fg th.lab, .fg td.lab, .fg thead th { position: static; }
  .fg { font-size: 9px; } .fg th, .fg td { height: auto; padding: 2px 4px; }
  .wg { break-inside: avoid; }
}


/* Indicadores */
.kst { display: inline-block; padding: 1px 6px; border-radius: 4px; }
.kst.ok { background: var(--brand-soft); color: var(--brand-d); }
.kst.warn { background: var(--warn-soft); color: var(--warn); }
.kst.bad { background: var(--bad-soft); color: var(--bad); }

/* Reporte al consejo */
.rp { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 20px; }
.rp-page { width: 100%; max-width: 980px; min-height: 600px; background: #fff; box-shadow: 0 6px 24px rgba(20,19,18,.10); padding: 36px 44px; color: var(--ink); }
.rp-h { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 18px; }
.rp-page h2 { font-size: 20px; margin-bottom: 14px; }
.rp-cover { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-height: 560px; }
.rp-cover h1 { font-size: 40px; letter-spacing: -.03em; line-height: 1.05; margin: 0; }
.rp-cover p { font-size: 15px; margin: 0; }
.rp-brand { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.rp-ok { color: var(--brand-d); font-weight: 600; }
.rp-t { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-bottom: 12px; }
.rp-t th, .rp-t td { padding: 4px 6px; border-bottom: 1px solid var(--line2); text-align: right; font-variant-numeric: tabular-nums; }
.rp-t td { font-family: var(--mono); }
.rp-t th:first-child, .rp-t td:first-child { text-align: left; font-family: var(--font); }
.rp-t thead th { border-bottom: 1.5px solid var(--ink); font-weight: 600; }
.rp-t tr.sub td, .rp-t tr.total td { font-weight: 700; background: #F8F6F0; }
.rp-t tr.total td { border-top: 1.5px solid var(--ink); }
.rp-k { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.rp-k div { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.rp-k span { display: block; font-size: 11px; color: var(--muted); }
.rp-k b { font: 700 20px var(--mono); }
.rp-k small { font: 500 12px var(--font); color: var(--brand-d); }
.rp-c { margin: 10px 0 14px; padding: 10px 14px; border-left: 3px solid var(--brand); background: var(--brand-soft2); line-height: 1.6; font-size: 13px; }
.rp-ch { height: 230px; margin-top: 8px; }
.rp-w { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rp-w .trc { height: 220px; }
.rp-sign { width: 100%; max-width: 980px; background: #fff; padding: 60px 44px 36px; display: flex; justify-content: space-around; gap: 20px; flex-wrap: wrap; }
.rp-sign div { display: flex; flex-direction: column; align-items: center; min-width: 180px; }
.rp-sign span { width: 200px; border-top: 1px solid var(--ink); margin-bottom: 6px; }
.rp-sign small { color: var(--muted); }
.share-body { background: #E9E4DA; }
.share-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.share-bar img { height: 22px; }
@media (max-width: 900px) { .rp { padding: 8px; } .rp-page { padding: 20px 16px; } .rp-k { grid-template-columns: 1fr 1fr; } .rp-w { grid-template-columns: 1fr; } }
@media print {
  @page { size: letter landscape; margin: 12mm; }
  .share-body, .share-bar { background: #fff; } .share-bar { display: none; }
  .rp { padding: 0; gap: 0; display: block; } .rp-page { box-shadow: none; padding: 0; max-width: none; min-height: 0; page-break-after: always; break-after: page; }
  .rp-cover { min-height: 160mm; } .rp-sign { padding: 40px 0 0; }
}


/* Hoja de captura */
.sh-host { flex: 1; min-height: 360px; height: calc(100vh - 220px); margin-top: 8px; }
.shx { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; height: 100%; }
.sh-bar { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.sh-ref { min-width: 48px; font-size: 12px; color: var(--muted); }
.sh-fx { flex: 1; min-height: 26px; border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; font: 12.5px var(--mono); background: #fff; }
.sh-st { white-space: nowrap; }
.sh-scroll { position: relative; flex: 1; overflow: auto; outline: none; }
.sh-head { position: sticky; top: 0; z-index: 3; display: flex; height: 28px; background: var(--bg2); border-bottom: 1px solid var(--line); }
.sh-head .sh-rn { position: sticky; left: 0; z-index: 4; background: var(--bg2); }
.sh-h { flex: none; padding: 0 8px; line-height: 28px; font-size: 12px; font-weight: 600; color: var(--ink2); border-right: 1px solid var(--line2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-h.num { text-align: right; }
.sh-body { position: relative; }
.sh-row { position: absolute; left: 0; display: flex; height: 28px; }
.sh-rn { flex: none; width: 46px; position: sticky; left: 0; z-index: 2; background: var(--bg2); color: var(--muted2); font-size: 11px; text-align: center; line-height: 28px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line2); }
.sh-c { flex: none; height: 28px; line-height: 27px; padding: 0 8px; border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12.5px; cursor: cell; user-select: none; }
.sh-c.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sh-c.neg { color: var(--bad); }
.sh-c.in { background: var(--brand-soft2); }
.sh-c.act { box-shadow: inset 0 0 0 2px var(--brand); background: #fff; }
.sh-c.bad { background: var(--bad-soft); color: var(--bad); }
.sh-ed { position: absolute; display: none; z-index: 5; height: 28px; margin-top: 0; border: 2px solid var(--brand); padding: 0 6px; font: 12.5px var(--font); background: #fff; outline: none; box-shadow: var(--shadow); }
.sh-ed.num { text-align: right; font-family: var(--mono); }

/* Selector de idioma */
.ltog { display: inline-flex; padding: 2px; border-radius: 15px; background: var(--line2); border: 1px solid var(--line); }
.ltog button { min-height: 24px; min-width: 32px; padding: 0 8px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 600; cursor: pointer; letter-spacing: .02em; }
.ltog button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(20,19,18,.15); }
.ltog.big button { min-height: 32px; min-width: 96px; font-size: 13px; }
.lang-sw { display: inline-flex; padding: 2px; border-radius: 15px; background: var(--line2); border: 1px solid var(--line); gap: 0; font-size: 0; }
.lang-sw a, .lang-sw b { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; min-width: 34px; padding: 0 8px; border-radius: 12px; font-size: 11.5px; font-weight: 600; text-decoration: none; color: var(--muted); }
.lang-sw b { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(20,19,18,.15); }
.lang-sw a:hover { color: var(--ink); }

/* Asistente global */
.ai-btn { gap: 7px; border-radius: 15px; }
.ai-btn.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, #8FA876, #55762E); box-shadow: 0 0 0 3px rgba(85,118,46,.18); display: inline-block; }
.assist-dr { position: fixed; top: 44px; right: 0; bottom: 26px; width: 400px; max-width: 94vw; z-index: 60; background: var(--card); border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(20,19,18,.08); display: flex; flex-direction: column; transform: translateX(105%); transition: transform .2s ease; }
.assist-dr.open { transform: none; }
.assist-dr .phd { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.assist-dr .phd h3 { flex: 1; margin: 0; font-size: 13px; }
.assist-dr .assist { flex: 1; min-height: 0; }
.ctxline { padding: 6px 12px; border-top: 1px dashed var(--line); background: var(--brand-soft2); }
body.assist-open .main { padding-right: 400px; }
@media (max-width: 1100px) { body.assist-open .main { padding-right: 0; } }

/* Avatar y perfil */
.avatar { overflow: hidden; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.pf-av { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; background: var(--line); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; color: var(--ink2); flex: none; }
.pf-av img { width: 100%; height: 100%; object-fit: cover; }

/* Panel de administración */
.adm-title { display: none; }
body.admin-mode .adm-title { display: inline; font-weight: 600; }
body.admin-mode .side { background: var(--ink); border-right-color: #2a2826; }
body.admin-mode .side .sh { color: #A39A8C; }
body.admin-mode .side a { color: #E4DDD0; }
body.admin-mode .side a:hover { background: #2a2826; color: #fff; }
body.admin-mode .side a.on { background: #3D3833; color: #fff; }
body.admin-mode .side .foot a { color: #CBD9B2; padding: 0; min-height: 0; }
body.admin-mode .top { background: #F2EEE6; }
body.admin-mode .assist-dr, body.admin-mode .ai-btn { display: none !important; }
#admForm .adm-sec[data-s="sistema"] { }
body.admin-mode .main { padding-right: 0 !important; }
body.admin-mode #scenarioDd, body.admin-mode #companyDd, body.admin-mode .top .sep, body.admin-mode .top .status { display: none !important; }


/* Barra lateral */
.side { padding: 0; gap: 0; transition: flex-basis .18s ease; }
.nv-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 4px; padding: 8px 8px 6px; background: var(--card); border-bottom: 1px solid var(--line2); }
.nv-search { flex: 1; position: relative; display: flex; align-items: center; min-width: 0; }
.nv-search svg { position: absolute; left: 8px; width: 14px; height: 14px; color: var(--muted2); pointer-events: none; }
.nv-search input { width: 100%; min-height: 30px; padding: 4px 26px 4px 28px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg2); font-size: 12.5px; }
.nv-search input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.nv-search kbd { position: absolute; right: 6px; font-size: 10px; padding: 0 4px; }
.nv-btn { flex: none; width: 26px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.nv-btn:hover { background: var(--line2); color: var(--ink); }
.nv-list { padding: 6px 8px 14px; display: flex; flex-direction: column; gap: 1px; }
.nv-g { display: flex; flex-direction: column; gap: 1px; margin-bottom: 4px; }
.nv-gh, .nv-sh { font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .07em; text-transform: uppercase; }
.nv-sh { padding: 8px 6px 4px; }
.nv-gh { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; padding: 8px 6px 4px !important; border-radius: 5px; }
.nv-gh:hover { background: var(--bg2); }
.nv-chev { display: inline-block; width: 10px; font-size: 9px; color: var(--muted2); transition: transform .15s; }
.nv-g.col .nv-chev { transform: rotate(-90deg); }
.nv-g.col .nv-items { display: none; }
.nv-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--gc); flex: none; }
.nv-gc { margin-left: auto; font-size: 10px; color: var(--muted2); font-weight: 500; letter-spacing: 0; }
.nv-add { margin-left: 4px; width: 18px; height: 18px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.nv-add:hover { background: var(--line); color: var(--ink); }
.nv-items { display: flex; flex-direction: column; gap: 1px; }
.side a.nv-l { position: relative; display: flex; align-items: center; gap: 9px; min-height: 30px; padding: 0 6px 0 9px; border-radius: 6px; color: var(--ink2); text-decoration: none; }
.side a.nv-l .nv-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side a.nv-l:hover { background: var(--line2); color: var(--ink); }
.side a.nv-l.on { background: var(--brand-soft); color: var(--brand-d); font-weight: 600; }
.side a.nv-l.on::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--brand); }
.side a.nv-l.drag { opacity: .4; }
.side a.nv-l.over { box-shadow: 0 2px 0 var(--brand); }
.nv-g.over { outline: 1.5px dashed var(--brand); outline-offset: 2px; border-radius: 6px; }
.nv-i { width: 16px; height: 16px; flex: none; color: var(--muted); }
.side a.nv-l.on .nv-i { color: var(--brand); }
.nv-star { flex: none; width: 20px; height: 20px; border: 0; padding: 2px; background: transparent; color: var(--muted2); cursor: pointer; opacity: 0; border-radius: 4px; }
.nv-star svg { width: 14px; height: 14px; display: block; }
.nv-l:hover .nv-star, .nv-star.on { opacity: 1; }
.nv-star.on { color: #B08D57; }
.nv-star:hover { background: var(--line); }
.nv-sep { height: 1px; background: var(--line2); margin: 6px 4px; }
.nv-empty, .nv-hint { padding: 8px; font-size: 11.5px; color: var(--muted); line-height: 1.5; border: 1px dashed var(--line); border-radius: 6px; margin: 6px 2px; }
.nv-hint.over { border-color: var(--brand); background: var(--brand-soft2); }
body.nav-mini .side { flex-basis: 52px; }
body.nav-mini .nv-search, body.nav-mini #nvMenu, body.nav-mini .nv-t, body.nav-mini .nv-star, body.nav-mini .nv-gh, body.nav-mini .nv-hint, body.nav-mini .side .cnt { display: none !important; }
body.nav-mini .nv-top { justify-content: center; padding: 8px 4px; }
body.nav-mini .nv-list { padding: 6px 6px; }
body.nav-mini .nv-g.col .nv-items { display: flex; }
body.nav-mini .side a.nv-l { justify-content: center; padding: 0; }
body.nav-mini .nv-g { margin-bottom: 0; padding-bottom: 6px; border-bottom: 1px solid var(--line2); }

/* Gráficas (motor SVG) */
/* ---------------- Motor de gráficos ---------------- */
.trc { position: relative; width: 100%; height: 100%; }
.trc-svg { display: block; width: 100%; height: auto; overflow: hidden; }
.trc-scroll { overflow: auto; }
.trc-noanim *, .trc-noanim { animation: none !important; stroke-dashoffset: 0 !important; }
.trc-auto { height: auto !important; }
.trc-center-box { display: flex; align-items: center; justify-content: center; }
.trc-tick { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.trc-axis-title { font-size: 11px; fill: var(--muted2); }
.trc-grid { stroke: #eff0f7; stroke-width: 1; }
.trc-zero { stroke: #dcdfec; stroke-width: 1; }
.trc-val { font-size: 11px; font-weight: 600; fill: var(--ink2); }
.trc-cross { stroke: #c7cae6; stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.trc-line { stroke-dasharray: 3000; stroke-dashoffset: 3000; animation: trcDraw 1.1s ease-out forwards; }
.trc-area { opacity: 0; animation: trcFade .8s .25s ease-out forwards; }
.trc-dot { transition: r .12s; }
.trc-bar { transform-box: fill-box; transform-origin: bottom; animation: trcGrow .6s cubic-bezier(.2, .8, .2, 1) both; cursor: pointer; transition: opacity .15s; }
.trc-bar:hover, .trc-slice:hover, .trc-pt:hover, .trc-cell:hover { opacity: .82; }
.trc-slice { cursor: pointer; animation: trcFade .6s ease-out both; transition: opacity .15s; }
.trc-pt { animation: trcFade .6s ease-out both; cursor: pointer; }
.trc-gauge { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: trcDraw 1.2s ease-out forwards; }

@keyframes trcDraw { to { stroke-dashoffset: 0; } }

@keyframes trcFade { from { opacity: 0; } to { opacity: 1; } }

@keyframes trcGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.trc-center { font-size: 19px; font-weight: 750; fill: var(--ink); }
.trc-center.big { font-size: 30px; }
.trc-center-sub { font-size: 11px; fill: var(--muted); }
.trc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; padding-top: 8px; }
.trc-legend.vertical { flex-direction: column; }
.trc-leg { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink2); }
.trc-leg i { width: 10px; height: 10px; border-radius: 3px; }
.trc-leg em { font-style: normal; color: var(--muted); margin-left: 4px; }
.trc-tip { position: fixed; z-index: 9999; pointer-events: none; background: #12152b; color: #fff; border-radius: 10px; padding: 9px 11px; font-size: 12px; box-shadow: 0 10px 30px rgba(10, 12, 40, .3); min-width: 140px; max-width: 280px; display: none; }
.trc-tip-h { font-weight: 650; margin-bottom: 5px; color: #fff; }
.trc-tip-row { display: flex; align-items: center; gap: 7px; margin-top: 3px; color: #c9cce4; }
.trc-tip-row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.trc-tip-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trc-tip-row b { color: #fff; font-weight: 650; white-space: pre; }
.trc-empty { display: grid; place-items: center; height: 100%; min-height: 120px; color: var(--muted2); font-size: 13px; }
.trc-hbars { display: flex; flex-direction: column; gap: 9px; padding: 6px 2px; }
.trc-hrow { display: grid; grid-template-columns: minmax(70px, 28%) 1fr auto; align-items: center; gap: 12px; font-size: 13px; cursor: default; }
.trc-hlab { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink2); }
.trc-htrack { height: 20px; background: transparent; border-radius: 5px; overflow: hidden; }
.trc-hfill { display: block; height: 100%; border-radius: 5px; animation: trcBar .8s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }

@keyframes trcBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.trc-hval { font-size: 13px; font-weight: 650; min-width: 54px; text-align: right; }
.trc-pie-wrap { display: flex; align-items: center; gap: 24px; height: 100%; justify-content: center; }
.trc-pie-wrap.stack { flex-direction: column; gap: 12px; }
.trc-pie-wrap svg { width: auto; flex: none; }
.trc-pie-legend { display: flex; flex-direction: column; gap: 9px; min-width: 120px; flex: 1; max-width: 240px; }
.trc-pl { display: grid; grid-template-columns: 10px 1fr auto; gap: 9px; align-items: center; font-size: 12.5px; color: var(--ink2); }
.trc-pl i { width: 10px; height: 10px; border-radius: 3px; }
.trc-pl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trc-pl b { color: var(--muted); font-weight: 600; }
.trc-funnel { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.trc-frow { display: grid; grid-template-columns: minmax(70px, 24%) 1fr 44px; align-items: center; gap: 12px; font-size: 13px; }
.trc-fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2); }
.trc-fbar-wrap { display: flex; justify-content: center; }
.trc-fbar { height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; min-width: 50px; animation: trcBar .8s both; }
.trc-frow em { font-style: normal; color: var(--muted); font-size: 12px; text-align: right; }
.trc-kpis { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
.trc-kpis.n1 { grid-template-columns: 1fr; }
.trc-kpis.n2 { grid-template-columns: repeat(2, 1fr); }
.trc-kpis.n3 { grid-template-columns: repeat(3, 1fr); }
.trc-kpi { display: flex; gap: 14px; align-items: flex-start; padding: 16px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; position: relative; overflow: hidden; min-width: 0; }
.trc-kpi-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.trc-kpi-ic svg { width: 21px; height: 21px; }
.trc-kpi-b { min-width: 0; flex: 1; position: relative; z-index: 1; }
.trc-kpi-l { font-size: 12.5px; color: var(--ink2); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trc-kpi-v { font-size: 25px; font-weight: 750; letter-spacing: -.02em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trc-kpi-d { font-size: 12px; font-weight: 650; margin-top: 4px; }
.trc-kpi-d span { color: var(--muted); font-weight: 450; margin-left: 4px; }
.trc-kpi-d.up { color: var(--ok); }
.trc-kpi-d.down { color: var(--bad); }
.trc-spark { position: absolute; right: 0; bottom: 6px; width: 46%; height: 34px; opacity: .55; }
.trc-table-wrap { overflow: auto; max-height: 420px; border: 1px solid var(--line); border-radius: 12px; }
.trc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.trc-table th { position: sticky; top: 0; background: #f7f8fc; text-align: left; font-weight: 600; color: var(--ink2); padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none; }
.trc-table td { padding: 8px 12px; border-bottom: 1px solid #f2f3f8; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.trc-table tr:hover td { background: #fbfbff; }
.trc-table .num { text-align: right; position: relative; font-variant-numeric: tabular-nums; }
.trc-table td.num span { position: relative; z-index: 1; }
.trc-tbar { position: absolute; right: 0; top: 6px; bottom: 6px; background: rgba(99, 102, 241, .08); border-radius: 4px 0 0 4px; z-index: 0 !important; }
.trc-more { font-size: 12px; color: var(--muted); padding: 8px 2px 0; }
.trc-kpis { grid-template-columns: repeat(2, 1fr) !important; }
.trc-line, .trc-area, .trc-bar, .trc-hfill, .trc-gauge, .trc-slice { animation: none !important; stroke-dashoffset: 0 !important; opacity: 1 !important; transform: none !important; }
}
.vcard .chart.kpi.trc, .vcard .chart.table.trc { height: auto; }
.trc-pie-wrap.stack .trc-pie-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; max-width: none; width: 100%; }
/* ================= Motor gráfico 2 ================= */
.trc { position: relative; }
.trc-leg, .trc-pl { background: none; border: 0; padding: 3px 6px; border-radius: 7px; cursor: pointer; font: inherit; transition: opacity .15s, background .15s; }
.trc-leg:hover, .trc-pl:hover { background: #f4f5fb; }
.trc-leg.off, .trc-pl.off { opacity: .38; }
.trc-leg.off i, .trc-pl.off i { background: #cbd0e4 !important; }
.trc-pl { width: 100%; text-align: left; }
.trc-tip-hint { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.12); color: #a5b4fc; font-size: 11px; }
.trc-brush { fill: rgba(99, 102, 241, .12); stroke: rgba(99, 102, 241, .5); stroke-dasharray: 3 3; pointer-events: none; }
.trc-reset { position: absolute; top: 2px; right: 2px; z-index: 2; border: 1px solid var(--line2); background: #fff; border-radius: 8px; font-size: 11.5px; padding: 3px 9px; cursor: pointer; color: var(--brand); font-weight: 600; box-shadow: var(--shadow); }
.trc-ref-l { font-size: 11px; font-weight: 650; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.trc-val.in { fill: #fff; paint-order: normal; }
.trc-val { paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.trc-val.in { stroke: none; }
.trc-tick.small { font-size: 10px; }
.trc-axis-title { font-size: 11px; font-weight: 600; fill: var(--muted2); }
.trc-tm-l { font-size: 12px; font-weight: 650; fill: #fff; pointer-events: none; }
.trc-tm-v { font-size: 11px; fill: rgba(255, 255, 255, .88); pointer-events: none; }
.trc-cell { transition: opacity .15s; }
.trc-sk-l { font-size: 12px; fill: var(--ink2); pointer-events: none; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.trc-link { transition: fill-opacity .15s; cursor: default; }
.trc-node { cursor: pointer; }
.trc-radar { animation: trcFade .7s ease-out both; }
.trc-region { transition: opacity .15s, stroke-width .15s; }
.trc-region.has:hover { opacity: .8; stroke: #1b1e3a; stroke-width: 1.2; }
.trc-map { display: flex; gap: 16px; align-items: center; }
.trc-map .trc-mapsvg { flex: 1; min-width: 0; width: 100%; display: block; overflow: hidden; }
.trc-map.withlist .trc-mapsvg { flex: none; width: 70%; }
.trc-map-list { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.trc-ml-h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted2); font-weight: 650; margin-bottom: 2px; }
.trc-ml { position: relative; display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; padding: 5px 8px; border-radius: 8px; overflow: hidden; }
.trc-ml > * { position: relative; z-index: 1; }
.trc-ml span { color: var(--muted2); font-weight: 650; }
.trc-ml b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trc-ml em { font-style: normal; color: var(--ink2); font-weight: 650; }
.trc-ml i { position: absolute !important; left: 0; top: 0; bottom: 0; opacity: .28; z-index: 0 !important; border-radius: 8px; }
.trc-scale { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 11px; color: var(--muted); padding-top: 6px; }
.trc-scale i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.trc-scale.map { justify-content: flex-start; gap: 8px; }
.trc-scale.map b { width: 120px; height: 8px; border-radius: 9px; display: inline-block; }
.trc-scale em { font-style: normal; margin-left: auto; color: var(--muted2); cursor: help; }
.trc-htrack { position: relative; }
.trc-goalmark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #16a34a; border-radius: 2px; }
.trc-progress { display: flex; flex-direction: column; gap: 14px; padding: 4px 2px; }
.trc-prow { border-radius: 10px; }
.trc-ptop { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.trc-ptop span { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trc-ptop b { font-weight: 700; white-space: nowrap; }
.trc-ptop em { font-style: normal; color: var(--muted); font-weight: 500; }
.trc-ptrack { height: 10px; background: #eef0f7; border-radius: 9px; overflow: hidden; }
.trc-ptrack i { display: block; height: 100%; border-radius: 9px; animation: trcBar .9s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }
.trc-ppct { font-size: 11.5px; font-weight: 650; margin-top: 4px; }
.trc-kpi-goal { height: 5px; background: #eef0f7; border-radius: 9px; overflow: hidden; margin-top: 8px; }
.trc-kpi-goal i { display: block; height: 100%; border-radius: 9px; }
.trc-kpi-gl { font-size: 11px; color: var(--muted); margin-top: 4px; }
.trc-tsearch { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.trc-tsearch input { flex: 1; height: 32px; border: 1px solid var(--line2); border-radius: 9px; padding: 0 10px; font: inherit; font-size: 13px; outline: none; }
.trc-tsearch input:focus { border-color: #a5a8f6; }
.trc-tsearch span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.trc-table tbody tr[style*="pointer"]:hover td { background: #f5f5ff; }
.vcard .chart.kpi.trc, .vcard .chart.table.trc { height: auto; }


@media (max-width: 1000px) {
  .ced { grid-template-columns: 1fr; }
  .ced-side { max-height: none; }
  .ced-prev .chart { height: 320px; }
  .trc-map.withlist { flex-direction: column; }
  .trc-map.withlist .trc-mapsvg { width: 100%; }
}
.trc-center, .trc-center-sub, .trc-val, .trc-tick, .trc-ref-l { pointer-events: none; }
.chart, .trc { overflow: hidden; contain: layout paint; }
.trc.trc-scroll { overflow: auto; }
.trc-note { font-size: 11.5px; color: var(--muted); text-align: center; padding-top: 4px; }

@media (prefers-reduced-motion: reduce) { .trc *, .trc { animation: none !important; } }
.trc-hbars { min-height: 100%; justify-content: space-evenly; }
.presenting .vcard .chart.kpi.trc, .presenting .vcard .chart.table.trc { height: auto; }
.presenting .trc-kpi-v { font-size: 30px; }
/* ===== 1.4 Motor: tiempo, analítica y matriz ===== */
.trc-grain { position: absolute; top: 0; right: 0; z-index: 3; display: flex; gap: 1px; background: rgba(241, 242, 248, .92); border-radius: 8px; padding: 2px; opacity: .75; transition: opacity .15s; }
.trc:hover .trc-grain { opacity: 1; }
.trc-grain button { border: 0; background: none; font: 600 10.5px Inter, system-ui, sans-serif; color: #7a7f9e; padding: 3px 7px; border-radius: 6px; cursor: pointer; }
.trc-grain button:hover { color: var(--ink); }
.trc-grain button.on { background: #fff; color: var(--brand); box-shadow: 0 1px 2px rgba(20, 22, 60, .12); }
.trc-an { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 2px 0; font-size: 11.5px; color: var(--ink2); line-height: 1.35; }
.trc-an-i { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.trc-an-i i { width: 10px; height: 3px; border-radius: 2px; flex: none; }
.trc-an-i.k-trend i { height: 0; border-top: 2px dotted currentColor; background: none !important; color: #4338ca; }
.trc-an-i.k-fc i { height: 0; border-top: 2px dashed #55762E; background: none !important; }
.trc-an-i.k-anom i { width: 8px; height: 8px; border-radius: 50%; }
.trc-an-i em { font-style: normal; color: var(--muted); }
.trc-fc-l { font: 600 10px Inter, system-ui, sans-serif; fill: #a3a7c2; }
.trc-tip-anom { margin-top: 4px; color: #fda4af; font-weight: 600; font-size: 11.5px; }
.trc-mx-wrap { max-height: 520px; }
.trc-mx { font-size: 12.5px; }
.trc-mx th { cursor: pointer; }
.trc-mx th.trc-mx-cg { text-align: center; border-left: 1px solid var(--line); }
.trc-mx thead { position: sticky; top: 0; z-index: 5; }
.trc-mx thead th { position: relative; }
.trc-mx thead th.trc-mx-dim { position: sticky; left: 0; }
.trc-mx .trc-mx-dim, .trc-mx td.trc-mx-l { position: sticky; left: 0; z-index: 2; background: #fff; min-width: 160px; max-width: 280px; }
.trc-mx thead .trc-mx-dim { background: #f7f8fc; z-index: 4; cursor: default; }
.trc-mx td.trc-mx-l { display: table-cell; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trc-mx td.trc-mx-l span { cursor: inherit; }
.trc-mx td.trc-mx-l em { font-style: normal; font-size: 10.5px; color: var(--muted); margin-left: 6px; }
.trc-mx-tg { border: 0; background: #eef0f8; color: var(--ink2); width: 18px; height: 18px; border-radius: 5px; font-size: 10px; line-height: 18px; padding: 0; margin-right: 6px; cursor: pointer; vertical-align: 1px; }
.trc-mx-tg:hover { background: var(--brand-soft); color: var(--brand); }
.trc-mx-sp0 { display: inline-block; width: 24px; }
.trc-mx tr.grp td { font-weight: 650; background: #fafbfe; }
.trc-mx tr.grp.l0 td { background: #f4f5fb; }
.trc-mx tr.grp.l0 td.trc-mx-l { background: #f4f5fb; }
.trc-mx tr.grp td.trc-mx-l { background: #fafbfe; }
.trc-mx .trc-mx-tot { font-weight: 650; background: #f9f9fd; border-left: 1px solid var(--line); }
.trc-mx tfoot { position: sticky; bottom: 0; z-index: 4; }
.trc-mx tfoot td { background: #eef0fa !important; font-weight: 700; border-top: 1px solid #dfe2f2; }
.trc-mx tfoot td.trc-mx-l { position: sticky; left: 0; z-index: 3; }
.trc-mx .trc-mx-sp { width: 90px; text-align: center; cursor: default; }
.trc-mx td.trc-mx-sp svg { display: block; margin: 0 auto; }
.trc-ic { font-style: normal; font-size: 9px; margin-right: 6px; position: relative; z-index: 1; vertical-align: 1px; }
.trc-ic.up { color: #16a34a; }
.trc-ic.down { color: #e11d48; }
.trc-ic.mid { color: #f59e0b; }
.trc-mx-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.trc-mx-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trc-mx-bar button { border: 1px solid var(--line2); background: #fff; border-radius: 8px; font-size: 11.5px; padding: 3px 9px; cursor: pointer; color: var(--ink2); }
.trc-mx-bar button:hover { border-color: var(--brand); color: var(--brand); }
/* ---------- 1.6 Ejes, jerarquías y anotaciones ---------- */
.trc-scale-l { font-size: 10px; fill: var(--muted2); font-style: italic; }
.trc-tick2 { fill: #6F685F; }
.trc-axis2 { stroke: #e3e5f0; }
.trc-break-band { fill: #fff; }
.trc-break-z { stroke: #b6b9d3; stroke-width: 1.4; }
.trc-note-ln { stroke: #9aa0c3; stroke-width: 1; stroke-dasharray: 2 2; }
.trc-note-pt { fill: #fff; stroke-width: 2.2; }
.trc-note-bx { fill: #1b1e3a; opacity: .92; }
.trc-note-t { font-size: 11px; font-weight: 600; fill: #fff; }
.trc-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--muted); padding: 0 0 6px; min-height: 22px; line-height: 1.2; }
.trc-crumbs button { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; padding: 2px 4px; border-radius: 6px; cursor: pointer; }
.trc-crumbs button:hover { background: #eef0ff; }
.trc-crumbs b { color: var(--ink); font-weight: 650; padding: 2px 2px; }
.trc-crumbs .trc-up { width: 22px; height: 22px; display: inline-grid; place-items: center; border: 1px solid var(--line2); background: #fff; padding: 0; font-size: 13px; }
.trc-crumbs em { font-style: normal; color: var(--muted2); margin-left: 6px; }
.trc-crumbs .trc-lv { font-weight: 600; color: var(--muted); }
.trc-crumbs .trc-lv + em::before { content: '· '; }
.trc-crumbs.tm { padding-right: 230px; }
/* ---------- 1.7 Mapas ---------- */
.trc-map-st path { fill: none; stroke: #9aa0c8; stroke-width: .6; pointer-events: none; vector-effect: non-scaling-stroke; }
.trc-base { fill: #eef0f7; stroke: #fff; stroke-width: .7; vector-effect: non-scaling-stroke; }
.trc-base.thin { stroke-width: .35; }
.trc-pt { transition: fill-opacity .15s; }
.trc-pt:hover { fill-opacity: 1; stroke: #1b1e3a; }
.trc-hex:hover { stroke: #1b1e3a; }
.trc-map.pts { display: block; }
.trc-map .trc-canvas { position: absolute; left: 0; top: 0; }
.trc-scale .trc-src { margin-left: auto; color: var(--muted2); font-size: 10.5px; }
/* ---------- 1.7 Nuevos tipos ---------- */
.trc-tick.strong { fill: var(--ink2); font-weight: 600; }
.trc-tick.small { font-size: 10px; }
.trc-sb-l { font-size: 10.5px; font-weight: 600; fill: #fff; pointer-events: none; }
.trc-sb-up { font-size: 11px; fill: var(--brand); font-weight: 600; pointer-events: none; }
.trc-word { font-family: Inter, Arial, sans-serif; font-weight: 700; cursor: default; transition: opacity .15s; }
.trc-word:hover { opacity: .75; }
.trc-slope:hover line { stroke-width: 3.6; }
.trc-facets { display: grid; gap: 10px 14px; }
.trc-facet { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 2px; }
.trc-facet-h { font-size: 12px; font-weight: 650; color: var(--ink2); padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trc.trc-auto .trc-facets { margin-bottom: 4px; }
.trc:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 8px; }
.trc .trc-kfocus { stroke: var(--ink) !important; stroke-width: 2.5px !important; paint-order: stroke; }
.trc .trc-hrow.trc-kfocus, .trc .trc-mx-l span.trc-kfocus { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

@keyframes trcFade { from { opacity: .35; } to { opacity: 1; } }body.admin-mode .side { padding: 10px 8px; gap: 1px; }

/* ---------- 1.4: cartera, comparativo, carga asistida, marca del reporte ---------- */
.lt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #D8D1C4; vertical-align: middle; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.lt.ok { background: #6E9A3D; } .lt.warn { background: #D9A23B; } .lt.bad { background: #C0483A; } .lt.na { background: #DDD6CA; }
.dt.pf td.c, .dt.pf th.c { text-align: center; width: 62px; }
.dt.pf tr.pf-r { cursor: pointer; } .dt.pf tr.pf-r.bad td:first-child { box-shadow: inset 3px 0 0 #C0483A; } .dt.pf tr.pf-r.warn td:first-child { box-shadow: inset 3px 0 0 #D9A23B; }
.pf-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.pf-sum > div { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; display: flex; align-items: baseline; gap: 8px; }
.pf-sum b { font-size: 22px; letter-spacing: -.02em; } .pf-sum span { color: var(--muted); font-size: 12px; }
.pf-sum .bad b { color: #B03A2E; } .pf-sum .warn b { color: #A86F12; } .pf-sum .ok b { color: var(--brand-d); }
.tag { display: inline-block; font-size: 10px; padding: 1px 5px; border-radius: 3px; background: var(--line2); color: var(--ink2); font-weight: 600; letter-spacing: .02em; vertical-align: 1px; }
.drop.big { padding: 34px 18px; } .drop.big b { font-size: 15px; }
.in.sm { min-height: 26px; padding: 2px 6px; font-size: 12px; }
.logo-box { width: 180px; height: 72px; border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rp { --rp-acc: var(--brand); --rp-ink: var(--ink); }
.rp-page { color: var(--rp-ink); border-top: 4px solid var(--rp-acc); }
.rp-page h2 { color: var(--rp-acc); }
.rp-brand { color: var(--rp-acc); }
.rp-cover { border-top: 0; border-left: 10px solid var(--rp-acc); }
.rp-h { align-items: center; } .rp-h b { margin-right: auto; color: var(--rp-ink); }
.rp-logo { height: 22px; max-width: 110px; object-fit: contain; margin-right: 10px; }
.rp-clogo { max-height: 70px; max-width: 240px; object-fit: contain; align-self: flex-start; margin-bottom: 18px; }
.rp-t tr.t td, .rp-t tr.total td { border-top: 1.5px solid var(--rp-acc); }
@media (max-width: 900px) { .pf-sum { grid-template-columns: 1fr 1fr; } }
.grid2.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } @media (max-width: 900px) { .grid2.cols2 { grid-template-columns: 1fr; } }
.dt.wrap td { white-space: normal; }
.dt.pf th { white-space: normal; line-height: 1.2; vertical-align: bottom; } .dt.pf th.num { min-width: 74px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatches button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatches button:hover { box-shadow: 0 0 0 2px var(--ink2); }
.swatches .sw-logo { width: auto; height: 22px; border-radius: 11px; padding: 0 8px 0 22px; font-size: 11px; background: var(--card) radial-gradient(circle at 11px 50%, var(--c, #999) 6px, transparent 7px); color: var(--ink2); }
.logo-box.sm { width: 140px; height: 56px; }
.rbrand { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg2); }
.rbrand summary { cursor: pointer; list-style: none; } .rbrand summary::-webkit-details-marker { display: none; }
.rbrand .grid2 { grid-template-columns: 1fr 1fr; }
.rbrand input[type=color] { height: 32px; padding: 2px; }

/* ---------- 1.5: tesorería, rentabilidad, panorama ---------- */
.kpi .v.warn { color: #A86F12; }
.dt td.link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.dt td.link:hover { background: var(--brand-soft2); }
.dt tr.warnrow td { background: #FBF3E2; }
.dt tr.clk { cursor: pointer; } .dt tr.clk:hover td { background: var(--bg2); }
.dt.fw th:first-child, .dt.fw td:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 240px; }
.bar { height: 6px; background: var(--line2); border-radius: 3px; overflow: hidden; } .bar span { display: block; height: 100%; }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.pv-c { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--card); cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: .12s; }
.pv-c:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(40,36,30,.06); }
.pv-c.nested { background: var(--bg2); }
.pv-c .row { gap: 6px; align-items: center; }
.pv-n { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.pv-n span { display: block; font-size: 11px; color: var(--muted); } .pv-n b { font-variant-numeric: tabular-nums; font-size: 14px; }
.pv-s { height: 54px; margin: 0 -4px -4px; }
.pv-g > .pv-c { border-left: 3px solid var(--brand); }
.pv-al { display: flex; flex-direction: column; } .pv-al a { display: grid; grid-template-columns: 12px auto; gap: 2px 8px; padding: 7px 4px; border-bottom: 1px solid var(--line2); cursor: pointer; color: inherit; text-decoration: none; align-items: center; }
.pv-al a:hover { background: var(--bg2); } .pv-al a span:last-child { grid-column: 2; font-size: 12px; color: var(--ink2); }
.pv-steps { border-left: 3px solid var(--brand); }
.pv-bar { height: 5px; background: var(--line2); border-radius: 3px; overflow: hidden; } .pv-bar span { display: block; height: 100%; background: var(--brand); }
.pv-step { display: flex; gap: 10px; align-items: center; padding: 6px 2px; cursor: pointer; color: inherit; text-decoration: none; }
.pv-step .n { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none; }
.pv-step.ok { color: var(--muted); text-decoration: line-through; } .pv-step.ok .n { background: var(--brand); border-color: var(--brand); color: #fff; }
.pv-step:hover:not(.ok) { color: var(--brand-d); }
input[type=range] { accent-color: var(--brand); }
.spark { width: 100%; height: 44px; display: block; } .spark .sa { fill: var(--brand-soft); } .spark .sl { fill: none; stroke: var(--brand); stroke-width: 1.6; vector-effect: non-scaling-stroke; } .spark .sd { fill: var(--brand); }
.pv-s { height: auto; margin: 0; }

/* ---------- 1.6: soporte, presencia, avisos ---------- */
#sysbar { position: sticky; top: 0; z-index: 60; }
.supbar, .bcbar { display: flex; align-items: center; gap: 10px; padding: 7px 14px; font-size: 13px; flex-wrap: wrap; }
.supbar { background: #7A1F2B; color: #fff; } .supbar b { color: #fff; } .supbar .btn { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); } .supbar .btn.dark { background: #fff; color: #7A1F2B; }
.bcbar.warn { background: #FBF0D2; color: #5C4410; border-bottom: 1px solid #EBD9A6; } .bcbar.info { background: var(--brand-soft); color: var(--brand-d); border-bottom: 1px solid var(--line); }
.maint { position: fixed; inset: 0; z-index: 200; background: rgba(247,244,238,.97); display: flex; align-items: center; justify-content: center; text-align: center; }
.maint > div { max-width: 420px; display: flex; flex-direction: column; gap: 12px; align-items: center; } .maint h2 { margin: 0; }
.avatar.dot { position: relative; } .avatar.dot::after { content: ''; position: absolute; top: 0; right: 0; width: 9px; height: 9px; border-radius: 50%; background: #C0483A; box-shadow: 0 0 0 2px var(--card); }
.badge.hot, .cnt.hot { background: #C0483A; color: #fff; }
.dt tr.unread td { font-weight: 600; } .dt tr.unread td:first-child { box-shadow: inset 3px 0 0 #C0483A; }
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--card); max-width: 86%; }
.msg.adm { border-color: #CFE0B8; background: #F4F8EC; } .msg.me { align-self: flex-end; } .msg:not(.me) { align-self: flex-start; }
.msg .mh { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; } .msg .mb { line-height: 1.55; }
.msg .att-img img { max-width: 260px; max-height: 180px; border-radius: 6px; margin-top: 8px; border: 1px solid var(--line); }
.att { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .att-prev { display: flex; gap: 6px; align-items: center; } .att-prev img { max-height: 70px; border-radius: 4px; border: 1px solid var(--line); }
pre.ctx { font-size: 11px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 6px; padding: 8px; overflow: auto; max-height: 220px; white-space: pre-wrap; word-break: break-word; margin: 6px 0 0; }
.dt.kv td { padding: 4px 6px; }
.preupd { border-left: 3px solid #D9A23B; margin-bottom: 12px; }
#side .cnt.hot { margin-left: auto; }
.menu.ctxm { min-width: 230px; }
details.tpl { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--card); margin: 6px 0; }
details.tpl summary { cursor: pointer; } details.tpl[open] summary { margin-bottom: 8px; }
details.tpl ul { margin: 8px 0; padding-left: 18px; line-height: 1.6; }
.dt.tplt th { background: var(--brand-soft); color: var(--brand-d); white-space: nowrap; } .dt.tplt td { white-space: nowrap; color: var(--muted); }

/* ---------- 1.7 Páginas legales ---------- */
.legal-body { background: var(--bg); }
.legal-wrap { display: grid; grid-template-columns: 230px 1fr; gap: 36px; padding: 20px 0 50px; align-items: start; }
.legal-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
.legal-side a { padding: 6px 10px; border-radius: 8px; color: var(--ink2); text-decoration: none; font-size: 13.5px; }
.legal-side a:hover { background: var(--card); }
.legal-side a.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.legal-side a.toc { font-size: 12.5px; padding: 4px 10px; color: var(--muted); }
.legal-side b { margin: 4px 10px 6px; }
.legal-doc { max-width: 780px; font-size: 15px; line-height: 1.65; color: var(--ink); }
.legal-doc h1 { font-size: 32px; line-height: 1.15; margin: 0 0 6px; letter-spacing: -.01em; }
.legal-doc .legal-meta { color: var(--muted); font-size: 13px; margin: 0 0 26px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.legal-doc h2 { font-size: 19px; margin: 30px 0 8px; scroll-margin-top: 16px; }
.legal-doc h3 { font-size: 16px; margin: 20px 0 6px; }
.legal-doc h4 { font-size: 14.5px; margin: 16px 0 4px; }
.legal-doc p { margin: 0 0 12px; }
.legal-doc ul, .legal-doc ol { margin: 0 0 12px; padding-left: 22px; }
.legal-doc li { margin: 3px 0; }
.legal-doc blockquote { margin: 12px 0; padding: 10px 14px; border-left: 3px solid var(--accent, #6b7a3a); background: var(--card); border-radius: 0 8px 8px 0; }
.legal-doc table { border-collapse: collapse; width: 100%; margin: 8px 0 16px; font-size: 13.5px; }
.legal-doc th, .legal-doc td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
.legal-doc th { background: var(--card); }
.legal-doc hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.legal-doc a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.legal-miss { background: #fff3c4; color: #7a5a00; padding: 0 4px; border-radius: 4px; font-size: .92em; }
.legal-links a { color: inherit; }
.auth-form label.auth-accept { align-items: flex-start; font-weight: 400; font-size: 13px; line-height: 1.4; margin: 2px 0 6px; }
.auth-accept input { margin-top: 2px; }
.auth-foot .legal-links { text-align: center; line-height: 1.7; }
@media (max-width: 860px) { .legal-wrap { grid-template-columns: 1fr; gap: 10px; } .legal-side { position: static; flex-direction: row; flex-wrap: wrap; } .legal-side .toc, .legal-side b { display: none; } .legal-doc h1 { font-size: 26px; } }
@media print { .no-print, .lp-nav, .lp-foot { display: none !important; } .legal-wrap { display: block; padding: 0; } .legal-doc { max-width: none; font-size: 11pt; } }
/* editor */
.legal-ed .ed-tb { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 8px 12px; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); margin-top: 12px; position: sticky; top: 0; background: var(--card); z-index: 2; }
.legal-ed .ed-tb button { border: 0; background: transparent; padding: 5px 8px; border-radius: 6px; font: inherit; font-size: 12.5px; color: var(--ink2); cursor: pointer; min-width: 28px; }
.legal-ed .ed-tb button:hover, .legal-ed .ed-tb button.on { background: var(--bg); color: var(--ink); }
.legal-ed .ed-tb .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.legal-ed .ed-tb select { font: inherit; font-size: 12.5px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: var(--card); margin-left: 4px; }
.legal-ed .ed-area { max-width: none; padding: 20px 26px; min-height: 480px; outline: none; }
.legal-ed .ed-area:focus { box-shadow: inset 0 0 0 2px rgba(107,122,58,.18); }
.legal-ed .ed-src { width: 100%; min-height: 520px; border: 0; padding: 16px; font-size: 12.5px; line-height: 1.5; resize: vertical; background: #1d1f1a; color: #e9e6dc; outline: none; }
.legal-ed .ed-foot { display: flex; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); }
.legal-var { display: inline-block; background: #eef1e2; color: #4c5a20; border: 1px solid #d5dcb8; border-radius: 5px; padding: 0 5px; font-family: 'JetBrains Mono', monospace; font-size: .82em; line-height: 1.5; user-select: all; }
.legal-ed .ver { padding: 8px 0; border-bottom: 1px solid var(--line); }
.legal-ed .ver:last-of-type { border-bottom: 0; }
.dt.kv td { padding: 5px 8px; }
.msg .tx a.alink { display: inline-block; margin: 2px 0; padding: 1px 8px; border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none; font-size: 12.5px; font-weight: 600; }
.dt.kv td { word-break: break-word; }
.dt.kv { width: 100%; table-layout: fixed; } .dt.kv td:first-child { width: 34%; }
.lp-plans { max-width: 760px; margin-left: auto; margin-right: auto; }
.plans-t td.num .in { margin-left: auto; display: block; }
