/*
 * Control Horario · hoja de estilos
 * ---------------------------------------------------------------
 * Diseño "mobile first": las reglas base son para móvil y las
 * consultas @media (min-width) amplían para tablet y escritorio.
 * Todos los colores son variables: el modo oscuro solo las redefine.
 *
 * Índice: 1 Variables · 2 Base · 3 Estructura · 4 Bloques · 5 Botones
 * 6 Avisos · 7 Tablas · 8 Formularios · 9 Fichaje · 10 Historial y
 * calendario · 11 Detalle · 12 Lectura NFC · 13 Acceso · 14 Impresión
 */

/* 1. Variables ------------------------------------------------------------ */
:root {
    --bg: #f4f3ef;
    --surface: #ffffff;
    --surface-2: #f7f6f2;
    --surface-3: #eeede7;
    --ink: #17191c;
    --ink-2: #3a3d42;
    --muted: #74767c;
    --line: #e7e5de;
    --line-strong: #d8d5cc;

    /* --accent y compañía: los pone el tema elegido (ver «Temas de color», más abajo). */
    --gold: #b08a3e;            /* detalle cálido para acentos discretos */

    --ok: #1b7a43;      --ok-soft: #e6f3eb;
    --warn: #9a5b0b;    --warn-soft: #faf0dd;
    --danger: #b3261e;  --danger-soft: #fbeae8;

    --radius: 18px;
    --radius-sm: 11px;
    --shadow: 0 1px 1px rgba(23, 25, 28, .03), 0 8px 24px -12px rgba(23, 25, 28, .10);
    --shadow-lg: 0 20px 48px -20px color-mix(in srgb, var(--accent) 45%, transparent);
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --font-display: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
    --sidebar: 264px;
    color-scheme: light;
}

/*
 * Modo oscuro. Configuración → Apariencia elige entre automático (sigue al
 * dispositivo), claro u oscuro; se refleja en <html data-mode="auto|light|dark">.
 * Los colores oscuros de marca (--accent-d...) los define cada tema.
 */
@media (prefers-color-scheme: dark) {
    :root:not([data-mode="light"]) {
        --bg: #0f1112;
        --surface: #171a1b;
        --surface-2: #1c2021;
        --surface-3: #232829;
        --ink: #eceeed;
        --ink-2: #c9cdcc;
        --muted: #949a99;
        --line: #262b2c;
        --line-strong: #323839;
        --accent: var(--accent-d);
        --accent-2: var(--accent-2-d);
        --accent-ink: var(--accent-ink-d);
        --accent-soft: var(--accent-soft-d);
        --gold: #d6b066;
        --ok: #5cd08d;      --ok-soft: #13291c;
        --warn: #f0b75c;    --warn-soft: #2d2413;
        --danger: #f2837b;  --danger-soft: #331a18;
        --shadow: none;
        --shadow-lg: none;
        color-scheme: dark;
    }
}
:root[data-mode="dark"] {
    --bg: #0f1112;
    --surface: #171a1b;
    --surface-2: #1c2021;
    --surface-3: #232829;
    --ink: #eceeed;
    --ink-2: #c9cdcc;
    --muted: #949a99;
    --line: #262b2c;
    --line-strong: #323839;
    --accent: var(--accent-d);
    --accent-2: var(--accent-2-d);
    --accent-ink: var(--accent-ink-d);
    --accent-soft: var(--accent-soft-d);
    --gold: #d6b066;
    --ok: #5cd08d;      --ok-soft: #13291c;
    --warn: #f0b75c;    --warn-soft: #2d2413;
    --danger: #f2837b;  --danger-soft: #331a18;
    --shadow: none;
    --shadow-lg: none;
    color-scheme: dark;
}

/*
 * Temas de color: <html data-theme="...">. Cada tema define su color de marca
 * en claro (--accent...) y en oscuro (--accent-d...). Como son variables, la
 * miniatura de cada tema en la pantalla de Apariencia también se pinta sola.
 */
:root, [data-theme="esmeralda"] {
    --accent: #0d6b5e; --accent-2: #0a5249; --accent-ink: #ffffff; --accent-soft: #e4f0ec;
    --accent-d: #3fb8a3; --accent-2-d: #5cc9b6; --accent-ink-d: #062520; --accent-soft-d: #12302b;
}
[data-theme="oceano"] {
    --accent: #1d5fa8; --accent-2: #164a85; --accent-ink: #ffffff; --accent-soft: #e5eef9;
    --accent-d: #6aa8ec; --accent-2-d: #8dbcf1; --accent-ink-d: #071a30; --accent-soft-d: #13253b;
}
[data-theme="grafito"] {
    --accent: #3b4250; --accent-2: #2a303b; --accent-ink: #ffffff; --accent-soft: #eceef1;
    --accent-d: #b4bccb; --accent-2-d: #ccd3df; --accent-ink-d: #14171c; --accent-soft-d: #262a31;
}
[data-theme="burdeos"] {
    --accent: #8a2340; --accent-2: #6c1a32; --accent-ink: #ffffff; --accent-soft: #f7e8ec;
    --accent-d: #e57a98; --accent-2-d: #ec9bb2; --accent-ink-d: #2b0a14; --accent-soft-d: #351922;
}
[data-theme="violeta"] {
    --accent: #5b3fa8; --accent-2: #47308a; --accent-ink: #ffffff; --accent-soft: #eeeafa;
    --accent-d: #a993ee; --accent-2-d: #bfaef3; --accent-ink-d: #1b1033; --accent-soft-d: #262040;
}
[data-theme="terracota"] {
    --accent: #b4532a; --accent-2: #8f4020; --accent-ink: #ffffff; --accent-soft: #f9ebe4;
    --accent-d: #ee9a72; --accent-2-d: #f2b293; --accent-ink-d: #2d1206; --accent-soft-d: #36231a;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
/* El atributo hidden debe ocultar siempre, aunque la clase del elemento fije un display. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 15px/1.55 var(--font);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
h1, h2, h3 { margin: 0; font-family: var(--font-display); line-height: 1.2; font-weight: 600; letter-spacing: -.015em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1rem; }
h3 { font-size: .92rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.icon { flex: none; vertical-align: middle; }

/* 3. Estructura: barra lateral + contenido -------------------------------- */
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 30;
    width: var(--sidebar); padding: 22px 16px 16px;
    display: flex; flex-direction: column; gap: 22px;
    background: var(--surface); border-right: 1px solid var(--line);
    transform: translateX(-100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1);  /* oculta en móvil */
    overflow-y: auto;
}
/*
 * Barra de desplazamiento del menú: fina, del color del tema y difuminada en los extremos.
 *  - Chrome, Edge y Safari: ::-webkit-scrollbar (permite el degradado).
 *  - Firefox: solo permite "fina" y el color (scrollbar-width / scrollbar-color),
 *    por eso esas propiedades van solo para él: en Chrome anularían las de arriba.
 */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; margin-block: 16px; }
/* Degradado en los extremos: el pulgar se difumina arriba y abajo en lugar de cortarse en seco. */
.sidebar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--accent) 45%, transparent) 30%, color-mix(in srgb, var(--accent) 45%, transparent) 70%, transparent);
}
.sidebar:hover::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
}
@supports (-moz-appearance: none) {
    .sidebar { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 40%, transparent) transparent; }
}
.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
.overlay { display: none; }
.nav-open .overlay { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(10, 12, 12, .4); backdrop-filter: blur(2px); }

.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none;
    background: linear-gradient(145deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
    box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--accent) 60%, transparent);
}
/* Logo de la empresa (Administración → Empresa): se adapta al hueco sin deformarse. */
.brand-logo { flex: none; display: grid; place-items: center; max-width: 120px; height: 40px; }
.brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview { display: grid; place-items: center; min-height: 120px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); }
.logo-preview img { max-width: 100%; max-height: 110px; object-fit: contain; }
.logo-preview span { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name strong { font-size: 15px; letter-spacing: -.01em; }
.brand-name small { font-size: 11.5px; }

/* Bloques del menú: cada uno con su color (barra lateral fina e icono del título). */
.nav-group { --tone: var(--accent); display: flex; flex-direction: column; gap: 1px; padding: 8px 6px 6px; border-radius: 14px; }
.nav-group.tone-me { --tone: var(--accent); }
.nav-group.tone-admin { --tone: var(--gold); }
.nav-group.tone-config { --tone: #6d7fb3; }
.nav-group.tone-records { --tone: var(--muted); }
details.nav-group { background: var(--surface-2); border: 1px solid var(--line); }
.nav-title {
    display: flex; align-items: center; gap: 8px; padding: 2px 8px 6px; cursor: pointer; list-style: none; user-select: none;
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-2);
}
.nav-title::-webkit-details-marker { display: none; }
.nav-title .icon { color: var(--tone); }
.nav-title::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.nav-title .nav-count { margin-left: auto; }
.nav-title:has(.nav-count)::after { margin-left: 8px; }
details.nav-group:not([open]) .nav-title { padding-bottom: 2px; }
details.nav-group:not([open]) .nav-title::after { transform: rotate(-45deg); }
.nav-group .nav-link.active { box-shadow: inset 3px 0 0 var(--tone); }
.nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 8px 12px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: 14px;
    transition: background .15s, color .15s;
}
.nav-link .icon { color: var(--muted); transition: color .15s; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-link.active .icon { color: var(--accent); }
.nav-count { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 99px; background: var(--warn); color: #fff; font-size: 11px; font-weight: 600; text-align: center; }

.avatar {
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: .02em;
}

.topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.menu-btn { display: grid; place-items: center; width: 38px; height: 38px; margin-left: -6px; border: 0; border-radius: 10px; background: none; color: var(--ink); cursor: pointer; }
.menu-btn:hover { background: var(--surface-3); }
.content { padding: 22px 16px 56px; max-width: 1200px; margin: 0 auto; }

@media (min-width: 960px) {
    .sidebar { transform: none; }
    .topbar { display: none; }
    .main { margin-left: var(--sidebar); }
    .content { padding: 40px 44px 72px; }
}

/* 4. Bloques de página ------------------------------------------------------ */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 26px; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 640px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.grid > * { min-width: 0; }  /* las columnas pueden encogerse: nada se sale por la derecha en el móvil */
@media (min-width: 760px) {
    .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Contenido + lateral: solo a partir de 1024 px; por debajo, el lateral pasa debajo y el contenido respira. */
@media (min-width: 1024px) { .grid-aside { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { display: flex; align-items: center; gap: 9px; }
.card-head h2 .icon { color: var(--muted); }
a.card { color: inherit; transition: transform .15s, border-color .15s; }
a.card:hover { transform: translateY(-2px); border-color: var(--line-strong); color: inherit; }

/* Tarjeta de dato: icono + etiqueta + cifra. */
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-value { font-family: var(--font-display); font-size: 1.65rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1.1; }
.stat-note { margin-top: 4px; font-size: 12px; color: var(--muted); }
.chip-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.chip-icon.warn { background: var(--warn-soft); color: var(--warn); }
.chip-icon.danger { background: var(--danger-soft); color: var(--danger); }
.chip-icon.neutral { background: var(--surface-3); color: var(--ink-2); }
.positive { color: var(--ok); }
.negative { color: var(--danger); }

/* 5. Botones y etiquetas ---------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
    font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-ghost { border-color: transparent; background: none; }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn-icon { width: 36px; padding: 0; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.plain::before { display: none; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-off { background: var(--danger-soft); color: var(--danger); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; margin-right: 7px; }

/* 6. Avisos ------------------------------------------------------------------ */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; border: 1px solid transparent; font-size: 14px; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--ok-soft); color: var(--ok); }
.alert-warning { background: var(--warn-soft); color: var(--warn); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert ul { margin: 0; padding-left: 18px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 20px; text-align: center; color: var(--muted); }
.empty .icon { color: var(--line-strong); }

/* 7. Tablas: en móvil se desplazan en horizontal dentro de su tarjeta ------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
.t-right { text-align: right; }
.person { display: flex; align-items: center; gap: 10px; color: inherit; font-weight: 500; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person .avatar { width: 32px; height: 32px; font-size: 11px; }

/* 8. Formularios --------------------------------------------------------------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span-2 { grid-column: span 2; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint, .hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=time], input[type=search], input[type=month], select, textarea {
    width: 100%; min-height: 42px; padding: 9px 12px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); font: inherit; font-size: 14.5px;
    transition: border-color .15s, box-shadow .15s;
}
input[type=time] { min-width: 0; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; min-width: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.check small { display: block; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.inline-form { display: inline; }

/* Formulario desplegable (p. ej. motivo de rechazo) sin JavaScript. */
details.reveal > summary { list-style: none; cursor: pointer; display: inline-flex; }
details.reveal > summary::-webkit-details-marker { display: none; }
details.reveal[open] > summary { margin-bottom: 10px; }

/* 9. Fichaje: tarjeta principal ----------------------------------------------- */
.punch-card {
    position: relative; overflow: hidden;
    background:
        radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
        var(--surface);
}
.clock { font-family: var(--font-display); font-size: clamp(3rem, 13vw, 4.2rem); font-weight: 600; letter-spacing: -.045em; font-variant-numeric: tabular-nums; line-height: 1; }
.clock-date { margin-top: 8px; color: var(--muted); }
.state { display: inline-flex; align-items: center; gap: 8px; margin: 20px 0 24px; padding: 7px 14px; border-radius: 99px; background: var(--surface-3); font-size: 13px; font-weight: 500; }
.state .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.state.working { background: var(--ok-soft); color: var(--ok); }
.state.working .pulse { background: var(--ok); animation: pulse 2s infinite; }
.state.paused { background: var(--warn-soft); color: var(--warn); }
.state.paused .pulse { background: var(--warn); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.btn-primary.punch-btn { box-shadow: var(--shadow-lg); }
.geo-status { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 14px 0 0; font-size: 12.5px; color: var(--muted); min-height: 1.2em; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline time { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 46px; }
.timeline .what { flex: 1; min-width: 0; }
.timeline a.what { color: inherit; }
.timeline a.what:hover { color: var(--accent); }

/* 10. Días del historial y calendario ------------------------------------------ */
.day { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.day:last-child { border-bottom: 0; }
.day-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: center; }
.day-date { display: flex; align-items: center; gap: 8px; font-weight: 600; text-transform: capitalize; }
.day-punches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 9px;
    background: var(--surface-3); color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums;
}
a.chip:hover { background: var(--accent-soft); color: var(--accent); }
.chip.pending { background: var(--warn-soft); color: var(--warn); }
.chip.void { text-decoration: line-through; opacity: .55; }
.day.off { background: var(--surface-2); }

/* Barra de tiempo del día: tramos de trabajo y pausa a escala. */
.day-bar { position: relative; height: 10px; margin-top: 12px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.day-bar span { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.day-bar .work { background: var(--accent); }
.day-bar .break { background: var(--gold); }
/* Pendiente de validar: rayado, para distinguirlo sin depender solo del color. */
.day-bar .pending { background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(255, 255, 255, .45) 4px 7px); }
.day-bar-scale { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Tramos del día: una fila por tramo, columnas alineadas. */
.segments { list-style: none; margin: 8px 0 0; padding: 0; }
.segments li {
    display: grid; grid-template-columns: 28px 70px 1fr auto; align-items: center; gap: 10px;
    padding: 7px 0; border-top: 1px dashed var(--line); font-size: 14px;
}
.segments li:first-child { border-top: 0; }
.seg-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.segments .break .seg-icon { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }
.seg-kind { color: var(--muted); }
.seg-times { font-weight: 600; font-variant-numeric: tabular-nums; }
.seg-times a { color: inherit; border-bottom: 1px dotted var(--line-strong); }
.seg-times a:hover { color: var(--accent); border-color: var(--accent); }
.seg-times .arrow { margin: 0 6px; color: var(--muted); font-weight: 400; }
.seg-times .missing { color: var(--warn); font-weight: 500; }
.seg-times .running { color: var(--accent); font-weight: 500; }
.seg-end { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.seg-duration { font-variant-numeric: tabular-nums; color: var(--ink-2); }

.day-voided { margin-top: 8px; font-size: 13px; color: var(--muted); }
.day-voided summary { cursor: pointer; width: fit-content; }
.day-voided summary:hover { color: var(--ink-2); }

/* Leyenda bajo la lista. */
.legend { display: inline-flex; align-items: center; gap: 6px; }
.legend::before { content: ""; width: 14px; height: 8px; border-radius: 999px; background: var(--accent); }
.legend.break::before { background: var(--gold); }
.legend.pending::before { background: var(--accent) repeating-linear-gradient(135deg, transparent 0 4px, rgba(255, 255, 255, .45) 4px 7px); }

@media (max-width: 520px) {
    .segments li { grid-template-columns: 28px 1fr auto; }
    .seg-kind { display: none; }
}

/* 10a. Ficha del empleado ----------------------------------------------------- */
/* Tarjeta de perfil: franja de color, foto que la pisa, identidad y cifras. */
.profile-card { overflow: hidden; margin-bottom: 18px; }
.profile-cover {
    height: 96px;
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--gold) 35%, transparent), transparent 55%),
        linear-gradient(120deg, var(--accent), var(--accent-2));
}
.profile-main { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 22px; padding: 0 24px 20px; margin-top: -48px; }
/* La foto pisa la franja de color; el texto empieza justo debajo de ella. */
.profile-photo { position: relative; flex: none; cursor: pointer; border-radius: 50%; }
.avatar-xl {
    width: 112px; height: 112px; font-size: 36px; border: 4px solid var(--surface);
    background: var(--accent-soft); color: var(--accent); box-shadow: var(--shadow);
}
.profile-photo-btn {
    position: absolute; right: 4px; bottom: 4px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface); color: var(--accent); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .15s;
}
.profile-photo:hover .profile-photo-btn { transform: scale(1.08); background: var(--accent); color: var(--accent-ink); }
.profile-photo:focus-within .avatar-xl { box-shadow: 0 0 0 4px var(--accent-soft); }
.profile-id { flex: 1; min-width: 240px; padding-top: 60px; }
@media (max-width: 560px) { .profile-id { padding-top: 0; } }
.profile-id .eyebrow { margin-bottom: 4px; }
.profile-id h1 { margin: 0; }
.profile-id .today-strip { display: inline-flex; margin: 8px 0 2px; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 10px; color: var(--muted); font-size: 14px; }
.profile-meta span { display: inline-flex; align-items: center; gap: 6px; }
.profile-photo-hint { margin: 10px 0 0; }
.profile-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
@media (min-width: 900px) { .profile-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* Elementos del resumen que llevan a su campo (data-jump). */
.jump { font: inherit; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.jump:not(.badge) { color: inherit; background: none; padding: 0; }
.profile-meta .jump:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
button.badge.jump { padding: 3px 10px; transition: box-shadow .15s; }
button.badge.jump:hover, .jump:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.profile-stat[data-jump] { cursor: pointer; transition: background .15s; }
.profile-stat[data-jump]:hover, .profile-stat[data-jump]:focus-visible { background: var(--surface-2); outline: none; }
.profile-stat[data-jump] small a { color: var(--accent); }

/* Resalte del campo al que se ha saltado. */
.flash { animation: flash 2.2s ease-out; border-radius: var(--radius-sm); }
@keyframes flash {
    0%, 30% { box-shadow: 0 0 0 4px var(--accent), 0 0 0 10px var(--accent-soft); background-color: var(--accent-soft); }
    100% { box-shadow: 0 0 0 0 transparent; }
}
[id^="campo-"], #semana { scroll-margin: 90px; }

.profile-stats > div { display: flex; flex-direction: column; gap: 2px; padding: 14px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.profile-stats span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.profile-stats strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-stats strong a { color: inherit; }
.profile-stats small { font-size: 12px; color: var(--muted); }

/* Semana de trabajo: una fila por día sobre una escala horaria. */
.week { margin-bottom: 0; }
.week .card-head { flex-wrap: wrap; }  /* en el móvil, pestañas y flechas bajan a otra línea */
.week .month-nav { flex-wrap: wrap; }
.week .card-head small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.week-number { margin-left: 4px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
input[readonly] { background: var(--surface-2); cursor: default; }
input[readonly]:focus { border-color: var(--line-strong); box-shadow: none; }
.week-totals { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.week-totals div { display: flex; align-items: baseline; gap: 8px; }
.week-totals span { font-size: 12.5px; color: var(--muted); }
.week-totals strong { font-size: 17px; }
.week-grid { display: flex; flex-direction: column; gap: 6px; }
.week-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 92px; align-items: center; gap: 12px; }
.week-day { display: flex; align-items: baseline; gap: 5px; }
.week-day small { color: var(--muted); }
.week-track { position: relative; height: 30px; border-radius: 8px; background: var(--surface-2); }
.week-track .tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.week-track .planned {
    position: absolute; top: 3px; bottom: 3px; border-radius: 6px;
    border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.week-track .worked { position: absolute; top: 8px; bottom: 8px; border-radius: 4px; background: var(--accent); }
.week-track .worked.break { background: var(--gold); }
.week-track .worked.pending { background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(255, 255, 255, .45) 4px 7px); }
.week-track .worked.broken { background: var(--warn); }
.week-label {
    position: absolute; inset: 4px auto 4px 8px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px;
    border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 500; z-index: 1;
}
.week-hours { text-align: right; font-size: 13px; }
.week-hours small { margin-left: 3px; color: var(--muted); }
/* Hoy, con la misma forma de pestaña que en las tarjetas: el día sobre el color del
   tema y la barra clara con el borde izquierdo redondeado («C»). Las columnas
   absorben la separación (52+12 y 92+12) para que la barra siga alineada. */
.week-row.today {
    grid-template-columns: 64px minmax(0, 1fr) 104px; column-gap: 0; border-radius: 10px;
    background: linear-gradient(to right, var(--accent) 0 76px, var(--surface-2) 76px);
}
.week-row.today .week-day { padding-left: 8px; color: var(--accent-ink); }
.week-row.today .week-day small { color: inherit; opacity: .8; }
.week-row.today .week-track { border-radius: 14px 0 0 14px; }
.week-row.today .week-hours { padding: 0 8px 0 12px; }
.week-row.future { opacity: .7; }
.week-scale .week-track { height: 16px; background: none; }
.week-scale .week-track span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.week-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 16px 0 0; font-size: 12.5px; color: var(--muted); }
.legend.planned::before { background: color-mix(in srgb, var(--accent) 7%, transparent); border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, transparent); }
@media (max-width: 560px) {
    .week-row { grid-template-columns: 40px minmax(0, 1fr) 54px; gap: 8px; }
    .week-hours small { display: none; }
    .profile-main { padding: 0 16px 16px; }
}


/* Cabecera de sección: icono + título + explicación corta. */
.section-head { justify-content: flex-start; gap: 12px; }
.section-head small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.optional { margin-left: 4px; font-weight: 400; font-size: 12px; color: var(--muted); }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field legend { margin-bottom: 8px; padding: 0; }

/* Rol: tarjetas seleccionables en lugar de un desplegable. */
.choice-cards { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .choice-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.choice {
    position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px; cursor: pointer;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.choice:hover { border-color: var(--accent); }
.choice input { position: absolute; top: 14px; right: 14px; width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
.choice-icon { width: 32px; height: 32px; margin-bottom: 4px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.choice small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.choice:has(input:checked) .choice-icon { background: var(--accent); color: var(--accent-ink); }
.choice:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--accent-soft); }

/* Contraseña: el ojo va dentro del campo, a la derecha; "Generar" al lado. */
.password-field { display: flex; gap: 8px; }
.password-input { position: relative; flex: 1; min-width: 0; }
.password-input input { padding-right: 46px; }
.password-input [data-password-toggle] { position: absolute; top: 3px; right: 3px; height: 36px; }
.password-field .when-shown, .password-field.is-visible .when-hidden { display: none; }
.password-field.is-visible .when-shown { display: inline; }
.password-field.is-visible input { letter-spacing: .04em; }

/* Interruptor (casilla con aspecto de interruptor). */
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; flex: none; width: 40px; height: 23px; margin-top: 1px; border-radius: 999px; background: var(--line-strong); transition: background .2s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(17px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 4px var(--accent-soft); }
.switch small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }

/* Zonas: casillas con forma de etiqueta. */
.chip-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check {
    position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; cursor: pointer; font-size: 14px;
    border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); transition: all .15s;
}
.chip-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-check small { color: var(--muted); }
.chip-check:hover { border-color: var(--accent); }
.chip-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip-check:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--accent-soft); }

/* Número con su unidad al lado ("22 días", "40 horas"). */
.input-suffix { position: relative; }
.input-suffix input { padding-right: 64px; }
.input-suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }

/* Barra de guardar, fija al pie mientras se recorre el formulario. */
.savebar {
    position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); box-shadow: var(--shadow);
}

@media (max-width: 640px) {
    .savebar > .muted { display: none; }   /* en el móvil, solo los botones */
    .savebar { justify-content: flex-end; padding: 10px 12px; }
}

/* Resumen lateral de la ficha. */
.summary { margin: 0; display: flex; flex-direction: column; }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.summary div:last-child { border-bottom: 0; }
.summary dt { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.summary dd { margin: 0; font-weight: 500; text-align: right; }
.assign { border-top: 1px solid var(--line); }
.assign summary { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; color: var(--accent); width: fit-content; }

/* 10c. Lista de empleados en tarjetas ------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.search-box { position: relative; display: flex; align-items: center; gap: 8px; flex: 1; max-width: 420px; }
.search-box > .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 36px; }

/* Cada rol es un grupo con su cabecera; los colores distinguen los grupos de un vistazo. */
.role-group { --role: var(--accent); --role-soft: var(--accent-soft); margin-bottom: 26px; }
.role-admin { --role: var(--gold); --role-soft: color-mix(in srgb, var(--gold) 15%, transparent); }
.role-inspeccion { --role: var(--muted); --role-soft: var(--surface-3); }
.role-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--role-soft); }
.role-head .chip-icon { background: var(--role-soft); color: var(--role); }
.role-head h2 { display: flex; align-items: center; gap: 8px; }
.role-head small { color: var(--muted); font-size: 12.5px; }

.team-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); align-items: start; }
.person-card {
    border: 1px solid var(--line); border-left: 3px solid var(--role); border-radius: var(--radius-sm);
    background: var(--surface); box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s;
}
.person-card:hover { transform: translateY(-1px); box-shadow: var(--shadow), 0 6px 18px -10px rgba(0, 0, 0, .25); }
.person-card summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.person-card summary::-webkit-details-marker { display: none; }
.person-card .avatar { width: 42px; height: 42px; font-size: 14px; }
.person-card-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-card-id strong, .person-card-id small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-card-id small { color: var(--muted); font-size: 12.5px; }
.person-card-flags { display: flex; align-items: center; gap: 4px; }
.flag { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.flag.on { background: var(--accent-soft); color: var(--accent); }
.flag.warn { background: var(--warn-soft); color: var(--warn); }
.person-card-chevron { color: var(--muted); transition: transform .2s; }
.person-card[open] .person-card-chevron { transform: rotate(90deg); }
.person-card[open] summary { border-bottom: 1px dashed var(--line); }
.person-card-body { padding: 6px 14px 14px; }
.person-card-body .summary { margin-bottom: 12px; }
.person-card-body .summary dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.person-card.inactive { opacity: .62; border-left-color: var(--line-strong); }

/* 10d. Apariencia: tarjetas de tema con miniatura ----------------------------- */
.theme-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.theme-card {
    position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px; cursor: pointer;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.theme-card input { position: absolute; top: 18px; right: 18px; width: 17px; height: 17px; margin: 0; accent-color: var(--accent); z-index: 1; }
.theme-card:hover { border-color: var(--accent); }
.theme-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.theme-card small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.theme-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.theme-dot { width: 12px; height: 12px; border-radius: 50%; }
.theme-thumb { display: flex; gap: 6px; height: 74px; padding: 6px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); }
.t-side { width: 30%; display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 6px; background: var(--surface); }
.t-side i { height: 6px; border-radius: 3px; background: var(--surface-3); }
.t-side i:first-child { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.t-main { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.t-btn { width: 52%; height: 14px; border-radius: 5px; background: var(--accent); }
.t-card { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 5px; border-radius: 6px; background: var(--surface); }
.t-card i { height: 5px; border-radius: 3px; background: var(--surface-3); }
.t-card i:first-child { width: 60%; background: var(--accent-soft); }

/* Icono de información con explicación desplegable (<x-info>). */
.label-row { display: flex; align-items: center; gap: 6px; }
.info-tip { position: relative; display: inline-block; }
.info-tip summary { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; list-style: none; color: var(--muted); }
.info-tip summary::-webkit-details-marker { display: none; }
.info-tip summary:hover, .info-tip[open] summary { color: var(--accent); background: var(--accent-soft); }
.info-pop {
    position: absolute; z-index: 20; top: calc(100% + 6px); left: -10px; width: min(300px, 80vw); padding: 12px 14px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow), 0 12px 30px -12px rgba(0, 0, 0, .3);
    font-size: 13px; line-height: 1.5; color: var(--ink-2);
}
.info-pop .info-title { display: block; margin-bottom: 4px; color: var(--ink); }
.info-pop p { margin: 0 0 6px; }
.info-pop p:last-child { margin-bottom: 0; }

/* Documentos adjuntos de la ficha. */
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.doc-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.doc-list li:last-child { border-bottom: 0; }
.doc-list .what { flex: 1; min-width: 0; color: inherit; display: flex; flex-direction: column; }
.doc-list .what:hover strong { color: var(--accent); }
.doc-list strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-list small { color: var(--muted); font-size: 12px; }
.doc-list .doc-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); }
.doc-icon {
    flex: none; width: 38px; height: 44px; border-radius: 7px; display: grid; place-items: center;
    font-size: 10px; font-weight: 700; letter-spacing: .03em; background: var(--danger-soft); color: var(--danger);
}
.doc-icon.other { background: var(--accent-soft); color: var(--accent); }
.dropzone {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 14px; cursor: pointer; text-align: center;
    border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 13px;
    transition: border-color .15s, background .15s;
}
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone strong { color: var(--accent); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.ready { border-style: solid; border-color: var(--accent); color: var(--ink); }

/* Aviso de la jornada de hoy en la tarjeta del empleado. */
.person-card summary { flex-wrap: wrap; }
.today-strip {
    flex-basis: 100%; display: flex; align-items: center; gap: 6px; margin-top: 2px; padding: 6px 10px;
    border-radius: 8px; font-size: 12.5px; background: var(--surface-2); color: var(--muted);
}
.today-strip.work { background: var(--accent-soft); color: var(--accent); }
.today-strip.away { background: var(--warn-soft); color: var(--warn); }
.today-strip > .icon { flex: none; }
.today-strip b { margin-left: auto; font-weight: 600; white-space: nowrap; }

/* Tarjeta desplegada: correo, datos en mosaico y semana. */
.person-mail { display: flex; align-items: center; gap: 6px; margin: 6px 0 10px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-mail:hover { color: var(--accent); }
.fact-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.fact-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); }
.fact-tile.wide { grid-column: span 2; }
.fact-tile span { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.fact-tile strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Semana: una fila por día con cada tramo horario en su recuadro. */
.mini-week { margin-bottom: 12px; padding: 10px 10px 6px; border-radius: 10px; border: 1px solid var(--line); }
.mini-week-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 4px 6px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.mini-week-head strong { font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.mini-day { display: grid; grid-template-columns: 38px 1fr auto; column-gap: 6px; align-items: center; padding: 4px; border-radius: 8px; font-size: 12.5px; }
.mini-day-name { font-weight: 600; }
.mini-day-name small { font-weight: 400; color: var(--muted); }
.mini-day-slots { display: flex; flex-wrap: wrap; gap: 3px; min-width: 0; }
.mini-day-hours { color: var(--muted); font-size: 12px; }
.slot {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 7px; white-space: nowrap;
    font-size: 12px; background: var(--accent-soft); color: var(--accent);
}
.slot.away { background: var(--warn-soft); color: var(--warn); }
.slot.free { background: var(--surface-2); color: var(--muted); }
.mini-day.free .mini-day-name { color: var(--muted); }
/*
 * Hoy, en forma de pestaña: la fila es del color del tema y la parte de los
 * tramos es clara con el borde izquierdo redondeado, así el bloque del día
 * queda con forma de «C» abrazando la línea.
 * Las columnas suman lo mismo que en las demás filas (38 + 6 de separación)
 * para que los tramos queden alineados.
 */
.mini-day.today {
    grid-template-columns: 42px 1fr auto; column-gap: 0; padding: 0;
    /* Color del tema solo bajo el día; el resto de la fila, claro y de una pieza (sin costuras). */
    background: linear-gradient(to right, var(--accent) 0 52px, var(--surface-2) 52px);
}
.mini-day.today .mini-day-name { padding: 0 0 0 6px; color: var(--accent-ink); }
.mini-day.today .mini-day-name small { color: inherit; opacity: .8; }
.mini-day.today .mini-day-slots { align-self: stretch; align-items: center; padding: 4px 6px; border-radius: 10px 0 0 10px; background: var(--surface-2); }
.mini-day.today .mini-day-hours { padding: 0 4px 0 6px; }

/* Ventana de confirmación (<dialog class="modal">). */
.modal { width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); }
.modal::backdrop { background: rgba(10, 12, 12, .45); backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in .22s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.modal-box { padding: 22px; }
.modal-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-head p { margin: 2px 0 0; }
.modal-icon.warn { background: var(--warn-soft); color: var(--warn); }
.pw-note { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.pw-note .icon { flex: none; margin-top: 2px; }
.modal-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.modal-rows { margin: 0; padding: 4px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.modal-rows div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.modal-rows div:last-child { border-bottom: 0; }
.modal-rows dt { color: var(--muted); }
.modal-rows dd { margin: 0; font-weight: 500; }
.modal-note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* «¡OK!» tras aprobar: círculo que se dibuja, check y estallido de confeti. */
.celebrate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(10, 12, 12, .25); backdrop-filter: blur(2px); animation: celebrate-out .4s ease 2.2s forwards; cursor: pointer; }
.celebrate-card {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 36px 24px; min-width: 260px; text-align: center;
    border-radius: 22px; background: var(--surface); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); animation: celebrate-pop .45s cubic-bezier(.2, 1.4, .4, 1);
}
.celebrate-card strong { font-size: 1.6rem; letter-spacing: -.02em; color: var(--ok); }
.celebrate-card span { color: var(--ink-2); font-size: 14px; max-width: 260px; }
.celebrate-check { width: 76px; height: 76px; margin-bottom: 4px; }
.celebrate-check circle { fill: var(--ok-soft); stroke: var(--ok); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .6s ease-out .1s forwards; }
.celebrate-check path { fill: none; stroke: var(--ok); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .35s ease-out .55s forwards; }
.celebrate-burst { position: absolute; top: 66px; left: 50%; width: 0; height: 0; }
.celebrate-burst i {
    position: absolute; width: 8px; height: 8px; margin: -4px; border-radius: 2px; opacity: 0;
    background: var(--accent); animation: burst .7s ease-out .6s forwards;
}
.celebrate-burst i:nth-child(3n) { background: var(--gold); border-radius: 50%; }
.celebrate-burst i:nth-child(3n + 1) { background: var(--ok); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes celebrate-pop { from { opacity: 0; transform: scale(.8); } }
@keyframes celebrate-out { to { opacity: 0; visibility: hidden; } }
@keyframes burst {
    0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); }
    100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) scale(.4); }
}
@media (prefers-reduced-motion: reduce) {
    .celebrate, .celebrate-card, .celebrate-check *, .celebrate-burst i, .modal[open] { animation-duration: .01s; animation-delay: 0s; }
    .celebrate { animation: celebrate-out .3s ease 2s forwards; }
}

/* Animación de confirmación: variantes de color e icono (fichajes). */
.celebrate.tone-break { --ok: var(--gold); --ok-soft: color-mix(in srgb, var(--gold) 16%, transparent); }
.celebrate-icon {
    position: absolute; top: 28px; left: 50%; width: 76px; height: 76px; margin-left: -38px; display: grid; place-items: center;
    color: var(--ok); opacity: 0; animation: icon-in .4s cubic-bezier(.2, 1.6, .4, 1) .45s forwards;
}
@keyframes icon-in { from { opacity: 0; transform: scale(.4) rotate(-20deg); } to { opacity: 1; transform: none; } }

/* Notificaciones: aviso en el panel, lista del empleado e historial del administrador. */
.notice-banner {
    display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding: 12px 16px; color: inherit;
    border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow);
    animation: modal-in .3s ease-out;
}
.notice-banner.important { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)); }
.notice-banner .what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.notice-banner small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-icon { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.important .notice-icon { background: var(--warn-soft); color: var(--warn); }
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list li { display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.notice-list li:last-child { border-bottom: 0; }
.notice-list li.new { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.notice-body { flex: 1; min-width: 0; }
.notice-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.notice-body p { margin: 6px 0; line-height: 1.55; }
.choice-cards.two { grid-template-columns: 1fr; }
@media (min-width: 640px) { .choice-cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.perm-panel { gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.perm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.perm-templates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.perm-grid { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .perm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.switch.perm { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.switch.perm:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.switch.perm strong { display: inline-flex; align-items: center; gap: 6px; }
.perm-note { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: 13.5px; }
.perm-note .icon { flex: none; margin-top: 2px; color: var(--accent); }
@media (min-width: 640px) { .choice-cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chip-check .avatar { width: 22px; height: 22px; font-size: 9px; }
.sent-list { list-style: none; margin: 0; padding: 0; }
.sent-list > li { border-bottom: 1px dashed var(--line); }
.sent-list > li:last-child { border-bottom: 0; }
.sent-list summary { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; list-style: none; }
.sent-list summary::-webkit-details-marker { display: none; }
.sent-list .what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sent-list .what small { color: var(--muted); font-size: 12px; }
.read-count { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--surface-3); color: var(--ink-2); }
.read-count.all { background: var(--ok-soft); color: var(--ok); }
.readers { list-style: none; margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.readers li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.readers .avatar { width: 24px; height: 24px; font-size: 9px; }
.readers small { margin-left: auto; font-size: 12px; }

/* Felicitación de cumpleaños: lluvia de confeti y tarjeta con tarta. */
.birthday { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 16px; background: rgba(10, 12, 12, .45); backdrop-filter: blur(3px); animation: modal-in .3s ease-out; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i {
    position: absolute; top: -20px; left: var(--x); width: 9px; height: 14px; border-radius: 2px; background: var(--accent);
    transform: rotate(var(--r)); animation: confetti-fall var(--t) linear var(--d) infinite;
}
.confetti i:nth-child(4n) { background: var(--gold); }
.confetti i:nth-child(4n + 1) { background: #e85d75; width: 7px; height: 7px; border-radius: 50%; }
.confetti i:nth-child(4n + 2) { background: #5ab8f0; }
@keyframes confetti-fall { to { top: 105%; transform: rotate(calc(var(--r) + 540deg)) translateX(40px); } }
.birthday-card {
    position: relative; max-width: 380px; padding: 30px 28px 24px; text-align: center; border-radius: 24px;
    background: var(--surface); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); animation: celebrate-pop .5s cubic-bezier(.2, 1.4, .4, 1);
}
.birthday-cake {
    display: inline-grid; place-items: center; width: 88px; height: 88px; margin-bottom: 10px; border-radius: 50%;
    background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); animation: cake-bounce 1.4s ease-in-out infinite;
}
@keyframes cake-bounce { 50% { transform: translateY(-6px) rotate(-4deg); } }
.birthday-card small { display: block; color: var(--muted); }
.birthday-card h2 { margin: 6px 0 8px; font-size: 1.5rem; color: var(--accent); }
.birthday-card p { margin: 0 0 18px; color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } .birthday-cake { animation: none; } }

/* Notificación recibida al momento: aviso emergente con campana que suena. */
.toast-stack { position: fixed; top: 16px; right: 16px; z-index: 120; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast {
    position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px 14px 14px; overflow: hidden; color: inherit; cursor: pointer;
    border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 14px; background: var(--surface);
    box-shadow: 0 20px 50px -18px rgba(0, 0, 0, .45); animation: toast-in .55s cubic-bezier(.2, 1.4, .4, 1);
}
.toast.important { border-left-color: var(--warn); }
.toast.leaving { animation: toast-out .35s ease-in forwards; }
.toast-bell { position: relative; flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.toast.important .toast-bell { background: var(--warn); color: #fff; }
.toast-bell .icon { animation: bell-ring 1.2s ease-in-out 2; transform-origin: 50% 10%; }
.toast-bell::after { content: ""; position: absolute; inset: -4px; border-radius: 15px; border: 2px solid currentColor; color: var(--accent); opacity: 0; animation: ring-pulse 1.4s ease-out 3; }
.toast.important .toast-bell::after { color: var(--warn); }
.toast-body { flex: 1; min-width: 0; }
.toast-body small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.toast.important .toast-body small { color: var(--warn); }
.toast-body strong { display: block; margin: 2px 0; }
.toast-body span { display: block; font-size: 13px; color: var(--muted); }
.toast-close { flex: none; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 4px; }
.toast-progress { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); animation: toast-progress 10s linear forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(110%) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(110%); } }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
@keyframes ring-pulse { from { opacity: .8; transform: scale(.9); } to { opacity: 0; transform: scale(1.35); } }
@keyframes toast-progress { from { width: 100%; } to { width: 0; } }
/* El contador del menú late cuando cambia. */
.nav-count.bump { animation: count-bump .6s cubic-bezier(.2, 1.8, .4, 1) 2; }
@keyframes count-bump { 50% { transform: scale(1.5); } }

/* Editor de texto con formato (<x-rich-editor>). */
.rich-editor { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.rich-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.rich-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.rich-toolbar button { min-width: 32px; height: 30px; padding: 0 8px; border: 0; border-radius: 7px; background: none; color: var(--ink-2); font: inherit; font-size: 14px; cursor: pointer; display: inline-grid; place-items: center; }
.rich-toolbar button:hover { background: var(--surface-3); color: var(--ink); }
.rich-toolbar button.on { background: var(--accent-soft); color: var(--accent); }
.rich-toolbar .sep { width: 1px; height: 20px; margin: 0 4px; background: var(--line-strong); }
.rich-area { min-height: 160px; max-height: 420px; overflow-y: auto; padding: 12px 14px; outline: none; line-height: 1.55; }
.rich-area:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rich-area p, .notice-text p { margin: 0 0 8px; }
.rich-area h3, .notice-text h3 { margin: 10px 0 6px; font-size: 1.05rem; }
.rich-area blockquote, .notice-text blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--ink-2); }
.rich-area ul, .rich-area ol, .notice-text ul, .notice-text ol { margin: 6px 0; padding-left: 22px; }
.notice-text a { text-decoration: underline; }
.notice-text { margin: 6px 0; line-height: 1.55; }

/* Adjuntos de una notificación. */
.notice-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.notice-file { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 10px; color: inherit; background: var(--surface); max-width: 280px; }
.notice-file:hover { border-color: var(--accent); }
.notice-file .doc-icon { width: 32px; height: 36px; font-size: 9px; }
.notice-file span:last-child { min-width: 0; display: flex; flex-direction: column; }
.notice-file strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-file small { color: var(--muted); font-size: 11px; }

/* Conversación de una notificación: burbujas como en un chat. */
.thread { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.bubble { display: flex; gap: 8px; align-items: flex-end; max-width: 85%; }
.bubble .avatar { width: 28px; height: 28px; font-size: 10px; }
.bubble > div { padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--line); }
.bubble p { margin: 0 0 3px; font-size: 14px; }
.bubble small { font-size: 11px; color: var(--muted); }
.bubble.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble.mine > div { border-radius: 14px 14px 4px 14px; background: var(--accent-soft); border-color: transparent; }
.reply-box { display: flex; gap: 8px; align-items: flex-end; }
.reply-box textarea { min-height: 42px; flex: 1; }
.reader { display: flex; align-items: center; gap: 8px; width: 100%; color: inherit; }
.reader:hover { color: var(--accent); }

/* Pestañas segmentadas («Semana | Mes»). */
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-3); }
.seg a { padding: 5px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.seg a.on { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg a:not(.on):hover { color: var(--ink); }

/* Calendario cargando por detrás (navegación sin recargar). */
#semana { transition: opacity .15s; }
#semana.loading { opacity: .55; pointer-events: none; }

/* Vista mensual del calendario de trabajo. */
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.month-head { padding: 0 4px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.month-day {
    position: relative; display: flex; flex-direction: column; gap: 3px; min-height: 92px; padding: 6px; color: inherit;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color .15s, transform .15s;
}
.month-day:hover { border-color: var(--accent); transform: translateY(-1px); }
.month-day.weekend { background: var(--surface-2); }
.month-day.out { opacity: .4; }
.month-num { font-weight: 700; font-size: 13px; }
.month-day .slot { font-size: 10.5px; padding: 2px 5px; }
.month-hours { margin-top: auto; font-size: 11px; color: var(--muted); }
.month-hours strong { color: var(--ink); }
.month-day.ok { box-shadow: inset 0 -3px 0 var(--ok); }
.month-day.under { box-shadow: inset 0 -3px 0 var(--danger); }
.month-day.over { box-shadow: inset 0 -3px 0 var(--gold); }
.month-day.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.month-day.today .month-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.legend.ok-dot::before { background: var(--ok); }
.legend.under-dot::before { background: var(--danger); }
.legend.over-dot::before { background: var(--gold); }
@media (max-width: 720px) {
    .month-grid { gap: 3px; }
    .month-day { min-height: 58px; padding: 4px; }
    .month-day .slot, .month-hours { display: none; }
    .month-day .slot.away { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
}

/* 10e. Vacaciones y ausencias ------------------------------------------------ */
.balance-card { padding: 18px 20px; }
.balance-main { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.balance-main .chip-icon { width: 46px; height: 46px; border-radius: 14px; }
.balance-big { display: block; font-size: 1.9rem; letter-spacing: -.02em; line-height: 1.1; }
.balance-big small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.balance-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--accent-soft); }
.balance-bar .approved { background: var(--accent); }
.balance-bar .pending { background: repeating-linear-gradient(135deg, var(--gold) 0 5px, color-mix(in srgb, var(--gold) 55%, transparent) 5px 10px); }
.balance-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend.b-approved::before { background: var(--accent); }
.legend.b-pending::before { background: var(--gold); }
.legend.b-free::before { background: var(--accent-soft); border: 1px solid var(--accent); }

.abs-toolbar { flex-wrap: wrap; gap: 10px; }
.abs-title { min-width: 150px; text-align: center; text-transform: capitalize; }
.switch.small { font-size: 13px; align-items: center; }
.switch.small .switch-track { margin-top: 0; }
.abs-legend { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 20px 0; }
.type-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12.5px; cursor: pointer; transition: opacity .15s; }
.type-chip i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.type-chip[aria-pressed="false"] { opacity: .4; text-decoration: line-through; }
.type-chip.static { cursor: default; }
.pending-chip i { background: repeating-linear-gradient(135deg, var(--muted) 0 3px, transparent 3px 6px); border: 1px solid var(--muted); }
.holiday-chip i { background: var(--danger-soft); border: 1px solid var(--danger); }

/* Meses del calendario: 1, 3 o 12 a la vista. */
.abs-months { display: grid; gap: 18px; grid-template-columns: 1fr; }
.abs-months.v3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.abs-months.v12 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.abs-month h3 { margin: 0 0 8px; font-size: .95rem; text-transform: capitalize; }
.abs-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.abs-grid.no-weekends { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.abs-dow { padding-bottom: 2px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: center; }
.abs-day {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 64px; padding: 5px 6px;
    border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
    transition: border-color .12s, transform .12s;
}
.v3 .abs-day { min-height: 40px; }
.v12 .abs-day { min-height: 0; aspect-ratio: 1; padding: 2px; align-items: center; justify-content: center; font-size: 11px; border-radius: 6px; }
.abs-day:hover { border-color: var(--accent); transform: translateY(-1px); }
.abs-day.blank { visibility: hidden; }
.abs-day.off { background: var(--surface-2); color: var(--muted); }
.abs-day.holiday { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.abs-day.today { box-shadow: 0 0 0 2px var(--accent); }
.abs-day.absent { background: var(--c); border-color: var(--c); color: #fff; }
.abs-day.absent.pending { background: repeating-linear-gradient(135deg, var(--c) 0 6px, color-mix(in srgb, var(--c) 55%, #fff) 6px 12px); }
.abs-day .tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 600; }
.v3 .abs-day .tag, .v12 .abs-day .tag { display: none; }
.abs-day.selected { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.abs-day.sel-edge { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.abs-summary { padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 13.5px; }
.abs-summary.warn { background: var(--warn-soft); color: var(--warn); }
.abs-summary strong { font-size: 1.15rem; }
@media (max-width: 720px) {
    .abs-day { min-height: 44px; font-size: 12px; }
    .abs-day .tag { display: none; }
}

/* Mis solicitudes en tarjetas. */
.request-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.request-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 12px; background: var(--surface); }
.request-card.status-rechazada, .request-card.status-cancelada { opacity: .6; }
.request-date { flex: none; width: 46px; padding: 4px 0; border-radius: 10px; text-align: center; background: color-mix(in srgb, var(--c) 14%, transparent); }
.request-date strong { display: block; font-size: 1.2rem; line-height: 1.1; }
.request-date small { text-transform: uppercase; font-size: 10.5px; font-weight: 600; }
.request-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.request-body small { font-size: 12.5px; color: var(--muted); }

/* Emails enviados. */
.filter-bar { flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
.filter-bar select { width: auto; min-width: 160px; }
.email-table td { vertical-align: top; }
.open-state { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 13px; }
.open-state.yes { color: var(--ok); }
.open-state.no { color: var(--muted); }
.email-table .person small { display: block; }

.request-card { flex-wrap: wrap; }

/* Panel de ausencias del equipo. */
.pending-absences { display: flex; flex-direction: column; gap: 10px; }
.pending-absence { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 12px; }
.pending-absence.is-cancel { background: color-mix(in srgb, var(--warn-soft) 45%, var(--surface)); }
.pa-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pa-person > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pa-person small { color: var(--ink-2); }
.pa-actions { display: flex; gap: 6px; align-items: flex-start; grid-row: span 2; }
.overlap-warning { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 9px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.overlap-warning > .icon { flex: none; margin-top: 2px; }
.overlap-person { display: inline-flex; align-items: center; gap: 5px; margin: 2px 6px 0 0; padding: 1px 8px; border-radius: 999px; background: var(--surface); color: var(--ink-2); }
.overlap-person::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.overlap-ok { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ok); }
@media (max-width: 720px) { .pending-absence { grid-template-columns: 1fr; } .pa-actions { grid-row: auto; } }

.legend-sep { width: 1px; height: 22px; margin: 0 4px; background: var(--line-strong); }
.type-chip.small { font-size: 11.5px; padding: 3px 8px; }
.type-chip i.round, .team-ev i.round { border-radius: 50%; }
.team-ev {
    display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 7px; border-radius: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    font-size: 11.5px; font-weight: 600; color: #fff; background: var(--c);
}
.team-ev i { flex: none; width: 7px; height: 7px; border: 1.5px solid #fff; }
.team-ev.pending { background: repeating-linear-gradient(135deg, var(--c) 0 5px, color-mix(in srgb, var(--c) 55%, #fff) 5px 10px); }
[data-person].person-hidden { display: none !important; }
.busy-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 4px; border-radius: 999px; background: var(--warn); color: #fff; font-size: 10.5px; font-weight: 700; vertical-align: middle; }
.legend.busy-dot::before { background: var(--warn); }

.team-week th { white-space: nowrap; text-align: center; }
.team-week th:first-child { text-align: left; }
.team-week th.today { color: var(--accent); }
.team-week td { padding: 6px; text-align: center; }
.team-week td:first-child { text-align: left; white-space: nowrap; }
.team-week .weekend { background: var(--surface-2); }
.holiday-name { display: block; font-weight: 500; color: var(--danger); text-transform: none; letter-spacing: 0; }

.team-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.team-day { display: flex; flex-direction: column; gap: 3px; min-height: 96px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.team-day.weekend { background: var(--surface-2); }
.team-day.out { opacity: .4; }
.team-day.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.team-day.busy { border-color: color-mix(in srgb, var(--warn) 60%, transparent); background: color-mix(in srgb, var(--warn-soft) 60%, var(--surface)); }

.team-year { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.tym-title { display: block; margin-bottom: 6px; font-weight: 700; color: inherit; }
.tym-title:hover { color: var(--accent); }
.tym-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.tym-day { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 6px; font-size: 10.5px; background: var(--surface); border: 1px solid var(--line); }
.tym-day.weekend { background: var(--surface-2); color: var(--muted); }
.tym-day.holiday { background: var(--danger-soft); color: var(--danger); }
.tym-day.today { box-shadow: 0 0 0 2px var(--accent); }
.tym-day.busy { background: var(--warn-soft); border-color: var(--warn); }
.tym-dots { position: absolute; bottom: 2px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; }
.tym-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.tym-dots i.pending { background: none; border: 1.5px solid var(--c); }

.assign-card > summary { cursor: pointer; list-style: none; }
.assign-card > summary::-webkit-details-marker { display: none; }
.assign-card[open] .person-card-chevron { transform: rotate(90deg); }
.period-box { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.period-box h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: .9rem; }
.period-box .muted { margin: 0; }
.period-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.period-list li { display: grid; grid-template-columns: 12px auto; column-gap: 8px; align-items: center; font-size: 13.5px; }
.period-list li i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.period-list li small { grid-column: 2; color: var(--muted); }
@media (max-width: 720px) {
    .team-month { gap: 3px; }
    .team-day { min-height: 60px; padding: 3px; }
    .team-ev { font-size: 9.5px; padding: 1px 4px; }
}

/* Ventana de confirmación propia (data-confirm). */
.confirm-modal .confirm-icon { animation: confirm-wobble .6s ease .15s; }
.confirm-modal.tone-danger .confirm-icon { background: var(--danger-soft); color: var(--danger); }
.confirm-modal.tone-warn .confirm-icon { background: var(--warn-soft); color: var(--warn); }
.confirm-modal.tone-info .confirm-icon { background: var(--accent-soft); color: var(--accent); }
.confirm-modal.tone-danger [data-confirm-ok-button] { background: var(--danger); border-color: var(--danger); }
.confirm-text { margin: 0; line-height: 1.55; color: var(--ink-2); }
.confirm-reason { margin-top: 12px; }
@keyframes confirm-wobble { 0%, 100% { transform: none; } 25% { transform: rotate(-10deg) scale(1.08); } 50% { transform: rotate(8deg) scale(1.08); } 75% { transform: rotate(-4deg); } }

/* 13b. Pantalla de acceso: panel de marca + formulario. */
.login-page { background: var(--bg); }
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .login { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.login-hero {
    position: relative; overflow: hidden; display: none; flex-direction: column; justify-content: space-between; gap: 30px; padding: 48px 56px;
    color: #fff; background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--gold) 45%, transparent), transparent 55%), linear-gradient(150deg, var(--accent), var(--accent-2));
}
@media (min-width: 900px) { .login-hero { display: flex; } }
.login-hero-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; font-size: 1.15rem; }
.login-hero-brand .brand-mark { width: 44px; height: 44px; background: rgba(255, 255, 255, .16); box-shadow: none; }
.login-logo { display: grid; place-items: center; height: 46px; max-width: 150px; padding: 6px 10px; border-radius: 12px; background: #fff; }
.login-logo img { max-height: 100%; max-width: 100%; object-fit: contain; }
.login-hero-clock { position: relative; z-index: 1; display: flex; flex-direction: column; }
.login-time { font-size: clamp(64px, 8vw, 112px); font-weight: 600; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.login-date { margin-top: 8px; font-size: 1.2rem; opacity: .85; }
.login-hero-text { position: relative; z-index: 1; max-width: 420px; margin: 0; font-size: 1.05rem; line-height: 1.6; opacity: .9; }
.login-orb { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .08); animation: orb-float 12s ease-in-out infinite; }
.login-orb.one { width: 420px; height: 420px; right: -140px; bottom: -120px; }
.login-orb.two { width: 220px; height: 220px; right: 120px; top: -80px; animation-delay: -6s; }
@keyframes orb-float { 50% { transform: translate(-20px, 18px) scale(1.04); } }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 32px 18px; }
.login-card { width: 100%; max-width: 410px; padding: 32px 30px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow), 0 30px 60px -30px rgba(0, 0, 0, .25); animation: modal-in .45s ease-out; }
.login-card h1 { margin: 0 0 4px; font-size: 1.6rem; }
.login-card > p.muted { margin: 0 0 22px; }
.login-eyebrow { display: block; margin-bottom: 8px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.login-farewell { display: flex; gap: 12px; margin-bottom: 24px; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; background: var(--surface-2); }
.login-farewell-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; }
.login-farewell > div { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.login-farewell strong { font-size: 14.5px; }
.login-farewell small, .login-farewell-note { color: var(--muted); }
.login-mobile-brand { margin-bottom: 20px; }
@media (min-width: 900px) { .login-mobile-brand { display: none; } }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 40px; min-height: 48px; }
.input-icon:focus-within > .icon { color: var(--accent); }
.input-icon [data-password-toggle] { top: 6px; }
.login-submit { min-height: 50px; font-size: 15px; justify-content: center; }
.login-help { display: flex; gap: 8px; align-items: flex-start; margin: 20px 0 0; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; color: var(--muted); }
.login-help .icon { flex: none; margin-top: 2px; }
.login-foot { font-size: 12px; text-align: center; }

/* 9b. Bloque de fichaje del panel del empleado. */
.punch-card { padding: 22px 22px 18px; text-align: center; }
.punch-top { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 12px; }
.punch-top .state { margin: 0; }
.state.done { background: var(--accent-soft); color: var(--accent); }
.state.done .pulse { background: var(--accent); }
.today-plan { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.today-plan .slot { font-weight: 600; }
.today-plan.away { color: var(--warn); }
.punch-clock { margin: 22px auto 20px; padding: 18px 16px 16px; max-width: 420px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); }
.punch-clock-label { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--accent); background: var(--accent-soft); }
.punch-card .clock { font-size: clamp(3.2rem, 14vw, 4.6rem); }
.punch-actions { display: grid; gap: 10px; max-width: 420px; margin: 0 auto; grid-template-columns: 1fr 1fr; }
.punch-actions form.punch-primary { grid-column: 1 / -1; }
.punch-actions form:only-child { grid-column: 1 / -1; }
.punch-actions form:nth-child(2):last-child { grid-column: 1 / -1; }  /* un solo botón secundario: ancho completo */
.punch-btn { min-height: 56px; font-size: 1rem; border-radius: 16px; gap: 10px; justify-content: center; }
.punch-actions .punch-primary .punch-btn { min-height: 74px; font-size: 1.2rem; }
.punch-btn-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.punch-btn-text small { font-size: .88rem; font-weight: 600; opacity: .95; font-variant-numeric: tabular-nums; }
.punch-blocked { display: flex; gap: 14px; max-width: 460px; margin: 0 auto; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--line)); border-left: 3px solid var(--danger); border-radius: 14px; background: var(--surface-2); text-align: left; }
.punch-blocked-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); }
.punch-blocked > div { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.punch-blocked strong { font-size: 15.5px; }
.punch-blocked small { color: var(--muted); }
.punch-hint { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 420px; margin: 16px auto 0; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14px; color: var(--ink-2); }
.punch-hint > span { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.punch-hint.working { background: var(--ok-soft); color: var(--ok); }
.punch-hint.paused { background: var(--warn-soft); color: var(--warn); }
.progress.big { width: 100%; height: 8px; margin: 0; background: color-mix(in srgb, var(--ok) 18%, transparent); }
.progress.big span { background: var(--ok); transition: width .6s; }

/* Tu jornada de hoy: barra del día y pasos. */
.today-bar { position: relative; height: 14px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.today-bar .planned { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent) 0 6px, transparent 6px 10px); }
.today-bar .worked { position: absolute; top: 2px; bottom: 2px; border-radius: 999px; background: var(--accent); }
.today-bar .worked.break { background: var(--gold); }
.punch-steps { list-style: none; margin: 16px 0 0; padding: 0; position: relative; }
.punch-steps::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.punch-steps li { position: relative; display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.step-icon { position: relative; z-index: 1; flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 3px solid var(--surface); }
.punch-steps .type-salida .step-icon { background: var(--surface-3); color: var(--ink-2); }
.punch-steps .type-pausa_inicio .step-icon, .punch-steps .type-pausa_fin .step-icon { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); color: var(--gold); }
.punch-steps .anulado, .punch-steps .rechazado { opacity: .5; }
.punch-steps time { min-width: 44px; font-weight: 700; }
.punch-steps .what { flex: 1; min-width: 0; display: flex; flex-direction: column; color: inherit; }
.punch-steps .what small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Accesos rápidos del lateral. */
.quick-links { display: flex; flex-direction: column; padding: 6px; }
.quick-links a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: inherit; }
.quick-links a:hover { background: var(--surface-2); }
.quick-links a > .icon { flex: none; color: var(--accent); }
.quick-links span { display: flex; flex-direction: column; }
.quick-links small { color: var(--muted); font-size: 12px; }
@media (max-width: 480px) { .punch-actions { grid-template-columns: 1fr; } }

/* «Mi perfil»: tarjeta de datos del empleado. */
/* Avatar de oficio: icono fino en un solo tono grafito, sobrio y elegante. */
.avatar-pro {
    display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
    background: radial-gradient(120% 120% at 30% 20%, color-mix(in srgb, var(--ink) 72%, var(--surface)), var(--ink));
    color: var(--surface);
}
.avatar-pro .icon { width: 50%; height: 50%; stroke-width: 1.5; }
.me-card { overflow: hidden; }
.me-cover {
    position: relative; height: 120px; padding: 14px 20px; display: flex; justify-content: flex-end; align-items: flex-start;
    background:
        radial-gradient(circle at 15% 120%, rgba(255, 255, 255, .18) 0 60px, transparent 61px),
        radial-gradient(circle at 85% -20%, rgba(255, 255, 255, .14) 0 90px, transparent 91px),
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--gold) 40%, transparent), transparent 55%),
        linear-gradient(125deg, var(--accent), var(--accent-2));
}
.me-company { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .18); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .04em; backdrop-filter: blur(4px); }
.me-main { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 20px; padding: 0 24px; margin-top: -56px; }
.me-photo { position: relative; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.me-photo:hover .profile-photo-btn { transform: scale(1.08); background: var(--accent); color: var(--accent-ink); }
.me-photo:focus-visible .avatar-xl { box-shadow: 0 0 0 4px var(--accent-soft); }
.me-id { flex: 1; min-width: 220px; padding-top: 66px; }  /* el texto empieza bajo la portada; la foto la pisa */
@media (max-width: 560px) { .me-id { padding-top: 0; } }
.me-id h2 { margin: 0; font-size: 1.5rem; letter-spacing: -.02em; }
.me-id p { margin: 2px 0 10px; color: var(--muted); }
.me-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; padding: 20px 24px 6px; }
.me-facts > div { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.me-facts > div > .icon { flex: none; margin-top: 2px; padding: 6px; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); box-sizing: border-box; }
.me-facts span { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.me-facts strong { margin-top: 2px; font-size: 14.5px; color: var(--ink); }
.me-facts small { font-size: 11.5px; }
.me-picker { margin: 14px 24px 0; border: 1px dashed var(--line-strong); border-radius: 14px; }
.me-picker > summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; list-style: none; font-weight: 600; color: var(--accent); }
.me-picker > summary::-webkit-details-marker { display: none; }
.me-picker[open] > summary { border-bottom: 1px dashed var(--line); }
.me-picker form { padding: 14px; }
.avatar-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 12px 8px; }
.avatar-choice { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; text-align: center; }
.avatar-choice input { position: absolute; opacity: 0; }
.avatar-choice .avatar-pro { width: 52px; height: 52px; transition: transform .15s, box-shadow .15s; }
.avatar-choice small { font-size: 11px; line-height: 1.2; color: var(--muted); }
.avatar-choice:hover .avatar-pro { transform: scale(1.06); }
.avatar-choice input:checked + .avatar-pro { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }
.avatar-choice input:checked ~ small { color: var(--accent); font-weight: 600; }
.avatar-choice input:focus-visible + .avatar-pro { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent-soft); }
.me-note { display: flex; gap: 6px; align-items: flex-start; margin: 16px 24px 20px; font-size: 12.5px; color: var(--muted); }
.me-note .icon { flex: none; margin-top: 2px; }

/* Fichar: bloques plegados bajo la tarjeta de fichaje. */
.quick-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 22px; }
.quick-chips a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 13px; }
.quick-chips a:hover { border-color: var(--accent); color: var(--accent); }
.quick-chips .icon { color: var(--accent); }
.folds { display: flex; flex-direction: column; gap: 12px; }
.fold > .fold-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; }
.fold > .fold-head::-webkit-details-marker { display: none; }
.fold > .fold-head:hover { background: var(--surface-2); }
.fold[open] > .fold-head { border-bottom: 1px solid var(--line); }
.fold-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fold-title small { color: var(--muted); font-size: 12.5px; }
.fold-value { font-size: 1.15rem; font-weight: 700; white-space: nowrap; }
.fold-value small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.fold-chevron { color: var(--muted); transition: transform .2s; }
.fold[open] .fold-chevron { transform: rotate(90deg); }
.fold-body { padding: 14px; }
.fold-body > .card { box-shadow: none; }

/* Resumen del mes y cifras con explicación. */
.month-sentence { margin: 0 0 12px; font-size: 15px; line-height: 1.6; }
.month-bar { margin-bottom: 16px; }
.explain-tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.explain-tiles > button, .explain-tiles > .tile-link {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; text-align: left; cursor: pointer;
    border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--ink); font: inherit; transition: border-color .15s, transform .15s;
}
.explain-tiles > *:hover { border-color: var(--accent); transform: translateY(-1px); }
.explain-tiles span { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.explain-tiles span .icon { color: var(--accent); }
.explain-tiles strong { font-size: 1.4rem; letter-spacing: -.02em; }
.explain-tiles small { font-size: 12px; color: var(--muted); }
.explain-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; line-height: 1.55; color: var(--ink-2); }
[data-explain] { cursor: help; }

/* Tarjeta de perfil del menú lateral. */
.me-banner { flex: none; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow), 0 14px 30px -18px rgba(0, 0, 0, .35); }
.me-banner-photo { position: relative; display: block; height: 196px; overflow: hidden; color: #fff; background: radial-gradient(120% 120% at 20% 10%, color-mix(in srgb, var(--ink) 65%, var(--surface)), var(--ink)); }
/* Las fotos suelen ser retratos: se encuadra la parte de arriba (la cara) y el zoom crece desde ahí. */
.me-banner-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transform-origin: 50% 20%; filter: grayscale(1) contrast(1.05); transform: scale(1.02); transition: filter .5s, transform .6s cubic-bezier(.2, .8, .2, 1); }
.me-banner-photo:hover img { filter: grayscale(0); transform: scale(1.08); }
.me-banner-avatar { position: absolute; inset: 0 0 34px; display: grid; place-items: center; color: var(--surface); transition: transform .5s; }
.me-banner-avatar .icon { width: 64px; height: 64px; stroke-width: 1.3; }
.me-banner-avatar.initials { font-size: 52px; font-weight: 600; letter-spacing: -.03em; }
.me-banner-photo:hover .me-banner-avatar { transform: scale(1.08); }
.me-banner-text { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; padding: 34px 14px 12px; background: linear-gradient(to top, rgba(0, 0, 0, .72), transparent); }
.me-banner-text small { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-banner-text strong { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-banner-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 14px; }
.chrono { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.chrono small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.chrono-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line-strong); }
.chrono.running { color: var(--ink); }
.chrono.running .chrono-dot { background: #a3e635; box-shadow: 0 0 0 0 rgba(163, 230, 53, .6); animation: chrono-pulse 1.6s infinite; }
@keyframes chrono-pulse { 70% { box-shadow: 0 0 0 8px rgba(163, 230, 53, 0); } 100% { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0); } }

/* Mis fichajes: pestañas de vista y vista anual. */
.seg-lg a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-size: 13.5px; }
.year-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.year-month { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; color: inherit; background: var(--surface); transition: border-color .15s, transform .15s; }
.year-month:hover { border-color: var(--accent); transform: translateY(-2px); }
.year-month.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.ym-head { display: flex; justify-content: space-between; align-items: baseline; }
.ym-head small { font-weight: 700; font-size: 12px; }
.ym-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.ym-grid i { display: block; aspect-ratio: 1; border-radius: 4px; }
.ym-grid .ym-dow { aspect-ratio: auto; font-style: normal; font-size: 9.5px; font-weight: 700; color: var(--muted); text-align: center; }
.ym-day { background: var(--surface-3); }
.ym-day.weekend { background: var(--surface-2); }
.ym-day.ok { background: var(--ok); }
.ym-day.under { background: var(--danger); opacity: .75; }
.ym-day.over { background: var(--gold); }
.ym-day.open { background: repeating-linear-gradient(135deg, var(--warn) 0 3px, var(--warn-soft) 3px 6px); }
.ym-day.today { box-shadow: 0 0 0 2px var(--accent); }
.legend.open-dot::before { background: var(--warn); }

/* «Mi apariencia»: muestras de color y modo. */
.theme-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 10px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch-dot { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; transition: transform .15s, box-shadow .15s; }
.swatch:hover .swatch-dot { transform: scale(1.08); }
.swatch input:checked + .swatch-dot { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }
.swatch small { font-size: 11.5px; color: var(--muted); }
.swatch input:checked ~ small { color: var(--ink); font-weight: 600; }
.mode-seg { align-self: flex-start; flex-wrap: wrap; }
.mode-seg label { padding: 6px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.mode-seg input { position: absolute; opacity: 0; }
.mode-seg label:has(input:checked) { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 600; }

/* Reloj de fichar: digital o analógico, con ajustes. */
.punch-clock { position: relative; }
.analog-clock { display: none; width: 210px; height: 210px; margin: 4px auto 8px; overflow: visible; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .14)); }
.punch-clock.is-analog .analog-clock { display: block; }
.punch-clock.is-analog .clock { font-size: 1.25rem; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); }
.analog-clock .bezel { fill: none; stroke: color-mix(in srgb, var(--ink) 14%, transparent); stroke-width: 3; }
.analog-clock .face-light { stop-color: var(--surface); }
.analog-clock .face-dark { stop-color: var(--surface-2); }
.analog-clock .face { stroke: var(--line); stroke-width: 1; }
.analog-clock .tick { stroke: color-mix(in srgb, var(--ink) 28%, transparent); stroke-width: 1; stroke-linecap: round; }
.analog-clock .tick-hour { stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.analog-clock .numeral { fill: var(--ink); font: 600 15px var(--font-display); text-anchor: middle; dominant-baseline: middle; letter-spacing: -.02em; }
.analog-clock .hand-hour, .analog-clock .hand-minute { fill: var(--ink); }
.analog-clock .hand-second line { stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; }
.analog-clock .hand-second circle { fill: var(--accent); }
.analog-clock .pin { fill: var(--ink); }
.analog-clock .pin-dot { fill: var(--accent); }
/* En el digital, los segundos siguen la preferencia; en el analógico, el segundero siempre gira. */
.clock-settings { position: absolute; top: 10px; right: 10px; text-align: left; }
.clock-settings > summary { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; cursor: pointer; list-style: none; color: var(--muted); }
.clock-settings > summary::-webkit-details-marker { display: none; }
.clock-settings > summary:hover, .clock-settings[open] > summary { background: var(--surface); color: var(--accent); }
.clock-settings-pop { position: absolute; right: 0; top: 36px; z-index: 6; display: flex; flex-direction: column; gap: 10px; width: 230px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow), 0 16px 30px -16px rgba(0, 0, 0, .3); }
.clock-pref { border-top: 1px solid var(--line); }
.clock-pref .label { display: inline-flex; align-items: center; gap: 6px; }

/* Mis correcciones. */
.open-days { margin-top: 18px; border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn-soft) 40%, var(--surface)); }
.open-days .card-head h2 { color: var(--warn); }
.open-day-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.open-day { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.open-day .what { flex: 1; display: flex; flex-direction: column; }
.open-day .what small { color: var(--muted); font-size: 12px; }
.correction-form .choice-cards { grid-template-columns: 1fr; }
.correction-form .choice { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 10px; }
.correction-form .choice small { flex-basis: 100%; padding-left: 42px; }
.correction-form .choice .choice-icon { margin: 0; }
.step-n { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; }
.correction-cards { display: flex; flex-direction: column; gap: 12px; }
.correction-card { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.correction-card.status-pendiente { border-left: 4px solid var(--warn); }
.correction-card.status-aprobada { border-left: 4px solid var(--ok); }
.correction-card.status-rechazada { border-left: 4px solid var(--danger); }
.correction-card.status-cancelada { opacity: .6; }
.cc-head { display: flex; align-items: center; gap: 10px; }
.cc-head .what { flex: 1; display: flex; flex-direction: column; }
.cc-head .what small { color: var(--muted); font-size: 12px; }
.cc-change { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 8px; }
.cc-change > span { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; }
.cc-change small { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cc-old b { text-decoration: line-through; color: var(--muted); }
.cc-new { background: var(--accent-soft) !important; color: var(--accent); }
.cc-new.void { background: var(--danger-soft) !important; color: var(--danger); }
.cc-arrow { color: var(--muted); }
.cc-reason { margin: 0; font-size: 13.5px; color: var(--ink-2); font-style: italic; }
.cc-answer { display: flex; gap: 6px; align-items: flex-start; margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.cc-answer .icon { flex: none; margin-top: 3px; color: var(--accent); }
.cc-cancel { margin-top: 10px; text-align: right; }

/* 10b. Panel del administrador -------------------------------------------------- */
/* Persona con su avatar (validar fichajes, registro de jornada) y barra de progreso. */
.person:hover { color: var(--accent); }
.person small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.progress { display: block; width: 72px; height: 4px; margin: 6px 0 0 auto; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

/* Indicadores del día: también son botones que filtran el equipo. */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.kpi {
    --tone: var(--accent); --tone-soft: var(--accent-soft);
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.kpi:hover { border-color: var(--tone); }
.kpi.active { border-color: var(--tone); box-shadow: 0 0 0 2px var(--tone); }
.kpi-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--tone-soft); color: var(--tone); }
.kpi strong { display: block; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi-break { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.kpi-late { --tone: var(--danger); --tone-soft: var(--danger-soft); }
.kpi-upcoming, .kpi-absent { --tone: var(--ink-2); --tone-soft: var(--surface-3); }
.kpi.zero:not(.active) { opacity: .6; }
.kpi-late:not(.zero) strong { color: var(--danger); }
.todo-count { min-width: 26px; padding: 2px 8px; border-radius: 999px; text-align: center; font-weight: 600; font-size: 13px; background: var(--warn); color: #fff; }

/* El equipo en una línea de tiempo: persona | barra del día | horas. */
.board { padding: 8px 12px 14px; }
.board-row { display: grid; grid-template-columns: minmax(170px, 230px) minmax(0, 1fr) 84px; gap: 14px; align-items: center; padding: 8px; border-radius: 10px; color: inherit; }
a.board-row:hover { background: var(--surface-2); }
.board-scale { padding-bottom: 0; }
.board-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.board-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.board-name strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.board-status small { font-size: 12px; color: var(--muted); }
.board-status small.negative { color: var(--danger); }
.board-track { position: relative; height: 30px; border-radius: 8px; background: var(--surface-2); }
.board-scale .board-track { height: 16px; background: none; }
.board-scale .board-track span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.board-track .tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.board-track .planned {
    position: absolute; top: 3px; bottom: 3px; border-radius: 6px;
    border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.board-track .worked { position: absolute; top: 9px; bottom: 9px; border-radius: 4px; background: var(--accent); }
.board-track .worked.break { background: var(--gold); }
.board-track .worked.pending { background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(255, 255, 255, .45) 4px 7px); }
.board-track .worked.broken { background: var(--warn); }
.board-track .now { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--danger); z-index: 2; }
.board-label { position: absolute; inset: 5px auto 5px 8px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 12px; z-index: 1; }
.board-hours { text-align: right; font-size: 13px; }
.board-hours small { color: var(--muted); }
.board-hours .progress { margin-top: 5px; width: 100%; }
.state-late .board-track { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--danger) 45%, transparent); }
.state-off, .state-absent, .state-done { color: var(--muted); }
.state-off .avatar, .state-absent .avatar { opacity: .55; }
.board-empty { margin: 12px 8px 0; }
@media (max-width: 720px) {
    .board-row { grid-template-columns: 1fr auto; gap: 8px 12px; }
    .board-row .board-track { grid-column: 1 / -1; grid-row: 2; }
    .board-scale { display: none; }
}

/* Por revisar: cada bandeja con sus primeros elementos y un botón para validar. */
.review { display: flex; flex-direction: column; gap: 14px; }
.review-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.review-title span { padding: 1px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); letter-spacing: 0; }
.review-title:hover { color: var(--accent); }
.review-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--line); }
.review-item .avatar { width: 30px; height: 30px; font-size: 11px; }
.review-item .what { flex: 1; min-width: 0; display: flex; flex-direction: column; color: inherit; }
.review-item .what strong { font-size: 13.5px; }
.review-item .what small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-item .what:hover strong { color: var(--accent); }
.btn-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-soft); }
.btn-ok:hover { background: var(--ok); color: #fff; }

/* Últimos fichajes y próximas ausencias. */
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.feed li:last-child { border-bottom: 0; }
.feed time { min-width: 40px; font-weight: 600; color: var(--ink-2); }
.feed .what { flex: 1; min-width: 0; color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .what small { color: var(--muted); }
.feed .dot { margin: 0 2px; }
.feed-icon { flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.feed-icon.type-salida { background: var(--surface-3); color: var(--ink-2); }
.feed-icon.type-pausa_inicio, .feed-icon.type-pausa_fin { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }

/* Alertas legales y lectores. */
.alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.alerts li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.alerts li > .icon { flex: none; margin-top: 2px; color: var(--warn); }
.alerts li.danger > .icon { color: var(--danger); }
.alerts small { display: block; color: var(--muted); }
.more { margin-top: 12px; font-size: 13px; }
.more summary { cursor: pointer; color: var(--accent); width: fit-content; }
.more .alerts { margin-top: 12px; }
.device-row { display: flex; align-items: center; gap: 4px; padding: 6px 0; font-size: 14px; }
.device-row .what { flex: 1; }
.device-row small { display: block; color: var(--muted); font-size: 12px; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.off { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

@media (max-width: 520px) {
    .team th:nth-child(3), .team td:nth-child(3) { display: none; }  /* en el móvil se oculta la hora de entrada */
}

.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav strong { min-width: 140px; text-align: center; text-transform: capitalize; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-head { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; padding-bottom: 4px; }
.cal-day { min-height: 66px; padding: 5px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11px; overflow: hidden; }
.cal-day.blank { background: none; border-color: transparent; }
.cal-day .n { font-weight: 600; font-size: 12px; }
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-ev { display: block; margin-top: 3px; padding: 1px 5px; border-radius: 5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.pending { opacity: .5; }
@media (min-width: 760px) { .cal-day { min-height: 88px; font-size: 12px; } }

/* 11. Detalle de un fichaje: lista de datos etiqueta → valor --------------------- */
.facts { display: grid; grid-template-columns: 1fr; margin: 0; }
.facts > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts > div:last-child { border-bottom: 0; }
.facts dt { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; color: var(--ink-2); }

/* 12. Lectura de tarjeta NFC (ficha del empleado) ------------------------------ */
.nfc-reader { display: none; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); }
.nfc-reader.active { display: flex; }
.nfc-reader.done { background: var(--ok-soft); color: var(--ok); }
.nfc-reader.error { background: var(--warn-soft); color: var(--warn); }
.nfc-waves { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface); }
.nfc-reader.active:not(.done):not(.error) .nfc-waves::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid currentColor;
    animation: ripple 1.4s ease-out infinite;
}
@keyframes ripple { from { transform: scale(1); opacity: .7; } to { transform: scale(1.7); opacity: 0; } }
.nfc-reader .text { flex: 1; min-width: 0; font-size: 13.5px; }
.nfc-reader .text strong { display: block; }

/* 12b. Manual "Cómo fichar": pasos numerados, bloques con icono y preguntas */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding-left: 40px; font-size: 14.5px; }
.steps li::before {
    content: counter(step); position: absolute; left: 0; top: -2px;
    width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 600;
}
.help-item { display: flex; gap: 12px; align-items: flex-start; }
.help-item p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 10px 0 0; color: var(--ink-2); font-size: 14px; }

/* 13. Mapa y pantalla de acceso --------------------------------------------------- */
.map { height: 360px; border-radius: var(--radius-sm); border: 1px solid var(--line); z-index: 0; }
.zone-map-card { display: flex; flex-direction: column; gap: 12px; }
.zone-map { height: 440px; }
.zone-search { position: relative; display: flex; gap: 8px; }
.zone-search .input-icon { flex: 1; }
.zone-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1000; margin: 0; padding: 6px; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow), 0 16px 30px -16px rgba(0, 0, 0, .3); }
.zone-results button { display: flex; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.zone-results button:hover, .zone-results button:focus-visible { background: var(--surface-2); }
.zone-results .icon { flex: none; margin-top: 2px; color: var(--accent); }
.zone-results li.muted { padding: 9px 10px; font-size: 13.5px; }
.zone-address { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 13.5px; color: var(--ink-2); }
.zone-address .icon { flex: none; margin-top: 2px; color: var(--accent); }
.zone-radius-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.zone-radius-presets .btn.active { border-color: var(--accent); color: var(--accent); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.zone-overview { height: 260px; margin-bottom: 10px; }
.leaflet-tooltip.zone-tooltip { padding: 2px 8px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 6px rgba(0, 0, 0, .2); font-size: 12px; font-weight: 600; cursor: pointer; }
.zone-pin { display: block; width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); border: 3px solid #fff; box-shadow: 0 6px 14px -4px rgba(0, 0, 0, .45); }
a.person-link { color: inherit; text-decoration: none; }
a.person-link:hover strong { color: var(--accent); text-decoration: underline; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
    background: radial-gradient(80% 60% at 50% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%), var(--bg); }
.auth-box { width: 100%; max-width: 400px; }
.auth .brand { justify-content: center; margin-bottom: 22px; }
.auth .card-body { padding: 28px; }

/* Páginas de error (resources/views/errors). */
.error-box { max-width: 460px; }
.error-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 18px; background: var(--accent-soft); color: var(--accent); }
.error-code { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.error-box h1 { margin: 4px 0 12px; font-size: 1.45rem; }
.error-message p { margin: 0 0 10px; }
.error-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.error-actions form { margin: 0; }

/* 14. Impresión: oculta la navegación y deja solo el contenido ------------------ */
/* Cabecera del registro impreso: empresa a la izquierda, trabajador y periodo a la derecha. */
.sheet-head { align-items: flex-start; gap: 16px; }
.sheet-company { display: flex; align-items: center; gap: 12px; }
.sheet-company img { max-width: 110px; max-height: 48px; object-fit: contain; }
.sheet-company div { display: flex; flex-direction: column; }

@media print {
    .sidebar, .topbar, .overlay, .no-print { display: none !important; }
    .main { margin: 0 !important; }
    body { background: #fff; color: #000; font-size: 11px; }
    .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
    th { background: #f2f2f2; }
    .sheet { break-after: page; }
}

/* Mi perfil: peticiones de cambio de datos */
.change-list { list-style: none; margin: 0; padding: 0 20px 4px; display: grid; gap: 6px; }
.change-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: 13.5px; }
.change-list li > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }

/* Restablecer el sistema y primer acceso */
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.danger-zone .card-head h2 .icon { color: var(--danger); }
.plain-list { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.code-input { font-size: 22px; letter-spacing: .35em; text-align: center; }
.login-single { grid-template-columns: 1fr; }

/* Plantillas de email: listado y editor con vista previa */
.tpl-list { display: grid; }
.tpl-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.tpl-item:hover { background: var(--surface-2); }
.tpl-item.is-off { opacity: .6; }
.tpl-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.tpl-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.tpl-subject { font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; color: var(--muted); }
@media (max-width: 640px) { .tpl-item { flex-wrap: wrap; } .tpl-badges { width: 100%; justify-content: flex-start; padding-left: 52px; } }
.tpl-vars { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-var { padding: 4px 9px; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font: 500 12.5px ui-monospace, SFMono-Regular, Consolas, monospace; cursor: pointer; }
.tpl-var:hover { border-color: var(--accent); color: var(--accent); }
.mail-preview { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-2); }

/* Calendario laboral: totales, semana, festivos disponibles y comparación */
.hol-kpi-main strong small { font-size: 13px; font-weight: 500; color: var(--muted); }
.hol-meter { display: block; height: 5px; margin-top: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.hol-meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.hol-week { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.hol-week-day { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.hol-week-day strong { font-size: 24px; line-height: 1; }
.hol-week-day small { color: var(--muted); font-size: 12px; }
.hol-week-day.weekend { background: var(--surface-2); }
.hol-week-day.holiday { border-color: var(--danger); background: var(--danger-soft); }
.hol-week-day.holiday small { color: var(--danger); font-weight: 600; }
.hol-week-day.today { box-shadow: 0 0 0 2px var(--accent); }
.hol-dow { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.team-day.is-holiday { background: var(--danger-soft); }
.legend.hol-dot::before { background: var(--danger); }
.hol-catalog { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hol-catalog li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; }
.hol-catalog li.is-active { background: var(--surface-2); opacity: .75; }
.hol-catalog li.on-weekend:not(.is-active) { border-style: dashed; }
.hol-catalog .check > span { display: flex; flex-direction: column; gap: 1px; }
.hol-compare-form { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.hol-side { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; }
.hol-compare .hol-totals td { background: var(--surface-2); }
.hol-yes { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); }

.email-stop { align-items: center; flex-wrap: wrap; }
.email-stop > span { flex: 1; min-width: 200px; }
.hol-compare-form .row select { width: auto; min-width: 150px; flex: 1; }
.hol-compare-form .row { flex: 1; min-width: 260px; flex-wrap: nowrap; }
.hol-compare-form .row select[name$="_anio"] { flex: none; min-width: 96px; }
.hol-side { flex: none; }

.badge-gold { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }
.hol-move { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.timeline li form + form { margin-left: 4px; }

/* Diseño de los emails: formulario, logo y vista previa real */
.mail-design { gap: 0; }
.mail-logo-row { display: flex; align-items: center; gap: 12px; }
.mail-logo-box { display: grid; place-items: center; flex: none; width: 120px; height: 56px; padding: 8px; border: 1px dashed var(--line); border-radius: 12px; background: #fff; color: var(--muted); }
.mail-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.color-input { width: 64px; height: 42px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: none; }
.mail-frame { display: block; width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 14px; background: #f4f3ef; }
.hol-active li { flex-wrap: wrap; row-gap: 6px; }
.hol-active .what { flex: 1 1 160px; min-width: 0; }
.hol-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }

/* Marca con logo: el logo (ya lleva el nombre) y debajo «Registro de jornada». */
/* Centrado, y el subtítulo entre dos líneas finas: — REGISTRO DE JORNADA — */
.brand.has-logo { flex-direction: column; align-items: center; gap: 8px; padding: 2px 8px; }
.brand.has-logo .brand-logo { max-width: 190px; height: 44px; place-items: center; }
.brand-sub { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 210px; font-size: 9.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.brand-sub::before, .brand-sub::after { content: ""; flex: 1; height: 1px; background: var(--line-strong, var(--line)); }

/* Restablecer el sistema: zona de riesgo con pasos, alcance con números y lo que se conserva */
.reset-hero { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px 18px; margin-bottom: 18px; padding: 20px 22px; border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--line)); border-radius: var(--radius, 16px); background: linear-gradient(120deg, var(--danger-soft), var(--surface) 70%); }
.reset-hero-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--danger); color: #fff; box-shadow: 0 10px 22px -12px var(--danger); }
.reset-hero-text { display: flex; flex-direction: column; gap: 3px; font-size: 14px; color: var(--ink-2); }
.reset-hero-text strong { font-size: 17px; color: var(--danger); }
.reset-steps { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.reset-steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }
.reset-steps li > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-size: 12px; }
.reset-steps li.current { border-color: var(--danger); color: var(--danger); }
.reset-steps li.current > span { background: var(--danger); color: #fff; }
.reset-steps li.done { color: var(--ok); }
.reset-steps li.done > span { background: var(--ok-soft); color: var(--ok); }
@media (min-width: 900px) { .reset-hero { grid-template-columns: auto 1fr auto; } .reset-steps { grid-column: auto; } }
.reset-card { border-top: 3px solid var(--danger); }
.reset-confirm { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px dashed color-mix(in srgb, var(--danger) 40%, var(--line)); border-radius: 12px; background: var(--surface-2); }
.reset-confirm label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.reset-confirm code { padding: 1px 6px; border-radius: 6px; background: var(--danger-soft); color: var(--danger); font-weight: 700; letter-spacing: .06em; }
.reset-confirm input { font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.reset-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.reset-actions small { display: inline-flex; align-items: center; gap: 6px; flex: 1; min-width: 200px; }
.reset-actions .btn[disabled] { opacity: .45; cursor: not-allowed; }
.reset-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.reset-counts > div { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.reset-counts .icon { color: var(--danger); margin-bottom: 4px; }
.reset-counts strong { font-size: 18px; line-height: 1.1; }
.reset-counts small { font-size: 11.5px; color: var(--muted); }
.reset-note { margin: 12px 0 0; font-size: 12.5px; }
.reset-keep { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 13.5px; }
.reset-keep li { display: flex; gap: 10px; align-items: flex-start; }
.reset-keep li > .icon { flex: none; margin-top: 2px; color: var(--ok); }
.reset-keep code, .reset-hero code { font-size: 11.5px; overflow-wrap: anywhere; }
.reset-backups { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.reset-backups .label { width: 100%; }
.reset-layout { align-items: start; }
@media (min-width: 1100px) { .reset-layout { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } }
.reset-actions small { flex: 1 1 100%; min-width: 0; }
.reset-actions .btn-danger { margin-left: auto; }
.mail-preview .mail-frame { border: 0; border-radius: 0; }
.mail-preview-subject { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.mail-preview-subject small { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
/* Editor de plantillas: la vista previa necesita sitio; en dos columnas solo en pantallas anchas. */
@media (min-width: 760px) and (max-width: 1199px) { .tpl-editor.grid-2 { grid-template-columns: 1fr; } }
