:root {
  --bg: #f3f6fc;
  --surface: #ffffff;
  --surface-2: #e9eef8;
  --ink: #0e1a33;
  --ink-2: #43506b;
  --ink-3: #5f6b84;
  --line: #dce3f0;
  --ridder: #1b76ff;        /* azul de la marca (logo) */
  --accent: #1564e6;        /* azul Ridder un tono más oscuro: texto blanco legible en botones */
  --accent-ink: #ffffff;
  --brand: #0a1a3a;         /* marino: menú, barra del celular e ingreso */
  --brand-raised: #13285a;
  --brand-line: #1f3566;
  --brand-ink-2: #a9b8d6;
  --brand-ink-3: #8193b8;
  --red: #b8291d;
  --red-bg: #fde9e6;
  --amber: #8a5300;
  --amber-bg: #fff2d6;
  --green: #17703d;
  --green-bg: #e1f5e8;
  --blue: #2563c9;
  --blue-bg: #e3ecfb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18,22,26,.06), 0 2px 8px rgba(18,22,26,.05);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: light;
}
/* Claro siempre. Oscuro solo si la persona lo eligió en Ridder Acceso (tema="oscuro", public/tema.js pone data-theme="dark").
   No se sigue el modo del sistema (prefers-color-scheme): contrato de Acceso §20, ORQ-331. */
:root[data-theme="dark"] {
  --bg: #071022; --surface: #0f1a30; --surface-2: #16243f; --ink: #eaf0fb; --ink-2: #adb9d0; --ink-3: #7c89a4;
  --line: #22314f; --brand: #060d1c; --brand-raised: #112142; --brand-line: #182a4d;
  --red: #ff6b5c; --red-bg: #3a1714; --amber: #ffb547; --amber-bg: #352510;
  --green: #4ad584; --green-bg: #112d1d; --blue: #7aa7ff; --blue-bg: #15233d;
  --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }

/* ---------- layout (celular: app con menú abajo) ---------- */
.shell { max-width: 760px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 10; background: var(--brand); color: #fff; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.topbar-row { display: flex; align-items: center; gap: 10px; }
.icon-btn { background: rgba(255,255,255,.08); border: 0; color: #fff; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { background: rgba(255,255,255,.18); }
main { padding: 14px 16px; }

.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.nav-inner { max-width: 760px; margin: 0 auto; display: flex; }
.nav a, .nav-mas { flex: 1; min-width: 0; text-align: center; text-decoration: none; color: var(--ink-3); font-size: 11px; font-weight: 600;
  padding: 6px 0; border-radius: 10px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.nav-mas { background: none; border: 0; cursor: pointer; font-family: inherit; }
.nav a svg, .nav-mas svg { width: 22px; height: 22px; }
.nav a.on, .nav-mas.on { color: var(--ink); }
.nav a.on svg, .nav-mas.on svg { color: var(--ridder); }
.nav .side-brand, .side-user { display: none; }
@media (max-width: 1023px) { .nav a.nav-extra { display: none; } }
@media (min-width: 1024px) { .nav-mas { display: none; } }

/* menú flotante (engranaje y "Más") */
.ajustes-menu { position: fixed; z-index: 60; min-width: 200px; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
[hidden] { display: none !important; }
.ajustes-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.ajustes-menu a svg { width: 18px; height: 18px; color: var(--ink-3); }
.ajustes-menu a:hover, .ajustes-menu a:focus-visible { background: var(--surface-2); outline: none; }
.ajustes-menu a.on { color: var(--accent); }
.ajustes-menu a.on svg { color: var(--accent); }

/* barra de arriba igual a la de Cobranzas (ORQ-80): engranaje con todo adentro; el menú con las medidas del del selector */
.gear-btn svg { width: 19px; height: 19px; }
.gear-btn.on { color: var(--ridder); }
.ajustes-menu { min-width: 220px; padding: 6px; border-radius: 12px; }
.ajustes-menu a, .ajustes-menu button { padding: 9px 10px; gap: 10px; font-size: 14px; }
.ajustes-menu a svg, .ajustes-menu button svg { width: 20px; height: 20px; }
.ajustes-menu button { display: flex; align-items: center; width: 100%; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
.ajustes-menu button svg { color: var(--ink-3); }
.ajustes-menu button:hover, .ajustes-menu button:focus-visible { background: var(--surface-2); outline: none; }

/* selector de módulos: el diseño único de todos los módulos (el de Insitu, docs/selector-modulos.md del Orquestador) */
.mod { position: relative; flex: 1; min-width: 0; display: flex; }
.mod-btn { display: flex; align-items: center; gap: 6px; background: none; border: 0; color: #fff; font: inherit; font-weight: 700; font-size: 17px; padding: 4px 6px; margin-left: -6px; border-radius: 8px; cursor: pointer; }
.mod-btn:hover, .mod-btn[aria-expanded="true"] { background: var(--brand-raised); }
.mod-btn:focus-visible { outline: 2px solid var(--brand-ink-2); outline-offset: 2px; }
.mod-nombre { color: #fff; font-weight: 700; font-size: 17px; padding: 4px 6px; margin-left: -6px; display: flex; align-items: center; gap: 8px; }
.mod img.logo { width: 24px; height: 24px; display: block; flex: none; }
.modulos-menu { min-width: 220px; border-radius: 12px; padding: 6px; }
.mod-op { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
a.mod-op:hover, a.mod-op:focus-visible { background: var(--surface-2); outline: none; }
.mod-op.on { color: var(--accent); font-weight: 700; cursor: default; }
.mod-op img { width: 20px; height: 20px; flex: none; }
.mod-ini { width: 20px; height: 20px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
/* título de la pantalla: va en el contenido, no en la barra */
.page-head { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 14px; }
.page-head-txt { min-width: 0; flex: 1; }
.page-head h1 { font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.page-head .sub { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.page-head .back { color: var(--ink); text-decoration: none; font-size: 20px; line-height: 1; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); flex: none; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
@media (min-width: 560px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
/* cinco números en el celular: tres arriba y dos abajo, sin hueco */
.kpis.k5 { grid-template-columns: repeat(6, 1fr); }
.kpis.k5 > * { grid-column: span 2; }
.kpis.k5 > :nth-child(n+4) { grid-column: span 3; }
@media (min-width: 560px) { .kpis.k5 { grid-template-columns: repeat(5, 1fr); } .kpis.k5 > *, .kpis.k5 > :nth-child(n+4) { grid-column: span 1; } }
.kpi { background: var(--surface); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); border: 0; text-align: left; color: inherit; cursor: default; }
button.kpi { cursor: pointer; }
button.kpi:hover { background: var(--surface-2); }
button.kpi.on { outline: 2px solid var(--accent); background: var(--surface-2); }
.kpi .l { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; }
.kpi .v { font-size: 20px; font-weight: 600; margin-top: 4px; font-family: var(--mono); }
.kpi.alert .v { color: var(--red); }
.kpi.good .v { color: var(--green); }
.kpi.warn .v { color: var(--amber); }

/* ---------- controles ---------- */
.search { position: relative; margin-bottom: 10px; }
.search input { width: 100%; padding: 12px 14px 12px 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); outline: none; }
.search input:focus { border-color: var(--ink-2); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--ink-3); }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tab .c { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-left: 4px; }
.tab.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tab.on .c { color: var(--bg); opacity: .7; }
a.tab { text-decoration: none; display: inline-block; }
/* ORQ-371: entradas y salidas del mes, un bloque por persona */
.ent-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.ent-nombre { font-size: 17px; font-weight: 700; }
.ent-ci { font-size: 14px; margin: 2px 0; }
.ent-total { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex: none; }
.ent-total span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; }
.ent-total b { font-size: 20px; }
.ent-total small { font-size: 12px; color: var(--ink-3); }
.ent-persona .tabla-wrap { box-shadow: none; border: 1px solid var(--line); }
.aviso-banco { padding: 10px 14px; margin-bottom: 12px; border-radius: 12px; background: var(--amber-bg); color: var(--amber); font-size: 14px; }
.aviso-banco a { color: inherit; font-weight: 700; }
/* ORQ-378: importación automática y «Por asignar» */
.banco-auto { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13.5px; color: var(--ink-2); }
.banco-auto .auto-error { color: var(--red); font-weight: 600; }
.banco-fila.pendiente { background: color-mix(in srgb, var(--amber-bg) 55%, transparent); }
.banco-fila .pa-motivo { color: var(--ink-2); margin-top: 2px; }
.banco-fila .elegir-banco { margin-top: 8px; }
.banco-tot .t-por-asignar span { color: var(--amber); }
.banco-tot .t-por-asignar.hay:not(.on) { border-color: var(--amber); background: var(--amber-bg); }
.banco-pie { margin: 6px 2px 18px; }
.btn-link { background: none; border: 0; padding: 0; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
/* ORQ-373: anticipos y bonos del mes */
.ant-tabla .neg, .ant-cuenta .neg { color: var(--red); }
.ant-tabla tr.ant-abierto > td { background: var(--surface-2); white-space: normal; }
/* ORQ-386: la flechita que abre las transferencias de cada persona */
.ant-fila { cursor: pointer; }
.ant-tabla tr.ant-fila:hover > td { background: var(--surface-2); }
.ant-tog { display: inline-grid; place-items: center; width: 24px; height: 24px; margin: -3px 4px -3px -4px; padding: 0; border: 0; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); cursor: pointer; vertical-align: middle; }
.ant-tog svg { transition: transform .15s ease; }
.ant-tog[aria-expanded="true"] svg { transform: rotate(90deg); }
.ant-tog:hover { background: var(--line); color: var(--ink); }
.ant-tog[aria-expanded="true"] { color: var(--accent); }
.ant-tabla td, .ant-tabla th { padding-left: 8px; padding-right: 8px; }
.ant-tabla td .ant-n { display: block; font-size: 11px; line-height: 1.2; }
.ant-tabla td:first-child { min-width: 120px; }
.ant-tabla .ant-sin { font-family: inherit; font-size: 12.5px; }
.ant-det { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.ant-mov { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.ant-mov .monto { min-width: 110px; font-weight: 600; }
.ant-mov .s { color: var(--ink-2); }
/* ORQ-386: en la tabla, columnas fijas para que la cabecera quede alineada con cada transferencia */
.ant-tabla .ant-mov { display: grid; grid-template-columns: 78px 120px 120px minmax(0, 1fr); gap: 12px; }
.ant-tabla .ant-mov .monto { min-width: 0; text-align: right; }
.ant-tabla .ant-mov > * { justify-self: start; }
.ant-tabla .ant-mov > .monto { justify-self: end; }
.ant-mov-cab { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; }
.ant-mov-cab .monto { font-weight: 600; }
.card .ant-mov-cab { display: none; }
.card .ant-det { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.card .ant-mov { row-gap: 2px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.card .ant-mov:last-child { border-bottom: 0; padding-bottom: 0; }
.card .ant-mov .s { flex-basis: 100%; }
.ant-cuenta { margin-top: 8px; font-size: 13.5px; }
.ant-cuenta > div { padding: 5px 0; }
.ent-tabla td, .ent-tabla th { padding-top: 6px; padding-bottom: 6px; }
.ent-tabla tr.apagado td { color: var(--ink-3); }
.ent-tabla tr.falta td:last-child { color: var(--red); font-weight: 600; }
.ent-tabla tr.ent-det-movil { display: none; }
@media (max-width: 480px) {
  .ent-tabla .ent-det { display: none; }
  .ent-tabla tr.ent-det-movil { display: table-row; }
  .ent-tabla tr.ent-det-movil td { padding-top: 0; font-size: 12px; color: var(--ink-3); border-top: 0; white-space: normal; }
  .ent-tabla th, .ent-tabla td { padding-left: 6px; padding-right: 6px; font-size: 12.5px; }
  .ent-nombre { font-size: 16px; }
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.toolbar input, .toolbar select { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 10px; min-width: 0; }
.toolbar input[type=month] { width: 184px; }

/* ---------- tarjetas y listas ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: block; text-decoration: none; border: 1px solid transparent; }
.card-top { display: flex; align-items: center; gap: 10px; }
.card-name { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; }
.card-bottom { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.badge { flex: none; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 8px; font-family: var(--mono); }
.chip { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.blue { background: var(--blue-bg); color: var(--blue); }
.chip.red.solido { background: var(--red); color: var(--surface); } /* falta injustificada (ORQ-334) */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; display: inline-block; }
.dot.green { background: var(--green); } .dot.red { background: var(--red); } .dot.amber { background: var(--amber); } .dot.blue { background: var(--blue); }

.btn { border: 0; border-radius: 12px; padding: 12px 14px; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14.5px; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-ok { background: var(--green-bg); color: var(--green); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 10px; font-size: 13px; border-radius: 9px; }

.section { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.section h3 { margin: 0 0 12px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section h3 .spacer { flex: 1; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink-2); }
.field textarea { min-height: 70px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: -4px; margin-bottom: 10px; }
.checks { display: flex; gap: 6px; flex-wrap: wrap; }
.checks label { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 600; cursor: pointer; background: var(--surface); }
.checks input { margin: 0; }
.checks label:has(input:checked) { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 12px; font-size: 14px; }
.switch-row input { width: 20px; height: 20px; }

.row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .info { flex: 1; min-width: 0; }
.row .n { font-weight: 600; }
.row .s { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row.clickable { cursor: pointer; }
.row.clickable:hover { background: var(--surface-2); margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--ink-2); flex: none; }
.timeline { display: flex; flex-direction: column; }
.ev { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; align-items: center; }
.ev:first-child { border-top: 0; padding-top: 0; }
.ev .h { font-family: var(--mono); font-weight: 600; min-width: 48px; }
.ev .t { font-weight: 600; min-width: 60px; }
.ev .o { color: var(--ink-3); font-size: 12.5px; }
.ev .nota { color: var(--ink-2); font-size: 12.5px; flex-basis: 100%; }

/* ---------- marcar ---------- */
.reloj { text-align: center; padding: 18px 0 6px; }
.reloj .hora { font-family: var(--mono); font-size: 52px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.reloj .fecha { color: var(--ink-3); margin-top: 6px; font-size: 14px; }
.reloj .fecha::first-letter, .cal-head h2::first-letter { text-transform: uppercase; }
.marcar-btn { width: 100%; max-width: 420px; margin: 18px auto 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  aspect-ratio: 1.6; border: 0; border-radius: 28px; font-size: 24px; font-weight: 700; cursor: pointer; color: #fff; box-shadow: 0 10px 30px rgba(21,100,230,.3); transition: transform .1s; }
.marcar-btn:active { transform: scale(.98); }
.marcar-btn:disabled { opacity: .6; cursor: default; }
.marcar-btn.entrada { background: linear-gradient(160deg, #1b76ff, #1050c8); }
.marcar-btn.salida { background: linear-gradient(160deg, #17703d, #0f4d2a); box-shadow: 0 10px 30px rgba(23,112,61,.3); }
.marcar-btn small { font-size: 13px; font-weight: 500; opacity: .85; }
.marcar-btn svg { width: 44px; height: 44px; margin-bottom: 4px; }
.estado-ubic { text-align: center; font-size: 13px; color: var(--ink-3); min-height: 20px; margin-bottom: 14px; }

/* ---------- calendario ---------- */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-head h2 { flex: 1; text-align: center; margin: 0; font-size: 16px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dn { text-align: center; font-size: 11px; color: var(--ink-3); font-weight: 600; padding: 4px 0; text-transform: uppercase; }
.cal .d { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; color: var(--ink); position: relative; }
.cal .d.vacio { border: 0; background: transparent; cursor: default; }
.cal .d.on { outline: 2px solid var(--accent); }
.cal .d.hoy { border-color: var(--accent); border-width: 2px; }
.cal .d .e { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.cal .d.presente { background: var(--green-bg); color: var(--green); }
.cal .d.tarde { background: var(--amber-bg); color: var(--amber); }
.cal .d.ausente { background: var(--red-bg); color: var(--red); }
.cal .d.justificado { background: var(--blue-bg); color: var(--blue); }
.cal .d.injustificada { background: var(--red); color: var(--surface); border-color: var(--red); }
.cal .d.franco { color: var(--ink-3); background: var(--surface-2); }
.cal .d .mark { position: absolute; top: 4px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.leyenda { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); margin: 10px 0 0; }
.leyenda span { display: inline-flex; align-items: center; gap: 4px; }
.leyenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dia-detalle { margin-top: 12px; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--bg); } /* claro como el resto y como Acceso (ORQ-331) */
.login-box { width: 100%; max-width: 360px; }
.login-brand { color: var(--ink); margin-bottom: 30px; }
.login-logo { display: block; width: 210px; max-width: 70%; height: auto; margin: 0 0 18px -6px; }
.login-brand h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.login-brand p { margin: 4px 0 0; color: var(--ink-2); font-size: 13.5px; }
.login .field label { color: var(--ink-2); }
.login .field input { background: var(--surface); border-color: var(--line); color: var(--ink); padding: 13px 14px; }
.login .field input:focus { border-color: var(--ridder); box-shadow: 0 0 0 3px rgba(27,118,255,.25); }
.err { background: var(--red-bg); color: var(--red); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--ink-3); padding: 40px 20px; font-size: 14px; }
.loading { text-align: center; color: var(--ink-3); padding: 40px; }
.spin { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner { background: var(--amber-bg); color: var(--amber); font-size: 12.5px; padding: 8px 12px; border-radius: 10px; margin-bottom: 12px; font-weight: 500; }
.banner.info { background: var(--blue-bg); color: var(--blue); }
.updated { font-size: 11.5px; color: var(--ink-3); text-align: center; margin: 14px 0 4px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: .2s; z-index: 70; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--surface); width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 90dvh; overflow-y: auto; }
@media (min-width: 560px) { .modal-bg { align-items: center; } .modal { border-radius: 18px; } }
.modal h3 { margin: 0 0 14px; font-size: 17px; }
.modal-actions { display: flex; gap: 8px; margin-top: 6px; }
.modal-actions .btn { flex: 1; }

/* ---------- tablas ---------- */
.tabla-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabla th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; padding: 11px 10px; background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.tabla td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tabla td.wrap { white-space: normal; }
.tabla td.r, .tabla th.r { text-align: right; }
.tabla tfoot td { font-weight: 700; background: var(--surface-2); }

/* ---------- escritorio: panel con barra lateral ---------- */
@media (min-width: 1024px) {
  body { font-size: 14.5px; }
  .shell { max-width: none; padding-bottom: 0; display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: start; }
  .nav { position: sticky; top: 0; bottom: auto; left: auto; right: auto; height: 100dvh; grid-column: 1; grid-row: 1 / span 2; background: var(--brand); border: 0; padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 22px; }
  .nav .side-brand { display: flex; flex: none; padding: 0 6px; }
  .nav-inner { max-width: none; flex-direction: column; gap: 2px; flex: 1; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 12px; font-size: 14px; color: var(--brand-ink-2); border-radius: 10px; }
  .nav a svg { width: 19px; height: 19px; }
  .nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
  .nav a.on { background: var(--accent); color: var(--accent-ink); }
  .nav a.on svg { color: var(--accent-ink); }
  .side-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--brand-line); color: #fff; }
  .side-user .avatar { background: var(--brand-raised); color: var(--brand-ink-2); }
  .side-user-txt { min-width: 0; flex: 1; }
  .side-user b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-user span { display: block; font-size: 11.5px; color: var(--brand-ink-3); }
  .gear-top { display: none; }
  .gear-side { display: inline-flex; flex: none; width: 34px; height: 34px; background: transparent; color: var(--brand-ink-2); border: 0; }
  .gear-side:hover { background: rgba(255,255,255,.08); color: #fff; }
  .gear-side.on { color: #fff; background: rgba(255,255,255,.1); }
  .topbar { display: none; } /* en la computadora el selector va arriba de la barra lateral */
  main { grid-column: 2; grid-row: 1 / span 2; padding: 30px 32px 48px; width: 100%; min-width: 0; }
  .page-head { margin: 0 0 16px; }
  .page-head h1 { font-size: 26px; letter-spacing: -.02em; }
  .page-head .sub { font-size: 13.5px; }
  #toast { bottom: 28px; }
  .kpis { gap: 14px; margin-bottom: 18px; }
  .kpi { padding: 16px 18px; }
  .kpi .v { font-size: 26px; }
  .tabs { flex-wrap: wrap; overflow: visible; margin: 0 0 14px; padding: 0; }
  /* pantalla completa: nada se centra en una columna angosta; lo que es lista se reparte en columnas según el ancho */
  .narrow { max-width: none; }
  .narrow > .list, .narrow .list:not([style]) { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; align-items: start; }
  .narrow form .field, .narrow .field { max-width: 720px; }
  /* calendario a la izquierda, detalle del día a la derecha */
  .narrow:has(> .section > .cal) { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
  /* tablas: ocupan todo el ancho y las celdas de texto envuelven en vez de desplazarse */
  .tabla td { white-space: normal; }
  .tabla td.num, .tabla td:last-child, .tabla td .num { white-space: nowrap; }
  .tabla td.reg-det { white-space: normal; min-width: 260px; } /* el detalle del Registro envuelve (ORQ-385) */
  .two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .modal { max-width: 600px; }
  /* marcar: reloj, cámara y botón a la izquierda; las marcaciones de hoy a la derecha */
  .marcar-wrap { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); column-gap: 32px; align-items: start; }
  .marcar-wrap > * { grid-column: 1; }
  .marcar-wrap > .section { grid-column: 2; grid-row: 1 / span 6; margin-top: 18px; }
  .marcar-wrap > .section:only-child { grid-column: 1 / -1; }
  .cal .d { aspect-ratio: auto; height: 72px; font-size: 14px; }
}
@media (max-width: 1023px) { .gear-side { display: none; } }

/* ---------- selfie ---------- */
.selfie-box { position: relative; width: 100%; max-width: 420px; margin: 6px auto 0; aspect-ratio: 1; border-radius: 28px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.selfie-box video, .selfie-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.selfie-box video { transform: scaleX(-1); } /* espejo, como la cámara del celular */
.selfie-msg { position: absolute; inset: auto 16px 16px; text-align: center; font-size: 13px; color: var(--ink-2); background: var(--surface); padding: 8px 10px; border-radius: 12px; }
.selfie-mini { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex: none; cursor: zoom-in; background: var(--surface-2); }
.selfie-grande { width: 100%; max-height: 70dvh; object-fit: contain; border-radius: 14px; background: var(--surface-2); }
.marcar-btn { margin-top: 12px; aspect-ratio: auto; padding: 16px; }
.ev > svg { width: 18px; height: 18px; flex: none; color: var(--ink-3); }
.selfie-box { max-height: 36dvh; }
.local { padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.local .row { align-items: flex-end; gap: 10px; }
.feriado { align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.feriado .field { margin: 0; }
.feriado .field + .field { min-width: 180px; }
a.chip { text-decoration: none; }
a.chip:hover { text-decoration: underline; }
.ev-del { margin-left: auto; border: 0; background: transparent; color: var(--ink-3); border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 500; cursor: pointer; }
.ev-del:hover { background: var(--red-bg); color: var(--red); }

/* confirmación después de marcar (la cámara queda cerrada hasta la próxima marcación) */
.hecho { text-align: center; padding: 28px 16px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hecho svg { width: 64px; height: 64px; color: var(--green); }
.hecho.salida svg { color: var(--accent); }
.hecho-t { font-size: 22px; font-weight: 700; }
.hecho-h { font-family: var(--mono); font-size: 40px; font-weight: 600; letter-spacing: -.02em; }

.ev .disp { flex-basis: 100%; font-size: 11.5px; }
.ev { flex-wrap: wrap; }

/* ---------- retoques de la revisión de UI ---------- */
.toolbar .search input { padding-left: 40px; }  /* la lupa no pisa el texto de ayuda */
@media (min-width: 720px) { .solo-movil { display: none !important; } }
@media (max-width: 719px) { .solo-escritorio { display: none !important; } }
/* menú: "Permisos" en la barra del celular, "Justificaciones" en la barra lateral; número de pendientes */
.nav a { position: relative; }
.nav .lbl-l { display: none; }
.nav-cuenta { display: flex; }
.nav-badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; font-style: normal; line-height: 17px; text-align: center; }
@media (min-width: 1024px) {
  .nav .lbl-l { display: inline; } .nav .lbl-c { display: none; }
  .nav a.nav-cuenta { display: none; }
  .nav-badge { position: static; margin-left: auto; }
}
/* hoy: dos renglones fijos por persona y los avisos aparte */
.row .s2 b { font-weight: 600; color: var(--ink-2); }
.row .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.filtro-activo { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); margin: -4px 0 12px; }
.filtro-activo b { color: var(--ink); }
/* confirmación al marcar */
.hecho-x { font-size: 14px; color: var(--ink-2); }
/* reportes */
.kpis.areas { grid-template-columns: 1fr; }
@media (min-width: 560px) { .kpis.areas { grid-template-columns: repeat(3, 1fr); } }
.trio { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 6px; font-size: 13.5px; }
.trio span { white-space: nowrap; }
.trio b { font-family: var(--mono); font-size: 17px; font-weight: 600; }
.cero { opacity: .4; }
.tabla th.ordenable { cursor: pointer; user-select: none; }
.tabla th.ordenable:hover, .tabla th.ordenable.on { color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 4px; margin-top: 10px; text-align: center; }
.stats b { display: block; font-family: var(--mono); font-size: 16px; font-weight: 600; }
.stats span { font-size: 10.5px; color: var(--ink-3); }
a.card { color: inherit; }
.row .s2 { display: block; }
.row .s2 b { white-space: nowrap; }

/* Rol revisor (solo lectura): no se muestran los botones que cambian algo. El servidor igual rechaza toda escritura. */
body.solo-lectura :is(.btn-primary, .btn-danger, .btn-ok, .ev-del, #importar, #pedirj, #agregar, #agregar-feriado, #sugerir-feriados, #pw, [data-quitar], [data-edit], [data-liberar]) { display: none !important; }

/* ---------- clasificar una falta (ORQ-334) ---------- */
.opciones-col { display: grid; gap: 8px; margin-bottom: 14px; }
.opcion { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); }
.opcion:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(21,100,230,.18); }
.opcion input { margin: 3px 0 0; accent-color: var(--accent); }
.opcion span { display: flex; flex-direction: column; gap: 1px; }
.opcion small { color: var(--ink-3); font-size: 12.5px; }

/* ---------- perfil: sueldos y adelantos (ORQ-346) ---------- */
.perfil-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.perfil-top .info { flex: 1; min-width: 160px; }
.perfil-top .n { font-weight: 700; font-size: 16px; }
.perfil-top .s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.sueldo-actual { text-align: right; }
.sueldo-actual .l { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; }
.sueldo-actual .v { font-size: 22px; font-weight: 600; font-family: var(--mono); margin-top: 2px; white-space: nowrap; }
.sueldo-actual .s { font-size: 12px; color: var(--ink-3); }
@media (max-width: 480px) { .sueldo-actual { text-align: left; width: 100%; padding-top: 10px; border-top: 1px solid var(--line); } }
.perfil-acc { display: flex; gap: 8px; margin-bottom: 12px; }
.perfil-acc .btn { flex: 1; }
.mes-nav { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.mes-nav b { min-width: 118px; text-align: center; white-space: nowrap; }
.h-mes { flex-wrap: wrap; row-gap: 8px; }
@media (max-width: 480px) { .h-mes .spacer { display: none; } .h-mes .mes-nav { width: 100%; justify-content: space-between; } }
.cuenta-mes > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.cuenta-mes > div:first-child { border-top: 0; }
.cuenta-mes b { font-weight: 600; white-space: nowrap; }
.cuenta-mes .total { border-top: 2px solid var(--ink); margin-top: 2px; font-weight: 700; }
.cuenta-mes .total b { font-size: 18px; font-weight: 700; }
.cuenta-mes .total.neg b { color: var(--red); }
.sub-h { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; margin: 14px 0 2px; }
.row.mov { align-items: flex-start; }
.row.mov .monto { font-weight: 600; }
.row.mov .nota { color: var(--ink-2); }
.row.mov.anulado .monto, .row.mov.anulado .nota { text-decoration: line-through; color: var(--ink-3); }
.mov-acc { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; max-width: 60%; }
@media (max-width: 480px) { .row.mov { flex-wrap: wrap; } .mov-acc { width: 100%; justify-content: flex-end; } }

/* ORQ-349: en Personal, la fila o la tarjeta abre el perfil */
.fila-link { cursor: pointer; }
.tabla tr.fila-link:hover td { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.card.fila-link:hover { border-color: var(--line); }
.nombre-link { color: inherit; text-decoration: none; }
.nombre-link:hover, .nombre-link:focus-visible { text-decoration: underline; }

/* ORQ-357: devoluciones (no se descuentan) y la vista previa del banco */
.cuenta-mes .aparte { color: var(--ink-3); font-size: 13px; }
.cuenta-mes .aparte b { font-weight: 500; }
.banco-cuenta { margin-bottom: 10px; }
.banco-cuenta span { font-size: 13.5px; }
.banco-det { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.banco-det summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 4px 0; }
.banco-det .row.mov:last-child { border-bottom: 0; }
.elegir-banco { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.elegir-banco select { flex: 1; min-width: 160px; }

/* ORQ-365: tipos de cada transferencia (como Finanzas de Cobranzas) y la pantalla del mes */
.chip.tachado { text-decoration: line-through; }
.chip.violeta { background: color-mix(in srgb, #7c3aed 14%, var(--surface)); color: color-mix(in srgb, #7c3aed 75%, var(--ink)); }
.banco-tot .tot.t-sueldo span { color: color-mix(in srgb, #7c3aed 75%, var(--ink)); }
/* ORQ-374: comisión (se suma, como el bono) */
.chip.teal { background: color-mix(in srgb, #0d9488 14%, var(--surface)); color: color-mix(in srgb, #0d9488 80%, var(--ink)); }
.banco-tot .tot.t-comision span { color: color-mix(in srgb, #0d9488 80%, var(--ink)); }
.cuenta-mes .aparte.aviso { color: var(--amber); }
.sel-tipo { width: auto; min-width: 130px; padding: 5px 28px 5px 10px; font-size: 13px; height: auto; }
.banco-tot { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin: 4px 0 10px; }
.banco-tot .tot { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.banco-tot .tot span { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.banco-tot .tot b { font-size: 20px; }
.banco-tot .tot small { font-size: 12px; color: var(--ink-3); }
.banco-tot .tot.on { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.banco-tot .t-anticipo span { color: var(--red); }
.banco-tot .t-bono span { color: var(--green); }
.banco-tot .t-devolucion span { color: var(--blue); }
.banco-tot .t-sin_clasificar span { color: var(--amber); }
.banco-lote { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; margin-bottom: 12px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--blue); box-shadow: 0 6px 18px rgb(0 0 0 / .08); }
.banco-lote > span { margin-right: 4px; font-size: 14px; }
.banco-todas { display: flex; gap: 8px; align-items: center; padding: 2px 0 8px; color: var(--ink-2); }
.banco-fila { gap: 10px; }
.banco-sel { flex: none; width: 20px; padding-top: 2px; }
.banco-sel input { width: 18px; height: 18px; }
.banco-fila .n a { color: inherit; font-weight: 600; text-decoration: none; }
.banco-fila .n a:hover { text-decoration: underline; }
.banco-der { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.reclas-lista { max-height: 46vh; overflow: auto; border-top: 1px solid var(--line); margin-bottom: 4px; }
@media (max-width: 480px) {
  .banco-tot { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .banco-tot .tot small { font-size: 11px; }
  .banco-tot .tot { padding: 8px; } .banco-tot .tot b { font-size: 17px; }
  .row.mov.banco-fila { flex-wrap: nowrap; }
  .banco-der .sel-tipo { min-width: 112px; }
  /* «¿A quién?» (ORQ-378): monto y tipo arriba, en una línea; abajo el texto y la elección a todo el ancho */
  .row.mov.banco-fila.pendiente { flex-wrap: wrap; }
  .banco-fila.pendiente .banco-sel { display: none; }
  .banco-fila.pendiente .banco-der { order: -1; flex: 1 1 100%; flex-direction: row; justify-content: space-between; align-items: center; }
  .banco-fila.pendiente .info { flex: 1 1 100%; }
  .banco-fila.pendiente .elegir-banco select { flex: 1 1 100%; }
}

/* ORQ-369: perfil como Finanzas — tarjetas del mes que filtran la lista */
.banco-tot.perfil-tot { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 2px; }
@media (max-width: 480px) { .banco-tot.perfil-tot { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.aviso-txt { color: var(--amber); }

/* ---------- Personal: lista sin botones y ficha de cada persona (ORQ-387, como Acceso ORQ-237) ---------- */
a.card.persona-card { display: block; color: inherit; text-decoration: none; }
a.card.persona-card:focus-visible, .tabla tr.fila-link a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.persona-card .card-top { align-items: center; }
.pf-chev { color: var(--ink-3); font-size: 20px; line-height: 1; padding-left: 6px; }
.tabla td.pf-chev { width: 18px; text-align: right; }
.tabla tr.fila-link:hover td.pf-chev, a.card.persona-card:hover .pf-chev { color: var(--accent); }
.ficha { max-width: none; } /* como el resto de Asistencias: usa todo el ancho */
.ficha-head { display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; }
.avatar.grande { width: 56px; height: 56px; font-size: 18px; border-radius: 14px; }
.ficha-head.baja .avatar { opacity: .6; }
.ficha-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ficha-id h2 { margin: 0; font-size: 21px; line-height: 1.25; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ficha-id .s { font-size: 13px; color: var(--ink-3); }
.ficha-id .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ficha-cerrar { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: 16px; background: var(--surface-2); }
.ficha-cerrar:hover { color: var(--ink); }
.ficha-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; }
.ficha-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; min-height: 40px; border-radius: 9px; color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.ficha-nav a:hover { color: var(--ink); background: var(--surface-2); }
.ficha-nav a[aria-current="page"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.ficha-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ficha-cuerpo { min-width: 0; }
.ficha-cuerpo .narrow { max-width: none; }
.datos-lista { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 16px; margin: 0 0 6px; }
.datos-lista dt { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; margin-bottom: 2px; }
.datos-lista dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .ficha-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ficha-nav::-webkit-scrollbar { display: none; }
  .ficha-nav a { flex: none; }
  .ficha-head { padding: 14px; }
  .avatar.grande { width: 48px; height: 48px; font-size: 16px; border-radius: 12px; }
  .ficha-id h2 { font-size: 19px; }
}
@media (min-width: 1440px) {
  .ficha-main { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
  .ficha-nav { flex-direction: column; flex-wrap: nowrap; position: sticky; top: 24px; }
}
/* en la ficha el nombre ya está arriba: del perfil queda solo el sueldo actual */
.ficha-cuerpo .perfil-top > .avatar, .ficha-cuerpo .perfil-top > .info { display: none; }
.ficha-cuerpo .perfil-top { justify-content: flex-start; }
.ficha-cuerpo .perfil-top .sueldo-actual { text-align: left; margin-left: 0; }
