@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&display=swap');

:root {
  --paper: #f2f1ee;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --ink: #14131a;
  --ink-2: #4b4a43;
  --ink-3: #8b8778;
  --rule: #e7e4dd;
  --rule-soft: #efece5;
  --accent: oklch(0.52 0.13 248);
  --accent-soft: oklch(0.52 0.13 248 / .1);
  --crit: oklch(0.5 0.16 28);
  --crit-soft: oklch(0.5 0.16 28 / .1);
  --warn: oklch(0.48 0.1 84);
  --warn-soft: oklch(0.48 0.1 84 / .12);
  --ok: oklch(0.45 0.11 158);
  --ok-soft: oklch(0.45 0.11 158 / .1);
  --shadow: 0 1px 3px rgba(20,19,26,.07), 0 1px 2px rgba(20,19,26,.05);
  --shadow-lg: 0 12px 28px rgba(20,19,26,.14);
  /* Identidad: azul profundo → teal, con ámbar como acento cálido */
  --brand-1: oklch(0.42 0.14 252);
  --brand-2: oklch(0.56 0.12 205);
  --brand-warm: oklch(0.80 0.15 75);
  --brand-warm-ink: oklch(0.30 0.08 70);
  --rail-1: oklch(0.27 0.08 258);
  --rail-2: oklch(0.34 0.09 228);
  --rail-ink: rgba(255,255,255,.72);
  --rail-pill: rgba(255,255,255,.14);
  --wash: oklch(0.955 0.02 240);
  --panel-bg: oklch(0.985 0.006 240);
  --nivel-pre: oklch(0.55 0.14 60);  --nivel-pre-soft: oklch(0.55 0.14 60 / .14);
  --nivel-bas: oklch(0.50 0.12 175); --nivel-bas-soft: oklch(0.50 0.12 175 / .14);
  --nivel-med: oklch(0.50 0.14 300); --nivel-med-soft: oklch(0.50 0.14 300 / .14);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14131a; --surface: #1d1b22; --surface-2: #232028;
    --ink: #f2f1ee; --ink-2: #c7c3b8; --ink-3: #8b8778;
    --rule: #34303a; --rule-soft: #2a2731;
    --accent: oklch(0.7 0.12 248); --accent-soft: oklch(0.7 0.12 248 / .16);
    --crit: oklch(0.7 0.14 28); --crit-soft: oklch(0.7 0.14 28 / .16);
    --warn: oklch(0.7 0.1 84); --warn-soft: oklch(0.7 0.1 84 / .16);
    --ok: oklch(0.7 0.1 158); --ok-soft: oklch(0.7 0.1 158 / .16);
    --shadow: 0 1px 3px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.3);
    --shadow-lg: 0 16px 32px rgba(0,0,0,.4);
    --brand-1: oklch(0.45 0.12 252); --brand-2: oklch(0.52 0.11 205);
    --brand-warm: oklch(0.78 0.14 75); --brand-warm-ink: oklch(0.25 0.06 70);
    --rail-1: oklch(0.19 0.05 258); --rail-2: oklch(0.23 0.06 228);
    --rail-ink: rgba(255,255,255,.66); --rail-pill: rgba(255,255,255,.12);
    --wash: oklch(0.19 0.03 250); --panel-bg: oklch(0.20 0.015 250);
    --nivel-pre: oklch(0.82 0.12 70);  --nivel-pre-soft: oklch(0.82 0.12 70 / .16);
    --nivel-bas: oklch(0.80 0.11 175); --nivel-bas-soft: oklch(0.80 0.11 175 / .16);
    --nivel-med: oklch(0.80 0.12 300); --nivel-med-soft: oklch(0.80 0.12 300 / .16);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14131a; --surface: #1d1b22; --surface-2: #232028;
  --ink: #f2f1ee; --ink-2: #c7c3b8; --ink-3: #8b8778;
  --rule: #34303a; --rule-soft: #2a2731;
  --accent: oklch(0.7 0.12 248); --accent-soft: oklch(0.7 0.12 248 / .16);
  --crit: oklch(0.7 0.14 28); --crit-soft: oklch(0.7 0.14 28 / .16);
  --warn: oklch(0.7 0.1 84); --warn-soft: oklch(0.7 0.1 84 / .16);
  --ok: oklch(0.7 0.1 158); --ok-soft: oklch(0.7 0.1 158 / .16);
  --shadow: 0 1px 3px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg: 0 16px 32px rgba(0,0,0,.4);
  --brand-1: oklch(0.45 0.12 252); --brand-2: oklch(0.52 0.11 205);
  --brand-warm: oklch(0.78 0.14 75); --brand-warm-ink: oklch(0.25 0.06 70);
  --rail-1: oklch(0.19 0.05 258); --rail-2: oklch(0.23 0.06 228);
  --rail-ink: rgba(255,255,255,.66); --rail-pill: rgba(255,255,255,.12);
  --wash: oklch(0.19 0.03 250); --panel-bg: oklch(0.20 0.015 250);
  --nivel-pre: oklch(0.82 0.12 70);  --nivel-pre-soft: oklch(0.82 0.12 70 / .16);
  --nivel-bas: oklch(0.80 0.11 175); --nivel-bas-soft: oklch(0.80 0.11 175 / .16);
  --nivel-med: oklch(0.80 0.12 300); --nivel-med-soft: oklch(0.80 0.12 300 / .16);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Instrument Sans", system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}

.topbar { border-bottom: 1px solid var(--rule); padding: 1rem 1.5rem; background: var(--surface); }
.brand { font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.brand span { font-weight: 400; color: var(--ink-3); font-size: .8rem; margin-left: .6rem; }

.shell { max-width: 1000px; margin: 0 auto; padding: 2rem 1.5rem; }

.carga h1 { font-size: 1.5rem; margin: 0 0 .4rem; letter-spacing: -.015em; }
.lede { color: var(--ink-2); max-width: 60ch; margin: 0 0 1.2rem; }

.dropzones { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1.2rem; }
@media (min-width: 720px) { .dropzones { grid-template-columns: 1fr 1fr; } }
@media (min-width: 720px) { .dropzones.dropzones-solo { grid-template-columns: 1fr; } }

.link-toggle {
  display: block; background: none; border: none; padding: 0; margin: -.6rem 0 1.2rem;
  color: var(--accent); font-size: .82rem; cursor: pointer; text-decoration: underline; text-underline-offset: .15em;
}

.dz {
  border: 1.5px dashed var(--rule); background: var(--surface-2); border-radius: 16px;
  padding: 1.6rem 1.2rem; text-align: center; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.dz:hover, .dz.dz-over { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow); }
.dz.dz-done { border-style: solid; border-color: var(--ok); background: var(--surface); text-align: left; box-shadow: var(--shadow); }
.dz.dz-bad { border-style: solid; border-color: var(--crit); background: var(--surface); text-align: left; box-shadow: var(--shadow); }
.dz-icono {
  width: 34px; height: 34px; border-radius: 12px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 600;
  margin: 0 auto .5rem;
}
.dz.dz-done .dz-icono, .dz.dz-bad .dz-icono { display: none; }
.dz-titulo { font-weight: 600; margin-top: .3rem; word-break: break-word; }
.dz-detalle { color: var(--ink-3); font-size: .85rem; margin-top: .2rem; }
.dz.dz-done .dz-detalle, .dz.dz-bad .dz-detalle { color: var(--ink-2); }

.config-card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 16px;
  padding: .3rem 1.1rem; margin-bottom: 1.4rem; box-shadow: var(--shadow);
}
.config-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; }
.config-info { display: flex; flex-direction: column; gap: .15rem; flex: 1 1 auto; min-width: 0; }
.config-label { font-weight: 600; font-size: .92rem; }
.config-sub { color: var(--ink-3); font-size: .8rem; }
.config-divider { height: 1px; background: var(--rule-soft); }
.config-input {
  font: inherit; padding: .5rem .7rem; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--surface-2); color: var(--ink); flex-shrink: 0;
}
.config-input-sm { width: 6em; }
@media (max-width: 480px) {
  .config-row { flex-wrap: wrap; }
  .config-input { width: 100%; }
}

button#btn-analizar {
  font: inherit; font-weight: 600; padding: .7rem 1.4rem; border: 0; border-radius: 12px;
  background: var(--accent); color: #fff; cursor: pointer; box-shadow: var(--shadow);
}
button#btn-analizar:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

/* ---- Reporte ---- */
.reporte-collapse { margin-top: 1.2rem; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.reporte-summary {
  cursor: pointer; list-style: none; padding: 1.1rem 1.3rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.reporte-summary::-webkit-details-marker { display: none; }
.reporte-summary-titulo { display: flex; align-items: center; gap: .5rem; }
.reporte-summary-titulo h2 { font-size: 1.1rem; margin: 0; letter-spacing: -.01em; }
.reporte-summary-titulo h2::before { content: '▸'; color: var(--ink-3); font-size: .85em; display: inline-block; transition: transform .12s; margin-right: .1rem; }
.reporte-collapse[open] .reporte-summary-titulo h2::before { transform: rotate(90deg); }
.reporte-summary-titulo .sub { color: var(--ink-3); font-family: ui-monospace, monospace; font-size: .8rem; }
.reporte-summary:hover .reporte-summary-titulo h2 { color: var(--accent); }
.reporte-summary-conteos { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.rc-item { font-size: .76rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; }
.rc-item.rc-crit { background: var(--crit-soft); color: var(--crit); }
.rc-item.rc-warn { background: var(--warn-soft); color: var(--warn); }
.rc-item.rc-ok { background: var(--ok-soft); color: var(--ok); }
.reporte { padding: 0 1.3rem 1.3rem; border-top: 1px solid var(--rule-soft); margin-top: .3rem; padding-top: 1.1rem; }

.archivos-originales { display: flex; gap: .6rem; flex-wrap: wrap; margin: .9rem 0 0; }
.btn-archivo { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .7rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: .8rem; text-decoration: none; }
.btn-archivo:hover { border-color: var(--accent); color: var(--accent); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin: 1.2rem 0; }
.tile { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: .9rem .8rem; text-align: center; box-shadow: var(--shadow); }
.tile-n { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-l { font-size: .7rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; margin-top: .2rem; }
.tile-crit { border-color: var(--crit); background: var(--crit-soft); }
.tile-crit .tile-n { color: var(--crit); }
.tile-warn { border-color: var(--warn); background: var(--warn-soft); }
.tile-warn .tile-n { color: var(--warn); }

.mesestrip { display: flex; gap: 6px; margin: 1rem 0; }
.mes { flex: 1; text-align: center; border: 1px solid var(--rule); background: var(--surface); padding: .5rem 2px; border-radius: 10px; cursor: pointer; transition: border-color .12s, box-shadow .12s, background .12s; }
.mes:hover { border-color: var(--accent); background: var(--accent-soft); }
.mes.mes-ancla { border-color: var(--accent); border-width: 1.5px; box-shadow: var(--shadow); }
.mes.mes-activo { background: var(--accent); border-color: var(--accent); box-shadow: var(--shadow); }
.mes.mes-activo .mes-n { color: #fff; }
.mes-n { font-family: ui-monospace, monospace; font-size: .75rem; display: block; margin-bottom: .25rem; }

.filtro-mes { display: flex; align-items: center; justify-content: space-between; gap: .8rem; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 12px; padding: .5rem .8rem; margin: -.3rem 0 1rem; font-size: .85rem; color: var(--ink); }
.filtro-mes-quitar { font: inherit; font-size: .8rem; font-weight: 600; padding: .3rem .7rem; border: 1px solid var(--accent); border-radius: 8px; background: var(--surface); color: var(--accent); cursor: pointer; flex-shrink: 0; }
.filtro-mes-quitar:hover { background: var(--accent); color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--ok); }
.dot-crit { background: var(--crit); }
.dot-warn { background: var(--warn); }
.dot-na { background: transparent; border: 1px solid var(--rule); }

.pill { font-size: .7rem; font-weight: 600; padding: .2rem .55rem; border-radius: 8px; border: 1px solid; text-transform: uppercase; letter-spacing: .03em; }
.pill-ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.pill-crit { color: var(--crit); background: var(--crit-soft); border-color: transparent; }
.pill-warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.pill-na { color: var(--ink-3); background: var(--surface-2); border-color: var(--rule); }

.note { border: 1px solid var(--rule); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 12px; padding: .8rem 1rem; margin: 1rem 0; box-shadow: var(--shadow); }
.note-crit { border-left-color: var(--crit); }
.note-warn { border-left-color: var(--warn); }

.propuesta { margin: 1rem 0; border: 1px solid var(--rule); background: var(--surface); border-radius: 14px; padding: .8rem 1rem; box-shadow: var(--shadow); }
.propuesta summary { cursor: pointer; font-weight: 600; }
.tabla-propuesta { width: 100%; border-collapse: collapse; margin-top: .6rem; font-size: .85rem; }
.tabla-propuesta th, .tabla-propuesta td { padding: .4rem .5rem; border-bottom: 1px solid var(--rule-soft); text-align: left; }
.tabla-propuesta .num { text-align: right; font-family: ui-monospace, monospace; }

.grupo-hallazgos { margin: 1.2rem 0; }
.grupo-titulo { font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 .5rem; }
.grupo-n { font-family: ui-monospace, monospace; }
.grupo-bloqueante, .grupo-critico { color: var(--crit); }
.grupo-aviso { color: var(--warn); }
.grupo-informativo { color: var(--ink-3); }

.finding { border: 1px solid var(--rule); border-left-width: 3px; background: var(--surface); border-radius: 14px; padding: .8rem 1rem; margin-bottom: .6rem; box-shadow: var(--shadow); }
.finding-bloqueante, .finding-critico { border-left-color: var(--crit); }
.finding-aviso { border-left-color: var(--warn); }
.finding-informativo { border-left-color: var(--rule); }
.finding-head { display: flex; gap: .5rem; flex-wrap: wrap; font-size: .78rem; margin-bottom: .3rem; align-items: center; }
.finding-head .regla { font-family: ui-monospace, monospace; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: .1rem .4rem; border-radius: 6px; }
.finding-head .hoja { color: var(--ink-3); }
.finding-head .ctx { color: var(--ink-2); }
.finding-msg { font-size: .92rem; }

.ev { margin-top: .5rem; border: 1px solid var(--rule-soft); border-radius: 10px; overflow: hidden; }
.ev-scroll { max-height: 340px; overflow-y: auto; }
.ev table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.ev th { position: sticky; top: 0; background: var(--surface); }
.ev th, .ev td { padding: .3rem .5rem; border-bottom: 1px solid var(--rule-soft); text-align: left; }
.ev th.num, .ev td.num { text-align: right; }
.ev-total { padding: .3rem .5rem; color: var(--ink-3); font-size: .8rem; border-top: 1px solid var(--rule-soft); }

.sin-hallazgos { color: var(--ink-3); }

/* ---- Verificación del centro (pantalla 4) ---- */
.verif { max-width: 640px; margin: 1.5rem 0; }
.verif-chip {
  display: inline-block; font-size: .78rem; font-weight: 700; padding: .3rem .7rem;
  border-radius: 20px; margin-bottom: .6rem;
}
.chip-ok { color: var(--ok); background: var(--ok-soft); }
.chip-crit { color: var(--crit); background: var(--crit-soft); }
.chip-warn { color: var(--warn); background: var(--warn-soft); }
.verif-h { font-size: 1.2rem; margin: 0 0 .8rem; letter-spacing: -.01em; }
.verif-card { border: 1px solid var(--rule); background: var(--surface); border-radius: 16px; margin-bottom: .7rem; box-shadow: var(--shadow); overflow: hidden; }
.verif-card-crit { border-color: var(--crit); }
.verif-card-warn { border-color: var(--warn); }
.verif-tbl { width: 100%; border-collapse: collapse; }
.verif-tbl th, .verif-tbl td { padding: .55rem .8rem; border-bottom: 1px solid var(--rule-soft); text-align: left; font-size: .88rem; }
.verif-tbl thead th { color: var(--ink-3); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); }
.verif-sub { color: var(--ink-3); }
.verif-mono { font-family: ui-monospace, monospace; }
.v-ok { color: var(--ok); }
.v-crit { color: var(--crit); }
.v-warn { color: var(--warn); }
.verif-nota { color: var(--ink-2); font-size: .88rem; margin: .4rem 0; }
.verif-nota-chica { font-size: .8rem; color: var(--ink-3); }
.verif-acciones { display: flex; gap: .6rem; margin-top: .8rem; }
.verif-acciones .btn { flex: 1; }

.btn {
  font: inherit; font-weight: 600; padding: .6rem 1.2rem; border: 1px solid var(--rule);
  border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer; text-align: center;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.btn:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.btn-pri { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: var(--shadow); }
.btn-pri:hover { filter: brightness(1.06); }
.btn-wide { display: block; width: 100%; margin-top: .5rem; }

/* ---- Lista de partes cargados (multi-registro) ---- */
.partes-lista { display: flex; flex-direction: column; gap: .6rem; margin: -.4rem 0 1.2rem; }
.parte-item {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  border: 1px solid var(--rule); border-left-width: 3px; background: var(--surface); border-radius: 14px;
  padding: .7rem .9rem; box-shadow: var(--shadow);
}
.parte-ok { border-left-color: var(--ok); }
.parte-bad { border-left-color: var(--crit); }
.parte-nombre { font-weight: 600; font-size: .88rem; word-break: break-word; }
.parte-estado { color: var(--ink-2); font-size: .82rem; }
.parte-quitar {
  font: inherit; font-size: .78rem; padding: .4rem .7rem; border: 1px solid var(--rule);
  border-radius: 10px; background: var(--surface-2); color: var(--ink-2); cursor: pointer; flex-shrink: 0;
}
.parte-quitar:hover { border-color: var(--crit); color: var(--crit); }

/* ---- Verificación de varios registros a la vez ---- */
.verif-lista-titulo { font-weight: 700; margin: 1.5rem 0 .8rem; font-size: 1.05rem; }
.verif-item { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--rule-soft); }
.verif-item:last-child { border-bottom: 0; }
.verif-item-nivel { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: .5rem; }
.verif-resuelto { padding: .3rem 0; }

/* ---- Acceso (login) ---- */
.login-shell { max-width: 400px; margin: 4rem auto; padding: 0 1.5rem; }
.login-card { border: 1px solid var(--rule); background: var(--surface); border-radius: 20px; padding: 2rem; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 1.3rem; margin: 0 0 .4rem; letter-spacing: -.01em; }
.campo { display: block; font-weight: 500; font-size: .8rem; color: var(--ink-3); margin-bottom: 1rem; }
.campo input {
  display: block; width: 100%; margin-top: .35rem; font: inherit; padding: .65rem .8rem;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--surface-2); color: var(--ink);
}
.campo input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---- Navegación lateral de la app privada: riel + panel de submenú ---- */
:root { --rail-w: 88px; --subpanel-w: 268px; }
.ico { width: 1.2em; height: 1.2em; flex: none; }
body.con-sidenav { padding-left: calc(var(--rail-w) + var(--subpanel-w)); }

.sidenav { position: fixed; top: 0; bottom: 0; left: 0; display: flex; z-index: 40; }
.rail {
  width: var(--rail-w); background: var(--surface); border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .9rem .5rem 1rem;
}
.rail-brand {
  width: 42px; height: 42px; border-radius: 13px; background: var(--accent); color: #fff; text-decoration: none;
  display: grid; place-items: center; font-weight: 800; font-size: .7rem; letter-spacing: .06em; margin-bottom: .9rem;
  box-shadow: var(--shadow);
}
.rail-item {
  width: 74px; padding: .6rem 0 .5rem; border: 0; border-radius: 12px; background: none; color: var(--ink-2); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: .32rem; font: inherit; font-size: .7rem; font-weight: 600; line-height: 1;
  transition: background .12s, color .12s;
}
.rail-item .ico { width: 22px; height: 22px; }
.rail-item:hover { background: var(--surface-2); color: var(--ink); }
.rail-item-activo, .rail-item-activo:hover { background: var(--accent-soft); color: var(--accent); }
.rail-espacio { flex: 1; }
.rail-usuario {
  width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--rule);
  display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: var(--ink-2); letter-spacing: .02em;
}

.subpanel {
  width: var(--subpanel-w); background: var(--surface); border-right: 1px solid var(--rule);
  padding: 1.35rem 1rem 1rem; overflow-y: auto; display: flex; flex-direction: column;
}
.subpanel-head h2 { margin: 0 0 .25rem; font-size: 1.15rem; letter-spacing: -.01em; }
.subpanel-head p { margin: 0 0 1.1rem; color: var(--ink-3); font-size: .82rem; line-height: 1.4; }
.sub-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.sub-item {
  display: flex; align-items: center; gap: .7rem; width: 100%; padding: .62rem .7rem; border: 0; border-radius: 10px;
  background: none; color: var(--ink-2); text-decoration: none; text-align: left; cursor: pointer;
  font: inherit; font-size: .9rem; font-weight: 500; transition: background .12s, color .12s;
}
.sub-item .ico { width: 20px; height: 20px; color: var(--ink-3); }
.sub-item:hover { background: var(--surface-2); color: var(--ink); }
.sub-item:hover .ico { color: var(--ink); }
.sub-item-activo, .sub-item-activo:hover { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sub-item-activo .ico { color: var(--accent); }
.sub-item em { margin-left: auto; font-style: normal; font-size: .75rem; color: var(--ink-3); }
.sub-item-salir, .sub-item-salir:hover, .sub-item-salir .ico { color: var(--crit); }
.subpanel-pie { margin-top: auto; padding-top: 1rem; font-size: .72rem; line-height: 1.4; color: var(--ink-3); border-top: 1px solid var(--rule-soft); }

.panel-password { margin: .4rem 0 .6rem; padding: .8rem; background: var(--surface-2); border-radius: 12px; display: flex; flex-direction: column; gap: .6rem; }
.panel-password .campo { margin: 0; }
.panel-password input { width: 100%; }
.pw-mensaje { font-size: .8rem; color: var(--ink-3); }

/* Enlaces «‹ Volver…» de las fichas siguen usando .nav-item */
.nav-item { padding: .5rem .9rem; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .88rem; }
.nav-item:hover { color: var(--accent); }

/* Móvil: barra superior compacta y el menú como cajón lateral */
.topbar-movil { display: none; }
.sidenav-velo { position: fixed; inset: 0; background: rgba(20,19,26,.45); z-index: 35; }
.btn-icono {
  border: 1px solid var(--rule); background: var(--surface); border-radius: 10px; width: 38px; height: 38px;
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.btn-icono .ico { width: 20px; height: 20px; }
@media (max-width: 959px) {
  body.con-sidenav { padding-left: 0; }
  .sidenav { transform: translateX(-100%); transition: transform .2s ease; max-width: 92vw; }
  body.sidenav-abierto .sidenav { transform: none; box-shadow: var(--shadow-lg); }
  .topbar-movil {
    display: flex; align-items: center; gap: .8rem; position: sticky; top: 0; z-index: 30;
    padding: .7rem 1rem; background: var(--surface); border-bottom: 1px solid var(--rule);
  }
  .topbar-movil .brand { font-size: 1rem; }
}

/* ---- Tablas con scroll horizontal ---- */
.tablewrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--rule); box-shadow: var(--shadow); }
.tablewrap .verif-tbl { border-radius: 0; }
.tabla-tablero tr { cursor: pointer; }
.tabla-tablero tbody tr:hover { background: var(--surface-2); }
.resolver-inline { display: flex; align-items: flex-end; gap: .6rem; margin-top: .6rem; }
.resolver-inline .campo { margin-bottom: 0; flex: 1; }
.resolver-inline input { width: 100%; }
.ver-ficha { margin-left: .6rem; font-size: .8rem; color: var(--accent); text-decoration: none; font-weight: 600; }
.ver-ficha:hover { text-decoration: underline; }

/* ---- Catálogos ---- */
.cat-bloque { margin: 1.2rem 0; padding-top: 1rem; border-top: 1px solid var(--rule-soft); }
.cat-bloque summary { cursor: pointer; list-style: none; }
.cat-bloque summary::-webkit-details-marker { display: none; }
.cat-bloque summary h2 {
  font-size: 1.1rem; margin: 0 0 .3rem; letter-spacing: -.01em; display: flex; align-items: center; gap: .5rem;
}
.cat-bloque summary h2::before { content: '▸'; color: var(--ink-3); font-size: .85em; transition: transform .12s; }
.cat-bloque[open] summary h2::before { transform: rotate(90deg); }
.cat-bloque summary:hover h2 { color: var(--accent); }
.cat-bloque[open] > summary h2 { margin-bottom: .8rem; }
.cat-conteo { font-size: .8rem; font-weight: 500; color: var(--ink-3); }
.cat-form {
  display: flex; flex-wrap: wrap; gap: .9rem 1.1rem; align-items: flex-end; margin-bottom: 1.4rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 1.2rem; box-shadow: var(--shadow);
}
.cat-form .campo { margin-bottom: 0; min-width: 10rem; }
.cat-form select { display: block; width: 100%; margin-top: .35rem; font: inherit; padding: .65rem .8rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface-2); color: var(--ink); }

.cat-filtros { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .8rem; }
.cat-filtros select { width: auto; }

/* ---- Tabla comparativa por mes (clicable) ---- */
.tabla-meses-titulo { font-size: 1.05rem; margin: 1.6rem 0 .3rem; letter-spacing: -.01em; }
.tabla-meses-ayuda { color: var(--ink-3); font-size: .82rem; margin: 0 0 .8rem; max-width: 62ch; }
.tabla-meses { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tabla-meses th, .tabla-meses td { padding: .45rem .6rem; border-bottom: 1px solid var(--rule-soft); text-align: right; white-space: nowrap; }
.tabla-meses th:first-child, .tabla-meses td.fila-etiqueta { text-align: left; white-space: normal; }
.tabla-meses thead th { color: var(--ink-3); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); position: sticky; top: 0; }
.tabla-meses tr.fila-total td { font-weight: 700; background: var(--surface-2); }
.tabla-meses tr.fila-subtotal td { font-style: italic; color: var(--ink-2); }
.tabla-meses .fila-etiqueta { font-weight: 500; color: var(--ink); }
.tabla-meses td.cell-mes { cursor: pointer; font-variant-numeric: tabular-nums; transition: background .1s; border-radius: 6px; }
.tabla-meses td.cell-mes:hover { background: var(--accent-soft); }
.tabla-meses td.cell-mes.cell-crit { color: var(--crit); font-weight: 700; }
.tabla-meses td.cell-mes.cell-activa { background: var(--accent); color: #fff; }
.tabla-meses td.cell-na { color: var(--ink-3); cursor: default; }
.tabla-meses td.cell-na:hover { background: none; }

.detalle-mes { border: 1px solid var(--accent); background: var(--surface); border-radius: 14px; padding: .9rem 1.1rem; margin: .8rem 0 1.4rem; box-shadow: var(--shadow); }
.detalle-mes-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .6rem; font-size: .95rem; }
.detalle-cerrar { background: none; border: 0; font-size: 1rem; color: var(--ink-3); cursor: pointer; padding: .2rem .4rem; line-height: 1; }
.detalle-cerrar:hover { color: var(--crit); }
.tabla-detalle { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tabla-detalle th, .tabla-detalle td { padding: .3rem .5rem; border-bottom: 1px solid var(--rule-soft); text-align: left; }
.tabla-detalle th.num, .tabla-detalle td.num { text-align: right; font-family: ui-monospace, monospace; }

/* ---- Movimientos del año, contra SACE ---- */
.movimientos-titulo { font-size: 1.05rem; margin: 1.4rem 0 .3rem; letter-spacing: -.01em; }
.movimientos-ayuda { color: var(--ink-3); font-size: .82rem; margin: 0 0 .8rem; max-width: 62ch; }
.tabla-movimientos th, .tabla-movimientos td { white-space: nowrap; }
.tabla-movimientos th:first-child, .tabla-movimientos td:first-child { white-space: normal; }
.tabla-movimientos th.num, .tabla-movimientos td.num { text-align: right; }
.tabla-movimientos tr.fila-mov-crit { background: var(--crit-soft); }
.tabla-movimientos tr.fila-mov-crit td:first-child { font-weight: 600; }
.movimientos-sinsace { color: var(--ink-3); font-style: italic; font-size: .82rem; }
.movimientos-nota { color: var(--ink-3); font-size: .8rem; margin: .5rem 0 1.6rem; max-width: 68ch; }

.mov-detalle { margin: -.6rem 0 1.6rem; }
.mov-detalle summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--accent); padding: .3rem 0; }
.mov-detalle summary:hover { text-decoration: underline; }
.mov-detalle .movimientos-ayuda { margin: .5rem 0 .7rem; }
.tabla-mov-grado td.mov-grado-celda { line-height: 1.35; vertical-align: middle; }
.tabla-mov-grado .mov-grado-parte { font-weight: 600; }
.tabla-mov-grado .mov-grado-sace { color: var(--ink-3); font-size: .82rem; }
.tabla-mov-grado .mov-grado-etq { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; opacity: .6; margin-right: .3em; }
.tabla-mov-grado td.celda-mov-crit { background: var(--crit-soft); }
.tabla-mov-grado td.celda-mov-crit .mov-grado-parte { color: var(--crit); }
.tabla-mov-grado td.celda-mov-crit .mov-grado-sace { color: var(--crit); }

/* ==== Identidad visual: color y carácter ======================================
   Va al final a propósito: refina lo de arriba sin tocarlo. Paleta: azul profundo →
   teal para marca y cabeceras, ámbar como acento cálido, y un color por nivel. */
body { background: var(--paper) linear-gradient(180deg, var(--wash), var(--paper) 440px) no-repeat; }

/* Riel oscuro con degradado */
.rail { background: linear-gradient(180deg, var(--rail-1), var(--rail-2)); border-right: 0; }
.rail-brand { background: var(--brand-warm); color: var(--brand-warm-ink); box-shadow: 0 6px 16px rgba(0,0,0,.28); }
.rail-item { color: var(--rail-ink); }
.rail-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.rail-item-activo, .rail-item-activo:hover { background: var(--rail-pill); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.rail-item-activo .ico { color: var(--brand-warm); }
.rail-usuario { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }

/* Panel de submenú */
.subpanel { background: var(--panel-bg); }
.subpanel-head h2 { color: var(--brand-1); }
.sub-item-activo, .sub-item-activo:hover { background: var(--accent-soft); color: var(--brand-1); }
.sub-item-activo .ico { color: var(--brand-1); }
.topbar-movil { border-bottom: 3px solid var(--brand-2); }

/* Cabecera de página: banda con degradado y dos brillos suaves */
.pagina-head, .reporte-head {
  position: relative; overflow: hidden; border-radius: 20px; padding: 1.5rem 1.7rem 1.45rem; margin: 0 0 1.5rem;
  background: linear-gradient(120deg, var(--brand-1), var(--brand-2)); color: #fff;
  box-shadow: 0 12px 30px oklch(0.42 0.14 252 / .26);
}
.pagina-head::before, .reporte-head::before {
  content: ''; position: absolute; top: -45%; right: -6%; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.24), transparent 62%); pointer-events: none;
}
.pagina-head::after, .reporte-head::after {
  content: ''; position: absolute; left: -70px; bottom: -130px; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, oklch(0.80 0.15 75 / .30), transparent 62%); pointer-events: none;
}
.pagina-head h1, .reporte-head h2 { position: relative; color: #fff; margin: 0 0 .35rem; font-size: 1.55rem; letter-spacing: -.015em; }
.pagina-head .lede, .reporte-head .sub { position: relative; color: rgba(255,255,255,.84); margin: 0; max-width: 64ch; }
.pagina-head .lede { font-size: .95rem; }
.reporte-head .sub { font-family: ui-monospace, monospace; font-size: .85rem; }
#centro-cont > .reporte, #ficha-cont > .reporte { padding: 0; border-top: 0; margin-top: .6rem; }

/* Un color por nivel */
.chip-nivel { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .03em; padding: .22rem .62rem; border-radius: 999px; white-space: nowrap; }
.nivel-PREBASICA { color: var(--nivel-pre); background: var(--nivel-pre-soft); }
.nivel-BASICA { color: var(--nivel-bas); background: var(--nivel-bas-soft); }
.nivel-MEDIA { color: var(--nivel-med); background: var(--nivel-med-soft); }

/* Tablas y semáforos */
.verif-tbl thead th, .tabla-meses thead th { background: var(--accent-soft); color: var(--brand-1); }
.tabla-tablero tbody tr { transition: background .12s; }
.tabla-tablero tbody tr:hover { background: var(--accent-soft); }
.tabla-tablero tbody tr:hover td:nth-child(2) { color: var(--brand-1); font-weight: 600; }
.dot { width: 11px; height: 11px; }
.dot-ok { box-shadow: 0 0 0 3px var(--ok-soft); }
.dot-crit { box-shadow: 0 0 0 3px var(--crit-soft); }
.dot-warn { box-shadow: 0 0 0 3px var(--warn-soft); }

/* Botones, tarjetas y tiles */
.btn-pri, button#btn-analizar { background: linear-gradient(120deg, var(--brand-1), var(--brand-2)); border-color: transparent; box-shadow: 0 6px 16px oklch(0.42 0.14 252 / .28); }
.btn-pri:hover, button#btn-analizar:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.tile { background: linear-gradient(180deg, var(--surface), var(--panel-bg)); }
.tile:not(.tile-crit):not(.tile-warn) .tile-n { color: var(--brand-1); }
.config-card { border-top: 3px solid var(--brand-2); }
.reporte-collapse { border-top: 3px solid var(--brand-2); }

/* Acceso: fondo con la marca y tarjeta flotante */
.pagina-login { min-height: 100vh; background: linear-gradient(135deg, var(--rail-1), var(--brand-2)); }
.pagina-login .topbar { background: transparent; border-bottom: 1px solid rgba(255,255,255,.16); color: #fff; }
.pagina-login .brand span { color: rgba(255,255,255,.72); }
.pagina-login .topbar .btn { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.28); }
.pagina-login .login-card { border: 0; box-shadow: 0 26px 60px rgba(0,0,0,.35); }
.login-marca {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 1rem;
  background: linear-gradient(120deg, var(--brand-1), var(--brand-2)); color: #fff; font-weight: 800; font-size: .8rem; letter-spacing: .06em;
  box-shadow: 0 8px 20px oklch(0.42 0.14 252 / .35);
}
