/* Proceso AF — panel. Sin framework: tokens + componentes mínimos. */

:root {
    /* Marca Vektor: azul marino #0B132B, cian #00A8E8 / #00F0FF, gris platino #E0E1DD, blanco. */
    --bg: #F1F2EF;              /* platino aclarado: fondo general, sin cansar la vista */
    --surface: #FFFFFF;
    --surface-2: #F6F7F4;
    --border: #E0E1DD;          /* gris platino */
    --border-strong: #C9CBC5;
    --text: #0B132B;            /* azul marino profundo */
    --text-2: #4B5468;
    --text-3: #858C99;

    /* Cian tecnológico. El texto y los enlaces usan un cian más oscuro de la
       misma familia: blanco o fondo claro sobre #00A8E8 no se lee bien. */
    --accent: #0077A8;
    --accent-hover: #005F87;
    --accent-bright: #00A8E8;
    --accent-soft: #E3F5FC;

    --ok: #1D7A4B;      --ok-soft: #E5F4EC;
    --warn: #9A6200;    --warn-soft: #FBF1DC;
    --danger: #B3261E;  --danger-soft: #FBE9E7;

    --primary: #0B132B;         /* botones principales */
    --primary-hover: #1C2541;

    --side-bg: #0B132B;
    --side-text: #AEB6C6;
    --side-hover: #1C2541;
    --side-active: #1C2541;

    --radius: 6px;
    --font: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
/* `hidden` debe ganar siempre, aunque el componente declare su propio display. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 14px/1.55 var(--font);
    font-variant-numeric: tabular-nums;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
code, kbd, samp, pre, input, select, textarea, button { font-family: var(--font); }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
p { margin: 0; }
.i { flex: none; vertical-align: middle; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.side {
    background: var(--side-bg);
    color: var(--side-text);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    padding: 14px 10px;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 8px 18px; color: #fff; text-decoration: none;
}
.brand:hover { text-decoration: none; }
.logo-vektor { flex: none; display: block; }
.side .brand { color: #fff; }
.brand-name { font-weight: 700; font-size: 17px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; }
.brand-sub { font-size: 11.5px; color: var(--side-text); }

.nav-label {
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    color: #6b737d; padding: 14px 10px 6px;
}
.nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px; border-radius: 5px;
    color: var(--side-text); font-size: 14.5px;
}
.nav a:hover { background: var(--side-hover); color: #e6e9ed; text-decoration: none; }
.nav a.is-active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--accent-bright); }

.side-foot { margin-top: auto; border-top: 1px solid #232932; padding-top: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.me-name { color: #e6e9ed; font-size: 13px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-role { font-size: 11.5px; }
.side-foot form { margin: 4px 0 0; }
.side-link {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 7px 10px; border: 0; border-radius: 5px; background: none;
    color: var(--side-text); font: inherit; font-size: 13px; cursor: pointer; text-align: left;
}
.side-link:hover { background: var(--side-hover); color: #e6e9ed; text-decoration: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 52px; display: flex; align-items: center; gap: 12px;
    padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 5;
}
.centro-switch { margin-left: auto; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.centro-switch form { display: flex; align-items: center; gap: 8px; }
.centro-switch select.input { height: 32px; min-width: 200px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; }
.crumbs a { color: var(--text-2); }
.crumbs strong { color: var(--text); font-weight: 600; }
.btn.menu-btn { display: none; }

.content { padding: 24px 28px 48px; max-width: 1400px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head p { color: var(--text-2); margin-top: 4px; }

/* ---------- Superficies ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.card-body { padding: 16px; }
aside > .card + .card { margin-top: 16px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 20px; }
.stat { padding: 14px 16px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat-label { font-size: 12px; color: var(--text-2); }
.stat-value { font: 600 24px/1.3 var(--font); margin-top: 2px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left; font-weight: 600; font-size: 13px; color: var(--text-2);
    padding: 9px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.actions { text-align: right; white-space: nowrap; }
.row-dim td { color: var(--text-3); }

.person { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 30px; height: 30px; border-radius: 50%; flex: none;
    display: grid; place-items: center;
    background: #e9edf2; color: #3d4652; font: 600 11.5px/1 var(--font);
}
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.side .avatar { background: #2a313b; color: #dfe3e8; }
.person-name { font-weight: 600; line-height: 1.3; }
.person-mail { font-size: 12.5px; color: var(--text-2); }

.empty { padding: 36px 16px; text-align: center; color: var(--text-2); }

/* ---------- Etiquetas ---------- */
.tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 1px 8px; border-radius: 4px; font-size: 13px; font-weight: 600;
    background: #eef0f3; color: #3d4652; white-space: nowrap;
}
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.status.on .dot { background: var(--ok); }
.status.off { color: var(--text-3); }

/* ---------- Formularios ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field small { display: block; color: var(--text-2); font-size: 12px; margin-top: 5px; }
.input, select.input {
    width: 100%; height: 36px; padding: 0 10px;
    border: 1px solid var(--border-strong); border-radius: 5px;
    background: var(--surface); color: var(--text); font: inherit;
}
select.input { appearance: none; padding-right: 30px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235b6470' stroke-width='1.75' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 8px center; }
.input:focus { outline: none; border-color: var(--accent-bright); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-icon { position: relative; }
.input-icon .i { position: absolute; left: 10px; top: 9px; color: var(--text-3); }
.input-icon .input { padding-left: 34px; }

.roles-pick { display: grid; gap: 8px; }
.role-opt {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 5px; cursor: pointer;
}
.role-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.role-opt:has(input:disabled) { cursor: not-allowed; opacity: .7; }
.role-opt input { margin: 3px 0 0; accent-color: var(--accent); }
.role-opt strong { display: block; font-weight: 600; font-size: 13.5px; }
.role-opt span { font-size: 12.5px; color: var(--text-2); }

.checks { display: grid; gap: 6px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { margin: 0; accent-color: var(--accent); }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { width: 34px; height: 20px; appearance: none; background: var(--border-strong); border-radius: 20px; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { left: 16px; }
.switch input:disabled { opacity: .5; cursor: not-allowed; }

.filters { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.filters .input-icon { flex: 1 1 240px; }
.filters select.input { width: auto; min-width: 150px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row label small { display: block; margin-bottom: 4px; color: var(--text-2); }
.input.num { text-align: right; }
.input.invalido { border-color: var(--danger); background: var(--danger-soft); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.toolbar .tool { display: flex; align-items: center; gap: 8px; }
.toolbar .input { height: 30px; width: auto; }
.toolbar .tool-hint { display: flex; align-items: center; gap: 6px; }
tfoot td { background: var(--surface-2); border-top: 1px solid var(--border-strong); padding: 10px 16px; }
.sticky-actions { position: sticky; bottom: 0; margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); justify-content: space-between; align-items: center; z-index: 4; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.plain:disabled .input { background: var(--surface-2); color: var(--text); }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--border); }
.paginador {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
    padding: 8px 16px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.paginador > :last-child { justify-self: end; }
.paginador .paginas { display: flex; align-items: center; gap: 2px; }
.paginador .paginas .btn { min-width: 30px; padding: 0 8px; }
.paginador .btn:disabled { opacity: .35; cursor: default; }
.paginador label { display: flex; align-items: center; gap: 8px; }
.paginador select.input { height: 28px; width: auto; padding-left: 8px; }
@media (max-width: 760px) { .paginador { grid-template-columns: 1fr; justify-items: start; } .paginador > :last-child { justify-self: start; } }
@media (max-width: 760px) { .form-row { grid-template-columns: 1fr; gap: 0; } }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 34px; padding: 0 14px; border-radius: 5px;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    font: 600 14.5px/1 var(--font); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.block { width: 100%; height: 38px; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: #eef0f3; }

/* ---------- Avisos ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 5px; margin-bottom: 16px; font-size: 13.5px; border: 1px solid; }
.flash.success { background: var(--ok-soft); color: var(--ok); border-color: #bfe3cf; }
.flash.error { background: var(--danger-soft); color: var(--danger); border-color: #f2c6c1; }
.flash.warning { background: var(--warn-soft); color: var(--warn); border-color: #efd9a8; }

.secret {
    border: 1px solid #efd9a8; background: var(--warn-soft); border-radius: var(--radius);
    padding: 14px 16px; margin-bottom: 16px;
}
.secret-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.secret code {
    font: 600 18px/1 var(--font); letter-spacing: .08em; background: #fff;
    border: 1px solid #efd9a8; border-radius: 5px; padding: 8px 12px; color: var(--text);
}

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; text-align: right; }

/* ---------- Pestañas ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 8px 14px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.is-active { color: var(--text); border-bottom-color: var(--accent-bright); }

/* ---------- Tabla editable (como hoja de cálculo) ---------- */
.grid-edit td { padding: 6px 8px; }
.grid-edit th { padding: 9px 8px; }
.grid-edit .input { height: 32px; }
.grid-edit .input.num { text-align: right; }
.grid-edit .col-entero, .grid-edit .col-porcentaje { width: 110px; }
.grid-edit .col-lista { width: 230px; }
.grid-edit .col-rnc { width: 150px; }
.grid-edit th.col-check, .grid-edit td.col-check { width: 90px; text-align: center; }
.grid-edit .col-accion { width: 52px; text-align: center; }
.grid-edit .btn-deshacer, .grid-edit tr.row-delete .btn-eliminar { display: none; }
.grid-edit tr.row-delete .btn-deshacer { display: inline-flex; }
.grid-edit .btn-eliminar { color: var(--text-3); }
.grid-edit .btn-eliminar:hover { color: var(--danger); }
.grid-edit tr.row-delete td { background: var(--danger-soft); }
.grid-edit tr.row-delete .input { text-decoration: line-through; color: var(--text-3); pointer-events: none; }
.grid-edit tr.row-delete input[type=checkbox], .grid-edit tr.row-delete input[type=radio] { pointer-events: none; opacity: .4; }
.scope { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); font-size: 13px; color: var(--text-2); }
.scope strong { color: var(--text); }
.grid-edit input[type=checkbox], .grid-edit input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- Matriz de permisos ---------- */
.matrix th.role-col { text-align: center; min-width: 130px; }
.matrix td.cell { text-align: center; }
.matrix .yes { color: var(--ok); }
.matrix .no { color: #c4cad1; }
.matrix tr.group td {
    background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--text-2);
    text-transform: uppercase; letter-spacing: .05em; padding: 7px 16px;
}
.perm-key { font-size: 12.5px; color: var(--text-3); }

/* ---------- Acceso ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; }
.auth-box {
    width: 100%; max-width: 380px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; padding: 28px;
}
.auth-brand { padding: 0 0 24px; color: var(--text); gap: 12px; }
.auth-box h1 { font-size: 20px; }
.auth-box > p { color: var(--text-2); margin: 6px 0 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: fixed; inset: 0 auto 0 0; width: 240px; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
    body.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
    .btn.menu-btn { display: inline-flex; }
    .topbar, .content { padding-left: 16px; padding-right: 16px; }
    .page-head { flex-direction: column; align-items: stretch; }
    .stat + .stat { border-left: 0; border-top: 1px solid var(--border); }
    .hide-sm { display: none; }
}
.paginador .btn.is-disabled { opacity: .35; pointer-events: none; }

/* ---------- Acciones formativas ---------- */
.tag.cat-solicitud { background: #eef0f3; color: #3d4652; }
.tag.cat-comprometido { background: var(--accent-soft); color: var(--accent); }
.tag.cat-ejecucion { background: var(--ok-soft); color: var(--ok); }
.tag.cat-excluido { background: var(--danger-soft); color: var(--danger); }
.mas-filtros { flex-basis: 100%; }
.mas-filtros > summary { list-style: none; display: inline-flex; }
.mas-filtros > summary::-webkit-details-marker { display: none; }
.mas-filtros:not([open]) { flex-basis: auto; }
.toolbar.masivo { position: sticky; top: 52px; z-index: 4; background: var(--accent-soft); }
.calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; border-top: 1px solid var(--border); }
.calc > div { padding: 12px 16px; }
.calc > div + div { border-left: 1px solid var(--border); }
.calc .stat-value { font-size: 18px; }
.historial { list-style: none; margin: 0; padding: 0; }
.historial li { padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13.5px; }
.historial li:first-child { border-top: 0; }

/* ---------- Lista con búsqueda ---------- */
.combo { position: relative; min-width: 0; }
.filters .combo { min-width: 180px; }
.combo .input { width: 100%; padding-right: 30px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235b6470' stroke-width='1.75' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m20 20-4.2-4.2'/%3E%3C/svg%3E") no-repeat right 8px center; text-align: left; }
.combo-lista {
    position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
    max-height: 280px; overflow: auto; margin: 0; padding: 4px; list-style: none;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px;
    box-shadow: 0 8px 24px rgba(20, 24, 30, .12);
    min-width: 260px;
}
.combo-lista li { padding: 7px 10px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.combo-lista li.activa, .combo-lista li:hover { background: var(--accent-soft); color: var(--accent); }
.combo-lista li[aria-selected] { font-weight: 600; }
.combo-lista li.combo-nada { cursor: default; background: none; }
.form-row-4 { grid-template-columns: repeat(4, 1fr); }
.form-row-af1 { grid-template-columns: minmax(0, 1fr) 180px; }
.grid-af { grid-template-columns: minmax(0, 1fr) 300px; }
.label-accion { display: flex !important; align-items: center; justify-content: space-between; }
.label-accion .btn { height: 22px; padding: 0 6px; font-size: 12.5px; }
.dialogo { border: 1px solid var(--border); border-radius: 8px; padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 16px 48px rgba(20, 24, 30, .2); }
.dialogo::backdrop { background: rgba(20, 24, 30, .35); }
@media (max-width: 960px) { .form-row-4 { grid-template-columns: 1fr 1fr; } .form-row-af1 { grid-template-columns: 1fr; } }
.stat-link { color: inherit; }
.stat-link:hover { background: var(--surface-2); text-decoration: none; }
.stat-value.warn { color: var(--warn); }
.aviso { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; margin-bottom: 16px; border: 1px solid #bfd3f2; background: var(--accent-soft); border-radius: var(--radius); color: var(--accent); }
.aviso span { display: flex; align-items: center; gap: 8px; }
/* Ficha de solo lectura en cuadrícula (datos de Pentaho). Las líneas son el
   hueco de 1px entre celdas, así funcionan aunque una ocupe varias columnas. */
.datos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border); border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.datos > div { padding: 12px 16px; background: var(--surface); min-width: 0; }
.datos span { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 2px; }
.datos strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.datos strong.normal { font-weight: 400; }
.datos .ancho-2 { grid-column: span 2; }
.datos .ancho-4 { grid-column: 1 / -1; }
@media (max-width: 760px) { .datos { grid-template-columns: 1fr 1fr; } .datos .ancho-2 { grid-column: 1 / -1; } }

/* ---------- Ficha de empresa ---------- */
.stat-value.negativo { color: var(--danger); }
.barra-balance { display: flex; height: 10px; border-radius: 5px; background: #e6e9ed; overflow: hidden; margin-top: -8px; }
.barra-balance span { display: block; height: 100%; }
.b-ejec { background: var(--ok); }
.b-comp { background: var(--accent-bright); }
.b-sol { background: #a9b4c2; }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.tabs-card { margin: 0; padding: 0 12px; }
.resumen-linea { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.enlace-fila { color: inherit; } .enlace-fila:hover { color: var(--accent); }
.nav .badge { margin-left: auto; background: var(--warn); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11.5px; font-weight: 700; line-height: 18px; }
/* Chips de filtro rápido (bandeja de pendientes). */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border: 1px solid var(--border-strong); border-radius: 16px; background: var(--surface); color: var(--text); font-size: 13.5px; }
.chip span { font-weight: 700; color: var(--text-2); }
.chip:hover { text-decoration: none; border-color: var(--accent); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.is-active span { color: #fff; }
.arreglo { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.arreglo .combo, .arreglo select { flex: 1; min-width: 0; }
.arreglo .input { height: 30px; }
.tabs-barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); padding-right: 12px; flex-wrap: wrap; }
.tabs-barra .tabs { border-bottom: 0; }
.buscar-ficha { width: min(300px, 100%); }
.buscar-ficha .input { height: 32px; }
.bloque { padding: 16px 16px 4px; }
.bloque + .bloque { border-top: 1px solid var(--border); }
.bloque h3 { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.bloque .calc { margin: 0 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.calc .calc-total .stat-value { color: var(--primary); font-weight: 700; }
.rango { display: inline-flex; align-items: center; gap: 6px; }
.rango .input { width: auto; height: 36px; }
.filtros-ficha { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 6px 0; flex: 1; }
.filtros-ficha .rango .input { height: 32px; }
.tabla-estado th:first-child { width: 30%; }
.tabla-detalle th:first-child { width: auto; }
.tabla-detalle thead th[colspan] { text-align: center; border-bottom: 1px solid var(--border); }
.tabla-estado tr.fila-total td { font-weight: 600; background: var(--surface-2); }
.tabla-estado + .tabla-estado, .table-wrap + .table-wrap { border-top: 1px solid var(--border); }
.texto-negativo { color: var(--danger); }

/* ---------- Páginas para imprimir ---------- */
body.impresion { background: #fff; }
.hoja { max-width: 1100px; margin: 0 auto; padding: 32px; }
.acciones-impresion { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 16px; }
.hoja-titulo { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; border-bottom: 2px solid var(--text); padding-bottom: 12px; margin-bottom: 16px; }
.hoja-titulo p { margin-top: 4px; }
.tabla-impresion { font-size: 13px; }
.tabla-impresion th, .tabla-impresion td { padding: 6px 8px; border: 1px solid var(--border); background: none; }
.tabla-impresion tfoot td { background: var(--surface-2); border-top: 1px solid var(--border-strong); }
.nowrap { white-space: nowrap; }
@media print {
    .no-imprimir { display: none !important; }
    .hoja { padding: 0; max-width: none; }
    body { font-size: 12px; }
    @page { size: letter landscape; margin: 12mm; }
}
.marca-impresion { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; color: var(--text); }
/* Montserrat: cifras de ancho fijo para que las columnas numéricas se alineen. */
td.num, th.num, .stat-value, .input.num { font-variant-numeric: tabular-nums; }
.semaforo { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.semaforo i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.semaforo.verde i { background: #1E8E3E; } .semaforo.verde { color: #1E6B34; }
.semaforo.amarillo i { background: #F2B705; } .semaforo.amarillo { color: #8A6100; }
.semaforo.rojo i { background: var(--danger); } .semaforo.rojo { color: var(--danger); }
.stat .semaforo { margin-top: 4px; }
.filtros-reporte { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 16px; padding: 12px 16px 0; margin-bottom: 16px; }
@media (max-width: 760px) { .filtros-reporte { grid-template-columns: 1fr; gap: 0; } }
.tabla-nuevas .tabla-impresion th, .tabla-nuevas .tabla-impresion td { border-left: 0; border-right: 0; }
.tabla-nuevas > p { padding: 16px; margin: 0; }
.stat.kpi .small { margin-top: 2px; }
.barra-kpi { position: relative; height: 8px; margin: 8px 0 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
.barra-kpi span { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--accent-bright); }
.barra-kpi b { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--primary); }
.tabla-estado tfoot td { border-top: 1px solid var(--border); }
/* Gráfico: uso del proyectado por empresa */
.grafico-uso { padding: 8px 16px 14px; }
.fila-uso { display: grid; grid-template-columns: 180px minmax(0, 1fr) 56px; gap: 12px; align-items: center; padding: 3px 0; color: inherit; text-decoration: none; font-size: 13px; }
.fila-uso:hover .nombre-uso { color: var(--accent); text-decoration: underline; }
.nombre-uso { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pista-uso { position: relative; height: 14px; background: var(--surface-2); border-radius: 3px; }
.pista-uso::after { content: ""; position: absolute; top: -3px; bottom: -3px; left: var(--cien); width: 2px; background: var(--primary); }
.pista-uso i { display: block; height: 100%; border-radius: 3px; min-width: 2px; }
.pista-uso i.verde { background: #1E8E3E; } .pista-uso i.amarillo { background: #F2B705; } .pista-uso i.rojo { background: var(--danger); }
.pct-uso { font-weight: 600; } .pct-uso.verde { color: #1E6B34; } .pct-uso.amarillo { color: #8A6100; } .pct-uso.rojo { color: var(--danger); }
@media (max-width: 760px) { .fila-uso { grid-template-columns: 110px minmax(0, 1fr) 48px; } }
/* Gráfico: grupos aprobados por estado */
.barra-grupos { display: flex; height: 28px; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.barra-grupos span { display: flex; align-items: center; justify-content: center; min-width: 3px; font-size: 12px; font-weight: 600; color: #0B132B; }
.barra-grupos + .leyenda { margin-top: 10px; }
/* Gráfico: indicadores acumulados contra el ritmo de la meta */
.grafico-kpi { padding: 8px 16px 12px; }
.grafico-kpi svg { display: block; width: 100%; height: auto; font-family: var(--font); }
.g-rejilla { stroke: var(--border); stroke-width: 1; }
.g-eje { font-size: 11px; fill: var(--text-2); }
.g-futuro { opacity: .45; }
.g-valor { font-size: 10.5px; font-weight: 600; fill: var(--text); font-variant-numeric: tabular-nums; }
.g-ritmo { fill: none; stroke: var(--primary); stroke-width: 1.5; stroke-dasharray: 5 4; }
.g-meta { stroke: var(--primary); stroke-width: 1.5; }
.g-meta-texto { font-size: 11px; font-weight: 600; fill: var(--primary); }
.reparto { padding: 4px 16px 16px; border-top: 1px solid var(--border); }
.reparto h3 { margin: 14px 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.reparto p { margin: 0 0 10px; }
.reparto .table-wrap { border: 1px solid var(--border); border-radius: var(--radius); }
.reparto td .input { height: 30px; text-align: right; }
