/* ─────────────────────────────────────────────────────────────────────────
   H&V · MVP visual
   Colores y tipografías: estilos-hv/tokens.css (fuente única).
   Aquí solo se definen aliases semánticos para pantalla, escala en px
   (los tokens originales están en pt/mm, pensados para documentos) y el
   tema oscuro derivado de --brand-primary / --brand-secondary.
   Los colores de estado "ok" y "danger" NO están en tokens.css: son
   funcionales y quedan pendientes de confirmación por H&V.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --bg: var(--background, #FFFFFF);
  --bg-2: var(--surface, #F5F6F6);
  --bg-3: #ECEFEF;
  --line: var(--border, #E2E6E7);
  --line-strong: var(--border-strong, #111B1E);
  --tx: var(--text-primary, #111B1E);
  --tx-2: var(--text-secondary, #4C585D);
  --tx-3: var(--text-muted, #879196);
  --accent: var(--brand-accent, #5E7A84);
  --side-bg: var(--brand-primary, #111B1E);
  --side-bg-2: var(--brand-secondary, #26343A);
  --side-tx: var(--text-on-brand, #FFFFFF);
  --side-tx-2: var(--text-on-brand-muted, #A9B4B8);
  --warn: var(--warning, #9A6B16);
  --warn-bg: var(--warning-surface, #FBF4E6);
  /* Funcionales — pendientes de confirmar con H&V */
  --ok: #3F6B57;
  --ok-bg: #EAF2EE;
  --danger: #9B3B32;
  --danger-bg: #F8ECEA;
  --edited: #B4661A;
  --edited-bg: #FCF1E4;
  --chart-1: #B9C2C5;
  --chart-2: #4C585D;
  --chart-line: #111B1E;

  --r: 6px;
  --shadow: 0 1px 2px rgba(17, 27, 30, .06), 0 4px 16px rgba(17, 27, 30, .06);
  --fd: var(--font-display, Georgia, serif);
  --fb: var(--font-body, "Segoe UI", Arial, sans-serif);
  --track: var(--tracking-label, .16em);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111B1E;
  --bg-2: #172326;
  --bg-3: #1E2B2F;
  --line: #2C3B40;
  --line-strong: #A9B4B8;
  --tx: #EEF1F1;
  --tx-2: #A9B4B8;
  --tx-3: #7D8A8F;
  --accent: #8FA9B2;
  --side-bg: #0B1214;
  --side-bg-2: #1A2629;
  --warn: #D9A54A;
  --warn-bg: #2A2416;
  --ok: #7FB79B;
  --ok-bg: #18291F;
  --danger: #E08A80;
  --danger-bg: #2E1A18;
  --edited: #E6A05A;
  --edited-bg: #2C2116;
  --chart-1: #3A4A50;
  --chart-2: #8FA9B2;
  --chart-line: #EEF1F1;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--tx);
  font-family: var(--fb);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--fd); font-weight: 600; margin: 0; letter-spacing: .01em; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
.label {
  font-size: 11px; text-transform: uppercase; letter-spacing: var(--track);
  color: var(--tx-3); font-weight: 600;
}
.muted { color: var(--tx-3); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mono { font-family: Consolas, "Cascadia Mono", "Courier New", monospace; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Banner MVP ─────────────────────────────────────────────────────── */
.mvp-banner {
  background: var(--warn-bg); color: var(--warn);
  border-bottom: 1px solid var(--line);
  font-size: 12px; padding: 6px 16px; display: flex; gap: 12px; align-items: center;
  justify-content: center; text-align: center;
}
.mvp-banner b { font-weight: 700; }

/* ── Botones ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--bg); color: var(--tx);
  padding: 7px 13px; border-radius: var(--r); cursor: pointer; font-weight: 600;
  font-size: 13px; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--bg-2); border-color: var(--tx-3); }
.btn.primary { background: var(--tx); color: var(--bg); border-color: var(--tx); }
.btn.primary:hover { opacity: .9; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ── Formularios ────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--tx-2); }
.input, select.input, textarea.input {
  border: 1px solid var(--line); background: var(--bg); border-radius: var(--r);
  padding: 8px 10px; min-width: 0; width: 100%;
}
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.input.sm { padding: 4px 7px; font-size: 13px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.check { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; font-size: 13px; }

/* ── Login ─────────────────────────────────────────────────────────── */
.login-wrap { min-height: calc(100vh - 31px); display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  background: var(--side-bg); color: var(--side-tx); padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.login-art img { width: 120px; filter: invert(1); opacity: .95; }
.login-art h1 { font-size: 44px; max-width: 12ch; color: var(--side-tx); }
.login-art p { color: var(--side-tx-2); max-width: 44ch; }
.login-art .rule { width: 48px; height: 1px; background: var(--side-tx-2); margin: 18px 0; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.demo-accounts { border: 1px dashed var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.demo-accounts button { text-align: left; background: none; border: 0; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.demo-accounts button:hover { background: var(--bg-2); }

/* ── Selector de tenant ────────────────────────────────────────────── */
.center-page { min-height: calc(100vh - 31px); display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.tenant-list { display: grid; gap: 12px; width: 100%; max-width: 560px; }
.tenant-card {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--bg); cursor: pointer; text-align: left; width: 100%;
}
.tenant-card:hover { border-color: var(--tx); }
.tenant-mono {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--bg-3); font-family: var(--fd); font-size: 18px; font-weight: 700;
}

/* ── Shell ─────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: calc(100vh - 31px); }
.side {
  background: var(--side-bg); color: var(--side-tx); display: flex; flex-direction: column;
  position: sticky; top: 0; height: calc(100vh - 31px); overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.side-brand img { width: 34px; filter: invert(1); }
.side-brand b { font-family: var(--fd); font-size: 19px; letter-spacing: .02em; }
.side-brand small { display: block; font-size: 9px; letter-spacing: .22em; color: var(--side-tx-2); text-transform: uppercase; }
.side-tenant { margin: 4px 12px 12px; }
.side-tenant select {
  width: 100%; background: var(--side-bg-2); color: var(--side-tx); border: 1px solid #33444A;
  border-radius: var(--r); padding: 8px 10px;
}
.side-sec { padding: 10px 12px 4px; font-size: 10px; text-transform: uppercase; letter-spacing: .2em; color: var(--side-tx-2); }
.side nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; margin: 1px 8px; border-radius: var(--r);
  color: var(--side-tx-2); text-decoration: none; font-weight: 600; font-size: 13.5px;
}
.side nav a:hover { background: var(--side-bg-2); color: var(--side-tx); }
.side nav a.on { background: var(--side-bg-2); color: var(--side-tx); box-shadow: inset 2px 0 0 var(--side-tx); }
.side nav a svg { width: 17px; height: 17px; flex: none; opacity: .9; }
.side nav a .lock { margin-left: auto; width: 13px; height: 13px; opacity: .6; }
.side-foot { margin-top: auto; padding: 14px 18px; font-size: 11px; color: var(--side-tx-2); border-top: 1px solid #22313A; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 12px 28px; border-bottom: 1px solid var(--line);
  background: var(--bg); position: sticky; top: 0; z-index: 20;
}
.crumbs { font-size: 13px; color: var(--tx-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs b { color: var(--tx); font-weight: 600; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--line); background: var(--bg); white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.pill.warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.pill.danger { color: var(--danger); background: var(--danger-bg); border-color: transparent; }
.pill.neutral { color: var(--tx-2); background: var(--bg-2); border-color: transparent; }
button.pill { cursor: pointer; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--tx); color: var(--bg);
  display: grid; place-items: center; font-weight: 700; font-size: 12px; cursor: pointer; border: 0;
}
.content { padding: 26px 28px 60px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .grow { flex: 1; min-width: 240px; }
.page-head p { margin: 6px 0 0; color: var(--tx-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Tarjetas, KPIs ────────────────────────────────────────────────── */
.card { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); padding: 18px; }
.card.flat { background: var(--bg-2); border-color: transparent; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-h .grow { flex: 1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; background: var(--bg); }
.kpi .v { font-family: var(--fd); font-size: 28px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--tx-3); margin-top: 2px; }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ── Tablas ─────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--tx-3);
  font-weight: 700; padding: 9px 10px; border-bottom: 1px solid var(--line-strong); background: var(--bg); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table.t td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:hover td { background: var(--bg-2); }
table.t tr.group td { background: var(--bg-2); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--tx-2); }
table.t tr.sub td { font-weight: 700; border-top: 1px solid var(--line-strong); }
table.t tr.total td { font-weight: 700; background: var(--bg-3); }
table.t tr.total td:first-child, table.t tr.sub td:first-child { font-family: var(--fd); font-size: 14.5px; }
table.t th.cut, table.t td.cut { border-right: 1px solid var(--line-strong); }
table.t .acc { display: block; font-size: 11px; color: var(--tx-3); }
table.t td.neg { color: var(--danger); }
table.t td.edit { cursor: cell; }
table.t td.edit:hover { outline: 1px dashed var(--tx-3); outline-offset: -3px; }
table.t td.edited { background: var(--edited-bg) !important; color: var(--edited); font-weight: 700; }
table.t td input.cell { width: 76px; text-align: right; padding: 2px 4px; border: 1px solid var(--accent); border-radius: 3px; background: var(--bg); }
.input.pct, table.t input.pct { width: 72px; text-align: right; display: inline-block; }
.tag {
  display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
  padding: 1px 6px; border-radius: 3px; background: var(--bg-3); color: var(--tx-2); vertical-align: 1px; margin-left: 6px;
}
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.danger { background: var(--danger-bg); color: var(--danger); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }

/* ── Pestañas ──────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; }
.tabs a {
  padding: 10px 14px; text-decoration: none; color: var(--tx-3); font-weight: 600; font-size: 13.5px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover { color: var(--tx); }
.tabs a.on { color: var(--tx); border-bottom-color: var(--tx); }
.tabs a .badge { background: var(--warn-bg); color: var(--warn); border-radius: 999px; padding: 0 6px; font-size: 11px; margin-left: 4px; }

/* ── Avisos ────────────────────────────────────────────────────────── */
.notice { display: flex; gap: 10px; padding: 11px 14px; border-radius: var(--r); font-size: 13px; margin-bottom: 14px; align-items: flex-start; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.danger { background: var(--danger-bg); color: var(--danger); }
.notice.info { background: var(--bg-2); color: var(--tx-2); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice b { font-weight: 700; }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

/* ── Estados de bloqueo ────────────────────────────────────────────── */
.state-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 72px 24px; gap: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2);
  min-height: 420px;
}
.state-screen .ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); }
.state-screen .ico svg { width: 28px; height: 28px; }
.state-screen p { max-width: 56ch; color: var(--tx-2); margin: 0; }
.lockscreen {
  position: fixed; inset: 0; z-index: 90; background: var(--side-bg); color: var(--side-tx);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 24px;
}
.lockscreen img { width: 92px; filter: invert(1); }
.lockscreen h1 { color: var(--side-tx); }
.lockscreen p { color: var(--side-tx-2); max-width: 54ch; margin: 0; }
.lockscreen .btn { background: transparent; color: var(--side-tx); border-color: #3A4A50; }
.lockscreen .btn.primary { background: var(--side-tx); color: var(--side-bg); }

/* ── Modal, toast, drawer ──────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(10, 16, 18, .5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--bg); border-radius: 8px; width: 100%; max-width: 520px; box-shadow: var(--shadow); max-height: 90vh; overflow: auto; }
.modal-h { padding: 18px 20px 6px; }
.modal-b { padding: 8px 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.modal-f { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); }
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--tx); color: var(--bg); padding: 10px 14px; border-radius: var(--r); box-shadow: var(--shadow); font-size: 13px; max-width: 380px; animation: tin .2s ease; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

.sim-fab { position: fixed; left: 16px; bottom: 16px; z-index: 80; }
.sim-panel {
  position: fixed; left: 16px; bottom: 62px; z-index: 81; width: 300px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 10px;
}

/* ── Gráficos ──────────────────────────────────────────────────────── */
.chart svg { width: 100%; height: auto; display: block; }
.chart text { fill: var(--tx-3); font-size: 10px; font-family: var(--fb); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--tx-2); flex-wrap: wrap; margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ── RG01 ──────────────────────────────────────────────────────────── */
.rg-text { background: var(--bg-2); border-radius: var(--r); padding: 12px; overflow-x: auto; font-size: 12px; line-height: 1.5; white-space: pre; }
.rg-text .ruler { color: var(--tx-3); }
.code-box { font-family: Consolas, monospace; font-size: 26px; letter-spacing: .3em; padding: 14px; text-align: center; border: 1px dashed var(--tx-3); border-radius: var(--r); background: var(--bg-2); }

.flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.flow span { padding: 4px 9px; border-radius: 4px; background: var(--bg-2); border: 1px solid var(--line); }
.flow i { color: var(--tx-3); font-style: normal; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { padding: 28px; min-height: 260px; }
  .login-art h1 { font-size: 32px; }
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .side nav { display: flex; flex-wrap: wrap; padding-bottom: 8px; }
  .side-foot { display: none; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .content { padding: 18px 16px 60px; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ── Importador ────────────────────────────────────────────────────── */
.drop {
  display: flex; align-items: center; gap: 12px; padding: 16px; border: 1.5px dashed var(--tx-3);
  border-radius: var(--r); cursor: pointer; background: var(--bg-2); min-height: 96px;
}
.drop:hover, .drop.over { border-color: var(--tx); background: var(--bg-3); }
.drop svg { width: 26px; height: 26px; flex: none; transform: rotate(180deg); color: var(--tx-2); }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-2); font-size: 12.5px; font-weight: 600;
}
.chip button { border: 0; background: none; cursor: pointer; color: var(--tx-3); padding: 0 4px; font-size: 14px; line-height: 1; }
.chip button:hover { color: var(--danger); }
table.t td .input.sm { min-width: 0; }
.row-move { display: inline-flex; flex-direction: column; }
.row-move button { border: 0; background: none; cursor: pointer; color: var(--tx-3); padding: 0 3px; line-height: 1; font-size: 11px; }
.row-move button:hover { color: var(--tx); }
.row-move button:disabled { opacity: .25; cursor: default; }
table.t tr.subi td { font-weight: 600; color: var(--tx-2); font-style: italic; }
table.t tr.lv1 td:nth-child(2) { padding-left: 26px; }

/* ── Manual de usuario ─────────────────────────────────────────────── */
.man-ruta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 26px; overflow: hidden; }
.man-paso { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--bg); border: 0; border-right: 1px solid var(--line); color: var(--tx); font: 600 14px/1.3 var(--fb); text-align: left; cursor: pointer; }
.man-paso:last-child { border-right: 0; }
.man-paso:hover { background: var(--bg-2); }
.man-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--tx); color: var(--bg); display: grid; place-items: center; font-size: 13px; }
.man-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 36px; align-items: start; }
.man-indice { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); padding-left: 14px; }
.man-indice .label { margin-bottom: 8px; }
.man-indice a { color: var(--tx-2); font-size: 14px; padding: 5px 0; cursor: pointer; text-decoration: none; }
.man-indice a:hover { color: var(--tx); }
.man-cuerpo { max-width: 860px; }
.man-cap { padding: 0 0 30px; margin-bottom: 30px; border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.man-cap:last-child { border-bottom: 0; }
.man-cab { display: flex; gap: 18px; align-items: baseline; }
.man-num { font: 600 34px/1 var(--fd); color: var(--accent); min-width: 44px; }
.man-cab h2 { margin: 0; font-family: var(--fd); font-size: 27px; }
.man-para { margin: 4px 0 0; color: var(--tx-2); }
.man-quien { display: inline-flex; align-items: center; gap: 6px; margin: 12px 0 4px 62px; font-size: 12px; letter-spacing: .04em; color: var(--tx-3); }
.man-quien svg { width: 14px; height: 14px; }
.man-pasos { margin: 10px 0 14px 62px; padding: 0; list-style: none; counter-reset: paso; }
.man-pasos li { counter-increment: paso; position: relative; padding: 8px 0 8px 36px; line-height: 1.55; border-top: 1px dashed var(--line); }
.man-pasos li:first-child { border-top: 0; }
.man-pasos li::before { content: counter(paso); position: absolute; left: 0; top: 9px; width: 22px; height: 22px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.man-cap > .notice, .man-cap > .table-wrap, .man-cap > .btn, .man-cap > p { margin-left: 62px; }
.ico-md { width: 22px; height: 22px; flex: none; color: var(--tx-2); }
.man-cap > .btn { text-decoration: none; }
.man-si svg { width: 16px; height: 16px; color: var(--ok); }
@media (max-width: 900px) {
  .man-layout { grid-template-columns: 1fr; }
  .man-indice { display: none; }
  .man-quien, .man-pasos, .man-cap > .notice, .man-cap > .table-wrap, .man-cap > .btn, .man-cap > p { margin-left: 0; }
  .man-paso { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media print {
  .mvp-banner, .side, .topbar, .no-print, .toasts, .sim-wrap { display: none !important; }
  .shell, .main { display: block !important; }
  .content { padding: 0; max-width: none; }
  .man-layout { display: block; }
  .man-cap { break-inside: avoid-page; }
  .man-ruta { break-inside: avoid; }
}

/* ── Gráficos "cine": panel carbón, entrada animada y lectura al pasar el cursor ── */
.cine-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); gap: 18px; margin-bottom: 20px; }
.cine-card {
  --cn-bg: #111B1E; --cn-tx: #A9B4B8; --cn-tx2: #6F7E83; --cn-hi: #F2F5F5; --cn-grid: rgba(233, 240, 242, .07);
  position: relative; border-radius: 10px; padding: 22px 22px 14px; color: var(--cn-tx);
  background: radial-gradient(120% 80% at 50% 0%, #1D2C31 0%, #111B1E 55%, #0B1214 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 18px 40px -18px rgba(8, 14, 16, .55);
  border: 1px solid #1F2E33;
}
.cine-card::after { /* viñeta sutil */
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(140% 100% at 50% 40%, transparent 62%, rgba(0,0,0,.35) 100%);
}
:root[data-theme="dark"] .cine-card { border-color: #2C3B40; background: radial-gradient(120% 80% at 50% 0%, #1A282C 0%, #0D1517 60%, #080E10 100%); }
.cine-h { position: relative; z-index: 1; margin-bottom: 4px; }
.cine-h .label { color: #7F9BA5; }
.cine-h h3 { margin: 4px 0 0; font-family: var(--fd); font-weight: 600; font-size: 24px; color: var(--cn-hi); letter-spacing: .01em; }
.cine { position: relative; z-index: 1; }
.cine-card:has(.cine.reading) { z-index: 4; }
.cine svg { width: 100%; height: auto; display: block; overflow: visible; outline: none; }
.cine svg:focus-visible { outline: 1px solid #7F9BA5; outline-offset: 4px; border-radius: 4px; }
.cine text { font-family: var(--fb); fill: var(--cn-tx2); font-size: 12px; }
.cine .cy { text-anchor: end; font-variant-numeric: tabular-nums; }
.cine .cx { text-anchor: middle; font-size: 12px; transition: fill .2s; }
.cine .cx.on { fill: var(--cn-hi); font-weight: 700; }
.cine .ck { fill: #7F9BA5; font-size: 10.5px; letter-spacing: .18em; font-weight: 700; }
.cine .cmk { fill: var(--cn-tx); font-size: 10.5px; letter-spacing: .16em; font-weight: 700; }
.cine .cv { fill: var(--cn-hi); font-family: var(--fd); font-size: 19px; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.cine .cv.sm { font-size: 15px; }
.cine .cg { stroke: var(--cn-grid); stroke-width: 1; }
.cine .c0 { stroke: rgba(233, 240, 242, .28); stroke-width: 1; }
.cine .cm { stroke: rgba(233, 240, 242, .16); stroke-width: 1; stroke-dasharray: 2 5; }
.cine .cb { transition: opacity .25s ease, filter .25s ease; }
.cine .c-hit { fill: transparent; cursor: crosshair; }
.cine .c-band { fill: rgba(233, 240, 242, 0); transition: fill .25s; }
.cine .c-band.on { fill: rgba(233, 240, 242, .05); }
.cine .c-cross, .cine .c-focus { opacity: 0; transition: opacity .2s; pointer-events: none; }
.cine.reading .c-cross, .cine.reading .c-focus { opacity: 1; }
.cine.reading .cb:not(.on) { opacity: .28; }
.cine.reading .cb.on { filter: brightness(1.18) drop-shadow(0 0 8px rgba(68, 157, 199, .35)); }
.cine-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--cn-tx); }
.cine-legend span { display: inline-flex; align-items: center; gap: 7px; }
.cine-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cine-legend i.ln { height: 2px; width: 16px; border-radius: 1px; }

/* Ficha de lectura */
.cine-tip {
  position: absolute; z-index: 5; width: 290px; pointer-events: none; padding: 14px 16px 12px; border-radius: 8px;
  background: rgba(10, 17, 19, .9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(233, 240, 242, .14); box-shadow: 0 20px 44px -12px rgba(0, 0, 0, .6);
  color: #C9D2D5; font-size: 12.5px; animation: tipIn .18s ease-out;
}
.cine-tip .tt-k { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #7F9BA5; font-weight: 700; margin-bottom: 4px; }
.cine-tip .tt-v { font-family: var(--fd); font-size: 30px; line-height: 1.05; color: #F5F8F8; font-weight: 600; margin-bottom: 8px; font-variant-numeric: lining-nums; }
.cine-tip .tt-v small { font-family: var(--fb); font-size: 11px; color: #8A979C; font-weight: 400; margin-left: 4px; }
.cine-tip .tt-row { display: flex; justify-content: space-between; gap: 12px; padding: 2.5px 0; }
.cine-tip .tt-row span { color: #9AA7AC; display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.cine-tip .tt-row b { color: #EEF2F3; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cine-tip .tt-drv span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; display: inline-block; }
.cine-tip .tt-sep { height: 1px; background: rgba(233, 240, 242, .1); margin: 8px 0; }
.cine-tip .tt-up { color: #7CC2DF; font-size: 9px; }
.cine-tip .tt-down { color: #D9A25E; font-size: 9px; }
.cine-tip .tt-eq { color: #8A979C; font-size: 8px; }
.cine-tip .tt-sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
@keyframes tipIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Entrada: barras que suben en cascada, línea que se dibuja, rótulos que aparecen */
.cine.anim .cb { transform-box: fill-box; animation: cnRise .9s cubic-bezier(.2, .75, .15, 1) both; animation-delay: calc(var(--d) * 55ms + 150ms); }
.cine.anim .c-line { stroke-dasharray: 1; animation: cnDraw 1.8s cubic-bezier(.45, 0, .2, 1) both .2s; }
.cine.anim .c-area { animation: cnFade 1.4s ease both .9s; }
.cine.anim .c-mark { animation: cnFade .7s ease both; animation-delay: calc(var(--d) * 220ms + 1.1s); }
@keyframes cnRise { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes cnDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes cnFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .cine.anim .cb, .cine.anim .c-line, .cine.anim .c-area, .cine.anim .c-mark, .cine-tip { animation: none; }
}
@media (max-width: 1100px) { .cine-grid { grid-template-columns: 1fr; } }

/* Indicador de revisión en el menú lateral (Configuración) */
.side nav a .side-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--warn-bg); color: var(--warn); }
/* Resumen de identificación (Archivo RG01) */
.rg-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.rg-dl dt { color: var(--tx-3); }
.rg-dl dd { margin: 0; font-weight: 600; }

/* Enlaces con aspecto de botón: sin subrayado */
a.btn { text-decoration: none; }
