/*
 * Panel web de Empleato. El rediseño «Noche» de la app (docs/diseno-noche.md) puesto en el ordenador:
 * lateral azul noche en los dos temas, contenido claro por defecto y oscuro para quien lo tiene en el
 * sistema o lo elige (tema.js). Sin recursos de fuera: las fuentes están en fuentes/.
 *
 * Índice: 1 fuentes · 2 colores · 3 base · 4 estructura · 5 lateral · 6 texto · 7 controles ·
 * 8 tablas · 9 piezas · 10 páginas · 11 móvil · 12 movimiento · 13 impresión
 */

/* ---------- 1. Fuentes (Poppins: títulos y cifras; Open Sans: texto) ---------- */
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("fuentes/poppins-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("fuentes/poppins-500-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("fuentes/poppins-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("fuentes/poppins-600-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("fuentes/poppins-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("fuentes/poppins-700-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Open Sans"; font-weight: 400 700; font-display: swap; src: url("fuentes/open-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Open Sans"; font-weight: 400 700; font-display: swap; src: url("fuentes/open-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- 2. Colores (los de la app: Resources/Styles/Colors.xaml) ---------- */
:root {
  --fondo: #F4F6FA; --superficie: #FFFFFF; --superficie-2: #F1F5F9; --borde: #E2E8F0; --borde-fuerte: #CBD5E1;
  --texto: #0F172A; --texto-2: #475569; --texto-3: #5B6B80;
  --azul: #2563EB; --azul-fuerte: #1D4ED8; --enlace: #1D4ED8; --seleccion: rgb(37 99 235 / .2);
  /* El naranja, solo para la acción principal de la pantalla. */
  --principal: #C2410C; --principal-fuerte: #9A3412; --sobre-principal: #FFFFFF; --naranja-vivo: #EA580C;
  --verde-azulado: #0D9488;
  --exito: #047857; --exito-fondo: #ECFDF5; --exito-borde: #A7F3D0;
  --aviso: #A16207; --aviso-fondo: #FEFCE8; --aviso-borde: #FDE68A;
  --error: #B91C1C; --error-fondo: #FEF2F2; --error-borde: #FECACA;
  --info: #1D4ED8; --info-fondo: #EFF6FF; --info-borde: #BFDBFE;
  --tramo: #2563EB;
  --noche: #0F172A; --noche-2: #1B2538; --noche-borde: #1F2A3D; --noche-texto: #CBD5E1; --noche-texto-2: #94A3B8;
  --sombra: 0 1px 2px rgb(15 23 42 / .05), 0 6px 16px -8px rgb(15 23 42 / .10);
  --sombra-alta: 0 2px 4px rgb(15 23 42 / .06), 0 18px 40px -16px rgb(15 23 42 / .22);
  --radio: 14px; --radio-control: 10px;
  --salida: cubic-bezier(0.23, 1, 0.32, 1); --cajon: cubic-bezier(0.32, 0.72, 0, 1);
  --titulos: "Poppins", "Open Sans", system-ui, sans-serif;
  --flecha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --i-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-18 0a9 9 0 1 1 18 0M12 16v-4M12 8h.01'/%3E%3C/svg%3E");
  --i-hecho: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-18 0a9 9 0 1 1 18 0M9 12l2 2 4-4'/%3E%3C/svg%3E");
  --i-error: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9L1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0zM12 9v4M12 17h.01'/%3E%3C/svg%3E");
  --i-descargar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3'/%3E%3C/svg%3E");
  color-scheme: light;
}
/* El tema oscuro: el del sistema, salvo que se haya elegido el claro, o el elegido. Los dos bloques son iguales. */
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --fondo: #0B1120; --superficie: #111A2C; --superficie-2: #18233A; --borde: #1F2A3D; --borde-fuerte: #334155;
    --texto: #F8FAFC; --texto-2: #CBD5E1; --texto-3: #94A3B8;
    --azul: #3B82F6; --azul-fuerte: #2563EB; --enlace: #93C5FD; --seleccion: rgb(96 165 250 / .32);
    --principal: #F97316; --principal-fuerte: #FB923C; --sobre-principal: #1C0A00; --naranja-vivo: #FB923C;
    --verde-azulado: #2DD4BF;
    --exito: #34D399; --exito-fondo: rgb(52 211 153 / .12); --exito-borde: rgb(52 211 153 / .28);
    --aviso: #FBBF24; --aviso-fondo: rgb(251 191 36 / .12); --aviso-borde: rgb(251 191 36 / .28);
    --error: #F87171; --error-fondo: rgb(248 113 113 / .12); --error-borde: rgb(248 113 113 / .3);
    --info: #93C5FD; --info-fondo: rgb(96 165 250 / .12); --info-borde: rgb(96 165 250 / .28);
    --tramo: #60A5FA; --avatar-fondo: 30%; --avatar-tinta: 42%;
    --sombra: 0 1px 2px rgb(0 0 0 / .3); --sombra-alta: 0 18px 40px -16px rgb(0 0 0 / .7);
    --flecha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
:root[data-tema="oscuro"] {
  --fondo: #0B1120; --superficie: #111A2C; --superficie-2: #18233A; --borde: #1F2A3D; --borde-fuerte: #334155;
  --texto: #F8FAFC; --texto-2: #CBD5E1; --texto-3: #94A3B8;
  --azul: #3B82F6; --azul-fuerte: #2563EB; --enlace: #93C5FD; --seleccion: rgb(96 165 250 / .32);
  --principal: #F97316; --principal-fuerte: #FB923C; --sobre-principal: #1C0A00; --naranja-vivo: #FB923C;
  --verde-azulado: #2DD4BF;
  --exito: #34D399; --exito-fondo: rgb(52 211 153 / .12); --exito-borde: rgb(52 211 153 / .28);
  --aviso: #FBBF24; --aviso-fondo: rgb(251 191 36 / .12); --aviso-borde: rgb(251 191 36 / .28);
  --error: #F87171; --error-fondo: rgb(248 113 113 / .12); --error-borde: rgb(248 113 113 / .3);
  --info: #93C5FD; --info-fondo: rgb(96 165 250 / .12); --info-borde: rgb(96 165 250 / .28);
  --tramo: #60A5FA; --avatar-fondo: 30%; --avatar-tinta: 42%;
  --sombra: 0 1px 2px rgb(0 0 0 / .3); --sombra-alta: 0 18px 40px -16px rgb(0 0 0 / .7);
  --flecha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  color-scheme: dark;
}

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--borde-fuerte) transparent; }
body { margin: 0; font: 400 15px/1.55 "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texto); background: var(--fondo); caret-color: var(--azul); -webkit-font-smoothing: antialiased; }
::selection { background: var(--seleccion); }
a { color: var(--enlace); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }
.icono { flex: none; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.saltar { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; border-radius: var(--radio-control); background: var(--superficie); color: var(--texto); font-weight: 600; }
.saltar:focus { top: 12px; box-shadow: var(--sombra-alta); }

/* ---------- 4. Estructura ---------- */
body.con-lateral { display: grid; grid-template-columns: 256px minmax(0, 1fr); }
.pagina { min-width: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 32px 16px; }
footer { width: 100%; max-width: 1280px; margin: 0 auto; padding: 16px 32px 28px; color: var(--texto-3); font-size: 13px; }
.cabecera { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; }
.cabecera h1 { margin: 0; }
.cabecera-acciones { margin-left: auto; display: flex; gap: 10px; }
.menu-interruptor, .boton-menu, .velo { display: none; }
.barra { display: flex; align-items: center; padding: 14px 32px; background: var(--noche); }

/* Entrar: la tarjeta sola, centrada. */
body.acceso .barra { background: none; justify-content: center; padding: clamp(40px, 12vh, 120px) 24px 0; }
body.acceso .barra .marca { color: var(--texto); font-size: 24px; }
body.acceso .barra .marca img { width: 44px; height: 44px; border-radius: 12px; }
body.acceso main { max-width: 440px; padding: 28px 24px 16px; }
body.acceso .cabecera { justify-content: center; }
body.acceso .cabecera h1 { font-size: 20px; }
body.acceso .estrecha { max-width: none; padding: 24px; }
body.acceso .estrecha .principal { width: 100%; justify-content: center; min-height: 44px; }
body.acceso footer { max-width: 440px; text-align: center; }

/* ---------- 5. Lateral ---------- */
.lateral { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 16px 12px 0; overflow-y: auto; background: var(--noche); color: var(--noche-texto); scrollbar-color: #334155 transparent; scrollbar-width: thin; }
.marca { display: inline-flex; align-items: center; gap: 10px; font: 600 19px/1 var(--titulos); letter-spacing: -0.01em; color: #fff; text-decoration: none; }
.marca img { border-radius: 9px; }
.lateral .marca { padding: 2px 8px 12px; border-radius: 10px; }
.lateral nav { flex: 1; }
.lateral .grupo { margin: 12px 10px 4px; font-size: 12px; font-weight: 600; color: var(--noche-texto-2); }
.lateral ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.lateral nav a { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 5px 10px; border-radius: 9px; color: var(--noche-texto); font-size: 14px; font-weight: 600; text-decoration: none; transition: background-color 150ms ease, color 150ms ease; }
.lateral nav a .icono { color: var(--noche-texto-2); transition: color 150ms ease; }
.lateral nav a .texto { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lateral nav a[aria-current="page"] { background: rgb(96 165 250 / .16); color: #fff; }
.lateral nav a[aria-current="page"] .icono { color: #93C5FD; }
.lateral :focus-visible { outline-color: #93C5FD; }
.cuenta { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: rgb(251 191 36 / .16); color: #FCD34D; font: 600 12px/1.5 var(--titulos); font-variant-numeric: tabular-nums; text-align: center; }
.quien { position: sticky; bottom: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; margin: 12px -12px 0; padding: 12px 20px 14px; border-top: 1px solid var(--noche-borde); background: var(--noche); }
.quien .datos { margin: 0; display: grid; font-size: 12.5px; line-height: 1.35; color: var(--noche-texto-2); }
.quien .datos strong { color: #fff; font-size: 13.5px; font-weight: 600; }
.quien .datos strong, .quien .datos span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quien-acciones { grid-column: 1 / -1; display: flex; gap: 6px; }
.quien-acciones form { margin: 0; flex: 1; display: flex; }
.boton-lateral { flex: 1; min-height: 34px; padding: 0 10px; justify-content: center; gap: 6px; border: 1px solid var(--noche-borde); border-radius: 9px; background: transparent; color: var(--noche-texto); font-size: 13px; }

/* ---------- 6. Texto ---------- */
h1, h2, h3 { font-family: var(--titulos); font-weight: 600; letter-spacing: -0.012em; text-wrap: balance; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { margin: 30px 0 10px; font-size: 17px; line-height: 1.3; }
h3 { margin: 18px 0 8px; font-size: 15px; line-height: 1.35; }
p { margin: 0 0 12px; }
main > p:not([class]) { max-width: 76ch; color: var(--texto-2); }
.nota { color: var(--texto-2); font-size: 13.5px; }
.subtitulo { margin: -10px 0 20px; color: var(--texto-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.migas { margin: -8px 0 6px; font-size: 13.5px; }
.migas a { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px 4px 2px; border-radius: 8px; color: var(--texto-2); font-weight: 600; text-decoration: none; }
blockquote { margin: 10px 0; padding: 10px 14px; border-radius: var(--radio-control); background: var(--superficie-2); }
.lista { margin: 6px 0 0; padding-left: 18px; }

/* ---------- 7. Controles ---------- */
label { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; font-size: 13.5px; font-weight: 600; }
label .nota { font-weight: 400; }
input, select, textarea { font: 400 15px/1.4 "Open Sans", system-ui, sans-serif; color: var(--texto); }
input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea { min-height: 40px; padding: 8px 12px; border: 1px solid var(--borde-fuerte); border-radius: var(--radio-control); background: var(--superficie); transition: border-color 150ms ease, box-shadow 150ms ease; }
input:not([type="checkbox"], [type="radio"], [type="file"]):focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px var(--seleccion); }
select { appearance: none; padding-right: 36px; background-image: var(--flecha); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
textarea { resize: vertical; }
::placeholder { color: var(--texto-3); opacity: 1; }
input:disabled, select:disabled, textarea:disabled { background-color: var(--superficie-2); color: var(--texto-2); cursor: not-allowed; }
input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--azul); }
input[type="file"] { font-size: 13.5px; }
input[type="file"]::file-selector-button { margin-right: 10px; min-height: 34px; padding: 0 12px; border: 1px solid var(--borde-fuerte); border-radius: 8px; background: var(--superficie); color: var(--texto); font: 600 13px "Open Sans", sans-serif; cursor: pointer; }
label.casilla { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; font-size: 14.5px; }
.estrecha label > input:not([type="checkbox"]), .estrecha label > select, .estrecha label > textarea { width: 100%; }

button, a.boton { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid var(--borde-fuerte); border-radius: var(--radio-control); background: var(--superficie); color: var(--texto); font: 600 14px/1.2 "Open Sans", system-ui, sans-serif; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 140ms var(--salida); }
button:active, a.boton:active { transform: scale(0.97); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.principal, a.boton.principal { border-color: var(--principal); background: var(--principal); color: var(--sobre-principal); }
.azul, a.boton.azul { border-color: var(--azul-fuerte); background: var(--azul-fuerte); color: #fff; }
.peligro { border-color: var(--error-borde); color: var(--error); }
.pequeno, a.boton.pequeno { min-height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; }
button.enlace { min-height: 0; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--enlace); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button.enlace:active { transform: none; }
.volver { color: var(--texto-2); font-weight: 600; font-size: 14px; }

.filtros { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--superficie); }
.filtros label { margin: 0; }
.acciones { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 0 12px; }
.tarjeta .acciones, td .acciones { margin: 0; }
.acciones form { margin: 0; }
.acciones input { max-width: 240px; }
/* El motivo va con «Rechazar»: el grupo se separa de «Aceptar» y el campo ocupa lo que haya. */
.rechazo { display: flex; flex: 1; align-items: flex-end; gap: 8px; margin-left: 24px; padding-left: 24px; border-left: 1px solid var(--borde); }
.rechazo label { flex: 1; margin: 0; }
.rechazo input { width: 100%; max-width: none; }
.en-linea { display: inline; margin: 0; }
.periodo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; }
.periodo strong { font: 600 16px var(--titulos); margin: 0 6px; }
.descargas { margin: 0 0 12px; color: var(--texto-2); font-size: 14px; }
.descargas a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }
.descargas a::before { content: ""; width: 15px; height: 15px; background: currentColor; -webkit-mask: var(--i-descargar) center / contain no-repeat; mask: var(--i-descargar) center / contain no-repeat; }
.enlace-copiar { width: 100%; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; letter-spacing: .01em; }

/* ---------- 8. Tablas ---------- */
table { width: 100%; margin: 0 0 16px; border: 1px solid var(--borde); border-radius: var(--radio); border-collapse: separate; border-spacing: 0; background: var(--superficie); font-size: 14px; box-shadow: var(--sombra); }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--borde); text-align: left; vertical-align: middle; }
tbody tr:last-child > * { border-bottom: 0; }
thead th { position: sticky; top: 0; z-index: 1; background: var(--superficie-2); color: var(--texto-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
thead th:first-child { border-top-left-radius: calc(var(--radio) - 1px); }
thead th:last-child { border-top-right-radius: calc(var(--radio) - 1px); }
tbody th { font-weight: 600; }
tbody tr { transition: background-color 120ms ease; }
td a { font-weight: 600; text-decoration: none; }
td input, td select { min-height: 34px; padding-block: 5px; font-size: 14px; }
/* Una columna de texto libre (un motivo) no se queda en una tira estrecha. */
th.texto { min-width: 260px; }
td.fecha, .consultas td:last-child { white-space: nowrap; }
tr.apagada > * { color: var(--texto-3); }
tr.apagada .nombre, tr.apagada .avatar { opacity: .7; }
/* La acción de la fila no se sale de la tabla: se queda a la derecha mientras el resto se desplaza. */
.fija { position: sticky; right: 0; background: var(--superficie); box-shadow: -1px 0 0 var(--borde); }
thead .fija { background: var(--superficie-2); }
.si { display: inline-flex; color: var(--exito); }
.no { color: var(--texto-3); }

/* ---------- 9. Piezas ---------- */
.tarjeta { margin: 0 0 16px; padding: 18px 20px; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--superficie); box-shadow: var(--sombra); }
.tarjeta > :first-child, .tarjeta > h2:first-of-type, .tarjeta > h3:first-of-type { margin-top: 0; }
.tarjeta > :last-child { margin-bottom: 0; }
.tarjeta.destacada { border-color: var(--info-borde); background: var(--info-fondo); }
.estrecha { max-width: 560px; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.rejilla.arriba { align-items: start; }
.rejilla > .tarjeta { margin: 0; }
.rejilla { margin: 0 0 16px; }

/* El aviso es un párrafo o una caja (p.aviso, div.aviso): «aviso» es también un tono de chip y de punto. */
:is(p, div).aviso { position: relative; max-width: none; margin: 0 0 16px; padding: 12px 16px 12px 44px; border: 1px solid var(--info-borde); border-radius: 12px; background: var(--info-fondo); color: var(--texto); }
:is(p, div).aviso::before { content: ""; position: absolute; left: 14px; top: 14px; width: 18px; height: 18px; background: var(--info); -webkit-mask: var(--i-info) center / contain no-repeat; mask: var(--i-info) center / contain no-repeat; }
:is(p, div).aviso.exito { border-color: var(--exito-borde); background: var(--exito-fondo); }
:is(p, div).aviso.exito::before { background: var(--exito); -webkit-mask-image: var(--i-hecho); mask-image: var(--i-hecho); }
:is(p, div).aviso.error { border-color: var(--error-borde); background: var(--error-fondo); }
:is(p, div).aviso.error::before { background: var(--error); -webkit-mask-image: var(--i-error); mask-image: var(--i-error); }

.chip { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; padding: 2px 9px; border: 1px solid var(--borde); border-radius: 999px; background: var(--superficie-2); color: var(--texto-2); font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.chip.exito::before, .chip.aviso::before, .chip.error::before, .chip.info::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.exito { border-color: var(--exito-borde); background: var(--exito-fondo); color: var(--exito); }
.chip.aviso { border-color: var(--aviso-borde); background: var(--aviso-fondo); color: var(--aviso); }
.chip.error { border-color: var(--error-borde); background: var(--error-fondo); color: var(--error); }
.chip.info { border-color: var(--info-borde); background: var(--info-fondo); color: var(--info); }

.persona { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.quien-es { display: grid; min-width: 0; line-height: 1.3; }
.persona .nombre { font-weight: 600; color: var(--texto); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.persona a.nombre { color: var(--texto); text-decoration-color: transparent; transition: color 150ms ease, text-decoration-color 150ms ease; }
.persona .detalle { color: var(--texto-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.punto { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--texto-3); vertical-align: 1px; }
.punto.exito { background: var(--exito); } .punto.aviso { background: var(--aviso); } .punto.info { background: var(--info); } .punto.error { background: var(--error); }
.avatar { --tono: #2563EB; flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #DBEAFE; background: color-mix(in srgb, var(--tono) var(--avatar-fondo, 16%), var(--superficie)); color: #1E3A8A; color: color-mix(in srgb, var(--tono) var(--avatar-tinta, 62%), var(--texto)); font: 600 12px/1 var(--titulos); letter-spacing: .01em; }
.avatar.t2 { --tono: #0D9488; } .avatar.t3 { --tono: #EA580C; } .avatar.t4 { --tono: #D97706; } .avatar.t5 { --tono: #059669; } .avatar.t6 { --tono: #64748B; }
.lateral .avatar { background: #1E3A8A; color: #DBEAFE; }

/* ---------- 10. Páginas ---------- */
/* Hoy */
.resumen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 16px; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--superficie); box-shadow: var(--sombra); }
.resumen > div { display: grid; gap: 2px; padding: 16px 20px; border-left: 1px solid var(--borde); }
.resumen > div:first-child { border-left: 0; }
.resumen .cifra { font: 600 30px/1.1 var(--titulos); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.resumen .rotulo { color: var(--texto-2); font-size: 13.5px; }
.hoy { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.hoy > .tarjeta { margin: 0; }
.hoy h2 { margin: 0 0 14px; }
.escala, .lineas li { display: grid; grid-template-columns: minmax(190px, 270px) minmax(0, 1fr) 52px; gap: 14px; align-items: center; }
.escala { margin: 0 0 6px; color: var(--texto-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.escala .horas { grid-column: 2; display: flex; justify-content: space-between; }
.lineas { margin: 0; padding: 0; list-style: none; }
.lineas li { padding: 9px 0; border-top: 1px solid var(--borde); }
.lineas .total { font: 600 14px var(--titulos); text-align: right; font-variant-numeric: tabular-nums; }
.lineas li.sin-tramos .total, .lineas li.sin-tramos:not(.sin_fichar) .nombre { color: var(--texto-3); }
.linea-tiempo { display: block; width: 100%; height: 22px; }
.linea-tiempo .pista { fill: var(--superficie-2); }
.linea-tiempo .marca-hora { stroke: var(--borde-fuerte); stroke-width: 1; stroke-dasharray: 2 3; }
.linea-tiempo .tramo { fill: var(--tramo); }
.linea-tiempo .tramo.teletrabajo { fill: var(--verde-azulado); }
.linea-tiempo .tramo.corregido { stroke: var(--naranja-vivo); stroke-width: 2; vector-effect: non-scaling-stroke; }
.linea-tiempo .ahora { stroke: var(--texto); stroke-width: 2; }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--borde); color: var(--texto-2); font-size: 12.5px; list-style: none; }
.leyenda li { display: inline-flex; align-items: center; gap: 7px; }
.leyenda i { width: 16px; height: 8px; border-radius: 3px; background: var(--tramo); }
.leyenda .teletrabajo i { background: var(--verde-azulado); }
.leyenda .corregido i { background: none; border: 2px solid var(--naranja-vivo); }
.leyenda .ahora i { width: 2px; height: 14px; border-radius: 1px; background: var(--texto); }
.pendientes { margin: 0; padding: 0; list-style: none; }
.pendientes li { border-top: 1px solid var(--borde); }
.pendientes li:first-child { border-top: 0; }
.pendientes .fila { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 6px; margin: 0 -6px; border-radius: 10px; color: var(--texto); text-decoration: none; transition: background-color 150ms ease; }
.pendientes .numero { font: 600 20px/1 var(--titulos); font-variant-numeric: tabular-nums; text-align: center; color: var(--aviso); }
.pendientes .cero .numero { color: var(--texto-3); }
.pendientes .cero .que { color: var(--texto-2); }
.pendientes .icono { color: var(--texto-3); }

/* Solicitudes (correcciones y ausencias): una tarjeta por petición */
.solicitud { max-width: 820px; }
.solicitud h2 { margin: 0 0 12px; font-size: 16px; }
.solicitud h2 .detalle { font: 400 12.5px/1.4 "Open Sans", system-ui, sans-serif; letter-spacing: 0; }

/* Ficha del trabajador: los datos, de dos en dos; asignar un turno, en una fila */
.ficha { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; max-width: 760px; }
.ficha > :not(label), .ficha > label.casilla { grid-column: 1 / -1; }
.ficha > label:not(.casilla) > input, .ficha > label > select { width: 100%; }
.ficha > button { justify-self: start; }
.asignar { padding: 18px 20px; }
.asignar > h3, .asignar > .nota { flex-basis: 100%; margin: 0; }
.asignar > label { flex: 1; min-width: 150px; }
.asignar > label > input, .asignar > label > select { width: 100%; }
.pie-formulario { margin-top: 14px; }

/* Cuadrante */
.tabla-ancha { margin: 0 0 16px; overflow-x: auto; border-radius: var(--radio); }
.tabla-ancha table { margin: 0; min-width: 960px; }
.tabla-ancha td:first-child { white-space: nowrap; }
.cuadrante th, .cuadrante td { padding: 9px 10px; }
.cuadrante thead th { text-align: center; }
.cuadrante thead th:first-child, .cuadrante tbody th { text-align: left; }
.cuadrante td { text-align: center; }
.cuadrante tbody th { min-width: 220px; position: sticky; left: 0; z-index: 1; background: var(--superficie); box-shadow: 1px 0 0 var(--borde); }
.cuadrante thead th:first-child { position: sticky; left: 0; z-index: 2; }
.cuadrante #hoy { scroll-margin-left: 232px; }
.ir-a-hoy { display: none; font-weight: 600; font-size: 14px; }
td .persona .nombre, th .persona .nombre { overflow: visible; }
.cuadrante .celda { display: inline-block; padding: 3px 9px; border-radius: 8px; font-size: 13px; font-weight: 600; line-height: 1.45; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cuadrante .turno .celda { background: var(--info-fondo); color: var(--info); }
.cuadrante .jornada .celda { background: var(--superficie-2); color: var(--texto-2); }
.cuadrante .libre .celda { color: var(--texto-3); font-weight: 400; }
.cuadrante .festivo .celda { box-shadow: inset 0 0 0 1px var(--borde-fuerte); color: var(--texto-2); }
.cuadrante .ausencia .celda { background: var(--exito-fondo); color: var(--exito); }
.cuadrante .es-hoy { background: color-mix(in srgb, var(--azul) 6%, transparent); }
.cuadrante thead .es-hoy { color: var(--enlace); }

/* Registro de jornada */
.trabajador { margin: 0 0 20px; padding: 20px; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--superficie); box-shadow: var(--sombra); }
.trabajador h2 { margin: 0 0 6px; font-size: 19px; }
.trabajador .datos { margin: 0 0 6px; color: var(--texto-2); font-size: 14px; }
.trabajador table { box-shadow: none; }
.trabajador td { vertical-align: top; }
.totales { margin: 0 0 6px; padding: 10px 14px; border-radius: var(--radio-control); background: var(--superficie-2); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 11. Estrecho y táctil ---------- */
@media (max-width: 1080px) {
  .hoy { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  body.con-lateral { display: block; }
  main { padding: 18px 16px 12px; }
  footer { padding: 12px 16px 24px; }
  h1 { font-size: 22px; }
  .menu-interruptor { display: block; position: fixed; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; }
  .boton-menu { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: -8px; border-radius: 12px; color: var(--texto); cursor: pointer; }
  .menu-interruptor:focus-visible ~ .pagina .boton-menu { outline: 2px solid var(--azul); outline-offset: 2px; }
  .lateral { position: fixed; inset: 0 auto 0 0; z-index: 30; width: min(300px, 86vw); transform: translateX(-102%); visibility: hidden; transition: transform 300ms var(--cajon), visibility 0s 300ms; }
  .menu-interruptor:checked ~ .lateral { transform: none; visibility: visible; transition: transform 300ms var(--cajon); box-shadow: var(--sombra-alta); }
  .velo { display: block; position: fixed; inset: 0; z-index: 20; background: rgb(2 6 23 / .55); opacity: 0; pointer-events: none; transition: opacity 220ms ease; }
  .menu-interruptor:checked ~ .velo { opacity: 1; pointer-events: auto; }
  .lateral nav a { min-height: 44px; }
  .resumen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resumen > div:nth-child(3) { border-left: 0; }
  .resumen > div:nth-child(n + 3) { border-top: 1px solid var(--borde); }
  .escala { display: none; }
  .lineas li { grid-template-columns: minmax(0, 1fr) 52px; }
  .lineas .linea-tiempo { grid-column: 1 / -1; grid-row: 2; }
  /* Las tablas que no caben se desplazan de lado dentro de su caja. */
  main > table, .trabajador table { display: block; overflow-x: auto; white-space: nowrap; }
  thead th { position: static; }
  /* En los enlaces de la Inspección, «Para quién» se parte en líneas: así entran el estado y la caducidad. */
  main > table.enlaces td:first-child { min-width: 150px; max-width: 170px; white-space: normal; }
  .rechazo, .acciones { flex-wrap: wrap; }
  .rechazo { margin-left: 0; padding-left: 0; border-left: 0; flex-basis: 100%; }
  .ficha { grid-template-columns: minmax(0, 1fr); }
  .cuadrante tbody th { min-width: 132px; max-width: 132px; }
  .cuadrante #hoy { scroll-margin-left: 144px; }
  .ir-a-hoy { display: inline; }
  .cuadrante .persona .avatar { display: none; }
  .cuadrante .persona .nombre { white-space: normal; }
  .cabecera { flex-wrap: wrap; }
}
@media (pointer: coarse) {
  button, a.boton, input:not([type="checkbox"], [type="radio"], [type="file"]), select { min-height: 44px; }
  .pequeno, a.boton.pequeno { min-height: 40px; }
}

/* ---------- 12. Movimiento y puntero ---------- */
@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration-thickness: 2px; }
  td a:hover { text-decoration: underline; }
  tbody tr:hover { background: color-mix(in srgb, var(--superficie-2) 60%, transparent); }
  button:hover, a.boton:hover { border-color: var(--texto-3); background: var(--superficie-2); }
  .principal:hover, a.boton.principal:hover { border-color: var(--principal-fuerte); background: var(--principal-fuerte); }
  .azul:hover, a.boton.azul:hover { border-color: var(--azul); background: var(--azul); }
  .peligro:hover { border-color: var(--error); background: var(--error-fondo); }
  button.enlace:hover { background: none; text-decoration-thickness: 2px; }
  .lateral nav a:hover { background: rgb(255 255 255 / .06); color: #fff; }
  .lateral nav a[aria-current="page"]:hover { background: rgb(96 165 250 / .2); }
  .boton-lateral:hover { border-color: #334155; background: var(--noche-2); color: #fff; }
  .migas a:hover { color: var(--texto); background: var(--superficie-2); }
  .pendientes a.fila:hover { background: var(--superficie-2); }
  .persona a.nombre:hover { color: var(--enlace); text-decoration: underline; text-decoration-color: currentColor; }
  .volver:hover { color: var(--texto); }
}
/* El aviso de «hecho» entra una vez, desde su sitio: confirma que la acción ha llegado. */
:is(p, div).aviso.exito { transition: opacity 260ms var(--salida), transform 260ms var(--salida); }
@starting-style { :is(p, div).aviso.exito { opacity: 0; transform: translateY(-6px); } }
/* De una página a otra, un fundido corto; la lateral no se mueve. */
@view-transition { navigation: auto; }
.lateral { view-transition-name: lateral; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 160ms; animation-timing-function: var(--salida); }
::view-transition-group(lateral), ::view-transition-old(lateral), ::view-transition-new(lateral) { animation: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; }
  button:active, a.boton:active { transform: none; }
  @view-transition { navigation: none; }
}

/* ---------- 13. Impresión (el registro de jornada sale en papel) ---------- */
@media print {
  :root, :root[data-tema="oscuro"], :root:not([data-tema="claro"]) {
    --fondo: #fff; --superficie: #fff; --superficie-2: #F1F5F9; --borde: #CBD5E1; --borde-fuerte: #94A3B8;
    --texto: #000; --texto-2: #334155; --texto-3: #475569; --enlace: #000; --sombra: none; color-scheme: light;
  }
  body, body.con-lateral { display: block; background: #fff; font-size: 10pt; }
  .lateral, .velo, .boton-menu, .menu-interruptor, .saltar, .barra, .filtros, .descargas, .migas, footer, :is(p, div).aviso.exito { display: none !important; }
  .pagina { min-height: 0; }
  main { max-width: none; padding: 0; }
  .trabajador { padding: 0; border: 0; border-radius: 0; break-before: page; }
  .trabajador:first-of-type { break-before: auto; }
  table { font-size: 9pt; border-radius: 0; }
  thead { display: table-header-group; }
  thead th { position: static; border-radius: 0 !important; }
  th, td { padding: 4px 6px; }
  tr { break-inside: avoid; }
}
