@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap");

:root {
    --font-ui: "Plus Jakarta Sans", "Aptos", "Segoe UI", sans-serif;
    --font-display: "Sora", "Plus Jakarta Sans", "Aptos", sans-serif;
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 12px;
    --shadow-panel: 0 24px 60px rgba(7, 13, 27, 0.22);
    --shadow-soft: 0 14px 30px rgba(17, 24, 39, 0.12);
    /* ==================== COLOR DE MARCA ====================
       Azul del logo (texto "Turno"). ESTE ES EL UNICO LUGAR A EDITAR para
       cambiar el color base de toda la aplicacion: todo lo demas deriva de
       aqui (--accent*, sombras, bordes y fondos suaves).
       --brand-blue-rgb debe ser EL MISMO color en componentes RGB, porque
       lo consumen los rgba() de sombras/bordes.
       OJO: los colores de TURNO (p.ej. "Noche" #1d6cff) son semanticos y
       NO dependen de esta variable; viven en js/turnoColors.js. */
    --brand-blue: #10498b;
    --brand-blue-rgb: 16, 73, 139;
    --brand-blue-dark: #0d3a6f;

    --accent: var(--brand-blue);
    --accent-2: var(--brand-blue-dark);
    --accent-soft: rgba(var(--brand-blue-rgb), 0.16);
    --green: #22c55e;
    --blue: #2477ee;
    --purple: #8f2cc9;
    --teal: #14b8a6;
    --yellow: #f0b100;
    --orange: #f97316;
    --red: #ef4444;
    --muted: #9ca3af;
    --timeline-holiday: rgba(239, 68, 68, 0.12);
}

/* Editor de rotativas dentro de Ajustes del sistema. */
.sx-section-head--actions,
.sx-rotation-builder__head,
.sx-subhead,
.sx-inline-actions,
.sx-rotation-builder__actions,
.sx-rotation-card,
.sx-shift-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sx-section-head--actions > div:first-child,
.sx-rotation-builder__head > div:first-child,
.sx-rotation-card > div:first-child,
.sx-shift-row > div {
    min-width: 0;
}

.sx-inline-actions,
.sx-rotation-builder__actions,
.sx-rotation-card__actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.sx-rotation-builder,
.sx-shift-editor {
    margin: 18px 0 24px;
    padding: 16px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--panel-alt);
}

.sx-rotation-builder h3,
.sx-shift-editor h3,
.sx-subhead h3 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    letter-spacing: 0;
}

.sx-rotation-builder p,
.sx-shift-editor p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

.sx-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.sx-rotation-palette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin: 16px 0;
}

.sx-rotation-shift {
    display: grid;
    grid-template-columns: 12px 1fr;
    gap: 2px 8px;
    min-height: 56px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--panel);
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.sx-rotation-shift.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(24, 117, 209, .14);
}

.sx-rotation-shift:disabled,
.sx-pattern-day:disabled {
    cursor: default;
    opacity: .78;
}

.sx-rotation-shift:disabled:hover,
.sx-pattern-day:disabled:hover {
    background: var(--panel);
}

.sx-rotation-shift strong,
.sx-rotation-shift small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sx-rotation-shift small {
    grid-column: 2;
    color: var(--text-muted);
    font-size: 11px;
}

.sx-rotation-shift__swatch {
    width: 10px;
    height: 28px;
    border-radius: 3px;
    background: #cbd5e1;
}

.sx-rotation-shift__swatch[data-turn="1"] { background: #f59e0b; }
.sx-rotation-shift__swatch[data-turn="2"] { background: #14b8a6; }
.sx-rotation-shift__swatch[data-turn="3"] { background: #ef4444; }
.sx-rotation-shift__swatch[data-turn="4"] { background: #8b5cf6; }
.sx-rotation-shift__swatch[data-turn="8"] { background: #2563eb; }

.sx-pattern-weekdays,
.sx-pattern-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.sx-pattern-weekdays span {
    padding: 6px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.sx-pattern-calendar {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--border);
    gap: 1px;
}

.sx-pattern-day {
    position: relative;
    min-width: 0;
    min-height: 62px;
    padding: 7px;
    border: 0;
    background: var(--panel);
    color: var(--text-muted);
    text-align: left;
    cursor: pointer;
}

.sx-pattern-day:hover { background: var(--panel-hover); }
.sx-pattern-day.has-shift { box-shadow: inset 0 -5px #cbd5e1; }
.sx-pattern-day[data-turn="1"] { box-shadow: inset 0 -5px #f59e0b; }
.sx-pattern-day[data-turn="2"] { box-shadow: inset 0 -5px #14b8a6; }
.sx-pattern-day[data-turn="3"] { box-shadow: inset 0 -5px #ef4444; }
.sx-pattern-day[data-turn="4"] { box-shadow: inset 0 -5px #8b5cf6; }
.sx-pattern-day[data-turn="8"] { box-shadow: inset 0 -5px #2563eb; }

.sx-pattern-day span {
    display: block;
    font-size: 11px;
}

.sx-pattern-day strong {
    display: block;
    margin-top: 8px;
    overflow: hidden;
    color: var(--text);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sx-pattern-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    border: 1px dashed var(--border-strong);
    border-radius: 8px;
    background: var(--panel);
}

.sx-pattern-status.is-recognized {
    border-style: solid;
    border-color: #22a06b;
    background: rgba(34, 160, 107, .1);
}

.sx-pattern-status strong,
.sx-pattern-status span {
    display: block;
}

.sx-pattern-status span {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
}

.sx-rotation-builder__actions {
    justify-content: flex-end;
    margin-top: 14px;
}

.sx-rotation-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
    gap: 18px;
}

.sx-subhead {
    margin-bottom: 8px;
}

.sx-subhead span {
    min-width: 26px;
    padding: 3px 7px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.sx-rotation-list,
.sx-shift-list {
    display: grid;
    gap: 7px;
}

.sx-rotation-card,
.sx-shift-row {
    min-height: 58px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--panel);
}

.sx-rotation-card strong,
.sx-rotation-card span,
.sx-rotation-card small,
.sx-shift-row strong,
.sx-shift-row small {
    display: block;
}

.sx-rotation-card span,
.sx-rotation-card small,
.sx-shift-row small {
    margin-top: 2px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sx-shift-row {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) 36px 36px;
}

.sx-shift-row .sx-rotation-shift__swatch {
    height: 34px;
}

.sx-icon-btn--danger { color: #c9363e; }

.sx-shift-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.sx-shift-form label:not(.sx-check-row) {
    display: grid;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.sx-shift-form input,
.sx-shift-form select {
    width: 100%;
    min-height: 40px;
    padding: 7px 9px;
    border: 1px solid var(--border-strong);
    border-radius: 7px;
    background: var(--field);
    color: var(--text);
}

.sx-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.sx-check-row input { width: 18px; min-height: 18px; }

@media (max-width: 900px) {
    .sx-section-head--actions,
    .sx-rotation-builder__head,
    .sx-pattern-status {
        align-items: stretch;
        flex-direction: column;
    }

    .sx-rotation-columns,
    .sx-shift-form {
        grid-template-columns: 1fr;
    }

    .sx-pattern-day {
        min-height: 50px;
        padding: 5px;
    }

    .sx-pattern-day strong { font-size: 9px; }
}

/* Dialogos ejecutivos compartidos: reemplazan alert, confirm y prompt nativos. */
body.app-dialog-open {
    overflow: hidden;
}

.app-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 22px;
    background:
        radial-gradient(circle at 50% 25%, rgba(var(--brand-blue-rgb), 0.16), transparent 34%),
        rgba(5, 12, 24, 0.66);
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(10px) saturate(0.85);
    transition:
        opacity 0.18s ease,
        visibility 0.18s ease;
}

.app-dialog-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

.app-dialog-backdrop.is-closing {
    opacity: 0;
}

.app-dialog {
    --dialog-tone: var(--accent);
    --dialog-tone-soft: rgba(var(--brand-blue-rgb), 0.13);
    position: relative;
    width: min(100%, 520px);
    max-height: min(760px, calc(100vh - 44px));
    overflow: auto;
    padding: 28px;
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    color: var(--text);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 42%),
        var(--panel);
    box-shadow:
        0 32px 90px rgba(3, 10, 23, 0.34),
        0 12px 28px rgba(3, 10, 23, 0.16);
    transform: translateY(14px) scale(0.975);
    opacity: 0;
    transition:
        transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.16s ease;
}

.app-dialog-backdrop.is-visible .app-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.app-dialog--success {
    --dialog-tone: #16a35a;
    --dialog-tone-soft: rgba(34, 197, 94, 0.14);
}

.app-dialog--warning {
    --dialog-tone: #d88b06;
    --dialog-tone-soft: rgba(245, 158, 11, 0.15);
}

.app-dialog--danger {
    --dialog-tone: #e24444;
    --dialog-tone-soft: rgba(239, 68, 68, 0.14);
}

.app-dialog__accent {
    position: absolute;
    inset: 0 28px auto;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, transparent, var(--dialog-tone), transparent);
    opacity: 0.9;
}

.app-dialog__header {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

.app-dialog__icon {
    display: grid;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid var(--dialog-tone-soft);
    border-radius: 16px;
    color: var(--dialog-tone);
    background: var(--dialog-tone-soft);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.18);
}

.app-dialog__icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-dialog__heading {
    min-width: 0;
}

.app-dialog__eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--dialog-tone);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.app-dialog__heading h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.18rem, 4vw, 1.42rem);
    line-height: 1.18;
}

.app-dialog__body {
    padding: 22px 2px 6px;
}

.app-dialog__message {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.96rem;
    line-height: 1.65;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.app-dialog__field {
    display: grid;
    gap: 8px;
    margin-top: 20px;
}

.app-dialog__field-label {
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 700;
}

.app-dialog__input {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--field-border);
    border-radius: 13px;
    color: var(--text);
    background: var(--field);
    box-shadow: inset 0 1px 2px rgba(8, 20, 40, 0.04);
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease;
}

.app-dialog__input:focus {
    border-color: var(--dialog-tone);
    box-shadow: 0 0 0 4px var(--dialog-tone-soft);
}

/* Dialogo de eleccion (showChoice): una lista corta donde se marca UNA. */
.app-dialog__choices {
    display: grid;
    gap: 8px;
    margin-top: 20px;
}

.app-dialog__choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--field-border);
    border-radius: 13px;
    background: var(--field);
    cursor: pointer;
}

.app-dialog__choice:hover {
    border-color: var(--dialog-tone);
}

.app-dialog__choice:has(input:checked) {
    border-color: var(--dialog-tone);
    box-shadow: 0 0 0 3px var(--dialog-tone-soft);
}

/* El radio, a salvo de la regla general de formularios.
   `input, select, textarea { width: 100%; padding: 12px 14px; border: ...; }`
   alcanza TAMBIEN a los radio: sin este reset el circulo se estiraba como una
   barra ancha y, al quedarse con el ancho de la fila, empujaba el nombre a una
   columna angosta que lo partia en dos lineas. */
.app-dialog__choice input[type="radio"] {
    flex: none;
    width: 17px;
    height: 17px;
    /* Alineado con la PRIMERA linea del texto, no con el centro del bloque:
       las opciones traen una pista debajo y el radio quedaria flotando. */
    margin: 1px 0 0;
    padding: 0;
    border-radius: 50%;
    accent-color: var(--dialog-tone);
}

.app-dialog__choice-text {
    display: grid;
    gap: 2px;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.app-dialog__choice-hint {
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 500;
}

.app-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 22px;
}

/* Con una tercera salida (p.ej. "eliminar igual" junto a "renombrar") los
   botones se reparten en dos lineas antes que desbordar el dialogo. */
.app-dialog__actions--multi {
    flex-wrap: wrap;
}

.app-dialog__button {
    min-width: 122px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 13px;
    font-size: 0.88rem;
    font-weight: 800;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.app-dialog__button:hover {
    transform: translateY(-1px);
}

.app-dialog__button:focus-visible {
    box-shadow: 0 0 0 4px var(--dialog-tone-soft);
}

.app-dialog__button--secondary {
    border: 1px solid var(--border-strong);
    color: var(--text-soft);
    background: var(--panel-alt);
}

.app-dialog__button--secondary:hover {
    color: var(--text);
    background: var(--panel-hover);
}

.app-dialog__button--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 22px rgba(var(--brand-blue-rgb), 0.22);
}

.app-dialog__button--danger {
    background: linear-gradient(135deg, #ef5350, #cf3232);
    box-shadow: 0 10px 22px rgba(207, 50, 50, 0.22);
}

@media (max-width: 560px) {
    .app-dialog-backdrop {
        align-items: end;
        padding: 12px;
    }

    .app-dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
        padding: 23px 20px 20px;
        border-radius: 22px;
    }

    .app-dialog__actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-dialog-backdrop[data-dialog-type="alert"] .app-dialog__actions,
    .app-dialog__actions--multi {
        grid-template-columns: 1fr;
    }

    .app-dialog__button {
        width: 100%;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-dialog-backdrop,
    .app-dialog {
        transition: none;
    }
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: var(--font-ui);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-ui);
    font-feature-settings: "liga" 1, "kern" 1;
    color: var(--text);
    background:
        radial-gradient(circle at top left, var(--bg-glow-1), transparent 28%),
        radial-gradient(circle at top right, var(--bg-glow-2), transparent 22%),
        linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
    transition: background 0.25s ease, color 0.25s ease;
}

h1,
h2,
h3,
h4,
.brand-copy strong,
.panel-title,
.nav-tile span,
.calendar-month-trigger,
.swap-month-trigger,
.hhee-monthbar strong,
.clockmarks-monthbar strong {
    font-family: var(--font-display);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    pointer-events: none;
    filter: blur(80px);
    opacity: 0.45;
    z-index: 0;
}

body::before {
    width: 240px;
    height: 240px;
    top: 72px;
    left: -48px;
    background: var(--bg-orb-1);
}

body::after {
    width: 320px;
    height: 320px;
    right: -80px;
    bottom: 40px;
    background: var(--bg-orb-2);
}

body.theme-dark {
    --bg-top: #08111d;
    --bg-bottom: #0d1625;
    --bg-glow-1: rgba(24, 95, 255, 0.18);
    --bg-glow-2: rgba(11, 183, 160, 0.12);
    --bg-orb-1: rgba(var(--brand-blue-rgb), 0.24);
    --bg-orb-2: rgba(122, 92, 255, 0.16);
    --panel: rgba(10, 18, 30, 0.94);
    --panel-alt: rgba(20, 31, 48, 0.88);
    /* Version opaca de --panel-alt para el header sticky del timeline (evita que
       las filas se transparenten a traves del encabezado al scrollear). */
    --timeline-head-bg: #141e2e;
    --panel-hover: rgba(28, 42, 64, 0.92);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #f6f8fc;
    --text-soft: #b8c4d8;
    --text-muted: #8a98ad;
    --field: rgba(15, 25, 40, 0.94);
    --field-border: rgba(255, 255, 255, 0.1);
    --timeline-empty: rgba(255, 255, 255, 0.05);
    --calendar-empty: rgba(255, 255, 255, 0.04);
    --calendar-disabled: rgba(148, 163, 184, 0.16);
    --inhabil-ring: rgba(248, 113, 113, 0.9);
    --inhabil-soft: rgba(248, 113, 113, 0.16);
    --weekday: rgba(255, 255, 255, 0.8);
    --scrollbar: rgba(255, 255, 255, 0.14);
}

body.theme-light {
    --bg-top: #f4f7ff;
    --bg-bottom: #f9fbff;
    --bg-glow-1: rgba(var(--brand-blue-rgb), 0.14);
    --bg-glow-2: rgba(13, 91, 240, 0.08);
    --bg-orb-1: rgba(var(--brand-blue-rgb), 0.14);
    --bg-orb-2: rgba(20, 184, 166, 0.12);
    --panel: rgba(255, 255, 255, 0.94);
    --panel-alt: rgba(248, 250, 255, 0.96);
    --timeline-head-bg: #f6f9ff;
    --panel-hover: rgba(240, 245, 255, 0.98);
    --border: rgba(14, 26, 44, 0.08);
    --border-strong: rgba(14, 26, 44, 0.14);
    --text: #112038;
    --text-soft: #30425c;
    --text-muted: #7d8aa0;
    --field: #ffffff;
    --field-border: rgba(17, 32, 56, 0.16);
    --timeline-empty: rgba(17, 32, 56, 0.06);
    --calendar-empty: rgba(17, 32, 56, 0.04);
    --calendar-disabled: rgba(17, 32, 56, 0.08);
    --inhabil-ring: rgba(220, 38, 38, 0.78);
    --inhabil-soft: rgba(220, 38, 38, 0.1);
    --weekday: #32425a;
    --scrollbar: rgba(17, 32, 56, 0.18);
    --shadow-panel: 0 20px 50px rgba(17, 32, 56, 0.08);
    --shadow-soft: 0 14px 28px rgba(17, 32, 56, 0.08);
}

input,
select,
textarea,
label,
button {
    font: inherit;
}

button,
input,
select,
textarea,
label {
    font-family: var(--font-ui);
}

button,
input,
select,
textarea {
    outline: none;
}

button {
    border: 0;
    cursor: pointer;
}

body.app-is-busy,
body.app-is-busy * {
    cursor: wait !important;
}

body.app-is-busy .app-shell,
body.app-is-busy .turn-change-dialog-backdrop {
    pointer-events: none;
    user-select: none;
}

.app-busy-indicator {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    left: 50%;
    z-index: 240;
    display: none;
    align-items: center;
    gap: 9px;
    max-width: min(360px, calc(100vw - 24px));
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid rgba(var(--brand-blue-rgb), 0.32);
    border-radius: 14px;
    background: var(--panel);
    color: var(--text);
    box-shadow: var(--shadow-soft);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    pointer-events: none;
    transform: translateX(-50%);
}

body.app-is-busy .app-busy-indicator {
    display: flex;
}

.app-busy-indicator__spinner {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border: 2px solid rgba(var(--brand-blue-rgb), 0.22);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: app-busy-spin 0.7s linear infinite;
}

@keyframes app-busy-spin {
    to {
        transform: rotate(360deg);
    }
}

input,
select,
textarea {
    width: 100%;
    font-family: var(--font-ui);
    font-size: 0.96rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    border: 1px solid var(--field-border);
    background: var(--field);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea {
    resize: vertical;
    min-height: 92px;
}

input::placeholder {
    color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(var(--brand-blue-rgb), 0.48);
    box-shadow: 0 0 0 4px rgba(var(--brand-blue-rgb), 0.12);
}

input:disabled,
select:disabled,
textarea:disabled {
    cursor: default;
    opacity: 1;
    color: var(--text);
    background: var(--panel-alt);
    border-color: var(--border);
    box-shadow: none;
}

body.theme-light input,
body.theme-light select,
body.theme-light textarea {
    background-color: #fff;
    border-color: rgba(17, 32, 56, 0.16);
    color: #0f172a;
}

body.theme-light input:disabled,
body.theme-light select:disabled,
body.theme-light textarea:disabled,
body.theme-light input[readonly],
body.theme-light textarea[readonly] {
    background-color: #fff;
    border-color: rgba(17, 32, 56, 0.14);
    color: #26364d;
    -webkit-text-fill-color: #26364d;
}

select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 2px),
        calc(100% - 14px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    color: var(--text);
}

svg {
    display: block;
}

.hidden {
    display: none !important;
}

.app-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 18px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 6px 16px;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    background: transparent;
    box-shadow: 0 18px 32px rgba(var(--brand-blue-rgb), 0.18);
}

.brand-mark.brand-mark--wide {
    width: clamp(170px, 24vw, 280px);
    height: 46px;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
}

.brand-mark svg {
    width: 28px;
    height: 28px;
}

.brand-logo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.brand-mark--wide .brand-logo {
    object-position: left center;
    opacity: 0.9;
    filter: saturate(0.98) contrast(1.04);
}

.brand-logo--dark {
    display: none;
}

body.theme-dark .brand-logo--light {
    display: none;
}

body.theme-dark .brand-logo--dark {
    display: block;
    opacity: 0.96;
    filter: drop-shadow(0 0 14px rgba(45, 212, 191, 0.22));
}

.brand-copy {
    display: grid;
    gap: 4px;
}

.brand-copy strong {
    color: #2c7be5;
    font-size: clamp(1.5rem, 2vw, 2.35rem);
    letter-spacing: -0.055em;
    line-height: 0.95;
}

.brand-accent {
    color: #72ba6a;
}

.brand-copy span {
    font-size: 0.92rem;
    color: var(--text-muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-install-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid rgba(45, 212, 191, 0.42);
    border-radius: 14px;
    color: #ecfeff;
    background: linear-gradient(135deg, #0d72d9, #0f9f98);
    box-shadow: 0 10px 24px rgba(13, 114, 217, 0.2);
    font: 800 0.78rem/1 var(--font-ui);
    letter-spacing: -0.01em;
    white-space: nowrap;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        filter 0.2s ease,
        box-shadow 0.2s ease;
}

.pwa-install-button[hidden] {
    display: none;
}

.pwa-install-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 14px 28px rgba(13, 114, 217, 0.28);
}

.pwa-install-button:focus-visible {
    outline: 3px solid rgba(45, 212, 191, 0.28);
    outline-offset: 3px;
}

.pwa-install-button:disabled {
    cursor: wait;
    opacity: 0.68;
    transform: none;
}

.pwa-install-button svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.pwa-install-gate-button:not([hidden]) {
    display: none;
}

body.auth-gate-active .topbar .pwa-install-button {
    display: none;
}

body.auth-gate-active .pwa-install-gate-button:not([hidden]) {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
    z-index: 130;
    display: inline-flex;
}

.mobile-menu-toggle,
.mobile-panel-toggle {
    display: none;
}

.profile-viewer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--text-soft);
    font-size: 0.86rem;
}

.profile-viewer label {
    white-space: nowrap;
}

.profile-viewer__field {
    display: inline-flex;
    align-items: center;
    min-width: 220px;
    max-width: 300px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    overflow: hidden;
}

.profile-viewer__field input {
    width: 100%;
    min-width: 0;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0 10px 0 12px;
    font-weight: 400;
    color: var(--text);
}

.profile-viewer__field input:focus {
    outline: none;
}

.profile-viewer__field:focus-within {
    border-color: rgba(var(--brand-blue-rgb), 0.55);
    box-shadow: 0 0 0 3px rgba(var(--brand-blue-rgb), 0.12);
}

.profile-viewer__button {
    width: 38px;
    height: 100%;
    border: 0;
    border-left: 1px solid var(--border);
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
}

.profile-viewer__button:hover {
    color: var(--accent);
    background: var(--panel-hover);
}

.profile-viewer__button svg {
    width: 16px;
    height: 16px;
}

.calendar-profile-viewer {
    display: grid;
    grid-template-columns: auto minmax(320px, 1fr) auto;
    justify-content: stretch;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 3px 8px;
    border-radius: 10px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.calendar-profile-viewer label {
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 800;
}

.calendar-profile-viewer .profile-viewer__field {
    width: 100%;
    max-width: none;
    height: 28px;
    border-radius: 9px;
    background: var(--field);
}

.calendar-profile-viewer .profile-viewer__field input {
    padding-inline: 9px;
    font-size: 0.8rem;
    font-weight: 600;
}

.calendar-profile-viewer .profile-viewer__button {
    width: 30px;
    height: 28px;
}

.calendar-profile-viewer .profile-viewer__button svg {
    width: 13px;
    height: 13px;
}

.calendar-edit-toggle {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 10px;
    min-width: max-content;
    cursor: pointer;
}

.calendar-edit-switch {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    width: 44px;
    height: 24px;
}

.calendar-edit-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

.calendar-edit-switch > span {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(125, 138, 160, 0.24);
    border: 1px solid var(--border-strong);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.calendar-edit-switch > span::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 10px rgba(17, 32, 56, 0.2);
    transition: transform 0.2s ease;
}

.calendar-edit-switch input:checked + span {
    background: #22c55e;
    border-color: rgba(34, 197, 94, 0.72);
}

.calendar-edit-switch input:checked + span::after {
    transform: translateX(20px);
}

.theme-switch,
.icon-button,
.primary-button,
.secondary-button,
.ghost-button {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.theme-switch,
.icon-button {
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text-soft);
}

.theme-switch:hover,
.icon-button:hover {
    transform: translateY(-1px);
    background: var(--panel-hover);
}

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 12px;
    border-radius: 999px;
}

.theme-switch__icon {
    width: 16px;
    height: 16px;
}

.theme-switch__track {
    position: relative;
    width: 42px;
    height: 22px;
    border-radius: 999px;
    background: rgba(var(--brand-blue-rgb), 0.22);
}

.theme-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6aa7ff, #845fff);
    box-shadow: 0 6px 12px rgba(var(--brand-blue-rgb), 0.26);
    transition: transform 0.2s ease;
}

body.theme-dark .theme-switch__thumb {
    transform: translateX(20px);
}

.icon-button {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
}

/* Campanita de notificaciones del supervisor. */
.notifications-bell-button {
    position: relative;
}

.notifications-bell-button.has-notifications {
    color: var(--brand-blue, #2563eb);
    border-color: rgba(var(--brand-blue-rgb, 37, 99, 235), 0.5);
}

.notifications-bell-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    padding: 0 5px;
    border: 2px solid var(--panel);
    border-radius: 999px;
    background: var(--red, #e11d48);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
}

.notifications-bell-badge.hidden {
    display: none;
}

/* Recuadro de avisos de la campanita. Cosas que ya pasaron y no hay que
   responder: un traspaso aceptado, un turno que alguien acepto cubrir. Se
   marcan leidas a mano, para que no se pierdan de vista solas. */
.bell-panel {
    position: fixed;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    max-height: min(70vh, 520px);
    border: 1px solid var(--border-strong, rgba(15, 23, 42, 0.12));
    border-radius: 14px;
    background: var(--panel, #fff);
    color: var(--text, #0f172a);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.bell-panel[hidden] {
    display: none;
}

.bell-panel__head,
.bell-panel__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
}

.bell-panel__head {
    border-bottom: 1px solid var(--border, rgba(15, 23, 42, 0.08));
}

.bell-panel__foot {
    border-top: 1px solid var(--border, rgba(15, 23, 42, 0.08));
}

.bell-panel__head strong {
    font-size: 0.92rem;
}

.bell-panel__action,
.bell-panel__requests {
    border: 1px solid var(--border-strong, rgba(15, 23, 42, 0.14));
    border-radius: 999px;
    padding: 5px 12px;
    background: transparent;
    color: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.bell-panel__action:hover,
.bell-panel__requests:hover {
    background: var(--panel-hover, rgba(15, 23, 42, 0.05));
}

.bell-panel__requests {
    width: 100%;
}

.bell-panel__list {
    display: grid;
    gap: 2px;
    overflow-y: auto;
    padding: 6px;
}

.bell-panel__empty {
    margin: 0;
    padding: 18px 12px;
    color: var(--text-muted, #64748b);
    font-size: 0.82rem;
    text-align: center;
}

.bell-notice {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border-radius: 10px;
}

.bell-notice:hover {
    background: var(--panel-alt, rgba(15, 23, 42, 0.04));
}

.bell-notice strong {
    font-size: 0.84rem;
    line-height: 1.3;
}

.bell-notice p {
    margin: 0;
    color: var(--text-soft, #475569);
    font-size: 0.79rem;
    line-height: 1.35;
}

.bell-notice time {
    color: var(--text-muted, #64748b);
    font-size: 0.72rem;
}

/* El aviso que lleva a alguna parte se ve pulsable: es un <button>. */
.bell-notice--link {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.bell-notice--link:focus-visible {
    outline: 2px solid var(--accent, #2563eb);
    outline-offset: 2px;
}

.mobile-menu-toggle,
.mobile-panel-toggle {
    display: none;
}

.icon-button svg {
    width: 18px;
    height: 18px;
}

.icon-button--small {
    width: 34px;
    height: 34px;
    border-radius: 12px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel);
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease;
}

.user-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--brand-blue-rgb), 0.34);
    background: var(--panel-alt);
}

.user-chip--firebase {
    border-color: rgba(34, 197, 94, 0.32);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-soft);
}

.user-avatar svg {
    width: 18px;
    height: 18px;
}

.app-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    margin-top: 16px;
}

.panel,
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(18px);
}

.sidebar,
.dashboard {
    min-width: 0;
}

.sidebar {
    --sidebar-sticky-top: 18px;
    --sidebar-viewport-gap: 36px;
    display: flex;
    flex-direction: column;
    padding: 18px;
    position: sticky;
    top: var(--sidebar-sticky-top);
    max-height: calc(100vh - var(--sidebar-viewport-gap));
    max-height: calc(100dvh - var(--sidebar-viewport-gap));
    overflow: hidden;
}

.sidebar:has(.profile-list) {
    height: calc(100vh - var(--sidebar-viewport-gap));
    height: calc(100dvh - var(--sidebar-viewport-gap));
}

.panel-title,
.section-head h3 {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.panel-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.field-shell,
.field-stack {
    display: grid;
    gap: 8px;
}

.field-shell {
    margin-bottom: 12px;
}

.field-shell--icon {
    position: relative;
}

.field-shell--icon input,
.field-shell--icon select {
    padding-left: 44px;
}

.field-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transform: translateY(-50%);
}

.field-stack span {
    color: var(--text-soft);
    font-size: 0.93rem;
    font-weight: 600;
}

.inline-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-soft);
}

.sidebar-toggle {
    margin: 12px 0 18px;
}

.toggle-check input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.toggle-check input:disabled {
    cursor: default;
}

.profile-list {
    display: grid;
    gap: 10px;
    align-content: start;
    align-items: start;
    grid-auto-rows: max-content;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    font-family: var(--font-ui);
}

.profile-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    content-visibility: auto;
    contain-intrinsic-size: auto 58px;
}

/* Las secciones inferiores de Perfil se materializan al acercarse al viewport.
   Esto evita calcular pintura y layout de todo el formulario durante la carga. */
body[data-active-view="profile"] #profileSection .profile-area,
body[data-active-view="profile"] #profileSection .contract-history-panel,
body[data-active-view="profile"] #profileSection .profile-records-grid {
    content-visibility: auto;
    contain-intrinsic-size: auto 260px;
}

.profile-item:hover {
    transform: translateX(2px);
    background: var(--panel-hover);
    border-color: var(--border);
}

.profile-list-more,
.timeline-load-more {
    width: 100%;
    border: 1px dashed var(--border);
    border-radius: 14px;
    padding: 11px 14px;
    color: var(--accent-strong);
    background: var(--panel-soft);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.profile-list-more:hover,
.timeline-load-more:hover {
    border-color: var(--accent);
    background: var(--panel-hover);
}

.timeline-load-more {
    margin-top: 12px;
}

.profile-item.active {
    background: linear-gradient(135deg, rgba(var(--brand-blue-rgb), 0.24), rgba(var(--brand-blue-rgb), 0.1));
    border-color: rgba(var(--brand-blue-rgb), 0.34);
}

.profile-item.is-inactive {
    opacity: 0.62;
    filter: grayscale(0.65);
}

.profile-item.is-inactive .profile-item__avatar {
    background: var(--calendar-disabled);
    color: var(--text-muted);
}

.profile-item__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    flex-shrink: 0;
}

.profile-item.active .profile-item__avatar {
    background: rgba(255, 255, 255, 0.16);
}

.profile-item__content {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.profile-item__content strong,
.profile-item__content span {
    font-family: var(--font-ui);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-item__content strong {
    color: var(--text);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.profile-item__content span {
    color: var(--text-muted);
    font-size: 0.88rem;
}

body.theme-dark .profile-list .profile-item__content strong {
    color: #f8fafc;
    -webkit-text-fill-color: #f8fafc;
}

body.theme-dark .profile-list .profile-item__content span {
    color: rgba(226, 232, 240, 0.72);
    -webkit-text-fill-color: rgba(226, 232, 240, 0.72);
}

.dashboard {
    display: grid;
    gap: 18px;
}

.profile-view-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

body:not([data-active-view="profile"]) #profileSection,
body:not([data-active-view="profile"]) .profile-view-layout,
body:not([data-active-view="profile"]) .availability-panel,
body:not([data-active-view="hours"]) #hoursView,
body:not([data-active-view="hours"]) .hours-panel,
body:not([data-active-view="hours"]) .hours-charts-panel,
body:not([data-active-view="weekly"]) #staffingWeeklyCalendar,
body:not([data-active-view="tasks"]) #taskAssignmentsPanel,
body:not([data-active-view="kanban"]) #kanbanPanel,
body:not([data-active-view="holders"]) #shiftHoldersPanel,
body:not([data-active-view="monthly"]) #monthlyCalendarPanel,
body:not([data-active-view="agenda"]) #agendaPanel,
body:not([data-active-view="turnos"]) .turnos-side-panel,
body:not([data-active-view="reports"]) #reportsPanel,
body:not([data-active-view="dashboard"]) #dashboardPanel,
body:not([data-active-view="requests"]) #workerRequestsPanel,
body:not([data-active-view="memos"]) #memosPanel,
body:not([data-active-view="informations"]) #informationsPanel,
body:not([data-active-view="medicalEquipment"]) #medicalEquipmentPanel,
body:not([data-active-view="tenders"]) #tendersPanel,
body:not([data-active-view="qualifications"]) #qualificationsPanel,
body:not([data-active-view="clockmarks"]) #clockMarksPanel,
body:not([data-active-view="home"]) #homePanel,
body:not([data-active-view="log"]) #auditLogPanel {
    display: none;
}

body[data-active-view="profile"] .calendar-panel,
body[data-active-view="profile"] .leave-panel,
body[data-active-view="profile"] .timeline-panel,
body[data-active-view="profile"] .secondary-grid {
    display: none;
}

body[data-active-view="hours"] #profileSection,
body[data-active-view="hours"] .calendar-panel,
body[data-active-view="hours"] .leave-panel,
body[data-active-view="hours"] .availability-panel,
body[data-active-view="hours"] .timeline-panel,
body[data-active-view="hours"] .secondary-grid {
    display: none;
}

body[data-active-view="turnos"] .secondary-grid,
body[data-active-view="requests"] .calendar-panel,
body[data-active-view="requests"] .leave-panel,
body[data-active-view="requests"] .timeline-panel,
body[data-active-view="requests"] #turnChangesView,
body[data-active-view="requests"] .primary-grid,
body[data-active-view="memos"] .calendar-panel,
body[data-active-view="memos"] .leave-panel,
body[data-active-view="memos"] .timeline-panel,
body[data-active-view="memos"] #turnChangesView,
body[data-active-view="memos"] .primary-grid,
body[data-active-view="informations"] .calendar-panel,
body[data-active-view="informations"] .leave-panel,
body[data-active-view="informations"] .timeline-panel,
body[data-active-view="informations"] #turnChangesView,
body[data-active-view="informations"] .primary-grid,
body[data-active-view="medicalEquipment"] .calendar-panel,
body[data-active-view="medicalEquipment"] .leave-panel,
body[data-active-view="medicalEquipment"] .timeline-panel,
body[data-active-view="medicalEquipment"] #turnChangesView,
body[data-active-view="medicalEquipment"] .primary-grid,
body[data-active-view="tenders"] .calendar-panel,
body[data-active-view="tenders"] .leave-panel,
body[data-active-view="tenders"] .timeline-panel,
body[data-active-view="tenders"] #turnChangesView,
body[data-active-view="tenders"] .primary-grid,
body[data-active-view="qualifications"] .calendar-panel,
body[data-active-view="qualifications"] .leave-panel,
body[data-active-view="qualifications"] .timeline-panel,
body[data-active-view="qualifications"] #turnChangesView,
body[data-active-view="qualifications"] .primary-grid,
body[data-active-view="clockmarks"] .calendar-panel,
body[data-active-view="clockmarks"] .leave-panel,
body[data-active-view="clockmarks"] .timeline-panel,
body[data-active-view="clockmarks"] #turnChangesView,
body[data-active-view="clockmarks"] #workerRequestsPanel,
body[data-active-view="clockmarks"] .primary-grid,
body[data-active-view="swap"] .calendar-panel,
body[data-active-view="swap"] .leave-panel,
body[data-active-view="swap"] .timeline-panel,
body[data-active-view="weekly"] .timeline-panel,
body[data-active-view="weekly"] .primary-grid,
body[data-active-view="weekly"] #turnChangesView,
body[data-active-view="tasks"] .primary-grid,
body[data-active-view="tasks"] .timeline-panel,
body[data-active-view="tasks"] #turnChangesView,
body[data-active-view="kanban"] .primary-grid,
body[data-active-view="kanban"] .timeline-panel,
body[data-active-view="kanban"] #turnChangesView,
body[data-active-view="agenda"] .primary-grid,
body[data-active-view="agenda"] .timeline-panel,
body[data-active-view="agenda"] #turnChangesView,
body[data-active-view="holders"] .primary-grid,
body[data-active-view="holders"] .timeline-panel,
body[data-active-view="holders"] #turnChangesView,
body[data-active-view="monthly"] .primary-grid,
body[data-active-view="monthly"] .timeline-panel,
body[data-active-view="monthly"] #turnChangesView,
body[data-active-view="reports"] .timeline-panel,
body[data-active-view="reports"] .primary-grid,
body[data-active-view="reports"] .secondary-grid,
body[data-active-view="dashboard"] .timeline-panel,
body[data-active-view="dashboard"] .primary-grid,
body[data-active-view="dashboard"] .secondary-grid,
body[data-active-view="timeline"] .primary-grid,
body[data-active-view="timeline"] .secondary-grid,
body[data-active-view="timeline"] #turnChangesView,
body[data-active-view="log"] .calendar-panel,
body[data-active-view="log"] .leave-panel,
body[data-active-view="log"] .timeline-panel,
body[data-active-view="log"] #turnChangesView,
body[data-active-view="log"] .primary-grid,
body[data-active-view="home"] .calendar-panel,
body[data-active-view="home"] .leave-panel,
body[data-active-view="home"] .timeline-panel,
body[data-active-view="home"] #turnChangesView,
body[data-active-view="home"] .primary-grid,
body[data-active-view="home"] .secondary-grid {
    display: none;
}

/* ============================================================
   Home / "Inicio" — resumen diario del supervisor
   ============================================================ */
.home-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;

    --hm-track: rgba(128, 138, 160, 0.30);
    --hm-violet-1: #8b5cf6;
    --hm-violet-2: #6d3bd4;
    --hm-blue-1: #4b8bf5;
    --hm-blue-2: #2563eb;
    --hm-green-1: #24c58a;
    --hm-green-2: #0f9d6f;
    --hm-amber-1: #fbb040;
    --hm-amber-2: #f2870f;
    --hm-red: #ef4444;
    --hm-red-soft: rgba(239, 68, 68, 0.15);
    --hm-good: #16a34a;
    --hm-good-soft: rgba(34, 197, 94, 0.16);
    --hm-warn: #ea8a10;
    --hm-warn-soft: rgba(249, 115, 22, 0.16);
    --hm-info: #2477ee;
    --hm-info-soft: rgba(36, 119, 238, 0.15);
    --hm-night: #4f46e5;
}

.hm-root { display: flex; flex-direction: column; gap: 18px; }

/* Hero */
.hm-hero { display: block; }
.hm-greet { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.hm-greet h1 { margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; }
.hm-greet p { margin: 0; color: var(--text-soft); font-size: 1rem; }
.hm-date {
    margin-top: 14px; display: inline-flex; align-items: center; gap: 12px;
    width: fit-content; padding: 12px 16px; border-radius: 14px;
    background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow-soft);
}
.hm-date-ico { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.hm-date-ico svg { width: 21px; height: 21px; }
.hm-date small { display: block; color: var(--text-muted); font-size: 0.75rem; font-weight: 600; }
.hm-date strong { font-size: 0.98rem; color: var(--text); }

/* Stat cards */
.hm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.hm-stat {
    position: relative; padding: 18px; border-radius: 18px; color: #fff;
    overflow: hidden; box-shadow: var(--shadow-panel); cursor: pointer;
}
.hm-stat--violet { background: linear-gradient(140deg, var(--hm-violet-1), var(--hm-violet-2)); }
.hm-stat--blue { background: linear-gradient(140deg, var(--hm-blue-1), var(--hm-blue-2)); }
.hm-stat--green { background: linear-gradient(140deg, var(--hm-green-1), var(--hm-green-2)); }
.hm-stat--amber { background: linear-gradient(140deg, var(--hm-amber-1), var(--hm-amber-2)); }
/* La programacion semanal comparte la fila con la dotacion, pero no es una
   dotacion: el color distinto evita leerla como un estamento mas. */
.hm-stat--teal { background: linear-gradient(140deg, #0f766e, #0d9488); }

.hm-weeks { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.hm-week {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 10px; cursor: help;
}
.hm-week b { font-size: 0.86rem; font-weight: 600; }
.hm-week small { font-size: 0.8rem; opacity: 0.85; white-space: nowrap; }
.hm-stat-icon svg { width: 30px; height: 30px; opacity: 0.92; }
.hm-stat-label { margin-top: 8px; font-size: 0.86rem; font-weight: 600; opacity: 0.94; }
.hm-stat-value { font-size: 2.4rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.hm-stat-sub { font-size: 0.8rem; opacity: 0.9; }
.hm-stat-go { position: absolute; right: 14px; bottom: 14px; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); display: grid; place-items: center; }
.hm-stat-go svg { width: 16px; height: 16px; }
.hm-dn2 { display: flex; gap: 18px; margin-top: 12px; flex-wrap: wrap; padding-right: 30px; }
.hm-dn2-item { display: flex; align-items: center; gap: 9px; }
.hm-dn2-ico svg { width: 24px; height: 24px; opacity: 0.9; }
.hm-dn2-txt { display: flex; flex-direction: column; line-height: 1.05; }
.hm-dn2-txt b { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.hm-dn2-txt small { font-size: 0.72rem; opacity: 0.9; }

/* Grid + cards */
/* Tres pilas, una por columna. La grilla solo reparte el ancho; el alto lo
   resuelve cada pila por su cuenta, asi que una tarjeta se apoya siempre en la
   de arriba de SU columna y no espera a la fila.

   Con filas (align-items: start sobre las tarjetas sueltas) el alto lo imponia
   la tarjeta mas alta de cada fila: "Tareas diarias" con una sola tarea dejaba
   medio panel en blanco antes de "Ausencias del dia". */
.hm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.hm-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hm-col-4 { grid-column: span 4; }
.hm-col-5 { grid-column: span 5; }
.hm-col-6 { grid-column: span 6; }
.hm-col-7 { grid-column: span 7; }

.hm-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
    padding: 18px; box-shadow: var(--shadow-soft); display: flex; flex-direction: column; gap: 12px;
}
.hm-head { display: flex; align-items: center; gap: 10px; }
.hm-head-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.hm-head-icon svg { width: 19px; height: 19px; }
.hm-head h3 { margin: 0; min-width: 0; font-size: 1.02rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; color: var(--text); }
.hm-count { margin-left: auto; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.76rem; font-weight: 800; display: grid; place-items: center; }
/* "Ver detalles" comparte fila con el titulo (antes ocupaba una fila propia
   debajo). Se ancla a la derecha y no se deja apretar: quien cede ancho es el
   titulo, que puede partirse en dos lineas sin perderse. */
.hm-head-toggle { flex: none; margin-left: auto; }
.hm-head-toggle + .hm-count { margin-left: 0; }

.hm-listcol { display: flex; flex-direction: column; gap: 2px; }
.hm-listcol--gap { gap: 9px; }

/* Listas que pueden crecer sin techo (tareas del dia, cumpleanos del mes y los
   dos detalles que se abren con el interruptor). En el tablero de tres columnas
   una sola de estas estirando su fila deja las otras dos tarjetas flotando en
   medio metro de blanco: cada una scrollea dentro de su propia tarjeta y la
   fila conserva la altura de la maqueta. El padding es para que el foco del
   teclado no quede cortado contra la barra de scroll. */
.hm-scroller { overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.hm-tasks-list { max-height: 330px; }
.hm-bday-list { max-height: 330px; }
.hm-req-list.hm-scroller,
.hm-cob-list.hm-scroller { max-height: 460px; }
/* Los tipos de incidencia se listan todos, incluso en cero: ver un "0" al lado
   de "Sin marcaje entrada" dice algo. La tarjeta crece hasta mostrarlos todos,
   sin barra de scroll: con las tarjetas apiladas por columna, crecer ya no deja
   a las vecinas flotando en blanco. */

.hm-gear { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel-alt); color: var(--text-soft); display: grid; place-items: center; cursor: pointer; }
.hm-gear:hover { color: var(--accent); border-color: var(--accent); }
.hm-gear svg { width: 17px; height: 17px; }

/* Tareas */
.hm-task { display: flex; align-items: center; gap: 11px; padding: 8px 6px; border-radius: 10px; cursor: pointer; }
.hm-task:hover { background: var(--panel-alt); }
.hm-task-check { width: 22px; height: 22px; border-radius: 50%; flex: none; border: 2px solid var(--border); background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; transition: background 0.12s ease, border-color 0.12s ease; }
.hm-task-check svg { width: 13px; height: 13px; }
.hm-task-check:hover { border-color: var(--hm-good); }
.hm-task.is-done .hm-task-check { background: var(--hm-good); border-color: var(--hm-good); color: #fff; }
.hm-task-name { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.hm-task.is-done .hm-task-name { text-decoration: line-through; color: var(--text-muted); font-weight: 500; }
.hm-task-time { margin-left: auto; color: var(--text-muted); font-size: 0.82rem; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Insignia de tarea compartida: dice con quien, en la fila del inicio y en el
   listado del dia. */
.hm-task-share { margin-left: 7px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-alt); color: var(--text-soft); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; vertical-align: middle; }
.hm-task.is-done .hm-task-share, .hm-dt-row.is-done .hm-task-share { text-decoration: none; }

/* Ausencias */
.hm-kv {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 6px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.hm-kv:hover { background: var(--panel-alt); }
.hm-kv:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hm-kv-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.hm-kv-ico svg { width: 17px; height: 17px; }
.hm-kv-ico.hm-crit { background: var(--hm-red-soft); color: var(--hm-red); }
.hm-kv-ico.hm-good { background: var(--hm-good-soft); color: var(--hm-good); }
.hm-kv-ico.hm-info { background: var(--hm-info-soft); color: var(--hm-info); }
.hm-kv-ico.hm-warn { background: var(--hm-warn-soft); color: var(--hm-warn); }
.hm-kv-name { min-width: 0; font-size: 0.9rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.hm-kv-right { flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.hm-kv-num { min-width: 26px; height: 24px; padding: 0 8px; border-radius: 8px; display: grid; place-items: center; font-size: 0.82rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.hm-kv-num.hm-crit { background: var(--hm-red-soft); color: var(--hm-red); }
.hm-kv-num.hm-good { background: var(--hm-good-soft); color: var(--hm-good); }
.hm-kv-num.hm-info { background: var(--hm-info-soft); color: var(--hm-info); }
.hm-kv-num.hm-warn { background: var(--hm-warn-soft); color: var(--hm-warn); }
.hm-empty { padding: 14px 6px; color: var(--text-muted); font-size: 0.86rem; font-style: italic; }
.hm-uncov { display: inline-flex; align-items: center; gap: 5px; font-size: 0.7rem; font-weight: 800; white-space: nowrap; padding: 3px 9px; border-radius: 999px; background: var(--hm-red-soft); color: var(--hm-red); }
.hm-uncov::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--hm-red); }

/* Resumen */
.hm-sum { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 12px; background: var(--panel-alt); }
.hm-sum span:first-child { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.hm-sum-val { margin-left: auto; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.hm-sum--info .hm-sum-val { color: var(--hm-info); }
.hm-sum--good .hm-sum-val { color: var(--hm-good); }
.hm-sum--warn .hm-sum-val { color: var(--hm-warn); }
.hm-sum--accent .hm-sum-val { color: var(--accent); }
.hm-sum--night .hm-sum-val { color: var(--hm-night); }
/* Cumpleaños de hoy: solo aparece el dia que corresponde, por eso resalta. */
.hm-sum--bday { background: rgba(236, 72, 153, 0.12); }
.hm-sum--bday span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-sum--bday .hm-sum-val { font-size: 0.9rem; color: #db2777; }

/* Cumpleaños del mes */
/* Ancladas a la derecha, no al texto: el nombre del mes cambia de largo
   ("Mayo" vs "Septiembre") y las flechas se movian con el. El contador pierde
   aca su margin-left:auto para quedar pegado a ellas. */
.hm-bday-nav { display: flex; gap: 5px; flex: none; margin-left: auto; }
.hm-bday-nav + .hm-count { margin-left: 0; }
.hm-bday-nav button {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--field);
    color: var(--text-soft);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
}
.hm-bday-nav button:hover { filter: brightness(0.95); }
.hm-bday-list { gap: 2px; }
.hm-bday {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
}
.hm-bday.is-today { background: rgba(236, 72, 153, 0.12); }
.hm-bday.is-past { opacity: 0.5; }
.hm-bday-day {
    min-width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--panel-alt);
    font-size: 0.82rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text-strong);
}
.hm-bday.is-today .hm-bday-day { background: #db2777; color: #fff; }
.hm-bday-name { display: flex; flex-direction: column; min-width: 0; }
.hm-bday-name strong {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hm-bday-name small { font-size: 0.72rem; color: var(--text-muted); }
.hm-bday-today {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    background: #db2777;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
}

/* Cambios de turno */
.hm-swap { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-radius: 10px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.hm-swap:hover, .hm-swap:focus-visible { background: var(--panel-alt); }
.hm-swap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hm-swap-tag { min-width: 0; font-size: 0.82rem; font-weight: 700; color: var(--text-soft); background: var(--panel-alt); border: 1px solid var(--border); padding: 4px 9px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-swap-arrow { color: var(--accent); flex: none; display: grid; }
.hm-swap-arrow svg { width: 16px; height: 16px; }
/* "Larga - 13 Ago" es el dato que identifica el cambio: se mantiene entero y
   quien se achica es el nombre, que ademas se puede leer completo al abrirlo. */
.hm-swap-count { flex: none; margin-left: auto; padding-left: 4px; font-size: 0.8rem; white-space: nowrap; color: var(--text-muted); font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.hm-swap-dialog { width: min(480px, 100%); }
.hm-swap-dialog__meta { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.hm-swap-dialog__meta span:first-child,
.hm-swap-dialog__meta span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-swap-dialog__arrow { color: var(--accent); display: grid; place-items: center; }
.hm-swap-dialog__arrow svg { width: 18px; height: 18px; }
.hm-swap-dialog__note { margin-top: -4px; }

/* Cobertura */
.hm-segmented { display: inline-flex; background: var(--panel-alt); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.hm-seg { border: none; background: transparent; color: var(--text-soft); font: inherit; font-size: 0.8rem; font-weight: 700; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.hm-seg:hover { color: var(--text); }
.hm-seg.is-active { background: var(--accent); color: #fff; }
.hm-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; color: var(--text-soft); cursor: pointer; user-select: none; }
.hm-toggle input { appearance: none; -webkit-appearance: none; width: 34px; height: 19px; border-radius: 999px; background: var(--hm-track); position: relative; cursor: pointer; transition: background 0.15s ease; flex: none; }
.hm-toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform 0.15s ease; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.hm-toggle input:checked { background: var(--accent); }
.hm-toggle input:checked::after { transform: translateX(15px); }

/* Apilados, igual que los del resumen de solicitudes: en una tarjeta de un
   tercio los dos chips lado a lado dejaban "Preasignados" cortado a la mitad. */
.hm-cob-summary { display: flex; flex-direction: column; gap: 8px; }
.hm-cob-summary[hidden], .hm-cob-list[hidden] { display: none; }
/* Es un <button>: abre el detalle de la tarjeta. Lleva el reset de fuente,
   color y alineacion porque un boton no los hereda, y el 100% de ancho porque
   el resumen es una columna flex y sin el se encogeria al contenido. */
.hm-cob-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; background: var(--panel-alt); border: 1px solid var(--border); width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.hm-cob-chip:hover:not(:disabled) { border-color: rgba(var(--brand-blue-rgb), 0.45); }
/* En cero no hay detalle que abrir: se ve igual, pero no invita al clic. */
.hm-cob-chip:disabled { cursor: default; }
.hm-cob-chip-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.hm-cob-chip-ico svg { width: 19px; height: 19px; }
.hm-cob-chip--crit .hm-cob-chip-ico { background: var(--hm-red-soft); color: var(--hm-red); }
.hm-cob-chip--accent .hm-cob-chip-ico { background: var(--accent-soft); color: var(--accent); }
.hm-cob-chip-num { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--text); }
.hm-cob-chip-lbl { display: block; font-size: 0.8rem; color: var(--text-soft); font-weight: 600; }

/* Resumen de solicitudes */
.hm-req-summary { display: flex; flex-direction: column; gap: 8px; }
.hm-req-summary[hidden], .hm-req-list[hidden] { display: none; }
.hm-req-chip { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 13px; background: var(--panel-alt); border: 1px solid var(--border); }
.hm-req-chip-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.hm-req-chip-ico svg { width: 18px; height: 18px; }
.hm-req-chip--leave .hm-req-chip-ico { background: var(--hm-warn-soft); color: var(--hm-warn); }
.hm-req-chip--swap .hm-req-chip-ico { background: var(--accent-soft); color: var(--accent); }
.hm-req-chip--clock .hm-req-chip-ico { background: var(--hm-info-soft); color: var(--hm-info); }
.hm-req-chip-num { display: block; font-size: 1.45rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--text); }
.hm-req-chip-lbl { display: block; font-size: 0.78rem; color: var(--text-soft); font-weight: 600; line-height: 1.2; }
.hm-req-list { display: flex; flex-direction: column; gap: 8px; }
.hm-req-row { padding: 10px 12px; border-radius: 13px; border: 1px solid var(--border); background: var(--panel-alt); display: flex; flex-direction: column; gap: 5px; }
.hm-req-row--leave { border-left: 3px solid var(--hm-warn); }
.hm-req-row--swap { border-left: 3px solid var(--accent); }
.hm-req-row--clock { border-left: 3px solid var(--hm-info); }
.hm-req-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hm-req-type { flex: none; font-size: 0.68rem; font-weight: 800; color: var(--text-soft); background: var(--hm-track); padding: 3px 8px; border-radius: 999px; text-transform: uppercase; }
.hm-req-worker { flex: 1; min-width: 0; font-size: 0.86rem; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-req-date { flex: none; font-size: 0.76rem; font-weight: 800; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.hm-req-meta { font-size: 0.8rem; color: var(--text-soft); line-height: 1.35; }
.hm-req-meta b { color: var(--text); font-weight: 700; }
.hm-req-row-actions { margin-top: 3px; }
.hm-req-actions { margin-top: 2px; }

.hm-cob-list { display: flex; flex-direction: column; gap: 8px; }
.hm-cob-row { padding: 11px 13px; border-radius: 13px; border: 1px solid var(--border); background: var(--panel-alt); display: flex; flex-direction: column; gap: 5px; }
/* La fila de un cargo faltante es un BOTON: se pulsa para abrir el cuadro que
   lo llena. Un boton no hereda tipografia ni alineacion, y sin el ancho
   completo se encogeria al contenido dentro de la columna. */
.hm-cob-row--action { width: 100%; font: inherit; text-align: left; cursor: pointer; }
.hm-cob-row--action:hover { border-color: var(--hm-warn); background: var(--hm-warn-soft); }
.hm-cob-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.hm-cob-date { min-width: 0; font-size: 0.86rem; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.hm-cob-status { margin-left: auto; font-size: 0.71rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.hm-cob-status--sincubrir { background: var(--hm-red-soft); color: var(--hm-red); }
.hm-cob-status--preasignado { background: var(--accent-soft); color: var(--accent); }
/* Brecha de rotativa: ambar y no rojo. No es que alguien falte hoy -eso es
   agudo y se acaba-, es que el cargo no existe en la rotativa del grupo y
   vuelve cada ciclo. Mismo criterio que la casilla del calendario semanal. */
.hm-cob-status--brecha { background: var(--hm-warn-soft); color: var(--hm-warn); }
.hm-cob-chip--warn .hm-cob-chip-ico { background: var(--hm-warn-soft); color: var(--hm-warn); }
.hm-cob-more { font-style: italic; }
.hm-cob-status--espera {
    display: inline-flex; align-items: center; gap: 5px;
    border: none; cursor: pointer; font-family: inherit;
    background: #dbeafe; color: #1d4ed8;
}
.hm-cob-status--espera svg { width: 16px; height: 16px; margin: -2px 0; }
.hm-cob-status--espera:hover { background: #bfdbfe; }
.hm-cob-meta { font-size: 0.83rem; color: var(--text-soft); line-height: 1.35; }
.hm-cob-meta b { color: var(--text); font-weight: 700; }
.hm-cob-none { color: var(--hm-warn); font-weight: 700; }

/* Detalle de la solicitud de cobertura enviada: a quien se le pidio y cuanto le
   queda antes de caducar. */
/* Un turno puede salir a 15 o 20 trabajadores: en una columna el modal se pasa
   de largo de la pantalla. Dos columnas y scroll propio en la lista, para que
   el titulo y los botones queden siempre a la vista. */
.turn-change-dialog.request-wait-dialog {
    width: min(720px, 100%);
    max-height: 86vh;
}
.request-wait-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px; margin: 4px 0 2px;
    max-height: 46vh; overflow-y: auto;
    /* Aire para que la barra de scroll no tape el borde de las tarjetas. */
    padding-right: 4px;
}
@media (max-width: 620px) {
    .turn-change-dialog.request-wait-dialog { width: 100%; }
    .request-wait-list { grid-template-columns: 1fr; max-height: 50vh; }
}
.request-wait-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 9px 11px; border-radius: 11px;
    background: var(--panel-alt); border: 1px solid var(--border);
}
.request-wait-worker { display: flex; flex-direction: column; min-width: 0; }
.request-wait-worker b {
    font-size: 0.88rem; font-weight: 700; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.request-wait-worker small { font-size: 0.74rem; color: var(--text-muted); }
.request-wait-left {
    flex: none; font-size: 0.78rem; font-weight: 800; color: #1d4ed8;
    background: #dbeafe; padding: 3px 10px; border-radius: 999px;
    font-variant-numeric: tabular-nums;
}
.request-wait-left.is-expired { color: var(--hm-red); background: var(--hm-red-soft); }

/* Confirmar / cancelar un turno preasignado desde la tarjeta de cobertura. */
/* En un tercio de ancho "COBERTURA AUTOMATICA" y "VER EN CALENDARIO" ya no
   caben lado a lado: con base 130px se reparten la fila cuando hay espacio y
   se apilan cuando no, en vez de desbordar la tarjeta. El texto centrado en
   dos lineas es por lo mismo, para que el boton crezca y no recorte. */
.hm-cob-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* Los dos botones de la brecha van uno sobre otro: "VER CALENDARIO SEMANAL"
   no cabe al lado de "CUBRIR" en el ancho de la tarjeta, y partirlo en dos
   lineas dejaria las filas de distinto alto. */
.hm-cob-actions--stack { flex-direction: column; }
.hm-cob-actions--stack .hm-cob-btn { flex: 0 0 auto; width: 100%; }

.hm-cob-btn {
    flex: 1 1 130px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px 12px;
    border-radius: 9px;
    border: 1px solid transparent;
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.hm-cob-btn:hover { filter: brightness(0.94); }
.hm-cob-btn:active { transform: translateY(1px); }

.hm-cob-btn--confirm {
    background: var(--accent);
    color: #fff;
}

.hm-cob-btn--cancel {
    background: transparent;
    border-color: rgba(239, 68, 68, 0.45);
    color: #b91c1c;
}

.hm-cob-btn--ver {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.hm-cob-btn--auto {
    background: var(--hm-good, #16a34a);
    color: #fff;
}

.hm-cob-btn:disabled {
    opacity: 0.6;
    cursor: default;
}


/* ==========================================================================
   Titulares de Turnos
   Los cuatro grupos del 4to turno. Las letras son fijas; lo que cambia cada dia
   es el subtitulo de la columna.
   ========================================================================== */

.shift-holders-panel {
    padding: 18px;
}

/* ---------- Calendario Mensual ---------- */

.monthly-calendar-panel {
    padding: 18px;
}

.mcal {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mcal-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.mcal-title h2 {
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 800;
}

/* "Ayuda para cubrir": junto al titulo, y su modal de consejos. */
.mcal-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.mcal-magic-button {
    padding: 6px 12px;
    border: 1px solid rgba(var(--brand-blue-rgb), 0.35);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(var(--brand-blue-rgb), 0.12), rgba(168, 85, 247, 0.14));
    color: var(--text-strong);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.mcal-magic-button:hover {
    border-color: rgba(var(--brand-blue-rgb), 0.6);
}

.turn-change-dialog.mcal-magic-dialog {
    width: min(1480px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mcal-magic-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.mcal-magic-summary,
.mcal-magic-note,
.mcal-magic-loading,
.mcal-magic-empty {
    margin: 8px 0 14px;
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.5;
}

.mcal-magic-advice {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-alt);
}

.mcal-magic-advice-head {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.mcal-magic-advice-head strong {
    color: var(--text-strong);
    font-size: 0.98rem;
}

.mcal-magic-advice-head p {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 0.86rem;
    line-height: 1.45;
}

.mcal-magic-number {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
}

.mcal-magic-advice summary {
    cursor: pointer;
    color: var(--accent);
    font-size: 0.86rem;
    font-weight: 800;
}

.mcal-magic-list {
    display: grid;
    gap: 6px;
    margin-top: 10px;
    max-height: 60vh;
    overflow: auto;
}

.mcal-magic-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    font-size: 0.86rem;
}

.mcal-magic-row > span {
    flex: 1 1 260px;
    min-width: 0;
}

.mcal-magic-row input[type="checkbox"] {
    flex: none;
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
}

.mcal-magic-row select {
    flex: 1 1 420px;
    min-height: 34px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--field);
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
}

.mcal-magic-row > .mcal-magic-tag {
    flex: none;
}

.mcal-magic-tag {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.mcal-magic-tag.is-warn {
    background: rgba(249, 115, 22, 0.16);
    color: #c2410c;
}

.mcal-magic-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

/* Mover turnos: la lista y, a la derecha, el mes del trabajador como
   quedaria con los movimientos marcados. */
.mcal-magic-movegrid {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(440px, 560px);
    gap: 20px;
    align-items: start;
    margin-top: 10px;
}

.mcal-magic-movegrid .mcal-magic-list {
    margin-top: 0;
}

.mcal-magic-side {
    position: sticky;
    top: 0;
}

.mcal-wcal {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
}

.mcal-wcal-title {
    display: block;
    margin-bottom: 8px;
    color: var(--text-strong);
    font-size: 0.86rem;
}

.mcal-wcal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

/* Aviso en vivo de una fila de horas extras (tope diurno, dos turnos el dia). */
.mcal-magic-warn {
    flex: 1 1 100%;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
    font-size: 0.8rem;
    font-weight: 700;
}

.mcal-magic-warn[hidden] {
    display: none;
}

/* El mes del trabajador al pasar el mouse por su nombre. */
.mcal-magic-hovercal {
    position: fixed;
    z-index: 10;
    width: min(480px, calc(100vw - 16px));
    pointer-events: none;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
    border-radius: 16px;
}

.mcal-magic-hovercal[hidden] {
    display: none;
}

/* Horas extras de un turno que tambien cubriria un cambio de rotativa. */
.mcal-magic-alt {
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.14);
    color: #7e22ce;
    font-size: 0.74rem;
    font-style: normal;
    font-weight: 700;
}

.mcal-wcal-weekday {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
}

.mcal-wcal-day {
    display: grid;
    align-content: space-between;
    min-height: 58px;
    padding: 5px 7px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--field);
    color: var(--text-soft);
    font-size: 0.8rem;
}

.mcal-wcal-day.is-empty {
    border: 0;
    background: transparent;
}

.mcal-wcal-day b {
    font-weight: 700;
}

.mcal-wcal-day small {
    justify-self: end;
    font-size: 0.95rem;
    font-weight: 800;
}

.mcal-wcal-day.has-turn {
    border-color: transparent;
    background: var(--wcal-color);
    color: #fff;
}

/* Recibe un turno con el movimiento. */
.mcal-wcal-day.is-arriving {
    box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px #16a34a;
}

/* Queda libre: se tacha el turno que tenia. */
.mcal-wcal-day.is-leaving {
    border: 1px dashed #dc2626;
    color: #dc2626;
}

.mcal-wcal-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.mcal-wcal-key {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.mcal-wcal-key.is-arriving {
    background: var(--field);
    box-shadow: 0 0 0 2px #16a34a;
}

.mcal-wcal-key.is-leaving {
    border: 1px dashed #dc2626;
}

@media (max-width: 1100px) {
    .mcal-magic-movegrid {
        grid-template-columns: minmax(0, 1fr);
    }

    .mcal-magic-side {
        position: static;
    }
}

/* Preasignar (a la izquierda, en azul como los preasignados) | Aplicar. */
.mcal-magic-actions-gap {
    flex: 1 1 auto;
}

.mcal-magic-preassign {
    border-color: rgba(59, 130, 246, 0.45);
    color: #2563eb;
}

body.theme-dark .mcal-magic-preassign {
    color: #93c5fd;
}

/* Mientras se aplica un consejo: nada mas se puede apretar. */
.turn-change-dialog-backdrop.is-busy .mcal-magic-dialog {
    cursor: progress;
}

/* Enviar solicitud a la app de los trabajadores. */
.mcal-magic-request {
    border-color: rgba(22, 163, 74, 0.45);
    color: #15803d;
}

body.theme-dark .mcal-magic-request {
    color: #86efac;
}

.mcal-magic-pending {
    margin-bottom: 12px;
    padding: 12px 16px;
    border: 1px dashed var(--border-strong);
    border-radius: 14px;
    font-size: 0.86rem;
}

.mcal-magic-pending ul {
    margin: 8px 0 0;
    padding-left: 18px;
    color: var(--text-soft);
}

.mcal-title p {
    margin: 0;
    max-width: 62ch;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.mcal-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* Filtros por profesion: uno activo a la vez. */
.mcal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mcal-filter {
    padding: 6px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.mcal-filter.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.mcal-month {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mcal-month strong {
    min-width: 140px;
    text-align: center;
    font-weight: 800;
}

.mcal-month button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
}

/* Se desplaza la PAGINA, no la tabla: las dos filas del encabezado (Dia/Noche
   y los motivos) quedan pegadas arriba de la ventana al bajar por el mes. Por
   eso el contenedor no puede tener overflow (convertiria en su propio
   desplazamiento y el encabezado se pegaria a el, no a la ventana). */
.mcal-table-wrap {
    --mcal-head-row: 40px;
}

/* En pantallas angostas la tabla no cabe: vuelve a desplazarse de lado ella
   misma (ahi el encabezado ya no se pega a la ventana). */
@media (max-width: 900px) {
    .mcal-table-wrap {
        overflow-x: auto;
    }
}

/* `separate` y no `collapse`: con bordes colapsados, las celdas fijas pierden
   sus bordes al desplazar. Cada celda dibuja el derecho y el inferior. */
.mcal-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-top: 1px solid rgba(100, 116, 139, 0.35);
    border-left: 1px solid rgba(100, 116, 139, 0.35);
    font-size: 0.92rem;
}

.mcal-table th,
.mcal-table td {
    padding: 6px 10px;
    border-right: 1px solid rgba(100, 116, 139, 0.35);
    border-bottom: 1px solid rgba(100, 116, 139, 0.35);
    text-align: center;
}

.mcal-table th {
    font-weight: 800;
    font-style: italic;
}

.mcal-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    /* --panel es translucido: sobre el fondo solido del tema, para que las
       filas que pasan por debajo no se trasluzcan. */
    background:
        linear-gradient(var(--panel), var(--panel)),
        var(--bg-bottom, #fff);
}

.mcal-table thead tr:first-child th {
    height: var(--mcal-head-row);
    box-sizing: border-box;
}

.mcal-table thead tr:nth-child(2) th {
    top: var(--mcal-head-row);
}

.mcal-table tr.is-weekend td {
    background: var(--accent-soft);
}

.mcal-date,
.mcal-weekday {
    width: 1%;
    white-space: nowrap;
    font-weight: 700;
}

.mcal-slot {
    min-width: 180px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.mcal-group-head {
    font-size: 0.95rem;
}

.mcal-sub-head {
    font-size: 0.76rem;
    font-style: normal !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Un motivo de horas extras por columna: angosta, con el motivo en varias
   lineas si es largo. */
.mcal-sub-head--extra {
    max-width: 150px;
    white-space: normal;
    color: var(--muted);
}

.mcal-slot--extra {
    min-width: 90px;
    background: rgba(100, 116, 139, 0.05);
}

/* Franja de motivos HHEE de un tramo: una celda con desplazamiento horizontal
   propio. Todas las filas se mueven juntas (JS); la barra se ve solo en el
   encabezado. */
.mcal-col-date {
    width: 56px;
}

.mcal-col-weekday {
    width: 36px;
}

.mcal-table .mcal-xwrap {
    padding: 0;
    height: 1px;
}

.mcal-xscroll {
    width: 0;
    min-width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.mcal-xscroll::-webkit-scrollbar {
    display: none;
}

.mcal-xwrap--head .mcal-xscroll {
    scrollbar-width: thin;
}

.mcal-xwrap--head .mcal-xscroll::-webkit-scrollbar {
    display: block;
    height: 6px;
}

.mcal-xwrap--head .mcal-xscroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.45);
}

.mcal-xrow {
    display: flex;
    min-width: 100%;
    height: 100%;
}

.mcal-table .mcal-xcell {
    flex: 1 0 112px;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 8px;
    border-right: 1px solid rgba(100, 116, 139, 0.35);
    text-align: center;
}

.mcal-table .mcal-xcell:last-child {
    border-right: 0;
}

/* Titulo de un motivo: clic para editarlo o eliminarlo. */
.mcal-sub-head--extra.is-editable {
    cursor: pointer;
}

.mcal-sub-head--extra.is-editable:hover,
.mcal-sub-head--extra.is-editable:focus-visible {
    color: var(--accent);
    text-decoration: underline;
    outline: none;
}

/* Arrastrar un apoyo extra a la columna de otro motivo. */
.mcal-chip.is-draggable {
    cursor: grab;
}

.mcal-chip.is-draggable:active {
    cursor: grabbing;
}

.mcal-slot.is-drop-target {
    outline: 2px dashed var(--accent);
    outline-offset: -3px;
    background: var(--accent-soft);
}

/* "Otros motivos": los de poca gente juntos, con + para abrirlos. */
.mcal-sub-head--group {
    color: var(--text);
}

.mcal-fold {
    margin-left: 6px;
    padding: 1px 8px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--panel);
    color: var(--accent);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    font-style: normal;
    text-transform: none;
    cursor: pointer;
}

.mcal-slot:hover,
.mcal-slot:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.mcal-chip {
    white-space: nowrap;
}

.mcal-chip small {
    margin-left: 2px;
    font-size: 0.7em;
    font-weight: 600;
}

.mcal-chip.is-covering {
    color: var(--red);
}

/* Mover turno: aviso fijo abajo mientras se elige la casilla de destino. */
.mcal-move-banner {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(760px, calc(100vw - 32px));
    padding: 12px 16px;
    border: 1px solid var(--accent);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow-panel);
    transform: translateX(-50%);
    font-size: 0.92rem;
}

.mcal-move-banner span {
    flex: 1;
}

.mcal.is-moving td[data-mcal-col="titulares"].is-move-target {
    cursor: copy;
    box-shadow: inset 0 0 0 1px var(--accent);
}

/* Origen del turno que se mueve: la casilla a la vista y las iniciales de
   quien se mueve en naranjo. */
.mcal.is-moving td[data-mcal-col="titulares"].is-move-source {
    box-shadow: inset 0 0 0 2px #f97316;
    background: rgba(249, 115, 22, 0.08);
}

.mcal-chip.is-moving-source {
    padding: 0 5px;
    border-radius: 6px;
    color: #ea580c;
    background: rgba(249, 115, 22, 0.16);
    font-weight: 900;
    text-shadow: 0 0 10px rgba(249, 115, 22, 0.45);
}

body.theme-dark .mcal-chip.is-moving-source {
    color: #fb923c;
}

/* Las columnas de motivos no reciben un turno movido. */
.mcal.is-moving .mcal-table tbody .mcal-xwrap {
    opacity: 0.35;
    pointer-events: none;
}

/* Casillas que no pueden recibir el turno (reglas de la unidad, dia ocupado). */
.mcal.is-moving td[data-mcal-col="titulares"].is-move-blocked {
    cursor: not-allowed;
    opacity: 0.35;
}

.mcal.is-moving td[data-mcal-col="titulares"].is-move-target:hover {
    outline: 2px dashed var(--accent);
    outline-offset: -3px;
    background: var(--accent-soft);
}

/* Preasignado: turno tentativo, azulino hasta que se confirma. */
.mcal-chip.is-preassigned {
    padding: 0 5px;
    border-radius: 6px;
    color: #2563eb;
    background: rgba(59, 130, 246, 0.14);
}

body.theme-dark .mcal-chip.is-preassigned {
    color: #93c5fd;
    background: rgba(96, 165, 250, 0.18);
}

/* Confirmar / Quitar preasignacion: en su propia fila, bajo el nombre. */
.mcal-dialog-actions {
    grid-column: 2 / -1;
    display: flex;
    gap: 8px;
}

.mcal-dialog-actions > button {
    flex: 1 1 0;
    min-width: 0;
}

/* Mover | Quitar de un titular: en la misma fila, a la derecha. */
.mcal-dialog-actions.mcal-dialog-actions--inline {
    grid-column: auto;
}

.mcal-dialog-actions--inline > button {
    flex: 0 0 auto;
}

/* Turno de un apoyo de Dia (Larga, Diurno u horario personalizado). */
.mcal-schedule-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mcal-schedule-dialog > p {
    margin: 4px 0 18px;
}

.mcal-schedule-dialog .app-dialog__choices {
    margin-bottom: 4px;
}

.mcal-schedule-error {
    margin: 12px 0 0;
    color: var(--red);
    font-size: 0.86rem;
    font-weight: 700;
}

.mcal-schedule-error[hidden] {
    display: none;
}

.mcal-schedule-actions {
    display: grid;
    margin-top: 22px;
}

.mcal-dialog-list button {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.mcal-pre-badge {
    align-self: flex-start;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    color: #2563eb;
    background: rgba(59, 130, 246, 0.12);
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 700;
}

body.theme-dark .mcal-pre-badge {
    color: #93c5fd;
    background: rgba(96, 165, 250, 0.16);
}

.mcal-sep {
    padding: 0 1px;
    color: var(--muted);
}

.mcal-gap {
    display: inline-block;
    margin: 1px 2px;
    padding: 0 6px;
    border: 1px dashed var(--red);
    border-radius: 999px;
    color: var(--red);
    font-weight: 800;
}

/* Cupo de la Brecha RRHH: falta gente en el grupo, no hay un ausente. */
.mcal-gap--cupo {
    background: rgba(239, 68, 68, 0.1);
    font-size: 0.8em;
}

.mcal-empty,
.mcal-loading {
    color: var(--muted);
}

.mcal-dialog-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
    padding: 0;
    list-style: none;
}

/* Cada persona: iniciales | nombre y detalle | Quitar. Los preasignados
   llevan sus dos botones en una fila aparte, bajo el nombre. */
.turn-change-dialog.mcal-dialog {
    width: min(520px, calc(100vw - 32px));
}

.mcal-dialog-list li {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.mcal-dialog-list .mcal-chip {
    min-width: 34px;
    font-weight: 800;
    text-align: center;
}

.mcal-dialog-name {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.mcal-dialog-name small {
    color: var(--muted);
    font-size: 0.78rem;
}

.mcal-dialog-empty {
    margin: 10px 0;
    color: var(--muted);
}

/* La columna de la casilla (Titulares o el motivo) bajo la fecha. */
.mcal-dialog-column {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

@media (max-width: 640px) {
    .mcal-slot {
        min-width: 120px;
    }

    .mcal-filters {
        width: 100%;
    }
}

.tt-root {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tt-head h2 {
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 800;
}

.tt-head p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-soft);
    line-height: 1.45;
}

.tt-head-date {
    display: block;
    margin-top: 2px;
    font-weight: 700;
    color: var(--text);
    text-transform: capitalize;
}

.tt-loading {
    margin: 0;
    padding: 24px 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

/* --- Leyenda de colores --- */
.tt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-alt);
}

.tt-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--tt-accent);
}

.tt-legend-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--tt-accent);
    flex: none;
}

/* --- Las cuatro columnas --- */
.tt-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.tt-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
    min-width: 0;
}

.tt-column-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-bottom: 9px;
    border-bottom: 2px solid var(--border);
}

.tt-letter {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.5px;
}

.tt-today {
    font-size: 0.74rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.tt-count {
    margin-left: auto;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-soft);
}

/* El encabezado se tiñe con el turno que ese grupo hace HOY: es lo que permite
   leer la columna de un vistazo sin que las letras se muevan. */
.tt-column-head--larga { border-bottom-color: rgba(0, 137, 197, 0.6); }
.tt-column-head--larga .tt-today { background: rgba(0, 137, 197, 0.2); color: #46b6e8; }
.tt-column-head--noche { border-bottom-color: rgba(16, 73, 139, 0.7); }
.tt-column-head--noche .tt-today { background: rgba(16, 73, 139, 0.28); color: #7aa5dd; }
.tt-column-head--libre { border-bottom-color: var(--border); }
.tt-column-head--libre .tt-today { background: rgba(148, 163, 184, 0.18); color: var(--text-soft); }

/* Arrastrar un titular a otro grupo. La tarjeta se atenua mientras viaja y la
   columna que puede recibirla se enciende; la de origen no se enciende nunca,
   porque soltarla ahi no cambiaria nada. */
.tt-worker[draggable="true"] { cursor: grab; }
.tt-worker.is-dragging { opacity: 0.45; cursor: grabbing; }
.tt-column.is-drag-over {
    border-color: rgba(var(--brand-blue-rgb), 0.55);
    background: rgba(var(--brand-blue-rgb), 0.07);
}
.tt-move-note { font-size: 0.86rem; color: var(--text-soft); }
.tt-move-note--pending { font-style: italic; }

/* El calendario son seis filas de celdas mas los textos y el aviso: en una
   pantalla baja el cuadro crecia hasta dejar los botones FUERA. Se limita la
   altura al viewport -como ya hace .plans-dialog-, el contenido hace scroll y
   el pie queda fijo, que es lo que garantiza poder cerrarlo siempre.

   El selector va doble a proposito: .turn-change-dialog define su ancho MAS
   ABAJO en este archivo, y a igual especificidad gana el ultimo, de modo que
   una sola clase aqui se perderia sin avisar. */
.turn-change-dialog.tt-move-dialog {
    width: min(520px, 100%);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.tt-move-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}
.tt-move-dialog .turn-change-dialog__actions {
    flex: none;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* El calendario del cuadro reutiliza la grilla mini de los cambios de turno
   (.mini-grid y compania). Lo propio es el encabezado del mes y el aviso. */
.tt-move-cal { margin: 10px 0; }
.tt-move-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    text-transform: capitalize;
}
.mini-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
}
.tt-move-pick { font-size: 0.9rem; }
.tt-move-warn {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.08);
    font-size: 0.86rem;
}
.tt-move-losses { margin: 6px 0 0; padding-left: 18px; }

.tt-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tt-worker {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 10px;
    border-radius: 10px;
    border-left: 4px solid var(--tt-accent);
    background: var(--tt-soft);
    min-width: 0;
}

.tt-worker-name {
    font-size: 0.87rem;
    font-weight: 700;
    color: var(--text);
    overflow-wrap: anywhere;
}

.tt-worker-meta {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--tt-accent);
    overflow-wrap: anywhere;
}

.tt-worker-note {
    font-size: 0.72rem;
    color: var(--text-soft);
}

.tt-worker-note.is-warn {
    color: var(--hm-warn, #ea8a10);
    font-weight: 700;
}

/* Cupo disponible: a este grupo le faltan trabajadores de un estamento frente
   al grupo mejor dotado. Mismo lenguaje que el hueco de reemplazo de la
   programacion semanal -caja al aire con una insignia roja-, y borde punteado
   para que no se confunda con una tarjeta de trabajador. */
/* Es un boton: el cupo se aprieta para buscar quien lo llene. Un boton no
   hereda fuente ni alineacion, y sin el ancho completo se encogeria al
   contenido dentro de la columna. */
.tt-vacancy {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px dashed rgba(239, 68, 68, 0.55);
    background: rgba(248, 113, 113, 0.07);
    min-width: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.tt-vacancy:hover {
    background: rgba(248, 113, 113, 0.16);
    border-color: rgba(239, 68, 68, 0.85);
}

.tt-vacancy-badge {
    flex: none;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(239, 68, 68, 0.28);
}

.tt-vacancy-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.tt-vacancy-title {
    font-size: 0.87rem;
    font-weight: 700;
    color: #dc2626;
}

.tt-vacancy-meta {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-soft);
    overflow-wrap: anywhere;
}

.tt-empty {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: var(--text-soft);
}

.tt-note {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-soft);
    line-height: 1.45;
}

/* --- Paleta por estamento / profesion ---
   Un tono por ranura; el color se deriva del matiz para no repetir doce pares
   de valores en cada tema. */
.tt-color-0 { --tt-h: 210; }
.tt-color-1 { --tt-h: 145; }
.tt-color-2 { --tt-h: 25; }
.tt-color-3 { --tt-h: 280; }
.tt-color-4 { --tt-h: 340; }
.tt-color-5 { --tt-h: 190; }
.tt-color-6 { --tt-h: 55; }
.tt-color-7 { --tt-h: 0; }
.tt-color-8 { --tt-h: 258; }
.tt-color-9 { --tt-h: 165; }
.tt-color-10 { --tt-h: 310; }
.tt-color-11 { --tt-h: 95; }

.tt-legend-item,
.tt-worker {
    --tt-accent: hsl(var(--tt-h, 210) 72% 68%);
    --tt-soft: hsl(var(--tt-h, 210) 60% 50% / 0.16);
}

body.theme-light .tt-legend-item,
body.theme-light .tt-worker {
    --tt-accent: hsl(var(--tt-h, 210) 65% 36%);
    --tt-soft: hsl(var(--tt-h, 210) 70% 45% / 0.12);
}

@media (max-width: 1100px) {
    .tt-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .tt-board { grid-template-columns: minmax(0, 1fr); }
}

/* --- Alerta de cobertura automatica sin respuesta (punto D) ---------------
   Banda propia entre las estadisticas y el tablero, no una tarjeta mas de la
   grilla: la tarjeta de cobertura se puede dejar plegada en modo resumen y una
   alarma que se puede esconder deja de servir. Sin alertas la seccion queda
   vacia y :empty la saca del flujo, para no dejar un hueco en el layout. */
.hm-alertband { display: flex; flex-direction: column; gap: 12px; }
.hm-alertband:empty { display: none; }

.hm-cobalert {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(239, 68, 68, 0.45);
    background: var(--hm-red-soft);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.hm-cobalert-ico {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.18);
    color: var(--hm-red);
    /* Latido lento y de baja amplitud: llama la atencion al entrar sin quedar
       parpadeando encima del texto que hay que leer. */
    animation: hm-cobalert-pulse 2.4s ease-in-out infinite;
}

.hm-cobalert-ico svg { width: 20px; height: 20px; }

@keyframes hm-cobalert-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.09); opacity: 0.78; }
}

@media (prefers-reduced-motion: reduce) {
    .hm-cobalert-ico { animation: none; }
}

.hm-cobalert-main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hm-cobalert-title { font-size: 0.92rem; font-weight: 800; color: var(--text); line-height: 1.3; }
.hm-cobalert-shift { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.hm-cobalert-date { font-size: 0.86rem; font-weight: 700; color: var(--text); }
.hm-cobalert-origin { font-size: 0.83rem; color: var(--text-soft); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hm-cobalert-left { font-size: 0.86rem; color: var(--text-soft); }
.hm-cobalert-left b { color: var(--hm-red); font-weight: 800; }

.hm-cobalert-actions {
    flex: 0 1 340px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-self: center;
}

.hm-cobalert-actions .hm-cob-btn { flex: 1 1 150px; }
.hm-cobalert-actions .hm-cob-btn--ver { background: var(--panel); }

@media (max-width: 720px) {
    .hm-cobalert { flex-wrap: wrap; }
    .hm-cobalert-actions { flex-basis: 100%; }
}

/* Etapa en curso de la campaña, dentro de la fila de cobertura. */
.hm-cob-meta--stage {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
}

/* Modal "ver quienes recibieron la solicitud": una lista por oleada, en el
   orden en que salieron. */
.hm-cobwho-wave { display: flex; flex-direction: column; gap: 6px; }
.hm-cobwho-wave + .hm-cobwho-wave { margin-top: 14px; }

.hm-cobwho-wave-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border);
    font-size: 0.83rem;
    color: var(--text-soft);
}

.hm-cobwho-wave-head b { color: var(--text); font-weight: 800; }
.hm-cobwho-when { margin-left: auto; font-size: 0.78rem; }

.hm-cobwho-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }

.hm-cobwho-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 2px;
    font-size: 0.85rem;
}

.hm-cobwho-name { font-weight: 700; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hm-cobwho-chan { font-size: 0.76rem; color: var(--text-soft); }

.hm-cobwho-state {
    margin-left: auto;
    font-size: 0.71rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
    background: var(--panel-alt);
    color: var(--text-soft);
}

.hm-cobwho-state--pending { background: #dbeafe; color: #1d4ed8; }
.hm-cobwho-state--accepted { background: var(--hm-good-soft); color: var(--hm-good); }
.hm-cobwho-state--rejected { background: var(--hm-red-soft); color: var(--hm-red); }
.hm-cobwho-state--expired,
.hm-cobwho-state--superseded { background: var(--hm-warn-soft); color: var(--hm-warn); }

.hm-turno { font-size: 0.71rem; font-weight: 800; padding: 3px 8px; border-radius: 7px; letter-spacing: 0.2px; white-space: nowrap; }
.hm-turno--larga { background: rgba(59, 130, 246, 0.16); color: #2563eb; }
.hm-turno--noche { background: rgba(109, 75, 216, 0.18); color: #6d3bd4; }
.hm-turno--diurno { background: rgba(245, 158, 11, 0.2); color: #d97706; }
.hm-turno--media-m { background: rgba(16, 185, 129, 0.17); color: #0f9d6f; }
.hm-turno--media-t { background: rgba(242, 135, 15, 0.18); color: #d97706; }

/* Mensajes */
.hm-memo { display: flex; gap: 11px; padding: 8px 4px; }
.hm-memo-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; }
.hm-memo-dot.hm-warn { background: var(--hm-warn); }
.hm-memo-dot.hm-good { background: var(--hm-good); }
.hm-memo span:last-child { font-size: 0.9rem; line-height: 1.4; color: var(--text); }
.hm-msg { display: flex; align-items: center; gap: 12px; padding: 9px 4px; }
.hm-msg-av { width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 0.85rem; }
.hm-avatar--violet { background: linear-gradient(135deg, var(--hm-violet-1), var(--hm-violet-2)); }
.hm-avatar--green { background: linear-gradient(135deg, var(--hm-green-1), var(--hm-green-2)); }
.hm-avatar--blue { background: linear-gradient(135deg, var(--hm-blue-1), var(--hm-blue-2)); }
.hm-msg-body { min-width: 0; }
.hm-msg-from { font-size: 0.9rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }
.hm-live { width: 7px; height: 7px; border-radius: 50%; background: var(--hm-good); }
.hm-msg-prev { display: block; font-size: 0.82rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-msg-time { margin-left: auto; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; white-space: nowrap; }

.hm-note { display: flex; align-items: center; gap: 10px; padding: 11px 15px; border-radius: 12px; background: var(--accent-soft); color: var(--text-soft); font-size: 0.82rem; border: 1px dashed rgba(var(--brand-blue-rgb), 0.4); }
.hm-note b { color: var(--accent); }
.hm-note svg { flex: none; color: var(--accent); }

/* Toast de alerta de tareas (aparece en cualquier vista) */
.hm-alert-toasts {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1400;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(360px, calc(100vw - 36px));
}
.hm-alert-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-panel);
    animation: hmToastIn 0.2s ease;
}
@keyframes hmToastIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.hm-alert-toast__icon {
    width: 38px; height: 38px; border-radius: 11px; flex: none;
    display: grid; place-items: center;
    background: rgba(249, 115, 22, 0.16); color: #ea8a10;
}
.hm-alert-toast__icon svg { width: 20px; height: 20px; }
.hm-alert-toast__body { display: grid; gap: 2px; min-width: 0; }
.hm-alert-toast__body strong { font-size: 0.82rem; color: var(--text-muted); font-weight: 700; }
.hm-alert-toast__body span { font-size: 0.92rem; color: var(--text); font-weight: 600; line-height: 1.25; }
.hm-alert-toast__close {
    margin-left: auto; width: 28px; height: 28px; flex: none;
    border-radius: 8px; border: 1px solid var(--border);
    background: var(--panel-alt); color: var(--text-soft);
    font-size: 1.1rem; line-height: 1; cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
    .hm-alert-toast { animation: none; }
}

/* Modal */
.hm-modal-backdrop { position: fixed; inset: 0; z-index: 1200; background: rgba(6, 12, 22, 0.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; }
.hm-modal-backdrop[hidden] { display: none; }
.hm-modal { width: min(560px, 100%); max-height: 88vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-panel); }
.hm-modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.hm-modal-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.hm-modal-ico svg { width: 19px; height: 19px; }
.hm-modal-head h3 { margin: 0; font-size: 1.1rem; font-weight: 800; color: var(--text); }
.hm-modal-action { margin-left: auto; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--accent-soft); color: var(--accent); cursor: pointer; display: grid; place-items: center; flex: none; }
.hm-modal-action svg { width: 18px; height: 18px; }
.hm-modal-action:hover { border-color: var(--accent); background: var(--accent); color: #fff; }
.hm-modal-action + .hm-modal-close { margin-left: 0; }
.hm-modal-close { margin-left: auto; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-alt); color: var(--text-soft); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.hm-modal-close:hover { color: var(--hm-red); }
.hm-modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.hm-modal-sub { font-size: 0.76rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
/* En pantalla grande el modal se ensancha hasta caber los nombres completos, en
   vez de recortarlos y sacar una barra de scroll lateral. El limite de 100% deja
   que en pantallas chicas siga entrando. */
.hm-modal--dotacion { width: min(1080px, 100%); }
/* Chips de estamento del modal de dotacion: cambian de estamento sin cerrar,
   conservando la fecha elegida. Toman el mismo lenguaje visual que la pastilla
   de conteo del encabezado de columna (.hm-dot-colhead b). */
.hm-dot-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.hm-dot-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel-alt);
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.hm-dot-chip b {
    font-size: 0.74rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    opacity: 0.75;
}
.hm-dot-chip:hover { border-color: var(--text-soft); color: var(--text); }
.hm-dot-chip.is-active {
    background: var(--text);
    border-color: var(--text);
    color: var(--panel);
}
.hm-dot-chip.is-active b { opacity: 0.85; }

.hm-dot-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* Sin esto las columnas de la grilla no pueden encoger por debajo de su
   contenido y es el nombre largo el que empuja el modal a lo ancho. */
.hm-dot-col { min-width: 0; }
.hm-dot-colhead { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 800; color: var(--text); padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.hm-dot-colhead svg { width: 17px; height: 17px; color: var(--text-soft); }
.hm-dot-colhead b { margin-left: auto; font-size: 0.78rem; font-weight: 800; color: var(--text-soft); background: var(--panel-alt); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; }
.hm-dot-list { display: flex; flex-direction: column; gap: 6px; }
.hm-dot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; border-radius: 11px; background: var(--panel-alt); border: 1px solid var(--border); }
/* El nombre completo, en dos lineas si hace falta: recortarlo con puntos
   suspensivos era justamente lo que escondia informacion. */
.hm-dot-name { font-size: 0.86rem; font-weight: 700; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.hm-dot-time { flex: none; font-size: 0.78rem; font-weight: 700; color: var(--text-soft); font-variant-numeric: tabular-nums; }
/* Tareas asignadas: segunda linea de la fila (flex-basis 100% la baja entera),
   para que el nombre y el horario sigan leyendose de un vistazo arriba. */
.hm-dot-tasks { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 5px; }
.hm-dot-task {
    font-size: 0.72rem; font-weight: 700; line-height: 1.3;
    padding: 3px 8px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent);
    border: 1px solid transparent;
}
.hm-dot-empty { padding: 14px; text-align: center; color: var(--text-muted); font-size: 0.8rem; border: 1px dashed var(--border-strong); border-radius: 11px; }
/* Dotacion: navegacion por dia y calendario para saltar a otra fecha.
   El dialogo recibe el foco al abrirse -para que las flechas del teclado
   muevan el dia- y por eso hay que apagarle el anillo de foco propio. */
.hm-modal--dotacion:focus { outline: none; }
.hm-bday-nav + .hm-modal-action { margin-left: 0; }
/* El titulo crece con la fecha ('Profesional - en servicio el Jueves 28 de
   agosto'): que envuelva en dos lineas antes que aplastar los botones. */
.hm-modal--dotacion .hm-modal-head h3 { min-width: 0; overflow-wrap: anywhere; }
.hm-modal--dotacion .hm-modal-close { flex: none; }
/* Calendario del modal de dotacion: compacto, al estilo del selector de fecha
   nativo del navegador. Antes cada dia era un boton con borde y fondo propio y
   la grilla ocupaba mas alto que la lista de trabajadores que uno venia a
   mirar. Ahora son numeros sueltos en una grilla apretada: el cuadro solo se
   dibuja al pasar por encima o en el dia elegido.

   No se estira: se centra y queda del ancho que necesita, para que en el modal
   ancho no aparezca una grilla gigante de celdas vacias. */
/* El calendario se SUPERPONE a la info, colgando del boton que lo abre. Antes
   vivia en el cuerpo del modal y empujaba la lista de trabajadores hacia abajo:
   se abria para elegir una fecha y de paso tapaba lo que uno venia a mirar. */
/* El calendario cuelga del encabezado y es mas alto que el modal cuando hay
   pocos trabajadores: con el `overflow-y: auto` del modal quedaba CORTADO a la
   mitad del mes (se veia hasta la tercera semana y se perdia el resto).
   No alcanza con position:fixed, porque el backdrop tiene `backdrop-filter` y
   eso lo vuelve bloque contenedor.
   La salida es mover el scroll al CUERPO: el modal deja de recortar y el popover
   puede salirse, mientras la lista de trabajadores conserva su propio scroll. */
.hm-modal--dotacion {
    overflow: visible;
    display: flex;
    flex-direction: column;
}
/* Sin scroll propio en el modal, el encabezado ya queda arriba por si mismo; el
   sticky solo creaba un contexto de apilamiento de mas. */
.hm-modal--dotacion .hm-modal-head { position: static; }
/* min-height:0 para que el cuerpo pueda encogerse y hacer scroll dentro de la
   columna flex en vez de desbordar el max-height del modal. */
.hm-modal--dotacion .hm-modal-body { overflow-y: auto; min-height: 0; }

.hm-dp-anchor { position: relative; display: flex; flex: none; }
/* El ancla se metio entre las flechas y el boton de cerrar, asi que hereda el
   papel que tenia el boton del calendario en esa fila: sin esto, el `margin-left:
   auto` suelto del boton de cerrar abria un hueco entre ambos. */
.hm-bday-nav + .hm-dp-anchor { margin-left: 0; }
.hm-dp-anchor + .hm-modal-close { margin-left: 0; }
.hm-dp-pop {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 40;
    /* La sombra es lo que lo despega de la lista de abajo; sin ella los numeros
       del calendario se confunden con los de la tabla que tapan. */
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
    border-radius: 14px;
}
.hm-dp {
    width: max-content;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 13px 15px;
    background: var(--panel);
}
.hm-dp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.hm-dp-head strong { font-size: 1rem; font-weight: 800; color: var(--text); min-width: 148px; }
.hm-dp-head button:not(.hm-dp-today) {
    width: 28px; height: 28px; flex: none; border-radius: 8px;
    border: none; background: transparent;
    color: var(--text-soft); font-size: 1.15rem; line-height: 1; cursor: pointer;
}
.hm-dp-head button:not(.hm-dp-today):hover { background: var(--panel-alt); color: var(--text); }
.hm-dp-today {
    margin-left: auto; height: 28px; padding: 0 10px; flex: none;
    border-radius: 8px; border: none; background: transparent;
    color: var(--accent); font-size: 0.9rem; font-weight: 800; cursor: pointer;
}
.hm-dp-today:hover { background: var(--accent-soft); }
.hm-dp-grid { display: grid; grid-template-columns: repeat(7, 38px); gap: 2px; }
.hm-dp-dow {
    text-align: center; font-size: 0.78rem; font-weight: 700;
    color: var(--text-muted); text-transform: lowercase;
    letter-spacing: 0; padding-bottom: 5px;
}
.hm-dp-cell {
    height: 35px; border-radius: 9px; border: 1px solid transparent;
    background: transparent; color: var(--text); cursor: pointer;
    font-size: 0.98rem; font-weight: 600; font-variant-numeric: tabular-nums;
    padding: 0;
}
.hm-dp-cell--blank { cursor: default; }
.hm-dp-cell:hover:not(.hm-dp-cell--blank) { background: var(--accent-soft); }
/* Inhabil (fin de semana o feriado): rojo suave, solo como pista visual. El dia
   se puede elegir igual -mirar la dotacion de un domingo es justamente uno de
   los usos-, por eso se tine el numero y no se bloquea el boton. */
.hm-dp-cell.is-inhabil { color: #dc2626; }
.hm-dp-cell.is-inhabil:hover:not(.hm-dp-cell--blank) { background: rgba(220, 38, 38, 0.1); }
.hm-dp-cell.is-today { border-color: var(--accent); }
.hm-dp-cell.is-sel,
.hm-dp-cell.is-sel.is-inhabil { background: var(--accent); border-color: var(--accent); color: #fff; }
.hm-modal--absence { width: min(720px, 100%); }
.hm-absence-detail-list { display: flex; flex-direction: column; gap: 8px; }
.hm-absence-worker { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-absence-detail-row .hm-cob-actions { margin-top: 6px; }
/* El modal ya no scrollea a lo ancho: si algo no cabe, se acomoda a lo alto. */
.hm-modal--dotacion .hm-modal-body { overflow-x: hidden; }
@media (max-width: 560px) { .hm-dot-cols { grid-template-columns: 1fr; } }
/* Respaldos de una licencia medica */
.leave-doc-list { display: grid; gap: 6px; margin: 4px 0; }

.leave-doc-row { display: flex; align-items: center; gap: 8px; }

.leave-doc-open {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-alt);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.leave-doc-open:hover { border-color: var(--accent); }
.leave-doc-open:disabled { opacity: 0.6; }
.leave-doc-open span { display: grid; min-width: 0; }
.leave-doc-open strong {
    font-size: 0.86rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.leave-doc-open small { font-size: 0.74rem; color: var(--text-muted); }

.leave-doc-remove {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text-soft);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.leave-doc-remove:hover { color: #dc2626; border-color: rgba(220, 38, 38, 0.35); }

.leave-doc-add {
    display: block;
    margin-top: 4px;
    padding: 11px 14px;
    border: 1px dashed var(--accent);
    border-radius: 12px;
    color: var(--accent);
    font-weight: 800;
    font-size: 0.86rem;
    text-align: center;
    cursor: pointer;
}

.leave-doc-add:hover { background: var(--accent-soft); }
.leave-doc-add input { display: none; }

/* Candidato que superaria el tope de horas extras diurnas: queda al final de la
   lista y lo dice, para que se entienda por que. */
.replacement-candidate--over-limit {
    border-color: rgba(220, 38, 38, 0.32);
    background: rgba(220, 38, 38, 0.06);
}

.replacement-candidate-over-limit {
    display: block;
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #b91c1c;
}

/* Carga del informe del reloj control, en Reportes */
.attendance-import {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-alt);
}

.attendance-import__copy { display: grid; gap: 3px; flex: 1; min-width: 220px; }
.attendance-import__copy strong { font-size: 0.95rem; font-weight: 800; color: var(--text-strong); }
.attendance-import__copy span { font-size: 0.82rem; color: var(--text-muted); line-height: 1.4; }

.attendance-import__button {
    flex: none;
    padding: 10px 18px;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-size: 0.86rem;
    cursor: pointer;
}

.attendance-import__button:hover { filter: brightness(1.06); }
.attendance-import__button input { display: none; }

.attendance-import__status {
    margin: 0 0 12px;
    padding: 9px 13px;
    border-radius: 11px;
    font-size: 0.84rem;
    font-weight: 700;
}

.attendance-import__status.hidden { display: none; }
.attendance-import__status--info { background: var(--panel-alt); color: var(--text-soft); }
.attendance-import__status--ok { background: var(--hm-good-soft, #dcfce7); color: #15803d; }
.attendance-import__status--error { background: var(--hm-red-soft, #fee2e2); color: #b91c1c; }

/* Periodos de vigencia de los valores por grado */
.settings-grade-periods {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.settings-grade-periods__list { display: flex; flex-wrap: wrap; gap: 6px; }

.settings-grade-period {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text-soft);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.settings-grade-period:hover { border-color: var(--accent); }
.settings-grade-period.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.settings-grade-period--add { border-style: dashed; color: var(--accent); }

.settings-grade-range { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.settings-grade-range label { display: grid; gap: 3px; }
.settings-grade-range span { font-size: 0.72rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }

.settings-grade-range input {
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid var(--field-border);
    background: var(--field);
    color: var(--text);
    font: inherit;
}

.settings-grade-period-remove {
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid rgba(220, 38, 38, 0.35);
    background: var(--panel);
    color: #dc2626;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.settings-grade-periods__note { margin: 0; font-size: 0.76rem; color: var(--text-muted); }

/* Nombre visible de un administrador: editable ahi mismo, en la tarjeta donde
   el supervisor ya ve quien tiene acceso. */
.settings-user-card__id { display: grid; gap: 2px; min-width: 0; }

.settings-user-name {
    width: min(280px, 100%);
    padding: 5px 9px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-strong);
    font: inherit;
    font-weight: 800;
    font-size: 0.95rem;
}

.settings-user-name:hover:not(:disabled) { border-color: var(--border); }
.settings-user-name:focus { border-color: var(--accent); background: var(--panel); outline: none; }
.settings-user-name:disabled { color: var(--text-muted); }

/* Adjunto de un registro del perfil: se abre al tocarlo. Antes era texto suelto
   y el archivo subido quedaba inalcanzable. */
.pf-rec-clip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    padding: 3px 9px 3px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel-alt);
    color: var(--text-soft);
    font: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.pf-rec-clip svg { width: 13px; height: 13px; flex: none; }
.pf-rec-clip:hover { border-color: var(--accent); color: var(--accent); }
.pf-rec-clip:disabled { opacity: 0.6; cursor: default; }

/* Registros viejos que guardaron solo el nombre: no hay archivo que abrir. */
.pf-rec-clip--gone { cursor: default; opacity: 0.7; }
.pf-rec-clip--gone:hover { border-color: var(--border); color: var(--text-soft); }

/* Boton de programacion semanal, bajo la fecha del encabezado */
.hm-hero-action {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.hm-hero-action:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-panel);
    transform: translateY(-1px);
}

.hm-hero-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hm-hero-action svg:first-child { width: 20px; height: 20px; color: var(--accent); }
.hm-hero-action svg:last-child { width: 16px; height: 16px; color: var(--text-muted); }

/* Visor de la programacion semanal publicada.
   Ocupa casi toda la pantalla porque la tabla tiene 7 columnas de dias mas la
   de roles: en un modal angosto no se lee nada. */
.hm-modal--weekly { width: min(1400px, 100%); }
.hm-modal--weekly .hm-modal-body { padding-top: 8px; }
.hm-ws-today { margin-left: 4px; padding: 6px 12px; font-size: 0.78rem; }

.hm-ws-weeks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 20px 0;
}

.hm-ws-week {
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel-alt);
    color: var(--text-soft);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.hm-ws-week:hover { border-color: var(--accent); }
.hm-ws-week.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.hm-ws-weeks-empty { font-size: 0.8rem; color: var(--text-muted); }

/* La tabla scrollea dentro de SU caja, no arrastrando el modal entero. */
.ws-table-scroll {
    overflow: auto;
    max-height: 70vh;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.ws-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.ws-table th,
.ws-table td {
    border: 1px solid var(--border);
    padding: 7px 9px;
    text-align: left;
    vertical-align: top;
}

.ws-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--panel-alt);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--text-soft);
    white-space: nowrap;
}

/* La columna de roles queda fija al hacer scroll horizontal: sin ella no se
   sabe de quien es la fila que se esta mirando. */
.ws-table .ws-role {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 170px;
    background: var(--panel);
}

.ws-table thead .ws-role { z-index: 3; background: var(--panel-alt); }
.ws-table .ws-role strong { display: block; font-size: 0.78rem; font-weight: 800; color: var(--text); }
.ws-table .ws-role span { display: block; font-size: 0.7rem; color: var(--text-muted); }
.ws-cell { min-width: 108px; color: var(--text); }

/* Fecha de la ultima edicion, bajo la tabla. Sin ella, una programacion vieja
   y una recien tocada se ven exactamente igual. */
.ws-updated {
    margin: 8px 2px 0;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

/* Fila con color en el visor de programacion. El fondo pastel va inline, pero
   el nombre de la tarea y su detalle tienen color propio por clase: en tema
   oscuro son claros, y sobre pastel quedarian ilegibles. */
.ws-table tr.tsp-row--tinted .ws-role strong { color: #111827; }
.ws-table tr.tsp-row--tinted .ws-role span { color: #334155; }
.ws-cell--weekend { background: var(--panel-alt); }
.ws-cell--full { background: var(--accent-soft); font-weight: 700; }

.ws-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.86rem;
    border: 1px dashed var(--border-strong);
    border-radius: 14px;
}

/* Ensayo de la programacion, abierto desde el menu de asignacion de tareas.
   Reusa la tabla del visor de arriba a proposito: lo que se revisa aca tiene
   que verse igual que lo que despues se publica. Lo unico propio es el rotulo
   del turno, porque el tablero de tareas tiene dos (diurno y noche) y la
   programacion subida como Excel viene en una sola tabla. */
/* El boton de imprimir va junto a "Hoy" en la cabecera del visor. La hoja que
   sale NO es este modal: se arma un documento aparte en taskSchedulePreview.js,
   pensado para papel carta. */
.tsp-print {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
    padding: 6px 12px;
    font-size: 0.78rem;
}

.tsp-print svg,
.tsp-color svg {
    width: 15px;
    height: 15px;
    flex: none;
}

.tsp-color-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tsp-color {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.78rem;
}

.tsp-section { display: grid; gap: 8px; }

.tsp-section-title {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Con los dos turnos abiertos, cada tabla se queda con la mitad del alto para
   que el rotulo del segundo turno no caiga fuera de la pantalla. */
/* Casilla que el supervisor fusiono en el tablero: se marca el borde y se
   centra el contenido para que se lea como un puesto compartido entre varias
   tareas y no como la celda de la primera. */
.tsp-cell--merged {
    vertical-align: middle;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
}

.tsp-section + .tsp-section .ws-table-scroll { max-height: 38vh; }
.tsp-section:has(+ .tsp-section) .ws-table-scroll { max-height: 38vh; }

@media (max-width: 720px) {
    .hm-ws-today { display: none; }
    .ws-table { font-size: 0.72rem; }
    .ws-table .ws-role { min-width: 120px; }
    .ws-cell { min-width: 86px; }
}

/* Calendario organizativo de tareas (se abre desde la fecha del encabezado) */
.hm-date[data-hm="open-taskcal"] { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.hm-date[data-hm="open-taskcal"]:hover { border-color: var(--accent); box-shadow: var(--shadow-panel); transform: translateY(-1px); }
.hm-date[data-hm="open-taskcal"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hm-date-go { display: grid; place-items: center; color: var(--text-muted); flex: none; margin-left: 4px; }
.hm-date-go svg { width: 17px; height: 17px; }
.hm-date[data-hm="open-taskcal"]:hover .hm-date-go { color: var(--accent); }

/* Mini calendario del inicio: un mes de un vistazo, que se mueve con las
   flechas. La grilla abre el calendario de tareas en ese mismo mes. */
.hm-minical .hm-bday-nav { margin-left: auto; }
.hm-minical-open {
    display: flex; flex-direction: column; gap: 12px;
    margin: -6px; padding: 6px; border-radius: 12px;
    cursor: pointer; transition: background .15s;
}
.hm-minical-open:hover { background: var(--panel-alt); }
.hm-minical-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hm-minical-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.hm-minical-dow { font-size: 0.68rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; padding-bottom: 2px; }
.hm-minical-day {
    position: relative; height: 30px; display: grid; place-items: center;
    border-radius: 9px; font-size: 0.82rem; font-weight: 700; color: var(--text-soft);
    font-variant-numeric: tabular-nums;
}
.hm-minical-day--blank { visibility: hidden; }
/* Fin de semana y feriado: los dos son dias no habiles, y se pintan igual. */
.hm-minical-dow.is-weekend { color: var(--red); }
.hm-minical-day.is-weekend,
.hm-minical-day.is-holiday { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.hm-minical-day.is-today { color: #fff; background: var(--accent); }
/* Hoy feriado: manda el fondo de hoy y el feriado queda como un punto. */
.hm-minical-day.is-today.is-holiday::after {
    content: ""; position: absolute; bottom: 3px; width: 4px; height: 4px;
    border-radius: 50%; background: #fff;
}
.hm-minical-legend { display: flex; gap: 14px; font-size: 0.74rem; font-weight: 600; color: var(--text-muted); }
.hm-minical-key { display: inline-flex; align-items: center; gap: 6px; }
.hm-minical-key::before { content: ""; width: 10px; height: 10px; border-radius: 3px; box-sizing: border-box; }
.hm-minical-key--today::before { background: var(--accent); }
.hm-minical-key--holiday::before { background: color-mix(in srgb, var(--red) 12%, transparent); border: 1px solid var(--red); }

/* Ordenar las tarjetas del inicio: la manija de cuatro puntos, arriba al
   centro, dice que la tarjeta se puede arrastrar y es desde donde se arrastra
   (ver homeCardDrag.js). Solo con las tres columnas a la vista. */
.hm-grid [data-hm-card] { position: relative; }
.hm-drag-handle { display: none; }
@media (min-width: 1101px) {
    .hm-drag-handle {
        position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
        display: grid; place-items: center; width: 30px; height: 14px;
        border-radius: 6px; color: var(--text-muted); opacity: 0.55;
        cursor: grab; touch-action: none; user-select: none;
        transition: opacity .15s, color .15s, background .15s;
    }
    .hm-drag-handle svg { width: 12px; height: 12px; }
    .hm-grid [data-hm-card]:hover .hm-drag-handle { opacity: 0.9; }
    .hm-drag-handle:hover { opacity: 1; color: var(--accent); background: var(--accent-soft); }
}
.hm-card.is-dragging {
    position: fixed; z-index: 1300; margin: 0; box-sizing: border-box;
    pointer-events: none; opacity: 0.96; transform: rotate(0.8deg);
    box-shadow: 0 18px 40px rgba(6, 12, 22, 0.28);
}
.hm-card-placeholder {
    flex: none; box-sizing: border-box; border-radius: 18px;
    border: 2px dashed var(--accent); background: var(--accent-soft);
}
body.hm-arranging,
body.hm-arranging * { cursor: grabbing !important; user-select: none; }
/* Una columna vacia tiene que seguir siendo un lugar donde soltar. */
.hm-grid.is-arranging .hm-stack { min-height: 140px; }

/* El listado de un dia se abre ENCIMA del calendario, que queda visible detras. */
.hm-modal-backdrop--over { z-index: 1210; }
/* Mas grande que el resto de los modales: al menos un 30% mas que los 1040 px
   de ancho y 92 px por casilla de antes, para leer las tareas sin abrir cada
   dia. Las casillas crecen con el alto de la pantalla. */
.hm-modal--taskcal { width: min(1360px, 100%); max-height: 94vh; }
.hm-modal--taskcal .hm-tc-cell { min-height: clamp(120px, 13vh, 150px); }
/* Las flechas ya toman el margin-left:auto del encabezado; sin esto el boton de
   cerrar toma un segundo auto y el grupo queda repartido a lo ancho. */
.hm-modal--taskcal .hm-modal-close { margin-left: 12px; }
.hm-tc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.hm-tc-dow { text-align: center; font-size: 0.72rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 4px; }
.hm-tc-cell {
    min-height: 92px; padding: 6px; border-radius: 11px;
    background: var(--panel-alt); border: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 4px; overflow: hidden;
}
.hm-tc-cell--blank { background: transparent; border-color: transparent; }
/* Dias inhabiles (fin de semana y feriado): rojo suave, como en el mini
   calendario del inicio. Van antes de "hoy" y del hover, que mandan. */
.hm-tc-cell.is-nonworking {
    background: color-mix(in srgb, var(--red) 8%, var(--panel-alt));
    border-color: color-mix(in srgb, var(--red) 22%, var(--border));
}
.hm-tc-cell.is-nonworking .hm-tc-day { color: var(--red); }
.hm-tc-dow.is-weekend { color: var(--red); }
.hm-tc-cell.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.hm-tc-cell.is-clickable { cursor: pointer; }
.hm-tc-cell.is-clickable:hover { border-color: var(--accent); background: var(--accent-soft); }
.hm-tc-cell.is-clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hm-tc-day { font-size: 0.78rem; font-weight: 800; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.hm-tc-cell.is-today .hm-tc-day { color: var(--accent); }
.hm-tc-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hm-tc-chip {
    display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 0.7rem; font-weight: 600; color: var(--text);
    background: var(--panel); border: 1px solid var(--border); border-radius: 7px; padding: 2px 6px;
}
.hm-tc-chip b { font-weight: 800; color: var(--accent); margin-right: 5px; font-variant-numeric: tabular-nums; }
.hm-tc-chip.is-done { color: var(--text-muted); text-decoration: line-through; }
.hm-tc-chip.is-done b { color: var(--text-muted); }
.hm-tc-chip--medeq { border-color: #c4b5fd; background: #f5f3ff; color: #33245e; }
.hm-tc-chip--medeq b { color: #6d3fd9; }
.hm-tc-chip--maintenance { border-color: #86efac; background: #ecfdf5; color: #064e3b; }
.hm-tc-chip--maintenance b { color: #047857; }
.hm-tc-chip--next { border-color: #93c5fd; background: #eff6ff; color: #123a6f; }
.hm-tc-chip--next b { color: #0f559d; }
.hm-tc-chip--service { border-color: #f6c453; background: #fff7e6; color: #533b07; }
.hm-tc-chip--service b { color: #a66a00; }

/* Ausencias del mes: cada ausencia lleva su marca de jornada, que es lo que
   decide a quien hay que llamar para cubrirla. D = dia, N = noche, DN = ambas
   (un 24h o un D+N). */
.hm-ac-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    max-width: 100%;
    padding: 2px 7px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--panel);
    color: var(--text);
    font-size: 0.7rem;
    font-weight: 600;
}

.hm-ac-chip > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-ac-chip b {
    flex: none;
    min-width: 17px;
    padding: 0 3px;
    border-radius: 5px;
    color: #fff;
    background: var(--muted);
    font-size: 0.62rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: 0.02em;
}

.hm-ac-chip--dia b { background: #0b8853; }
.hm-ac-chip--noche b { background: #10498b; }
.hm-ac-chip--ambos b { background: #8b2bd9; }
.hm-ac-chip--libre b { background: var(--muted); }

.hm-ac-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

/* Fila del listado del dia: misma pinta que .hm-kv pero sin ser un boton. */
.hm-kv--static {
    cursor: default;
}

.hm-kv--static:hover {
    background: transparent;
}

.hm-kv--static .hm-kv-name small {
    display: block;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 600;
}
.hm-tc-more { font-size: 0.68rem; font-weight: 800; color: var(--accent); padding-left: 2px; }

/* Listado completo de un dia */
.hm-dt-list { display: flex; flex-direction: column; gap: 6px; }
.hm-dt-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 11px; background: var(--panel-alt); border: 1px solid var(--border); }
.hm-dt-time { flex: none; font-size: 0.8rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.hm-dt-name { flex: 1; min-width: 0; font-size: 0.86rem; font-weight: 600; color: var(--text); }
.hm-dt-repeat { flex: none; font-size: 0.71rem; font-weight: 700; color: var(--text-soft); background: var(--hm-track); padding: 3px 8px; border-radius: 7px; white-space: nowrap; }
.hm-dt-row.is-done .hm-dt-name { color: var(--text-muted); text-decoration: line-through; }
.hm-dt-row { cursor: pointer; transition: border-color .12s ease; }
.hm-dt-row:hover { border-color: var(--accent); }
.hm-dt-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hm-dt-row.is-done .hm-task-check { background: var(--hm-good); border-color: var(--hm-good); color: #fff; }
.hm-dt-row--medeq { border-color: #c7d2fe; background: #f8fbff; }
.hm-dt-row--medeq:hover { border-color: #7c3aed; }
.hm-dt-time--medeq { color: #6d3fd9; }
.hm-dt-name small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 0.72rem; font-weight: 600; line-height: 1.25; }
.hm-dt-repeat--medeq { color: #5b21b6; background: #ede9fe; }
/* Modificar una tarea se abre por encima del listado del dia, que a su vez esta
   por encima del calendario. */
.hm-modal-backdrop--top { z-index: 1220; }
@media (max-width: 760px) {
    .hm-tc-cell,
    .hm-modal--taskcal .hm-tc-cell { min-height: 68px; }
    .hm-tc-chip { font-size: 0.64rem; }
}
.hm-modal-tasks { display: flex; flex-direction: column; gap: 8px; }
.hm-mt-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel-alt); border: 1px solid var(--border); }
.hm-mt-name { font-weight: 600; font-size: 0.89rem; color: var(--text); }
.hm-mt-time { color: var(--text-muted); font-weight: 700; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.hm-mt-alert { display: inline-flex; align-items: center; gap: 4px; font-size: 0.71rem; font-weight: 700; color: var(--hm-warn); background: var(--hm-warn-soft); padding: 3px 8px; border-radius: 7px; white-space: nowrap; }
.hm-mt-repeat { display: inline-flex; align-items: center; gap: 4px; font-size: 0.71rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 7px; white-space: nowrap; }
.hm-mt-repeat--once { color: var(--text-muted); background: var(--hm-track); }
.hm-mt-del { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: var(--hm-red); cursor: pointer; display: grid; place-items: center; flex: none; }
.hm-mt-del svg { width: 15px; height: 15px; }
.hm-modal-form { border-top: 1px dashed var(--border); padding-top: 16px; }
.hm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.hm-form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 0.78rem; font-weight: 700; color: var(--text-soft); }
.hm-form-grid label.hm-full { grid-column: 1 / -1; }
.hm-form-grid input, .hm-form-grid select { padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--field); color: var(--text); font: inherit; font-size: 0.88rem; }
.hm-form-grid input:focus, .hm-form-grid select:focus { outline: none; border-color: var(--accent); }
.hm-form-grid input:disabled, .hm-form-grid select:disabled { opacity: 0.65; cursor: not-allowed; }
.hm-field-note { margin-top: 6px; font-size: 0.74rem; font-weight: 600; line-height: 1.35; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.hm-btn-add { margin-top: 12px; display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 11px; border: none; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.hm-btn-add svg { width: 16px; height: 16px; }
.hm-modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 20px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--panel); }
.hm-btn-secondary { padding: 10px 18px; border-radius: 11px; border: 1px solid var(--border); background: var(--panel-alt); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.hm-btn-primary { padding: 10px 18px; border-radius: 11px; border: none; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.hm-btn-danger { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 11px; border: 1px solid var(--hm-red); background: transparent; color: var(--hm-red); font: inherit; font-weight: 700; cursor: pointer; }
.hm-btn-danger svg { width: 15px; height: 15px; }
.hm-btn-danger:hover { background: var(--hm-red-soft); }
.hm-modal-foot--split { justify-content: space-between; }
.hm-modal-foot--split > div { display: flex; gap: 10px; }

/* Responsive */
@media (max-width: 1100px) {
    /* Tres pilas fijas en dos columnas dejarian una columna con seis tarjetas
       y la otra con tres. Se disuelven con display: contents (las tarjetas
       pasan a ser hijas de la grilla) y se reparten solas de a dos. */
    .hm-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .hm-stack { display: contents; }
    .hm-col-4, .hm-col-5, .hm-col-6, .hm-col-7 { grid-column: span 6; }
}
@media (max-width: 720px) {
    .hm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* Sin ">" a proposito: con las pilas disueltas el padre en el DOM sigue
       siendo .hm-stack, aunque la caja que cuenta sea la grilla. */
    .hm-grid .hm-card { grid-column: 1 / -1; }
    .hm-greet h1 { font-size: 1.6rem; }
    .hm-form-grid { grid-template-columns: 1fr; }
}

body[data-active-view="profile"] .primary-grid {
    grid-template-columns: 1fr;
}

body[data-active-view="hours"] .primary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="requests"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="memos"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="informations"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="medicalEquipment"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="tenders"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="qualifications"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="weekly"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="tasks"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="kanban"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="agenda"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="holders"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="monthly"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="clockmarks"] .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="reports"] #reportsPanel {
    display: grid;
}

body[data-active-view="dashboard"] #dashboardPanel {
    display: block;
}

body[data-active-view="turnos"] .primary-grid {
    grid-template-columns: minmax(0, 1.38fr) minmax(0, 1.02fr);
}

body[data-active-view="profile"] .stacked-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-active-view="hours"] .stacked-panels {
    grid-template-columns: minmax(0, 1fr);
}

body[data-active-view="turnos"] .stacked-panels {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: stretch;
}

body[data-active-view="swap"] .secondary-grid,
body[data-active-view="staffing"] .secondary-grid,
body[data-active-view="log"] .secondary-grid {
    grid-template-columns: 1fr;
}

.turn-changes-view {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.hours-view {
    display: block;
}

/* HHEE: nombre del trabajador + lupa (mismo patrón que Reportes/Marcajes) */
.hhee-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.hhee-selected strong {
    font-size: 1.05rem;
    color: var(--text);
}

.reports-view {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.agenda-view {
    display: block;
}

.hhee-content {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.hhee-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
    gap: 18px;
    align-items: stretch;
}

.hhee-sidebar .profile-list {
    max-height: none;
    overflow-y: auto;
    padding-right: 2px;
}

.reports-sidebar .profile-list {
    max-height: none;
    overflow-y: auto;
    padding-right: 2px;
}

.agenda-sidebar .profile-list {
    max-height: none;
    overflow-y: auto;
    padding-right: 2px;
}

.reports-detail-panel {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.reports-selected-profile {
    display: grid;
    gap: 4px;
    text-align: left;
}

.reports-selected-profile span,
.reports-selected-profile small,
.report-download-card p {
    color: var(--text-soft);
}

.reports-selected-profile strong {
    color: var(--text);
    font-size: 1.08rem;
}

.report-download-card {
    display: grid;
    gap: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.report-download-card__head {
    display: grid;
    gap: 8px;
}

.report-download-card__head strong {
    color: var(--text);
    font-size: 1.08rem;
}

.report-badge {
    width: fit-content;
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--accent);
    background: rgba(var(--brand-blue-rgb), 0.12);
    font-size: 0.82rem;
    font-weight: 800;
}

.report-download-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.report-download-card__actions .primary-button,
.report-download-card__actions .secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 168px;
    text-decoration: none;
}

.report-preview-heading {
    position: sticky;
    top: 8px;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(140px, 1fr) auto;
    gap: 8px;
    align-items: stretch;
    padding-bottom: 8px;
    background: var(--panel);
}

.report-preview-heading .report-title-strip {
    display: grid;
    place-items: center;
    min-height: 42px;
    min-width: 0;
    padding-inline: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(0.82rem, 1.2vw, 0.95rem);
}

.report-monthbar {
    width: 100%;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 8px;
}

.report-month-button,
.report-month-trigger {
    min-width: 0;
    color: #fff;
    cursor: pointer;
}

.report-month-button {
    width: 34px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.1);
}

.report-month-button svg {
    width: 16px;
    height: 16px;
}

.report-month-trigger {
    min-height: 32px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: inherit;
    font-size: inherit;
    font-weight: 900;
    text-transform: uppercase;
}

.report-month-button:hover,
.report-month-button:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.58);
    outline: none;
}

.report-month-trigger:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.report-month-trigger:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.72);
    outline-offset: 2px;
}

.report-preview-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.report-download-inline {
    min-height: 42px;
    min-width: 120px;
    padding-inline: 12px;
    border-radius: 12px;
    font-size: 0.82rem;
    white-space: nowrap;
}

.report-preview-card {
    max-height: none;
    overflow: visible;
}

.report-preview-card .report-title-strip {
    display: none;
}

.no-assignment-report {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.report-title-strip {
    padding: 10px 12px;
    border-radius: 12px;
    color: #fff;
    background: #0f172a;
    font-weight: 900;
    text-align: center;
    letter-spacing: 0;
}

.report-section {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.report-section h4 {
    margin: 0;
    padding: 7px 10px;
    border-radius: 10px;
    color: #fff;
    background: var(--accent);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.report-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel);
}

.report-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.report-table th,
.report-table td {
    padding: 7px 8px;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.report-table th {
    color: var(--text);
    background: rgba(var(--brand-blue-rgb), 0.14);
    font-weight: 800;
}

.report-table td {
    color: var(--text-soft);
    background: var(--field);
}

/* Columnas de marcaje del reporte.
   Una celda puede llevar dos marcas apiladas (un turno con noche) y cada hora
   puede traer su simbolo -asterisco de salida movida, aviso de incidencia-, asi
   que necesitan mas ancho que el resto: con el de antes no cabia "08:00 *" en
   una linea. */
.report-table th[data-col="entrada"],
.report-table td[data-col="entrada"],
.report-table th[data-col="salida"],
.report-table td[data-col="salida"],
.report-table th[data-col="atrasos"],
.report-table td[data-col="atrasos"] {
    min-width: 6.5rem;
    white-space: nowrap;
}

/* Las apiladas conservan su salto de linea propio: lo que no debe partirse es
   la hora de su simbolo, y de eso se encarga el espacio duro. */
.report-table td[data-col="entrada"].report-cell--stacked,
.report-table td[data-col="salida"].report-cell--stacked,
.report-table td[data-col="atrasos"].report-cell--stacked {
    white-space: pre-line;
}

/* Columnas de fecha del reporte.
   El ancho lo repartia el navegador entre todas las columnas y las de texto
   largo -"Turno realizado", "Tipo de permiso"- se llevaban lo suyo: la fecha
   quedaba angosta y "01-08-2026" se partia en dos lineas, con la fila del
   doble de alto que sus vecinas. Se fija el ancho justo del formato
   dd-mm-aaaa y se prohibe el corte, para que todas las filas midan igual. */
.report-table th[data-col="fecha"],
.report-table td[data-col="fecha"],
.report-table th[data-col="inicio"],
.report-table td[data-col="inicio"],
.report-table th[data-col="termino"],
.report-table td[data-col="termino"],
.report-table th[data-col="fechaCambio"],
.report-table td[data-col="fechaCambio"],
.report-table th[data-col="fechaDevolucion"],
.report-table td[data-col="fechaDevolucion"] {
    min-width: 6.5rem;
    white-space: nowrap;
}

.report-worker-data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.report-worker-data-column {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.report-section--worker-data .report-table {
    min-width: 0;
}

.report-section--worker-data .report-table th:first-child,
.report-section--worker-data .report-table td:first-child {
    width: 1%;
    padding-right: 22px;
    white-space: nowrap;
}

.report-table .report-row--inhabil td:first-child {
    background: rgba(248, 113, 113, 0.16);
}

/* Honorarios: el periodo o el dia que pasa el tope de horas del contrato. */
.report-table .report-row--excess td {
    background: rgba(248, 113, 113, 0.16);
    color: #b91c1c;
    font-weight: 600;
}

.honoraria-report-total {
    margin: 4px 0 10px;
    font-size: 0.92rem;
}

.honoraria-report-excess {
    color: #b91c1c;
    font-weight: 600;
}

/* Cruz del dia trabajado sin registro de entrada. El cursor de ayuda avisa que
   hay algo que leer al pasar el mouse; sin el, el tooltip pasa desapercibido. */
.report-table td.report-cell--missing-entry {
    color: #dc2626;
    font-weight: 700;
    text-align: center;
    cursor: help;
}

/* Salida de un turno con noche, traida desde el dia siguiente. El asterisco
   avisa que esa hora no se marco en la fecha de la fila; el hover dice cual. */
.report-table td.report-cell--moved-exit,
.report-table td.report-cell--more-marks {
    cursor: help;
}

/* La celda esconde marcas. El cursor de ayuda solo se descubre cuando el mouse
   ya esta encima, asi que el dia entero podia leerse como correcto sin que
   nada invitara a mirar: el subrayado punteado es lo que dice, sin pasar por
   arriba, que ahi hay algo mas que leer. */
.report-table td.report-cell--more-marks,
.report-table td.report-cell--mark-incident {
    text-decoration: underline dotted currentColor 1px;
    text-underline-offset: 3px;
}

/* Marca cuyo tipo no calza con el turno: el trabajador apreto el boton
   equivocado. La hora vale, pero se senala en ambar para poder revisarla. */
.report-table td.report-cell--mark-incident {
    color: #b45309;
    font-weight: 600;
    cursor: help;
}

.report-signature-footer {
    justify-self: end;
    width: min(320px, 42%);
    min-width: 240px;
    margin-top: 84px;
    margin-right: 28px;
    padding: 8px 2px 0;
    border-top: 1px solid var(--text-soft);
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 650;
    line-height: 1.35;
    text-align: center;
    break-inside: avoid;
    page-break-inside: avoid;
}

.overview-card {
    padding: 24px;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(190px, 20vw, 230px);
    gap: 12px;
    align-items: start;
    grid-auto-flow: row dense;
}

.profile-area {
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

body[data-active-view="profile"] .profile-view-layout {
    font-size: 0.9rem;
}

body[data-active-view="profile"] #profileSection .section-head h3 {
    font-size: 0.95rem;
}

body[data-active-view="profile"] #profileSection .profile-area--personal > .section-head h3,
body[data-active-view="profile"] #profileSection .profile-availability-card > .section-head h3,
body[data-active-view="profile"] #profileSection .profile-area--contract > .section-head h3 {
    font-size: 0.86rem;
}

body[data-active-view="profile"] #profileSection .metric-label,
body[data-active-view="profile"] #profileSection .record-field span {
    font-size: 0.82rem;
}

body[data-active-view="profile"] #profileSection .metric-row--field input,
body[data-active-view="profile"] #profileSection .metric-row--field select,
body[data-active-view="profile"] #profileSection .phone-prefix-field {
    font-size: 0.86rem;
}

body[data-active-view="profile"] #profileSection .profile-status-note,
body[data-active-view="profile"] #profileSection .record-item__values {
    font-size: 0.8rem;
}

body[data-active-view="profile"] #profileSection .profile-availability-card .availability-item,
body[data-active-view="profile"] #profileSection .profile-availability-card .availability-item input,
body[data-active-view="profile"] #profileSection .profile-availability-card .availability-item select {
    font-size: 0.78rem;
}

body[data-active-view="profile"] #profileSection .record-card__head h4,
body[data-active-view="profile"] #profileSection .contract-history-head strong,
body[data-active-view="profile"] #profileSection .profile-mini-head strong {
    font-size: 0.9rem;
}

body[data-active-view="profile"] #profileSection .field-help,
body[data-active-view="profile"] #profileSection .profile-active-toggle small,
body[data-active-view="profile"] #profileSection .record-year-filter,
body[data-active-view="profile"] #profileSection .attachment-item small {
    font-size: 0.74rem;
}

body[data-active-view="profile"] #profileSection .primary-button,
body[data-active-view="profile"] #profileSection .secondary-button {
    font-size: 0.78rem;
}

body[data-active-view="profile"] .profile-view-layout > .sidebar {
    font-size: 0.8rem;
}

body[data-active-view="profile"] .profile-view-layout > .sidebar .panel-title {
    font-size: 0.78rem;
}

body[data-active-view="profile"] .profile-view-layout > .sidebar input,
body[data-active-view="profile"] .profile-view-layout > .sidebar select,
body[data-active-view="profile"] .profile-view-layout > .sidebar .inline-toggle {
    font-size: 0.78rem;
}

body[data-active-view="profile"] .profile-view-layout > .sidebar .profile-item {
    gap: 7px;
    padding: 7px 9px;
    border-radius: 11px;
}

body[data-active-view="profile"] .profile-view-layout > .sidebar .profile-item__avatar {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
}

body[data-active-view="profile"] .profile-view-layout > .sidebar .profile-item__content strong {
    font-size: 0.74rem;
}

body[data-active-view="profile"] .profile-view-layout > .sidebar .profile-item__content span {
    font-size: 0.64rem;
}

.profile-area--contract,
.profile-area--records,
.profile-availability-card {
    grid-column: 1;
}

.profile-medical-chart {
    grid-column: 1 / -1;
    min-width: 0;
}

.profile-side-column {
    display: grid;
    gap: 10px;
    grid-column: 2;
    grid-row: 1 / span 4;
    align-content: start;
    align-self: start;
    position: sticky;
    top: 16px;
    z-index: 6;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    align-items: start;
}

.phone-prefix-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    color: var(--text-soft);
    font-weight: 800;
}

.phone-prefix-field input {
    min-width: 0;
}

.field-help {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.attachment-list {
    display: grid;
    gap: 8px;
}

/* Documentos del perfil en dos columnas para que un solo archivo no ocupe toda
   la fila. minmax(0, 1fr) permite que el nombre se recorte con puntos suspensivos
   sin desbordar. En pantallas angostas vuelve a una sola columna. */
#profileDocsList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
    #profileDocsList {
        grid-template-columns: minmax(0, 1fr);
    }
}

.attachment-empty {
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--text-muted);
    background: var(--calendar-empty);
    border: 1px dashed var(--border);
}

.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--field);
    border: 1px solid var(--border);
}

.attachment-item > span:first-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.attachment-item strong,
.attachment-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-item small {
    color: var(--text-muted);
}

.attachment-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.attachment-view,
.attachment-remove {
    min-height: 34px;
    padding-inline: 12px;
    border-radius: 10px;
}

.profile-actions-card {
    align-content: start;
    position: static;
    width: 100%;
    min-width: 0;
    padding: 12px;
}

.profile-availability-card {
    width: 100%;
    padding: 16px;
    gap: 12px;
    align-content: start;
}

.profile-availability-card .section-head {
    gap: 8px;
    margin-bottom: 0;
}

.profile-availability-card .section-icon {
    width: 26px;
    height: 26px;
}

.profile-availability-card h3 {
    font-size: 1rem;
    line-height: 1.15;
}

.profile-availability-card .availability-list {
    grid-template-columns: repeat(var(--availability-columns, 4), minmax(0, 1fr));
}

.profile-availability-card .availability-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    min-width: 0;
    padding: 9px 10px;
    background: var(--field);
    border-color: var(--border);
    color: var(--text);
    font-size: 0.82rem;
}

.profile-availability-card .availability-item--wide {
    grid-column: auto;
}

.profile-availability-card .availability-item span {
    min-width: 0;
    color: var(--text-soft);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.profile-availability-card .availability-item strong {
    color: var(--text);
}

.profile-availability-card .availability-item input,
.profile-availability-card .availability-item select {
    width: 74px;
    padding: 7px 8px;
    background: var(--panel-alt);
    border-color: var(--border);
    color: var(--text);
    -webkit-text-fill-color: var(--text);
}

.profile-availability-card .availability-item input:disabled,
.profile-availability-card .availability-item input[readonly],
.profile-availability-card .availability-item select:disabled {
    background: var(--panel-alt);
    border-color: var(--border);
    color: var(--text);
    -webkit-text-fill-color: var(--text);
}

.profession-field-stack {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.profile-active-toggle {
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--field);
    border: 1px solid var(--border);
}

.profile-active-toggle span:first-child {
    display: grid;
    gap: 4px;
    font-weight: 800;
}

.profile-active-toggle small {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.35;
}

.profile-records-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.record-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    background: var(--field);
    border: 1px solid var(--border);
    font-family: var(--font-ui);
}

.record-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.record-card__head h4 {
    margin: 0;
    font-size: 1rem;
}

.record-year-filter {
    display: grid;
    gap: 5px;
    min-width: 130px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.record-year-filter select {
    min-height: 36px;
    padding: 8px 30px 8px 10px;
}

.record-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: var(--panel-alt);
    border: 1px dashed var(--border-strong);
}

.record-field {
    display: grid;
    gap: 6px;
}

.record-field span {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.record-field--wide,
.record-add {
    grid-column: 1 / -1;
}

.record-list {
    display: grid;
    gap: 10px;
}

.record-item {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
}

.record-item__values {
    display: grid;
    gap: 4px;
    color: var(--text-soft);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.35;
}

.record-item__values strong {
    color: var(--text);
    font-weight: 800;
}

.record-item small {
    color: var(--text-muted);
}

.overview-card__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(220px, 280px);
    gap: 18px 24px;
    align-items: start;
}

.overview-metrics,
.overview-side {
    display: grid;
    gap: 16px;
}

.metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 40px;
}

.metric-row--field {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-height: auto;
}

.metric-label {
    font-family: var(--font-display);
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.metric-row--field .metric-label {
    font-weight: 700;
}

.metric-row strong {
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.metric-row--field input,
.metric-row--field select {
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Selector de archivos desactivado fuera del modo edicion: se ve claramente
   apagado y con cursor bloqueado (incluye el boton nativo "Elegir archivos"). */
.profile-file-row input[type="file"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-file-row input[type="file"]:disabled::file-selector-button {
    cursor: not-allowed;
    opacity: 0.6;
    filter: grayscale(1);
}

.profile-email-cell {
    position: relative;
    display: block;
    min-width: 0;
}

.profile-email-cell input {
    width: 100%;
}

.profile-email-cell input:invalid {
    border-color: #e5484d;
    box-shadow: 0 0 0 2px rgba(229, 72, 77, 0.18);
}

.profile-email-hint {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 300px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #fff;
    color: #1f2430;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
    border: 1px solid rgba(15, 23, 42, 0.14);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    pointer-events: none;
}

.profile-email-hint[hidden] {
    display: none;
}

.profile-email-hint::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 18px;
    border: 6px solid transparent;
    border-bottom-color: #fff;
}

.metric-input input {
    max-width: none;
    padding: 10px 12px;
}

.metric-toggle .toggle-check {
    justify-self: start;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(var(--brand-blue-rgb), 0.14);
    color: #4190ff;
    font-weight: 700;
}

.overview-actions {
    display: grid;
    gap: 8px;
    align-self: stretch;
}

.overview-actions button {
    width: 100%;
}

.primary-button,
.secondary-button,
.ghost-button {
    min-height: 46px;
    border-radius: 14px;
    padding: 0 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.primary-button {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 18px 26px rgba(var(--brand-blue-rgb), 0.26);
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 24px 30px rgba(var(--brand-blue-rgb), 0.32);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
    opacity: 0.45;
    pointer-events: none;
}

.secondary-button {
    color: var(--accent);
    background: transparent;
    border: 1px solid rgba(var(--brand-blue-rgb), 0.72);
}

.secondary-button:hover,
.ghost-button:hover {
    transform: translateY(-1px);
    background: rgba(var(--brand-blue-rgb), 0.08);
}

.secondary-button--wide,
.primary-button--wide {
    width: 100%;
}

.ghost-button {
    color: var(--text);
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.profile-status-note {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(var(--brand-blue-rgb), 0.22);
    background: rgba(var(--brand-blue-rgb), 0.1);
    color: var(--text-soft);
    line-height: 1.4;
}

.profile-status-note--soft {
    border-color: var(--border-strong);
    border-style: dashed;
    background: var(--panel-alt);
}

.profile-status-note--with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.profile-status-note--with-action span {
    flex: 1 1 220px;
}

.profile-status-action {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 11px;
    border: 1px solid rgba(var(--brand-blue-rgb), 0.34);
    background: var(--panel);
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 800;
}

.profile-status-action:hover {
    background: rgba(var(--brand-blue-rgb), 0.1);
}

.profile-rotation-mini {
    padding: 12px;
    border-radius: 16px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.profile-mini-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.profile-mini-head strong {
    text-align: center;
    text-transform: uppercase;
    font-size: 0.92rem;
    letter-spacing: -0.02em;
}

.profile-mini-head button {
    width: 32px;
    height: 30px;
    border-radius: 10px;
    color: var(--text);
    background: var(--field);
    border: 1px solid var(--border);
    font-weight: 900;
}

.profile-mini-head .profile-mini-month-trigger {
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 30px;
    padding: 4px 10px;
    border-color: transparent;
    background: transparent;
    color: var(--text-strong);
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 850;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
}

.profile-mini-head .profile-mini-month-trigger:hover,
.profile-mini-head .profile-mini-month-trigger:focus-visible {
    border-color: rgba(var(--brand-blue-rgb), 0.42);
    background: rgba(var(--brand-blue-rgb), 0.1);
    color: var(--accent);
    outline: none;
}

.profile-mini-weekdays,
.profile-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.profile-mini-weekdays {
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
}

.profile-mini-spacer {
    min-height: 0;
}

.profile-mini-day {
    position: relative;
    overflow: hidden;
    min-height: 42px;
    padding: 5px;
    border-radius: 11px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    color: var(--text);
    background: var(--field);
    border: 1px solid var(--border);
}

.profile-mini-day span {
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
}

.profile-mini-day small {
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
}

.profile-mini-day.is-pickable {
    cursor: pointer;
}

.profile-mini-day.is-pickable:hover {
    border-color: rgba(var(--brand-blue-rgb), 0.42);
    transform: translateY(-1px);
}

.profile-mini-day.is-selected {
    box-shadow:
        inset 0 0 0 2px rgba(var(--brand-blue-rgb), 0.55),
        0 10px 20px rgba(var(--brand-blue-rgb), 0.18);
}

.profile-mini-day.is-contract-range {
    border-color: rgba(37, 99, 235, 0.72);
    background: rgba(37, 99, 235, 0.14);
}

.profile-mini-day.is-contract-end {
    box-shadow:
        inset 0 0 0 2px rgba(37, 99, 235, 0.62),
        0 10px 20px rgba(37, 99, 235, 0.16);
}

.profile-mini-day.has-existing-contract {
    border-color: rgba(22, 163, 74, 0.72);
    box-shadow:
        inset 0 0 0 2px rgba(22, 163, 74, 0.55),
        0 10px 20px rgba(22, 163, 74, 0.14);
}

.profile-mini-day.has-existing-contract::after {
    content: "";
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.18);
}

.profile-mini-day.has-existing-contract small {
    color: #15803d !important;
    text-transform: uppercase;
}

.profile-mini-day .contract-day-label {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 2px 4px;
    border-radius: 999px;
    color: #fff !important;
    font-size: 0.5rem;
    line-height: 1.05;
    text-transform: none;
}

.profile-mini-day .replacement-contract-preview-turn {
    display: block;
    margin-bottom: 3px;
    color: inherit;
    font-size: 0.66rem;
    font-weight: 900;
    line-height: 1;
}

.profile-mini-day .contract-day-label--new {
    background: #2563eb;
}

.profile-mini-day .contract-day-label--current {
    background: #16a34a;
}

/* El dia del contrato nuevo que SI hereda turno, frente al que no tiene nada
   que heredar (--new). Se distinguen porque el supervisor necesita ver de un
   vistazo cuanto del contrato queda cubierto. */
.profile-mini-day .contract-day-label--inherited {
    background: #0ea5e9;
}

/* Y el que no se pudo heredar: es el que lleva el "!" y hay que cubrir aparte.
   Mismo rojo que el resto de lo que pide atencion. */
.profile-mini-day .contract-day-label--pending {
    background: var(--red, #ef4444);
}

.profile-mini-day.is-contract-range {
    box-shadow:
        inset 0 0 0 2px rgba(37, 99, 235, 0.62),
        0 10px 20px rgba(37, 99, 235, 0.16);
}

.profile-mini-day.has-existing-contract:disabled {
    opacity: 1;
}

.profile-mini-day:disabled {
    cursor: default;
    opacity: 0.82;
}

.profile-mini-day.is-contract-disabled {
    opacity: 0.42;
    filter: grayscale(0.5);
}

/* Inicio del contrato nuevo (flecha verde ->) y termino (flecha azul <-). */
.profile-mini-day.is-contract-start {
    border-color: rgba(22, 163, 74, 0.82);
    background: rgba(22, 163, 74, 0.16);
    box-shadow:
        inset 0 0 0 2px rgba(22, 163, 74, 0.62),
        0 10px 20px rgba(22, 163, 74, 0.16);
}

.contract-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 900;
    line-height: 1;
}

.contract-arrow--start {
    color: #16a34a;
}

.contract-arrow--end {
    color: #2563eb;
}

.profile-mini-day.is-contract-start small,
.profile-mini-day.is-contract-end small {
    color: inherit !important;
    text-transform: none;
}

.profile-mini-help {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.profile-editor {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-alt);
}

.profile-editor__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.profile-editor__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.profile-editor__submit {
    align-self: stretch;
}

.replacement-contract-editor {
    display: grid;
    gap: 10px;
}

.honoraria-contract-editor {
    display: grid;
    gap: 14px;
}

.honoraria-new-contract {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px dashed var(--border);
    border-radius: 14px;
}

.honoraria-new-contract-title {
    font-weight: 700;
    font-size: 0.9rem;
}

.honoraria-new-contract-hint {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.35;
}

.honoraria-add-contract {
    grid-column: 1 / -1;
    justify-self: start;
}

.honoraria-contract-list {
    display: grid;
    gap: 8px;
}

/* En pantalla grande, los contratos se muestran en dos columnas. */
@media (min-width: 768px) {
    .honoraria-contract-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.honoraria-contract-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field);
}

.honoraria-contract-item-info {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.honoraria-contract-item-info small {
    color: var(--text-muted);
}

.honoraria-contract-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}

.honoraria-contract-edit {
    border: none;
    background: transparent;
    color: var(--accent, #10498b);
    line-height: 1;
    cursor: pointer;
    padding: 5px 7px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.honoraria-contract-edit:hover {
    background: rgba(var(--brand-blue-rgb, 37, 99, 235), 0.12);
}

.honoraria-contract-remove {
    border: none;
    background: transparent;
    color: #dc2626;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 8px;
}

.honoraria-contract-remove:hover {
    background: rgba(220, 38, 38, 0.12);
}

.honoraria-contract-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 4px 2px;
}

@media (max-width: 720px) {
    .honoraria-new-contract {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Modal interactivo de contrato de Honorarios (desde el calendario). */
.honoraria-contract-dialog {
    max-width: 440px;
}

.honoraria-contract-month {
    font-weight: 800;
    text-transform: capitalize;
}

.honoraria-contract-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 12px;
    margin-top: 12px;
}

.honoraria-contract-fields .rotation-contract-field {
    min-width: 0;
}

@media (max-width: 520px) {
    .honoraria-contract-fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

.honoraria-overlap-list {
    margin: 8px 0 4px;
    padding-left: 18px;
    display: grid;
    gap: 6px;
    color: var(--text);
    font-size: 0.9rem;
}

.honoraria-overlap-meta {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.honoraria-overlap-actions {
    flex-wrap: wrap;
}

/* Logo documento+lapiz en los dias del calendario principal con contrato de
   Honorarios vigente. */
.day.honoraria-contract-day .day-contract-mark {
    position: absolute;
    top: 3px;
    right: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #16a34a;
    opacity: 0.9;
    pointer-events: none;
}

.day.honoraria-contract-day .day-contract-mark svg {
    width: 13px;
    height: 13px;
}

/* En el dia "hoy" el pin ocupa la esquina superior derecha: se corre el logo. */
.day.today.honoraria-contract-day .day-contract-mark {
    top: 6px;
    right: 30px;
}

.contract-history-panel {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(var(--brand-blue-rgb), 0.08), transparent 46%),
        var(--panel);
}

.contract-history-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.contract-history-head strong {
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 800;
}

.contract-history-head span,
.contract-history-section small,
.contract-history-muted {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.contract-history-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.contract-history-section {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.contract-history-section h4 {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.contract-history-section ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.contract-history-section li {
    display: grid;
    gap: 4px;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.contract-history-section li strong {
    color: var(--text);
    font-size: 0.83rem;
    font-weight: 800;
}

.contract-history-section li span {
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.35;
}

.contract-history-empty {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.actionbar {
    order: -1;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(16, minmax(0, 1fr));
    gap: 5px;
}

/* Orden del menu lateral (mismo orden en la barra movil). Pedido del
   usuario 2026-09-30: Inicio, Solicitudes, Turnos, Cambios de Turno,
   Semanal, Mensual, Asignacion de Tareas, HHEE, Reportes, Perfiles,
   Calificaciones, Titulares, Informaciones, Contactos, Kanban, Equipos
   Medicos, Licitaciones, Memorandum, Dashboard, LOG. */
.actionbar .nav-tile[data-target="homePanel"] {
    order: 1;
}

.actionbar .nav-tile[data-target="workerRequestsPanel"] {
    order: 2;
}

.actionbar .nav-tile[data-target="calendarPanel"] {
    order: 3;
}

#turnChangesNav {
    order: 4;
}

.actionbar .nav-tile[data-target="staffingWeeklyCalendar"] {
    order: 5;
}

.actionbar .nav-tile[data-target="monthlyCalendarPanel"] {
    order: 6;
}

.actionbar .nav-tile[data-target="taskAssignmentsPanel"] {
    order: 7;
}

.actionbar .nav-tile[data-target="hoursPanel"] {
    order: 8;
}

.actionbar .nav-tile[data-target="reportsPanel"] {
    order: 9;
}

.actionbar .nav-tile[data-target="clockMarksPanel"] {
    order: 9;
}

.actionbar .nav-tile[data-target="profileSection"] {
    order: 10;
}

.actionbar .nav-tile[data-target="qualificationsPanel"] {
    order: 11;
}

.actionbar .nav-tile[data-target="shiftHoldersPanel"] {
    order: 12;
}

.actionbar .nav-tile[data-target="informationsPanel"] {
    order: 13;
}

.actionbar .nav-tile[data-target="agendaPanel"] {
    order: 14;
}

.actionbar .nav-tile[data-target="kanbanPanel"] {
    order: 15;
}

.actionbar .nav-tile[data-target="medicalEquipmentPanel"] {
    order: 16;
}

.actionbar .nav-tile[data-target="tendersPanel"] {
    order: 17;
}

.actionbar .nav-tile[data-target="memosPanel"] {
    order: 18;
}

.actionbar .nav-tile[data-target="dashboardPanel"] {
    order: 19;
}

.actionbar .nav-tile[data-target="auditLogPanel"] {
    order: 20;
}

.nav-tile {
    position: relative;
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 62px;
    padding: 7px 4px;
    border-radius: 15px;
    color: var(--text);
    background: transparent;
    border-bottom: 3px solid transparent;
}

.nav-tile--mobile-only {
    display: none;
}

.nav-tile:hover {
    background: var(--panel-hover);
}

.nav-tile:disabled,
.nav-tile.is-disabled,
.nav-tile.is-permission-disabled {
    opacity: 0.38;
    cursor: not-allowed;
    filter: grayscale(1);
}

.nav-tile:disabled:hover,
.nav-tile.is-disabled:hover,
.nav-tile.is-permission-disabled:hover {
    background: transparent;
}

.nav-tile.is-active {
    background: var(--panel-hover);
    border-bottom-color: var(--accent);
}

.nav-tile span {
    max-width: 100%;
    font-size: 0.684rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.08;
    text-align: center;
}

.nav-tile[data-alert-count] {
    padding-right: 34px;
}

.actionbar .nav-tile[data-target="staffingWeeklyCalendar"] span,
.actionbar .nav-tile[data-target="monthlyCalendarPanel"] span,
.actionbar .nav-tile[data-target="taskAssignmentsPanel"] span {
    white-space: normal;
}

.nav-tile .nav-alert-badge {
    position: absolute;
    top: 5px;
    right: 10px;
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #e11d48;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 8px 16px rgba(225, 29, 72, 0.28);
}

.floating-messages-button {
    position: fixed;
    right: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 85;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 18px 40px rgba(var(--brand-blue-rgb), 0.32);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.floating-messages-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 46px rgba(var(--brand-blue-rgb), 0.38);
}

.floating-messages-button svg {
    width: 28px;
    height: 28px;
}

.floating-messages-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    padding: 0 6px;
    border: 2px solid var(--panel);
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
}

.supervisor-messages-backdrop {
    z-index: 120;
}

.supervisor-messages-dialog {
    width: min(920px, calc(100vw - 28px));
    max-height: min(760px, calc(100dvh - 34px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 22px;
    background: var(--panel);
    color: var(--text);
    box-shadow: var(--shadow-panel);
}

.supervisor-messages-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--panel-alt);
}

.supervisor-messages-header strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.supervisor-messages-header small {
    color: var(--text-muted);
    font-weight: 800;
}

.supervisor-messages-close {
    width: 42px;
    height: 42px;
}

.supervisor-messages-body {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
}

.supervisor-message-workers {
    min-height: 0;
    overflow: auto;
    padding: 10px;
    border-right: 1px solid var(--border);
    background: var(--panel-alt);
}

.supervisor-message-search {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: -10px -10px 8px;
    padding: 10px 10px 8px;
    background: var(--panel-alt);
    border-bottom: 1px solid var(--border);
}

.supervisor-message-search input {
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--field);
    color: var(--text);
    font: inherit;
}

.supervisor-message-no-results {
    padding: 12px 6px;
    color: var(--text-soft);
    font-size: 0.85rem;
    text-align: center;
}

.supervisor-messages-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.supervisor-messages-mass-toggle.is-active {
    background: var(--blue);
    border-color: var(--blue);
    color: #ffffff;
}

.supervisor-mass-worker {
    width: 100%;
    display: grid;
    grid-template-columns: 20px 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text);
    cursor: pointer;
}

.supervisor-mass-worker:hover,
.supervisor-mass-worker.is-selected {
    border-color: var(--border-strong);
    background: var(--panel-hover);
}

.supervisor-mass-worker input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.supervisor-mass-worker strong {
    display: block;
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.supervisor-mass-worker small {
    display: block;
    color: var(--text-soft);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.supervisor-message-mass {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    overflow: auto;
}

.supervisor-message-mass-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.supervisor-message-mass-head strong {
    font-size: 1.02rem;
    color: var(--text);
}

.supervisor-message-mass-head small {
    color: var(--text-soft);
    font-weight: 700;
}

.supervisor-mass-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.supervisor-mass-chip {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--field);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.supervisor-mass-chip:hover {
    border-color: var(--border-strong);
    background: var(--panel-hover);
}

.supervisor-mass-text {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--field);
    color: var(--text);
    font: inherit;
}

.supervisor-mass-send {
    align-self: flex-start;
}

.supervisor-mass-send:disabled {
    opacity: 0.6;
    cursor: default;
}

.supervisor-message-worker {
    width: 100%;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.supervisor-message-worker-copy {
    min-width: 0;
}

.supervisor-message-worker:hover,
.supervisor-message-worker.is-active {
    border-color: var(--border-strong);
    background: var(--panel-hover);
}

.supervisor-message-worker.has-unread {
    background: rgba(255, 59, 48, 0.06);
}

.supervisor-message-worker.is-historical {
    border-style: dashed;
    background: var(--panel-alt);
}

.supervisor-message-unread-badge {
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.24);
}

.supervisor-message-worker strong,
.supervisor-message-chat-head strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.92rem;
}

.supervisor-message-worker small,
.supervisor-message-chat-head small {
    display: block;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.supervisor-message-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 900;
}

.supervisor-message-chat {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(280px, 1fr) auto;
}

.supervisor-message-chat-head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.supervisor-message-thread {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    padding: 14px;
}

.supervisor-message-bubble {
    max-width: min(78%, 520px);
    display: grid;
    gap: 5px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-alt);
}

.supervisor-message-bubble.is-mine {
    align-self: flex-end;
    border-color: rgba(var(--brand-blue-rgb), 0.36);
    background: var(--accent);
    color: #fff;
}

.supervisor-message-bubble.is-worker {
    align-self: flex-start;
}

.supervisor-message-bubble p {
    margin: 0;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.supervisor-message-bubble small {
    color: currentColor;
    font-size: 0.68rem;
    font-weight: 800;
    opacity: 0.72;
}

.supervisor-message-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border-top: 1px solid var(--border);
    background: var(--panel-alt);
}

.supervisor-message-composer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
}

/* Clip: el input de archivo va oculto dentro del label, que es el boton. */
.supervisor-message-clip {
    display: grid;
    place-items: center;
    width: 42px;
    height: 48px;
    border: 1px solid var(--field-border);
    border-radius: var(--radius-md);
    background: var(--field);
    color: var(--text-soft);
    cursor: pointer;
}

.supervisor-message-clip:hover { color: var(--accent); border-color: var(--accent); }
.supervisor-message-clip.is-disabled { opacity: 0.5; cursor: not-allowed; }
.supervisor-message-clip svg { width: 19px; height: 19px; }
.supervisor-message-clip input[type="file"] { display: none; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.supervisor-message-attachment {
    display: flex;
    align-items: center;
    gap: 8px;
}

.supervisor-message-attachment[hidden] { display: none; }

.supervisor-message-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--panel);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.supervisor-message-file.is-draft { cursor: default; }
.supervisor-message-file:hover:not(.is-draft) { border-color: var(--accent); }
.supervisor-message-file svg { width: 16px; height: 16px; flex: none; color: var(--text-soft); }
.supervisor-message-file span { display: grid; min-width: 0; }
.supervisor-message-file strong {
    font-size: 0.82rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.supervisor-message-file small { font-size: 0.72rem; color: var(--text-muted); }

.supervisor-message-file-remove {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text-soft);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
}

.supervisor-message-file-remove:hover { color: var(--hm-red); }

/* En la burbuja el adjunto hereda el color del texto de la burbuja. */
.supervisor-message-bubble .supervisor-message-file {
    margin-top: 6px;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.24);
}

.supervisor-message-bubble.is-worker .supervisor-message-file {
    background: var(--panel-alt);
    border-color: var(--border);
}

.supervisor-message-disabled-note {
    margin: 0;
    padding: 9px 11px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.supervisor-message-form textarea {
    min-height: 48px;
    max-height: 120px;
    resize: vertical;
    border: 1px solid var(--field-border);
    border-radius: var(--radius-md);
    background: var(--field);
    color: var(--text);
    font: inherit;
    padding: 10px 12px;
}

.supervisor-messages-empty {
    align-self: center;
    justify-self: center;
    padding: 20px;
    color: var(--text-muted);
    font-weight: 800;
    text-align: center;
}

@media (max-width: 760px) {
    .floating-messages-button {
        right: 16px;
        bottom: calc(18px + env(safe-area-inset-bottom));
        width: 54px;
        height: 54px;
    }

    .supervisor-messages-dialog {
        width: 100vw;
        max-height: 92dvh;
        border-radius: 18px 18px 0 0;
    }

    .supervisor-messages-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .supervisor-message-workers {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .supervisor-message-worker {
        min-width: 220px;
    }

    .supervisor-message-chat {
        grid-template-rows: auto minmax(260px, 1fr) auto;
    }

    .supervisor-message-form {
        grid-template-columns: 1fr;
    }

    .supervisor-message-composer {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .supervisor-message-composer > [type="submit"] {
        grid-column: 1 / -1;
    }

    .supervisor-message-bubble {
        max-width: 88%;
    }
}

.nav-icon {
    width: 24px;
    height: 24px;
}

.history-action-toast {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 4200;
    display: grid;
    gap: 6px;
    width: min(360px, calc(100vw - 32px));
    padding: 15px 18px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #112038;
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(0.98);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease;
}

.history-action-toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.history-action-toast strong {
    color: #0f172a;
    font-size: 0.84rem;
    font-weight: 900;
    letter-spacing: 0;
}

.history-action-toast span {
    color: #1f2f47;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.32;
}

.history-action-toast--undo {
    border-color: rgba(34, 197, 94, 0.36);
}

.history-action-toast--redo {
    border-color: rgba(var(--brand-blue-rgb), 0.36);
}

.app-toast {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 4300;
    display: grid;
    gap: 6px;
    width: min(360px, calc(100vw - 32px));
    padding: 15px 18px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-left-width: 4px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    color: #112038;
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(0.98);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease;
}

.app-toast.is-visible {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
    transform: translateY(0) scale(1);
}

.app-toast strong {
    color: #0f172a;
    font-size: 0.84rem;
    font-weight: 900;
}

.app-toast span {
    color: #1f2f47;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.32;
}

.app-toast--info {
    border-left-color: rgba(var(--brand-blue-rgb), 0.7);
}

.app-toast--success {
    border-left-color: rgba(34, 197, 94, 0.7);
}

.app-toast--warn {
    border-left-color: rgba(245, 158, 11, 0.85);
}

body.theme-dark .app-toast {
    background: rgba(17, 25, 40, 0.96);
    border-color: rgba(148, 163, 184, 0.28);
}

body.theme-dark .app-toast strong,
body.theme-dark .app-toast span {
    color: #e8eefc;
}

.dashboard-panel {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.dashboard-shell {
    display: grid;
    gap: 16px;
}

.dashboard-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.dashboard-card h3 {
    margin: 0;
    color: var(--text-strong);
    letter-spacing: 0;
}

.dashboard-card p {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.4;
}

.dashboard-card {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.dashboard-card h3 {
    font-size: 1rem;
}

.dashboard-card-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 230px);
    gap: 14px;
    align-items: start;
}

.dashboard-card-layout--wide {
    grid-template-columns: minmax(0, 1fr);
}

.dashboard-chart-area {
    min-width: 0;
}

.dashboard-control-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.dashboard-control-card strong {
    color: var(--text-strong);
    font-size: 0.8rem;
}

.dashboard-check-list,
.dashboard-radio-list {
    display: grid;
    gap: 8px;
}

/* ---- Horas extras por trabajador ----
   Dos series (diurnas / nocturnas) en barras apiladas: la altura total es la
   suma, que es justo lo que se quiere comparar entre trabajadores.
   Los pasos de color estan validados contra las superficies reales del app
   (claro #ffffff, oscuro #0a121e): banda de luminosidad, croma, separacion
   para daltonismo y contraste. El modo oscuro NO es un volteo automatico:
   son sus propios pasos del mismo tono. */
.dashboard-overtime {
    --dash-hhee-day: #c9760a;
    --dash-hhee-night: #2f6bd8;
    display: grid;
    gap: 12px;
}

body.theme-dark .dashboard-overtime {
    --dash-hhee-day: #bf801c;
    --dash-hhee-night: #4f88ee;
}

.dashboard-overtime-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    font-size: 0.8rem;
    color: var(--text-soft);
}

.dashboard-overtime-legend b {
    margin-left: auto;
    color: var(--text-strong);
}

.dashboard-overtime-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: -1px;
}

.dashboard-overtime-swatch.is-day { background: var(--dash-hhee-day); }
.dashboard-overtime-swatch.is-night { background: var(--dash-hhee-night); }

.dashboard-overtime-plot {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
}

/* Eje Y: los valores se reparten de arriba hacia abajo alineados con las guias. */
.dashboard-overtime-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 246px;
    padding-bottom: 40px;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
}

/* Las guias van en una capa fija detras de las barras: si viajaran dentro del
   contenedor con scroll se cortarian al desplazarse. */
.dashboard-overtime-field {
    position: relative;
    min-width: 0;
}

.dashboard-overtime-guides {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 206px;
    pointer-events: none;
}

/* Guias horizontales recesivas: orientan sin competir con las barras. */
.dashboard-overtime-guides i {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
    opacity: 0.5;
}

.dashboard-overtime-bars {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 246px;
    padding-bottom: 40px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
}

.dashboard-overtime-item {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    min-width: 48px;
    flex: 1 0 48px;
    height: 100%;
}

.dashboard-overtime-total {
    font-size: 0.72rem;
    color: var(--text-strong);
    margin-bottom: 3px;
}

.dashboard-overtime-stack {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 26px;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
}

.dashboard-overtime-stack span {
    display: block;
    width: 100%;
}

/* Separador de 2px del color de la superficie entre los dos segmentos. */
.dashboard-overtime-night {
    background: var(--dash-hhee-night);
    box-shadow: 0 2px 0 0 var(--panel);
}

.dashboard-overtime-day { background: var(--dash-hhee-day); }

.dashboard-overtime-item small {
    position: absolute;
    bottom: -34px;
    width: 100%;
    font-size: 0.66rem;
    line-height: 1.15;
    color: var(--text-muted);
    text-align: center;
    overflow-wrap: anywhere;
}

.dashboard-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dashboard-month-nav span {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-strong);
}

.dashboard-month-nav button {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--field);
    color: var(--text);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.dashboard-month-nav button:hover { filter: brightness(0.95); }

.dashboard-control-card select {
    width: 100%;
    min-height: 34px;
    padding: 0 8px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--field);
    color: var(--text);
}

.dashboard-check-list label,
.dashboard-radio-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--field);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
}

.dashboard-check-list input,
.dashboard-radio-list input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

.dashboard-check-list span::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 7px;
    border-radius: 999px;
    background: var(--role-color, var(--accent));
}

.dashboard-bar-scroll,
.dashboard-line-scroll {
    overflow-x: auto;
    padding: 4px 4px 10px;
}

.dashboard-stacked-bars {
    display: grid;
    grid-template-columns: repeat(var(--dashboard-bars), minmax(42px, 1fr));
    align-items: end;
    gap: 10px;
    min-width: max(760px, calc(var(--dashboard-bars) * 52px));
    height: 300px;
    padding: 14px 8px 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
        linear-gradient(to top, rgba(148, 163, 184, 0.16) 1px, transparent 1px) 0 0 / 100% 25%,
        var(--panel-alt);
}

.dashboard-stacked-item {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    min-width: 0;
    height: 100%;
}

.dashboard-stacked-bar {
    align-self: end;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
    width: 100%;
    height: 230px;
    overflow: hidden;
    border-radius: 10px 10px 7px 7px;
    background: rgba(148, 163, 184, 0.13);
}

.dashboard-stacked-bar span {
    display: block;
    min-height: 0;
}

.dashboard-stacked-item small,
.dashboard-line-label,
.dashboard-line-axis {
    color: var(--text-muted);
    fill: currentColor;
    font-size: 0.68rem;
    font-weight: 800;
}

.dashboard-stacked-item small {
    text-align: center;
    transform: rotate(-45deg);
    transform-origin: center top;
    white-space: nowrap;
}

.dashboard-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 10px;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 800;
}

.dashboard-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dashboard-chart-legend i {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.dashboard-line-chart {
    display: block;
    min-width: 760px;
    width: 100%;
    height: 300px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.dashboard-line-grid {
    stroke: rgba(148, 163, 184, 0.22);
    stroke-width: 1;
}

.dashboard-line-path {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-line-dot {
    stroke: var(--panel-alt);
    stroke-width: 2;
}

.dashboard-line-label {
    text-anchor: middle;
}

.dashboard-service {
    display: grid;
    gap: 10px;
    position: relative;
}

.dashboard-service-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 800;
}

.dashboard-service-summary b {
    margin-left: auto;
    color: var(--text-strong);
}

.dashboard-service-line {
    display: inline-block;
    width: 26px;
    height: 0;
    margin-right: 6px;
    vertical-align: 3px;
    border-top: 3px solid var(--text-soft);
}

.dashboard-service-line.is-night {
    border-top-style: dashed;
}

.dashboard-service-chart {
    min-width: 820px;
    height: 390px;
    cursor: crosshair;
}

.dashboard-service-hit {
    fill: transparent;
    stroke: transparent;
    stroke-width: 12;
    cursor: pointer;
    outline: none;
    pointer-events: all;
}

.dashboard-service-hit:hover,
.dashboard-service-hit:focus-visible {
    fill: rgba(var(--brand-blue-rgb), 0.08);
}

.dashboard-service-tooltip {
    position: absolute;
    z-index: 25;
    width: min(520px, calc(100% - 16px));
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.2);
    color: var(--text-strong);
    pointer-events: none;
}

.dashboard-service-tooltip[hidden] {
    display: none;
}

.dashboard-service-tooltip-head,
.dashboard-service-tooltip-meta,
.dashboard-service-tooltip li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-service-tooltip-head {
    justify-content: space-between;
    margin-bottom: 6px;
}

.dashboard-service-tooltip-head strong {
    min-width: 0;
    font-size: 0.82rem;
}

.dashboard-service-tooltip-head span,
.dashboard-service-tooltip small {
    flex: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.dashboard-service-tooltip-meta {
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 0.74rem;
    font-weight: 900;
}

.dashboard-service-tooltip-meta b {
    min-width: 26px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(var(--brand-blue-rgb), 0.1);
    color: var(--brand-blue);
    text-align: center;
}

.dashboard-service-tooltip ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dashboard-service-tooltip li {
    justify-content: space-between;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 10px;
    background: var(--panel-alt);
    font-size: 0.74rem;
    font-weight: 900;
}

.dashboard-service-tooltip li span {
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-overflow: ellipsis;
}

.dashboard-service-tooltip p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 800;
}

.dashboard-service-legend i {
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.dashboard-service-professions {
    max-height: 260px;
    overflow-y: auto;
    padding-right: 2px;
}

.dashboard-service-modal .hm-modal-body > div {
    display: grid;
    gap: 16px;
}

.dashboard-ranking {
    display: grid;
    gap: 9px;
}

.dashboard-ranking-row {
    display: grid;
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.dashboard-ranking-person {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.dashboard-ranking-person b {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 10px;
    background: rgba(var(--brand-blue-rgb), 0.14);
    color: var(--accent);
    font-size: 0.8rem;
}

.dashboard-ranking-person span {
    display: grid;
    min-width: 0;
}

.dashboard-ranking-person strong {
    color: var(--text-strong);
    font-size: 0.86rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-ranking-person small {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.dashboard-ranking-bar {
    position: relative;
    min-height: 30px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
}

.dashboard-ranking-bar span {
    position: absolute;
    inset: 0 auto 0 0;
    min-width: 2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #ef4444, #f97316);
}

.dashboard-ranking-bar strong {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 30px;
    padding: 0 12px;
    color: var(--text-strong);
    font-size: 0.78rem;
}

.dashboard-empty,
.dashboard-loading {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 800;
    text-align: center;
}

body.theme-dark .history-action-toast {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.96);
    color: #fff;
}

body.theme-dark .history-action-toast strong,
body.theme-dark .history-action-toast span {
    color: #fff;
}

@media (max-width: 640px) {
    .dashboard-card {
        border-radius: 16px;
        padding: 14px;
    }

    .dashboard-card-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-control-card {
        order: -1;
    }

    .dashboard-ranking-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .dashboard-ranking-person strong {
        white-space: normal;
    }

    .history-action-toast {
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        width: calc(100vw - 24px);
        padding: 13px 14px;
        border-radius: 14px;
    }

    .history-action-toast span {
        font-size: 0.86rem;
    }
}

.tone-blue {
    color: #2a7cff;
}

.tone-light {
    color: #8aa0bd;
}

.tone-green {
    color: #27c66d;
}

.tone-violet {
    color: #b03ff3;
}

.tone-orange {
    color: #ff8c1f;
}

.tone-cyan {
    color: #0ea5e9;
}

.tone-red {
    color: #ef4444;
}

.tone-yellow {
    color: #f4ba24;
}

.tone-muted {
    color: #98a2b3;
}

.primary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
    gap: 18px;
    align-items: start;
    min-width: 0;
}

.primary-grid > *,
.stacked-panels > * {
    min-width: 0;
}

.calendar-panel,
.leave-panel,
.availability-panel,
.hours-panel,
.hours-charts-panel,
.hhee-records-panel,
.turnos-side-panel,
.timeline-panel,
.swap-panel,
.clockmarks-panel,
.audit-log-panel {
    padding: 18px;
}

.stacked-panels {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.section-head--with-action {
    justify-content: space-between;
    gap: 14px;
}

.section-head__title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.secondary-button--small,
.ghost-button--small {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 0.86rem;
    white-space: nowrap;
}

.section-icon,
.legend-dot {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.calendar-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px minmax(240px, 300px) 40px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.calendar-header #prevBtn {
    grid-column: 2;
}

.calendar-header #monthYear {
    grid-column: 3;
}

.calendar-header #nextBtn {
    grid-column: 4;
}

.calendar-month-trigger {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    margin: 0;
    min-width: 0;
    padding: 4px 8px;
    border-radius: 10px;
    text-align: center;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.18s ease, background 0.18s ease;
}

.calendar-month-trigger:hover,
.calendar-month-trigger:focus-visible {
    background: rgba(var(--brand-blue-rgb), 0.1);
    color: var(--accent);
}

.calendar-rotation-button {
    grid-column: 5;
    justify-self: end;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text-strong);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease,
        color 0.16s ease;
}

.calendar-rotation-button:hover,
.calendar-rotation-button:focus-visible {
    border-color: rgba(var(--brand-blue-rgb), 0.58);
    background: rgba(var(--brand-blue-rgb), 0.1);
    color: var(--accent);
    outline: none;
    transform: translateY(-1px);
}

.calendar-month-picker {
    position: fixed;
    z-index: 4000;
    width: min(320px, calc(100vw - 24px));
    padding: 10px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(18px);
}

.calendar-month-picker__year {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    text-align: center;
}

.calendar-month-picker__year-button {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--field);
    color: var(--text);
    cursor: pointer;
}

.calendar-month-picker__year-button svg {
    width: 16px;
    height: 16px;
}

.calendar-month-picker__months {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.calendar-month-picker__month {
    min-height: 34px;
    padding: 5px 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--field);
    color: var(--text);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
}

.calendar-month-picker__month:hover,
.calendar-month-picker__month:focus-visible {
    border-color: rgba(var(--brand-blue-rgb), 0.52);
}

.calendar-month-picker__month.is-active {
    border-color: rgba(var(--brand-blue-rgb), 0.72);
    background: rgba(var(--brand-blue-rgb), 0.16);
    color: var(--accent);
}

.weekdays,
.grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekdays {
    gap: 10px;
    margin-bottom: 12px;
    color: var(--weekday);
    font-size: 0.92rem;
    text-align: center;
}

.grid {
    gap: 10px;
}

.calendar-spacer {
    min-height: 0;
}

.calendar-empty {
    grid-column: 1 / -1;
    padding: 36px 18px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border-strong);
    border-radius: 18px;
    background: var(--calendar-empty);
}

.day {
    position: relative;
    min-height: 78px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: var(--field);
    color: var(--text);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.day:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-soft);
}

.day.draft-selected {
    border-color: rgba(var(--brand-blue-rgb), 0.58);
    box-shadow: inset 0 0 0 2px rgba(var(--brand-blue-rgb), 0.22);
}

.day.worker-blocked-day {
    border-color: rgba(148, 163, 184, 0.72);
    background:
        linear-gradient(135deg, rgba(148, 163, 184, 0.22), rgba(100, 116, 139, 0.12)),
        var(--field);
}

.day.worker-blocked-day .day-badge--worker-blocked {
    background: rgba(100, 116, 139, 0.9);
    color: #fff;
    letter-spacing: 0;
}

body.theme-light .day.worker-blocked-day {
    background:
        linear-gradient(135deg, rgba(148, 163, 184, 0.22), rgba(203, 213, 225, 0.32)),
        var(--field);
}

.day.calendar-direct-edit-feedback {
    transform: scale(0.985);
    filter: saturate(1.08);
}

.day-number {
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1;
}

.day-label {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.1;
}

.day-label--alternating {
    display: grid;
    min-height: 1.1em;
}

.day-label--alternating > span {
    grid-area: 1 / 1;
}

.day-label__primary {
    animation: pendingLeavePrimaryBlink 1.75s ease-in-out infinite;
}

.day-label__alternate {
    animation: pendingLeaveAlternateBlink 1.75s ease-in-out infinite;
}

@keyframes pendingLeavePrimaryBlink {
    0%,
    45% {
        opacity: 1;
        transform: translateY(0);
    }

    50%,
    95% {
        opacity: 0;
        transform: translateY(2px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pendingLeaveAlternateBlink {
    0%,
    45% {
        opacity: 0;
        transform: translateY(-2px);
    }

    50%,
    95% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-2px);
    }
}

.day-label-stack {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}

.day-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 100%;
}

.day-badge {
    align-self: flex-start;
    min-width: 20px;
    min-height: 20px;
    display: inline-grid;
    place-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.26);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

/* Turno trasladado (TTMM). Es la insignia mas larga de todas y ahora comparte
   celda con el "!" de sin cubrir: se achica para que la que exige una accion
   siga siendo la que se ve primero. */
.day-badge--move {
    min-width: 0;
    min-height: 13px;
    padding: 0 4px;
    font-size: 0.42rem;
    letter-spacing: 0.02em;
}

.day-badge--clock {
    padding: 2px;
    background: rgba(var(--brand-blue-rgb), 0.92);
}

.day-badge--clock svg {
    width: 14px;
    height: 14px;
}

.day-badge--preassign {
    padding: 3px 5px;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    color: #fff;
}

.day-badge--preassign svg {
    width: 18px;
    height: 8px;
}

/* Solicitud de cobertura enviada y en espera: azul, distinto del "!" rojo de
   "sin cubrir" y del naranjo del preasignado. */
.day-badge--request {
    padding: 1px 4px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.day-badge--request svg {
    width: 17px;
    height: 17px;
}

/* Casilla con turno preasignado (cobertura tentativa): tinte naranjo distinto del
   "!" pendiente y del reemplazo real. */
.day.preassign-day {
    box-shadow:
        inset 0 0 0 2px rgba(249, 115, 22, 0.6),
        0 10px 22px rgba(249, 115, 22, 0.14);
}

.day.preassign-day .day-badge {
    background: linear-gradient(135deg, #fbbf24, #f97316);
    color: #fff;
}

/* Una casilla con dos insignias (por ejemplo el "!" de sin cubrir junto al
   TTMM de un turno trasladado) se maqueta EXACTAMENTE como cualquier otra: el
   mismo alto, el mismo padding y el mismo `justify-content: space-between` de
   `.day`, que es lo que apoya las insignias abajo.

   Antes esta regla redefinia la caja entera -min-height, height, align-self,
   padding, gap y justify-content- y la casilla salia mas baja que sus vecinas y
   con el "!" flotando a media altura. Lo unico que de verdad hace falta es
   dejar que las insignias se desborden si no entran en una linea. */
.day.has-multiple-badges {
    overflow: visible;
}

.day.has-multiple-badges .day-badges {
    align-content: flex-start;
    gap: 2px;
}

.day.has-multiple-badges .day-badge {
    min-height: 15px;
    padding: 1px 4px;
    font-size: 0.5rem;
    line-height: 1;
}

/* TTMM solo informa que el turno se trasladado; el "!" pide una accion. Va
   despues de la regla de arriba a proposito: con la misma especificidad, gana
   la ultima, y asi queda mas chica que su companera aunque compartan celda. */
.day.has-multiple-badges .day-badge--move {
    min-height: 13px;
    padding: 0 4px;
    font-size: 0.42rem;
    letter-spacing: 0.02em;
}

.turn-change-day {
    box-shadow: inset 0 0 0 2px rgba(251, 146, 60, 0.55);
}

.turn-change-day .day-badge {
    max-width: 100%;
    background: rgba(234, 88, 12, 0.9);
    color: #fff;
    line-height: 1.05;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    text-align: center;
}

/* CCTT (cambio) y DDTT (devolucion) con colores distintos. */
.turn-change-day--change .day-badge {
    background: rgba(234, 88, 12, 0.92);
}

.turn-change-day--return .day-badge {
    background: rgba(124, 58, 237, 0.92);
}

.turn-change-day--return {
    box-shadow: inset 0 0 0 2px rgba(124, 58, 237, 0.5);
}

/* Dia del turno DEVUELTO con color personalizado por el supervisor: pisa el color
   normal del turno (incluso el gradiente inline) manteniendo texto legible. */
.day.turn-change-return-day {
    background: var(--color-turn-change-return) !important;
    color: var(--color-turn-change-return-text, #fff) !important;
}

.day.turn-change-return-day .day-number,
.day.turn-change-return-day .day-label {
    color: var(--color-turn-change-return-text, #fff) !important;
}

.shift-move-day {
    box-shadow: inset 0 0 0 2px rgba(13, 148, 136, 0.58);
}

.shift-move-day .day-badge {
    max-width: 100%;
    background: rgba(13, 148, 136, 0.94);
    color: #fff;
    line-height: 1.05;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    text-align: center;
}

/* Solicitud de CAMBIO DE TURNO pendiente. Reutiliza la maquinaria de parpadeo de
   los permisos (misma clase, mismo periodo, mismo sincronizador de fase) y solo
   cambia el color, para que los dos tipos de solicitud parpadeen juntos y el
   supervisor los distinga por color: naranja permiso, azul cambio de turno. */
.day.pending-swap-request-day,
td.mini.timeline-swap-pending {
    --pending-leave-color: linear-gradient(135deg, #0089c5, #38bdf8);
}

/* Solicitud de permiso pendiente: la celda conserva el color del turno y parpadea
   alternando con el color del permiso (overlay), en sincronia con el nombre. */
.day.pending-leave-request-day {
    color: #fff;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.55),
        0 12px 28px rgba(15, 23, 42, 0.18);
}

/* Overlay con el color del permiso, encima del color del turno y debajo del texto.
   Su opacidad parpadea igual que el nombre del permiso (fase 0-45%). */
.day.pending-leave-request-day > .pending-leave-color-overlay {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--pending-leave-color, var(--color-admin, #f97316));
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    animation: pendingLeaveColorBlink 1.75s ease-in-out infinite;
}

/* Timeline: la casilla-dia (mini) de un permiso pendiente parpadea alternando el
   color del turno (fondo de la celda) con el color del permiso (overlay). */
td.mini.timeline-leave-pending {
    position: relative;
}

td.mini.timeline-leave-pending > .timeline-leave-overlay {
    position: absolute;
    inset: 0;
    background: var(--pending-leave-color, var(--color-admin, #f97316));
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    animation: pendingLeaveColorBlink 1.75s ease-in-out infinite;
}

td.mini.timeline-leave-pending > .timeline-replacement-marker {
    position: relative;
    z-index: 1;
}

.day.pending-leave-request-day > .day-number,
.day.pending-leave-request-day > .day-label-stack {
    position: relative;
    z-index: 1;
}

@keyframes pendingLeaveColorBlink {
    0%,
    45% {
        opacity: 1;
    }

    50%,
    95% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.day.pending-leave-request-day .day-badge {
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    letter-spacing: 0;
}

.day.pending-leave-request-day .day-label {
    color: #fff;
    text-shadow: 0 1px 3px rgba(15, 23, 42, 0.55);
}

.day.needs-replacement {
    box-shadow:
        inset 0 0 0 2px rgba(239, 68, 68, 0.58),
        0 10px 22px rgba(239, 68, 68, 0.16);
}

.day.needs-replacement .day-badge {
    background: #ef4444;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1;
}

.day.needs-extra-reason {
    box-shadow:
        inset 0 0 0 2px rgba(245, 158, 11, 0.72),
        0 10px 22px rgba(245, 158, 11, 0.16);
}

.day.needs-extra-reason .day-badge {
    background: #f59e0b;
    color: #111827;
    font-size: 0.9rem;
    line-height: 1;
}

/* Incidencia que trajo el reporte del reloj (atraso, falta de marca, marca en
   dia libre). Triangulo ambar, distinto del reloj de "marcaje modificado a
   mano": son dos cosas distintas y no pueden leerse igual. */
.day-badge--attendance-incident {
    background: #f59e0b;
    color: #3d2600;
    cursor: pointer;
}

.day-badge--attendance-incident svg {
    width: 13px;
    height: 13px;
}

.attendance-incident-dialog {
    width: min(520px, 100%);
}

.attendance-incident-list {
    display: grid;
    gap: 10px;
    margin: 4px 0 12px;
}

/* Lo que el reloj registro ese dia, marca por marca. Va ARRIBA de las
   incidencias: primero el hecho -a que hora apreto- y despues lo que se le
   encontro raro, que es el orden en que se revisa un dia. */
/* `display: grid` le gana al [hidden] del navegador, asi que hay que decirlo:
   en los cuadros que no son el del marcaje el hueco arranca oculto y solo
   aparece si el dia trae marcas. */
.attendance-marks[hidden] {
    display: none;
}

.attendance-marks {
    display: grid;
    gap: 2px;
    margin: 4px 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--panel-alt);
}

.attendance-marks-turn {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.attendance-mark,
.attendance-marks-turn {
    font-size: 0.86rem;
}

.attendance-mark {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 3px 0;
}

.attendance-mark span,
.attendance-marks-turn span {
    min-width: 62px;
    color: var(--text-soft);
}

.attendance-mark b,
.attendance-marks-turn b {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* La marca que se trajo del dia siguiente: sin la fecha, una salida a las 08:06
   dentro de un turno de noche se lee como si fuera de la manana anterior. */
.attendance-mark em {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: normal;
}

.attendance-marks-loading {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-style: italic;
}

.attendance-incident-item {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-left: 3px solid #f59e0b;
    border-radius: var(--radius-sm);
    background: var(--panel-alt);
}

.attendance-incident-kind {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
}

.attendance-incident-item p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.86rem;
    line-height: 1.5;
}

.day.clock-incident-day {
    box-shadow:
        inset 0 0 0 2px rgba(14, 165, 233, 0.56),
        0 10px 22px rgba(14, 165, 233, 0.12);
}

.day.clock-incident-day .day-badge {
    background: #0ea5e9;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1;
}

.day.clock-severe-day {
    box-shadow:
        inset 0 0 0 2px rgba(220, 38, 38, 0.86),
        0 10px 22px rgba(220, 38, 38, 0.2);
}

.day.clock-severe-day .day-badge {
    min-width: 28px;
    background: #dc2626;
    color: #fff;
    font-size: 0.68rem;
    line-height: 1;
}

.day.contract-error-day {
    box-shadow:
        inset 0 0 0 2px rgba(220, 38, 38, 0.86),
        0 10px 22px rgba(220, 38, 38, 0.18);
}

.day.contract-error-day .day-badge {
    background: #fff;
    color: #dc2626;
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1;
    min-width: 24px;
    min-height: 24px;
    padding: 0 5px;
    box-shadow: 0 0 0 2px #dc2626;
}

.day.replacement-day {
    box-shadow:
        inset 0 0 0 2px rgba(34, 197, 94, 0.6),
        0 10px 22px rgba(34, 197, 94, 0.12);
}

.day.replacement-day .day-badge {
    background: rgba(22, 163, 74, 0.92);
    color: #fff;
    min-height: 17px;
    padding: 1px 6px;
    font-size: 0.54rem;
    letter-spacing: 0.04em;
}

.day.worker-blocked-day .day-badge--worker-blocked {
    min-width: 20px;
    min-height: 20px;
    padding: 2px 7px;
    background: rgba(100, 116, 139, 0.9);
    color: #fff;
    font-size: 0.65rem;
    line-height: 1;
    letter-spacing: 0;
}

.turn-change-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 6, 23, 0.46);
    backdrop-filter: blur(8px);
}

.firebase-mfa-backdrop {
    z-index: 12000;
}

.firebase-mfa-dialog {
    width: min(560px, calc(100vw - 28px));
    display: grid;
    gap: 20px;
}

.firebase-mfa-dialog > header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.firebase-mfa-dialog h3,
.firebase-mfa-dialog p {
    margin: 0;
}

.firebase-mfa-dialog header p {
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.45;
}

.firebase-mfa-shield {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 13px;
    color: #ffffff;
    background: linear-gradient(135deg, #1677ff, #08a88a);
    font-size: 1.2rem;
    font-weight: 800;
}

.firebase-mfa-content,
.firebase-mfa-step {
    display: grid;
    gap: 14px;
}

.firebase-mfa-step {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
}

.firebase-mfa-content label {
    display: grid;
    gap: 7px;
}

.firebase-mfa-secret-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.firebase-mfa-content input,
.firebase-mfa-content textarea {
    width: 100%;
}

.firebase-mfa-content [data-mfa-error] {
    min-height: 1.2em;
    color: var(--red);
}

.firebase-mfa-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 520px) {
    .firebase-mfa-secret-row,
    .firebase-mfa-actions {
        grid-template-columns: 1fr;
    }
}

.day.honoraria-limit-day:not(.needs-replacement):not(.contract-error-day):not(.clock-severe-day) {
    box-shadow:
        inset 0 0 0 2px rgba(220, 38, 38, 0.82),
        0 10px 22px rgba(220, 38, 38, 0.18);
}

.day.honoraria-limit-day:not(.needs-replacement):not(.contract-error-day):not(.clock-severe-day) .day-badge {
    background: #dc2626;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1;
}

.turn-change-dialog-backdrop--locked {
    z-index: 120;
}

body.auth-gate-active .app-shell {
    pointer-events: none;
    user-select: none;
}

.turn-change-dialog {
    width: min(440px, 100%);
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--panel);
    color: var(--text);
    box-shadow: var(--shadow);
}

.turn-change-dialog strong {
    display: block;
    margin-bottom: 10px;
    color: var(--text-strong);
    font-size: 1.08rem;
}

.turn-change-dialog p {
    margin: 0 0 14px;
    color: var(--text-muted);
    line-height: 1.45;
}

.turn-change-dialog__meta {
    margin-bottom: 18px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--field);
    color: var(--text-strong);
    font-weight: 700;
}

/* Detalle del cambio de turno: dia y turno (Larga/Noche) que se entrega y que se
   devuelve. */
.turn-change-dialog__swap-detail {
    list-style: none;
    margin: -8px 0 18px;
    padding: 0;
    display: grid;
    gap: 8px;
}

.turn-change-dialog__swap-detail li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--field);
    border: 1px solid var(--border);
}

.turn-change-dialog__swap-detail li span {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.turn-change-dialog__swap-detail li strong {
    color: var(--text-strong);
    font-weight: 800;
    text-align: right;
}

.turn-change-dialog__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.profile-inactivation-dialog {
    width: min(620px, 100%);
}

.profile-inactivation-calendar {
    margin: 12px 0;
}

.profile-inactivation-calendar .profile-mini-day {
    min-height: 64px;
}

.profile-inactivation-calendar .profile-mini-day.is-selected {
    outline: 3px solid var(--accent);
    outline-offset: 1px;
}

/* ===== Planes / suscripcion ===== */
.plans-button svg {
    color: #f5b94a;
}

.plans-dialog {
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--panel);
    color: var(--text);
    box-shadow: var(--shadow);
    display: grid;
    gap: 16px;
}

.plans-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.plans-dialog-head h3 {
    margin: 0;
    font-size: 1.18rem;
}

.plans-usage {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: var(--field);
}

.plans-usage--muted {
    color: var(--text-muted);
    margin: 0;
}

.plans-usage-plan {
    display: grid;
    gap: 2px;
}

.plans-usage-plan > span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.plans-usage-plan strong {
    font-size: 1.1rem;
}

.plans-usage-flag {
    font-size: 0.74rem;
    color: var(--text-soft);
}

.plans-usage-flag--expired {
    color: #e0556a;
    font-weight: 700;
}

.plans-usage-metrics {
    display: flex;
    gap: 22px;
}

.plans-usage-metrics div {
    display: grid;
    gap: 2px;
    text-align: right;
}

.plans-usage-metrics strong {
    font-size: 1.05rem;
}

.plans-usage-metrics span {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.plan-card {
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-alt);
}

.plan-card.is-current {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent) inset;
}

.plan-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.plan-card-head h4 {
    margin: 0;
    font-size: 1.02rem;
}

.plan-card-badge {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 8px;
    border-radius: 999px;
}

.plan-card-price {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.plan-card-price strong {
    font-size: 1.3rem;
}

.plan-card-price span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.plan-card-price-annual {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: -4px;
}

.plan-card-features {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
    font-size: 0.84rem;
    color: var(--text-soft);
}

.plan-card-features li {
    padding-left: 16px;
    position: relative;
}

.plan-card-features li::before {
    content: "•";
    position: absolute;
    left: 2px;
    color: var(--accent);
}

.plan-card-cta {
    width: 100%;
    margin-top: 4px;
}

.plan-card-cta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}

.plan-card-cta-row button {
    width: 100%;
}

.plan-card-status {
    margin: 6px 0 0;
    font-size: 0.78rem;
    min-height: 1em;
    color: var(--text-muted);
}

.plan-card-status.is-error {
    color: #e0556a;
}

.plan-card-current {
    margin-top: 4px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
}

.plans-quote {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px dashed var(--border-strong);
    border-radius: 16px;
}

.plans-quote strong {
    display: block;
}

.plans-quote span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.plans-footnote {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Cupones (canje + admin) dentro del modal de Planes */
.plans-coupon {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
}

.plans-coupon-row {
    display: flex;
    gap: 8px;
}

.plans-coupon-row input {
    flex: 1;
    text-transform: uppercase;
}

.plans-coupon-status {
    margin: 0;
    font-size: 0.82rem;
    min-height: 1em;
}

.plans-coupon-status.is-error {
    color: #e0556a;
}

.plans-coupon-status.is-ok {
    color: #2bb673;
}

.plans-coupon-note {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.plans-admin {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 10px 14px;
}

.plans-admin > summary {
    cursor: pointer;
    font-weight: 700;
}

.plans-admin-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.plans-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.plans-admin-grid label {
    display: grid;
    gap: 4px;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.plans-admin-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.coupon-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.coupon-row.is-inactive {
    opacity: 0.55;
}

.coupon-row-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.coupon-row-main span {
    font-size: 0.76rem;
    color: var(--text-muted);
}

@media (max-width: 560px) {
    .plans-grid {
        grid-template-columns: 1fr;
    }

    .plans-usage-metrics {
        gap: 16px;
    }

    .plans-admin-grid {
        grid-template-columns: 1fr;
    }
}

.move-shift-dialog {
    width: min(480px, 100%);
}

.move-shift-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0 0 18px;
}

.move-shift-option {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
    min-height: 58px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--field);
    color: var(--text-strong);
    font-weight: 800;
    cursor: pointer;
}

.move-shift-option:has(input:checked) {
    border-color: rgba(var(--brand-blue-rgb), 0.52);
    background: rgba(var(--brand-blue-rgb), 0.1);
    box-shadow: inset 0 0 0 1px rgba(var(--brand-blue-rgb), 0.18);
}

.move-shift-dialog .move-shift-option input[type="radio"] {
    position: static;
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    box-shadow: none;
    accent-color: var(--accent);
    cursor: pointer;
    flex: 0 0 18px;
}

.move-shift-option span {
    line-height: 1.1;
}

@media (max-width: 460px) {
    .move-shift-options {
        grid-template-columns: 1fr;
    }
}

.leave-detail-dialog {
    width: min(460px, 100%);
}

.leave-detail-rows {
    display: grid;
    gap: 8px;
    margin: 6px 0 4px;
}

.leave-detail-rows > div {
    display: grid;
    grid-template-columns: minmax(0, 110px) minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
}

.leave-detail-rows span {
    color: var(--text-soft);
    font-size: 0.82rem;
}

.leave-detail-rows b {
    color: var(--text);
    text-transform: capitalize;
}

/* Correo de quien hizo la accion, bajo su nombre en la fila "Por" de los
   modales de detalle. Va aparte y no pegado al nombre porque estas filas
   capitalizan su valor -un correo capitalizado se lee como mal escrito- y
   porque el nombre de la cuenta puede ser el generico del servicio: el correo
   es lo unico que dice de verdad quien fue. */
.detail-actor-email {
    display: block;
    margin-top: 2px;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: none;
    overflow-wrap: anywhere;
}

.leave-detail-note {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.4;
}

.leave-detail-nocoverage {
    margin: 6px 0;
    padding: 10px 12px;
    border: 1px solid rgba(var(--brand-blue-rgb), 0.3);
    border-radius: 12px;
    background: rgba(var(--brand-blue-rgb), 0.08);
}

.leave-detail-nocoverage > strong {
    display: block;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.9rem;
}

.leave-detail-nocoverage .leave-detail-rows {
    margin: 0;
}

.leave-detail-nocoverage .leave-detail-note {
    margin-top: 8px;
}

.leave-detail-actions--stacked {
    grid-template-columns: 1fr;
}

.clock-detail-dialog {
    width: min(460px, 100%);
}

.clock-detail-rows {
    display: grid;
    gap: 8px;
    margin: 6px 0 10px;
}

.clock-detail-rows > div {
    display: grid;
    grid-template-columns: minmax(0, 110px) minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
}

.clock-detail-rows span {
    color: var(--text-soft);
    font-size: 0.82rem;
}

.clock-detail-rows b {
    color: var(--text);
}

.clock-detail-segments {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.clock-detail-segment {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field);
}

.clock-detail-segment strong {
    color: var(--text);
    font-size: 0.9rem;
}

.clock-detail-segment > span {
    color: var(--text-soft);
    font-size: 0.82rem;
}

.clock-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.clock-detail-tags em {
    font-style: normal;
    font-weight: 700;
    font-size: 0.74rem;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(var(--brand-blue-rgb), 0.12);
    color: var(--accent);
}

.clock-detail-reason {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 0.84rem;
}

.clock-detail-reason span {
    color: var(--text-soft);
    font-weight: 700;
}

/* El turno extra sobre el que se hizo el marcaje: es informacion distinta de la
   incidencia, va en su propio bloque para que no se confundan. */
.clock-detail-extra {
    margin: 4px 0 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field);
}

.clock-detail-extra > strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.86rem;
}

.clock-detail-extra .clock-detail-rows {
    margin: 0;
}

.leave-detail-undo {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid #dc2626;
    border-radius: 14px;
    background: #dc2626;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.leave-detail-undo:hover:not(:disabled) {
    background: #b91c1c;
    border-color: #b91c1c;
}

.leave-detail-undo:disabled {
    opacity: 0.6;
    cursor: default;
}

.replacement-detail-dialog {
    width: min(500px, 100%);
}

.replacement-detail-rows {
    margin-bottom: 12px;
}

/* Un dia puede tener MAS DE UN turno asignado (un D+N con su Diurno y su Noche
   respaldados por separado son dos registros). Cuando hay varios, cada uno va en
   su tarjeta con su propio "Anular reemplazo". */
.replacement-detail-dialog--multi {
    width: min(620px, 100%);
    max-height: min(80vh, 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.replacement-detail-list {
    display: grid;
    gap: 12px;
    margin: 4px 0 12px;
    overflow: auto;
    padding-right: 4px;
}

.replacement-detail-card {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--panel-alt);
}

.replacement-detail-card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.replacement-detail-card__head strong {
    color: var(--text);
    font-size: 0.95rem;
}

.replacement-detail-card__head small {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.replacement-detail-card .replacement-detail-rows {
    margin-bottom: 12px;
}

.replacement-detail-card .leave-detail-undo {
    width: 100%;
}

.worker-app-invite-dialog {
    width: min(520px, 100%);
}

#workerAppInviteBtn.is-linked {
    background: #1f8a4c;
    border-color: #1f8a4c;
    color: #ffffff;
}

#workerAppInviteBtn.is-linked:hover:not(:disabled) {
    background: #1a7741;
    border-color: #1a7741;
}

/* Invitado pero sin abrir el enlace: ambar, para separarlo tanto del enlazado
   (verde) como del que nunca fue invitado (neutro). */
#workerAppInviteBtn.is-invite-pending {
    background: #b45309;
    border-color: #b45309;
    color: #ffffff;
}

#workerAppInviteBtn.is-invite-pending:hover:not(:disabled) {
    background: #92400e;
    border-color: #92400e;
}

/* Panel de estado de enlaces */
.worker-link-status-dialog {
    width: min(560px, 100%);
    max-height: min(80vh, 720px);
    display: flex;
    flex-direction: column;
}

.worker-link-status-dialog .wl-intro {
    color: var(--text-muted);
    margin: 4px 0 12px;
}

.worker-link-status-dialog .wl-list {
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.worker-link-status-dialog .wl-section {
    margin: 14px 0 6px;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    gap: 8px;
}

.worker-link-status-dialog .wl-section span {
    background: var(--panel-soft, rgba(148, 163, 184, 0.18));
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 0.78rem;
}

.worker-link-status-dialog .wl-empty {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: 2px 0 0;
}

.worker-link-status-dialog .wl-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 6px;
}

.worker-link-status-dialog .wl-row--none {
    background: rgba(239, 68, 68, 0.06);
}

.worker-link-status-dialog .wl-row--pending {
    background: rgba(180, 83, 9, 0.07);
}

.worker-link-status-dialog .wl-row__name {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.worker-link-status-dialog .wl-row__name small {
    color: var(--text-muted);
}

.worker-link-status-dialog .wl-badge {
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.78rem;
    white-space: nowrap;
}

.worker-link-status-dialog .wl-badge--linked {
    background: rgba(31, 138, 76, 0.14);
    color: #1f8a4c;
}

.worker-link-status-dialog .wl-badge--pending {
    background: rgba(180, 83, 9, 0.14);
    color: #b45309;
}

.worker-link-status-dialog .wl-badge--none {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
}

.worker-app-invite-profile {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin: 4px 0 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--field);
}

.worker-app-invite-avatar {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
    font-weight: 900;
}

.worker-app-invite-profile b,
.worker-app-invite-profile small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.worker-app-invite-profile small {
    margin-top: 3px;
    color: var(--text-muted);
    font-weight: 750;
}

.worker-app-invite-link {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--text-strong);
    font-weight: 850;
}

.worker-app-invite-link input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
    color: var(--text);
    font: inherit;
}

.worker-app-invite-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.worker-app-unlink-button {
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid #dc2626;
    border-radius: 14px;
    background: #dc2626;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.worker-app-unlink-button:hover:not(:disabled) {
    background: #b91c1c;
    border-color: #b91c1c;
}

.worker-app-unlink-button:disabled {
    opacity: 0.6;
    cursor: default;
}

.rotation-config-dialog {
    width: min(620px, 100%);
    max-height: min(88vh, 760px);
    overflow: auto;
}

.rotation-start-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.rotation-start-option {
    display: grid;
    gap: 4px;
    min-height: 72px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--field);
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.rotation-start-option span {
    color: var(--text-strong);
    font-weight: 900;
}

.rotation-start-option small {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.rotation-start-option.is-selected {
    border-color: rgba(var(--brand-blue-rgb), 0.7);
    background:
        linear-gradient(135deg, rgba(var(--brand-blue-rgb), 0.16), rgba(34, 197, 94, 0.08)),
        var(--panel);
    box-shadow: 0 0 0 3px rgba(var(--brand-blue-rgb), 0.1);
}

.rotation-contract-field {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--text-strong);
    font-weight: 800;
}

.rotation-contract-field input,
.rotation-contract-field select {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
    color: var(--text);
    font: inherit;
}

.rotation-contract-field input:focus,
.rotation-contract-field select:focus {
    outline: none;
    border-color: rgba(var(--brand-blue-rgb), 0.58);
    box-shadow: 0 0 0 3px rgba(var(--brand-blue-rgb), 0.12);
}

.rotation-contract-field > small {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
}

/* Buscar permisos en otras unidades: el boton y su aclaracion. */
.rotation-contract-linked {
    gap: 6px;
}

/* El contenedor pone font-weight 800 para las etiquetas; la nota es una
   aclaracion, no un titulo, y en negrita pesada competia con ellas. */
.rotation-contract-linked > small {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
}

/* ===================================================================
   Contrato de reemplazo: cuadro en dos columnas

   Portado del mockup aprobado. Prefijo `rc-` en TODO: los nombres del
   mockup (.day, .step, .mode) son genericos y en una hoja de 27 mil
   lineas chocarian con algo, silenciosamente y en otra pantalla.

   La idea: las decisiones a la izquierda y el calendario a la derecha
   como consecuencia visible. Antes era una sola columna con scroll
   interno y el calendario quedaba cortado al fondo.
   =================================================================== */

.rc-dialog {
    width: min(1060px, 100%);
    padding: 0;
    overflow: hidden;

    /* El cuadro NO puede crecer mas que la pantalla. El pie lleva "Guardar
       contrato": si queda por debajo del pliegue, y encima el cuadro tiene
       `overflow: hidden`, no hay ninguna forma de guardar. Se desplaza el
       cuerpo; cabecera y pie se quedan siempre a la vista. */
    max-height: min(92vh, 940px);
    display: flex;
    flex-direction: column;
}

.rc-head,
.rc-foot {
    flex: none;
}

/* El `[hidden]` del navegador PIERDE contra una clase que fije `display`, y
   aqui varias lo fijan (`rc-why`, `rc-jump`, `rc-bands`, `rc-legend`). Sin
   esto, el recuadro de explicacion vacio se veia como una franja roja al pie
   del calendario aunque no hubiera ningun dia pendiente. */
.rc-dialog [hidden] {
    display: none !important;
}

.rc-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(
        180deg,
        rgba(var(--brand-blue-rgb), 0.07),
        transparent
    );
}

.rc-head h3 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.12rem;
    color: var(--text-strong);
}

.rc-head p {
    margin: 4px 0 0;
    font-size: 0.86rem;
    color: var(--text-soft);
    max-width: 62ch;
}

/* Barra de resumen: lo que se va a crear, siempre a la vista. */
.rc-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 22px;
    padding: 14px 24px;
    background: var(--panel-2, var(--field));
    border-bottom: 1px solid var(--border);
}

.rc-sum-item {
    display: grid;
    gap: 1px;
}

.rc-sum-k {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.rc-sum-v {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-strong);
    font-variant-numeric: tabular-nums;
}

.rc-sum-sep {
    width: 1px;
    align-self: stretch;
    background: var(--border);
}

.rc-tally-group {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rc-tally {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.rc-tally--ok {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

.rc-tally--pend {
    background: rgba(239, 68, 68, 0.13);
    color: #b91c1c;
}

body.theme-dark .rc-tally--ok { color: #6ee7a0; }
body.theme-dark .rc-tally--pend { color: #fca5a5; }

/* El "!" de siempre, en tamano de texto. */
.rc-bang {
    display: inline-grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1;
}

.rc-body {
    display: grid;
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);

    /* Lo que se desplaza es esto. `min-height: 0` hace falta o el hijo de un
       flex no encoge por debajo de su contenido y el pie vuelve a irse fuera. */
    min-height: 0;
    overflow: auto;
}

.rc-decide {
    padding: 20px 22px 22px;
    border-right: 1px solid var(--border);
    display: grid;
    gap: 18px;
    align-content: start;
}

.rc-preview {
    padding: 20px 22px 22px;
    display: grid;
    gap: 14px;
    align-content: start;
}

.rc-step {
    display: grid;
    gap: 8px;
}

.rc-step-head {
    display: flex;
    align-items: center;
    gap: 9px;
}

.rc-step-n {
    flex: 0 0 auto;
    width: 21px;
    height: 21px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    background: rgba(var(--brand-blue-rgb), 0.14);
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 800;
}

.rc-step-t {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-soft);
}

/* Los modos dejan de ser un select ciego: cada uno dice que hace. */
.rc-modes {
    display: grid;
    gap: 8px;
}

.rc-mode {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--panel);
    cursor: pointer;
}

.rc-mode:hover {
    border-color: rgba(var(--brand-blue-rgb), 0.45);
}

.rc-mode input {
    margin: 3px 0 0;
    accent-color: var(--accent);
}

.rc-mode-t {
    font-weight: 700;
    color: var(--text-strong);
    font-size: 0.9rem;
}

.rc-mode-d {
    font-size: 0.77rem;
    color: var(--text-soft);
    line-height: 1.4;
}

.rc-mode.is-on {
    border-color: var(--accent);
    background: rgba(var(--brand-blue-rgb), 0.06);
}

/* Deshabilitado CON motivo: antes se apagaba sin decir por que. */
.rc-mode.is-off {
    opacity: 0.55;
    cursor: not-allowed;
}

.rc-mode.is-off .rc-mode-d {
    color: var(--orange);
    font-weight: 600;
}

.rc-cal-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rc-cal-nav {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text-soft);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.rc-cal-nav:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.rc-cal-month {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.98rem;
    color: var(--text-strong);
}

.rc-jump {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
    font: inherit;
    font-weight: 800;
    font-size: 0.79rem;
    cursor: pointer;
}

body.theme-dark .rc-jump { color: #fca5a5; }

/* Las tres barras hacen VISIBLE el traslape, que antes habia que deducir. */
.rc-bands {
    display: grid;
    gap: 5px;
}

.rc-band {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.rc-band-k {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-align: right;
}

.rc-band-track {
    position: relative;
    height: 13px;
    border-radius: 999px;
    background: var(--field);
    overflow: hidden;
}

.rc-band-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: 999px;
}

.rc-band-fill--prev { background: rgba(34, 197, 94, 0.45); }
.rc-band-fill--new { background: rgba(var(--brand-blue-rgb), 0.5); }

.rc-band-fill--lap {
    background: repeating-linear-gradient(
        45deg,
        rgba(240, 177, 0, 0.75) 0 5px,
        rgba(240, 177, 0, 0.3) 5px 10px
    );
}

.rc-why {
    display: grid;
    gap: 3px;
    padding: 11px 13px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.07);
}

.rc-why-t {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-strong);
}

.rc-why-d {
    font-size: 0.8rem;
    color: var(--text-soft);
}

.rc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 0.75rem;
    color: var(--text-soft);
}

.rc-lg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rc-sw {
    width: 13px;
    height: 13px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.rc-sw--prev {
    background: rgba(34, 197, 94, 0.35);
    border-color: rgba(34, 197, 94, 0.5);
}

.rc-sw--new {
    background: rgba(var(--brand-blue-rgb), 0.3);
    border-color: rgba(var(--brand-blue-rgb), 0.5);
}

.rc-sw--lap {
    background: repeating-linear-gradient(
        45deg,
        rgba(240, 177, 0, 0.8) 0 4px,
        rgba(240, 177, 0, 0.28) 4px 8px
    );
    border-color: rgba(240, 177, 0, 0.6);
}

.rc-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--panel-2, var(--field));
}

.rc-foot-note {
    font-size: 0.82rem;
    color: var(--text-soft);
    max-width: 60ch;
}

.rc-foot-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

/* Marcas sobre las casillas del mini calendario del cuadro. */
.rc-cal .profile-mini-day.is-rc-prev {
    background: rgba(34, 197, 94, 0.09);
    border-color: rgba(34, 197, 94, 0.3);
}

.rc-cal .profile-mini-day.is-rc-new {
    background: rgba(var(--brand-blue-rgb), 0.07);
    border-color: rgba(var(--brand-blue-rgb), 0.28);
}

.rc-cal .profile-mini-day.is-rc-lap {
    box-shadow: inset 0 0 0 2px rgba(240, 177, 0, 0.55);
}

.rc-cal .profile-mini-day.is-rc-pending {
    border-color: rgba(239, 68, 68, 0.55);
    background: rgba(239, 68, 68, 0.08);
}

.rc-cal .profile-mini-day.is-rc-target {
    outline: 3px solid rgba(239, 68, 68, 0.45);
    outline-offset: 2px;
}

.rc-cal .profile-mini-day.is-rc-inherited,
.rc-cal .profile-mini-day.is-rc-excluded {
    cursor: pointer;
}

.rc-cal .profile-mini-day.is-rc-inherited:hover {
    filter: brightness(1.05);
}

.rc-day-bang {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    border: 0;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.rc-day-turn {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 6px;
    color: #fff;
}

@media (max-width: 900px) {
    .rc-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .rc-decide {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .rc-band {
        grid-template-columns: 90px minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .rc-summary {
        gap: 10px 14px;
    }

    .rc-sum-sep {
        display: none;
    }

    .rc-tally-group {
        margin-left: 0;
        width: 100%;
    }

    .rc-band-k {
        font-size: 0.62rem;
    }
}

.rotation-modal-head {
    margin-top: 4px;
}

.rotation-modal-calendar {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-alt);
}

.rotation-modal-grid .profile-mini-day {
    min-height: 52px;
}

.grade-effective-dialog {
    width: min(560px, 100%);
}

.grade-effective-dialog p {
    margin: 6px 0 10px;
    color: var(--text-muted);
    line-height: 1.45;
}

.grade-effective-dialog b {
    color: var(--text-strong);
    font-weight: 850;
}

.firebase-dialog {
    width: min(620px, 100%);
    max-height: min(88vh, 760px);
    overflow: auto;
}

.firebase-dialog code {
    padding: 2px 6px;
    border-radius: 8px;
    background: var(--field);
    color: var(--text-strong);
    font-size: 0.9em;
}

.firebase-dialog-note,
.firebase-empty {
    padding: 12px 14px;
    border: 1px dashed var(--border-strong);
    border-radius: 14px;
    background: var(--panel-alt);
    color: var(--text-muted);
    line-height: 1.4;
}

.firebase-dialog-note--success {
    background: rgba(34, 197, 94, 0.13);
    color: #15803d;
    font-weight: 750;
}

.firebase-dialog-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.firebase-field {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-alt);
}

.firebase-field span {
    color: var(--text-strong);
    font-weight: 800;
}

.firebase-field input {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field);
    color: var(--text);
    font: inherit;
}

.firebase-field input:focus {
    outline: none;
    border-color: rgba(var(--brand-blue-rgb), 0.58);
    box-shadow: 0 0 0 3px rgba(var(--brand-blue-rgb), 0.12);
}

.firebase-workspace-list {
    display: grid;
    gap: 10px;
    margin: 14px 0;
}

.firebase-workspace-item {
    display: grid;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--field);
    color: var(--text);
    text-align: left;
    cursor: default;
}

.firebase-workspace-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.firebase-workspace-main span {
    display: grid;
    gap: 3px;
}

.firebase-workspace-main strong {
    color: var(--text-strong);
}

.firebase-workspace-main small {
    color: var(--text-muted);
}

.firebase-workspace-main em {
    color: var(--blue);
    font-style: normal;
    font-weight: 900;
}

.firebase-workspace-use {
    min-width: 92px;
    min-height: 38px;
}

.firebase-workspace-invite-help {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.88rem;
    font-weight: 750;
    line-height: 1.35;
}

.firebase-workspace-email {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.38fr);
    gap: 8px;
    align-items: end;
}

.firebase-workspace-email-field {
    display: grid;
    gap: 6px;
}

.firebase-workspace-email-field span {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 800;
}

.firebase-workspace-email-field input {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text-strong);
    font: inherit;
}

.firebase-workspace-email-field input:focus {
    outline: none;
    border-color: rgba(var(--brand-blue-rgb), 0.58);
    box-shadow: 0 0 0 3px rgba(var(--brand-blue-rgb), 0.12);
}

.firebase-workspace-email button {
    min-height: 42px;
    padding: 0 12px;
    font-size: 0.9rem;
}

.firebase-workspace-danger {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.firebase-workspace-danger.is-pending {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #ef4444;
    border-radius: 12px;
    background: #fef2f2;
    color: #991b1b;
}

.firebase-workspace-danger.is-pending strong {
    display: block;
    margin-bottom: 4px;
}

.firebase-workspace-danger.is-pending p {
    margin: 0 0 8px;
    font-size: 0.86rem;
    line-height: 1.4;
}

.danger-button {
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #ef4444;
    border-radius: 10px;
    background: #fff;
    color: #dc2626;
    font-weight: 700;
}

.danger-button:hover {
    background: #fef2f2;
}

.firebase-workspace-danger.is-pending .primary-button {
    background: #ef4444;
}

.firebase-workspace-item.is-active {
    border-color: rgba(34, 197, 94, 0.55);
    background:
        linear-gradient(135deg, rgba(34, 197, 94, 0.13), rgba(var(--brand-blue-rgb), 0.08)),
        var(--panel);
}

.firebase-linked-panel {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid rgba(20, 184, 166, 0.22);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(20, 184, 166, 0.09), rgba(var(--brand-blue-rgb), 0.05)),
        var(--panel-alt);
}

.firebase-linked-panel > strong {
    color: var(--text-strong);
}

.firebase-linked-panel p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.45;
}

.firebase-linked-status {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
    font-weight: 750;
}

.firebase-linked-request {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.firebase-linked-request input {
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text-strong);
    font: inherit;
}

.firebase-linked-list {
    display: grid;
    gap: 8px;
}

.firebase-linked-list > span {
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 850;
}

.firebase-linked-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.firebase-linked-item--action {
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.firebase-linked-item--action:hover,
.firebase-linked-item--action:focus-visible {
    border-color: rgba(37, 99, 235, 0.42);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
    transform: translateY(-1px);
}

.firebase-linked-item div:first-child {
    display: grid;
    gap: 3px;
}

.firebase-linked-item small {
    color: var(--text-muted);
}

.firebase-linked-item em {
    color: #0f766e;
    font-style: normal;
    font-weight: 900;
}

.firebase-linked-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.firebase-linked-actions button {
    min-height: 34px;
    padding-inline: 12px;
    font-size: 0.82rem;
}

.supervisor-invite-dialog {
    width: min(720px, calc(100vw - 32px));
}

.supervisor-invite-permissions {
    max-height: min(48vh, 440px);
    overflow: auto;
    padding-right: 4px;
}

.supervisor-invite-error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.supervisor-invite-actions {
    grid-template-columns: 1fr 1fr 1fr;
}

.supervisor-invite-item {
    align-items: flex-start;
}

.supervisor-invite-item--approved {
    border-color: rgba(34, 197, 94, 0.55);
    background:
        linear-gradient(135deg, rgba(34, 197, 94, 0.13), rgba(var(--brand-blue-rgb), 0.08)),
        var(--panel);
}

.supervisor-invite-item--approved:hover,
.supervisor-invite-item--approved:focus-visible {
    border-color: rgba(34, 197, 94, 0.68);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.supervisor-invite-item--approved small {
    color: #15803d;
}

.supervisor-invite-item--danger {
    border-color: rgba(239, 68, 68, 0.48);
    background:
        linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(254, 242, 242, 0.82)),
        #fff;
}

.supervisor-invite-item--danger small {
    color: #b91c1c;
}

.replacement-dialog .turn-change-dialog__actions {
    grid-template-columns: 1fr 1fr;
    margin-top: 14px;
}

.replacement-dialog-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 6px 0 12px;
}

.replacement-dialog-toolbar button {
    min-height: 40px;
    padding-inline: 12px;
    font-size: 0.78rem;
}

.replacement-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.replacement-options-icon {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--field);
    color: var(--accent);
    cursor: pointer;
}

.replacement-options-icon svg {
    width: 24px;
    height: 20px;
}

.replacement-options-icon:hover,
.replacement-options-icon.is-open {
    background: rgba(var(--brand-blue-rgb), 0.12);
    border-color: rgba(var(--brand-blue-rgb), 0.5);
}

/* La cabecera es un flex con el titulo a la izquierda: los dos controles van
   agrupados para que sigan juntos a la derecha. */
.replacement-dialog-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* La cruz de cerrar, que reemplaza al boton "Cancelar" del pie. Toma la misma
   caja que el de "Mas opciones" para que la cabecera quede pareja. */
.replacement-dialog-close {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--field);
    color: var(--text-soft);
    font: inherit;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.replacement-dialog-close:hover {
    background: rgba(var(--brand-blue-rgb), 0.12);
    border-color: rgba(var(--brand-blue-rgb), 0.5);
    color: var(--text);
}

/* Sin "Cancelar" el pie puede quedar con un numero impar de botones: el
   ultimo, si queda solo en su fila, la ocupa entera en vez de dejar un hueco. */
.replacement-dialog__actions > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.replacement-search {
    width: 100%;
    min-height: 40px;
    margin: 2px 0 12px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field);
    color: var(--text);
    font: inherit;
}

.replacement-search.is-hidden {
    display: none;
}

/* El buscador y la casilla de "enviar a todos", en una sola fila. El is-hidden
   se le sigue aplicando SOLO al input -el buscador aparece cuando la lista
   desborda-, asi que la casilla sobrevive aunque el buscador no este. Los
   margenes viven en los hijos y no en la fila: con los dos ocultos, la fila no
   deja un hueco. */
.replacement-search-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.replacement-search-row .replacement-search {
    flex: 1 1 auto;
}

.replacement-send-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 12px;
    white-space: nowrap;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 800;
}

.replacement-send-all input {
    width: 17px;
    height: 17px;
    accent-color: var(--blue);
}

.replacement-candidate.is-search-hidden {
    display: none;
}

.replacement-options-panel {
    display: grid;
    gap: 12px;
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(var(--brand-blue-rgb), 0.05), rgba(20, 184, 166, 0.04)),
        var(--panel-alt);
}

.replacement-options-panel.is-hidden {
    display: none;
}

.replacement-option-row {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.replacement-option-label {
    color: var(--text-soft);
    font-size: 0.74rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.replacement-segmented {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
}

.replacement-segment {
    min-height: 36px;
    padding: 7px 10px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.replacement-segment:hover {
    color: var(--text-strong);
    background: rgba(var(--brand-blue-rgb), 0.08);
}

.replacement-segment.is-active {
    background: var(--panel);
    color: var(--accent);
    box-shadow:
        0 0 0 1px rgba(var(--brand-blue-rgb), 0.24),
        0 6px 16px rgba(15, 23, 42, 0.08);
}

.replacement-segment--green.is-active {
    color: #0f766e;
    box-shadow:
        0 0 0 1px rgba(20, 184, 166, 0.3),
        0 6px 16px rgba(15, 23, 42, 0.08);
}

.replacement-segment--amber.is-active {
    color: #c2410c;
    box-shadow:
        0 0 0 1px rgba(249, 115, 22, 0.3),
        0 6px 16px rgba(15, 23, 42, 0.08);
}

.replacement-coverage-exception {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid rgba(220, 38, 38, 0.16);
    border-radius: 14px;
    background: rgba(220, 38, 38, 0.08);
}

.replacement-coverage-exception.is-disabled {
    opacity: 0.52;
}

.replacement-coverage-exception-copy {
    display: grid;
    gap: 2px;
}

.replacement-coverage-exception-copy strong {
    margin: 0;
    color: var(--text-strong);
    font-size: 0.88rem;
    line-height: 1.15;
}

.replacement-coverage-exception-copy small {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.3;
}

.replacement-coverage-button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(220, 38, 38, 0.26);
    border-radius: 11px;
    background: var(--panel);
    color: #b91c1c;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 850;
    white-space: nowrap;
    cursor: pointer;
}

.replacement-coverage-button:hover:not(:disabled) {
    background: rgba(220, 38, 38, 0.12);
}

.replacement-coverage-button:disabled {
    cursor: not-allowed;
}

.replacement-dialog-note {
    padding: 10px 12px;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.12);
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.35;
}

.replacement-candidate-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    max-height: min(420px, 52vh);
    overflow: auto;
    padding-right: 4px;
}

.replacement-candidate-group-title {
    grid-column: 1 / -1;
    padding: 4px 4px 0;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Escritorio: 2 columnas de candidatos en el modal de reemplazo para que quepan
   mas en pantalla. Solo el modal (no la subseccion de respaldo de turnos extra). */
@media (min-width: 860px) {
    .replacement-dialog {
        width: min(760px, 100%);
    }

    .replacement-dialog .replacement-candidate-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.replacement-candidate {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--field);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.replacement-candidate:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--brand-blue-rgb), 0.48);
    background: var(--panel-alt);
}

.replacement-candidate.is-disabled,
.replacement-candidate:disabled {
    opacity: 0.62;
    cursor: not-allowed;
    transform: none;
}

.replacement-candidate.is-selected {
    border-color: rgba(var(--brand-blue-rgb), 0.72);
    background: linear-gradient(135deg, rgba(var(--brand-blue-rgb), 0.14), rgba(34, 197, 94, 0.1));
    box-shadow: 0 0 0 3px rgba(var(--brand-blue-rgb), 0.1);
}

.replacement-candidate--forced {
    border-color: rgba(245, 158, 11, 0.46);
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.1), transparent 54%),
        var(--field);
}

.replacement-candidate--linked {
    border-color: rgba(20, 184, 166, 0.48);
    background:
        linear-gradient(135deg, rgba(20, 184, 166, 0.12), transparent 58%),
        var(--field);
}

.replacement-candidate--worker-blocked {
    border-color: rgba(148, 163, 184, 0.72);
    background:
        linear-gradient(135deg, rgba(148, 163, 184, 0.18), transparent 58%),
        var(--field);
}

/* Ya tiene el turno puesto a mano y sin motivo: elegirlo no le suma otro, le
   pone el respaldo al que tiene. Celeste suave -no ambar- porque no es un
   reparo: es el mejor candidato del dia, y el color lo distingue del resto sin
   decir "cuidado". */
.replacement-candidate--backs-extra {
    border-color: rgba(56, 189, 248, 0.55);
    background:
        linear-gradient(135deg, rgba(56, 189, 248, 0.16), transparent 58%),
        var(--field);
}

.replacement-candidate-backs-extra {
    display: block;
    margin-top: 4px;
    color: #0369a1;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: normal;
}

.replacement-candidate--request {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: flex-start;
    cursor: default;
}

.replacement-candidate--request:not(.is-disabled) {
    cursor: pointer;
}

.replacement-candidate-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--blue);
}

.replacement-candidate span {
    display: grid;
    gap: 3px;
}

.replacement-candidate em {
    justify-self: end;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
    font-size: 0.66rem;
    font-style: normal;
    font-weight: 800;
}

.replacement-candidate b {
    justify-self: end;
}

.replacement-candidate-hours {
    justify-self: end;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.replacement-candidate small {
    color: var(--text-muted);
}

.replacement-candidate-state {
    font-weight: 750;
    color: var(--text) !important;
}

.replacement-candidate-warning {
    max-width: 54ch;
    color: #94a3b8 !important;
    font-weight: 800;
    line-height: 1.25;
}

/* Cubrir una noche cuando al dia siguiente entra por la mañana: encadena la
   jornada sin dormir. No se bloquea, se advierte. */
.replacement-candidate-next-shift {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(180, 83, 9, 0.16);
    color: #b45309;
    font-weight: 800;
}

.replacement-candidate--next-day-shift {
    background: rgba(250, 204, 21, 0.13);
    border-color: rgba(180, 83, 9, 0.38);
}

.replacement-candidate--next-day-shift:hover:not(:disabled) {
    background: rgba(250, 204, 21, 0.2);
}

body.theme-light .replacement-candidate--next-day-shift {
    background: rgba(250, 204, 21, 0.22);
}

body.theme-light .replacement-candidate-warning {
    color: #64748b !important;
}

.replacement-request-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 12px;
    padding: 12px 14px;
    border: 1px solid rgba(var(--brand-blue-rgb), 0.22);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(var(--brand-blue-rgb), 0.08), transparent 68%),
        var(--field);
    color: var(--text);
}

.replacement-request-toggle input {
    width: 42px;
    height: 22px;
    accent-color: var(--blue);
}

.replacement-request-toggle span {
    display: grid;
    gap: 2px;
}

.replacement-request-toggle strong {
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.15;
}

.replacement-request-toggle small {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

/* Cuando se preasigna, la aprobacion del trabajador no aplica: se atenua. */
.replacement-request-toggle.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.replacement-request-toggle.is-disabled input {
    pointer-events: none;
}

/* "Preasignar turno": toggle button (estado intermedio) */
.replacement-preassign-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 4px 0 12px;
    padding: 12px 14px;
    border: 1px solid rgba(249, 115, 22, 0.28);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(249, 115, 22, 0.08), transparent 68%),
        var(--field);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.replacement-preassign-toggle:hover {
    border-color: rgba(249, 115, 22, 0.5);
}

.replacement-preassign-toggle.is-active {
    border-color: rgba(249, 115, 22, 0.65);
    background:
        linear-gradient(135deg, rgba(249, 115, 22, 0.16), rgba(251, 191, 36, 0.1) 70%),
        var(--field);
    box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.35);
}

.replacement-preassign-text {
    display: grid;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.replacement-preassign-toggle strong {
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.15;
}

.replacement-preassign-toggle small {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.replacement-preassign-switch {
    position: relative;
    flex: none;
    width: 42px;
    height: 22px;
    border-radius: 999px;
    background: var(--border);
    transition: background 0.15s ease;
}

.replacement-preassign-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease;
}

.replacement-preassign-toggle.is-active .replacement-preassign-switch {
    background: linear-gradient(135deg, #fbbf24, #f97316);
}

.replacement-preassign-toggle.is-active .replacement-preassign-switch::after {
    transform: translateX(20px);
}

/* La solicitud enviada se muestra SOBRE la tarjeta del candidato al que se le
   pidio. El boton de anular va como hermano de la tarjeta, posicionado encima:
   la tarjeta es un <button> (o un <label>) y no admite otro boton adentro. */
.replacement-candidate-slot {
    position: relative;
    display: grid;
    min-width: 0;
}

.replacement-candidate-slot > .replacement-candidate {
    width: 100%;
    /* Aire para que el texto no pase por debajo del boton. */
    padding-right: 74px;
}

.replacement-candidate-cancel {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(220, 38, 38, 0.35);
    background: var(--panel);
    color: #dc2626;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
}

.replacement-candidate-cancel:hover {
    background: rgba(220, 38, 38, 0.1);
}

.extra-reason-dialog .turn-change-dialog__actions {
    grid-template-columns: 1fr 1fr;
}

/* El que scrollea es el CUERPO, no el modal entero: antes las acciones se iban
   con el scroll y habia que bajar hasta el fondo para guardar, incluso con un
   solo tramo que respaldar. */
.overtime-backup-dialog {
    /* Ancho para las dos columnas de cada tramo (ver __cols). */
    width: min(860px, 100%);
    max-height: min(86vh, 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Con dos tramos hay el doble de contenido: el modal se ensancha y los tramos
   se reparten en dos columnas, en vez de uno debajo del otro fuera de la
   pantalla. */
.overtime-backup-dialog--split {
    width: min(1040px, 100%);
}

/* Cada tramo en dos columnas: ausencia compatible y motivo escrito a la
   izquierda; los motivos predefinidos a la derecha, con su propio scroll. */
.overtime-backup-subsection__cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.overtime-backup-subsection__main,
.overtime-backup-subsection__presets {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.overtime-backup-subsection__label {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.overtime-backup-subsection .overtime-backup-subsection__presets .replacement-dialog-toolbar {
    grid-template-columns: minmax(0, 1fr);
    max-height: 300px;
    margin: 0;
}

.overtime-backup-subsection__main .replacement-candidate-list {
    grid-template-columns: minmax(0, 1fr);
}

.overtime-backup-subsection__main .empty-state {
    width: 100%;
    min-height: 0;
    padding: 14px;
}

.overtime-backup-subsection__main .overtime-backup-skip {
    justify-self: start;
    margin-top: 0;
}

.overtime-backup-subsection__presets .replacement-dialog-toolbar button {
    justify-content: flex-start;
    min-height: 36px;
    text-align: left;
    white-space: normal;
}

/* Con dos tramos, cada uno ya es una columna: adentro se apilan. */
.overtime-backup-dialog--split .overtime-backup-subsection__cols {
    grid-template-columns: minmax(0, 1fr);
}

.overtime-backup-dialog--split .overtime-backup-subsection .overtime-backup-subsection__presets .replacement-dialog-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 168px;
}

@media (max-width: 720px) {
    .overtime-backup-subsection__cols {
        grid-template-columns: minmax(0, 1fr);
    }

    .overtime-backup-subsection .overtime-backup-subsection__presets .replacement-dialog-toolbar {
        max-height: 168px;
    }
}

.overtime-backup-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
    margin-right: -4px;
}

.overtime-backup-dialog .turn-change-dialog__actions {
    flex: none;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.overtime-backup-grid {
    display: grid;
    gap: 12px;
}

.overtime-backup-grid--split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

/* Estado de cada tramo. Sin esto, que un turno extra de dos tramos necesita DOS
   respaldos solo se descubria al guardar. */
.overtime-backup-state {
    flex: none;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--hm-warn-soft, rgba(249, 115, 22, 0.16));
    color: var(--hm-warn, #ea8a10);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.overtime-backup-state.is-done {
    background: var(--hm-good-soft, rgba(34, 197, 94, 0.16));
    color: var(--hm-good, #16a34a);
}

/* Tramo apartado con "Sin motivo aun": queda a la vista, atenuado, para que se
   note que sigue pendiente y no se confunda con uno respaldado. */
.overtime-backup-state.is-skipped {
    background: var(--panel-alt);
    color: var(--text-muted);
}

.overtime-backup-skip {
    align-self: flex-start;
    margin-top: 10px;
    padding: 6px 12px;
    border: 1px dashed var(--border-strong);
    border-radius: 999px;
    color: var(--text-soft);
    background: transparent;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.overtime-backup-skip:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.overtime-backup-skip.is-active {
    border-style: solid;
    border-color: var(--text-muted);
    color: var(--text);
    background: var(--panel-alt);
}

.overtime-backup-subsection.is-skipped {
    opacity: 0.72;
}

.overtime-backup-subsection.is-skipped .replacement-candidate-list,
.overtime-backup-subsection.is-skipped .replacement-dialog-toolbar {
    pointer-events: none;
    opacity: 0.55;
}

.overtime-backup-subsection.is-missing {
    border-color: rgba(249, 115, 22, 0.55);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.14);
}

/* Los motivos predefinidos son catorce botones POR TRAMO: son los que estiraban
   el modal. Con scroll propio dejan de empujar al resto. */
.overtime-backup-subsection .replacement-dialog-toolbar {
    max-height: 168px;
    overflow: auto;
    margin-bottom: 0;
    padding-right: 4px;
}

/* Y la lista de ausencias compatibles no necesita 420px aqui: suele traer una o
   dos, y lo que hace falta es que quepa el resto del tramo. */
.overtime-backup-subsection .replacement-candidate-list {
    max-height: 180px;
}

@media (max-width: 820px) {
    .overtime-backup-grid--split {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Pie del modal de respaldo: "Quitar turno extra" va a la izquierda, separado
   de Cancelar/Guardar, porque es la accion destructiva. El pie normal de estos
   cuadros es una rejilla de dos columnas; aca son tres botones. */
.extra-reason-dialog .turn-change-dialog__actions.overtime-backup-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.overtime-backup-actions__spacer {
    flex: 1 1 auto;
}

.overtime-backup-actions .secondary-button,
.overtime-backup-actions .primary-button,
.overtime-backup-actions .danger-button {
    flex: 0 0 auto;
}

@media (max-width: 560px) {
    .overtime-backup-actions__spacer {
        display: none;
    }

    .overtime-backup-actions .secondary-button,
    .overtime-backup-actions .primary-button,
    .overtime-backup-actions .danger-button {
        flex: 1 1 100%;
    }
}

.overtime-backup-section {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background:
        linear-gradient(145deg, rgba(var(--brand-blue-rgb), 0.06), rgba(34, 197, 94, 0.04)),
        var(--panel-alt);
}

.overtime-backup-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-strong);
    font-size: 0.94rem;
    font-weight: 800;
}

.overtime-backup-section__head small {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(var(--brand-blue-rgb), 0.12);
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.overtime-backup-section p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.overtime-backup-subsection {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.44);
}

body.theme-dark .overtime-backup-subsection {
    background: rgba(15, 23, 42, 0.28);
}

.overtime-backup-subsection__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-strong);
    font-size: 0.9rem;
    font-weight: 800;
}

.overtime-backup-subsection .extra-reason-field {
    margin-top: 0;
}

.extra-reason-field {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 700;
}

.extra-reason-field textarea {
    width: 100%;
    min-height: 78px;
    resize: vertical;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
    color: var(--text);
    font: inherit;
}

.extra-reason-field textarea:focus {
    outline: none;
    border-color: rgba(var(--brand-blue-rgb), 0.55);
    box-shadow: 0 0 0 3px rgba(var(--brand-blue-rgb), 0.12);
}

.clock-mark-dialog {
    width: min(520px, 100%);
    padding: 28px;
    border-radius: 34px;
    background:
        radial-gradient(circle at 12% 10%, rgba(var(--brand-blue-rgb), 0.12), transparent 32%),
        var(--panel);
}

.clock-mark-dialog--simple {
    width: min(460px, 100%);
}

.clock-mark-dialog--split {
    width: min(520px, 100%);
}

.clock-mark-dialog > p {
    margin-bottom: 18px;
}

/* Reparto de un turno entre dos: una fila por trabajador, con su tramo. */
.cover-split-dialog {
    width: min(480px, 100%);
}

.cover-split-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.cover-split-row label {
    display: grid;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-soft);
}

.cover-split-row input {
    min-height: 38px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--field);
    color: var(--text-strong);
    font: inherit;
    font-weight: 700;
}

.cover-split-hint {
    margin: -6px 0 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* El nombre es el asa: se toca para tomarlo y se toca otro para permutar. */
.cover-split-worker {
    padding: 8px 10px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text-strong);
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.cover-split-worker.is-taken {
    border-style: solid;
    border-color: rgba(var(--brand-blue-rgb), 0.6);
    background: rgba(var(--brand-blue-rgb), 0.12);
}

.cover-split-row.is-drop-target {
    background: rgba(var(--brand-blue-rgb), 0.08);
}

/* Media hora arriba o abajo: el reloj no se escribe a mano, se mueve a pasos.
   Asi no hay forma de tipear un horario que se pise con el de al lado. */
.cover-split-step {
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--field);
    color: var(--text-strong);
    font: inherit;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.cover-split-step:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cover-split-time {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cover-split-time > b {
    min-width: 52px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* El hueco es un bloque mas de la tira, no la ausencia de uno: se ve, dice
   cuanto dura y lleva encima las dos decisiones posibles. */
.cover-split-row--gap {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    border-top: 1px dashed var(--border);
    background: rgba(var(--brand-amber-rgb, 217, 119, 6), 0.08);
}

.cover-split-gap-label {
    font-weight: 800;
    color: var(--text-soft);
}

.cover-split-gap-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cover-split-row--gap.is-no-coverage {
    opacity: 0.65;
}

/* En el celular las dos horas no caben junto al nombre. */
@media (max-width: 480px) {
    .cover-split-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cover-split-row > .cover-split-worker {
        grid-column: 1 / -1;
    }
}

.training-time-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.training-time-grid label {
    display: grid;
    gap: 7px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.training-time-grid input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 12px;
    color: var(--text);
    background: var(--panel);
    font: inherit;
    font-weight: 800;
}

.training-dialog-summary {
    min-height: 20px;
    margin: 12px 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.training-dialog-summary.is-error {
    color: var(--red);
}

.clock-mark-dialog .turn-change-dialog__actions {
    grid-template-columns: 1fr 1fr;
    margin-top: 22px;
}

.clock-mark-segments {
    display: grid;
    gap: 16px;
}

.clock-mark-segment {
    padding: 0 0 16px;
    border-bottom: 1px solid var(--border);
}

.clock-mark-segment:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.clock-mark-segment h3 {
    margin: 0 0 12px;
    color: var(--text-strong);
    font-size: 1rem;
    font-weight: 800;
}

.clock-mark-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.clock-mark-segment__status {
    margin: 10px 0 0;
    padding: 6px 10px;
    border-radius: 9px;
    background: rgba(var(--brand-blue-rgb), 0.1);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
}

.clock-mark-segment__status[hidden] {
    display: none;
}

.clock-mark-column {
    display: grid;
    gap: 8px;
}

.clock-mark-column > span {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 700;
}

.clock-time-inputs {
    display: grid;
    grid-template-columns: minmax(58px, 1fr) auto minmax(58px, 1fr);
    align-items: center;
    gap: 7px;
}

.clock-time-inputs > span {
    color: var(--text-muted);
    font-weight: 800;
}

.clock-time-number {
    width: 100%;
    min-height: 38px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--field);
    color: var(--text-strong);
    font: inherit;
    font-weight: 700;
    text-align: center;
}

.clock-time-number:focus {
    outline: none;
    border-color: rgba(var(--brand-blue-rgb), 0.6);
    box-shadow: 0 0 0 3px rgba(var(--brand-blue-rgb), 0.12);
}

.clock-time-number:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.clock-missing-button {
    min-height: 36px;
    border: 1px solid rgba(var(--brand-blue-rgb), 0.38);
    border-radius: 10px;
    background: rgba(var(--brand-blue-rgb), 0.12);
    color: var(--text-strong);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.clock-missing-button span {
    color: #e11d48;
    font-weight: 900;
}

.clock-missing-button:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--brand-blue-rgb), 0.72);
    background: rgba(var(--brand-blue-rgb), 0.18);
}

.clock-missing-button.is-active {
    border-color: rgba(225, 29, 72, 0.42);
    background: rgba(225, 29, 72, 0.12);
    color: #be123c;
}

.amount-dialog {
    width: min(430px, 100%);
    padding: 28px;
    border-radius: 34px;
    background:
        radial-gradient(circle at 12% 10%, rgba(var(--brand-blue-rgb), 0.12), transparent 32%),
        var(--panel);
}

.amount-dialog .turn-change-dialog__actions {
    grid-template-columns: 1fr 1fr;
    margin-top: 22px;
}

.amount-dialog-field {
    display: grid;
    gap: 9px;
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 800;
}

.amount-dialog-field input {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
    color: var(--text-strong);
    font: inherit;
    font-size: 1.08rem;
    font-weight: 800;
}

.amount-dialog-field input:focus {
    outline: none;
    border-color: rgba(var(--brand-blue-rgb), 0.6);
    box-shadow: 0 0 0 3px rgba(var(--brand-blue-rgb), 0.12);
}

.amount-dialog-field small {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 700;
}

.hours-return-dialog {
    width: min(540px, 100%);
    padding: 28px;
    border-radius: 34px;
    background:
        radial-gradient(circle at 12% 10%, rgba(20, 184, 166, 0.16), transparent 32%),
        var(--panel);
}

.hours-return-dialog .turn-change-dialog__actions {
    grid-template-columns: 1fr 1fr;
    margin-top: 18px;
}

.hours-return-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.hours-return-field {
    display: grid;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.94rem;
    font-weight: 800;
}

.hours-return-field input,
.hours-return-field select {
    min-height: 46px;
    font-weight: 800;
}

.hours-return-summary {
    display: grid;
    gap: 4px;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(20, 184, 166, 0.22);
    border-radius: 16px;
    background: rgba(20, 184, 166, 0.1);
    color: var(--text);
}

.hours-return-summary span,
.hours-return-summary small {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 800;
}

.hours-return-summary strong {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
}

.hours-return-result {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--field);
    color: var(--text);
    font-weight: 800;
}

.hours-return-result.is-invalid {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.hours-return-full-button {
    width: 100%;
    min-height: 44px;
    margin-top: 12px;
    border: 1px solid rgba(20, 184, 166, 0.42);
    border-radius: 14px;
    background: rgba(20, 184, 166, 0.14);
    color: var(--text);
    font: inherit;
    font-weight: 900;
}

.hours-return-full-button:disabled {
    cursor: not-allowed;
    opacity: 0.46;
}

.system-settings-dialog {
    width: min(920px, 100%);
    max-height: min(86vh, 760px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

.settings-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.settings-dialog-head strong {
    margin-bottom: 6px;
}

.settings-dialog-head p {
    margin: 0;
}

.settings-tabs {
    display: inline-grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    padding: 6px;
    border-radius: 16px;
    background: var(--field);
    border: 1px solid var(--border);
}

.settings-tabs button {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    /* Sin background explicito el navegador aplica su gris por defecto, que en
       modo noche se veia como un boton blanco. Transparente toma el color del
       contenedor (--field) y funciona en ambos temas. */
    background: transparent;
    color: var(--text-muted);
    font-weight: 800;
}

.settings-tabs button:hover {
    background: var(--panel-hover);
    color: var(--text);
}

.settings-tabs button.is-active {
    color: var(--blue);
    background: var(--panel);
    box-shadow: inset 0 -2px 0 var(--blue);
}

.settings-panel {
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.settings-subtitle {
    margin: 0 0 6px;
    font-size: 1rem;
    color: var(--text-strong, var(--text));
}

.settings-hint {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.4;
}

.settings-color-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    margin-bottom: 16px;
}

.settings-color-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field, #fff);
}

.settings-color-name {
    min-width: 0;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-color-field {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.settings-color-field input[type="color"] {
    width: 42px;
    height: 30px;
    min-height: 0;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.settings-color-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    cursor: pointer;
}

.settings-color-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.settings-color-field input[type="color"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.settings-reset-colors {
    width: auto;
}

@media (max-width: 760px) {
    .settings-color-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.settings-grade-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
}

.settings-card {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--panel-alt);
}

.settings-card--wide {
    max-width: 720px;
}

.settings-card__head {
    display: grid;
    gap: 4px;
}

.settings-card__head h4 {
    margin: 0;
    color: var(--text-strong);
}

.settings-card__head span {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.settings-table-wrap {
    overflow: auto;
}

.settings-table {
    width: 100%;
    border-collapse: collapse;
}

.settings-table th,
.settings-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.settings-table th {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.settings-money-field {
    display: grid;
    grid-template-columns: auto minmax(96px, 1fr);
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 12px;
    background: var(--field);
    border: 1px solid var(--border);
}

.settings-money-field input {
    min-height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
}

.settings-holiday-form {
    display: grid;
    grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.settings-holiday-form label {
    display: grid;
    gap: 6px;
}

.settings-holiday-form label span {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.settings-request-field {
    display: grid;
    max-width: 320px;
    gap: 8px;
    color: var(--text-soft);
    font-size: 0.88rem;
    font-weight: 700;
}

.settings-request-field input {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
    color: var(--text);
    font: inherit;
}

.settings-request-field small {
    color: var(--text-muted);
    font-weight: 600;
}

.settings-limit-field {
    display: grid;
    max-width: 340px;
    gap: 8px;
    margin-left: 44px;
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 800;
}

.settings-limit-field input {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
    color: var(--text);
    font: inherit;
}

.settings-signature-grid {
    display: grid;
    gap: 10px;
}

.settings-signature-field {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--field);
}

.settings-signature-field span {
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 850;
}

.settings-signature-field input {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
}

.settings-switch-grid {
    display: grid;
    gap: 10px;
}

.settings-switch {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--field);
    cursor: pointer;
}

.settings-switch.is-disabled {
    cursor: not-allowed;
    opacity: 0.66;
}

.settings-switch input {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: var(--blue);
}

.settings-switch span {
    display: grid;
    gap: 4px;
}

.settings-switch strong {
    color: var(--text-strong);
    font-size: 0.94rem;
    line-height: 1.25;
}

.settings-switch small {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.35;
}

.settings-users-list {
    display: grid;
    gap: 14px;
}

.settings-user-invite {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(var(--brand-blue-rgb), 0.22);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(var(--brand-blue-rgb), 0.08), rgba(20, 184, 166, 0.06)),
        var(--panel);
}

.settings-user-invite > div:first-child {
    display: grid;
    gap: 4px;
}

.settings-user-invite strong {
    color: var(--text-strong);
}

.settings-user-invite span {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.settings-user-invite__form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.settings-user-invite__field {
    display: grid;
    gap: 6px;
}

.settings-user-invite__field input {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text-strong);
    font: inherit;
}

.settings-user-invite__field input:focus {
    outline: none;
    border-color: rgba(var(--brand-blue-rgb), 0.58);
    box-shadow: 0 0 0 3px rgba(var(--brand-blue-rgb), 0.12);
}

.settings-user-invite__form button {
    min-height: 42px;
    padding: 0 14px;
    font-size: 0.9rem;
}

.settings-user-invite-message {
    padding: 9px 11px;
    border-radius: 12px;
    font-size: 0.84rem;
    font-weight: 800;
}

.settings-user-invite-message--ok {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.settings-user-invite-message--error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.settings-user-card {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--field);
}

.settings-user-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.settings-user-card__head span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.settings-user-card__head strong {
    color: var(--text-strong);
    font-size: 0.95rem;
}

.settings-user-card__head small {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.settings-user-card__head em {
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--panel-hover);
    color: var(--blue);
    font-size: 0.76rem;
    font-style: normal;
    font-weight: 850;
}

.settings-user-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.settings-user-delete {
    min-height: 28px;
    padding: 0 10px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
    font-size: 0.74rem;
    font-weight: 850;
}

.settings-user-delete:hover {
    background: rgba(239, 68, 68, 0.16);
}

.settings-user-delete:disabled {
    opacity: 0.55;
    cursor: wait;
}

.settings-permission-grid {
    display: grid;
    gap: 6px;
}

.settings-permission-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px 72px;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 10px;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 750;
}

.settings-permission-row--head {
    color: var(--text-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.settings-permission-row:not(.settings-permission-row--head) {
    background: var(--panel);
}

.settings-permission-row input {
    width: 18px;
    height: 18px;
    justify-self: center;
    accent-color: var(--blue);
}

.settings-holiday-list {
    display: grid;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
}

.settings-holiday-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
}

.settings-holiday-item span {
    display: grid;
    gap: 2px;
}

.settings-holiday-item small {
    color: var(--text-muted);
}

.settings-holiday-item button {
    min-height: 32px;
    padding: 0 10px;
    border-radius: 10px;
    color: var(--red);
    background: rgba(239, 68, 68, 0.1);
}

.settings-empty {
    padding: 16px;
    border: 1px dashed var(--border-strong);
    border-radius: 14px;
    color: var(--text-muted);
    text-align: center;
}

.settings-actions {
    flex: 0 0 auto;
}

@media (max-width: 560px) {
    .system-settings-dialog {
        max-height: calc(100vh - 28px);
        padding: 18px;
        border-radius: 24px;
    }

    .settings-dialog-head {
        align-items: center;
    }

    .settings-tabs,
    .settings-grade-grid,
    .settings-holiday-form,
    .settings-signature-field,
    .firebase-dialog-grid,
    .firebase-linked-request,
    .firebase-workspace-email,
    .settings-user-invite__form,
    .settings-actions {
        grid-template-columns: 1fr;
    }

    .clock-mark-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .settings-limit-field {
        margin-left: 0;
        max-width: none;
    }
}

.green,
.blue,
.purple,
.lightgreen,
.yellow,
.half-morning,
.half-afternoon,
.eighteen,
.admin-day,
.half-admin-day,
.legal-day,
.legal-soft,
.comp-day,
.comp-soft,
.training-day,
.license-day,
.union-leave-day,
.professional-license-day,
.unpaid-leave-day,
.unjustified-absence-day,
.hours-return-day {
    color: #fff !important;
    border-color: transparent !important;
}

/* Colores de turno configurables (variables seteadas desde Ajustes). El color
   de texto se calcula por contraste. Los turnos extra (replacement-day) usan
   su propia variable para poder distinguirse del turno base. */
.green {
    background: var(--turno-color-1, #0089c5) !important;
    color: var(--turno-text-1, #ffffff) !important;
}

.blue {
    background: var(--turno-color-2, #10498b) !important;
    color: var(--turno-text-2, #ffffff) !important;
}

.purple {
    background: var(--turno-color-3, #8b2bd9) !important;
    color: var(--turno-text-3, #ffffff) !important;
}

.lightgreen {
    background: var(--turno-color-4, #0b8853) !important;
    color: var(--turno-text-4, #ffffff) !important;
}

.yellow {
    background: var(--turno-color-5, #f0b100) !important;
    color: var(--turno-text-5, #1c1c1c) !important;
}

.half-morning {
    background: var(--turno-color-6, #fbbf24) !important;
    color: var(--turno-text-6, #1c1c1c) !important;
}

.half-afternoon {
    background: var(--turno-color-7, #f59e0b) !important;
    color: var(--turno-text-7, #1c1c1c) !important;
}

.eighteen {
    background: var(--turno-color-8, #7c3aed) !important;
    color: var(--turno-text-8, #ffffff) !important;
}

.day.replacement-day.green {
    background: var(--turno-color-1-extra, #0089c5) !important;
    color: var(--turno-text-1-extra, #ffffff) !important;
}

.day.replacement-day.blue {
    background: var(--turno-color-2-extra, #10498b) !important;
    color: var(--turno-text-2-extra, #ffffff) !important;
}

.day.replacement-day.purple {
    background: var(--turno-color-3-extra, #8b2bd9) !important;
    color: var(--turno-text-3-extra, #ffffff) !important;
}

.day.replacement-day.lightgreen {
    background: var(--turno-color-4-extra, #0b8853) !important;
    color: var(--turno-text-4-extra, #ffffff) !important;
}

.day.replacement-day.yellow {
    background: var(--turno-color-5-extra, #f0b100) !important;
    color: var(--turno-text-5-extra, #1c1c1c) !important;
}

.day.replacement-day.half-morning {
    background: var(--turno-color-6-extra, #fbbf24) !important;
    color: var(--turno-text-6-extra, #1c1c1c) !important;
}

.day.replacement-day.half-afternoon {
    background: var(--turno-color-7-extra, #f59e0b) !important;
    color: var(--turno-text-7-extra, #1c1c1c) !important;
}

.day.replacement-day.eighteen {
    background: var(--turno-color-8-extra, #7c3aed) !important;
    color: var(--turno-text-8-extra, #ffffff) !important;
}

/* Turnos de doble color: el dia se divide en mitad superior / inferior. Los
   colores derivan de los componentes y siguen las variables configurables en
   Ajustes. El texto va en blanco con sombra para ser legible sobre ambos. */
.turno-split {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.6) !important;
}

.turno-split--24 {
    background: linear-gradient(
        to bottom,
        var(--turno-color-1, #0089c5) 0 50%,
        var(--turno-color-2, #10498b) 50% 100%
    ) !important;
}

.turno-split--dn {
    background: linear-gradient(
        to bottom,
        var(--turno-color-4, #0b8853) 0 50%,
        var(--turno-color-2, #10498b) 50% 100%
    ) !important;
}

.turno-split--18 {
    background: linear-gradient(
        to bottom,
        var(--color-extension, #f59e0b) 0 33.333%,
        var(--turno-color-2, #10498b) 33.333% 100%
    ) !important;
}

.day.replacement-day.turno-split--24 {
    background: linear-gradient(
        to bottom,
        var(--turno-color-1-extra, #0089c5) 0 50%,
        var(--turno-color-2-extra, #10498b) 50% 100%
    ) !important;
}

.day.replacement-day.turno-split--dn {
    background: linear-gradient(
        to bottom,
        var(--turno-color-4-extra, #0b8853) 0 50%,
        var(--turno-color-2-extra, #10498b) 50% 100%
    ) !important;
}

.day.replacement-day.turno-split--18 {
    background: linear-gradient(
        to bottom,
        var(--color-extension, #f59e0b) 0 33.333%,
        var(--turno-color-2-extra, #10498b) 33.333% 100%
    ) !important;
}

/* 1/2 ADM: admin + turno base (larga o diurno). Manana = admin arriba; tarde =
   admin abajo. 50/50. */
.turno-split--adm-m-larga {
    background: linear-gradient(
        to bottom,
        var(--color-admin, #f97316) 0 50%,
        var(--turno-color-1, #0089c5) 50% 100%
    ) !important;
}

.turno-split--adm-m-diurno {
    background: linear-gradient(
        to bottom,
        var(--color-admin, #f97316) 0 50%,
        var(--turno-color-4, #0b8853) 50% 100%
    ) !important;
}

.turno-split--adm-t-larga {
    background: linear-gradient(
        to bottom,
        var(--turno-color-1, #0089c5) 0 50%,
        var(--color-admin, #f97316) 50% 100%
    ) !important;
}

.turno-split--adm-t-diurno {
    background: linear-gradient(
        to bottom,
        var(--turno-color-4, #0b8853) 0 50%,
        var(--color-admin, #f97316) 50% 100%
    ) !important;
}

.weekend:not(.green):not(.blue):not(.purple):not(.lightgreen):not(.yellow):not(.half-morning):not(.half-afternoon):not(.eighteen):not(.admin-day):not(.half-admin-day):not(.training-day):not(.license-day):not(.union-leave-day):not(.professional-license-day):not(.unpaid-leave-day):not(.unjustified-absence-day):not(.hours-return-day):not(.legal-day):not(.comp-day),
.holiday:not(.green):not(.blue):not(.purple):not(.lightgreen):not(.yellow):not(.half-morning):not(.half-afternoon):not(.eighteen):not(.admin-day):not(.half-admin-day):not(.training-day):not(.license-day):not(.union-leave-day):not(.professional-license-day):not(.unpaid-leave-day):not(.unjustified-absence-day):not(.hours-return-day):not(.legal-day):not(.comp-day) {
    background: rgba(255, 255, 255, 0.06);
}

body.theme-light .weekend:not(.green):not(.blue):not(.purple):not(.lightgreen):not(.yellow):not(.half-morning):not(.half-afternoon):not(.eighteen):not(.admin-day):not(.half-admin-day):not(.training-day):not(.license-day):not(.union-leave-day):not(.professional-license-day):not(.unpaid-leave-day):not(.unjustified-absence-day):not(.hours-return-day):not(.legal-day):not(.comp-day),
body.theme-light .holiday:not(.green):not(.blue):not(.purple):not(.lightgreen):not(.yellow):not(.half-morning):not(.half-afternoon):not(.eighteen):not(.admin-day):not(.half-admin-day):not(.training-day):not(.license-day):not(.union-leave-day):not(.professional-license-day):not(.unpaid-leave-day):not(.unjustified-absence-day):not(.hours-return-day):not(.legal-day):not(.comp-day) {
    background: rgba(17, 32, 56, 0.05);
}

.day.weekend::after,
.day.holiday::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1.5px solid var(--inhabil-ring);
    border-radius: inherit;
    pointer-events: none;
}

.day.today::before {
    content: "";
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22r%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%221%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22%23ff8b8b%22%2F%3E%3Cstop%20offset%3D%22.38%22%20stop-color%3D%22%23ef2020%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23a90000%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22b%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%221%22%20y2%3D%220%22%3E%3Cstop%20stop-color%3D%22%23ff6b6b%22%2F%3E%3Cstop%20offset%3D%22.45%22%20stop-color%3D%22%23d90b0b%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23920000%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22m%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%221%22%20y2%3D%220%22%3E%3Cstop%20stop-color%3D%22%2366717c%22%2F%3E%3Cstop%20offset%3D%22.45%22%20stop-color%3D%22%23e6edf2%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%234b5660%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cpath%20fill%3D%22url(%23m)%22%20d%3D%22m14.7%2020.2%201.2%2011.3%202.1-11.3z%22%2F%3E%3Cpath%20fill%3D%22url(%23b)%22%20d%3D%22M12.3%208.1h7.4l1.4%2010.7H10.9z%22%2F%3E%3Cellipse%20cx%3D%2216%22%20cy%3D%2219%22%20rx%3D%229.6%22%20ry%3D%224%22%20fill%3D%22url(%23r)%22%2F%3E%3Cellipse%20cx%3D%2216%22%20cy%3D%2218.1%22%20rx%3D%228.7%22%20ry%3D%223%22%20fill%3D%22%23ed1717%22%20opacity%3D%22.7%22%2F%3E%3Cellipse%20cx%3D%2216%22%20cy%3D%227.5%22%20rx%3D%228.4%22%20ry%3D%223.5%22%20fill%3D%22url(%23r)%22%2F%3E%3Cellipse%20cx%3D%2214.5%22%20cy%3D%226.7%22%20rx%3D%224.6%22%20ry%3D%221.2%22%20fill%3D%22%23ffd2d2%22%20opacity%3D%22.55%22%2F%3E%3Cpath%20d%3D%22M13.7%209.2h2l-1.4%208.2h-1.8z%22%20fill%3D%22%23ffb6b6%22%20opacity%3D%22.42%22%2F%3E%3C%2Fsvg%3E");
    filter: drop-shadow(0 2px 2px rgba(127, 29, 29, 0.34));
    transform: rotate(10deg);
    pointer-events: none;
}

.day.today .day-number {
    font-size: 1.22rem;
    font-weight: 800;
}

.inactive-selected {
    box-shadow: inset 0 0 0 2px var(--inhabil-ring);
}

.admin-day {
    background: var(--color-admin, #f97316) !important;
    color: var(--color-admin-text, #ffffff) !important;
}

.half-admin-day {
    background: linear-gradient(135deg, #f4b223, #ffd15c) !important;
    color: #1c1c1c !important;
}

.legal-day {
    background: var(--color-legal, #0ea5a6) !important;
    color: var(--color-legal-text, #ffffff) !important;
}

.legal-soft {
    background: linear-gradient(135deg, rgba(14, 165, 166, 0.65), rgba(27, 199, 191, 0.75)) !important;
}

.comp-day {
    background: var(--color-comp, #8b2bd9) !important;
    color: var(--color-comp-text, #ffffff) !important;
}

.comp-soft {
    background: linear-gradient(135deg, rgba(139, 43, 217, 0.7), rgba(186, 82, 236, 0.82)) !important;
}

.training-day {
    background: var(--color-training, #0891b2) !important;
    color: var(--color-training-text, #ffffff) !important;
}

.license-day {
    background: var(--color-license, #d97706) !important;
    color: var(--color-license-text, #ffffff) !important;
}

.union-leave-day {
    background: linear-gradient(135deg, #dc2626, #fb7185) !important;
}

.professional-license-day {
    background: var(--color-professional_license, #2563eb) !important;
    color: var(--color-professional_license-text, #ffffff) !important;
}

.unpaid-leave-day {
    background: var(--color-unpaid_leave, #6b7280) !important;
    color: var(--color-unpaid_leave-text, #ffffff) !important;
}

.unjustified-absence-day {
    background: var(--color-unjustified_absence, #b91c1c) !important;
    color: var(--color-unjustified_absence-text, #ffffff) !important;
}

.hours-return-day {
    background: var(--color-hours_return, #14b8a6) !important;
}

/* Permiso/ausencia sobre un dia LIBRE por rotativa (sin turno base): el trabajador
   no tenia turno ese dia, asi que la casilla se pinta al 50% de transparencia. Con
   turno base se mantiene solida. Uniforme para todos los tipos de permiso, en el
   calendario (.day), en el timeline (.mini) y en los calendarios chicos de los
   modales (.profile-mini-day). */
.day.leave-free-day,
.mini.leave-free-day,
.profile-mini-day.leave-free-day {
    opacity: 0.5;
}

.hours-return-day--partial {
    background: linear-gradient(135deg, #0f766e, #2dd4bf) !important;
}

.day.hours-return-day {
    box-shadow:
        inset 0 0 0 2px rgba(20, 184, 166, 0.72),
        0 10px 22px rgba(20, 184, 166, 0.14);
}

.legend-list {
    display: grid;
    gap: 10px;
}

.legend-action,
.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    color: var(--text);
}

.legend-action {
    background: transparent;
    border: 1px solid transparent;
    text-align: left;
}

.legend-action span:last-child {
    font-weight: 800;
}

body[data-active-view="turnos"] .leave-panel .legend-action span:last-child,
body[data-active-view="turnos"] .add-turn-panel .legend-action span:last-child {
    font-weight: 500;
}

.legend-action:hover {
    background: var(--panel-hover);
    border-color: var(--border);
}

.legend-action:disabled {
    color: var(--text-muted);
    background: var(--calendar-disabled);
    border-color: var(--border);
    cursor: not-allowed;
    filter: grayscale(1);
    opacity: 0.68;
}

.legend-action:disabled:hover {
    transform: none;
    background: var(--calendar-disabled);
    border-color: var(--border);
}

.legend-action:disabled .legend-dot {
    color: var(--text-muted);
}

.legend-item--static {
    opacity: 0.92;
}

.helper-note {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--text-soft);
    background: var(--panel-alt);
    border: 1px dashed var(--border-strong);
}

.mode-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(var(--brand-blue-rgb), 0.2), rgba(13, 91, 240, 0.1));
    border: 1px solid rgba(var(--brand-blue-rgb), 0.28);
}

.mode-banner span {
    flex: 1 1 260px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.mode-banner button {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 12px;
    color: #fff;
    background: rgba(var(--brand-blue-rgb), 0.8);
}

.availability-list {
    display: grid;
    gap: 8px;
}

.availability-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    font-size: 0.86rem;
}

.availability-item--wide {
    grid-column: 1 / -1;
}

.availability-item span {
    color: var(--text-soft);
    font-weight: 600;
}

.availability-item input,
.availability-item select {
    width: 110px;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 10px;
}

.availability-item input {
    text-align: right;
}

.availability-note {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.availability-empty {
    color: var(--text-muted);
    padding: 12px 0 6px;
}

.availability-history {
    display: grid;
    gap: 10px;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.availability-history__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.availability-history__head > strong {
    color: var(--text);
    font-size: 0.84rem;
}

.availability-history__head label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.availability-history__head select {
    width: 86px;
    min-width: 0;
    padding: 7px 9px;
    border-radius: 10px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    color: var(--text);
}

.availability-history__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 2px;
}

.availability-history__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--field);
}

.availability-history__item > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.availability-history__item strong {
    color: var(--text);
    font-size: 0.79rem;
}

.availability-history__item span {
    color: var(--text-muted);
    font-size: 0.73rem;
}

.availability-history__amount {
    flex: 0 0 auto;
    padding: 4px 7px;
    border-radius: 999px;
    background: var(--panel-alt);
    color: var(--text-soft) !important;
    font-weight: 700;
    white-space: nowrap;
}

.availability-history__empty {
    grid-column: 1 / -1;
    padding: 10px;
    border: 1px dashed var(--border);
    border-radius: 11px;
    color: var(--text-muted);
    font-size: 0.76rem;
    text-align: center;
}

@media (max-width: 520px) {
    .availability-history__list {
        grid-template-columns: 1fr;
    }

    .availability-history__head,
    .availability-history__item {
        align-items: flex-start;
    }

    .availability-history__head {
        flex-wrap: wrap;
    }
}

.summary {
    display: grid;
    gap: 14px;
}

.summary-context {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
    text-transform: capitalize;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.summary-card {
    padding: 14px;
    border-radius: 16px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    display: grid;
    gap: 8px;
}

.summary-label {
    color: var(--text-soft);
    font-weight: 600;
}

.summary-value {
    font-size: 1.45rem;
    letter-spacing: -0.04em;
}

.hhee-alert-warning {
    color: #f97316 !important;
    font-weight: 900 !important;
}

.hhee-alert-danger {
    color: #ef4444 !important;
    font-weight: 900 !important;
}

.summary-amount {
    color: var(--accent);
    font-weight: 800;
}

.summary-footnote {
    display: grid;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.replacement-log {
    display: grid;
    gap: 10px;
    margin-top: 4px;
}

.replacement-log > strong {
    color: var(--text-strong);
}

.replacement-log--empty {
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--calendar-empty);
    color: var(--text-muted);
    font-weight: 700;
}

.replacement-log__item {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field);
}

.replacement-log__item span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-strong);
    font-weight: 800;
}

.replacement-log__item small {
    color: var(--text-muted);
    line-height: 1.35;
}

.hours-panel,
.hours-charts-panel,
.hhee-records-panel {
    min-width: 0;
}

.hours-charts-panel {
    display: grid;
    gap: 16px;
}

.hhee-monthbar,
.clockmarks-monthbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: -2px 0 16px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-alt);
}

.hhee-monthbar strong,
.clockmarks-monthbar strong {
    min-width: 190px;
    text-align: center;
    color: var(--text-strong);
    letter-spacing: 0.02em;
}

.hhee-return-transfer {
    margin: 12px 0 4px;
    padding: 12px 14px;
    border: 1px solid rgba(20, 184, 166, 0.22);
    border-radius: 16px;
    background: rgba(20, 184, 166, 0.1);
}

.hhee-return-transfer > span:first-child {
    display: grid;
    gap: 3px;
}

.hhee-return-transfer strong {
    color: var(--text);
    font-size: 0.96rem;
}

.hhee-return-transfer small {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
}

.hhee-chart-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.hhee-chart-controls label {
    display: grid;
    gap: 7px;
}

.hhee-chart-controls span {
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 800;
}

.hhee-chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.hhee-chart-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.hhee-chart-card--profile {
    align-content: stretch;
    height: 100%;
}

.hhee-chart-card--profile > div:last-child {
    min-width: 0;
}

.hhee-chart-card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.hhee-chart-card__head h4 {
    margin: 0;
    font-size: 1rem;
}

.hhee-chart-card__head span,
.hhee-chart-context {
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.hhee-chart-context {
    text-transform: capitalize;
}

.hhee-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 800;
}

.hhee-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hhee-chart-legend i {
    width: 12px;
    height: 12px;
    border-radius: 999px;
}

.hhee-color-day,
.hhee-bar-day {
    background: linear-gradient(135deg, #facc15, #fb923c);
}

.hhee-color-night,
.hhee-bar-night {
    background: linear-gradient(135deg, #1d4ed8, #60a5fa);
}

.hhee-worker-bars {
    display: grid;
    gap: 11px;
}

.hhee-worker-row {
    display: grid;
    grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 64px;
    align-items: center;
    gap: 12px;
}

.hhee-worker-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hhee-worker-row small {
    color: var(--text-soft);
    font-weight: 900;
    text-align: right;
}

.hhee-stacked-bar {
    position: relative;
    overflow: hidden;
    display: flex;
    height: 28px;
    border-radius: 999px;
    background: var(--timeline-empty);
    border: 1px solid var(--border);
}

.hhee-stacked-bar span {
    min-width: 0;
}

.hhee-history-bars {
    display: flex;
    align-items: end;
    gap: 8px;
    min-height: 240px;
    overflow-x: auto;
    padding: 16px 4px 4px;
    border-radius: 16px;
    background: var(--calendar-empty);
    border: 1px solid var(--border);
}

.hhee-profile-history-bars {
    min-height: 280px;
}

.hhee-history-item {
    flex: 0 0 34px;
    display: grid;
    grid-template-rows: minmax(160px, 1fr) auto;
    align-items: end;
    gap: 8px;
    min-height: 220px;
}

.hhee-history-stack {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: end;
    width: 100%;
    min-height: 2px;
    border-radius: 10px 10px 4px 4px;
    background: var(--timeline-empty);
    border: 1px solid var(--border);
}

.hhee-history-stack span {
    width: 100%;
    min-height: 0;
}

.hhee-history-item small {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    justify-self: center;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: capitalize;
}

.hhee-profile-history-bars .hhee-history-item {
    flex: 1 1 0;
    min-width: 36px;
}

.hhee-records-panel {
    display: grid;
    gap: 14px;
}

.hhee-records-context {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
    text-transform: capitalize;
}

#teamTimeline {
    overflow: auto;
}

.timeline-shell {
    overflow: auto;
    --timeline-hhee-day-left: 160px;
    --timeline-hhee-night-left: 270px;
}

.timeline-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.timeline-table th,
.timeline-table td {
    border: 1px solid var(--border);
    text-align: center;
    white-space: nowrap;
}

.timeline-table th {
    background: var(--panel-alt);
    font-size: 0.82rem;
    padding: 10px 6px;
    color: var(--text-soft);
}

.timeline-name-head,
.namecol {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 1%;
    min-width: max-content;
    padding: 10px 14px !important;
    text-align: left !important;
    background: var(--panel);
    font-weight: 700;
}

.timeline-name-head {
    background: var(--panel-alt);
    z-index: 4;
    overflow: visible;
}

.timeline-filter {
    position: relative;
    min-width: 174px;
}

.timeline-filter__trigger {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--field);
    color: var(--text);
    text-align: left;
}

.timeline-filter__trigger span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: calc(0.78rem - 1px);
    font-weight: 800;
}

.timeline-filter__trigger svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.timeline-filter__select {
    width: 100%;
    min-height: 34px;
    padding: 7px 28px 7px 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--field);
    color: var(--text);
    font: inherit;
    font-size: calc(0.78rem - 1px);
    font-weight: 800;
}

.timeline-filter__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 12;
    display: none;
    width: min(280px, 78vw);
    max-height: 280px;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.timeline-filter.is-open .timeline-filter__menu {
    display: grid;
    gap: 4px;
}

.timeline-filter__option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 8px;
    border-radius: 10px;
    color: var(--text);
    font-size: calc(0.8rem - 1px);
    font-weight: 700;
}

.timeline-filter__option:hover {
    background: var(--panel-hover);
}

.timeline-filter__option input {
    width: 16px;
    height: 16px;
}

.timeline-filter__option span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-filter__option small {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.timeline-filter__option.is-locked {
    color: var(--text-soft);
}

.timeline-profile-link {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 800;
    padding: 0;
    text-align: left;
    cursor: pointer;
}

.timeline-profile-link:hover,
.timeline-profile-link:focus-visible {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.timeline-profile-link.is-current-calendar-profile {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.timeline-profile-link:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 3px;
    border-radius: 6px;
}

.timeline-hhee-head,
.timeline-hhee {
    position: sticky;
    z-index: 2;
    width: 1%;
    min-width: max-content;
    padding-inline: 10px;
    background: var(--panel);
    font-weight: 800;
}

.timeline-hhee-head {
    background: var(--panel-alt);
    z-index: 4;
}

.timeline-hhee--day {
    left: var(--timeline-hhee-day-left);
}

.timeline-hhee--night {
    left: var(--timeline-hhee-night-left);
}

/* Encabezado del timeline fijo al hacer scroll vertical. Los <th> del thead
   quedan sticky arriba; las esquinas (nombre + HHEE) ya son sticky a la
   izquierda, asi que con top:0 quedan congeladas en ambos ejes. Se les da mayor
   z-index para que tapen las celdas de dias al scrollear. */
.timeline-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--timeline-head-bg, var(--panel-alt));
}

.timeline-table thead th.timeline-hhee-head {
    z-index: 6;
}

.timeline-table thead th.timeline-name-head {
    z-index: 7;
}

/* En pantallas medianas/grandes el timeline se despliega COMPLETO y scrollea con
   la pagina (una sola barra de scroll, sin scroll interno propio). Se quita el
   overflow de los contenedores para que el thead pueda quedar sticky respecto a
   la pagina: al bajar, los dias del mes siguen visibles arriba aunque las
   primeras filas ya se hayan perdido. En movil (<=760px) se mantiene el scroll
   horizontal del shell, sin tocar nada. */
@media (min-width: 761px) {
    #teamTimeline,
    .timeline-shell {
        overflow: visible;
        max-height: none;
    }
}

.timeline-hhee-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.timeline-hhee-icon {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.mini {
    position: relative;
    width: 1%;
    min-width: 24px;
    height: 28px;
    background: var(--timeline-empty);
}

.mini.worker-blocked-mini:not(.needs-replacement):not(.needs-extra-reason):not(.contract-error-day):not(.replacement-day):not(.clock-incident-day):not(.clock-severe-day):not(.hours-return-mini):not(.honoraria-limit-day) {
    box-shadow: inset 0 0 0 2px rgba(100, 116, 139, 0.5);
}

.mini.needs-replacement {
    box-shadow: inset 0 0 0 2px rgba(239, 68, 68, 0.7);
    cursor: pointer;
}

.mini.needs-extra-reason {
    box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.84);
    cursor: pointer;
}

.mini.contract-error-day {
    box-shadow: inset 0 0 0 2px rgba(220, 38, 38, 0.9);
    cursor: pointer;
}

.mini.replacement-day {
    box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.72);
}

.mini.timeline-inhabil:not(.needs-replacement):not(.needs-extra-reason):not(.contract-error-day):not(.replacement-day):not(.clock-incident-day):not(.clock-severe-day):not(.hours-return-mini) {
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.14);
}

.timeline-replacement-marker {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.74rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.32);
}

.mini.replacement-day .timeline-replacement-marker {
    background: #16a34a;
}

.mini.honoraria-limit-day:not(.needs-replacement):not(.contract-error-day):not(.clock-severe-day) {
    box-shadow: inset 0 0 0 2px rgba(220, 38, 38, 0.9);
    cursor: pointer;
}

.mini.hours-return-mini {
    box-shadow: inset 0 0 0 2px rgba(20, 184, 166, 0.76);
}

.mini.hours-return-mini .timeline-replacement-marker {
    background: #0f766e;
    color: #fff;
    font-size: 0.62rem;
}

.mini.needs-extra-reason .timeline-replacement-marker {
    background: #f59e0b;
    color: #111827;
}

.mini.clock-incident-day .timeline-replacement-marker {
    background: #0ea5e9;
    color: #fff;
}

.timeline-replacement-marker .timeline-clock-marker {
    width: 12px;
    height: 12px;
}

.mini.preassign-day .timeline-replacement-marker {
    background: linear-gradient(135deg, #fbbf24, #f97316);
    color: #fff;
}

.timeline-replacement-marker .timeline-preassign-marker {
    width: 13px;
    height: 6px;
}

.mini.request-wait-day .timeline-replacement-marker {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.timeline-replacement-marker .timeline-request-marker {
    width: 14px;
    height: 14px;
}

.mini.clock-severe-day .timeline-replacement-marker {
    min-width: 20px;
    background: #dc2626;
    color: #fff;
    font-size: 0.52rem;
}

.mini.contract-error-day .timeline-replacement-marker {
    background: #dc2626;
    color: #fff;
}

.secondary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 18px;
}

.turn-changes-view {
    min-width: 0;
}

.staff-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.staff-grid.is-collapsed {
    display: none;
}

.staff-grid > div {
    padding: 14px;
    border-radius: 16px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.staff-grid label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-soft);
    font-weight: 600;
}

.mini.honoraria-limit-day:not(.needs-replacement):not(.contract-error-day):not(.clock-severe-day) .timeline-replacement-marker {
    background: #dc2626;
    color: #fff;
}

.timeline-hhee.honoraria-hhee-excess {
    color: #ef4444;
    font-weight: 900;
}

.staffing-weekly-calendar {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 18px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.staffing-weekly-calendar--view {
    margin-bottom: 0;
}

.staffing-weekly-sticky {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    gap: 8px;
    margin: -16px -16px 0;
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
    background: var(--panel-alt);
    box-shadow: 0 12px 24px rgba(17, 32, 56, 0.08);
}

.staffing-weekly-filters {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px 20px;
}

/* ==========================================================================
   Barra del calendario semanal.

   Dos columnas: los filtros ocupan lo que necesiten a la izquierda y la
   navegacion se apila a la derecha, en las mismas lineas. Uno sobre otro
   gastaban una banda entera de alto para media pantalla vacia.
   ========================================================================== */

.staffing-weekly-filter-grid {
    flex: 1 1 460px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px 12px;
    min-width: 0;
}

.staffing-weekly-filter-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-soft);
    white-space: nowrap;
}

.staffing-weekly-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

/* Chips en vez de desplegables: se ven sin abrir nada y se combinan -Larga y
   Noche juntos, que es la pregunta del 4to turno-, cosa que un desplegable de
   opcion unica no permitia. */
.staffing-weekly-chip {
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 6px 13px 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text-soft);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: border-color 0.16s, background 0.16s, color 0.16s;
}

.staffing-weekly-chip i {
    width: 8px;
    height: 8px;
    border-radius: 3px;
    background: var(--staffing-chip-tone, var(--text-soft));
}

/* Los de estamento y profesion van sin punto: no son un turno, y conviene
   que los grupos de chips se distingan de un vistazo. */
.staffing-weekly-chip--plain { padding-left: 13px; }
.staffing-weekly-chip--plain[aria-pressed="true"] { --staffing-chip-tone: var(--accent); }

.staffing-weekly-chip--diurno { --staffing-chip-tone: #0b8853; }
.staffing-weekly-chip--larga { --staffing-chip-tone: #22c55e; }
.staffing-weekly-chip--noche { --staffing-chip-tone: #1d6cff; }
.staffing-weekly-chip--leave { --staffing-chip-tone: var(--text-soft); }

.staffing-weekly-chip:hover {
    border-color: var(--staffing-chip-tone, var(--accent));
}

.staffing-weekly-chip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.staffing-weekly-chip[aria-pressed="true"] {
    color: var(--text);
    border-color: var(--staffing-chip-tone);
    background: color-mix(in srgb, var(--staffing-chip-tone) 14%, transparent);
}

.staffing-weekly-chip__count {
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--text-soft);
    font-variant-numeric: tabular-nums;
}

.staffing-weekly-side {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

/* La semana orienta: las flechas van pegadas a la fecha en vez de sueltas
   entre los demas botones. */
.staffing-weekly-weeknav {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel);
}

.staffing-weekly-weeknav__arrow {
    font: inherit;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-soft);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.16s, color 0.16s;
}

.staffing-weekly-weeknav__arrow:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.staffing-weekly-weeknav__arrow:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.staffing-weekly-weeknav__label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0 8px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.staffing-weekly-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.staffing-weekly-button {
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 11px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: border-color 0.16s, background 0.16s, color 0.16s;
}

.staffing-weekly-button:hover { border-color: var(--accent); }
.staffing-weekly-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.staffing-weekly-button[aria-pressed="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* El mismo signo con que se marca un hueco en la rejilla: el boton dice asi
   que es lo que deja en pantalla. Se invierte al quedar encendido, porque un
   circulo rojo sobre el azul del boton se ensucia. */
.staffing-weekly-button__badge {
    flex: none;
    width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.66rem;
    font-weight: 900;
    line-height: 1;
}

.staffing-weekly-button[aria-pressed="true"] .staffing-weekly-button__badge {
    background: #fff;
    color: var(--accent);
}

/* Celda fuera de foco con "Solo con problemas": se encoge, no se esconde.
   Con display:none la rejilla correria las columnas. */
.staffing-weekly-cell--quiet {
    --staffing-weekly-cell-bg: transparent;
    --staffing-weekly-cell-border: var(--border);
    display: grid;
    place-items: center;
    grid-template-rows: 1fr;
    border-style: dashed;
    color: var(--text-soft);
    font-size: 0.78rem;
    min-height: 56px;
}


.staffing-weekly-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(146px, 1fr));
    gap: 8px;
}

.staffing-weekly-mobile-days {
    display: none;
}

.staffing-weekly-mobile-days-placeholder {
    display: none;
    height: 0;
}

.staffing-weekly-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(146px, 1fr));
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.staffing-weekly-day,
.staffing-weekly-cell {
    min-width: 0;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.staffing-weekly-day {
    display: flex;
    align-items: center;
    padding: 10px;
    color: var(--text);
    background: var(--field);
    text-transform: capitalize;
}

.staffing-weekly-day strong {
    white-space: nowrap;
}

.staffing-weekly-cell {
    --staffing-weekly-cell-bg: var(--field);
    --staffing-weekly-cell-border: var(--border);
    display: grid;
    /* Encabezado, mezcla por estamento y la gente. La del medio se cierra
       sola cuando la celda esta vacia. */
    grid-template-rows: auto auto minmax(82px, 1fr);
    align-content: start;
    padding: 10px;
    background: var(--staffing-weekly-cell-bg);
    border-color: var(--staffing-weekly-cell-border);
    position: relative;
}

.staffing-weekly-day--inhabil {
    background: var(--inhabil-soft);
    border-color: rgba(248, 113, 113, 0.24);
}

.staffing-weekly-cell--diurno {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(11, 136, 83, 0.14), rgba(34, 197, 94, 0.06));
    --staffing-weekly-cell-border: rgba(11, 136, 83, 0.3);
}

.staffing-weekly-cell--larga {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(34, 197, 94, 0.06));
    --staffing-weekly-cell-border: rgba(34, 197, 94, 0.3);
}

.staffing-weekly-cell--noche {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(29, 108, 255, 0.14), rgba(48, 132, 255, 0.06));
    --staffing-weekly-cell-border: rgba(29, 108, 255, 0.32);
}

.staffing-weekly-cell--leave {
    grid-template-rows: auto minmax(54px, 1fr);
}

.staffing-weekly-cell--leave-license {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(217, 119, 6, 0.18), rgba(245, 158, 11, 0.08));
    --staffing-weekly-cell-border: rgba(217, 119, 6, 0.34);
}

.staffing-weekly-cell--leave-professional-license {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(79, 140, 255, 0.06));
    --staffing-weekly-cell-border: rgba(37, 99, 235, 0.3);
}

.staffing-weekly-cell--leave-union-leave {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(220, 38, 38, 0.14), rgba(251, 113, 133, 0.06));
    --staffing-weekly-cell-border: rgba(220, 38, 38, 0.28);
}

.staffing-weekly-cell--leave-admin {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(249, 115, 22, 0.14), rgba(251, 146, 60, 0.06));
    --staffing-weekly-cell-border: rgba(249, 115, 22, 0.3);
}

.staffing-weekly-cell--leave-legal,
.staffing-weekly-cell--leave-hour-return {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(14, 165, 166, 0.14), rgba(27, 199, 191, 0.06));
    --staffing-weekly-cell-border: rgba(14, 165, 166, 0.3);
}

.staffing-weekly-cell--leave-comp {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(139, 43, 217, 0.14), rgba(186, 82, 236, 0.06));
    --staffing-weekly-cell-border: rgba(139, 43, 217, 0.3);
}

.staffing-weekly-cell--leave-half-morning {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(234, 179, 8, 0.16), rgba(250, 204, 21, 0.07));
    --staffing-weekly-cell-border: rgba(234, 179, 8, 0.34);
}

.staffing-weekly-cell--leave-half-afternoon {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 146, 60, 0.07));
    --staffing-weekly-cell-border: rgba(245, 158, 11, 0.32);
}

.staffing-weekly-cell--leave-unpaid-leave {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(107, 114, 128, 0.14), rgba(156, 163, 175, 0.06));
    --staffing-weekly-cell-border: rgba(107, 114, 128, 0.3);
}

.staffing-weekly-cell--leave-unjustified-absence {
    --staffing-weekly-cell-bg: linear-gradient(135deg, rgba(15, 23, 42, 0.1), rgba(239, 68, 68, 0.11));
    --staffing-weekly-cell-border: rgba(239, 68, 68, 0.32);
}

.staffing-weekly-cell__shift {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.staffing-weekly-cell__shift-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}

/* Dotacion de la celda. Antes habia que contar tarjetas para saber si el
   turno del jueves tenia cuatro personas o siete. */
.staffing-weekly-cell__count {
    margin-left: auto;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-variant-numeric: tabular-nums;
}

.staffing-weekly-cell__count b {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}

/* Estado de cobertura. El signo de admiracion solo decia "pasa algo": no
   cuantos faltan, ni si alguien ya lo resolvio. */
.staffing-weekly-cell__count i {
    font-style: normal;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    padding: 2px 6px;
    border-radius: 999px;
    white-space: nowrap;
}

.staffing-weekly-cell__count i.is-ok {
    background: rgba(11, 136, 83, 0.14);
    color: #0b8853;
}

.staffing-weekly-cell__count i.is-cover {
    background: rgba(180, 83, 9, 0.16);
    color: #b45309;
}

.staffing-weekly-cell__count i.is-gap {
    background: rgba(220, 38, 38, 0.14);
    color: #dc2626;
}

/* Mezcla por estamento: no da lo mismo que los siete sean todos tecnicos. */
.staffing-weekly-cell__mix {
    margin: -4px 0 8px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-soft);
    font-variant-numeric: tabular-nums;
    text-transform: none;
    letter-spacing: 0;
}

/* Franja de estado en el borde de arriba: el color del turno ya ocupa el
   fondo de la celda y no conviene pelearselo. */
.staffing-weekly-cell--gap::before,
.staffing-weekly-cell--rota::before,
.staffing-weekly-cell--covered::before {
    content: "";
    position: absolute;
    inset: -1px -1px auto -1px;
    height: 3px;
    border-radius: 12px 12px 0 0;
}

.staffing-weekly-cell--gap::before { background: #dc2626; }
.staffing-weekly-cell--covered::before { background: #b45309; }

/* Cupo por rotativa incompleta: al grupo le falta un trabajador frente al
   mejor dotado, asi que le falta CADA VEZ que entra.

   Va en ambar y no en rojo a proposito. Una licencia de hoy es aguda y se
   acaba; una rotativa corta es cronica y vuelve cada ciclo. Si las dos
   gritaran igual, la semana se veria peor de lo que esta y el rojo dejaria de
   significar "esto hay que resolverlo ahora". */
.staffing-weekly-rota-gap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 8px;
    border-radius: 10px;
    border: 1px dashed rgba(180, 83, 9, 0.5);
    background: rgba(180, 83, 9, 0.1);
    text-align: left;
    font: inherit;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.16s, transform 0.16s;
}

.staffing-weekly-rota-gap:hover {
    border-color: #b45309;
    transform: translateY(-1px);
}

.staffing-weekly-rota-gap:focus-visible {
    outline: 2px solid #b45309;
    outline-offset: 2px;
}

.staffing-weekly-rota-gap__badge {
    flex: none;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #b45309;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
}

.staffing-weekly-rota-gap__body {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.staffing-weekly-rota-gap__body strong {
    font-size: 0.78rem;
    font-weight: 700;
    color: #b45309;
}

.staffing-weekly-rota-gap__body small {
    font-size: 0.68rem;
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staffing-weekly-cell--rota::before { background: #b45309; }

/* Letra del grupo del 4to turno. Conecta esta pantalla con Titulares de
   Turnos sin tener que cambiar de menu. */
.staffing-weekly-group {
    flex: none;
    align-self: center;
    width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    font-family: var(--font-display);
    font-size: 0.63rem;
    font-weight: 700;
    background: var(--accent-soft);
    color: var(--accent);
}

/* Quien esta en el turno cubriendo a otro. */
.staffing-weekly-covers {
    flex: none;
    align-self: center;
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(180, 83, 9, 0.16);
    color: #b45309;
}

/* Hoy. Es de las primeras cosas que el ojo busca y no habia nada que lo
   dijera: habia que leer la fecha de cada encabezado para ubicarse. */
.staffing-weekly-day--today {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    gap: 8px;
}

.staffing-weekly-day__today {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
}

.staffing-weekly-cell--today {
    box-shadow: inset 0 0 0 1px var(--accent);
}

.staffing-weekly-people {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

/* Fila y no columna: a los lados del nombre van la letra del grupo y las
   marcas -cubre, o el aviso de que falta reemplazo-, que apiladas debajo se
   leerian como si fueran parte del cargo. */
.staffing-weekly-person {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 8px;
    border-radius: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
}

.staffing-weekly-person--needs-replacement {
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(248, 113, 113, 0.12);
}

.staffing-weekly-person__body {
    flex: 1;
    display: grid;
    gap: 1px;
    min-width: 0;
}

.staffing-weekly-replacement-alert {
    flex: none;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
}

.staffing-weekly-replacement-alert:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* El hueco por cubrir. Antes era un signo de admiracion solo: decia que
   pasaba algo, pero no a quien, ni por que, ni si la cobertura automatica ya
   estaba buscando. */
.staffing-weekly-replacement-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 8px;
    border: 1px dashed rgba(220, 38, 38, 0.55);
    border-radius: 10px;
    background: rgba(248, 113, 113, 0.1);
    text-align: left;
}

.staffing-weekly-replacement-slot__badge {
    flex: none;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 900;
    line-height: 1;
}

.staffing-weekly-slot__body {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.staffing-weekly-slot__body strong {
    font-size: 0.78rem;
    font-weight: 700;
    color: #dc2626;
}

.staffing-weekly-slot__body small {
    font-size: 0.68rem;
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* En que va la cobertura automatica: los puntos son las etapas hechas. */
.staffing-weekly-slot__stage {
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staffing-weekly-slot__dots {
    flex: none;
    display: inline-flex;
    gap: 2px;
}

.staffing-weekly-slot__dots i {
    width: 10px;
    height: 3px;
    border-radius: 2px;
    background: rgba(17, 24, 39, 0.2);
}

.staffing-weekly-slot__dots i.is-done { background: #dc2626; }

.staffing-weekly-replacement-slot:hover {
    border-color: #dc2626;
    background: rgba(248, 113, 113, 0.16);
    transform: translateY(-1px);
}

.staffing-weekly-replacement-slot:focus-visible {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

.staffing-weekly-person strong,
.staffing-weekly-person small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staffing-weekly-person strong {
    color: var(--text);
    font-size: 0.82rem;
}

.staffing-weekly-person small,
.staffing-weekly-empty {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.staffing-weekly-empty {
    padding: 8px;
    border-radius: 10px;
    background: var(--calendar-empty);
    border: 1px dashed var(--border);
}

.staffing-weekly-empty-state {
    grid-column: 1 / -1;
    padding: 18px;
    border-radius: 12px;
    background: var(--calendar-empty);
    border: 1px dashed var(--border);
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 700;
    text-align: center;
}

.task-assignment-panel {
    display: grid;
    min-width: 0;
    padding: 16px;
}

.task-assignment-shell {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.task-assignment-head {
    align-items: center;
    margin-bottom: 0;
}

/* ==========================================================================
   ASIGNACION DE TAREAS - CABECERA

   La semana es el dato que ordena el panel entero, asi que ocupa el centro y
   se lee completa. A los lados quedan la identidad del panel y las acciones
   que no cambian de una semana a otra (programacion y Excel).
========================================================================== */

.task-assignment-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-alt);
}

.task-assignment-identity {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.task-assignment-identity > div {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.task-assignment-identity strong {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.task-assignment-identity span {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
}

.task-assignment-identity__icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
}

.task-assignment-identity__icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.task-assignment-weeknav {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-left: auto;
}

.task-assignment-weeknav__step,
.task-assignment-weeknav__today,
.task-assignment-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    background: var(--field);
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.task-assignment-weeknav__step:hover,
.task-assignment-weeknav__today:hover,
.task-assignment-action:hover {
    color: var(--text);
    border-color: var(--accent);
}

.task-assignment-weeknav__step {
    width: 38px;
    padding: 0;
    flex: none;
}

.task-assignment-weeknav__step svg,
.task-assignment-action svg {
    width: 17px;
    height: 17px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.task-assignment-weeknav__label {
    display: grid;
    gap: 1px;
    min-width: 206px;
    padding: 4px 16px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--field);
    text-align: center;
}

.task-assignment-weeknav__label span {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.task-assignment-weeknav__label strong {
    font-family: var(--font-display);
    font-size: 0.94rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

/* "Hoy" se enciende cuando ya estas en la semana actual: no es un boton
   apagado, es el indicador de donde estas parado. */
.task-assignment-weeknav__today.is-on {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong, var(--accent));
}

.task-assignment-topbar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding-left: 14px;
    border-left: 1px solid var(--border);
}

.task-assignment-action--primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 12px 22px rgba(var(--brand-blue-rgb), 0.24);
}

.task-assignment-action--primary:hover {
    color: #fff;
    border-color: transparent;
}

/* La programacion automatica escribe en la semana entera, asi que se tinta
   para no confundirse con "Ver programacion", que solo mira. No lleva el
   degradado del boton primario: el Excel sigue siendo la accion principal de
   esta barra. */
.task-assignment-action--auto {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong, var(--accent));
}

.task-assignment-action--auto:hover {
    color: var(--accent-strong, var(--accent));
    background: var(--accent-soft);
    border-color: var(--accent);
}

/* Mientras el reparto corre el boton queda inerte: recorre los 7 dias y los
   dos turnos, y un segundo clic abriria el mismo dialogo dos veces. */
.task-assignment-action--auto:disabled {
    opacity: 0.55;
    cursor: progress;
}

.task-assignment-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.task-assignment-view-filters,
.task-assignment-dialog__filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

/* Los filtros dejaron de ser dos bloques con etiqueta encima: ahora son dos
   botones con menu, del mismo alto que el resto de la barra, y el nombre del
   filtro viaja dentro del propio boton ("Estamentos - Todos"). */
.task-assignment-view-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    grid-template-columns: none;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.task-assignment-gap-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    background: var(--field);
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.task-assignment-gap-filter svg {
    width: 16px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.task-assignment-gap-filter:hover {
    color: var(--text);
    border-color: var(--accent);
}

.task-assignment-gap-filter.is-on {
    border-color: transparent;
    background: var(--accent);
    color: #fff;
}

.task-assignment-dialog__filters strong,
.task-assignment-global-task-form strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text);
    font-size: 0.74rem;
    font-weight: 800;
}

.task-assignment-dialog__filters strong {
    margin-bottom: 8px;
    font-size: 0.84rem;
}

.task-assignment-dialog__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    grid-template-columns: none;
}

.task-assignment-dialog__filters .task-assignment-worker-search {
    flex: 1 1 220px;
    min-width: 0;
}

.task-assignment-dialog__filters .task-assignment-multiselect {
    flex: 0 1 auto;
}

/* Segmentado que reemplaza al antiguo checkbox "incluir libres del dia": la
   misma decision, pero legible sin leer una frase entera. */
.task-assignment-scope {
    display: flex;
    flex: none;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-alt);
}

.task-assignment-scope__option {
    min-height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.task-assignment-scope__option.is-on {
    background: var(--field);
    color: var(--text);
    box-shadow: var(--shadow-soft);
}

.task-assignment-worker-search-field {
    min-width: 0;
}

.task-assignment-worker-search {
    display: block;
    width: 100%;
}

/* 42 px es la altura comun de la fila de filtros del modal: buscador,
   segmentado y menu de profesion quedan alineados. */
.task-assignment-worker-search .profile-viewer__field {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--field);
}

.task-assignment-dialog__filters .task-assignment-multiselect > summary {
    min-height: 42px;
}

.task-assignment-worker-search .profile-viewer__field input {
    font-weight: 700;
}

.task-assignment-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.task-assignment-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--field);
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 800;
}

.task-assignment-filter-chip input {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    padding: 0;
    accent-color: var(--accent);
}

.task-assignment-filter-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-assignment-multiselect {
    position: relative;
    min-width: 0;
}

.task-assignment-multiselect summary {
    min-height: 38px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid var(--field-border);
    border-radius: 12px;
    background: var(--field);
    color: var(--text);
    cursor: pointer;
    list-style: none;
}

.task-assignment-multiselect summary::-webkit-details-marker {
    display: none;
}

.task-assignment-multiselect summary span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 800;
}

.task-assignment-multiselect summary svg {
    width: 16px;
    height: 16px;
    color: var(--text-soft);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.16s ease;
}

.task-assignment-multiselect[open] summary {
    border-color: rgba(var(--brand-blue-rgb), 0.42);
    box-shadow: 0 0 0 3px rgba(var(--brand-blue-rgb), 0.12);
}

.task-assignment-multiselect[open] summary svg {
    transform: rotate(180deg);
}

.task-assignment-multiselect__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 20;
    display: grid;
    gap: 4px;
    max-height: min(260px, 42vh);
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.task-assignment-multiselect__option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 9px;
    color: var(--text-soft);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 800;
}

.task-assignment-multiselect__option:hover {
    background: var(--panel-hover);
    color: var(--text);
}

.task-assignment-multiselect__option--all {
    margin-bottom: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-weight: 900;
}

.task-assignment-multiselect__option input {
    width: 15px;
    height: 15px;
    padding: 0;
    accent-color: var(--accent);
}

.task-assignment-multiselect__option span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-assignment-section,
.task-assignment-events {
    display: grid;
    gap: 6px;
    min-width: 0;
}

/* Cabecera de turno: plegable, con su recuento y -solo cuando lo hay- el
   contador de casillas sin cubrir, que ademas es el atajo al filtro. */
.task-assignment-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 0 4px;
}

.task-assignment-section-title {
    min-width: 0;
    font-family: var(--font-display);
    color: var(--text);
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.task-assignment-section-toggle {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: none;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: var(--field);
    color: var(--text-soft);
    cursor: pointer;
}

.task-assignment-section-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.task-assignment-section-toggle svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.18s ease;
}

.task-assignment-section.is-collapsed .task-assignment-section-toggle svg {
    transform: rotate(-90deg);
}

.task-assignment-section-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: none;
    border-radius: 8px;
}

.task-assignment-section-icon svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Diurno y noche toman el mismo color que ya tienen en el calendario y el
   timeline (js/turnoColors.js): verde para Diurno, azul de marca para Noche. */
.task-assignment-section--day .task-assignment-section-icon {
    background: rgba(11, 136, 83, 0.16);
    color: #0b8853;
}

.task-assignment-section--night .task-assignment-section-icon {
    background: rgba(var(--brand-blue-rgb), 0.2);
    color: var(--accent);
}

.task-assignment-section-icon--events {
    background: rgba(139, 43, 217, 0.16);
    color: #7c2bb8;
}

body.theme-dark .task-assignment-section--day .task-assignment-section-icon { color: #34d399; }
body.theme-dark .task-assignment-section--night .task-assignment-section-icon { color: #7dabe8; }
body.theme-dark .task-assignment-section-icon--events { color: #c084fc; }

.task-assignment-section-metric {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--panel-alt);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.task-assignment-section-gap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border: 1px solid rgba(240, 177, 0, 0.55);
    border-radius: 999px;
    background: rgba(240, 177, 0, 0.09);
    color: #b07d00;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.task-assignment-section-gap svg {
    width: 12px;
    height: 12px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.task-assignment-section-gap.is-on {
    border-color: transparent;
    background: #b07d00;
    color: #fff;
}

body.theme-dark .task-assignment-section-gap { color: #f0b100; }
body.theme-dark .task-assignment-section-gap.is-on { background: #a97800; color: #fff; }

/* Las 8 columnas tienen que entrar en pantalla sin scroll lateral.
   Antes el ancho minimo era 230 + 7x155 + huecos = 1371 px, mas de lo que deja
   un portatil de 1440 una vez descontados shell, panel y padding: siempre
   sobraba tablero por el costado.
   Ahora la columna de tareas escala con la ventana y los dias se reparten lo
   que queda. El minimo de 116 px es lo que ocupa la linea "mie 26/08 100%" del
   encabezado, que es la fila mas ancha de la columna; por debajo de ~1050 px de
   ventana vuelve el scroll, que ahi si es preferible a exprimir las columnas.
   Los dos tableros y la fila de Novedades comparten esta regla: si se separan,
   dejan de alinearse.

   La columna de tareas se angosto un 20% respecto de la primera version
   (132/13vw/250 -> 106/10.4vw/200): los titulos reales son cortos ("RM", "TC")
   y ese ancho le hacia falta a los dias, donde los nombres si aprietan. */
.task-assignment-board,
.task-assignment-events-grid {
    display: grid;
    grid-template-columns: clamp(106px, 10.4vw, 200px) repeat(7, minmax(116px, 1fr));
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-alt);
}

.task-assignment-task-head,
.task-assignment-day-head,
.task-assignment-task-cell,
.task-assignment-cell,
.task-assignment-events-head,
.task-assignment-event-day {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field);
}

.task-assignment-task-head,
.task-assignment-events-head {
    position: sticky;
    left: 0;
    z-index: 2;
    display: grid;
    align-content: center;
    padding: 12px;
    box-shadow: 8px 0 18px rgba(15, 23, 42, 0.08);
}

/* Los dos rotulos de la primera columna son etiquetas de grilla, no titulos:
   el titulo de la seccion ya esta arriba, en la cabecera. */
.task-assignment-events-head,
.task-assignment-task-head--label {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.task-assignment-task-form {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.task-assignment-global-task-form {
    min-width: 0;
    margin-left: auto;
}

.task-assignment-task-form__icon {
    position: absolute;
    top: 50%;
    left: 11px;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    pointer-events: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: var(--text-muted);
}

.task-assignment-task-form input {
    width: 258px;
    max-width: 100%;
    min-width: 0;
    min-height: 38px;
    padding-left: 34px;
    border-radius: 11px;
    font-size: 0.82rem;
}

.task-assignment-task-add {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 11px;
    background: var(--accent);
    color: #fff;
    font-size: 0.82rem;
    white-space: nowrap;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 20px rgba(var(--brand-blue-rgb), 0.2);
}

.task-assignment-task-add:hover {
    background: var(--accent-2);
    transform: translateY(-1px);
}

/* En que turnos va la tarea nueva. Segmentado y no un <select> porque las tres
   salidas tienen que estar a la vista al escribir el nombre: lo que se elige
   aqui decide en cual de los dos tableros nace la tarea. */
.task-assignment-scope-choice {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--panel-alt);
}

.task-assignment-scope-option {
    display: inline-flex;
    cursor: pointer;
}

/* El radio de verdad queda invisible pero enfocable: el pill es su etiqueta. */
.task-assignment-task-form .task-assignment-scope-option input {
    position: absolute;
    width: 1px;
    min-width: 0;
    height: 1px;
    min-height: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.task-assignment-scope-option span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 9px;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
}

.task-assignment-scope-option:hover span {
    color: var(--text);
}

.task-assignment-scope-option input:checked + span {
    background: var(--accent);
    color: #fff;
}

.task-assignment-scope-option input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* El turno de la tarea en la tarjeta: sol, luna, o los dos. Es tambien el boton
   para cambiarlo, porque devolver al otro tablero una tarea que se quito de ahi
   no puede obligar a crearla de nuevo -una tarea nueva pierde el historial. */
.task-assignment-task-shift {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    height: 24px;
    padding: 0 5px;
    border-radius: 6px;
    color: var(--text-muted);
}

.task-assignment-task-shift svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.task-assignment-task-shift--day {
    color: #0b8853;
}

.task-assignment-task-shift--night {
    color: var(--accent);
}

.task-assignment-task-shift:hover {
    background: var(--panel-alt);
}

body.theme-dark .task-assignment-task-shift--day {
    color: #34d399;
}

body.theme-dark .task-assignment-task-shift--night {
    color: #7dabe8;
}

.task-assignment-event-day {
    display: grid;
    gap: 3px;
    align-content: start;
    padding: 10px;
}

.task-assignment-event-date {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    text-align: center;
}

/* El encabezado del dia pasa de ser un rotulo a ser un resumen: dia, fecha,
   cuanto del turno esta cubierto y que permisos hay. Es lo que se mira antes
   de entrar a repartir casilla por casilla. */
.task-assignment-day-head {
    display: grid;
    gap: 5px;
    align-content: start;
    min-height: 62px;
    padding: 8px 9px 9px;
}

.task-assignment-day-head__top {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.task-assignment-day-percent {
    margin-left: auto;
    flex: none;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 800;
}

.task-assignment-day-percent--full { color: #0b8853; }
.task-assignment-day-percent--mid { color: var(--accent); }
.task-assignment-day-percent--low { color: #b07d00; }

body.theme-dark .task-assignment-day-percent--full { color: #34d399; }
body.theme-dark .task-assignment-day-percent--mid { color: #7dabe8; }
body.theme-dark .task-assignment-day-percent--low { color: #f0b100; }

.task-assignment-day-meter {
    height: 3px;
    border-radius: 999px;
    background: var(--border-strong);
    overflow: hidden;
}

.task-assignment-day-meter span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
    transition: width 0.2s ease;
}

.task-assignment-day-meter--full span { background: #0b8853; }
.task-assignment-day-meter--low span { background: #f0b100; }

.task-assignment-day-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 17px;
}

/* Los avisos se escriben con el encabezado por delante porque
   `.task-assignment-day-head span` -que viene mas abajo- gana por
   especificidad y les borraria el color. */
.task-assignment-day-head .task-assignment-day-flag {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-assignment-day-head .task-assignment-day-flag--absence {
    background: rgba(217, 119, 6, 0.16);
    color: #b45309;
}

.task-assignment-day-head .task-assignment-day-flag--birthday {
    background: rgba(139, 43, 217, 0.16);
    color: #7c2bb8;
}

.task-assignment-day-head .task-assignment-day-flag--rest {
    background: var(--panel-alt);
    color: var(--text-muted);
}

body.theme-dark .task-assignment-day-head .task-assignment-day-flag--absence { color: #fbbf24; }
body.theme-dark .task-assignment-day-head .task-assignment-day-flag--birthday { color: #c084fc; }

.task-assignment-day-head strong,
.task-assignment-event-date strong {
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 900;
    text-transform: capitalize;
}

.task-assignment-day-head strong,
.task-assignment-day-head span,
.task-assignment-event-date strong,
.task-assignment-event-date span {
    white-space: nowrap;
}

.task-assignment-day-head span,
.task-assignment-event-date span {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.task-assignment-day-head--inhabil,
.task-assignment-cell--inhabil,
.task-assignment-event-day--inhabil {
    background: var(--inhabil-soft);
    border-color: rgba(248, 113, 113, 0.24);
}

body.theme-light .task-assignment-day-head--inhabil,
body.theme-light .task-assignment-cell--inhabil,
body.theme-light .task-assignment-event-day--inhabil {
    background: rgba(254, 226, 226, 0.72);
    border-color: rgba(220, 38, 38, 0.16);
}

.task-assignment-task-cell {
    min-height: 92px;
    padding: 7px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.task-assignment-task-cell.is-drag-over,
.task-assignment-cell.is-drag-over {
    border-color: rgba(20, 184, 166, 0.7);
    box-shadow: inset 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.task-assignment-task-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    align-items: start;
}

.task-assignment-task-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.task-assignment-task-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.task-assignment-drag {
    color: var(--text-muted);
    cursor: grab;
    font-weight: 900;
    letter-spacing: 0;
}

.task-assignment-task-card:active .task-assignment-drag {
    cursor: grabbing;
}

.task-assignment-task-card input {
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.86rem;
}

.task-assignment-task-detail {
    min-height: 32px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.task-assignment-delete {
    width: 24px;
    min-width: 24px;
    max-width: 24px;
    height: 24px;
    min-height: 24px;
    max-height: 24px;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 6px;
    color: #dc2626;
    font-size: 0.9rem;
    line-height: 1;
}

.task-assignment-cell {
    position: relative;
    display: grid;
    gap: 6px;
    align-content: start;
    min-height: 92px;
    padding: 7px;
}

/* Fusion de casillas de una columna.

   UN punto por casilla, en el borde de abajo. Se arrastra hasta cualquier otra
   casilla de la misma columna -hacia abajo o hacia arriba- y se unen todas las
   filas del tramo. Antes habia dos puntos por casilla, arriba y abajo, y la
   columna se llenaba de puntos sin que el segundo aportara nada.

   El circulo se ve chico a proposito -no debe competir con los chips- pero el
   area que recibe el mouse es bastante mayor, porque si no habria que tener
   punteria de cirujano. */
.task-assignment-merge-port {
    position: absolute;
    left: -7px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    cursor: grab;
    z-index: 2;
}

.task-assignment-merge-port::after {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
    border: 2px solid var(--panel);
    background: var(--accent);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
    transition: transform .12s ease;
}

.task-assignment-merge-port--bottom { bottom: -7px; }
.task-assignment-merge-port:active { cursor: grabbing; }
.task-assignment-merge-port:hover::after { transform: scale(1.35); }
.task-assignment-merge-port.is-dragging::after { transform: scale(1.35); }

/* La linea que queda cuando el grupo esta fusionado. Es tambien el boton para
   separarlo, asi que ocupa todo el alto del bloque entre los dos puntos. */
.task-assignment-merge-line {
    position: absolute;
    /* Angosta y corrida hacia el borde: si invade la zona de los chips, les
       roba el arrastre por el costado izquierdo. */
    left: -2px;
    top: 4px;
    bottom: 4px;
    width: 12px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    z-index: 1;
}

.task-assignment-merge-line::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    border-radius: 2px;
    background: var(--accent);
}

.task-assignment-merge-line:hover::after {
    width: 3px;
    left: 5px;
}

/* El grupo fusionado se reconoce por el riel de marca del borde izquierdo mas
   el rotulo de arriba, no por el anillo completo: asi no compite con el estado
   "sin cubrir" ni con la casilla seleccionada. */
.task-assignment-cell--merged {
    border-color: var(--border);
    border-left: 3px solid var(--accent);
    box-shadow: none;
}

/* El blanco valido mientras se arrastra un punto: se marca la casilla entera,
   que es lo que de verdad se va a unir. */
.task-assignment-cell.is-merge-target,
.task-assignment-merge-port.is-merge-target::after {
    border-color: var(--accent);
}

.task-assignment-cell.is-merge-target {
    box-shadow: inset 0 0 0 3px rgba(var(--brand-blue-rgb), 0.28);
}

.task-assignment-merge-port.is-merge-target::after {
    transform: scale(1.5);
}

/* El boton de asignar dejo de ser un "+" azul siempre encendido en la esquina:
   con la casilla llena, quien manda son los chips, asi que el boton se revela
   al pasar el mouse. En la casilla vacia se queda fijo, porque ahi el boton ES
   el contenido. */
.task-assignment-add {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    padding: 4px 8px;
    border: 1px dashed var(--field-border);
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.3;
    opacity: 0;
    transition: opacity 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.task-assignment-add svg {
    width: 12px;
    height: 12px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.task-assignment-cell:hover .task-assignment-add,
.task-assignment-cell:focus-within .task-assignment-add,
.task-assignment-cell--uncovered .task-assignment-add,
.task-assignment-cell--picking .task-assignment-add {
    opacity: 1;
}

.task-assignment-add:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Sin cubrir es el unico estado que llama la atencion sola: borde punteado
   ambar. Es lo que cuenta el contador de la cabecera del turno. */
.task-assignment-cell--uncovered {
    border-style: dashed;
    border-color: rgba(240, 177, 0, 0.55);
    background: rgba(240, 177, 0, 0.09);
}

.task-assignment-cell--picking {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(var(--brand-blue-rgb), 0.3);
}

/* Con "solo sin cubrir" encendido, lo cubierto no se esconde: se apaga. Sigue
   dando contexto de la columna sin competir con los huecos. */
.task-assignment-cell--dimmed {
    opacity: 0.34;
}

.task-assignment-cell--dimmed:hover {
    opacity: 1;
}

.task-assignment-cell-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.task-assignment-cell-tag svg {
    width: 11px;
    height: 11px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.task-assignment-worker-avatar {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    flex: none;
    border-radius: 999px;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

/* `min-width: 0` es lo que mantiene los chips DENTRO de la casilla.
   Sin el, este contenedor -que es un item de grilla- toma `min-width: auto`,
   crece hasta su contenido y se desborda por debajo de la columna vecina: el
   nombre largo tapa la casilla de al lado y el lapiz de predefinir queda fuera
   de alcance. Ademas el `max-width: 100%` del chip se mide contra ESTE ancho,
   asi que sin el guardia el recorte con puntos suspensivos nunca actua. */
.task-assignment-cell-workers {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

/* El nombre se recorta con puntos suspensivos en vez de partirse letra a letra:
   en una columna angosta `overflow-wrap: anywhere` convertia "J. Cornejo" en
   dos renglones y estiraba la casilla. El nombre completo sigue en el title. */
.task-assignment-worker-chip {
    max-width: 100%;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    /* Red de seguridad para la etiqueta de franja parcial: en la columna mas
       angosta (116px) el nombre ya se recorto entero y aun asi no entra, asi
       que la hora baja a un segundo renglon dentro del chip en vez de
       desbordarse sobre la casilla vecina. */
    flex-wrap: wrap;
    gap: 3px 5px;
    padding: 3px 4px 3px 3px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--text);
    cursor: grab;
    font-size: 0.72rem;
    font-weight: 800;
}

.task-assignment-worker-chip__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Franja parcial del dia: 1/2 ADM o extension horaria. Va DESPUES del nombre y
   con `flex: none` para que el recorte con puntos suspensivos se coma el
   nombre y no la hora: entre "J. CORNEJO" y "hasta 14:00", lo que no se
   puede perder es la hora -el nombre completo sigue en el title del chip. */
.task-assignment-worker-chip__when {
    flex: none;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(var(--brand-blue-rgb), 0.14);
    color: var(--accent);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.task-assignment-worker-edit {
    width: 18px;
    min-width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(var(--brand-blue-rgb), 0.24);
    border-radius: 999px;
    background: var(--field);
    color: var(--accent);
    cursor: pointer;
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1;
}

.task-assignment-worker-edit.is-configured {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.task-assignment-worker-chip:active {
    cursor: grabbing;
}

.task-assignment-worker-chip.is-dragging {
    opacity: 0.55;
}

/* Relleno = asignacion de ese dia. Contorno = trabajador predefinido de la
   tarea, el que la regla repone sola. Se distinguen sin leer el lapiz. */
.task-assignment-worker-chip.is-configured {
    background: transparent;
    border-color: rgba(var(--brand-blue-rgb), 0.45);
}

/* Asignado a proposito aunque ese dia no le toca el turno (opcion "Todos" del
   modal). Se muestra en ambar y con borde punteado: es valido, pero no es una
   asignacion normal y el supervisor tiene que poder verlo de una pasada. */
.task-assignment-worker-chip--off-shift {
    border-style: dashed;
    border-color: rgba(240, 177, 0, 0.6);
    background: rgba(240, 177, 0, 0.12);
}

.task-assignment-cell p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.35;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.task-assignment-empty-row {
    grid-column: 1 / -1;
    min-height: 90px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--field);
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 800;
}

/* La fila de Novedades NO redeclara sus columnas: hereda la plantilla comun de
   arriba. Cuando tenia la suya propia venia despues en el archivo, ganaba, y
   dejaba esta fila con el minimo viejo -o sea, con scroll- y desalineada de los
   dos tableros de turno. */

.task-assignment-events-head {
    min-height: 92px;
}

.task-assignment-event-list {
    display: grid;
    gap: 6px;
    margin-top: 6px;
}

.task-assignment-event {
    display: block;
    padding: 6px 7px;
    border-radius: 9px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.task-assignment-event--absence {
    background: rgba(248, 113, 113, 0.16);
    color: #b91c1c;
}

.task-assignment-event--birthday {
    background: rgba(34, 197, 94, 0.16);
    color: #15803d;
}

.task-assignment-event-empty {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.task-assignment-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 6, 23, 0.56);
    backdrop-filter: blur(10px);
}

.task-assignment-dialog {
    width: min(780px, 100%);
    max-height: min(760px, calc(100vh - 36px));
    display: grid;
    gap: 14px;
    overflow: auto;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow-panel);
}

.task-auto-preview-backdrop {
    padding: 8px;
}

.task-assignment-dialog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.task-assignment-dialog__head h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.05rem;
}

.task-assignment-dialog__head span {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: capitalize;
}

.task-auto-preview-dialog {
    width: min(1760px, calc(100vw - 16px));
    height: min(980px, calc(100vh - 16px));
    max-height: min(980px, calc(100vh - 16px));
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    overflow: hidden;
}

.task-auto-preview-summary {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-alt);
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.45;
}

.task-auto-preview-list {
    display: grid;
    gap: 12px;
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding-right: 4px;
}

.task-auto-preview-section {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.task-auto-preview-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 900;
}

.task-auto-preview-section-head span {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.task-auto-preview-grid-wrap {
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 2px;
}

.task-auto-preview-grid {
    min-width: 1180px;
    display: grid;
    grid-template-columns: minmax(150px, 210px) repeat(7, minmax(130px, 1fr));
    gap: 6px;
    align-items: stretch;
}

.task-auto-preview-corner,
.task-auto-preview-day-head,
.task-auto-preview-task-head,
.task-auto-preview-cell {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--field);
}

.task-auto-preview-corner,
.task-auto-preview-day-head {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 54px;
    padding: 9px 10px;
    background: var(--panel-alt);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 900;
}

.task-auto-preview-corner {
    left: 0;
    z-index: 3;
    display: flex;
    align-items: center;
}

.task-auto-preview-day-head {
    display: grid;
    align-content: center;
    gap: 3px;
    text-transform: capitalize;
}

.task-auto-preview-day-head strong {
    color: var(--text);
    font-size: 0.8rem;
}

.task-auto-preview-day-head span {
    font-size: 0.7rem;
}

.task-auto-preview-day-head--inhabil {
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.08);
}

.task-auto-preview-task-head {
    position: sticky;
    left: 0;
    z-index: 1;
    display: grid;
    align-content: start;
    gap: 4px;
    min-height: 76px;
    padding: 10px;
    background: var(--panel);
}

.task-auto-preview-task-head strong {
    min-width: 0;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.task-auto-preview-task-head span {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
}

.task-auto-preview-cell {
    position: relative;
    min-height: 92px;
    padding: 9px 8px 34px;
}

.task-auto-preview-cell.is-short {
    border-color: rgba(240, 177, 0, 0.72);
    background: rgba(240, 177, 0, 0.08);
}

.task-auto-preview-cell--merged {
    border-color: rgba(var(--brand-blue-rgb), 0.55);
    background: rgba(var(--brand-blue-rgb), 0.04);
}

.task-auto-preview-cell--empty {
    background:
        linear-gradient(135deg, transparent 47%, rgba(148, 163, 184, 0.22) 49%, rgba(148, 163, 184, 0.22) 51%, transparent 53%),
        var(--field);
}

.task-auto-preview-cell--empty .task-auto-preview-add,
.task-auto-preview-cell--empty .task-auto-preview-picker {
    opacity: 1;
}

.task-auto-preview-cell--locked {
    background: var(--panel-alt);
}

.task-auto-preview-cell-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    margin-bottom: 5px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(var(--brand-blue-rgb), 0.08);
    color: var(--accent);
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
}

.task-auto-preview-cell-tag svg {
    width: 12px;
    height: 12px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.task-auto-preview-cell-workers {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.task-auto-preview-cell .task-auto-preview-chip {
    max-width: 100%;
}

.task-auto-preview-cell .task-auto-preview-count {
    position: absolute;
    right: 8px;
    bottom: 6px;
}

.task-auto-preview-add {
    position: absolute;
    left: 8px;
    bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: calc(100% - 58px);
    height: 23px;
    padding: 0 8px;
    border: 1px dashed rgba(var(--brand-blue-rgb), 0.35);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 900;
    cursor: pointer;
}

.task-auto-preview-add svg {
    width: 12px;
    height: 12px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.task-auto-preview-add span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-auto-preview-add:hover {
    border-color: rgba(var(--brand-blue-rgb), 0.65);
    background: #fff;
}

.task-auto-preview-row {
    display: grid;
    grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1.3fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field);
}

.task-auto-preview-row.is-short {
    border-color: rgba(240, 177, 0, 0.65);
    background: rgba(240, 177, 0, 0.08);
}

.task-auto-preview-row__main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.task-auto-preview-row__main span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: capitalize;
}

.task-auto-preview-row__main strong {
    min-width: 0;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-auto-preview-workers {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

.task-auto-preview-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 180px;
    min-width: 0;
    padding: 3px 8px 3px 4px;
    border: 1px solid rgba(var(--brand-blue-rgb), 0.2);
    border-radius: 999px;
    background: rgba(var(--brand-blue-rgb), 0.08);
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 900;
}

.task-auto-preview-chip-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-auto-preview-chip-remove {
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    flex: none;
    margin-left: 1px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #dc2626;
    font-size: 0.78rem;
    line-height: 1;
    cursor: pointer;
}

.task-auto-preview-chip-remove:hover {
    background: rgba(220, 38, 38, 0.12);
}

.task-auto-preview-chip--locked {
    opacity: 0.82;
}

.task-auto-preview-count {
    justify-self: end;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--panel-alt);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
}

.task-auto-preview-notes {
    display: grid;
    gap: 5px;
    padding: 10px 12px;
    border: 1px dashed rgba(240, 177, 0, 0.7);
    border-radius: 12px;
    background: rgba(240, 177, 0, 0.08);
    color: #8a6400;
    font-size: 0.8rem;
    font-weight: 800;
}

.task-auto-preview-notes p {
    margin: 0;
}

.task-auto-preview-actions {
    align-items: center;
}

.task-auto-preview-picker {
    position: absolute;
    left: 8px;
    right: 8px;
    top: calc(100% - 6px);
    z-index: 8;
    display: grid;
    /* La lista hace scroll DENTRO del recuadro. Sin la fila acotada y el
       overflow, los nombres pasados los 270px se salian del fondo y quedaban
       encima de las casillas de abajo, como si el menu fuera transparente. */
    grid-template-rows: auto minmax(0, 1fr);
    gap: 6px;
    max-height: 270px;
    overflow: hidden;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    /* --panel es 94% opaco: debajo va un fondo solido para que no se lean los
       chips de la grilla a traves del menu. */
    background: linear-gradient(var(--panel), var(--panel)), var(--bg-bottom, #ffffff);
    box-shadow: var(--shadow-lg);
}

.task-auto-preview-picker__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 8px;
    align-items: center;
}

.task-auto-preview-picker__head strong {
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 900;
}

.task-auto-preview-picker__head span {
    grid-column: 1;
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 800;
}

.task-auto-preview-picker__head button {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--field);
    color: var(--text-muted);
    font-weight: 900;
    cursor: pointer;
}

.task-auto-preview-picker__list {
    display: grid;
    gap: 3px;
    min-height: 0;
    overflow: auto;
}

.task-auto-preview-picker__option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 7px;
    align-items: center;
    width: 100%;
    padding: 6px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.task-auto-preview-picker__option:hover {
    background: var(--panel-hover);
}

.task-auto-preview-picker__option--busy {
    background: rgba(240, 177, 0, 0.08);
}

.task-auto-preview-picker__option span {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.task-auto-preview-picker__option strong,
.task-auto-preview-picker__option small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-auto-preview-picker__option strong {
    font-size: 0.72rem;
    font-weight: 900;
}

.task-auto-preview-picker__option small {
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 800;
}

.task-auto-preview-picker__empty {
    margin: 0;
    padding: 8px 4px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
}

@media (max-width: 760px) {
    .task-auto-preview-row {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .task-auto-preview-count {
        justify-self: start;
    }
}

.task-assignment-candidates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    align-content: start;
    gap: 6px;
    max-height: 340px;
    overflow: auto;
    padding-right: 2px;
}

.task-assignment-candidates > .empty-state {
    grid-column: 1 / -1;
}

/* La fila del candidato ya no se pinta entera de verde o rojo: el estado -libre
   del turno, o el nombre de la tarea en la que ya esta- viaja en una etiqueta
   a la derecha, y la fila solo se marca cuando esta seleccionada. */
.task-assignment-candidate {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease;
}

.task-assignment-candidate:hover {
    background: var(--panel-hover);
}

.task-assignment-candidate[hidden] {
    display: none;
}

.task-assignment-candidate.is-checked {
    border-color: var(--accent);
    background: rgba(var(--brand-blue-rgb), 0.13);
}

.task-assignment-candidate__state {
    flex: none;
    max-width: 120px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--panel-alt);
    color: var(--text-muted);
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-assignment-candidate__when {
    flex: none;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(var(--brand-blue-rgb), 0.14);
    color: var(--accent);
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
}

.task-assignment-candidate.is-busy .task-assignment-candidate__state {
    background: rgba(240, 177, 0, 0.16);
    color: #b07d00;
}

body.theme-dark .task-assignment-candidate.is-busy .task-assignment-candidate__state {
    color: #f0b100;
}

.task-assignment-candidate input {
    width: 16px;
    height: 16px;
    padding: 0;
    accent-color: var(--accent);
}

.task-assignment-candidate > span:not(.task-assignment-worker-avatar) {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.task-assignment-candidate strong {
    overflow-wrap: anywhere;
    font-size: 0.86rem;
}

.task-assignment-candidate small {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.task-assignment-note-field {
    display: grid;
    gap: 7px;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 800;
}

.task-assignment-note-field textarea {
    min-height: 92px;
}

.task-assignment-default-worker-field {
    display: grid;
    gap: 7px;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 800;
}

.task-assignment-default-worker-search {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
}

.task-assignment-default-worker-list {
    display: grid;
    gap: 8px;
    max-height: 340px;
    overflow: auto;
    padding-right: 2px;
}

.task-assignment-worker-default-dialog {
    max-width: 440px;
}

.task-assignment-worker-default-toggle,
.task-assignment-worker-default-field {
    display: grid;
    gap: 8px;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 800;
}

.task-assignment-worker-default-toggle {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field);
    color: var(--text);
}

.task-assignment-worker-default-toggle input {
    width: 16px;
    height: 16px;
    padding: 0;
    accent-color: var(--accent);
}

.task-assignment-worker-default-field select {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
}

.task-assignment-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

body.theme-dark .task-assignment-task-head,
body.theme-dark .task-assignment-events-head {
    box-shadow: 8px 0 18px rgba(0, 0, 0, 0.18);
}

body.theme-dark .task-assignment-event--absence {
    color: #fecaca;
}

body.theme-dark .task-assignment-event--birthday {
    color: #bbf7d0;
}

/* ==========================================================================
   ASIGNACION DE TAREAS - SELECTOR RAPIDO DE LA CASILLA

   Cuelga del BODY, no de la casilla: el tablero scrollea en horizontal y un
   `overflow-x: auto` recorta tambien en vertical, asi que dentro de la grilla
   el panel quedaria cortado. La posicion la calcula el JS contra la casilla.
========================================================================== */

.task-assignment-picker {
    position: fixed;
    z-index: 9000;
    width: 288px;
    max-height: min(560px, calc(100vh - 24px));
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(18px);
}

.task-assignment-picker__head {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 0 2px 8px;
}

.task-assignment-picker__head > div {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.task-assignment-picker__head strong {
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
}

.task-assignment-picker__head span {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: capitalize;
}

.task-assignment-picker__close {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: none;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--field);
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.task-assignment-picker__close:hover {
    color: var(--text);
    border-color: var(--accent);
}

.task-assignment-picker__assigned {
    display: grid;
    gap: 1px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.task-assignment-picker__row,
.task-assignment-picker__option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 7px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    text-align: left;
}

.task-assignment-picker__option {
    cursor: pointer;
}

.task-assignment-picker__option:hover {
    background: var(--panel-hover);
}

.task-assignment-picker__name {
    min-width: 0;
    font-size: 0.8rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.task-assignment-picker__remove {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: none;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #dc2626;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
}

.task-assignment-picker__remove:hover {
    background: rgba(220, 38, 38, 0.12);
}

.task-assignment-picker__label {
    padding: 8px 4px 5px;
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.task-assignment-picker__list {
    display: grid;
    gap: 1px;
    max-height: 360px;
    overflow: auto;
}

/* Ya asignado a otra tarea de este mismo turno y dia. Se puede elegir igual
   -mover gente entre tareas es normal- pero va al final de la lista y en ambar
   suave, para no confundirlo con quien esta libre. */
.task-assignment-picker__option--busy {
    background: rgba(240, 177, 0, 0.13);
}

.task-assignment-picker__option--busy:hover {
    background: rgba(240, 177, 0, 0.22);
}

.task-assignment-picker__option--busy small {
    color: #b07d00;
}

body.theme-dark .task-assignment-picker__option--busy small {
    color: #f0b100;
}

.task-assignment-picker__option > span {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.task-assignment-picker__option strong {
    font-size: 0.8rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.task-assignment-picker__option small {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.task-assignment-picker__empty {
    margin: 0;
    padding: 14px 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
    text-align: center;
}

.task-assignment-picker__more {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--field);
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
}

.task-assignment-picker__more:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Cerrar la casilla vive en el pie del selector, no en la casilla: es una
   decision poco frecuente y una fila de candados sobre las 7 columnas seria
   mas ruido que ayuda. Volver a abrirla si esta en la casilla, que es la unica
   forma de alcanzarla con el boton de asignar deshabilitado. */
.task-assignment-picker__foot {
    display: grid;
    gap: 6px;
}

.task-assignment-picker__close-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--field);
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
}

.task-assignment-picker__close-cell svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.task-assignment-picker__close-cell:hover {
    color: #b45309;
    border-color: rgba(180, 83, 9, 0.55);
}

body.theme-dark .task-assignment-picker__close-cell:hover {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.5);
}

/* ==========================================================================
   ASIGNACION DE TAREAS - REMATES DEL MODAL
========================================================================== */

.task-assignment-shift-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 800;
    vertical-align: middle;
}

.task-assignment-shift-badge--day {
    background: rgba(11, 136, 83, 0.16);
    color: #0b8853;
}

.task-assignment-shift-badge--night {
    background: rgba(var(--brand-blue-rgb), 0.18);
    color: var(--accent);
}

body.theme-dark .task-assignment-shift-badge--day { color: #34d399; }
body.theme-dark .task-assignment-shift-badge--night { color: #7dabe8; }

.task-assignment-dialog__selected {
    display: grid;
    gap: 7px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.task-assignment-dialog__selected-label {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.task-assignment-dialog__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 26px;
}

.task-assignment-dialog__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 3px 5px 3px 3px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--text);
    font-size: 0.74rem;
    font-weight: 800;
}

.task-assignment-dialog__chip > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.task-assignment-dialog__chip button {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    flex: none;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
}

.task-assignment-dialog__chip button:hover {
    color: #dc2626;
}

.task-assignment-dialog__chips-empty {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
    font-weight: 600;
}

.task-assignment-repeat-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.task-assignment-repeat-toggle input {
    width: 16px;
    height: 16px;
    padding: 0;
    accent-color: var(--accent);
}

.task-assignment-dialog__actions {
    align-items: center;
}

/* Un filtro puesto se nota en el propio boton, sin abrir el menu. */
.task-assignment-multiselect.is-filtered > summary {
    border-color: var(--accent);
    color: var(--accent);
}

.task-assignment-view-filters .task-assignment-multiselect {
    min-width: 178px;
}

.task-assignment-multiselect__menu {
    min-width: 224px;
}

/* `.task-assignment-board` declara `display: grid`, que gana al atributo
   `hidden`: sin esto, plegar un turno no ocultaria nada. */
.task-assignment-board[hidden] {
    display: none;
}

.task-assignment-shell {
    gap: 14px;
}

.task-assignment-section,
.task-assignment-events {
    gap: 8px;
}

.kanban-panel {
    display: grid;
    gap: 12px;
    padding: 14px 18px 18px;
    min-width: 0;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 10px;
    min-height: 520px;
    padding: 12px;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(17, 32, 56, 0.14);
    background:
        linear-gradient(180deg, rgba(17, 32, 56, 0.02), transparent 34%),
        #ffffff;
    box-shadow:
        inset 0 0 0 1px rgba(17, 32, 56, 0.04),
        inset 0 18px 28px rgba(17, 32, 56, 0.04);
}

.kanban-column {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
    border-radius: 6px;
    border: 1px solid rgba(17, 32, 56, 0.16);
    background: rgba(17, 32, 56, 0.03);
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.kanban-column.is-drag-over {
    border-color: rgba(20, 184, 166, 0.95);
    box-shadow: inset 0 0 0 3px rgba(20, 184, 166, 0.42);
}

.kanban-column__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 58px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(17, 32, 56, 0.16);
    color: var(--text-strong);
}

.kanban-column__head h4 {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 800;
}

.kanban-column__head span {
    min-width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(17, 32, 56, 0.08);
    color: var(--text-strong);
    font-size: 0.82rem;
    font-weight: 800;
}

.kanban-column__cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 410px;
    padding: 14px;
}

.kanban-card {
    display: grid;
    gap: 8px;
    min-height: 98px;
    padding: 12px;
    border-radius: 8px;
    color: #122033;
    cursor: grab;
    box-shadow:
        0 12px 18px rgba(0, 0, 0, 0.23),
        inset 0 0 0 1px rgba(255, 255, 255, 0.22);
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card.is-dragging {
    opacity: 0.58;
    transform: rotate(1.5deg) scale(0.98);
}

.kanban-card--cyan {
    background: #19c4d8;
}

.kanban-card--yellow {
    background: #ffbd3c;
}

.kanban-card--green {
    background: #72d63c;
}

.kanban-card--coral {
    background: #ff6267;
}

.kanban-card--automatic {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #3f2a13;
    box-shadow:
        0 12px 18px rgba(124, 45, 18, 0.13),
        inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.kanban-card--automatic:active {
    cursor: default;
}

.kanban-card__head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 8px;
}

.kanban-card strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.84rem;
    line-height: 1.25;
}

.kanban-card p {
    margin: 0;
    overflow-wrap: anywhere;
    color: rgba(18, 32, 51, 0.82);
    font-size: 0.76rem;
    line-height: 1.35;
    white-space: pre-wrap;
}

.kanban-card small {
    color: rgba(18, 32, 51, 0.65);
    font-size: 0.66rem;
    font-weight: 800;
}

.kanban-card__actions {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.kanban-card__edit,
.kanban-card__delete,
.kanban-card__open {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: rgba(18, 32, 51, 0.72);
    background: rgba(255, 255, 255, 0.3);
}

.kanban-card__edit,
.kanban-card__delete {
    width: 28px;
    height: 28px;
}

.kanban-card__open {
    min-height: 28px;
    padding: 0 8px;
    color: #7c2d12;
    font-size: 0.68rem;
    font-weight: 800;
    white-space: nowrap;
}

.kanban-card__edit:hover,
.kanban-card__delete:hover,
.kanban-card__open:hover {
    background: rgba(255, 255, 255, 0.54);
}

.kanban-card__edit:hover {
    color: #1d4ed8;
}

.kanban-card__delete:hover {
    color: #7f1d1d;
}

.kanban-card__edit svg,
.kanban-card__delete svg {
    width: 15px;
    height: 15px;
}

.kanban-empty {
    min-height: 92px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px dashed rgba(17, 32, 56, 0.2);
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.kanban-column-add {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    justify-self: end;
    margin: 0 14px 14px 0;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 20px rgba(var(--brand-blue-rgb), 0.2);
    transition: background 0.18s ease, transform 0.18s ease;
}

.kanban-column-add:hover {
    background: var(--accent-2);
    transform: translateY(-1px);
}

.kanban-edit-dialog,
.kanban-create-dialog {
    display: grid;
    gap: 12px;
}

.kanban-edit-dialog .turn-change-dialog__actions,
.kanban-create-dialog .turn-change-dialog__actions {
    margin-top: 2px;
}

body.theme-dark .kanban-board {
    border-color: rgba(255, 255, 255, 0.78);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 34%),
        #30333b;
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.35),
        inset 0 18px 28px rgba(0, 0, 0, 0.16);
}

body.theme-dark .kanban-column {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(15, 23, 42, 0.13);
}

body.theme-dark .kanban-column__head {
    border-bottom-color: rgba(255, 255, 255, 0.7);
    color: #f8fafc;
}

body.theme-dark .kanban-column__head span {
    background: rgba(255, 255, 255, 0.14);
    color: #f8fafc;
}

body.theme-dark .kanban-empty {
    border-color: rgba(255, 255, 255, 0.42);
    color: rgba(255, 255, 255, 0.68);
}

.agenda-panel {
    display: grid;
    gap: 16px;
    padding: 18px;
    min-width: 0;
}

.agenda-sidebar-actions {
    margin-bottom: 14px;
}

.agenda-sidebar-actions .primary-button {
    width: 100%;
    min-height: 42px;
}

.agenda-contact-list .profile-item {
    width: 100%;
    text-align: left;
    font: inherit;
}

.agenda-form {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.agenda-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.agenda-field--wide {
    grid-column: 1 / -1;
}

.agenda-notes {
    min-height: 118px;
    resize: vertical;
}

.agenda-attachment-list {
    max-width: 760px;
}

.agenda-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.agenda-actions .primary-button,
.agenda-actions .secondary-button,
.agenda-actions .ghost-button {
    min-height: 40px;
}

.agenda-delete-button {
    margin-left: auto;
    color: #dc2626;
}

.applicant-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 220px)) minmax(0, 1fr);
    gap: 12px;
    align-items: end;
}

.applicant-toolbar label,
.applicant-form label {
    display: grid;
    gap: 7px;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 800;
}

.applicant-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: var(--field);
    border: 1px solid var(--border);
}

.applicant-form label:nth-last-child(4),
.applicant-form label:nth-last-child(3),
.applicant-form label:nth-last-child(2) {
    grid-column: span 2;
}

.applicant-form textarea {
    min-height: 92px;
    resize: vertical;
}

.applicant-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: end;
    grid-column: 1 / -1;
}

.applicant-list {
    display: grid;
    gap: 12px;
}

.applicant-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: var(--field);
    border: 1px solid var(--border);
}

.applicant-card__head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: start;
}

.applicant-card__title {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.applicant-card__title strong {
    color: var(--text-strong);
    font-size: 1rem;
}

.applicant-card__title span,
.applicant-card__meta span,
.applicant-card__notes small {
    color: var(--text-muted);
}

.applicant-card__meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    font-size: 0.84rem;
}

.applicant-card__notes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.applicant-card__notes div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.applicant-card__notes p {
    margin: 0;
    color: var(--text);
    line-height: 1.45;
    white-space: pre-wrap;
}

.applicant-documents {
    display: grid;
    gap: 8px;
}

#staffingResult {
    margin-top: 14px;
    display: grid;
    gap: 12px;
}

/* Espacio reservado del menu Turnos: la columna donde vivia el recuadro
   "Resumen RRHH". Se conserva para lo que lo reemplace; mientras este vacio no
   pinta nada, asi no queda una tarjeta en blanco a la vista. */
.turnos-side-panel {
    min-height: 0;
}

.turnos-side-panel:empty {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* Botones de turno: se elige uno y se marca el dia en el calendario, sin pasar
   por el switch de "Editar". El punto de color es el MISMO del turno en el
   calendario, para que el boton y la casilla se lean como lo mismo. */
/* Se dibujan como los de Permisos/Ausencias -misma clase `legend-action`, misma
   caja y mismo hueco de 24px para el icono- para que las dos columnas del menu
   Turnos se lean como una sola lista y no como dos controles distintos. Lo
   propio de estos es el color: el punto lleva el MISMO del turno en el
   calendario. */
.add-turn-button__dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* El punto va dentro del hueco de 24px en vez de ocuparlo: asi las etiquetas de
   las dos columnas quedan a la misma altura, aunque una lleve icono dibujado y
   la otra un punto de color. */
.add-turn-button__dot::before {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 5px;
    background: var(--add-turn-color, var(--muted));
}

.add-turn-button:disabled .add-turn-button__dot::before {
    background: var(--text-muted);
}

/* Preasignado: el mismo color del turno pero el punto va HUECO. Es la misma
   diferencia que representa -el turno esta reservado, no puesto- y se ve sin
   leer la etiqueta, que es lo unico que si no los distinguiria de un vistazo
   estando uno debajo del otro. */
.add-turn-button--pre .add-turn-button__dot::before {
    background: transparent;
    box-shadow: inset 0 0 0 2.5px var(--add-turn-color, var(--muted));
}

.add-turn-button--pre:disabled .add-turn-button__dot::before {
    box-shadow: inset 0 0 0 2.5px var(--text-muted);
}

.add-turn-button--diurno {
    --add-turn-color: #0b8853;
}

.add-turn-button--larga {
    --add-turn-color: #0089c5;
}

.add-turn-button--noche {
    --add-turn-color: #10498b;
}

/* Armado: el boton se queda marcado mientras se espera el click en el dia. */
.add-turn-button.is-armed {
    border-color: var(--add-turn-color, var(--accent));
    box-shadow: inset 0 0 0 1px var(--add-turn-color, var(--accent));
}

/* QUITAR TURNO: en vez de un punto de color, una cruz roja. Es el unico boton
   de la lista que saca algo del calendario. */
.add-turn-button--remove {
    --add-turn-color: #dc2626;
}

.add-turn-button--remove .add-turn-button__dot::before {
    content: "\00d7";
    width: 16px;
    height: 16px;
    border-radius: 5px;
    background: var(--add-turn-color);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}

/* ==========================================================
   Contingencia (L CONTINGENCIA / N CONTINGENCIA)

   Quien queda de LLAMADO para un turno del dia: si alguien no llega a ultima
   hora, le toca venir a cubrir. No es un turno, asi que en ninguna de las tres
   vistas se pinta como tal: es una sigla -"LC" / "NC"- sobre lo que el dia ya
   tenga.
========================================================== */

/* El punto lleva el color de SU turno, pero pequeño y con halo: ni relleno
   -eso es el turno puesto- ni hueco -eso es el preasignado-. El halo se lee
   como lo que representa, alguien a la espera de que lo llamen. */
.add-turn-button--contingency .add-turn-button__dot::before {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--add-turn-color, var(--muted));
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.38);
}

.add-turn-button--contingency:disabled .add-turn-button__dot::before {
    background: var(--text-muted);
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.24);
}

/* La sigla en la casilla del calendario. Va un 80% mas grande que el resto de
   las insignias -lo pidio el usuario- porque no es un aviso que se atiende y se
   va: se programa con semanas de anticipacion y hay que poder leerlo de un
   vistazo sobre el calendario completo. */
.day-badge--contingency {
    min-width: 36px;
    min-height: 36px;
    padding: 3px 12px;
    background: rgba(59, 130, 246, 0.2);
    color: #1d4ed8;
    font-size: 1.17rem;
    font-weight: 800;
}

body.theme-light .day-badge--contingency {
    background: rgba(59, 130, 246, 0.24);
    color: #1e40af;
}

/* Y en el timeline, donde comparte el hueco con los demas marcadores. */
.mini.contingency-mini .timeline-replacement-marker {
    color: #1d4ed8;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

/* Candidato que estaba programado de contingencia para este dia: azul suave,
   que no es un reparo -no dice "cuidado"- sino "a este le toca". No pisa el
   amarillo del que al dia siguiente entra por la mañana ni el rojo del que se
   pasa del tope: esos dos avisos siguen mandando en el color, y la nota de la
   tarjeta explica igual por que aparece. */
.replacement-candidate--contingency:not(.replacement-candidate--next-day-shift):not(.replacement-candidate--over-limit) {
    border-color: rgba(37, 99, 235, 0.55);
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.18), transparent 58%),
        var(--field);
}

.replacement-candidate-contingency {
    display: block;
    margin-top: 2px;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35;
    white-space: normal;
}

.audit-log-panel {
    display: grid;
    gap: 18px;
}

.audit-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.audit-month-filter {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    font-size: 0.88rem;
    font-weight: 800;
}

.audit-month-filter input {
    width: 170px;
}

.audit-summary-card {
    position: relative;
    overflow: hidden;
    display: grid;
    align-content: center;
    gap: 2px;
    min-height: 66px;
    min-width: 0;
    padding: 7px 9px 7px 13px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease,
        box-shadow 0.16s ease;
}

.audit-summary-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--accent);
}

.audit-summary-card span {
    color: var(--text-soft);
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.08;
}

.audit-summary-card strong {
    color: var(--text-strong);
    font-size: 1.08rem;
    line-height: 1;
}

.audit-summary-card small {
    color: var(--text-muted);
    font-size: 0.58rem;
    line-height: 1.12;
}

.audit-summary-card:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--brand-blue-rgb), 0.34);
    box-shadow: 0 12px 26px rgba(17, 32, 56, 0.08);
}

.audit-summary-card.is-active {
    border-color: rgba(var(--brand-blue-rgb), 0.6);
    background:
        linear-gradient(135deg, rgba(var(--brand-blue-rgb), 0.16), rgba(34, 197, 94, 0.08)),
        var(--panel);
    box-shadow:
        inset 0 0 0 1px rgba(var(--brand-blue-rgb), 0.16),
        0 14px 28px rgba(var(--brand-blue-rgb), 0.12);
}

.audit-summary-card.is-active span,
.audit-summary-card.is-active strong {
    color: var(--blue);
}

.audit-summary-card--orange::before,
.audit-chip--orange {
    background: rgba(249, 115, 22, 0.18);
    color: #fb923c;
}

.audit-summary-card--green::before,
.audit-chip--green {
    background: rgba(34, 197, 94, 0.18);
    color: #34d399;
}

.audit-summary-card--cyan::before,
.audit-chip--cyan {
    background: rgba(20, 184, 166, 0.18);
    color: #2dd4bf;
}

.audit-summary-card--blue::before,
.audit-chip--blue {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
}

.audit-summary-card--violet::before,
.audit-chip--violet {
    background: rgba(168, 85, 247, 0.18);
    color: #d8b4fe;
}

.audit-summary-card--yellow::before,
.audit-chip--yellow {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}

.audit-summary-card--red::before,
.audit-chip--red {
    background: rgba(239, 68, 68, 0.18);
    color: #fb7185;
}

.audit-summary-card--muted::before,
.audit-chip--muted {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
}

.audit-summary-card--orange::before {
    background: #fb923c;
}

.audit-summary-card--green::before {
    background: #34d399;
}

.audit-summary-card--cyan::before {
    background: #2dd4bf;
}

.audit-summary-card--blue::before {
    background: #60a5fa;
}

.audit-summary-card--violet::before {
    background: #d8b4fe;
}

.audit-summary-card--yellow::before {
    background: #fbbf24;
}

.audit-summary-card--red::before {
    background: #fb7185;
}

.audit-summary-card--muted::before {
    background: #94a3b8;
}

.audit-feed {
    display: grid;
    gap: 10px;
}

.worker-requests-panel {
    display: grid;
    gap: 14px;
}

/* El panel del menu Memorandum ya no pinta nada propio: el rediseno (bloque
   mem-, mas abajo) trae su fondo, y el backdrop-filter de .panel crea un bloque
   contenedor que le romperia el position:fixed a sus dialogos. */
#memosPanel.memos-panel {
    display: block;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.informations-panel {
    display: grid;
    gap: 14px;
}

/* ==========================================================================
   Licitaciones
   ========================================================================== */
#tendersPanel.tenders-panel {
    display: block;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.tnd-root {
    --tnd-panel: #ffffff;
    --tnd-panel-alt: #f6f8fd;
    --tnd-border: rgba(15, 23, 42, 0.12);
    --tnd-border-strong: rgba(15, 23, 42, 0.2);
    --tnd-text: #112038;
    --tnd-soft: #53627a;
    --tnd-muted: #728098;
    --tnd-brand: #10498b;
    --tnd-brand-soft: rgba(16, 73, 139, 0.09);
    --tnd-ok: #15803d;
    --tnd-ok-bg: rgba(34, 197, 94, 0.13);
    --tnd-warn: #a35a04;
    --tnd-warn-bg: rgba(245, 158, 11, 0.15);
    --tnd-danger: #b91c1c;
    --tnd-danger-bg: rgba(239, 68, 68, 0.12);
    --tnd-info: #2563eb;
    --tnd-info-bg: rgba(37, 99, 235, 0.11);
    display: grid;
    gap: 14px;
    color: var(--tnd-text);
    font-family: var(--font-ui);
    font-size: 14px;
}

.theme-dark .tnd-root {
    --tnd-panel: #0e1828;
    --tnd-panel-alt: #132036;
    --tnd-border: rgba(255, 255, 255, 0.09);
    --tnd-border-strong: rgba(255, 255, 255, 0.17);
    --tnd-text: #f3f6fb;
    --tnd-soft: #c3cddc;
    --tnd-muted: #8e9bb0;
    --tnd-brand: #78aef0;
    --tnd-brand-soft: rgba(120, 174, 240, 0.14);
    --tnd-ok: #4ade80;
    --tnd-ok-bg: rgba(34, 197, 94, 0.16);
    --tnd-warn: #fbbf24;
    --tnd-warn-bg: rgba(245, 158, 11, 0.18);
    --tnd-danger: #fca5a5;
    --tnd-danger-bg: rgba(239, 68, 68, 0.17);
    --tnd-info: #93c5fd;
    --tnd-info-bg: rgba(59, 130, 246, 0.16);
}

.tnd-root :where(button, input, select, textarea) {
    font: inherit;
}

.tnd-root :where(button) {
    cursor: pointer;
}

.tnd-head,
.tnd-detail__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--tnd-border);
    border-radius: 8px;
    background: var(--tnd-panel);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.tnd-head h1,
.tnd-detail__head h2 {
    margin: 0;
    color: var(--tnd-text);
    font-size: 1.34rem;
    line-height: 1.15;
}

.tnd-detail__head p {
    margin: 4px 0 0;
    color: var(--tnd-soft);
    font-weight: 700;
}

.tnd-kicker {
    display: block;
    color: var(--tnd-brand);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tnd-head__actions,
.tnd-file__actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.tnd-btn,
.tnd-link,
.tnd-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    border-radius: 8px;
    font-weight: 850;
    text-decoration: none;
}

.tnd-btn svg,
.tnd-link svg,
.tnd-iconbtn svg,
.tnd-empty__icon svg,
.tnd-file__ic svg,
.tnd-related svg,
.tnd-reminder svg {
    width: 17px;
    height: 17px;
    flex: none;
}

.tnd-btn {
    padding: 0 13px;
    border: 1px solid var(--tnd-border-strong);
    color: var(--tnd-text);
    background: var(--tnd-panel);
}

.tnd-btn--primary {
    border-color: var(--tnd-brand);
    color: #ffffff;
    background: var(--tnd-brand);
}

.tnd-btn--secondary,
.tnd-link {
    color: var(--tnd-brand);
    background: var(--tnd-brand-soft);
}

.tnd-link {
    min-height: 28px;
    padding: 0 8px;
    border: 0;
}

.tnd-iconbtn {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--tnd-border);
    color: var(--tnd-soft);
    background: var(--tnd-panel);
}

.tnd-btn:hover,
.tnd-link:hover,
.tnd-iconbtn:hover,
.tnd-item:hover {
    border-color: var(--tnd-brand);
    box-shadow: 0 0 0 3px var(--tnd-brand-soft);
}

.tnd-btn:disabled {
    opacity: 0.46;
    cursor: not-allowed;
}

.tnd-kpis,
.tnd-grid3 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.tnd-grid3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tnd-kpi,
.tnd-info {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--tnd-border);
    border-radius: 8px;
    color: var(--tnd-text);
    text-align: left;
    background: var(--tnd-panel);
}

.tnd-kpi span,
.tnd-info span {
    color: var(--tnd-muted);
    font-size: 0.74rem;
    font-weight: 850;
}

.tnd-kpi strong,
.tnd-info strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 1.28rem;
    line-height: 1.12;
}

.tnd-kpi small {
    color: var(--tnd-soft);
    font-weight: 700;
}

.tnd-kpi--danger {
    border-color: rgba(239, 68, 68, 0.28);
    background: var(--tnd-danger-bg);
}

.tnd-kpi--warn {
    border-color: rgba(245, 158, 11, 0.32);
    background: var(--tnd-warn-bg);
}

.tnd-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.tnd-list,
.tnd-detail,
.tnd-sec {
    min-width: 0;
    border: 1px solid var(--tnd-border);
    border-radius: 8px;
    background: var(--tnd-panel);
}

.tnd-list {
    display: grid;
    gap: 10px;
    padding: 12px;
    max-height: calc(100vh - 190px);
    overflow: auto;
}

.tnd-list__tools,
.tnd-items,
.tnd-summary,
.tnd-stages,
.tnd-files,
.tnd-timeline,
.tnd-extension-list,
.tnd-checklist {
    display: grid;
    gap: 8px;
}

.tnd-list__filters,
.tnd-grid2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.tnd-list input,
.tnd-list select,
.tnd-dialog input,
.tnd-dialog select,
.tnd-dialog textarea,
.tnd-field textarea {
    width: 100%;
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid var(--tnd-border-strong);
    border-radius: 8px;
    color: var(--tnd-text);
    background: var(--tnd-panel);
}

.tnd-dialog textarea,
.tnd-field textarea {
    min-height: 98px;
    padding: 10px 11px;
    resize: vertical;
}

.tnd-item {
    display: grid;
    gap: 6px;
    width: 100%;
    min-width: 0;
    padding: 11px;
    border: 1px solid var(--tnd-border);
    border-radius: 8px;
    color: var(--tnd-soft);
    text-align: left;
    background: var(--tnd-panel);
}

.tnd-item.is-active {
    border-color: var(--tnd-brand);
    background: var(--tnd-brand-soft);
}

.tnd-item__top,
.tnd-item__foot,
.tnd-sec__h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.tnd-item strong,
.tnd-sec h3,
.tnd-event strong,
.tnd-extension strong,
.tnd-related strong {
    color: var(--tnd-text);
}

.tnd-item strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tnd-item__foot small,
.tnd-hint,
.tnd-note,
.tnd-event p,
.tnd-extension p,
.tnd-reminder p {
    color: var(--tnd-soft);
    line-height: 1.5;
}

.tnd-progress,
.tnd-budget__bar {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
}

.tnd-progress i,
.tnd-budget__bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--tnd-ok);
}

.tnd-budget__bar i.is-warn {
    background: #f59e0b;
}

.tnd-budget__bar i.is-danger {
    background: #ef4444;
}

.tnd-detail {
    display: grid;
    gap: 12px;
    padding: 12px;
}

.tnd-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tnd-tabs button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--tnd-border);
    border-radius: 8px;
    color: var(--tnd-soft);
    background: var(--tnd-panel-alt);
    font-weight: 850;
}

.tnd-tabs button.is-active {
    color: #ffffff;
    border-color: var(--tnd-brand);
    background: var(--tnd-brand);
}

.tnd-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tnd-sec {
    display: grid;
    gap: 10px;
    padding: 13px;
}

.tnd-sec__h h3 {
    margin: 0;
    font-size: 1rem;
}

.tnd-sec__h span,
.tnd-sec__h p {
    margin: 0;
    color: var(--tnd-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.tnd-sec__h--mt {
    margin-top: 6px;
}

.tnd-budget {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: end;
}

.tnd-budget div:not(.tnd-budget__bar) {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.tnd-budget span {
    color: var(--tnd-muted);
    font-size: 0.73rem;
    font-weight: 850;
}

.tnd-budget strong {
    overflow-wrap: anywhere;
}

.tnd-budget__bar {
    grid-column: 1 / -1;
}

.tnd-stage {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px;
    border: 1px solid var(--tnd-border);
    border-radius: 8px;
    background: var(--tnd-panel-alt);
}

.tnd-stage.is-done {
    border-color: rgba(34, 197, 94, 0.36);
    background: var(--tnd-ok-bg);
}

.tnd-stage input {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--tnd-brand);
}

.tnd-stage span {
    display: grid;
    gap: 2px;
}

.tnd-stage small {
    color: var(--tnd-soft);
    font-weight: 650;
}

.tnd-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    color: var(--tnd-soft);
    background: rgba(15, 23, 42, 0.07);
    font-size: 0.74rem;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
}

.tnd-pill--ok {
    color: var(--tnd-ok);
    background: var(--tnd-ok-bg);
}

.tnd-pill--warn {
    color: var(--tnd-warn);
    background: var(--tnd-warn-bg);
}

.tnd-pill--danger {
    color: var(--tnd-danger);
    background: var(--tnd-danger-bg);
}

.tnd-pill--info {
    color: var(--tnd-info);
    background: var(--tnd-info-bg);
}

.tnd-doc-types {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tnd-doc-types span {
    display: inline-flex;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--tnd-soft);
    background: var(--tnd-panel-alt);
    font-weight: 750;
}

.tnd-file {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--tnd-border);
    border-radius: 8px;
    background: var(--tnd-panel-alt);
}

.tnd-file__ic {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 8px;
    color: var(--tnd-brand);
    background: var(--tnd-brand-soft);
}

.tnd-file strong,
.tnd-file small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tnd-file small {
    color: var(--tnd-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.tnd-tablewrap {
    overflow: auto;
}

.tnd-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.tnd-table th,
.tnd-table td {
    padding: 10px;
    border-bottom: 1px solid var(--tnd-border);
    text-align: left;
    vertical-align: top;
}

.tnd-table th {
    color: var(--tnd-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.tnd-table td small {
    display: block;
    color: var(--tnd-muted);
    font-weight: 700;
}

.tnd-table__files td {
    padding-top: 0;
}

.tnd-event,
.tnd-extension {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--tnd-border);
    border-left: 4px solid var(--tnd-warn);
    border-radius: 8px;
    background: var(--tnd-panel-alt);
}

.tnd-event--closed {
    border-left-color: var(--tnd-ok);
}

.tnd-event p,
.tnd-extension p {
    margin: 5px 0 0;
}

.tnd-event aside {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.tnd-event__files,
.tnd-extension .tnd-files {
    grid-column: 1 / -1;
}

.tnd-related {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--tnd-border);
    border-radius: 8px;
    color: var(--tnd-soft);
    text-align: left;
    background: var(--tnd-panel-alt);
}

.tnd-related span:first-child {
    grid-row: span 2;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--tnd-brand);
    border-radius: 8px;
    background: var(--tnd-brand-soft);
}

.tnd-related small {
    color: var(--tnd-soft);
    font-weight: 700;
}

.tnd-reminder {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--tnd-border);
    border-radius: 8px;
    background: var(--tnd-panel-alt);
}

.tnd-reminder > span {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: var(--tnd-ok);
    border-radius: 8px;
    background: var(--tnd-ok-bg);
}

.tnd-reminder p {
    margin: 3px 0 0;
}

.tnd-empty {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 420px;
    padding: 28px;
    border: 1px solid var(--tnd-border);
    border-radius: 8px;
    color: var(--tnd-soft);
    text-align: center;
    background: var(--tnd-panel);
}

.tnd-empty strong {
    color: var(--tnd-text);
    font-size: 1.2rem;
}

.tnd-empty p {
    max-width: 620px;
    margin: 0;
    line-height: 1.55;
}

.tnd-empty__icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 14px;
    color: var(--tnd-brand);
    background: var(--tnd-brand-soft);
}

.tnd-upload {
    position: relative;
    overflow: hidden;
}

.tnd-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.tnd-dialog-backdrop {
    z-index: 10020;
}

.tnd-dialog {
    width: min(760px, calc(100vw - 32px));
    max-height: min(820px, calc(100vh - 32px));
    overflow: auto;
}

.tnd-dialog__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.tnd-formgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.tnd-formgrid label,
.tnd-field {
    display: grid;
    gap: 6px;
    color: var(--tnd-soft);
    font-size: 0.8rem;
    font-weight: 850;
}

.tnd-formgrid__full {
    grid-column: 1 / -1;
}

@media (max-width: 1180px) {
    .tnd-layout,
    .tnd-summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .tnd-list {
        max-height: none;
    }
}

@media (max-width: 760px) {
    .tnd-head,
    .tnd-detail__head,
    .tnd-sec__h {
        align-items: flex-start;
        flex-direction: column;
    }

    .tnd-kpis,
    .tnd-grid2,
    .tnd-grid3,
    .tnd-budget,
    .tnd-formgrid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tnd-event,
    .tnd-extension,
    .tnd-file {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ==========================================================================
   Equipos Medicos (rediseño 2026-09). Portado del mockup aprobado: mismos
   valores y mismos selectores, con prefijo meq- para que ningun estilo global
   (input, h1-h4, svg, .panel) lo deforme. Los resets usan :where() para no
   ganarle a las clases propias.
   ========================================================================== */
#medicalEquipmentPanel.medical-equipment-panel {
    display: block;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.meq {
    --meq-panel: #ffffff;
    --meq-panel-alt: #f6f8fd;
    --meq-hover: #edf2fb;
    --meq-border: rgba(14, 26, 44, 0.09);
    --meq-border-strong: rgba(14, 26, 44, 0.17);
    --meq-text: #112038;
    --meq-text-soft: #30425c;
    --meq-muted: #66748b;
    --meq-brand: #10498b;
    --meq-brand-2: #0d3a6f;
    --meq-brand-ink: #10498b;
    --meq-brand-soft: rgba(16, 73, 139, 0.08);
    --meq-brand-ring: rgba(16, 73, 139, 0.45);
    --meq-teal: #0f766e;
    --meq-ok: #15803d;
    --meq-ok-bg: rgba(34, 197, 94, 0.13);
    --meq-notice: #0369a1;
    --meq-notice-bg: rgba(14, 165, 233, 0.12);
    --meq-warn: #9a4a0b;
    --meq-warn-bg: rgba(245, 158, 11, 0.17);
    --meq-danger: #b91c1c;
    --meq-danger-bg: rgba(239, 68, 68, 0.12);
    --meq-mut-bg: rgba(17, 32, 56, 0.06);
    --meq-sev-low: #94a3b8;
    --meq-sev-medium: #0ea5e9;
    --meq-sev-high: #f59e0b;
    --meq-sev-critical: #ef4444;
    --meq-chart: #10498b;
    --meq-chart-soft: rgba(16, 73, 139, 0.14);
    --meq-grid: rgba(17, 32, 56, 0.08);
    --meq-shadow: 0 18px 40px rgba(17, 32, 56, 0.07);
    --meq-field: #ffffff;
    --meq-field-border: rgba(17, 32, 56, 0.16);
    --meq-tip-bg: #112038;
    --meq-tip-text: #f3f6fb;
    color: var(--meq-text);
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

.theme-dark .meq {
    --meq-panel: #0e1828;
    --meq-panel-alt: #132036;
    --meq-hover: #182842;
    --meq-border: rgba(255, 255, 255, 0.08);
    --meq-border-strong: rgba(255, 255, 255, 0.16);
    --meq-text: #f3f6fb;
    --meq-text-soft: #c3cddc;
    --meq-muted: #8e9bb0;
    --meq-brand: #1d5fae;
    --meq-brand-2: #10498b;
    --meq-brand-ink: #8dbaf3;
    --meq-brand-soft: rgba(93, 156, 236, 0.12);
    --meq-brand-ring: rgba(141, 186, 243, 0.5);
    --meq-teal: #2dd4bf;
    --meq-ok: #4ade80;
    --meq-ok-bg: rgba(34, 197, 94, 0.16);
    --meq-notice: #7dd3fc;
    --meq-notice-bg: rgba(14, 165, 233, 0.16);
    --meq-warn: #fbbf24;
    --meq-warn-bg: rgba(245, 158, 11, 0.17);
    --meq-danger: #fca5a5;
    --meq-danger-bg: rgba(239, 68, 68, 0.17);
    --meq-mut-bg: rgba(255, 255, 255, 0.07);
    --meq-sev-low: #8190a6;
    --meq-sev-medium: #38bdf8;
    --meq-sev-high: #fbbf24;
    --meq-sev-critical: #f87171;
    --meq-chart: #6aa5ee;
    --meq-chart-soft: rgba(106, 165, 238, 0.18);
    --meq-grid: rgba(255, 255, 255, 0.07);
    --meq-shadow: none;
    --meq-field: #0b1524;
    --meq-field-border: rgba(255, 255, 255, 0.12);
    --meq-tip-bg: #f3f6fb;
    --meq-tip-text: #112038;
}

:where(.meq) *,
:where(.meq) *::before,
:where(.meq) *::after { box-sizing: border-box; }
:where(.meq) :is(h1, h2, h3, h4) { margin: 0; font-family: inherit; letter-spacing: normal; text-wrap: balance; }
:where(.meq) p { margin: 0; }
:where(.meq) button { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
:where(.meq) svg { display: inline; }
:where(.meq) :is(input, select, textarea) { font-weight: 400; letter-spacing: normal; }
:where(.meq) :focus-visible { outline: 2px solid var(--meq-brand-ring); outline-offset: 2px; }
.meq [hidden], .meq[hidden] { display: none !important; }
.meq-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.meq-i { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -4px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.meq-num { font-variant-numeric: tabular-nums; }

/* ---------- raiz y encabezado ---------- */
.meq-root { display: grid; gap: 14px; align-content: start; min-width: 0; container-type: inline-size; container-name: meq; }
.meq-pagehead { background: var(--meq-panel); border: 1px solid var(--meq-border); border-radius: 20px; padding: 18px 20px; box-shadow: var(--meq-shadow); display: grid; gap: 16px; }
.meq-pagehead__top { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; justify-content: space-between; }
.meq-kicker { display: block; color: var(--meq-teal); font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 4px; }
.meq-pagehead h1 { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; color: var(--meq-text); }
.meq-pagehead p { color: var(--meq-muted); font-weight: 600; margin-top: 4px; max-width: 62ch; }
.meq-pagehead__side { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.meq-kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.meq-kpi { display: grid; gap: 3px; text-align: left; padding: 10px 12px; border: 1px solid var(--meq-border); border-radius: 14px; background: var(--meq-panel-alt); transition: border-color 0.15s, background 0.15s, transform 0.15s; }
.meq-kpi:hover { border-color: var(--meq-border-strong); transform: translateY(-1px); }
.meq-kpi.is-on { border-color: var(--meq-brand-ring); background: var(--meq-brand-soft); }
.meq-kpi__row { display: flex; align-items: center; gap: 7px; }
.meq-kpi strong { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--meq-text); }
.meq-kpi strong small { font-size: 13px; color: var(--meq-muted); font-weight: 600; }
.meq-kpi__lbl { color: var(--meq-text-soft); font-size: 11.5px; font-weight: 700; line-height: 1.25; }
.meq-kpi.is-zero strong { color: var(--meq-muted); }

/* ---------- tonos ---------- */
.meq-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--meq-sev-low); }
.meq-dot--ok { background: #22c55e; }
.meq-dot--warn { background: #f59e0b; }
.meq-dot--danger { background: #ef4444; }
.meq-dot--notice { background: #0ea5e9; }
.meq-dot--muted { background: var(--meq-sev-low); }
.meq-pill { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; line-height: 1.3; white-space: nowrap; background: var(--meq-mut-bg); color: var(--meq-text-soft); }
.meq-pill--ok { background: var(--meq-ok-bg); color: var(--meq-ok); }
.meq-pill--notice { background: var(--meq-notice-bg); color: var(--meq-notice); }
.meq-pill--warn { background: var(--meq-warn-bg); color: var(--meq-warn); }
.meq-pill--danger { background: var(--meq-danger-bg); color: var(--meq-danger); }
.meq-pill--solid { background: var(--meq-brand); color: #fff; }
.meq-pill .meq-i { width: 13px; height: 13px; stroke-width: 2.2; }
button.meq-pill:hover { filter: brightness(0.97); }

/* ---------- botones ---------- */
.meq-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 14px; border-radius: 12px; border: 1px solid transparent; background: none; font-weight: 800; font-size: 13px; letter-spacing: -0.01em; white-space: nowrap; transition: transform 0.15s, background 0.15s, box-shadow 0.15s; }
.meq-btn .meq-i { width: 16px; height: 16px; stroke-width: 2.1; }
.meq-btn--primary { color: #fff; background: linear-gradient(135deg, var(--meq-brand), var(--meq-brand-2)); box-shadow: 0 10px 20px rgba(16, 73, 139, 0.22); }
.meq-btn--primary:hover { transform: translateY(-1px); }
.meq-btn--secondary { color: var(--meq-brand-ink); border-color: var(--meq-brand-ring); }
.meq-btn--secondary:hover,
.meq-btn--ghost:hover { background: var(--meq-brand-soft); }
.meq-btn--ghost { color: var(--meq-text-soft); }
.meq-btn--sm { min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: 10px; }
.meq-btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.meq-link { background: none; border: 0; padding: 0; color: var(--meq-brand-ink); font-weight: 800; font-size: 12.5px; }
.meq-link:hover { text-decoration: underline; }
.meq-link--danger { color: var(--meq-danger); }
.meq-sec > .meq-link { text-align: center; }
.meq-iconbtn { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: var(--meq-muted); }
.meq-iconbtn:hover { background: var(--meq-danger-bg); color: var(--meq-danger); }
.meq-iconbtn .meq-i { width: 15px; height: 15px; }

/* ---------- lista lateral ---------- */
.meq-workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.meq-rail { position: sticky; top: 16px; background: var(--meq-panel); border: 1px solid var(--meq-border); border-radius: 20px; box-shadow: var(--meq-shadow); padding: 12px; display: grid; gap: 10px; align-content: start; max-height: calc(100vh - 32px); overflow: auto; }
.meq-railbody { display: grid; gap: 10px; }
.meq-search { display: flex; align-items: center; gap: 8px; padding: 0 11px; min-height: 40px; border: 1px solid var(--meq-field-border); border-radius: 12px; background: var(--meq-field); color: var(--meq-muted); }
.meq-search input { flex: 1; min-width: 0; width: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; outline: 0; color: var(--meq-text); font-size: 13px; }
.meq-search input:focus { box-shadow: none; border: 0; }
.meq-filterchip { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 10px; background: var(--meq-brand-soft); color: var(--meq-brand-ink); font-size: 12px; font-weight: 800; }
.meq-filterchip button { color: inherit; font-weight: 800; font-size: 12px; }
.meq-railnav { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 12px; border: 1px solid var(--meq-border); background: var(--meq-panel-alt); text-align: left; }
.meq-railnav span { display: grid; gap: 1px; min-width: 0; }
.meq-railnav strong { font-size: 13px; }
.meq-railnav small { color: var(--meq-muted); font-weight: 600; font-size: 11.5px; }
.meq-railnav.is-active,
.meq-eqi.is-active { border-color: var(--meq-brand-ring); background: var(--meq-brand-soft); }
.meq-railnav .meq-i { color: var(--meq-brand-ink); }
.meq-railgroup { display: grid; gap: 6px; }
.meq-railgroup__h { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 0; color: var(--meq-muted); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.meq-railgroup summary { cursor: pointer; list-style: none; }
.meq-railgroup summary::-webkit-details-marker { display: none; }
.meq-eqi { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: start; width: 100%; padding: 9px 10px; border: 1px solid transparent; border-radius: 12px; background: none; text-align: left; }
.meq-eqi:hover { background: var(--meq-hover); }
.meq-eqi .meq-dot { margin-top: 5px; }
.meq-eqi__main { display: grid; gap: 1px; min-width: 0; }
.meq-eqi__main strong { font-size: 13px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meq-eqi__main small { color: var(--meq-muted); font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meq-eqi__flags { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px; }
.meq-eqi__flags .meq-pill { min-height: 19px; font-size: 10.5px; padding: 1px 7px; }
.meq-eqi.is-off { opacity: 0.6; }
.meq-railempty { padding: 14px 6px; color: var(--meq-muted); font-weight: 600; font-size: 12.5px; }

/* ---------- area principal ---------- */
.meq-main { min-width: 0; background: var(--meq-panel); border: 1px solid var(--meq-border); border-radius: 20px; box-shadow: var(--meq-shadow); container-type: inline-size; container-name: meqmain; }
.meq-view { padding: 20px; display: grid; gap: 22px; }
.meq-sec { display: grid; gap: 12px; min-width: 0; }
.meq-sec__h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.meq-sec__h h3 { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; color: var(--meq-text); }
.meq-sec__h p,
.meq-hint { color: var(--meq-muted); font-size: 12.5px; font-weight: 600; }
.meq-viewtitle { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -0.02em; color: var(--meq-text); }
.meq-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.meq-box { border: 1px solid var(--meq-border); border-radius: 16px; padding: 16px; display: grid; gap: 12px; min-width: 0; align-content: start; }
.meq-box--flush { gap: 0; }
.meq-box__lbl { color: var(--meq-text-soft); font-size: 12px; font-weight: 700; }
.meq-box p { font-size: 13px; color: var(--meq-text-soft); }
.meq-readonly { padding: 10px 14px; border-radius: 12px; background: var(--meq-mut-bg); color: var(--meq-text-soft); font-size: 12.5px; font-weight: 700; }
.meq-empty { display: grid; gap: 10px; justify-items: start; padding: 8px 0; }
.meq-empty strong { font-size: 15px; }

/* ---------- avisos ---------- */
.meq-alerts { display: grid; border: 1px solid var(--meq-border); border-radius: 16px; overflow: hidden; }
.meq-alert { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; background: var(--meq-panel); }
.meq-alert + .meq-alert { border-top: 1px solid var(--meq-border); }
.meq-alert__ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--meq-mut-bg); color: var(--meq-text-soft); }
.meq-alert__ic .meq-i { width: 16px; height: 16px; stroke-width: 2.1; }
.meq-alert__ic--danger { background: var(--meq-danger-bg); color: var(--meq-danger); }
.meq-alert__ic--warn { background: var(--meq-warn-bg); color: var(--meq-warn); }
.meq-alert__ic--notice { background: var(--meq-notice-bg); color: var(--meq-notice); }
.meq-alert__ic--ok { background: var(--meq-ok-bg); color: var(--meq-ok); }
.meq-alert__txt { display: grid; gap: 2px; min-width: 0; }
.meq-alert__txt strong { font-size: 13px; font-weight: 800; }
.meq-alert__txt span { color: var(--meq-text-soft); font-size: 12.5px; font-weight: 500; }
.meq-alert__txt em { font-style: normal; color: var(--meq-muted); font-size: 11.5px; font-weight: 700; }

/* ---------- indicadores ---------- */
.meq-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.meq-metrics--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.meq-metric { display: grid; gap: 4px; align-content: start; padding: 14px; border-radius: 14px; background: var(--meq-panel-alt); border: 1px solid var(--meq-border); }
.meq-metric--clear { background: none; }
.meq-metric--plain { background: none; border: 0; padding: 0; min-width: min(340px, 100%); }
.meq-metric__lbl { color: var(--meq-text-soft); font-size: 12px; font-weight: 700; }
.meq-metric__val { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.meq-metric__val small { font-family: var(--font-ui); font-size: 13px; color: var(--meq-muted); font-weight: 700; letter-spacing: 0; }
.meq-metric__ctx { color: var(--meq-muted); font-size: 11.5px; font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.meq-meter { height: 6px; border-radius: 999px; background: var(--meq-mut-bg); overflow: hidden; }
.meq-meter i { display: block; height: 100%; border-radius: 999px; background: var(--meq-chart); }
.meq-meter i.meq-fill--warn { background: #f59e0b; }
.meq-meter i.meq-fill--danger { background: #ef4444; }
.meq-meter i.meq-fill--ok { background: #22c55e; }
.meq-metric__ctx .meq-pill { white-space: normal; }

/* ---------- ficha: encabezado y pestañas ---------- */
.meq-fhead { padding: 20px 20px 0; display: grid; gap: 14px; }
.meq-fhead__top { display: flex; flex-wrap: wrap; gap: 12px 18px; justify-content: space-between; align-items: flex-start; }
.meq-fhead__id { min-width: 0; }
.meq-fhead h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; color: var(--meq-text); }
.meq-fhead__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; color: var(--meq-text-soft); font-size: 12.5px; font-weight: 600; align-items: center; }
.meq-fhead__meta b { color: var(--meq-muted); font-weight: 700; }
.meq-fhead__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.meq-more { position: relative; }
.meq-more summary { list-style: none; }
.meq-more summary::-webkit-details-marker { display: none; }
.meq-more__menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 230px; background: var(--meq-panel); border: 1px solid var(--meq-border-strong); border-radius: 14px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18); padding: 6px; display: grid; }
.meq-more__menu button { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; text-align: left; font-size: 13px; font-weight: 700; color: var(--meq-text-soft); }
.meq-more__menu button:hover { background: var(--meq-hover); }
.meq-more__menu button.is-danger { color: var(--meq-danger); }
.meq-more__menu hr { border: 0; height: 1px; background: var(--meq-border); margin: 4px 2px; }
.meq-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--meq-border); scrollbar-width: thin; }
.meq-tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px 11px; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--meq-muted); font-weight: 800; font-size: 13px; white-space: nowrap; }
.meq-tab:hover { color: var(--meq-text); }
.meq-tab[aria-selected="true"] { color: var(--meq-brand-ink); border-bottom-color: var(--meq-brand-ink); }
.meq-tab .meq-pill { min-height: 18px; font-size: 10.5px; padding: 0 6px; }

/* ---------- datos ---------- */
.meq-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--meq-border); border: 1px solid var(--meq-border); border-radius: 16px; overflow: hidden; }
.meq-dl div { padding: 11px 14px; display: grid; gap: 2px; align-content: start; background: var(--meq-panel); min-width: 0; }
.meq-dl dt { color: var(--meq-muted); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.meq-dl dd { margin: 0; font-weight: 700; font-size: 13px; overflow-wrap: anywhere; }
.meq-dl dd.is-missing { color: var(--meq-warn); }
.meq-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.meq-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--meq-border-strong); font-size: 12px; font-weight: 800; color: var(--meq-text-soft); background: var(--meq-panel); }
.meq-chip.is-on { border-color: var(--meq-brand-ring); background: var(--meq-brand-soft); color: var(--meq-brand-ink); }
button.meq-chip:hover { border-color: var(--meq-brand-ring); }

/* ---------- fallas ---------- */
.meq-cards { display: grid; gap: 10px; }
.meq-fcard { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--meq-border); border-radius: 16px; }
.meq-fcard.is-closed { background: var(--meq-panel-alt); }
.meq-sev { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; }
.meq-sev--low { background: var(--meq-mut-bg); color: var(--meq-text-soft); }
.meq-sev--medium { background: var(--meq-notice-bg); color: var(--meq-notice); }
.meq-sev--high { background: var(--meq-warn-bg); color: var(--meq-warn); }
.meq-sev--critical { background: var(--meq-danger-bg); color: var(--meq-danger); }
.meq-fcard__body { display: grid; gap: 8px; min-width: 0; }
.meq-fcard__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: flex-start; }
.meq-fcard__title { display: grid; gap: 3px; min-width: 0; }
.meq-fcard__top strong { font-size: 14px; font-weight: 800; }
.meq-fcard__by { color: var(--meq-muted); font-size: 12px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.meq-fcard__by b.is-open { color: var(--meq-danger); }
.meq-fcard__by b.is-review { color: var(--meq-warn); }
.meq-fcard p { color: var(--meq-text-soft); font-size: 13px; }
.meq-steps { display: inline-flex; border: 1px solid var(--meq-border-strong); border-radius: 10px; overflow: hidden; }
.meq-steps button { padding: 5px 10px; font-size: 12px; font-weight: 800; color: var(--meq-muted); }
.meq-steps button + button { border-left: 1px solid var(--meq-border-strong); }
.meq-steps button.is-on { background: var(--meq-brand); color: #fff; }
.meq-fcard__foot { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.meq-fcard__acts { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.meq-linkrow { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12px; font-weight: 700; color: var(--meq-text-soft); }
.meq-atts { display: grid; gap: 6px; }
.meq-atts__h { display: flex; align-items: center; gap: 6px; color: var(--meq-muted); font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.meq-atts__h .meq-i { width: 15px; height: 15px; }
.meq-atts__list { display: flex; flex-wrap: wrap; gap: 8px; }
.meq-att { position: relative; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; border: 1px solid var(--meq-border-strong); background: var(--meq-panel-alt); display: grid; place-items: center; }
.meq-att:hover { border-color: var(--meq-brand-ring); box-shadow: 0 0 0 3px var(--meq-brand-soft); }
.meq-att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meq-att--file { width: auto; height: auto; min-height: 34px; max-width: 260px; padding: 6px 10px; display: inline-flex; gap: 7px; align-items: center; font-size: 12px; font-weight: 800; color: var(--meq-brand-ink); }
.meq-att--file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meq-att--file .meq-i { width: 16px; height: 16px; }
.meq-callout { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--meq-warn-bg); color: var(--meq-text); }
.meq-callout .meq-alert__ic { background: var(--meq-panel); color: var(--meq-warn); }
.meq-callout strong { font-size: 13px; }
.meq-callout span { font-size: 12.5px; color: var(--meq-text-soft); font-weight: 500; }
.meq-callout__txt { display: grid; gap: 2px; }
.meq-callout__acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.meq-callout--ok { background: var(--meq-ok-bg); }
.meq-callout--ok .meq-alert__ic { color: var(--meq-ok); }
.meq-callout--danger { background: var(--meq-danger-bg); }
.meq-callout--danger .meq-alert__ic { color: var(--meq-danger); }
.meq-callout--muted { background: var(--meq-mut-bg); }
.meq-callout--muted .meq-alert__ic { color: var(--meq-text-soft); }

/* ---------- tablas, agenda y vigencias ---------- */
.meq-tblwrap { overflow-x: auto; border: 1px solid var(--meq-border); border-radius: 16px; }
.meq-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 640px; }
.meq-tbl th { text-align: left; padding: 9px 12px; color: var(--meq-muted); font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; background: var(--meq-panel-alt); border-bottom: 1px solid var(--meq-border); }
.meq-tbl td { padding: 11px 12px; border-bottom: 1px solid var(--meq-border); vertical-align: top; font-weight: 600; color: var(--meq-text-soft); }
.meq-tbl tr:last-child td { border-bottom: 0; }
.meq-tbl td strong { color: var(--meq-text); font-weight: 800; }
.meq-tbl td small { display: block; color: var(--meq-muted); font-weight: 600; font-size: 11.5px; margin-top: 2px; }
.meq-tbl__files { display: grid; gap: 4px; justify-items: start; }
.meq-agenda { display: grid; }
.meq-agenda__row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--meq-border); }
.meq-agenda__row:first-child { border-top: 0; }
.meq-agenda__row--2 { grid-template-columns: minmax(0, 1fr) auto; }
.meq-agenda__side { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.meq-cal { display: grid; justify-items: center; padding: 5px 0; border-radius: 11px; background: var(--meq-panel-alt); border: 1px solid var(--meq-border); line-height: 1.1; }
.meq-cal b { font-family: var(--font-display); font-size: 17px; font-variant-numeric: tabular-nums; }
.meq-cal small { font-size: 10px; font-weight: 800; color: var(--meq-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.meq-cal.is-overdue { background: var(--meq-danger-bg); border-color: transparent; }
.meq-cal.is-overdue b,
.meq-cal.is-overdue small { color: var(--meq-danger); }
.meq-agenda__row strong { font-size: 13px; font-weight: 800; display: block; }
.meq-agenda__row span { color: var(--meq-muted); font-size: 12px; font-weight: 600; }
.meq-vig { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--meq-border); }
.meq-vig:first-of-type { border-top: 0; padding-top: 0; }
.meq-vig__top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.meq-vig__top strong { font-size: 13px; }
.meq-vig__bar { position: relative; height: 8px; border-radius: 999px; background: var(--meq-mut-bg); }
.meq-vig__bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--meq-chart); }
.meq-vig__bar i.meq-fill--warn { background: #f59e0b; }
.meq-vig__bar i.meq-fill--danger { background: #ef4444; }
.meq-vig__dates { display: flex; justify-content: space-between; color: var(--meq-muted); font-size: 11px; font-weight: 700; }

/* ---------- graficos ---------- */
.meq-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.meq-chart .meq-gridl { stroke: var(--meq-grid); stroke-width: 1; }
.meq-chart .meq-axis { fill: var(--meq-muted); font-size: 10.5px; font-weight: 700; font-family: var(--font-ui); }
.meq-chart .meq-axis--strong { fill: var(--meq-text-soft); }
.meq-chart .meq-bar { fill: var(--meq-chart); }
.meq-chart .meq-hit { fill: transparent; }
.meq-chart g.meq-bargrp:hover .meq-bar { opacity: 0.8; }
.meq-chart .meq-vallbl { fill: var(--meq-text); font-size: 11px; font-weight: 800; font-family: var(--font-ui); }
.meq-chart .meq-today { stroke: var(--meq-brand-ink); stroke-width: 1.5; stroke-dasharray: 3 3; }
.meq-chart .meq-lane { fill: var(--meq-panel-alt); }
.meq-chart .meq-sev-low { fill: var(--meq-sev-low); }
.meq-chart .meq-sev-medium { fill: var(--meq-sev-medium); }
.meq-chart .meq-sev-high { fill: var(--meq-sev-high); }
.meq-chart .meq-sev-critical { fill: var(--meq-sev-critical); }
.meq-chart .meq-sev-dismissed { fill: var(--meq-panel); stroke: var(--meq-sev-low); stroke-width: 2; }
.meq-chart .meq-ring { stroke: var(--meq-panel); stroke-width: 2; }
.meq-chart .meq-mk-prev { fill: var(--meq-panel); stroke: var(--meq-chart); stroke-width: 2; }
.meq-chart .meq-mk-corr { fill: var(--meq-chart); stroke: var(--meq-panel); stroke-width: 2; }
.meq-chart .meq-mk-insp { fill: var(--meq-panel); stroke: var(--meq-teal); stroke-width: 2; }
.meq-chart .meq-mk-plan { fill: var(--meq-panel); stroke: var(--meq-chart); stroke-width: 2; stroke-dasharray: 3 2; }
.meq-chart .meq-linkline { stroke: var(--meq-border-strong); stroke-width: 1.5; stroke-dasharray: 2 3; }
.meq-chartscroll { overflow-x: auto; }
.meq-chartscroll > div { min-width: 560px; }
.meq-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--meq-text-soft); font-size: 11.5px; font-weight: 700; }
.meq-legend span { display: inline-flex; align-items: center; gap: 6px; }
.meq-legend svg { width: 14px; height: 14px; display: inline-block; }
.meq-hbars { display: grid; gap: 8px; }
.meq-hbar { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 92px; gap: 10px; align-items: center; font-size: 12px; font-weight: 700; padding: 2px 0; text-align: left; width: 100%; border-radius: 8px; }
.meq-hbar:hover .meq-hbar__track i { opacity: 0.8; }
.meq-hbar__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--meq-text-soft); }
.meq-hbar__track { height: 12px; border-radius: 0 4px 4px 0; position: relative; }
.meq-hbar__track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--meq-chart); min-width: 2px; }
.meq-hbar__val { text-align: right; color: var(--meq-text); font-variant-numeric: tabular-nums; }
.meq-hbar__val small { color: var(--meq-muted); font-weight: 600; display: block; font-size: 10.5px; }

/* ---------- documentos ---------- */
.meq-docgroup { display: grid; border: 1px solid var(--meq-border); border-radius: 16px; overflow: hidden; }
.meq-docgroup__h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: var(--meq-panel-alt); font-size: 12px; font-weight: 800; color: var(--meq-text-soft); }
.meq-doc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--meq-border); }
.meq-doc__ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--meq-brand-soft); color: var(--meq-brand-ink); }
.meq-doc__ic.is-missing { background: var(--meq-mut-bg); color: var(--meq-muted); border: 1px dashed var(--meq-border-strong); }
.meq-doc strong { font-size: 13px; font-weight: 800; display: block; }
.meq-doc span { color: var(--meq-muted); font-size: 12px; font-weight: 600; }
.meq-doc__side { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.meq-doc select { width: auto; min-height: 30px; padding: 4px 30px 4px 9px; border-radius: 9px; font-size: 12px; background-color: var(--meq-field); color: var(--meq-text); border: 1px solid var(--meq-field-border); }

/* ---------- hoja de vida ---------- */
.meq-hv { display: grid; gap: 18px; }
.meq-hv__year { display: grid; }
.meq-hv__year h4 { font-family: var(--font-display); font-size: 15px; font-weight: 700; padding-bottom: 8px; color: var(--meq-text); }
.meq-hv__ev { display: grid; grid-template-columns: 64px 30px minmax(0, 1fr); gap: 10px; padding: 8px 0; align-items: start; position: relative; }
.meq-hv__ev::before { content: ""; position: absolute; left: 88px; top: 0; bottom: 0; width: 2px; background: var(--meq-border); }
.meq-hv__date { color: var(--meq-muted); font-size: 12px; font-weight: 800; padding-top: 6px; font-variant-numeric: tabular-nums; }
.meq-hv__ic { position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--meq-panel); border: 2px solid var(--meq-border-strong); color: var(--meq-text-soft); }
.meq-hv__ic .meq-i { width: 14px; height: 14px; stroke-width: 2.2; }
.meq-hv__ic--failure { border-color: #f59e0b; color: var(--meq-warn); }
.meq-hv__ic--maintenance { border-color: var(--meq-chart); color: var(--meq-brand-ink); }
.meq-hv__ic--document { border-color: var(--meq-teal); color: var(--meq-teal); }
.meq-hv__txt { display: grid; gap: 2px; padding-top: 4px; }
.meq-hv__txt strong { font-size: 13px; font-weight: 800; }
.meq-hv__txt span { color: var(--meq-muted); font-size: 12px; font-weight: 600; }

/* ---------- contactos ---------- */
.meq-contacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.meq-contact { position: relative; display: grid; gap: 4px; align-content: start; padding: 12px 14px; border: 1px solid var(--meq-border); border-radius: 14px; }
.meq-contact strong { font-size: 13px; font-weight: 800; }
.meq-contact span { color: var(--meq-muted); font-size: 12px; font-weight: 600; }
.meq-contact a { display: inline-flex; align-items: center; gap: 6px; color: var(--meq-brand-ink); font-weight: 800; font-size: 12.5px; text-decoration: none; overflow-wrap: anywhere; }
.meq-contact a:hover { text-decoration: underline; }
.meq-contact a .meq-i { width: 14px; height: 14px; }
.meq-contact .meq-iconbtn { position: absolute; top: 8px; right: 8px; }

/* ---------- capa flotante: dialogos, tooltip, aviso ---------- */
.meq-layer { position: relative; z-index: 1300; }
.meq-overlay { position: fixed; inset: 0; z-index: 1300; background: rgba(8, 17, 29, 0.45); display: grid; place-items: center; padding: 16px; }
.meq-dialog { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--meq-panel); border: 1px solid var(--meq-border); border-radius: 20px; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.3); color: var(--meq-text); }
.meq-dialog__h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 0; }
.meq-dialog__h h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.meq-dialog__h p { color: var(--meq-muted); font-size: 12.5px; font-weight: 600; margin-top: 3px; }
.meq-dialog__b { padding: 16px 20px; display: grid; gap: 14px; }
.meq-dialog__f { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; flex-wrap: wrap; }
.meq-fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.meq-field { display: grid; gap: 5px; min-width: 0; }
.meq-field.is-wide { grid-column: 1 / -1; }
.meq-field > span { color: var(--meq-text-soft); font-size: 12px; font-weight: 800; }
.meq-field small { color: var(--meq-muted); font-size: 11.5px; font-weight: 600; }
.meq-field input,
.meq-field select,
.meq-field textarea { width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--meq-field-border); border-radius: 11px; background-color: var(--meq-field); color: var(--meq-text); font-size: 13px; }
.meq-field select { padding-right: 36px; }
.meq-field textarea { resize: vertical; min-height: 72px; }
.meq-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.meq-drop { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 8px 12px; border: 1.5px dashed var(--meq-brand-ring); border-radius: 12px; color: var(--meq-brand-ink); font-weight: 800; font-size: 12.5px; background: var(--meq-brand-soft); cursor: pointer; text-align: center; }
.meq-drop.has-files { border-style: solid; }
.meq-drop input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.meq-autonote { display: flex; gap: 8px; align-items: center; padding: 9px 11px; border-radius: 11px; background: var(--meq-ok-bg); color: var(--meq-ok); font-size: 12px; font-weight: 700; }
.meq-opt { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; padding: 12px 14px; border: 1px solid var(--meq-border-strong); border-radius: 14px; cursor: pointer; }
.meq-opt input { width: auto; min-height: 0; margin: 3px 0 0; padding: 0; border: 0; box-shadow: none; accent-color: var(--meq-brand); }
.meq-opt strong { font-size: 13px; font-weight: 800; }
.meq-opt span { grid-column: 2; color: var(--meq-muted); font-size: 12px; font-weight: 600; }
.meq-opt:has(input:checked) { border-color: var(--meq-brand-ring); background: var(--meq-brand-soft); }
.meq-tip { position: fixed; z-index: 1400; pointer-events: none; max-width: 260px; padding: 7px 10px; border-radius: 9px; background: var(--meq-tip-bg); color: var(--meq-tip-text); font-size: 12px; font-weight: 700; line-height: 1.35; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2); white-space: pre-line; }
.meq-toast { position: fixed; z-index: 1400; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px; background: var(--meq-tip-bg); color: var(--meq-tip-text); font-weight: 700; font-size: 13px; box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25); }

/* ---------- anchos: se miden sobre el modulo, no sobre la ventana ---------- */
@container meq (max-width: 1063px) {
    .meq-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@container meq (max-width: 860px) {
    .meq-workspace { grid-template-columns: minmax(0, 1fr); }
    .meq-rail { position: static; max-height: 340px; }
}

@container meq (max-width: 520px) {
    .meq-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .meq-pagehead { padding: 16px; }
}

@container meqmain (max-width: 760px) {
    .meq-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container meqmain (max-width: 640px) {
    .meq-cols { grid-template-columns: minmax(0, 1fr); }
}

@container meqmain (max-width: 480px) {
    .meq-view { padding: 16px; }
    .meq-fhead { padding: 16px 16px 0; }
    .meq-metrics,
    .meq-metrics--3,
    .meq-dl { grid-template-columns: minmax(0, 1fr); }
    .meq-alert,
    .meq-callout { grid-template-columns: auto minmax(0, 1fr); }
    .meq-alert > .meq-btn,
    .meq-callout > .meq-btn,
    .meq-callout > .meq-callout__acts { grid-column: 2; justify-self: start; }
    .meq-hbar { grid-template-columns: minmax(0, 100px) minmax(0, 1fr) 78px; }
    .meq-hv__ev { grid-template-columns: 52px 30px minmax(0, 1fr); }
    .meq-hv__ev::before { left: 76px; }
}

/* ==========================================================================
   Memorandum (rediseño 2026-09). Portado del mockup aprobado: mismos valores y
   mismos selectores, con prefijo mem- para que ningun estilo global (input,
   h1-h4, svg, .panel) lo deforme. Los resets usan :where() para no ganarle a
   las clases propias, y los anchos se miden con @container sobre el modulo.
   ========================================================================== */
.mem {
    --mem-panel: #ffffff;
    --mem-panel-alt: #f6f8fd;
    --mem-hover: #edf2fb;
    --mem-border: rgba(14, 26, 44, 0.09);
    --mem-border-strong: rgba(14, 26, 44, 0.17);
    --mem-text: #112038;
    --mem-text-soft: #30425c;
    --mem-muted: #66748b;
    --mem-brand: #10498b;
    --mem-brand-2: #0d3a6f;
    --mem-brand-ink: #10498b;
    --mem-brand-soft: rgba(16, 73, 139, 0.08);
    --mem-brand-ring: rgba(16, 73, 139, 0.45);
    --mem-teal: #0f766e;
    --mem-ok: #15803d;
    --mem-ok-bg: rgba(34, 197, 94, 0.13);
    --mem-notice: #0369a1;
    --mem-notice-bg: rgba(14, 165, 233, 0.12);
    --mem-warn: #9a4a0b;
    --mem-warn-bg: rgba(245, 158, 11, 0.17);
    --mem-danger: #b91c1c;
    --mem-danger-bg: rgba(239, 68, 68, 0.12);
    --mem-mut-bg: rgba(17, 32, 56, 0.06);
    --mem-shadow: 0 18px 40px rgba(17, 32, 56, 0.07);
    --mem-field: #ffffff;
    --mem-field-border: rgba(17, 32, 56, 0.16);
    --mem-tip-bg: #112038;
    --mem-tip-text: #f3f6fb;
    --mem-paper: #f1f4fa;
    color: var(--mem-text);
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

.theme-dark .mem {
    --mem-panel: #0e1828;
    --mem-panel-alt: #132036;
    --mem-hover: #182842;
    --mem-border: rgba(255, 255, 255, 0.08);
    --mem-border-strong: rgba(255, 255, 255, 0.16);
    --mem-text: #f3f6fb;
    --mem-text-soft: #c3cddc;
    --mem-muted: #8e9bb0;
    --mem-brand: #1d5fae;
    --mem-brand-2: #10498b;
    --mem-brand-ink: #8dbaf3;
    --mem-brand-soft: rgba(93, 156, 236, 0.12);
    --mem-brand-ring: rgba(141, 186, 243, 0.5);
    --mem-teal: #2dd4bf;
    --mem-ok: #4ade80;
    --mem-ok-bg: rgba(34, 197, 94, 0.16);
    --mem-notice: #7dd3fc;
    --mem-notice-bg: rgba(14, 165, 233, 0.16);
    --mem-warn: #fbbf24;
    --mem-warn-bg: rgba(245, 158, 11, 0.17);
    --mem-danger: #fca5a5;
    --mem-danger-bg: rgba(239, 68, 68, 0.17);
    --mem-mut-bg: rgba(255, 255, 255, 0.07);
    --mem-shadow: none;
    --mem-field: #0b1524;
    --mem-field-border: rgba(255, 255, 255, 0.12);
    --mem-tip-bg: #f3f6fb;
    --mem-tip-text: #112038;
    --mem-paper: #0b1524;
}

:where(.mem) *,
:where(.mem) *::before,
:where(.mem) *::after { box-sizing: border-box; }
:where(.mem) :is(h1, h2, h3, h4) { margin: 0; font-family: inherit; letter-spacing: normal; text-wrap: balance; }
:where(.mem) p { margin: 0; }
:where(.mem) button { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
:where(.mem) svg { display: inline; }
:where(.mem) :is(input, select, textarea) { font-weight: 400; letter-spacing: normal; }
:where(.mem) :focus-visible { outline: 2px solid var(--mem-brand-ring); outline-offset: 2px; }
.mem [hidden], .mem[hidden] { display: none !important; }
.mem-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.mem-i { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -4px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- raiz y encabezado ---------- */
.mem-root { display: grid; gap: 14px; align-content: start; min-width: 0; container-type: inline-size; container-name: mem; }
.mem-kicker { display: block; color: var(--mem-teal); font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 4px; }

/* ---------- tonos ---------- */
.mem-pill { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; line-height: 1.3; white-space: nowrap; background: var(--mem-mut-bg); color: var(--mem-text-soft); }
.mem-pill--ok { background: var(--mem-ok-bg); color: var(--mem-ok); }
.mem-pill--notice { background: var(--mem-notice-bg); color: var(--mem-notice); }
.mem-pill--warn { background: var(--mem-warn-bg); color: var(--mem-warn); }
.mem-pill--danger { background: var(--mem-danger-bg); color: var(--mem-danger); }
.mem-pill .mem-i { width: 13px; height: 13px; stroke-width: 2.2; }

/* ---------- botones ---------- */
.mem-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 14px; border-radius: 12px; border: 1px solid transparent; background: none; font-weight: 800; font-size: 13px; letter-spacing: -0.01em; white-space: nowrap; transition: transform 0.15s, background 0.15s, box-shadow 0.15s; }
.mem-btn .mem-i { width: 16px; height: 16px; stroke-width: 2.1; }
.mem-btn--primary { color: #fff; background: linear-gradient(135deg, var(--mem-brand), var(--mem-brand-2)); box-shadow: 0 10px 20px rgba(16, 73, 139, 0.22); }
.mem-btn--primary:hover { transform: translateY(-1px); }
.mem-btn--secondary { color: var(--mem-brand-ink); border-color: var(--mem-brand-ring); }
.mem-btn--secondary:hover,
.mem-btn--ghost:hover { background: var(--mem-brand-soft); }
.mem-btn--ghost { color: var(--mem-text-soft); }
.mem-btn--sm { min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: 10px; }
.mem-btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.mem-link { background: none; border: 0; padding: 0; color: var(--mem-brand-ink); font-weight: 800; font-size: 12.5px; }
.mem-link:hover { text-decoration: underline; }
.mem-link--danger { color: var(--mem-danger); }
.mem-iconbtn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--mem-muted); border: 1px solid transparent; }
.mem-iconbtn:hover { background: var(--mem-hover); color: var(--mem-text); }
.mem-iconbtn:disabled { opacity: 0.5; cursor: default; }
.mem-iconbtn .mem-i { width: 16px; height: 16px; }
.mem-iconbtn--danger:hover { background: var(--mem-danger-bg); color: var(--mem-danger); }

/* ---------- barra de filtros ---------- */
.mem-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: var(--mem-panel); border: 1px solid var(--mem-border); border-radius: 16px; padding: 10px 12px; box-shadow: var(--mem-shadow); }
.mem-toolbar__group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* Estado y buscador van en la misma linea: el buscador toma lo que sobra. */
.mem-toolbar__group:first-child { flex: 1 1 440px; flex-wrap: nowrap; min-width: 0; }
.mem-search { display: flex; align-items: center; gap: 8px; padding: 0 11px; min-height: 38px; border: 1px solid var(--mem-field-border); border-radius: 12px; background: var(--mem-field); color: var(--mem-muted); min-width: 160px; max-width: 340px; flex: 1 1 auto; }
.mem-search input { flex: 1; min-width: 0; width: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; outline: 0; color: var(--mem-text); font-size: 13px; }
.mem-search input:focus { box-shadow: none; border: 0; }
.mem-select { display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 10px; border: 1px solid var(--mem-field-border); border-radius: 12px; background: var(--mem-field); font-size: 12.5px; font-weight: 700; color: var(--mem-text-soft); }
/* El select global dibuja un triangulo relleno; el mockup usa un chevron fino. */
.mem-select select { width: auto; min-height: 0; padding: 0 24px 0 4px; border: 0; border-radius: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2366748b' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 6px center / 12px 12px; box-shadow: none; outline: 0; font-weight: 700; color: var(--mem-text); font-size: 12.5px; }
.mem-select select:focus { box-shadow: none; }
.mem-segbtns { display: inline-flex; border: 1px solid var(--mem-border-strong); border-radius: 10px; overflow: hidden; }
.mem-segbtns button { padding: 6px 11px; font-size: 12px; font-weight: 800; color: var(--mem-muted); border: 0; background: none; }
.mem-segbtns button + button { border-left: 1px solid var(--mem-border-strong); }
.mem-segbtns button.is-on { background: var(--mem-brand); color: #fff; }
.mem-segbtns .mem-i { width: 14px; height: 14px; }

/* ---------- lista y hoja ---------- */
.mem-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 14px; align-items: start; }
.mem-list-panel { min-width: 0; background: var(--mem-panel); border: 1px solid var(--mem-border); border-radius: 20px; box-shadow: var(--mem-shadow); padding: 14px; display: grid; gap: 12px; align-content: start; }
.mem-sec__h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.mem-sec__h h3 { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; color: var(--mem-text); }
.mem-sec__h p,
.mem-hint { color: var(--mem-muted); font-size: 12.5px; font-weight: 600; }

.mem-group { border: 1px solid var(--mem-border); border-radius: 16px; overflow: hidden; }
.mem-group__h { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; background: var(--mem-panel-alt); width: 100%; text-align: left; border: 0; }
.mem-group__h:hover { background: var(--mem-hover); }
.mem-avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--mem-brand-soft); color: var(--mem-brand-ink); font-size: 12px; font-weight: 800; letter-spacing: 0.02em; }
.mem-group__name { display: grid; gap: 1px; min-width: 0; }
.mem-group__name strong { font-size: 13.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-group__name small { color: var(--mem-muted); font-size: 11.5px; font-weight: 600; }
.mem-group__side { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.mem-memo { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 12px; align-items: start; padding: 11px 12px; border-top: 1px solid var(--mem-border); background: var(--mem-panel); }
.mem-memo:hover { background: var(--mem-hover); }
.mem-memo.is-on { background: var(--mem-brand-soft); }
.mem-memo__type { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--mem-mut-bg); color: var(--mem-text-soft); }
.mem-memo__type--leave { background: var(--mem-notice-bg); color: var(--mem-notice); }
.mem-memo__type--clock { background: var(--mem-warn-bg); color: var(--mem-warn); }
.mem-memo__type--contract { background: var(--mem-brand-soft); color: var(--mem-brand-ink); }
.mem-memo__type .mem-i { width: 17px; height: 17px; stroke-width: 2; }
.mem-memo__body { display: grid; gap: 5px; min-width: 0; }
/* Vista Lista: quien origina el memorandum (en la vista por trabajador lo dice el grupo). */
.mem-memo__who { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 12.5px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; color: var(--mem-brand-ink); }
.mem-memo__who .mem-i { width: 15px; height: 15px; vertical-align: 0; }
.mem-memo__top { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.mem-memo__top strong { font-size: 13.5px; font-weight: 800; }
.mem-memo__facts { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--mem-text-soft); font-size: 12.5px; font-weight: 600; }
.mem-memo__facts b { color: var(--mem-muted); font-weight: 700; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; margin-right: 4px; }
.mem-memo__foot { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12px; font-weight: 700; color: var(--mem-muted); }
.mem-memo__side { display: grid; gap: 6px; justify-items: end; }
.mem-memo__actions { display: flex; gap: 6px; align-items: center; }

.mem-thumb { width: 44px; height: 56px; border-radius: 8px; overflow: hidden; border: 1px solid var(--mem-border-strong); background: var(--mem-paper); display: grid; place-items: center; flex: none; padding: 0; position: relative; color: var(--mem-brand-ink); }
.mem-thumb:hover { border-color: var(--mem-brand-ring); box-shadow: 0 0 0 3px var(--mem-brand-soft); }
.mem-thumb.is-empty { background: var(--mem-mut-bg); border-style: dashed; color: var(--mem-muted); }
.mem-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mem-thumb__tag { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(17, 32, 56, 0.72); color: #fff; font-size: 8px; font-weight: 800; text-align: center; padding: 1px 0; }
.mem-empty { display: grid; gap: 8px; justify-items: center; padding: 34px 16px; text-align: center; color: var(--mem-muted); }
.mem-empty strong { color: var(--mem-text); font-size: 15px; }
.mem-empty .mem-i { width: 26px; height: 26px; }


/* ---------- visor del documento adjunto ---------- */
.mem-viewer { position: sticky; top: 16px; display: grid; gap: 12px; align-content: start; background: var(--mem-panel); border: 1px solid var(--mem-border); border-radius: 20px; box-shadow: var(--mem-shadow); padding: 14px; }
.mem-viewer-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; justify-content: space-between; }
.mem-viewer-file { display: grid; gap: 2px; min-width: 0; }
.mem-viewer-file strong { font-size: 13.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-viewer-file small { color: var(--mem-muted); font-size: 11.5px; font-weight: 600; }
.mem-viewer-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; padding: 6px 8px; border-radius: 10px; background: var(--mem-panel-alt); border: 1px solid var(--mem-border); }
.mem-viewer-tools__grp { display: flex; gap: 4px; align-items: center; }
.mem-zoomlbl { font-size: 11.5px; font-weight: 800; color: var(--mem-muted); min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.mem-viewer-stage { border-radius: 12px; background: var(--mem-mut-bg); padding: 10px; max-height: 520px; overflow: auto; display: grid; justify-items: center; }
.mem-viewer-stage.is-full { max-height: none; }
.mem-docwrap { display: grid; justify-items: center; width: 100%; }
.mem-docwrap img { max-width: 100%; border-radius: 6px; background: #fff; box-shadow: 0 10px 24px rgba(17, 32, 56, 0.18); }
.mem-docwrap iframe { width: 100%; height: 480px; border: 0; border-radius: 6px; background: #fff; }
.mem-docwrap__alt { margin-top: 8px; text-align: center; }
.mem-docfile { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 26px 18px; color: var(--mem-muted); font-weight: 700; font-size: 12.5px; }
.mem-docfile .mem-i { width: 26px; height: 26px; color: var(--mem-brand-ink); }
.mem-dropzone { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 24px 18px; border: 1.5px dashed var(--mem-brand-ring); border-radius: 14px; background: var(--mem-brand-soft); color: var(--mem-brand-ink); }
.mem-dropzone strong { font-size: 13.5px; }
.mem-dropzone p { color: var(--mem-text-soft); font-size: 12.5px; font-weight: 600; max-width: 40ch; }
.mem-dropzone__acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mem-viewer-meta { display: grid; gap: 8px; }
.mem-viewer-meta > .mem-link { text-align: center; }
.mem-match { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px; background: var(--mem-ok-bg); }
.mem-match--warn { background: var(--mem-warn-bg); }
.mem-match__ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--mem-panel); color: var(--mem-ok); }
.mem-match--warn .mem-match__ic { color: var(--mem-warn); }
.mem-match__txt { display: grid; gap: 2px; }
.mem-match strong { font-size: 12.5px; }
.mem-match span { color: var(--mem-text-soft); font-size: 12px; font-weight: 600; }
.mem-metric { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--mem-border); border-radius: 12px; background: var(--mem-panel-alt); }
.mem-metric span { color: var(--mem-text-soft); font-size: 11.5px; font-weight: 700; }
.mem-metric strong { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.mem-timeline { display: grid; gap: 8px; }
.mem-tl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.mem-tl__dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--mem-border-strong); background: var(--mem-panel); color: var(--mem-muted); }
.mem-tl__dot .mem-i { width: 12px; height: 12px; stroke-width: 2.4; }
.mem-tl__dot.is-done { border-color: var(--mem-ok); color: var(--mem-ok); background: var(--mem-ok-bg); }
.mem-tl__dot.is-now { border-color: var(--mem-brand-ink); color: var(--mem-brand-ink); background: var(--mem-brand-soft); }
.mem-tl__txt { display: grid; gap: 1px; }
.mem-tl__txt strong { font-size: 12.5px; font-weight: 800; }
.mem-tl__txt small { color: var(--mem-muted); font-size: 11.5px; font-weight: 600; }

/* ---------- avisos, dialogos ---------- */
.mem-callout { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--mem-warn-bg); }
.mem-callout__ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--mem-panel); color: var(--mem-warn); }
.mem-callout__txt { display: grid; gap: 2px; }
.mem-callout strong { font-size: 13px; }
.mem-callout span { font-size: 12.5px; color: var(--mem-text-soft); font-weight: 500; }
.mem-readonly { padding: 10px 14px; border-radius: 12px; background: var(--mem-mut-bg); color: var(--mem-text-soft); font-size: 12.5px; font-weight: 700; }
.mem-layer { position: relative; z-index: 1300; }
.mem-overlay { position: fixed; inset: 0; z-index: 1300; background: rgba(8, 17, 29, 0.45); display: grid; place-items: center; padding: 16px; }
.mem-dialog { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--mem-panel); border: 1px solid var(--mem-border); border-radius: 20px; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.3); color: var(--mem-text); }
.mem-dialog--wide { width: min(860px, 100%); }
.mem-dialog__h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 0; }
.mem-dialog__h h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.mem-dialog__h p { color: var(--mem-muted); font-size: 12.5px; font-weight: 600; margin-top: 3px; }
.mem-dialog__b { padding: 16px 20px; display: grid; gap: 14px; }
.mem-dialog__f { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; flex-wrap: wrap; }
.mem-fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mem-field { display: grid; gap: 5px; min-width: 0; }
.mem-field.is-wide { grid-column: 1 / -1; }
.mem-field > span { color: var(--mem-text-soft); font-size: 12px; font-weight: 800; }
.mem-field small { color: var(--mem-muted); font-size: 11.5px; font-weight: 600; }
.mem-field input,
.mem-field select,
.mem-field textarea { width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--mem-field-border); border-radius: 11px; background-color: var(--mem-field); color: var(--mem-text); font-size: 13px; }
.mem-field input { height: 38px; }
.mem-field select { padding-right: 36px; }
.mem-field :is(input, select, textarea):focus { border-color: var(--mem-brand-ring); box-shadow: 0 0 0 3px var(--mem-brand-soft); }
.mem-field textarea { resize: vertical; min-height: 72px; }
.mem-drop { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 70px; padding: 8px 12px; border: 1.5px dashed var(--mem-brand-ring); border-radius: 12px; color: var(--mem-brand-ink); font-weight: 800; font-size: 12.5px; background: var(--mem-brand-soft); cursor: pointer; text-align: center; }
.mem-drop.has-files { border-style: solid; }
.mem-drop input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.mem-toast { position: fixed; z-index: 1400; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px; background: var(--mem-tip-bg); color: var(--mem-tip-text); font-weight: 700; font-size: 13px; box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25); }

/* ---------- anchos: se miden sobre el modulo, no sobre la ventana ---------- */
@container mem (max-width: 1100px) {
    .mem-workspace { grid-template-columns: minmax(0, 1fr); }
    .mem-viewer { position: static; }
}

@container mem (max-width: 620px) {
    .mem-memo { grid-template-columns: auto minmax(0, 1fr); }
    .mem-memo__side { grid-column: 2; justify-items: start; }
    .mem-group__h { grid-template-columns: auto minmax(0, 1fr); }
    .mem-group__side { grid-column: 2; justify-content: flex-start; }
    .mem-callout { grid-template-columns: auto minmax(0, 1fr); }
    .mem-callout > .mem-btn { grid-column: 2; justify-self: start; }
    .mem-fgrid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
    .meq-fgrid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .meq *,
    .meq-layer * { transition: none !important; }
}

.task-assignment-cell--maintenance {
    border-color: rgba(15, 118, 110, 0.5);
    background: rgba(20, 184, 166, 0.1);
}

.task-assignment-maintenance-banner {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid rgba(15, 118, 110, 0.34);
    border-radius: 12px;
    background: rgba(20, 184, 166, 0.08);
    color: #0f766e;
}

.task-assignment-maintenance-banner strong {
    color: inherit;
    font-size: 0.86rem;
    font-weight: 900;
}

.task-assignment-maintenance-banner div {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.task-assignment-maintenance-banner span {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--panel);
    color: var(--text-soft);
    font-size: 0.75rem;
    font-weight: 900;
}

.task-assignment-cell--maintenance .task-assignment-add {
    display: none;
}

.task-assignment-maintenance-note {
    display: grid;
    gap: 2px;
    padding: 6px 7px;
    border-radius: 8px;
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1.25;
}

.task-assignment-maintenance-note small {
    color: inherit;
    opacity: 0.78;
    font-weight: 800;
}

/* Casilla cerrada a mano: esa tarea ese turno no va. Se lee distinto de "sin
   cubrir" -que es un hueco por tapar- y distinto del mantenimiento, que no lo
   decidio el supervisor. Gris apagado: esta resuelta, no reclama nada. */
.task-assignment-cell--closed {
    border-style: solid;
    border-color: var(--border);
    background: repeating-linear-gradient(
        135deg,
        rgba(120, 130, 145, 0.10) 0 6px,
        rgba(120, 130, 145, 0.03) 6px 12px
    );
}

.task-assignment-cell--closed .task-assignment-add {
    display: none;
}

.task-assignment-closed-note {
    display: grid;
    gap: 2px;
    padding: 6px 7px;
    border-radius: 8px;
    background: rgba(120, 130, 145, 0.14);
    color: var(--text-soft);
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1.25;
}

.task-assignment-closed-note span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.task-assignment-closed-note svg {
    width: 13px;
    height: 13px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.task-assignment-closed-note small {
    color: inherit;
    opacity: 0.75;
    font-weight: 800;
}

.task-assignment-reopen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    min-height: 28px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--panel);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
}

.task-assignment-reopen svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.task-assignment-reopen:hover {
    color: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 1180px) {
    .medeq-head {
        grid-template-columns: minmax(0, 1fr);
    }

    .medeq-stats {
        min-width: 0;
        width: 100%;
    }

    .medeq-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .medeq-sidebar {
        position: static;
    }
}

@media (max-width: 760px) {
    .medeq-head,
    .medeq-detail,
    .medeq-section,
    .medeq-sidebar {
        padding: 12px;
        border-radius: 14px;
    }

    .medeq-stats,
    .medeq-summary-row,
    .medeq-grid--four,
    .medeq-section--split {
        grid-template-columns: minmax(0, 1fr);
    }

    .medeq-detail-head {
        grid-template-columns: minmax(0, 1fr);
    }

    .medeq-actions {
        justify-content: stretch;
    }

    .medeq-actions .primary-button,
    .medeq-actions .secondary-button,
    .medeq-actions .danger-button {
        width: 100%;
    }
}

.qualifications-panel,
.qual-root {
    display: grid;
    gap: 14px;
}

.qual-head {
    margin-bottom: 0;
}

/* ---------- Bandeja a ancho completo / ficha a ancho completo ---------- */

/* Son dos PANTALLAS, no dos columnas. Con la lista y la ficha lado a lado
   ninguna tenia sitio: las escalas de nota y los antecedentes de cada factor
   quedaban metidos en columnas de trescientos pixeles. */
.qual-root {
    display: grid;
    gap: 14px;
}

.qual-list-panel,
.qual-detail-panel {
    display: grid;
    gap: 14px;
    align-content: start;
    padding: 16px;
}

.qual-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: max-content;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-alt);
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.qual-back:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.qual-back svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.qual-detail-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "back back"
        "id periods";
    align-items: start;
    gap: 12px;
}

/* Las areas son de ESTA rejilla y de ninguna otra. Sueltas, `.qual-detail-id`
   se llevaba su `grid-area: id` al encabezado de la anual, cuya rejilla no
   define esa area: el navegador la manda a una fila implicita y la identidad
   terminaba debajo del puntaje y pegada a la derecha. */
.qual-detail-head > .qual-back { grid-area: back; }
.qual-detail-head > .qual-detail-id { grid-area: id; }
.qual-detail-head > .qual-detail-periods { grid-area: periods; }

.qual-detail-id {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.qual-detail-name {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.qual-detail-name h3 {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.qual-detail-id small {
    display: block;
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 600;
}

.qual-avatar--lg {
    width: 52px;
    height: 52px;
    font-size: 1.05rem;
}

.qual-detail-periods {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.qual-detail-kind {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.qual-periods--compact .qual-period {
    min-height: 32px;
    padding: 0 11px;
    font-size: 0.78rem;
}

/* Franja de antecedentes del periodo, encima de los tres factores. */
.qual-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 11px 13px;
    border: 1px solid rgba(var(--brand-blue-rgb), 0.22);
    border-radius: 14px;
    background: rgba(var(--brand-blue-rgb), 0.04);
}

.qual-strip__label {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.qual-strip__chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.qual-strip__chip strong { font-weight: 900; }

.qual-strip__chip--ok { background: rgba(34, 197, 94, 0.12); color: #15803d; }
.qual-strip__chip--warn { background: rgba(240, 177, 0, 0.14); color: #97690a; }
.qual-strip__chip--bad { background: rgba(239, 68, 68, 0.1); color: #c53030; }

.qual-strip__chip--mute {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text-soft);
}

.qual-strip__hint {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.qual-queue-foot {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.qual-queue-foot small {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.qual-queue-foot .ghost-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.qual-queue-foot svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 860px) {
    .qual-detail-head {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "back"
            "id"
            "periods";
    }

    .qual-detail-periods {
        justify-items: start;
    }
}

/* ---------- Cabecera del ciclo ---------- */

.qual-head__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.qual-deadline {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
    font-size: 0.82rem;
    font-weight: 800;
}

.qual-deadline.is-urgent {
    background: rgba(240, 177, 0, 0.16);
    color: #97690a;
}

.qual-queue {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.qual-queue svg {
    width: 17px;
    height: 17px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Los cuatro pasos del ciclo en UNA fila de pastillas. Antes eran tarjetas
   grandes que se partian en dos filas y ocupaban un tercio de la pantalla. */
.qual-cyclebar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.qual-cycle-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: none;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text-soft);
    cursor: pointer;
}

.qual-cycle-nav:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.qual-cycle-nav svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.qual-cyclebar > strong {
    font-family: var(--font-display);
    font-size: 0.9rem;
    white-space: nowrap;
}

.qual-periods {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.qual-period {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    color: var(--text-soft);
    font-size: 0.84rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.qual-period:hover {
    border-color: var(--accent);
}

.qual-period > strong {
    font-weight: 800;
    white-space: nowrap;
}

.qual-period__stage {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(17, 32, 56, 0.06);
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 900;
}

.qual-period.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.qual-period.is-active .qual-period__stage {
    background: rgba(var(--brand-blue-rgb), 0.16);
    color: var(--accent);
}

.qual-period--annual.is-active {
    border-color: #7322a3;
    background: rgba(143, 44, 201, 0.1);
    color: #7322a3;
}

.qual-period--annual.is-active .qual-period__stage {
    background: rgba(143, 44, 201, 0.14);
    color: #7322a3;
}

/* ---------- Avance y antecedentes, lado a lado ---------- */

.qual-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 11px;
    align-items: start;
}

.qual-progress,
.qual-ledger {
    display: grid;
    gap: 11px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-alt);
}

.qual-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.qual-panel-head > span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.qual-panel-head > strong {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--text);
}

.qual-progress__bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    background: rgba(17, 32, 56, 0.08);
    overflow: hidden;
}

.qual-progress__done { background: var(--green); }
.qual-progress__printed { background: var(--yellow); }

.qual-progress__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.qual-ledger__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.qual-ledger__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
}

.qual-ledger__item > span:last-child {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.qual-ledger__item strong {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.qual-ledger__item small {
    color: var(--text-muted);
    font-size: 0.73rem;
    font-weight: 600;
}

.qual-ledger__dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--muted);
}

.qual-ledger__dot--ok { background: var(--green); }
.qual-ledger__dot--warn { background: var(--yellow); }
.qual-ledger__dot--bad { background: var(--red); }
/* El evento no es merito ni demerito: va en gris, como el hecho neutro que es. */
.qual-ledger__dot--mute { background: var(--muted); }

.qual-ledger__note {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.77rem;
    font-weight: 600;
    line-height: 1.45;
}

@media (max-width: 1180px) {
    .qual-overview {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 780px) {
    .qual-progress__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.qual-kpis,
.qual-evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 10px;
}

/* Sin franja de color a la izquierda: el color lo llevan el rotulo y la cifra,
   que es donde se lee. La franja obligaba ademas a un tono saturado por tarjeta
   y cuatro seguidas parecian un semaforo. */
.qual-kpi {
    --qual-kpi-tone: var(--blue);
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
}

.qual-kpi span {
    min-width: 0;
    color: var(--qual-kpi-tone);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.qual-kpi strong {
    min-width: 0;
    color: var(--qual-kpi-tone);
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.qual-kpi small {
    min-width: 0;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.qual-kpi--green { --qual-kpi-tone: #15803d; }
.qual-kpi--red { --qual-kpi-tone: #c53030; }
.qual-kpi--orange { --qual-kpi-tone: #97690a; }
.qual-kpi--teal { --qual-kpi-tone: #0f766e; }
.qual-kpi--violet { --qual-kpi-tone: #7322a3; }
.qual-kpi--slate { --qual-kpi-tone: var(--text-soft); }

/* Buscador y filtros en UNA linea: en dos ocupaban el doble de alto para
   decir lo mismo, y empujaban la lista -que es lo que se viene a mirar- fuera
   de la primera pantalla. El buscador se estira y los filtros se quedan a la
   derecha con su ancho natural. */
.qual-list-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.qual-list-tools .field-shell {
    flex: 1 1 260px;
    min-width: 200px;
    margin-bottom: 0;
}

.qual-list-tools .worker-request-filters {
    flex: 0 1 auto;
}

.qual-list-head,
.qual-subhead,
.qual-detail-head,
.qual-factor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

/* ---------- Encabezado de la calificacion anual ---------- */

/* Volver y los cuatro pasos del ciclo comparten la primera linea, para que la
   tarjeta de puntaje se quede con el costado derecho del encabezado. */
.qual-detail-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.qual-annual-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
    align-items: start;
    gap: 14px;
}

.qual-kind-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(143, 44, 201, 0.12);
    color: #7322a3;
    font-size: 0.7rem;
    font-weight: 900;
}

.qual-annual-head .qual-detail-id small {
    display: block;
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 600;
}

.qual-annual-head .qual-detail-id small + small {
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* ---------- Los tres informes, para compararlos ---------- */

/* Apilados a lo ancho no se podian mirar juntos, que es justo lo que hay que
   hacer para poner la nota del ano. */
.qual-reports__cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.qual-report-card {
    display: grid;
    gap: 5px;
    align-content: start;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    text-align: left;
    cursor: pointer;
}

.qual-report-card:hover {
    border-color: var(--accent);
}

.qual-report-card.is-open {
    border-color: rgba(var(--brand-blue-rgb), 0.5);
    background: rgba(var(--brand-blue-rgb), 0.05);
}

.qual-report-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.qual-report-card__head strong {
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 800;
}

.qual-report-card__head span {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 900;
}

.qual-report-card__head .is-ok {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

.qual-report-card__head .is-missing {
    background: rgba(240, 177, 0, 0.16);
    color: #97690a;
}

.qual-report-card small {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}

.qual-report__body {
    display: grid;
    gap: 8px;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
}

.qual-report__title {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 1080px) {
    .qual-annual-head {
        grid-template-columns: minmax(0, 1fr);
    }

    .qual-reports__cards {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- Calificacion anual: escala de notas y puntaje ---------- */

/* Las bandas del articulo 15 A ESCALA REAL: el ancho de cada franja es su
   tramo de puntos, no una porcion igual. Asi se ve de un vistazo lo cerca que
   esta de Lista 1, que es lo unico con efecto (ascenso, estimulos). */
.qual-scoreboard {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-alt);
}

.qual-scoreboard__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.qual-scoreboard__head span {
    display: grid;
    gap: 1px;
}

.qual-scoreboard__head small {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.qual-scoreboard__head strong {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--text);
}

.qual-scoreboard__list {
    text-align: right;
}

.qual-scoreboard__list strong {
    font-size: 1rem;
    color: var(--accent);
}

.qual-scoreboard__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.qual-scoreboard__list strong {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(36, 119, 238, 0.13);
    color: #1d4ed8;
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 900;
}

.qual-bands {
    position: relative;
    display: flex;
    height: 9px;
    border-radius: 999px;
    overflow: hidden;
}

.qual-band {
    display: block;
    height: 100%;
}

.qual-band--4 { width: 22.2%; background: rgba(239, 68, 68, 0.55); }
.qual-band--3 { width: 17.8%; background: rgba(249, 115, 22, 0.55); }
.qual-band--2 { width: 38.9%; background: rgba(36, 119, 238, 0.5); }
.qual-band--1 { width: 21.1%; background: rgba(34, 197, 94, 0.6); }

.qual-bands__marker {
    position: absolute;
    top: -3px;
    width: 3px;
    height: 15px;
    border-radius: 2px;
    background: var(--text);
    transform: translateX(-50%);
    transition: left 0.15s ease;
}

.qual-bands__scale {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 800;
}

/* ---------- La escala 1 a 10 ---------- */

.qual-factor--annual .qual-subfactors {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.qual-factor--annual .qual-subfactor {
    display: grid;
    /* Anula la columna de 72 px que la regla general reservaba para el
       <input type="number"> que se elimino: ahi la escala quedaba aplastada. */
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-content: start;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--panel);
}

.qual-subfactor__head {
    display: grid;
    gap: 2px;
}

.qual-subfactor__head strong {
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 800;
}

.qual-subfactor__head small {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.qual-scale {
    display: flex;
    gap: 3px;
}

/* Un boton por nota, teñido con su tramo. Un clic en vez de teclear, y volver
   a tocar la misma nota la quita. */
.qual-cell {
    flex: 1 1 0;
    min-width: 0;
    height: 34px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.qual-cell:hover:not(:disabled) {
    transform: translateY(-1px);
}

.qual-cell:disabled {
    cursor: default;
    opacity: 0.6;
}

.qual-cell--deficiente { background: rgba(239, 68, 68, 0.14); color: #c53030; }
.qual-cell--insuficiente { background: rgba(249, 115, 22, 0.16); color: #c2410c; }
.qual-cell--satisfactorio { background: rgba(240, 177, 0, 0.16); color: #97690a; }
.qual-cell--buena { background: rgba(36, 119, 238, 0.14); color: #1d4ed8; }
.qual-cell--optimo { background: rgba(34, 197, 94, 0.16); color: #15803d; }

/* La nota del ciclo anterior queda marcada con borde punteado: mover dos
   puntos de un ano a otro es lo primero que mira una apelacion. */
.qual-cell.is-previous { border-style: dashed; border-color: currentColor; }

.qual-cell.is-on { color: #fff; }
.qual-cell--deficiente.is-on { background: #c53030; border-color: #c53030; }
.qual-cell--insuficiente.is-on { background: #c2410c; border-color: #c2410c; }
.qual-cell--satisfactorio.is-on { background: #97690a; border-color: #97690a; }
.qual-cell--buena.is-on { background: #1d4ed8; border-color: #1d4ed8; }
.qual-cell--optimo.is-on { background: #15803d; border-color: #15803d; }

.qual-subfactor__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 18px;
}

.qual-subfactor__foot small {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.qual-concept {
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--text-muted);
}

.qual-concept--deficiente { color: #c53030; }
.qual-concept--insuficiente { color: #c2410c; }
.qual-concept--satisfactorio { color: #97690a; }
.qual-concept--buena { color: #1d4ed8; }
.qual-concept--optimo { color: #15803d; }

/* El fundamento solo aparece donde el reglamento lo va a exigir de verdad. */
.qual-reason {
    display: grid;
    gap: 5px;
}

.qual-reason[hidden] {
    display: none;
}

.qual-reason span {
    color: #97690a;
    font-size: 0.72rem;
    font-weight: 800;
}

.qual-form .qual-reason textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(240, 177, 0, 0.5);
    border-radius: 10px;
    background: rgba(240, 177, 0, 0.06);
    color: var(--text);
    font: inherit;
    font-size: 0.8rem;
    line-height: 1.45;
    resize: vertical;
}

.qual-factor--annual .qual-factor-score {
    display: flex;
    align-items: flex-end;
    gap: 14px;
}

.qual-factor--annual .qual-factor-score span {
    display: grid;
    gap: 1px;
    text-align: right;
}

.qual-factor--annual .qual-factor-score small {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.qual-factor--annual .qual-factor-score strong {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.qual-factor--annual .qual-factor-score .is-points {
    color: var(--accent);
}

@media (max-width: 1080px) {
    .qual-factor--annual .qual-subfactors {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- Informe cuatrimestral: apreciacion escrita ---------- */

/* El antecedente va PEGADO al factor que lo usa, en la columna de al lado.
   Antes vivia en un recuadro suelto arriba de todo: habia que leerlo, bajar, y
   redactar de memoria. */
.qual-factor--quarter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    gap: 13px;
    align-items: start;
}

.qual-factor__main {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.qual-factor__evidence {
    display: grid;
    gap: 7px;
    align-content: start;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--panel);
}

.qual-evidence-title {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.qual-evidence-empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.4;
}

.qual-form .qual-appraisal {
    width: 100%;
    min-height: 118px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field, var(--panel));
    color: var(--text);
    font: inherit;
    font-weight: 500;
    line-height: 1.55;
    resize: vertical;
}

.qual-appraisal-count {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
}

/* Fila del antecedente: el chip que copia el texto y, cuando el registro
   antiguo traia calificacion escaneada, el boton que la abre. Van separados
   porque un boton dentro de otro no es HTML valido. */
.qual-chip-row {
    display: flex;
    align-items: stretch;
    gap: 5px;
}

.qual-chip-row .qual-chip {
    flex: 1 1 auto;
    min-width: 0;
}

.qual-chip__file {
    flex: 0 0 auto;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(239, 68, 68, 0.1);
    color: #c53030;
    font-size: 0.68rem;
    font-weight: 900;
    cursor: pointer;
}

.qual-chip__file:hover {
    border-color: #c53030;
}

.qual-chip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--panel-alt);
    color: var(--text-soft);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.qual-chip:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.qual-chip__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--muted);
}

.qual-chip--ok .qual-chip__dot { background: var(--green); }
.qual-chip--warn .qual-chip__dot { background: var(--yellow); }
.qual-chip--bad .qual-chip__dot { background: var(--red); }

.qual-chip__text {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.qual-chip__text strong {
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
}

.qual-chip__text small {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.qual-chip__add {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 900;
    opacity: 0.7;
}

.qual-note {
    margin: 0;
    padding: 11px 12px;
    border: 1px solid rgba(var(--brand-blue-rgb), 0.24);
    border-radius: 12px;
    background: rgba(var(--brand-blue-rgb), 0.05);
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.45;
}

/* ---------- El camino del papel ---------- */

.qual-paper {
    display: grid;
    gap: 11px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-alt);
}

.qual-paper-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.qual-step {
    display: grid;
    gap: 4px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
}

.qual-step.is-done {
    border-color: rgba(34, 197, 94, 0.34);
}

.qual-step__dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.28);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 900;
}

.qual-step.is-done .qual-step__dot {
    background: var(--green);
    color: #fff;
}

.qual-step strong {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.qual-step.is-done strong {
    color: var(--text);
}

.qual-step small {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.4;
}

.qual-scan-drop {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 62px;
    padding: 0 14px;
    border: 1px dashed rgba(var(--brand-blue-rgb), 0.4);
    border-radius: 12px;
    background: rgba(var(--brand-blue-rgb), 0.04);
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
}

.qual-scan-drop:hover {
    border-color: var(--accent);
    background: rgba(var(--brand-blue-rgb), 0.08);
}

.qual-scan-drop svg {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* El input cubre la zona entera para recibir el arrastre, pero invisible: lo
   que se ve es la etiqueta. */
.qual-scan-drop input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.qual-scan-drop.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.qual-scan {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 12px;
    background: rgba(34, 197, 94, 0.07);
}

.qual-scan__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(239, 68, 68, 0.12);
    color: #c53030;
    font-size: 0.62rem;
    font-weight: 900;
}

.qual-scan__meta {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.qual-scan__meta strong {
    color: var(--text);
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qual-scan__meta small {
    color: var(--text-muted);
    font-size: 0.73rem;
}

.qual-scan__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--panel);
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

/* ---------- Calificacion anual ---------- */

.qual-period--annual {
    border-color: rgba(143, 44, 201, 0.42);
}

.qual-reports {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-alt);
}

/* El rotulo del bloque en versalitas, como el resto de los encabezados de
   seccion del menu: el titulo en negrita y a tamano de parrafo competia con el
   nombre de los tres informes, que es lo que hay que leer. */
.qual-reports .qual-subhead {
    align-items: baseline;
}

.qual-reports .qual-subhead h4 {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.qual-reports .qual-subhead span {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 600;
}

.qual-report {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-alt);
    overflow: hidden;
}

.qual-report > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 13px;
    cursor: pointer;
    list-style: none;
}

.qual-report > summary::-webkit-details-marker {
    display: none;
}

.qual-report > summary strong {
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 800;
}

.qual-report > summary span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 900;
}

.qual-report > summary .is-ok {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

.qual-report > summary .is-missing {
    background: rgba(240, 177, 0, 0.16);
    color: #97690a;
}

.qual-report__part {
    display: grid;
    gap: 2px;
    padding: 0 13px 11px;
}

.qual-report__part strong {
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 800;
}

.qual-report__part p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.5;
}

@media (max-width: 1080px) {
    .qual-factor--quarter {
        grid-template-columns: minmax(0, 1fr);
    }

    .qual-paper-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.qual-factor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.qual-list-head h4,
.qual-subhead h4,
.qual-detail-head h3 {
    margin: 0;
    min-width: 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

.qual-list-head small,
.qual-subhead span,
.qual-detail-head small {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.qual-worker-list {
    display: grid;
    gap: 8px;
    max-height: min(70vh, 760px);
    overflow: auto;
    padding-right: 2px;
}

/* Nombre y cargo a la izquierda; a la derecha, en orden, los antecedentes que
   tiene, si esta el escaneado y en que estado va. Las tres columnas de la
   derecha se dimensionan solas para que la del nombre se lleve el resto. */
.qual-worker-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.qual-worker-row:hover,
.qual-worker-row:focus-visible,
.qual-worker-row.is-selected {
    border-color: rgba(37, 99, 235, 0.45);
    background: rgba(37, 99, 235, 0.08);
}

.qual-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(20, 184, 166, 0.14);
    color: #0f766e;
    font-size: 0.82rem;
    font-weight: 900;
}

.qual-worker-main,
.qual-worker-side,
.qual-factor-head > div,
.qual-subfactor > span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.qual-worker-main strong,
.qual-worker-main small,
.qual-worker-side small,
.qual-factor-head strong,
.qual-factor-head small,
.qual-subfactor strong,
.qual-subfactor small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qual-worker-main strong {
    color: var(--text);
    font-size: 0.9rem;
}

.qual-worker-main small,
.qual-worker-side small,
.qual-factor-head small,
.qual-subfactor small {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.qual-worker-tags {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

/* Cada antecedente con su color: el atraso pesa distinto que la capacitacion,
   y en gris todos parecian lo mismo. */
.qual-tag {
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.qual-tag--ok { background: rgba(34, 197, 94, 0.12); color: #15803d; }
.qual-tag--warn { background: rgba(240, 177, 0, 0.14); color: #97690a; }
.qual-tag--bad { background: rgba(239, 68, 68, 0.1); color: #c53030; }

.qual-worker-scan {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 74px;
}

.qual-worker-scan small {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.qual-scan-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: #c53030;
    font-size: 0.7rem;
    font-weight: 900;
}

.qual-worker-row .worker-request-status {
    justify-content: center;
    min-width: 116px;
    text-align: center;
}

.qual-worker-side {
    justify-items: end;
}

@media (max-width: 900px) {
    .qual-worker-row {
        grid-template-columns: 42px minmax(0, 1fr) auto;
    }

    .qual-worker-tags,
    .qual-worker-scan {
        display: none;
    }
}

.qual-doc-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.qual-doc-row {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-alt);
}

.qual-doc-row span,
.qual-doc-row small {
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

.qual-doc-row strong {
    min-width: 0;
    color: var(--text);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.qual-evidence-list,
.qual-form,
.qual-factors {
    display: grid;
    gap: 10px;
}

.qual-evidence-item {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-left: 4px solid #64748b;
    border-radius: 12px;
    background: var(--panel);
}

.qual-evidence-item--merit { border-left-color: #16a34a; }
.qual-evidence-item--demerit { border-left-color: #dc2626; }
.qual-evidence-item--training { border-left-color: #0d9488; }
.qual-evidence-item--atraso,
.qual-evidence-item--lateOnExtra { border-left-color: #f97316; }

.qual-evidence-item time {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 900;
}

.qual-evidence-item div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.qual-evidence-item strong,
.qual-evidence-item small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.qual-evidence-item strong {
    color: var(--text);
    font-size: 0.84rem;
}

.qual-evidence-item small {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.qual-form-grid,
.qual-subfactors {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.qual-form label,
.qual-factor-comment,
.qual-subfactor {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 850;
}

.qual-form input[type="text"],
.qual-form input[type="number"],
.qual-form textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field, var(--panel-alt));
    color: var(--text);
    font: inherit;
}

.qual-form input[type="text"],
.qual-form input[type="number"] {
    min-height: 38px;
    padding: 8px 10px;
}

.qual-form input[type="number"] {
    text-align: center;
    font-weight: 900;
}

.qual-form textarea {
    min-height: 72px;
    padding: 9px 10px;
    resize: vertical;
}

.qual-form input:disabled,
.qual-form textarea:disabled {
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.1);
    cursor: not-allowed;
}

.qual-factor {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-alt);
}

.qual-factor-score {
    display: grid;
    justify-items: end;
    gap: 2px;
    flex: 0 0 auto;
}

.qual-factor-score strong {
    color: var(--accent);
    font-size: 1rem;
}

.qual-factor-score small {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.qual-subfactor {
    grid-template-columns: minmax(0, 1fr) 72px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
}

.qual-subfactor textarea {
    grid-column: 1 / -1;
    min-height: 56px;
}

.qual-agreement,
.qual-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.qual-agreement label {
    display: inline-flex;
    align-items: center;
    width: auto;
    gap: 7px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-alt);
}

.qual-agreement input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.qual-actions .primary-button,
.qual-actions .secondary-button,
.qual-actions .danger-action {
    min-height: 38px;
}

.qual-sync-note {
    padding: 9px 10px;
    border: 1px dashed rgba(37, 99, 235, 0.36);
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 850;
}

@media (max-width: 720px) {
    .qual-cyclebar {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .qual-periods {
        grid-column: 1 / -1;
        grid-template-columns: minmax(0, 1fr);
    }

    .qual-worker-row {
        grid-template-columns: 38px minmax(0, 1fr);
        align-items: start;
    }

    .qual-worker-side {
        grid-column: 2;
        justify-items: start;
    }

    .qual-form-grid,
    .qual-subfactors {
        grid-template-columns: minmax(0, 1fr);
    }

    .qual-evidence-item {
        grid-template-columns: minmax(0, 1fr);
    }

    .qual-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }
}

.information-root {
    display: grid;
    gap: 14px;
}

.information-head {
    margin-bottom: 0;
}

.information-head__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.information-rate {
    gap: 7px;
}

.information-rate svg {
    width: 15px;
    height: 15px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.information-body-panel {
    display: grid;
    gap: 14px;
    align-content: start;
    padding: 14px;
}

.information-editor--readonly p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

/* ---------- Barra de control de la bandeja ---------- */

.information-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.information-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border-radius: 12px;
    background: rgba(var(--brand-blue-rgb), 0.07);
}

.information-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 13px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    cursor: pointer;
}

.information-tab.is-on {
    background: var(--panel);
    color: var(--accent);
    box-shadow: var(--shadow-soft);
}

.information-tab span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(var(--brand-blue-rgb), 0.1);
    font-size: 0.7rem;
    font-weight: 900;
}

.information-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 220px;
    min-width: 180px;
}

.information-search svg {
    position: absolute;
    left: 12px;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}

.information-search input {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px 9px 36px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field, var(--panel));
    color: var(--text);
}

.information-chip-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.information-chip-filter {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--field, var(--panel));
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.information-chip-filter.is-on {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

/* En el compositor la categoria elegida se tinta con SU color, no con el azul
   de la aplicacion: es la misma pastilla que va a ver el trabajador, y verla
   del color definitivo mientras se redacta evita la sorpresa al publicar. */
.information-chip-filter--purple.is-on {
    border-color: #7322a3;
    background: rgba(143, 44, 201, 0.12);
    color: #7322a3;
}

.information-chip-filter--blue.is-on {
    border-color: #1d4ed8;
    background: rgba(36, 119, 238, 0.12);
    color: #1d4ed8;
}

.information-chip-filter--red.is-on {
    border-color: #c53030;
    background: rgba(239, 68, 68, 0.12);
    color: #c53030;
}

.information-chip-filter--green.is-on {
    border-color: #15803d;
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.information-chip-filter--orange.is-on {
    border-color: #c2410c;
    background: rgba(249, 115, 22, 0.13);
    color: #c2410c;
}

/* ---------- Bloque de lectura de la tarjeta ---------- */

.information-card__lead {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.information-card__tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.information-flag {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(143, 44, 201, 0.12);
    color: var(--purple);
    font-size: 0.72rem;
    font-weight: 900;
}

.information-flag--soon {
    background: rgba(36, 119, 238, 0.12);
    color: var(--blue);
}

.information-flag--draft {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-soft);
}

.information-read {
    flex: 0 0 auto;
    display: grid;
    gap: 5px;
    align-content: start;
    width: 168px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field, var(--panel));
}

.information-read__label {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.information-read__value {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.information-read small {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 600;
}

.information-read__bar {
    display: block;
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.28);
    overflow: hidden;
}

.information-read__bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--muted);
}

.information-read--ok .information-read__value { color: #15803d; }
.information-read--ok .information-read__bar span { background: var(--green); }
.information-read--mid .information-read__value { color: #97690a; }
.information-read--mid .information-read__bar span { background: var(--yellow); }
.information-read--low .information-read__value { color: #c53030; }
.information-read--low .information-read__bar span { background: var(--red); }

.information-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.information-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--field, var(--panel));
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 700;
}

.information-chip svg {
    width: 14px;
    height: 14px;
    flex: none;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.information-chip--warn svg { stroke: #97690a; }
.information-chip--soon svg { stroke: var(--blue); }

.information-chip--warn {
    border-color: rgba(240, 177, 0, 0.4);
    background: rgba(240, 177, 0, 0.1);
    color: #97690a;
}

.information-chip--soon {
    border-color: rgba(36, 119, 238, 0.34);
    background: rgba(36, 119, 238, 0.09);
    color: var(--blue);
}

.information-file__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-soft);
    font-size: 0.62rem;
    font-weight: 900;
}

.information-file__badge--pdf { background: rgba(239, 68, 68, 0.12); color: #c53030; }
.information-file__badge--doc { background: rgba(36, 119, 238, 0.12); color: #1d4ed8; }
.information-file__badge--xls { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.information-file__badge--img { background: rgba(143, 44, 201, 0.12); color: #7322a3; }

/* ---------- Compositor ---------- */

.information-composer {
    display: grid;
    gap: 14px;
}

.information-composer__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.information-composer__head h3 {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
}

.information-composer__head p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.information-reach {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(var(--brand-blue-rgb), 0.1);
    color: var(--blue);
    font-size: 0.82rem;
    font-weight: 800;
}

.information-reach.is-empty {
    background: rgba(239, 68, 68, 0.1);
    color: #c53030;
}

.information-composer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.42fr) minmax(280px, 0.58fr);
    gap: 14px;
    align-items: start;
}

.information-composer__main {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.information-field {
    display: grid;
    gap: 6px;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.information-field__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.information-field__row small,
.information-field small {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.information-field input[type="text"],
.information-field input[type="file"],
.information-field input[type="datetime-local"],
.information-field textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field, var(--panel-alt));
    color: var(--text);
    font: inherit;
    font-weight: 500;
}

.information-field input[type="text"],
.information-field input[type="file"] {
    min-height: 42px;
    padding: 9px 11px;
}

.information-field textarea {
    padding: 10px 11px;
    resize: vertical;
    min-height: 128px;
    line-height: 1.5;
}

/* El <input type="file"> del navegador no se puede estilar, asi que se esconde
   dentro de la etiqueta y lo que se ve es la zona de arrastre. El input sigue
   siendo el que abre el selector y el que recibe el arrastre: no hay JavaScript
   supliendo nada. */
.information-drop {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 62px;
    padding: 0 14px;
    border: 1px dashed rgba(var(--brand-blue-rgb), 0.4);
    border-radius: 12px;
    background: rgba(var(--brand-blue-rgb), 0.04);
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.information-drop:hover {
    border-color: var(--accent);
    background: rgba(var(--brand-blue-rgb), 0.08);
}

.information-drop:focus-within {
    border-color: var(--accent);
    outline: 2px solid rgba(var(--brand-blue-rgb), 0.35);
    outline-offset: 2px;
}

.information-drop svg {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Cubre la zona entera para que el arrastre caiga en el input y no en el
   documento, pero invisible: lo que se ve es la etiqueta. */
.information-drop input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.information-drop.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

/* El archivo elegido que todavia no se ha subido: mismo bloque, pero de trazo
   discontinuo, para que se distinga del que ya esta guardado. */
.information-file--pending {
    border-style: dashed;
    border-color: rgba(var(--brand-blue-rgb), 0.34);
    background: rgba(var(--brand-blue-rgb), 0.04);
}

/* ---------- Destinatarios ---------- */

.information-audience {
    display: grid;
    gap: 9px;
    padding: 13px;
    border: 1px solid rgba(var(--brand-blue-rgb), 0.24);
    border-radius: 14px;
    background: rgba(var(--brand-blue-rgb), 0.05);
}

.information-segs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border-radius: 12px;
    background: rgba(var(--brand-blue-rgb), 0.08);
    width: max-content;
    max-width: 100%;
    flex-wrap: wrap;
}

.information-seg {
    min-height: 34px;
    padding: 0 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.information-seg.is-on {
    background: var(--panel);
    color: var(--accent);
    box-shadow: var(--shadow-soft);
}

.information-groups {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.information-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--field, var(--panel));
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.information-group.is-on {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.information-group span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(var(--brand-blue-rgb), 0.12);
    font-size: 0.68rem;
    font-weight: 900;
}

.information-people {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field, var(--panel));
}

.information-person {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 6px 0 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
}

.information-person button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 999px;
    background: rgba(var(--brand-blue-rgb), 0.18);
    color: inherit;
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
}

.information-people input {
    flex: 1 1 160px;
    min-width: 130px;
    min-height: 32px;
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
}

.information-note {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
}

.information-note--warn {
    color: #97690a;
}

/* ---------- Interruptores de envio ---------- */

.information-options {
    display: grid;
    gap: 7px;
}

.information-option {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-alt);
    text-align: left;
    cursor: pointer;
}

.information-option.is-on {
    border-color: rgba(var(--brand-blue-rgb), 0.32);
    background: rgba(var(--brand-blue-rgb), 0.06);
}

.information-switch {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    width: 38px;
    height: 22px;
    padding: 2px;
    margin-top: 1px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.42);
    transition: background 0.15s ease;
}

.information-switch span {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(17, 32, 56, 0.28);
    transition: transform 0.15s ease;
}

.information-option.is-on .information-switch {
    background: var(--accent);
}

.information-option.is-on .information-switch span {
    transform: translateX(16px);
}

.information-option__text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.information-option__text strong {
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 800;
}

.information-option__text small {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.35;
}

.information-schedule {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 11px;
    border: 1px solid rgba(36, 119, 238, 0.28);
    border-radius: 12px;
    background: rgba(36, 119, 238, 0.06);
}

.information-schedule label {
    display: grid;
    gap: 5px;
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 800;
}

.information-schedule input {
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--field, var(--panel));
    color: var(--text);
    font: inherit;
    font-size: 0.84rem;
}

.information-send svg {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.information-send {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ---------- Vista previa ---------- */

.information-preview {
    display: grid;
    gap: 10px;
    align-content: start;
    position: sticky;
    top: 12px;
}

.information-live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #15803d;
    font-size: 0.74rem;
    font-weight: 800;
}

.information-live::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--green);
}

.information-preview__phone {
    display: grid;
    gap: 8px;
    padding: 12px 10px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--panel-alt);
}

.information-preview__phonehead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 6px 4px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--text);
}

.information-preview__phonehead span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(36, 119, 238, 0.14);
    color: var(--blue);
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 900;
}

/* La publicada anterior, atenuada: ubica la tarjeta nueva dentro de la lista
   en la que el trabajador la va a encontrar. */
.information-preview__card--dim {
    opacity: 0.5;
    box-shadow: none;
}

.information-preview__card--dim strong {
    font-size: 0.86rem;
}

.information-preview__card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.information-preview__card.is-pinned {
    border-color: rgba(20, 184, 166, 0.46);
}

.information-preview__card strong {
    font-family: var(--font-display);
    font-size: 0.92rem;
    line-height: 1.25;
    color: var(--text);
    overflow-wrap: anywhere;
}

.information-preview__card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.8rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.information-preview__files {
    display: grid;
    gap: 6px;
}

.information-preview__file {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-alt);
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text);
}

.information-preview__file span:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.information-preview__file em {
    padding: 4px 9px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 800;
}

.information-preview__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
}

.information-preview__ack {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
}

/* ---------- Ficha de lectura ---------- */

.information-reader-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(5, 12, 24, 0.55);
    backdrop-filter: blur(6px);
}

.information-reader {
    position: fixed;
    z-index: 9001;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(100%, 720px);
    max-height: min(860px, calc(100vh - 40px));
    overflow: auto;
    display: grid;
    gap: 14px;
    padding: 24px;
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: 0 32px 90px rgba(3, 10, 23, 0.34);
}

.information-reader__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.information-reader__head h3 {
    margin: 7px 0 4px;
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.information-reader__head small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.information-reader__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.information-reader__stat {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.information-reader__stat span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.information-reader__stat strong {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}

.information-reader__stat small {
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 600;
}

.information-reader__stat--ok {
    border-color: rgba(34, 197, 94, 0.34);
    background: rgba(34, 197, 94, 0.08);
}

.information-reader__stat--ok span,
.information-reader__stat--ok strong {
    color: #15803d;
}

.information-reader__stat--warn {
    border-color: rgba(240, 177, 0, 0.42);
    background: rgba(240, 177, 0, 0.1);
}

.information-reader__stat--warn span,
.information-reader__stat--warn strong {
    color: #97690a;
}

.information-reader__bar {
    height: 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.28);
    overflow: hidden;
}

.information-reader__bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--green);
}

.information-reader__list {
    display: grid;
    gap: 7px;
    max-height: 330px;
    overflow: auto;
}

.information-reader__avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 900;
}

.information-reader__avatar--blue { background: rgba(36, 119, 238, 0.14); color: #1d4ed8; }
.information-reader__avatar--purple { background: rgba(143, 44, 201, 0.13); color: #7322a3; }
.information-reader__avatar--teal { background: rgba(20, 184, 166, 0.16); color: #0f766e; }
.information-reader__avatar--orange { background: rgba(249, 115, 22, 0.14); color: #c2410c; }
.information-reader__avatar--muted { background: rgba(148, 163, 184, 0.24); color: var(--text-muted); }

.information-reader__row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-alt);
}

.information-reader__row.is-pending {
    border-color: rgba(240, 177, 0, 0.34);
    background: rgba(240, 177, 0, 0.07);
}

.information-reader__name {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.information-reader__name strong {
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.information-reader__name small {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 600;
}

.information-reader__stamp {
    flex: 0 0 auto;
    color: #15803d;
    font-size: 0.76rem;
    font-weight: 800;
}

.information-reader__row.is-pending .information-reader__stamp {
    color: #97690a;
}

.information-actions .danger-action {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(239, 68, 68, 0.42);
    border-radius: 12px;
    background: transparent;
    color: #c53030;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.information-actions .danger-action:hover {
    border-color: #c53030;
    background: rgba(239, 68, 68, 0.08);
}

.information-editor__actions,
.information-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.information-list {
    display: grid;
    gap: 10px;
}

.information-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-alt);
}

.information-card.is-pinned {
    border-color: rgba(20, 184, 166, 0.46);
    background: rgba(20, 184, 166, 0.08);
}

.information-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.information-card__head h4 {
    margin: 7px 0 4px;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.information-card__head small {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.information-type {
    width: max-content;
}

.information-type--green {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.information-type--blue {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.information-type--orange {
    background: rgba(249, 115, 22, 0.13);
    color: #c2410c;
}

/* Protocolo y Urgente. Sin estas dos, las categorias caian al azul de
   `.worker-request-type` y las cinco etiquetas se veian casi iguales, que es
   justo lo que la categoria viene a evitar. */
.information-type--purple {
    background: rgba(143, 44, 201, 0.12);
    color: #7322a3;
}

.information-type--red {
    background: rgba(239, 68, 68, 0.12);
    color: #c53030;
}

.information-pin {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.16);
    color: #0f766e;
    font-size: 0.72rem;
    font-weight: 900;
}

.information-body {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.information-files {
    display: grid;
    gap: 7px;
}

.information-file {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 7px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--field, var(--panel));
}

.information-file__meta {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.information-file__meta strong,
.information-file__meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.information-file__meta strong {
    color: var(--text);
    font-size: 0.82rem;
}

.information-file__meta small {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.information-file__button,
.information-file__remove {
    border: none;
    border-radius: 10px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
}

.information-file__button {
    background: var(--accent);
    color: #fff;
}

.information-file__button.ghost {
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text-soft);
}

.information-file__remove {
    width: 34px;
    padding: 0;
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
    font-size: 1.15rem;
}

.information-file__button:disabled,
.information-file__remove:disabled {
    opacity: 0.55;
    cursor: wait;
}

@media (max-width: 1080px) {
    .information-composer__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .information-preview {
        position: static;
    }
}

@media (max-width: 760px) {
    .information-card__head {
        flex-direction: column;
    }

    .information-read {
        width: 100%;
    }

    .information-reader__stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .information-schedule {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 620px) {
    .information-file {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .information-file__button {
        grid-column: 2;
    }

    .information-file__button.ghost {
        grid-column: 2;
    }
}

.clockmarks-view {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.clockmarks-sidebar {
    position: sticky;
    top: 18px;
}

.clockmarks-panel {
    display: grid;
    gap: 18px;
    align-content: start;
}

.clockmarks-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
    align-items: center;
    gap: 14px;
}

.clockmarks-topbar .clockmarks-monthbar {
    min-height: 56px;
    margin: 0;
}

.clockmarks-all-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 56px;
    padding: 10px 14px;
    border-radius: 16px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.clockmarks-all-toggle span {
    display: grid;
    gap: 2px;
}

.clockmarks-all-toggle small {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.clockmarks-all-toggle input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.clockmarks-list {
    display: grid;
    gap: 12px;
}

.clockmark-record,
.clockmarks-empty {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 18px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.clockmark-record--warning {
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(245, 158, 11, 0.05)),
        var(--panel-alt);
    border-color: rgba(245, 158, 11, 0.34);
}

.clockmark-record--severe {
    background:
        linear-gradient(135deg, rgba(244, 63, 94, 0.13), rgba(244, 63, 94, 0.05)),
        var(--panel-alt);
    border-color: rgba(244, 63, 94, 0.24);
}

.clockmark-record.is-approved {
    border-color: rgba(34, 197, 94, 0.38);
}

.clockmark-record__main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.clockmark-record__main > div:first-child {
    display: grid;
    gap: 2px;
}

.clockmark-record__main strong {
    color: var(--text-strong);
    font-size: 1rem;
}

.clockmark-record__main span,
.clockmark-record__detail,
.clockmarks-empty {
    color: var(--text-muted);
}

.clockmark-record__detail {
    margin: 0;
    font-size: 0.9rem;
}

.clockmark-record__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.clockmark-record__badges span {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(var(--brand-blue-rgb), 0.1);
    color: var(--blue);
    font-size: 0.72rem;
    font-weight: 800;
}

.clockmark-check {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    font-weight: 700;
}

.clockmark-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.clockmark-note {
    display: grid;
    gap: 6px;
}

.clockmark-note span {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.clockmark-note textarea {
    min-height: 74px;
    resize: vertical;
}

.clockmark-documents {
    display: grid;
    gap: 8px;
}

.clockmark-file {
    display: grid;
    gap: 6px;
}

.clockmark-file span {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.clockmark-file input {
    width: 100%;
    min-height: 38px;
}

.worker-request-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(var(--brand-blue-rgb), 0.1);
    color: var(--blue);
    font-size: 0.82rem;
    font-weight: 800;
}

.worker-request-head-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.worker-request-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.worker-request-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-alt);
    color: var(--text-soft);
    font-weight: 800;
}

.worker-request-filter span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    min-height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-muted);
    font-size: 0.76rem;
}

.worker-request-filter.is-active {
    border-color: rgba(var(--brand-blue-rgb), 0.5);
    background: rgba(var(--brand-blue-rgb), 0.1);
    color: var(--blue);
}

.worker-request-list {
    display: grid;
    gap: 10px;
}

.worker-request-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent),
        var(--panel-alt);
}

.worker-request-card__main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
}

.worker-request-card h4 {
    margin: 6px 0 4px;
    color: var(--text-strong);
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.worker-request-card p,
.worker-request-card small {
    display: block;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.45;
}

.worker-request-type,
.worker-request-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 900;
}

.worker-request-type {
    background: rgba(var(--brand-blue-rgb), 0.1);
    color: var(--blue);
}

.worker-request-status--pending {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

.worker-request-status--accepted {
    background: rgba(34, 197, 94, 0.14);
    color: #16a34a;
}

.worker-request-status--completed {
    background: rgba(20, 184, 166, 0.14);
    color: #0f766e;
}

.worker-request-status--rejected,
.worker-request-status--canceled {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.worker-request-status--expired {
    background: rgba(100, 116, 139, 0.16);
    color: #475569;
}

.worker-request-card__meta {
    display: grid;
    justify-items: end;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.worker-request-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.worker-request-documents {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.worker-request-document {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
}

.worker-request-document > span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-weight: 700;
}

.worker-request-document__actions {
    display: flex;
    flex: none;
    gap: 6px;
}

.worker-request-reject-note {
    margin-top: 8px !important;
    color: #dc2626 !important;
    font-weight: 700;
}

.worker-request-footnote {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.worker-request-textarea {
    display: grid;
    gap: 8px;
    margin: 16px 0 18px;
}

.worker-request-textarea span {
    color: var(--text-soft);
    font-weight: 800;
}

.worker-request-textarea textarea {
    min-height: 110px;
    resize: vertical;
}

.audit-feed__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px;
}

.audit-feed__head h4 {
    margin: 0;
    color: var(--text-strong);
}

.audit-feed__head span {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.audit-entry {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-alt);
    cursor: pointer;
    transition:
        border-color 0.16s ease,
        background 0.16s ease,
        opacity 0.16s ease;
}

.audit-entry:hover,
.audit-entry.is-expanded {
    border-color: rgba(var(--brand-blue-rgb), 0.34);
    background: var(--panel);
}

.audit-entry.is-canceled {
    opacity: 0.72;
}

.audit-entry.is-canceled strong,
.audit-entry.is-canceled p,
.audit-entry.is-canceled > small {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: rgba(239, 68, 68, 0.72);
}

.audit-entry__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.audit-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 900;
}

.audit-entry time,
.audit-entry small {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.audit-entry strong {
    color: var(--text-strong);
}

.audit-entry__canceled {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    font-size: 0.82rem;
    font-weight: 800;
}

.audit-entry__canceled span {
    color: inherit;
    font-weight: 700;
}

.audit-entry__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.audit-entry__actions small {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.audit-entry p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.45;
}

.medical-chart-card {
    display: grid;
    gap: 14px;
    margin-top: 16px;
    padding: 16px;
    border-radius: 18px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.medical-chart-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.medical-chart-head h4 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.medical-chart-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.medical-chart-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, auto));
    gap: 8px;
    min-width: 260px;
}

.medical-chart-summary span {
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--field);
    border: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.medical-chart-summary strong {
    color: var(--text);
}

.medical-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.medical-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.medical-chart-legend i {
    display: inline-block;
    width: 14px;
    height: 10px;
    border-radius: 999px;
}

.medical-color-license,
.medical-stack--license {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.medical-color-professional,
.medical-stack--professional {
    background: linear-gradient(135deg, #2563eb, #60a5fa);
}

.medical-line-average {
    height: 3px !important;
    background: #f97316;
}

.medical-line-mode {
    height: 3px !important;
    background: #22c55e;
}

.medical-chart-bars {
    display: flex;
    align-items: end;
    gap: 8px;
    min-height: 240px;
    overflow-x: auto;
    padding: 14px 4px 4px;
    border-radius: 16px;
    background: var(--calendar-empty);
    border: 1px solid var(--border);
}

.medical-chart-month {
    flex: 0 0 34px;
    display: grid;
    grid-template-rows: minmax(170px, 1fr) auto;
    align-items: end;
    gap: 8px;
    min-height: 220px;
}

.medical-chart-bar {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: end;
    width: 100%;
    height: 100%;
    min-height: 170px;
    border-radius: 10px 10px 4px 4px;
    background: var(--timeline-empty);
    border: 1px solid var(--border);
}

.medical-stack {
    display: block;
    width: 100%;
    min-height: 0;
}

.medical-ref {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    transform: translateY(1px);
    z-index: 2;
}

.medical-ref--average {
    background: #f97316;
}

.medical-ref--mode {
    background: #22c55e;
}

.medical-chart-month small {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    justify-self: center;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: capitalize;
}

#swapPanel select {
    margin-bottom: 12px;
}

.swap-profile-viewer {
    display: block;
    width: 100%;
}

.swap-profile-viewer .profile-viewer__field {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 46px;
    border-radius: var(--radius-sm);
    background: var(--field);
}

.swap-profile-viewer .profile-viewer__field input {
    font-weight: 700;
}

.swap-monthbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin: -4px 0 18px;
}

.swap-month-trigger {
    appearance: none;
    min-width: 170px;
    padding: 4px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    text-align: center;
    font-size: clamp(0.98rem, 1.55vw, 1.28rem);
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease;
}

.swap-month-trigger:hover,
.swap-month-trigger:focus-visible {
    background: rgba(var(--brand-blue-rgb), 0.1);
    color: var(--accent);
    outline: none;
}

.swap-month-button {
    min-width: 42px;
    height: 38px;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font-size: 1.4rem;
    font-weight: 900;
}

.swap-month-button:hover {
    background: var(--panel-hover);
}

.swap-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.swap-row--selector-only {
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 14px;
}

.mini-wrap {
    padding: 12px;
    border-radius: 16px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.mini-wrap label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: minmax(42px, auto);
    gap: 6px;
}

.mini-day {
    min-height: 42px;
    padding: 6px 4px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.8rem;
    user-select: none;
}

.mini-day span {
    color: inherit;
    font-weight: 900;
    line-height: 1;
}

.mini-day small {
    font-size: 0.68rem;
    color: inherit;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.mini-spacer {
    visibility: hidden;
    pointer-events: none;
}

.mini-on {
    background: rgba(34, 197, 94, 0.18);
    color: #63d98f;
    cursor: pointer;
}

.mini-on.mini-turn-larga {
    border-color: rgba(34, 197, 94, 0.9);
    background: linear-gradient(135deg, #17a34a, #27c76f);
    color: #fff;
    box-shadow: 0 8px 18px rgba(34, 197, 94, 0.16);
}

.mini-on.mini-turn-noche {
    border-color: rgba(29, 108, 255, 0.92);
    background: linear-gradient(135deg, #1d6cff, #2788ff);
    color: #fff;
    box-shadow: 0 8px 18px rgba(29, 108, 255, 0.16);
}

.mini-off {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
}

body.theme-light .mini-off {
    background: rgba(17, 32, 56, 0.04);
}

.mini-selected {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    cursor: pointer;
}

.mini-selected.mini-turn-larga {
    border-color: rgba(12, 74, 35, 0.56);
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.72),
        0 0 0 3px rgba(34, 197, 94, 0.32);
}

.mini-selected.mini-turn-noche {
    border-color: rgba(30, 64, 175, 0.58);
    background: linear-gradient(135deg, #1d4ed8, #1d6cff);
    color: #fff;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.72),
        0 0 0 3px rgba(29, 108, 255, 0.32);
}

#saveSwapBtn {
    grid-column: 1 / -1;
}

.swap-item {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    color: var(--text-soft);
}

.swap-item.is-canceled {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    opacity: 0.72;
    background: var(--calendar-disabled);
}

.empty-state {
    padding: 18px;
    border-radius: 16px;
    border: 1px dashed var(--border-strong);
    color: var(--text-muted);
    text-align: center;
    background: var(--calendar-empty);
}

.empty-state--compact {
    padding: 22px 16px;
}

body.mode-active .day.mpa-enabled {
    cursor: pointer;
    border-color: rgba(var(--brand-blue-rgb), 0.26);
    box-shadow: inset 0 0 0 1px rgba(var(--brand-blue-rgb), 0.1);
}

body.mode-active .day.mpa-enabled:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 18px 28px rgba(var(--brand-blue-rgb), 0.24);
    border-color: rgba(var(--brand-blue-rgb), 0.4);
}

body.mode-active .day.draft-selected {
    box-shadow:
        inset 0 0 0 2px rgba(var(--brand-blue-rgb), 0.34),
        0 18px 28px rgba(var(--brand-blue-rgb), 0.18);
}

/* Dia anterior al ingreso de quien llego por TRASPASO. Hasta esa fecha la
   persona era de otra unidad y su calendario de esos dias vive alla: cargarle
   turnos aqui la pondria trabajando en dos unidades el mismo dia. El bloqueo
   esta en el codigo (clickDia y la edicion directa); esto es para que se vea
   antes de apretar. */
.day.day-before-unit-entry {
    background:
        repeating-linear-gradient(
            135deg,
            transparent 0 7px,
            rgba(148, 163, 184, 0.16) 7px 14px
        ),
        var(--calendar-disabled);
    color: var(--text-muted);
    cursor: not-allowed;
}

.day.day-before-unit-entry:hover {
    transform: none;
    box-shadow: none;
}

.day.mpa-disabled {
    background: var(--calendar-disabled) !important;
    color: var(--text-muted) !important;
    border-color: var(--border) !important;
    opacity: 0.72;
    filter: grayscale(1) saturate(0.25);
    cursor: not-allowed;
    box-shadow: none !important;
}

.day.mpa-disabled:hover {
    transform: none;
    border-color: var(--border) !important;
    box-shadow: none !important;
}

body.calendar-direct-edit-off:not(.mode-active) .calendar-panel .day:not(.turn-change-day):not(.needs-replacement):not(.needs-extra-reason):not(.contract-error-day) {
    cursor: default;
}

.day.mpa-disabled:not(.today)::before,
.day.mpa-disabled::after {
    display: none;
}

.day.mpa-disabled .day-number,
.day.mpa-disabled .day-label {
    color: var(--text-muted) !important;
}

/* Perfil inactivo: los turnos que alcanzo a trabajar SIGUEN VIENDOSE, con su
   color, pero oscurecido y casi gris. Antes se desteñian hasta perder el color
   -no se distinguia una Larga de una Noche- y eso es justamente lo que hay que
   poder leer de un perfil que se fue. */
.day.inactive-profile-day {
    cursor: not-allowed;
    opacity: 1;
    filter: grayscale(0.62) brightness(0.72) contrast(1.05);
}

@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
    .pwa-install-button {
        display: none !important;
    }
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--scrollbar);
}

::-webkit-scrollbar-track {
    background: transparent;
}

@media (min-width: 1321px) and (max-height: 1080px) {
    body {
        font-size: 0.86rem;
    }

    .app-shell {
        padding: 8px;
    }

    .topbar {
        gap: 10px;
        padding: 0 2px 6px;
    }

    .brand {
        gap: 8px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .brand-mark.brand-mark--wide {
        width: 210px;
        height: 42px;
    }

    .brand-copy strong {
        font-size: clamp(1.08rem, 1.28vw, 1.48rem);
    }

    .brand-copy span {
        font-size: 0.68rem;
    }

    .topbar-actions {
        gap: 8px;
    }

    .topbar .profile-viewer {
        gap: 6px;
        font-size: 0.72rem;
    }

    .topbar .profile-viewer__field {
        min-width: 190px;
        max-width: 230px;
        height: 30px;
        border-radius: 10px;
    }

    .topbar .profile-viewer__field input {
        padding-inline: 8px;
        font-size: 0.72rem;
    }

    .topbar .profile-viewer__button {
        width: 30px;
    }

    .theme-switch,
    .icon-button,
    .user-chip {
        height: 30px;
    }

    .theme-switch {
        gap: 5px;
        padding: 0 7px;
    }

    .icon-button {
        width: 30px;
        border-radius: 9px;
    }

    .user-chip {
        padding: 0 9px;
        font-size: 0.72rem;
    }

    .user-avatar {
        width: 22px;
        height: 22px;
    }

    .app-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        margin-top: 7px;
    }

    .profile-view-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .dashboard {
        gap: 8px;
    }

    .sidebar {
        --sidebar-sticky-top: 8px;
        --sidebar-viewport-gap: 16px;
        padding: 10px;
    }

    .panel-title {
        margin-bottom: 8px;
        font-size: 0.78rem;
    }

    .field-shell {
        margin-bottom: 7px;
    }

    input,
    select,
    textarea {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .profile-list {
        gap: 5px;
    }

    .profile-item {
        gap: 7px;
        padding: 7px 9px;
        border-radius: 11px;
    }

    .profile-item__avatar {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .profile-item__content strong {
        font-size: 0.74rem;
    }

    .profile-item__content span {
        font-size: 0.64rem;
    }

    .actionbar {
        padding: 4px;
        gap: 4px;
        border-radius: 16px;
    }

    .nav-tile {
        min-height: 40px;
        gap: 3px;
        border-radius: 11px;
    }

    .nav-icon {
        width: 17px;
        height: 17px;
    }

    .nav-tile span {
        font-size: 0.522rem;
        white-space: nowrap;
    }

    .calendar-panel,
.leave-panel,
.availability-panel,
.hours-panel,
.hours-charts-panel,
.hhee-records-panel,
.turnos-side-panel,
.timeline-panel,
.swap-panel,
.worker-requests-panel,
.memos-panel,
.informations-panel,
.medical-equipment-panel,
.qualifications-panel,
.agenda-panel,
.audit-log-panel {
        padding: 10px;
        border-radius: 16px;
    }

    .primary-grid {
        gap: 8px;
    }

    body[data-active-view="turnos"] .primary-grid {
        grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.92fr);
    }

    .stacked-panels,
    body[data-active-view="turnos"] .stacked-panels {
        gap: 8px;
    }

    body[data-active-view="turnos"] .stacked-panels {
        grid-template-columns: minmax(210px, 0.7fr) minmax(0, 1fr);
    }

    .section-head {
        gap: 7px;
        margin-bottom: 7px;
    }

    .section-icon,
    .legend-dot {
        width: 16px;
        height: 16px;
    }

    .section-head h3 {
        font-size: 0.8rem;
        line-height: 1.05;
    }

    .calendar-header {
        grid-template-columns: minmax(0, 1fr) 28px minmax(144px, 220px) 28px minmax(0, 1fr);
        gap: 8px;
        margin-bottom: 7px;
    }

    .calendar-rotation-button {
        min-height: 28px;
        padding: 0 9px;
        font-size: 0.62rem;
    }

    .calendar-month-trigger {
        font-size: clamp(0.98rem, 1.12vw, 1.22rem);
    }

    .calendar-header .icon-button {
        width: 28px;
        height: 28px;
        border-radius: 9px;
    }

    .weekdays {
        gap: 5px;
        margin-bottom: 5px;
        font-size: 0.64rem;
    }

    .grid {
        gap: 5px;
    }

    .day {
        min-height: clamp(44px, 5.45vh, 52px);
        padding: 6px;
        border-radius: 10px;
        gap: 3px;
    }

    .day-number {
        font-size: 0.74rem;
    }

    .day-label {
        font-size: 0.62rem;
    }

    .day-badge {
        min-width: 15px;
        min-height: 15px;
        padding: 1px 4px;
        font-size: 0.48rem;
    }

    .day.replacement-day .day-badge {
        min-height: 14px;
        padding: 1px 4px;
        font-size: 0.42rem;
        letter-spacing: 0.02em;
    }

    .legend-list {
        gap: 5px;
    }

    .legend-action {
        gap: 6px;
        padding: 7px 8px;
        border-radius: 10px;
        font-size: 0.66rem;
        line-height: 1.1;
    }

    .legend-action span:last-child {
        white-space: nowrap;
    }

    .timeline-shell {
        --timeline-hhee-day-left: 116px;
        --timeline-hhee-night-left: 194px;
    }

    .timeline-table th {
        padding: 5px 4px;
        font-size: 0.6rem;
    }

    .timeline-name-head,
    .namecol {
        padding: 6px 8px !important;
        font-size: 0.66rem;
    }

    .timeline-hhee-head,
    .timeline-hhee {
        padding-inline: 6px;
        font-size: 0.64rem;
    }

    .mini {
        min-width: 17px;
        height: 20px;
    }
}

@media (max-width: 1320px) {
    .profile-layout,
    .profile-records-grid {
        grid-template-columns: 1fr;
    }

    .profile-side-column {
        grid-column: auto;
        grid-row: auto;
        top: 12px;
        width: 100%;
    }

    .profile-actions-card {
        justify-self: stretch;
        width: 100%;
        min-width: 0;
    }

    .overview-card__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .audit-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .overview-actions {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .actionbar {
        grid-template-columns: repeat(16, minmax(0, 1fr));
        gap: 4px;
    }

    .nav-tile {
        min-height: 56px;
        padding: 6px 3px;
        gap: 4px;
    }

    .nav-icon {
        width: 21px;
        height: 21px;
    }

    .nav-tile span {
        font-size: 0.594rem;
    }

    .secondary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .app-grid {
        grid-template-columns: 1fr;
    }

    .profile-view-layout {
        grid-template-columns: 1fr;
    }

    .turn-changes-view,
.hours-view,
.reports-view,
.agenda-view,
.clockmarks-view,
.hhee-overview-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .primary-grid {
        grid-template-columns: 1fr;
    }

    body[data-active-view="turnos"] .primary-grid,
    body[data-active-view="turnos"] .stacked-panels {
        grid-template-columns: 1fr;
    }

    .kanban-head,
    .kanban-form {
        grid-template-columns: 1fr;
    }

    .task-assignment-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .task-assignment-controls {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .task-assignment-toolbar {
        justify-content: flex-start;
        padding-left: 0;
        padding-top: 10px;
        border-left: 0;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 860px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .pwa-install-button span {
        display: none;
    }

    .pwa-install-button {
        width: 42px;
        padding: 0;
    }

    .pwa-install-gate-button {
        width: auto;
        padding: 0 15px;
    }

    .pwa-install-gate-button span {
        display: inline;
    }

    .topbar .profile-viewer {
        flex: 1 1 100%;
        justify-content: flex-end;
    }

    .topbar .profile-viewer__field {
        flex: 0 1 320px;
        max-width: 100%;
    }

    .medical-chart-head,
.clockmarks-header,
.clockmark-record__main,
.applicant-toolbar,
.staffing-weekly-filters,
.task-assignment-view-filters,
.task-assignment-dialog__filters,
.kanban-board,
.agenda-form-grid,
.report-preview-heading,
.report-worker-data-grid,
.overview-card__grid,
.contract-history-grid,
.profile-form-grid,
.record-form,
.profile-editor__grid,
.hhee-chart-controls,
.medical-chart-summary,
.audit-summary-grid,
.staff-grid,
.actionbar,
.summary-grid,
body[data-active-view="profile"] .stacked-panels,
body[data-active-view="turnos"] .stacked-panels,
.applicant-form,
.applicant-card__meta,
.applicant-card__notes,
.swap-row {
        grid-template-columns: 1fr;
    }

    .metric-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .metric-row--field {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .replacement-dialog-toolbar {
        grid-template-columns: 1fr;
    }

    .worker-request-card__main,
    .clockmark-record__main,
    .memo-documents,
    .worker-request-actions {
        grid-template-columns: 1fr;
    }

    .worker-request-card__meta {
        justify-items: start;
    }

    .clockmarks-header,
    .clockmark-record__main {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .clockmark-record__badges {
        justify-content: flex-start;
    }

    .worker-request-actions {
        display: grid;
    }

    .metric-input input {
        max-width: none;
    }

    .calendar-header {
        grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr) 36px minmax(0, 1fr);
    }

    .calendar-rotation-button {
        grid-column: 5;
        justify-self: end;
        min-height: 30px;
        padding: 0 10px;
        font-size: 0.66rem;
    }

    .calendar-profile-viewer {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .calendar-profile-viewer .profile-viewer__field {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .app-shell {
        padding: 14px;
    }

    .panel,
.card,
.sidebar,
.calendar-panel,
.leave-panel,
.availability-panel,
.hours-panel,
.timeline-panel,
.task-assignment-panel,
.swap-panel,
.overview-card {
        border-radius: 20px;
    }

    .topbar-actions,
    .brand {
        gap: 10px;
    }

    .topbar .profile-viewer {
        justify-content: stretch;
    }

    .topbar .profile-viewer label {
        display: none;
    }

    .topbar .profile-viewer__field {
        flex: 1 1 100%;
        min-width: 0;
    }

    .user-chip {
        width: 100%;
        justify-content: center;
    }

    .day {
        min-height: 68px;
        padding: 10px;
    }

    .day-number {
        font-size: 0.95rem;
    }

    .day-label {
        font-size: 0.8rem;
    }

    .weekdays {
        gap: 6px;
        font-size: 0.8rem;
    }

    .grid {
        gap: 6px;
    }

    .timeline-table {
        min-width: 100%;
    }

    .hhee-worker-row {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .hhee-worker-row small {
        text-align: left;
    }
}

@media (max-width: 860px) {
    body {
        overflow-x: hidden;
    }

    .app-shell {
        max-width: 100%;
    }

    .actionbar {
        display: flex;
        grid-template-columns: none;
        gap: 8px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .actionbar::-webkit-scrollbar,
    .profile-list::-webkit-scrollbar {
        display: none;
    }

    .nav-tile {
        flex: 0 0 92px;
        min-height: 64px;
        padding: 8px 6px;
        scroll-snap-align: start;
    }

    .nav-icon {
        width: 24px;
        height: 24px;
    }

    .nav-tile span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.702rem;
    }
}

@media (max-width: 760px) {
    body {
        padding-bottom: calc(86px + env(safe-area-inset-bottom));
    }

    body::before,
    body::after {
        opacity: 0.28;
    }

    .app-shell {
        padding: 10px;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 50;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin: -10px -10px 10px;
        padding: 10px;
        background: var(--bg-top);
        background:
            linear-gradient(180deg, var(--bg-top), color-mix(in srgb, var(--bg-top) 72%, transparent));
        backdrop-filter: blur(18px);
    }

    .brand {
        min-width: 0;
        gap: 10px;
    }

    .brand-mark {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .brand-mark.brand-mark--wide {
        width: clamp(170px, 36vw, 240px);
        height: 44px;
    }

    .brand-mark svg {
        width: 23px;
        height: 23px;
    }

    .brand-copy {
        min-width: 0;
    }

    .brand-copy strong {
        font-size: 1.2rem;
        white-space: nowrap;
    }

    .brand-copy span {
        display: none;
    }

    .topbar-actions {
        margin-left: auto;
        flex: 0 0 auto;
        justify-content: flex-end;
        gap: 8px;
    }

    .topbar .profile-viewer {
        display: none;
    }

    .theme-switch {
        width: 48px;
        padding: 0 6px;
        justify-content: center;
    }

    .theme-switch__icon {
        display: none;
    }

    .theme-switch__track {
        width: 34px;
        height: 20px;
    }

    .theme-switch__thumb {
        width: 14px;
        height: 14px;
    }

    body.theme-dark .theme-switch__thumb {
        transform: translateX(14px);
    }

    .user-chip {
        width: auto;
        height: 38px;
        padding: 0 6px;
    }

    .user-chip > span:last-child {
        display: none;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    .icon-button {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .app-grid {
        display: block;
        margin-top: 10px;
    }

    .panel,
    .card {
        box-shadow: 0 14px 34px rgba(7, 13, 27, 0.16);
    }

    .sidebar {
        position: static;
        height: auto;
        max-height: none;
        overflow: visible;
        margin-bottom: 12px;
        padding: 14px;
    }

    .sidebar:has(.profile-list) {
        height: auto;
    }

    .panel-title {
        margin-bottom: 12px;
    }

    .field-shell {
        margin-bottom: 10px;
    }

    .sidebar-toggle {
        margin: 10px 0 12px;
    }

    .profile-list {
        display: flex;
        gap: 8px;
        margin: 0 -4px;
        padding: 0 4px 2px;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .profile-item {
        flex: 0 0 min(78vw, 240px);
        scroll-snap-align: start;
    }

    .profile-item__avatar {
        width: 38px;
        height: 38px;
    }

    .dashboard {
        gap: 12px;
    }

    .actionbar {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        z-index: 70;
        padding: 8px;
        border-radius: 22px;
        border: 1px solid var(--border-strong);
        background: var(--panel);
        background: color-mix(in srgb, var(--panel) 94%, transparent);
        box-shadow: 0 18px 44px rgba(7, 13, 27, 0.32);
        backdrop-filter: blur(20px);
    }

    .nav-tile {
        flex-basis: 76px;
        min-height: 58px;
        border-bottom: 0;
        border-radius: 16px;
        gap: 5px;
    }

    .nav-tile.is-active {
        border-bottom-color: transparent;
        box-shadow: inset 0 0 0 1px rgba(var(--brand-blue-rgb), 0.34);
    }

    .nav-icon {
        width: 21px;
        height: 21px;
    }

    .nav-tile span {
        font-size: 0.612rem;
    }

    .primary-grid,
    .secondary-grid,
    .stacked-panels,
    body[data-active-view="profile"] .stacked-panels {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .overview-card,
.calendar-panel,
.leave-panel,
.availability-panel,
.hours-panel,
.hhee-records-panel,
.timeline-panel,
.swap-panel {
        padding: 14px;
    }

    .overview-card__grid,
    .profile-layout,
    .profile-form-grid,
    .profile-records-grid,
    .record-form,
    .profile-availability-card .availability-list,
    .overview-actions {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .overview-actions {
        grid-column: auto;
    }

    .metric-row--field {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .metric-label {
        font-size: 0.88rem;
    }

    input,
    select {
        min-height: 44px;
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .calendar-header {
        grid-template-columns: 34px minmax(0, 1fr) 34px;
        gap: 8px;
        margin-bottom: 12px;
    }

    .calendar-header #prevBtn {
        grid-column: 1;
    }

    .calendar-header #monthYear {
        grid-column: 2;
    }

    .calendar-header #nextBtn {
        grid-column: 3;
    }

    .calendar-rotation-button {
        grid-column: 1 / -1;
        justify-self: end;
        width: auto;
        max-width: min(100%, 180px);
        min-height: 28px;
        padding: 0 9px;
        font-size: 0.6rem;
    }

    .calendar-month-trigger {
        font-size: 1.15rem;
        line-height: 1.1;
    }

    .weekdays {
        gap: 5px;
        margin-bottom: 8px;
        font-size: 0.72rem;
    }

    .grid {
        gap: 5px;
    }

    .day {
        min-height: clamp(48px, 13vw, 62px);
        padding: 7px;
        border-radius: 12px;
        gap: 4px;
    }

    .day-number {
        font-size: 0.86rem;
    }

    .day-label {
        font-size: 0.68rem;
        line-height: 1;
    }

    .day.weekend::after,
    .day.holiday::after {
        inset: 0;
        border-width: 1px;
        border-radius: inherit;
    }

    .day.today::before {
        top: 3px;
        right: 3px;
        width: 17px;
        height: 17px;
    }

    .mode-banner {
        align-items: stretch;
        padding: 12px;
        font-size: 0.9rem;
    }

    .mode-banner button {
        min-height: 38px;
    }

    .legend-list {
        gap: 6px;
    }

    .legend-action,
    .legend-item {
        padding: 9px 10px;
        border-radius: 12px;
        font-size: 0.86rem;
    }

    .section-icon,
    .legend-dot {
        width: 21px;
        height: 21px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-card,
.availability-item,
.staff-grid > div,
.mini-wrap,
.swap-item {
        border-radius: 14px;
    }

    .timeline-shell,
.hours-charts-panel,
.swap-panel {
        overflow-x: auto;
    }

    .timeline-table th {
        padding: 8px 5px;
        font-size: 0.72rem;
    }

    .timeline-table td {
        font-size: 0.75rem;
    }

    .timeline-name-head,
    .namecol {
        padding: 8px 10px !important;
    }

    .timeline-hhee-head,
    .timeline-hhee {
        padding-inline: 8px;
    }

    .mini {
        min-width: 20px;
        height: 24px;
    }

    .swap-monthbar {
        gap: 10px;
        margin-bottom: 12px;
    }

    .swap-month-trigger {
        min-width: 0;
        flex: 1;
        font-size: 0.98rem;
    }

    .swap-month-button {
        min-width: 36px;
        height: 34px;
    }

    .mini-grid {
        grid-auto-rows: minmax(36px, auto);
    }

    .mini-day {
        min-height: 36px;
        border-radius: 10px;
        font-size: 0.72rem;
    }

    .mini-day small {
        font-size: 0.58rem;
    }
}

@media (max-width: 420px) {
    .app-shell {
        padding-inline: 8px;
    }

    .topbar {
        margin-inline: -8px;
        padding-inline: 8px;
    }

    .brand-copy strong {
        max-width: 96px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .theme-switch {
        display: none;
    }

    .actionbar {
        left: 8px;
        right: 8px;
    }

    .nav-tile {
        flex-basis: 68px;
        min-height: 54px;
    }

    .nav-tile span {
        font-size: 0.567rem;
    }

    .calendar-panel,
.leave-panel,
.availability-panel,
.hours-panel,
.hhee-records-panel,
.timeline-panel,
.swap-panel,
.worker-requests-panel,
.memos-panel,
.agenda-panel,
.task-assignment-panel,
.overview-card,
.sidebar {
        padding: 12px;
    }

    .day {
        min-height: 44px;
        padding: 5px;
        border-radius: 10px;
    }

    .day-number {
        font-size: 0.78rem;
    }

    .day-label {
        font-size: 0.58rem;
    }

    .weekdays {
        font-size: 0.64rem;
    }

    .legend-action,
    .legend-item {
        font-size: 0.8rem;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1101px) {
    body[data-active-view="turnos"] .primary-grid {
        align-items: start;
    }

    body[data-active-view="turnos"] .calendar-panel {
        display: flex;
        flex-direction: column;
        align-self: start;
        height: var(--turnos-side-panel-height, auto);
        max-height: var(--turnos-side-panel-height, none);
        min-height: 0;
        overflow: hidden;
    }

    body[data-active-view="turnos"] .calendar-panel.has-multiple-badge-days {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    body[data-active-view="turnos"] .calendar-panel .grid {
        flex: 1 1 auto;
        min-height: 0;
        grid-auto-rows: minmax(0, 1fr);
    }

    body[data-active-view="turnos"] .calendar-panel.has-multiple-badge-days .grid {
        flex: 0 0 auto;
        min-height: auto;
        align-items: start;
        grid-auto-rows: auto;
    }

    body[data-active-view="turnos"] .calendar-panel .day {
        min-height: 0;
    }

    body[data-active-view="turnos"] .calendar-panel.has-multiple-badge-days .day {
        min-height: 78px;
        align-self: start;
    }

    /* Aqui pasaba lo mismo: este `min-height: auto` deshacia justo para la
       casilla de dos insignias el piso de 78px que la regla de arriba le da a
       todas, y quedaba mas baja que sus vecinas. La regla se elimino; el piso
       comun ya alcanza, porque el panel lleva `has-multiple-badge-days` en
       cuanto existe una casilla asi. */

    body[data-active-view="turnos"] .stacked-panels {
        align-self: start;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    body[data-active-view="turnos"] .leave-panel {
        align-self: start;
        height: auto;
        width: fit-content;
        max-width: min(100%, 250px);
        padding-inline: 12px;
    }

    body.mode-active[data-active-view="turnos"] .leave-panel {
        max-width: min(100%, 340px);
    }

    body[data-active-view="turnos"] .leave-panel .legend-action {
        width: 100%;
        white-space: nowrap;
    }

    body[data-active-view="turnos"] .turnos-side-panel {
        display: flex;
        flex-direction: column;
        align-self: start;
        height: var(--turnos-side-panel-height, auto);
        max-height: var(--turnos-side-panel-height, none);
        min-height: 0;
        overflow: hidden;
    }
}

@media (max-width: 760px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        padding-bottom: max(14px, env(safe-area-inset-bottom));
    }

    .app-shell,
    .dashboard {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .app-shell {
        padding-top: 0;
    }

    .topbar {
        z-index: 90;
        width: 100vw;
        max-width: 100vw;
        min-width: 0;
        margin-top: 0;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        margin-bottom: 10px;
        box-sizing: border-box;
    }

    body[data-active-view="turnos"] .app-shell {
        padding: 0 4px 10px;
    }

    body[data-active-view="turnos"] .topbar {
        margin-top: 0;
        margin-bottom: 8px;
        padding: 8px;
    }

    body[data-active-view="turnos"] .app-grid {
        margin-top: 8px;
    }

    body[data-active-view="turnos"] .dashboard {
        gap: 8px;
    }

    .mobile-menu-toggle {
        display: grid;
    }

    body.mobile-menu-open .mobile-menu-toggle {
        color: var(--accent);
        background: var(--panel-hover);
        box-shadow: inset 0 0 0 1px rgba(var(--brand-blue-rgb), 0.34);
    }

    .brand-mark.brand-mark--wide {
        width: clamp(132px, 34vw, 180px);
        height: 38px;
    }

    .actionbar {
        position: fixed;
        top: calc(62px + env(safe-area-inset-top));
        left: auto;
        right: 10px;
        bottom: auto;
        z-index: 80;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: min(360px, calc(100vw - 20px));
        max-height: min(72vh, calc(100dvh - 82px));
        padding: 10px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 18px;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-8px) scale(0.98);
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    }

    body.mobile-menu-open .actionbar {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .nav-tile {
        flex: initial;
        min-height: 58px;
        padding: 7px 5px;
        border-bottom: 0;
        border-radius: 14px;
        scroll-snap-align: none;
    }

    .nav-tile--mobile-only {
        display: grid;
    }

    .nav-tile span {
        white-space: normal;
        font-size: 0.594rem;
        line-height: 1.05;
    }

    body[data-active-view="turnos"] .primary-grid,
    body[data-active-view="turnos"] .stacked-panels {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-panel,
    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) #teamTimeline,
    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-shell {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-panel,
    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) #teamTimeline {
        overflow-x: hidden;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-shell {
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-name-head,
    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .namecol {
        left: 0;
        z-index: 8;
        width: 140px;
        min-width: 140px;
        max-width: 140px;
        padding-inline: 6px !important;
        box-shadow: 8px 0 14px rgba(17, 32, 56, 0.08);
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-name-head {
        z-index: 10;
        overflow: visible;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .namecol {
        overflow: hidden;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-filter {
        width: 100%;
        min-width: 0;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-filter__trigger,
    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-filter__select {
        min-height: 30px;
        padding: 5px 7px;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-profile-link {
        display: block;
        width: 100%;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-hhee-label > span {
        display: none;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-hhee-label {
        gap: 0;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-hhee-head,
    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-hhee {
        position: static;
        width: 30px;
        min-width: 30px;
        max-width: 30px;
        padding-inline: 3px;
    }

    :is(body[data-active-view="turnos"], body[data-active-view="timeline"]) .timeline-hhee-icon {
        width: 15px;
        height: 15px;
    }

    .turn-change-dialog-backdrop {
        display: flex;
        align-items: stretch;
        justify-content: center;
        padding: 10px 8px max(10px, env(safe-area-inset-bottom));
        overflow: hidden;
    }

    .replacement-dialog {
        display: flex;
        flex-direction: column;
        width: min(100%, calc(100vw - 16px));
        max-height: calc(100dvh - 20px - env(safe-area-inset-bottom));
        min-height: 0;
        padding: 16px;
        border-radius: 18px;
        overflow: hidden;
    }

    .replacement-dialog > strong {
        flex: 0 0 auto;
        margin-bottom: 8px;
        font-size: 1rem;
    }

    .replacement-dialog > p {
        flex: 0 0 auto;
        margin-bottom: 10px;
        line-height: 1.32;
    }

    .replacement-dialog-toolbar {
        flex: 0 0 auto;
        gap: 8px;
        margin: 4px 0 10px;
    }

    .replacement-dialog-toolbar button {
        min-height: 38px;
        padding-inline: 10px;
        line-height: 1.18;
    }

    .replacement-options-panel {
        flex: 0 0 auto;
        gap: 10px;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 16px;
    }

    .replacement-option-row,
    .replacement-coverage-exception {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .replacement-segmented {
        grid-template-columns: 1fr;
    }

    .replacement-segment {
        min-height: 34px;
        font-size: 0.8rem;
    }

    .replacement-coverage-button {
        width: 100%;
    }

    .replacement-request-toggle {
        flex: 0 0 auto;
        gap: 10px;
        margin: 2px 0 10px;
        padding: 10px 12px;
        border-radius: 14px;
    }

    .replacement-request-toggle input {
        width: 20px;
        height: 20px;
        min-height: 0;
    }

    .replacement-request-toggle strong {
        font-size: 0.82rem;
    }

    .replacement-preassign-toggle {
        flex: 0 0 auto;
        gap: 10px;
        margin: 2px 0 10px;
        padding: 10px 12px;
        border-radius: 14px;
    }

    .replacement-preassign-toggle strong {
        font-size: 0.82rem;
    }

    .replacement-candidate-list {
        flex: 1 1 auto;
        min-height: 160px;
        max-height: none;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-right: 4px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .replacement-candidate {
        gap: 10px;
        padding: 10px 12px;
        border-radius: 14px;
    }

    .replacement-dialog .turn-change-dialog__actions {
        flex: 0 0 auto;
        margin-top: 10px;
    }

    body[data-active-view="weekly"] .app-shell,
    body[data-active-view="weekly"] .app-grid,
    body[data-active-view="weekly"] .secondary-grid,
    body[data-active-view="weekly"] #staffingWeeklyCalendar,
    body[data-active-view="weekly"] .dashboard {
        overflow: visible;
    }

    body[data-active-view="weekly"] .staffing-weekly-sticky {
        position: static;
        z-index: auto;
    }

    body[data-active-view="weekly"] .staffing-weekly-sticky .staffing-weekly-days {
        display: none;
    }

    body[data-active-view="weekly"] .staffing-weekly-mobile-days {
        position: sticky;
        top: 0;
        z-index: 95;
        align-self: start;
        display: grid;
        gap: 8px;
        margin: -14px -16px 0;
        padding: 8px 16px 10px;
        border-bottom: 1px solid var(--border);
        background: var(--panel-alt);
        box-shadow: 0 12px 20px rgba(17, 32, 56, 0.1);
        grid-template-columns: repeat(7, minmax(150px, 150px));
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        scrollbar-width: none;
    }

    body[data-active-view="weekly"] .staffing-weekly-mobile-days-placeholder {
        display: block;
        height: 0;
    }

    body[data-active-view="weekly"] .staffing-weekly-mobile-days--fixed {
        position: fixed;
        z-index: 120;
        margin: 0;
        box-sizing: border-box;
        border-radius: 0 0 14px 14px;
    }

    body[data-active-view="weekly"] .staffing-weekly-grid {
        grid-template-columns: repeat(7, minmax(150px, 150px));
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
    }

    body[data-active-view="weekly"] .staffing-weekly-mobile-days::-webkit-scrollbar {
        display: none;
    }

    body[data-active-view="weekly"] .staffing-weekly-day,
    body[data-active-view="weekly"] .staffing-weekly-cell {
        min-width: 150px;
    }

    body[data-active-view="turnos"] .calendar-panel {
        padding: 6px;
        border-radius: 14px;
    }

    body[data-active-view="turnos"] .calendar-profile-viewer {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
        margin-bottom: 6px;
        padding: 4px 6px;
        border-radius: 8px;
    }

    body[data-active-view="turnos"] .calendar-profile-viewer > label:not(.calendar-edit-toggle) {
        display: none;
    }

    body[data-active-view="turnos"] .calendar-profile-viewer .profile-viewer__field {
        width: 100%;
        min-width: 0;
        height: 30px;
        border-radius: 8px;
    }

    body[data-active-view="turnos"] .calendar-profile-viewer .profile-viewer__field input {
        padding-inline: 8px;
        font-size: 0.74rem;
    }

    body[data-active-view="turnos"] .calendar-profile-viewer .profile-viewer__button {
        width: 30px;
        height: 30px;
    }

    body[data-active-view="turnos"] .calendar-profile-viewer .profile-viewer__button svg {
        width: 12px;
        height: 12px;
    }

    body[data-active-view="turnos"] .calendar-edit-toggle {
        gap: 5px;
        min-width: 0;
        font-size: 0.58rem;
    }

    body[data-active-view="turnos"] .calendar-edit-switch {
        width: 32px;
        height: 18px;
    }

    body[data-active-view="turnos"] .calendar-edit-switch > span::after {
        width: 14px;
        height: 14px;
        top: 1px;
        left: 1px;
    }

    body[data-active-view="turnos"] .calendar-edit-switch input:checked + span::after {
        transform: translateX(14px);
    }

    body[data-active-view="turnos"] .calendar-header {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
        margin-bottom: 6px;
    }

    body[data-active-view="turnos"] .calendar-header #monthYear {
        grid-column: 1;
        justify-self: stretch;
        width: 100%;
        text-align: center;
    }

    body[data-active-view="turnos"] .calendar-rotation-button {
        grid-column: 2;
        justify-self: end;
        width: auto;
        max-width: min(42vw, 170px);
        min-height: 26px;
        padding: 0 8px;
        font-size: 0.58rem;
    }

    body[data-active-view="turnos"] .calendar-month-trigger {
        font-size: 0.84rem;
        line-height: 1.05;
        letter-spacing: 0;
    }

    body[data-active-view="turnos"] .calendar-header .icon-button {
        display: none;
    }

    body[data-active-view="turnos"] .weekdays {
        gap: 4px;
        margin-bottom: 5px;
        font-size: 0.58rem;
    }

    body[data-active-view="turnos"] .grid {
        gap: 3px;
        touch-action: pan-y;
    }

    body[data-active-view="turnos"] .day {
        min-height: clamp(55px, 17vw, 78px);
        padding: 5px;
        border-radius: 9px;
        gap: 2px;
    }

    body[data-active-view="turnos"] .day:hover {
        transform: none;
    }

    body[data-active-view="turnos"] .day-number {
        font-size: 0.68rem;
    }

    body[data-active-view="turnos"] .day-label {
        font-size: 0.52rem;
        line-height: 1;
    }

    body[data-active-view="turnos"] .day-badge {
        min-width: 14px;
        min-height: 14px;
        padding: 1px 4px;
        font-size: 0.44rem;
    }

    body[data-active-view="turnos"] .day.has-multiple-badges {
        min-height: clamp(66px, 18vw, 80px);
        gap: 2px;
        padding: 5px;
        justify-content: flex-start;
    }

    body[data-active-view="turnos"] .day.has-multiple-badges .day-badges {
        gap: 2px;
    }

    body[data-active-view="turnos"] .day.has-multiple-badges .day-badge {
        min-height: 13px;
        padding: 1px 4px;
        font-size: 0.4rem;
    }

    body[data-active-view="turnos"] .day.replacement-day .day-badge {
        min-height: 13px;
        font-size: 0.38rem;
    }

    body[data-active-view="turnos"] .mobile-panel-toggle {
        display: flex;
    }

    .mobile-panel-toggle {
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        min-height: 48px;
        padding: 0 14px;
        border: 1px solid var(--border-strong);
        border-radius: 14px;
        background: var(--field);
        color: var(--text);
        font-size: 0.94rem;
        font-weight: 800;
        box-shadow: var(--shadow-soft);
    }

    .mobile-panel-toggle svg {
        width: 18px;
        height: 18px;
        transition: transform 0.18s ease;
    }

    body.mobile-leave-open .mobile-leave-toggle svg {
        transform: rotate(180deg);
    }

    body[data-active-view="turnos"]:not(.mobile-leave-open) #leavePanel {
        display: none !important;
    }

    body[data-active-view="turnos"] .leave-panel,
    body[data-active-view="turnos"] .turnos-side-panel {
        padding: 10px;
        border-radius: 14px;
    }

    body[data-active-view="turnos"] .leave-panel .legend-list {
        gap: 6px;
    }

    body[data-active-view="turnos"] .leave-panel .legend-action {
        min-height: 38px;
        padding: 8px 10px;
        border-radius: 11px;
        font-size: 0.78rem;
    }

    body[data-active-view="turnos"] .leave-panel .legend-action span:last-child {
        white-space: normal;
    }

    body[data-active-view="clockmarks"] #clockMarksPanel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 10px;
        overflow-x: hidden;
    }

    body[data-active-view="clockmarks"] .clockmarks-sidebar,
    body[data-active-view="clockmarks"] .clockmarks-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 12px;
        border-radius: 16px;
        overflow-x: hidden;
    }

    body[data-active-view="clockmarks"] .clockmarks-sidebar {
        position: static;
    }

    body[data-active-view="clockmarks"] .clockmarks-sidebar .profile-list {
        display: flex;
        gap: 8px;
        margin: 0 -4px;
        padding: 0 4px 2px;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    body[data-active-view="clockmarks"] .clockmarks-sidebar .profile-item {
        flex: 0 0 min(78vw, 240px);
        scroll-snap-align: start;
    }

    body[data-active-view="clockmarks"] .clockmarks-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        align-items: stretch;
    }

    body[data-active-view="clockmarks"] .clockmarks-all-toggle {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
        min-width: 0;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 14px;
    }

    body[data-active-view="clockmarks"] .clockmarks-all-toggle small {
        font-size: 0.7rem;
        line-height: 1.25;
    }

    body[data-active-view="clockmarks"] .clockmarks-monthbar {
        gap: 8px;
        margin: 0;
        padding: 8px;
        border-radius: 14px;
    }

    body[data-active-view="clockmarks"] .clockmarks-monthbar strong {
        min-width: 0;
        flex: 1 1 auto;
        font-size: 0.86rem;
        line-height: 1.15;
    }

    body[data-active-view="clockmarks"] .clockmarks-monthbar .swap-month-button {
        flex: 0 0 38px;
        width: 38px;
        min-width: 38px;
        height: 36px;
    }

    body[data-active-view="clockmarks"] .clockmarks-list {
        gap: 8px;
    }

    body[data-active-view="clockmarks"] .clockmark-record,
    body[data-active-view="clockmarks"] .clockmarks-empty {
        width: 100%;
        min-width: 0;
        padding: 12px;
        border-radius: 16px;
    }

    body[data-active-view="clockmarks"] .clockmark-record__main {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        align-items: stretch;
    }

    body[data-active-view="clockmarks"] .clockmark-record__main > div:first-child,
    body[data-active-view="clockmarks"] .clockmark-record__main strong,
    body[data-active-view="clockmarks"] .clockmark-record__main span,
    body[data-active-view="clockmarks"] .clockmark-record__detail,
    body[data-active-view="clockmarks"] .clockmark-note,
    body[data-active-view="clockmarks"] .clockmark-documents {
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    body[data-active-view="clockmarks"] .clockmark-record__main strong {
        font-size: 0.94rem;
        line-height: 1.18;
    }

    body[data-active-view="clockmarks"] .clockmark-record__main span,
    body[data-active-view="clockmarks"] .clockmark-record__detail,
    body[data-active-view="clockmarks"] .clockmark-note span,
    body[data-active-view="clockmarks"] .clockmarks-empty {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    body[data-active-view="clockmarks"] .clockmark-record__badges {
        justify-content: flex-start;
        gap: 5px;
    }

    body[data-active-view="clockmarks"] .clockmark-record__badges span {
        padding: 5px 7px;
        font-size: 0.66rem;
        line-height: 1.1;
        white-space: normal;
    }

    body[data-active-view="clockmarks"] .clockmark-check {
        align-items: flex-start;
        gap: 9px;
        font-size: 0.78rem;
        line-height: 1.3;
    }

    body[data-active-view="clockmarks"] .clockmark-check input {
        flex: 0 0 18px;
        min-height: 0;
        margin-top: 1px;
    }

    body[data-active-view="clockmarks"] .clockmark-note textarea {
        min-height: 84px;
        font-size: 0.82rem;
    }

    body[data-active-view="clockmarks"] .attachment-item {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 8px;
    }

    body[data-active-view="clockmarks"] .attachment-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    body[data-active-view="clockmarks"] .attachment-view,
    body[data-active-view="clockmarks"] .attachment-remove {
        width: 100%;
        min-height: 36px;
        padding-inline: 8px;
        font-size: 0.76rem;
    }

    body[data-active-view="log"] #auditLogPanel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 12px;
        overflow-x: hidden;
        padding: 12px;
        border-radius: 16px;
    }

    body[data-active-view="log"] .section-head--with-action {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 12px;
    }

    body[data-active-view="log"] .section-head__title {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
        min-width: 0;
    }

    body[data-active-view="log"] .section-head__title h3 {
        font-size: 1.05rem;
        line-height: 1.1;
        overflow-wrap: anywhere;
    }

    body[data-active-view="log"] .audit-month-filter {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        width: 100%;
        min-width: 0;
        gap: 8px;
        font-size: 0.8rem;
    }

    body[data-active-view="log"] .audit-month-filter input {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        font-size: 0.82rem;
    }

    body[data-active-view="log"] .audit-summary-grid {
        width: 100%;
        min-width: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body[data-active-view="log"] .audit-summary-card {
        min-width: 0;
        min-height: 60px;
        padding: 7px 8px 7px 12px;
        border-radius: 14px;
    }

    body[data-active-view="log"] .audit-summary-card span,
    body[data-active-view="log"] .audit-summary-card small {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    body[data-active-view="log"] .audit-summary-card span {
        font-size: 0.58rem;
        line-height: 1.1;
    }

    body[data-active-view="log"] .audit-summary-card strong {
        font-size: 0.98rem;
    }

    body[data-active-view="log"] .audit-summary-card small {
        font-size: 0.54rem;
        line-height: 1.15;
    }

    body[data-active-view="log"] .audit-feed,
    body[data-active-view="log"] .audit-entry {
        max-width: 100%;
        min-width: 0;
    }

    body[data-active-view="log"] .audit-feed__head {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 4px;
    }

    body[data-active-view="log"] .audit-feed__head h4 {
        font-size: 0.95rem;
    }

    body[data-active-view="log"] .audit-feed__head span {
        font-size: 0.78rem;
        line-height: 1.3;
    }

    body[data-active-view="log"] .audit-entry {
        overflow-wrap: anywhere;
        padding: 12px;
        border-radius: 16px;
    }

    body[data-active-view="log"] .audit-entry__head {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 6px;
    }

    body[data-active-view="log"] .audit-chip {
        width: fit-content;
        max-width: 100%;
        white-space: normal;
        font-size: 0.68rem;
        line-height: 1.15;
    }

    body[data-active-view="log"] .audit-entry time,
    body[data-active-view="log"] .audit-entry small,
    body[data-active-view="log"] .audit-entry p,
    body[data-active-view="log"] .audit-entry__actions small {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    body[data-active-view="log"] .audit-entry strong {
        font-size: 0.9rem;
        line-height: 1.22;
    }

    body[data-active-view="log"] .audit-entry__canceled {
        padding: 10px;
        border-radius: 12px;
        font-size: 0.78rem;
        line-height: 1.35;
    }

    body[data-active-view="log"] .audit-entry__actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        justify-content: stretch;
        gap: 8px;
    }

    body[data-active-view="log"] .audit-entry__actions .secondary-button {
        width: 100%;
        min-height: 38px;
        padding-inline: 10px;
    }

    body[data-active-view="requests"] #workerRequestsPanel,
    body[data-active-view="memos"] #memosPanel,
    body[data-active-view="qualifications"] #qualificationsPanel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
        padding: 12px;
    }

    body[data-active-view="requests"] .section-head--with-action,
    body[data-active-view="memos"] .section-head--with-action,
    body[data-active-view="qualifications"] .section-head--with-action {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 12px;
    }

    body[data-active-view="requests"] .section-head__title,
    body[data-active-view="memos"] .section-head__title,
    body[data-active-view="qualifications"] .section-head__title {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
        min-width: 0;
    }

    body[data-active-view="requests"] .section-head__title h3,
    body[data-active-view="memos"] .section-head__title h3,
    body[data-active-view="qualifications"] .section-head__title h3 {
        font-size: 1.05rem;
        line-height: 1.1;
    }

    body[data-active-view="requests"] .section-head__title small,
    body[data-active-view="memos"] .section-head__title small,
    body[data-active-view="qualifications"] .section-head__title small {
        max-width: 100%;
        color: var(--text-muted);
        font-size: 0.78rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    body[data-active-view="requests"] .worker-request-head-actions,
    body[data-active-view="memos"] .worker-request-head-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        justify-content: stretch;
        width: 100%;
        min-width: 0;
        gap: 8px;
    }

    body[data-active-view="requests"] .audit-month-filter,
    body[data-active-view="memos"] .audit-month-filter {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        width: 100%;
        min-width: 0;
        gap: 8px;
        font-size: 0.8rem;
    }

    body[data-active-view="requests"] .audit-month-filter input,
    body[data-active-view="memos"] .audit-month-filter input {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        font-size: 0.82rem;
    }

    body[data-active-view="requests"] .worker-request-counter,
    body[data-active-view="memos"] .worker-request-counter,
    body[data-active-view="qualifications"] .worker-request-counter {
        justify-content: center;
        width: 100%;
        min-width: 0;
        padding: 7px 10px;
        white-space: normal;
        text-align: center;
        font-size: 0.78rem;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    body[data-active-view="requests"] .worker-request-filters,
    body[data-active-view="memos"] .worker-request-filters,
    body[data-active-view="qualifications"] .worker-request-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        min-width: 0;
    }

    body[data-active-view="requests"] .worker-request-filter,
    body[data-active-view="memos"] .worker-request-filter,
    body[data-active-view="qualifications"] .worker-request-filter {
        justify-content: center;
        min-width: 0;
        min-height: 36px;
        padding: 0 8px;
        border-radius: 14px;
        font-size: 0.78rem;
        line-height: 1.1;
        text-align: center;
        white-space: normal;
    }

    body[data-active-view="requests"] .worker-request-filter span,
    body[data-active-view="memos"] .worker-request-filter span,
    body[data-active-view="qualifications"] .worker-request-filter span {
        flex: 0 0 auto;
    }

    body[data-active-view="requests"] .worker-request-card,
    body[data-active-view="memos"] .worker-request-card {
        min-width: 0;
        padding: 12px;
        border-radius: 16px;
    }

    body[data-active-view="requests"] .worker-request-card__main,
    body[data-active-view="memos"] .worker-request-card__main {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        min-width: 0;
    }

    body[data-active-view="requests"] .worker-request-card__main > *,
    body[data-active-view="memos"] .worker-request-card__main > *,
    body[data-active-view="requests"] .worker-request-card h4,
    body[data-active-view="memos"] .worker-request-card h4,
    body[data-active-view="requests"] .worker-request-card p,
    body[data-active-view="memos"] .worker-request-card p,
    body[data-active-view="requests"] .worker-request-card small,
    body[data-active-view="memos"] .worker-request-card small {
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    body[data-active-view="requests"] .worker-request-card h4,
    body[data-active-view="memos"] .worker-request-card h4 {
        font-size: 0.94rem;
        line-height: 1.18;
    }

    body[data-active-view="requests"] .worker-request-card p,
    body[data-active-view="memos"] .worker-request-card p,
    body[data-active-view="requests"] .worker-request-card small,
    body[data-active-view="memos"] .worker-request-card small,
    body[data-active-view="requests"] .worker-request-footnote,
    body[data-active-view="memos"] .worker-request-footnote {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    body[data-active-view="requests"] .worker-request-card__meta,
    body[data-active-view="memos"] .worker-request-card__meta {
        justify-items: start;
        min-width: 0;
    }

    body[data-active-view="requests"] .memo-documents,
    body[data-active-view="memos"] .memo-documents {
        min-width: 0;
    }

    body[data-active-view="requests"] .memo-file-button,
    body[data-active-view="memos"] .memo-file-button,
    body[data-active-view="requests"] .memo-document-item,
    body[data-active-view="memos"] .memo-document-item,
    body[data-active-view="requests"] .memo-document-button,
    body[data-active-view="memos"] .memo-document-button {
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }
}

/* Auto-pruebas de reglas basicas (solo entorno de pruebas) */
.selftest-fab {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 9998;
    padding: 10px 14px;
    border: none;
    border-radius: 999px;
    background: #7c3aed;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4);
}

.selftest-fab:hover {
    background: #6d28d9;
}

.selftest-fab:disabled {
    opacity: 0.7;
    cursor: default;
}

.selftest-dialog {
    max-width: 560px;
    width: min(560px, 92vw);
}

.selftest-summary {
    font-weight: 600;
    margin: 4px 0 10px;
}

.selftest-summary.is-ok {
    color: #15803d;
}

.selftest-summary.is-fail {
    color: #b91c1c;
}

.selftest-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 52vh;
    overflow-y: auto;
}

.selftest-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #f3f4f6;
    font-size: 13px;
}

.selftest-row.is-fail {
    background: #fef2f2;
}

.selftest-mark {
    font-weight: 700;
}

.selftest-row.is-ok .selftest-mark {
    color: #15803d;
}

.selftest-row.is-fail .selftest-mark {
    color: #b91c1c;
}

.selftest-name {
    flex: 1;
    min-width: 0;
}

.selftest-error {
    width: 100%;
    color: #b91c1c;
    font-size: 12px;
}

/* ============================================================
   Menú lateral (desktop) — el nav pasa de barra superior a
   sidebar vertical a la izquierda del contenido.
   Solo aplica en pantallas anchas; en angostas/móvil se
   conserva el comportamiento existente (barra / menú deslizante).
   ============================================================ */
@media (min-width: 1101px) {
    /* El nav es columna 1 de .app-grid; todo el contenido (.dashboard) es la
       columna 2 como un unico bloque apilado (evita huecos entre paneles). */
    .app-grid {
        grid-template-columns: 220px minmax(0, 1fr);
        align-items: start;
        column-gap: 18px;
    }

    .app-grid > .dashboard {
        grid-column: 2;
        min-width: 0;
    }

    #mainNavigation.actionbar {
        grid-column: 1;
        align-self: start;
        position: sticky;
        top: 18px;
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 12px 10px;
        max-height: calc(100vh - 36px);
        max-height: calc(100dvh - 36px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .actionbar .nav-tile {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 14px;
        width: 100%;
        min-height: 0;
        padding: 12px 15px;
        border-bottom: none;
        border-radius: 14px;
        color: var(--text-soft);
        text-align: left;
    }

    .actionbar .nav-tile .nav-icon {
        width: 22px;
        height: 22px;
        color: var(--text-muted);
    }

    .actionbar .nav-tile span {
        max-width: none;
        font-size: 0.72rem;
        font-weight: 600;
        line-height: 1.25;
        white-space: normal;
        text-align: left;
    }

    .actionbar .nav-tile:not(.is-active):hover {
        background: rgba(139, 92, 246, 0.10);
        color: var(--text);
    }

    .actionbar .nav-tile:not(.is-active):hover .nav-icon {
        color: #7c5cf0;
    }

    .actionbar .nav-tile.is-active {
        color: #fff;
        background: linear-gradient(135deg, #8b5cf6, #6d3bd4);
        border-bottom-color: transparent;
        box-shadow: 0 12px 24px -12px rgba(109, 75, 216, 0.65);
    }

    .actionbar .nav-tile.is-active .nav-icon,
    .actionbar .nav-tile.is-active span {
        color: #fff;
    }

}

/* ============================================================
   Perfiles: búsqueda de trabajador en modal (lupa junto al nombre)
   ============================================================ */
.profile-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.profile-name-cell > input {
    flex: 1;
    min-width: 0;
}
.profile-name-search {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--field);
    color: var(--text-soft);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.profile-name-search:hover {
    color: var(--accent);
    border-color: rgba(var(--brand-blue-rgb), 0.55);
    background: var(--panel-hover);
}
.profile-name-search svg { width: 18px; height: 18px; }

.profile-search-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(6, 12, 22, 0.55);
    backdrop-filter: blur(3px);
    display: grid;
    place-items: start center;
    padding: max(48px, 8vh) 16px 24px;
    overflow-y: auto;
}
.profile-search-modal[hidden] { display: none; }

.profile-search-dialog {
    width: min(520px, 100%);
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-panel);
}
.profile-search-dialog__head {
    display: flex;
    align-items: center;
    gap: 12px;
}
.profile-search-dialog__head strong {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
}
.profile-search-dialog__close {
    margin-left: auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel-alt);
    color: var(--text-soft);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.profile-search-dialog__close:hover { color: var(--danger, #ef4444); }
.profile-search-dialog__controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.profile-search-dialog #profiles {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    max-height: none;
}

/* Reportes: barra con lupa para buscar/cambiar trabajador */
.reports-detail-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--text-soft);
    font-weight: 700;
    font-size: 0.9rem;
}

/* Reportes: encabezado con nombre del trabajador + lupa */
.reports-selected {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}
.reports-selected__name {
    display: flex;
    align-items: center;
    gap: 10px;
}
.reports-selected__name strong {
    font-size: 1.05rem;
    color: var(--text);
}
.reports-selected small { color: var(--text-soft); font-size: 0.85rem; }

/* Reportes: lupa al final del nombre en la tabla del trabajador */
.report-name-value { font-weight: 700; }
.report-name-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    width: 26px;
    height: 26px;
    margin-left: 8px;
    border-radius: 8px;
}
.report-name-search svg { width: 15px; height: 15px; }
@media print {
    .report-name-search { display: none !important; }
}

/* Marcajes: nombre del trabajador visualizado + lupa (bajo el mes) */
.clockmarks-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.clockmarks-selected strong {
    font-size: 1.05rem;
    color: var(--text);
}

/* ============================================================
   Contactos (agenda) — directorio con búsqueda, filtros y detalle
   ============================================================ */
.ag-root { display: flex; flex-direction: column; gap: 16px; }
.ag-root {
    --ag-av-1a:#4b8bf5; --ag-av-1b:#2563eb;
    --ag-av-2a:#14b8a6; --ag-av-2b:#0e918c;
    --ag-av-3a:#a26bf0; --ag-av-3b:#7c46d6;
    --ag-av-4a:#f0913f; --ag-av-4b:#dd6f16;
    --ag-av-5a:#ec5f8a; --ag-av-5b:#d63e6e;
    --ag-av-6a:#38bdf8; --ag-av-6b:#0d8fd1;
    --ag-teal:#0ea5a4; --ag-teal-soft: rgba(14,165,164,0.16);
    --ag-amber:#e08a12; --ag-amber-soft: rgba(224,138,18,0.16);
}

/* Header */
.ag-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ag-title { display: flex; align-items: center; gap: 12px; }
.ag-mk { width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 24px -12px var(--accent); }
.ag-mk svg { width: 22px; height: 22px; }
.ag-title h1 { margin: 0; font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.ag-title p { margin: 2px 0 0; color: var(--text-muted); font-size: 0.82rem; }
.ag-search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-soft); }
.ag-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ag-search svg { width: 19px; height: 19px; color: var(--text-muted); flex: none; }
.ag-search input { border: none; background: none; outline: none; width: 100%; font: inherit; font-size: 0.95rem; color: var(--text); }
.ag-new { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px; border: none; border-radius: 14px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer; box-shadow: 0 14px 28px -14px var(--accent); }
.ag-new svg { width: 18px; height: 18px; }

/* Chips */
.ag-chips-wrap { position: relative; }
.ag-chips { display: flex; gap: 8px; flex-wrap: nowrap; overflow: hidden; }
.ag-chip { flex: none; white-space: nowrap; }
.ag-chip--more { color: var(--accent); border-color: rgba(var(--brand-blue-rgb), 0.35); background: var(--accent-soft); }
.ag-chip--more[hidden] { display: none; }
.ag-more-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 45; width: min(360px, 92vw); padding: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-panel); }
.ag-more-pop[hidden] { display: none; }
.ag-more-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--field); margin-bottom: 8px; }
.ag-more-search svg { width: 17px; height: 17px; color: var(--text-muted); flex: none; }
.ag-more-search input { border: none; background: none; outline: none; width: 100%; font: inherit; font-size: 0.88rem; color: var(--text); }
.ag-more-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.ag-more-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; border-radius: 10px; border: none; background: none; color: var(--text); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; text-align: left; }
.ag-more-item:hover { background: var(--panel-alt); }
.ag-more-item.is-active { background: var(--accent-soft); color: var(--accent); }
.ag-more-item .ag-chip-count { background: var(--panel-alt); color: var(--text-soft); }
.ag-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--text-soft); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.ag-chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ag-chip:hover { border-color: var(--border-strong); color: var(--text); }
.ag-chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ag-chip.is-active .ag-chip-dot { background: rgba(255,255,255,0.85); }
.ag-chip-count { font-size: 0.72rem; font-weight: 800; background: var(--panel-alt); color: var(--text-soft); padding: 1px 6px; border-radius: 999px; }
.ag-chip.is-active .ag-chip-count { background: rgba(255,255,255,0.24); color: #fff; }

/* Grid */
.ag-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.ag-list-panel { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.ag-list-head { display: flex; align-items: baseline; justify-content: space-between; padding: 15px 16px 6px; }
.ag-list-head h2 { margin: 0; font-size: 0.95rem; font-weight: 800; }
.ag-list-head span { color: var(--text-muted); font-size: 0.8rem; }
.ag-list { max-height: 64vh; overflow-y: auto; padding: 4px 8px 10px; }

.ag-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; cursor: pointer; border: 1px solid transparent; }
.ag-item:hover { background: var(--panel-alt); }
.ag-item.is-active { background: var(--accent-soft); border-color: rgba(var(--brand-blue-rgb), 0.32); }
.ag-avatar { width: 44px; height: 44px; border-radius: 13px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 0.9rem; }
.ag-avatar svg { width: 22px; height: 22px; }
.ag-av-1 { background: linear-gradient(135deg, var(--ag-av-1a), var(--ag-av-1b)); }
.ag-av-2 { background: linear-gradient(135deg, var(--ag-av-2a), var(--ag-av-2b)); }
.ag-av-3 { background: linear-gradient(135deg, var(--ag-av-3a), var(--ag-av-3b)); }
.ag-av-4 { background: linear-gradient(135deg, var(--ag-av-4a), var(--ag-av-4b)); }
.ag-av-5 { background: linear-gradient(135deg, var(--ag-av-5a), var(--ag-av-5b)); }
.ag-av-6 { background: linear-gradient(135deg, var(--ag-av-6a), var(--ag-av-6b)); }
.ag-item__body { min-width: 0; flex: 1; }
.ag-item__name { font-size: 0.92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-item__meta { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-item__actions { display: flex; gap: 6px; flex: none; }
.ag-mini { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--panel); color: var(--text-soft); cursor: pointer; }
.ag-mini svg { width: 15px; height: 15px; }
.ag-mini.call:hover { color: var(--ag-teal); border-color: var(--ag-teal); background: var(--ag-teal-soft); }
.ag-mini.mail:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.ag-empty { padding: 26px 16px; text-align: center; color: var(--text-muted); font-size: 0.88rem; }

/* Detail */
.ag-detail { padding: 22px; }
.ag-detail-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 48px 20px; color: var(--text-muted); text-align: center; }
.ag-detail-empty .ag-avatar { width: 60px; height: 60px; }
.ag-detail__top { display: flex; align-items: center; gap: 16px; }
.ag-detail .ag-avatar { width: 66px; height: 66px; border-radius: 18px; font-size: 1.4rem; }
.ag-detail__id { min-width: 0; }
.ag-detail__id h2 { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; }
.ag-tag { display: inline-flex; align-items: center; margin-top: 6px; font-size: 0.78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.ag-detail__unit { margin-top: 6px; color: var(--text-muted); font-size: 0.85rem; display: flex; align-items: center; gap: 6px; }
.ag-detail__unit svg { width: 15px; height: 15px; }

.ag-actions { display: flex; gap: 10px; margin: 20px 0; flex-wrap: wrap; }
.ag-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 15px; border-radius: 12px; font: inherit; font-weight: 700; font-size: 0.86rem; cursor: pointer; border: 1px solid var(--border); text-decoration: none; }
.ag-btn svg { width: 16px; height: 16px; }
.ag-btn--call { background: var(--ag-teal); border-color: var(--ag-teal); color: #fff; }
.ag-btn--mail { background: var(--accent); border-color: var(--accent); color: #fff; }
.ag-btn--ghost { background: var(--panel-alt); color: var(--text); }
.ag-btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }

.ag-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ag-field { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 14px; background: var(--panel-alt); border: 1px solid var(--border); }
.ag-field__ico { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; }
.ag-field__ico svg { width: 18px; height: 18px; }
.ico-mail { background: var(--accent-soft); color: var(--accent); }
.ico-phone { background: var(--ag-teal-soft); color: var(--ag-teal); }
.ico-anexo { background: var(--ag-amber-soft); color: var(--ag-amber); }
.ico-unit { background: var(--panel-hover); color: var(--text-soft); }
.ag-field__body { min-width: 0; }
.ag-field__label { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ag-field__value { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.ag-field__value.num { font-variant-numeric: tabular-nums; }
a.ag-field__value:hover { color: var(--accent); }
.ag-copy { margin-left: auto; flex: none; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: var(--text-muted); cursor: pointer; display: grid; place-items: center; }
.ag-copy svg { width: 14px; height: 14px; }
.ag-copy:hover { color: var(--accent); }

.ag-notes { margin-top: 14px; }
.ag-notes__label { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.ag-notes__box { padding: 13px 15px; border-radius: 14px; background: var(--panel-alt); border: 1px solid var(--border); font-size: 0.9rem; line-height: 1.45; color: var(--text-soft); white-space: pre-wrap; }
.ag-attach { margin-top: 12px; display: flex; align-items: center; gap: 9px; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-alt); font-size: 0.85rem; font-weight: 600; color: var(--text); }
.ag-attach svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.ag-attach--empty { color: var(--text-muted); font-weight: 500; }
.ag-attach-btn { margin-left: auto; border: 1px solid var(--border); background: var(--panel); color: var(--accent); border-radius: 8px; padding: 5px 11px; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.ag-attach-btn.ghost { color: var(--text-soft); margin-left: 0; }

/* Modal */
.ag-modal-backdrop { position: fixed; inset: 0; z-index: 1300; background: rgba(6,12,22,0.55); backdrop-filter: blur(3px); display: grid; place-items: start center; padding: max(40px, 6vh) 16px 24px; overflow-y: auto; }
.ag-modal-backdrop[hidden] { display: none; }
.ag-modal { width: min(560px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-panel); }
.ag-modal__head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.ag-modal__ico { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.ag-modal__ico svg { width: 19px; height: 19px; }
.ag-modal__head h3 { margin: 0; font-size: 1.1rem; font-weight: 800; color: var(--text); }
.ag-modal__close { margin-left: auto; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-alt); color: var(--text-soft); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.ag-modal__body { padding: 18px 20px; }
.ag-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ag-form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 0.78rem; font-weight: 700; color: var(--text-soft); }
.ag-form-grid label.ag-full { grid-column: 1 / -1; }
.ag-form-grid input, .ag-form-grid textarea { padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--field); color: var(--text); font: inherit; font-size: 0.88rem; resize: vertical; }
.ag-form-grid input:focus, .ag-form-grid textarea:focus { outline: none; border-color: var(--accent); }
.ag-modal__foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

@media (max-width: 900px) {
    .ag-grid { grid-template-columns: 1fr; }
    .ag-list { max-height: 380px; }
    .ag-fields { grid-template-columns: 1fr; }
    .ag-form-grid { grid-template-columns: 1fr; }
}

/* ==================== HHEE (rediseno estilo Contactos / mockup) ==================== */
.hh-v2 {
    --hh-diurna: #c9760a;
    --hh-diurna-soft: rgba(232, 146, 15, 0.14);
    --hh-nocturna: #2f6bd8;
    --hh-nocturna-soft: rgba(47, 107, 216, 0.14);
    --hh-good: #16a34a;
    --hh-good-soft: rgba(22, 163, 74, 0.14);
    --hh-larga: #2563eb;
    --hh-larga-soft: rgba(59, 130, 246, 0.16);
    --hh-noche: #6d3bd4;
    --hh-noche-soft: rgba(109, 75, 216, 0.16);
    --hh-marcaje: #0b8a86;
    --hh-marcaje-soft: rgba(14, 165, 164, 0.15);
}
body.theme-dark .hh-v2 {
    --hh-diurna: #f3ae3d;
    --hh-diurna-soft: rgba(243, 174, 61, 0.18);
    --hh-nocturna: #5b93f6;
    --hh-nocturna-soft: rgba(91, 147, 246, 0.18);
    --hh-good: #3ec77f;
    --hh-good-soft: rgba(62, 199, 127, 0.18);
    --hh-larga: #7ba7ff;
    --hh-larga-soft: rgba(59, 130, 246, 0.22);
    --hh-noche: #b39bff;
    --hh-noche-soft: rgba(109, 75, 216, 0.28);
    --hh-marcaje: #2dd4c4;
    --hh-marcaje-soft: rgba(45, 212, 196, 0.18);
}

.hhee-content.hh-v2 {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* Header */
.hh-v2 .hh-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0;
}
.hh-v2 .hh-who {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}
.hh-v2 .hh-av {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    flex: none;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    background: linear-gradient(135deg, #5b93f6, var(--accent));
}
.hh-v2 .hh-who__text {
    min-width: 0;
}
.hh-v2 .hh-who__text strong {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text);
}
.hh-v2 .hh-who__text p {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.hh-v2 .hh-spacer {
    flex: 1;
}
.hh-v2 .hh-month {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--panel);
}
.hh-v2 .hh-month-nav {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: none;
    background: var(--panel-alt);
    color: var(--text-soft);
    cursor: pointer;
    font-size: 1rem;
}
.hh-v2 .hh-month-nav:hover {
    background: var(--panel-hover);
    color: var(--text);
}
.hh-v2 .hh-month strong {
    padding: 0 10px;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text);
}
.hh-v2 .hh-export {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border-strong);
    border-radius: 13px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}
.hh-v2 .hh-export:hover {
    background: var(--panel-hover);
}
.hh-v2 .hh-export svg {
    width: 17px;
    height: 17px;
    color: var(--accent);
}
.hh-v2 .hh-export:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cards */
.hh-v2 .panel.hh-card {
    padding: 20px;
    border-radius: var(--radius-lg);
}
.hh-v2 .hh-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.hh-v2 .hh-card__head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}
.hh-v2 .hh-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 16px;
    align-items: stretch;
}

/* dots + legend */
.hh-v2 .hh-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}
.hh-v2 .hh-dot-d {
    background: var(--hh-diurna);
}
.hh-v2 .hh-dot-n {
    background: var(--hh-nocturna);
}
.hh-v2 .hh-legend {
    display: flex;
    gap: 14px;
}
.hh-v2 .hh-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-soft);
}

/* Resumen */
.hh-v2 .summary {
    display: block;
    gap: 0;
}
.hh-v2 .hh-total {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.hh-v2 .hh-total .big {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--text);
}
.hh-v2 .hh-total .big.is-return {
    color: var(--teal);
}
.hh-v2 .hh-total .cur {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.95rem;
}
.hh-v2 .hh-total-sub {
    color: var(--text-muted);
    font-size: 0.84rem;
    margin-top: 5px;
}
.hh-v2 .hh-delta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--hh-good-soft);
    color: var(--hh-good);
}
.hh-v2 .hh-delta.down {
    background: rgba(224, 68, 122, 0.16);
    color: #e0447a;
}
.hh-v2 .hh-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}
.hh-v2 .hh-split-cell {
    padding: 13px 14px;
    border-radius: 14px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}
.hh-v2 .hh-split-cell .lbl {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-soft);
}
.hh-v2 .hh-split-cell .h {
    font-size: 1.45rem;
    font-weight: 800;
    margin-top: 6px;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.hh-v2 .hh-split-cell .money {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 2px;
}
.hh-v2 .hh-meta {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.hh-v2 .hh-meta span {
    font-size: 0.76rem;
    color: var(--text-soft);
    background: var(--panel-alt);
    border: 1px solid var(--border);
    padding: 5px 10px;
    border-radius: 999px;
}
.hh-v2 .hh-meta b {
    color: var(--text);
}
.hh-v2 .hh-return {
    margin-top: 16px;
}

/* Chart card body */
.hh-v2 #hoursChartsPanel {
    display: flex;
    flex-direction: column;
}
.hh-v2 #hoursChartsPanel .hhee-chart-card {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0;
}

/* KPIs */
.hh-v2 .hh-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.hh-v2 .hh-kpi {
    padding: 16px;
    border-radius: 18px;
    color: #fff;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}
.hh-v2 .hh-kpi .k-ico {
    display: block;
    width: 26px;
    height: 26px;
    opacity: 0.92;
}
.hh-v2 .hh-kpi .k-ico svg {
    width: 26px;
    height: 26px;
}
.hh-v2 .hh-kpi .k-lbl {
    margin-top: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.95;
}
.hh-v2 .hh-kpi .k-val {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
.hh-v2 .hh-kpi .k-sub {
    font-size: 0.76rem;
    opacity: 0.9;
}
.hh-v2 .kpi-pay {
    background: linear-gradient(140deg, #22b07d, #0f9d6f);
}
.hh-v2 .kpi-year {
    background: linear-gradient(140deg, #8b5cf6, #6d3bd4);
}
.hh-v2 .kpi-bank {
    background: linear-gradient(140deg, #2dd4c4, #0e918c);
}
.hh-v2 .kpi-dist {
    background: linear-gradient(140deg, #5b93f6, var(--accent));
}

/* Records */
.hh-v2 .hhee-records-panel {
    padding: 0;
}
.hh-v2 .hh-rec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 6px;
    flex-wrap: wrap;
}
.hh-v2 .hh-rec-head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}
.hh-v2 .hh-rec-tools {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.hh-v2 .hh-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-soft);
    font-weight: 600;
}
.hh-v2 .hh-progress-bar {
    width: 90px;
    height: 7px;
    border-radius: 999px;
    background: var(--panel-hover);
    overflow: hidden;
}
.hh-v2 .hh-progress-bar i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--hh-good);
    border-radius: 999px;
    transition: width 0.2s ease;
}
.hh-v2 .hh-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-soft);
    cursor: pointer;
}
.hh-v2 .hh-toggle input {
    appearance: none;
    -webkit-appearance: none;
    width: 34px;
    height: 19px;
    border-radius: 999px;
    background: var(--panel-hover);
    border: 1px solid var(--border);
    position: relative;
    cursor: pointer;
    flex: none;
}
.hh-v2 .hh-toggle input::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s ease;
}
.hh-v2 .hh-toggle input:checked {
    background: var(--accent);
    border-color: transparent;
}
.hh-v2 .hh-toggle input:checked::after {
    transform: translateX(15px);
}
.hh-v2 .hh-rec-list {
    padding: 8px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.hh-v2 .hh-rec {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--panel-alt);
    flex-wrap: wrap;
}
.hh-v2 .hh-rec__date {
    min-width: 54px;
}
/* La fecha es el boton de accion de la fila: abre el cuadro que le falta a ese
   dia (respaldo, marcaje o anular el turno extra). */
.hh-v2 .hh-rec__date--action {
    padding: 4px 6px;
    margin: -4px -6px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.hh-v2 .hh-rec__date--action:hover {
    background: var(--panel-alt);
    border-color: var(--border);
}
.hh-v2 .hh-rec__date--action:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
.hh-v2 .hh-rec__date strong {
    display: block;
    font-size: 1rem;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.hh-v2 .hh-rec__date small {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
}
.hh-v2 .hh-turno {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 8px;
    white-space: nowrap;
}
.hh-v2 .t-larga {
    background: var(--hh-larga-soft);
    color: var(--hh-larga);
}
.hh-v2 .t-noche {
    background: var(--hh-noche-soft);
    color: var(--hh-noche);
}
.hh-v2 .t-diurno {
    background: var(--hh-diurna-soft);
    color: var(--hh-diurna);
}
.hh-v2 .t-marcaje {
    background: var(--hh-marcaje-soft);
    color: var(--hh-marcaje);
}
.hh-v2 .hh-rec__hours {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.hh-v2 .hh-hchip {
    font-size: 0.76rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}
.hh-v2 .hh-hchip-d {
    background: var(--hh-diurna-soft);
    color: var(--hh-diurna);
}
.hh-v2 .hh-hchip-n {
    background: var(--hh-nocturna-soft);
    color: var(--hh-nocturna);
}
.hh-v2 .hh-rec__spacer {
    flex: 1;
}
.hh-v2 .hh-resp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--border);
    white-space: nowrap;
}
.hh-v2 .hh-resp svg {
    width: 14px;
    height: 14px;
}
.hh-v2 .hh-resp.ok {
    background: var(--hh-good-soft);
    color: var(--hh-good);
    border-color: transparent;
}
.hh-v2 .hh-resp.missing {
    background: transparent;
    color: var(--text-soft);
}

/* Descuento por marcaje: horas programadas que no se trabajaron. No es un
   evento de HH.EE con respaldo, es una resta al total del mes. */
.hh-v2 .t-descuento {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
}
.hh-v2 .hh-hchip-neg {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}
.hh-v2 .hh-resp.adjust {
    background: transparent;
    color: #b91c1c;
}
.hh-v2 .hh-rec.is-adjustment {
    background: rgba(239, 68, 68, 0.05);
}
.hh-v2 .hh-rec__detail {
    flex-basis: 100%;
    color: var(--text-muted);
    font-size: 0.75rem;
}
.hh-v2 .hh-rec-empty {
    padding: 26px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}

@media (max-width: 1000px) {
    .hh-v2 .hh-top {
        grid-template-columns: 1fr;
    }
    .hh-v2 .hh-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 620px) {
    .hh-v2 .hh-spacer {
        display: none;
    }
    .hh-v2 .hh-kpis {
        grid-template-columns: 1fr;
    }
    .hh-v2 .hh-rec__detail {
        order: 5;
    }
}

/* ==================== PERFIL (rediseno estilo mockup) ==================== */
.pf-v2 {
    --pf-diurna: #c9760a;
    --pf-nocturna: #2f6bd8;
    --pf-libre: #64748b;
}
body.theme-dark .pf-v2 {
    --pf-diurna: #f3ae3d;
    --pf-nocturna: #5b93f6;
    --pf-libre: #8aa0bd;
}

.profile-view-layout.pf-v2 {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

/* ---- Hero ---- */
.pf-v2 .pf-hero {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 22px;
    flex-wrap: wrap;
}
.pf-v2 .pf-av {
    width: 66px;
    height: 66px;
    border-radius: 20px;
    flex: none;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    font-size: 1.45rem;
    background: linear-gradient(140deg, #5b93f6, var(--accent-2));
    box-shadow: var(--shadow-soft);
}
.pf-v2 .pf-hero-main {
    flex: 1;
    min-width: 220px;
}
.pf-v2 .pf-hero-name {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text);
}
.pf-v2 .pf-hero-sub {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 0.84rem;
}
.pf-v2 .pf-pills {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.pf-v2 .pf-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel-alt);
    color: var(--text-soft);
}
.pf-v2 .pf-pill .d {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.pf-v2 .pf-pill.ok { background: rgba(34, 197, 94, 0.16); color: var(--green); border-color: transparent; }
.pf-v2 .pf-pill.off { background: rgba(148, 163, 184, 0.18); color: var(--muted); border-color: transparent; }
.pf-v2 .pf-pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pf-v2 .pf-pill.purple { background: rgba(143, 44, 201, 0.16); color: var(--purple); border-color: transparent; }
.pf-v2 .pf-pill.amber { background: rgba(240, 177, 0, 0.16); color: var(--yellow); border-color: transparent; }

.pf-v2 .pf-hero-name .profile-name-search {
    width: 30px;
    height: 30px;
    flex: none;
}
.pf-v2 .pf-hero-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.pf-v2 .pf-hero-actions .pf-btn {
    margin: 0;
}
.pf-v2 .pf-active {
    margin-left: 4px;
}

/* ---- KPIs ---- */
.pf-v2 .pf-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.pf-v2 .pf-kpi {
    padding: 16px;
    border-radius: 18px;
    color: #fff;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    min-height: 104px;
}
.pf-v2 .pf-kpi .k-ico { display: block; width: 24px; height: 24px; opacity: 0.92; }
.pf-v2 .pf-kpi .k-ico svg { width: 24px; height: 24px; }
.pf-v2 .pf-kpi .k-lbl { margin-top: 8px; font-size: 0.8rem; font-weight: 600; opacity: 0.95; }
.pf-v2 .pf-kpi .k-val { font-size: 1.55rem; font-weight: 800; line-height: 1.12; font-variant-numeric: tabular-nums; }
.pf-v2 .pf-kpi .k-sub { font-size: 0.76rem; opacity: 0.9; }
.pf-v2 .pf-kpi--anti { background: linear-gradient(140deg, #8b5cf6, #6d3bd4); }
.pf-v2 .pf-kpi--vac { background: linear-gradient(140deg, #22b07d, #0f9d6f); }
.pf-v2 .pf-kpi--hhee { background: linear-gradient(140deg, #f0a63a, #dd7d10); }
.pf-v2 .pf-kpi--doc { background: linear-gradient(140deg, #2dd4c4, #0e918c); }

/* ---- Perfil inactivo ---- */
/* El trabajador ya no esta activo en la unidad y la vista entera lo dice: las
   tarjetas, el avatar, los iconos y los graficos pierden el color. Se despinta
   con un filtro y no cambiando cada color, porque varios vienen en estilos en
   linea (los anillos de vacaciones, las barras de turnos) y porque asi un color
   nuevo queda en gris sin tener que acordarse de este bloque.
   Los botones NO entran: siguen funcionando, y en gris pareceria que no. */
.pf-v2.pf-inactive .pf-av,
.pf-v2.pf-inactive .pf-kpi,
.pf-v2.pf-inactive .pf-card-ico,
.pf-v2.pf-inactive .pf-mini-head .ci,
.pf-v2.pf-inactive .pf-vac,
.pf-v2.pf-inactive .pf-spark,
.pf-v2.pf-inactive .pf-tdist {
    filter: grayscale(1);
}

/* ---- Layout 2 columnas ---- */
.pf-v2 .profile-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
    gap: 14px;
    grid-auto-flow: row dense;
}
.pf-v2 .profile-area--personal { grid-column: 1; }
.pf-v2 .profile-availability-card { grid-column: 2; }
.pf-v2 #profileHheeCard { grid-column: 2; }
.pf-v2 #profileTurnosCard { grid-column: 2; }
.pf-v2 .profile-area--contract { grid-column: 1; }
.pf-v2 .profile-area--records { grid-column: 1 / -1; }
.pf-v2 .profile-medical-chart { grid-column: 1 / -1; }

/* Campos como texto en modo ver (inputs/selects deshabilitados) */
.pf-v2 #profileSection .metric-row--field input:disabled,
.pf-v2 #profileSection .metric-row--field select:disabled {
    -webkit-appearance: none;
    appearance: none;
    border-color: transparent !important;
    background: transparent !important;
    color: var(--text) !important;
    opacity: 1 !important;
    font-weight: 600;
    padding-left: 2px;
}
.pf-v2 #profileSection .metric-label {
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted) !important;
    font-weight: 700;
}

/* ---- Mini cards (HH.EE sparkline / turnos) ---- */
.pf-v2 .pf-mini-card { gap: 12px; }
.pf-v2 .pf-mini-head {
    display: flex;
    align-items: center;
    gap: 9px;
}
.pf-v2 .pf-mini-head .ci {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    flex: none;
}
.pf-v2 .pf-mini-head .ci svg { width: 16px; height: 16px; }
.pf-v2 .pf-mini-head .ci.amber { background: rgba(240, 177, 0, 0.16); color: var(--yellow); }
.pf-v2 .pf-mini-head .ci.teal { background: rgba(20, 184, 166, 0.16); color: var(--teal); }
.pf-v2 .pf-mini-head h3 { margin: 0; font-size: 0.92rem; font-weight: 800; color: var(--text); flex: 1; }
.pf-v2 .pf-mini-head .pf-mini-badge { font-size: 0.76rem; font-weight: 800; color: var(--text-soft); }

.pf-v2 .pf-spark { width: 100%; height: 80px; }
.pf-v2 .pf-spark-x { display: flex; justify-content: space-between; margin-top: 4px; font-size: 0.66rem; color: var(--text-muted); }

.pf-v2 .pf-tdist { display: flex; gap: 10px; }
.pf-v2 .pf-tdist .seg { flex: 1; text-align: center; }
.pf-v2 .pf-tdist .seg .bar { height: 8px; border-radius: 999px; background: var(--panel-hover); overflow: hidden; margin-bottom: 6px; }
.pf-v2 .pf-tdist .seg .bar i { display: block; height: 100%; border-radius: 999px; }
.pf-v2 .pf-tdist .seg .n { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pf-v2 .pf-tdist .seg .t { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }

.pf-v2 .pf-empty {
    padding: 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}

@media (max-width: 980px) {
    .pf-v2 .pf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pf-v2 .profile-layout { grid-template-columns: 1fr; }
    .pf-v2 .profile-area--personal,
    .pf-v2 .profile-availability-card,
    .pf-v2 #profileHheeCard,
    .pf-v2 #profileTurnosCard,
    .pf-v2 .profile-area--contract,
    .pf-v2 .profile-area--records,
    .pf-v2 .profile-medical-chart { grid-column: 1; }
}
@media (max-width: 560px) {
    .pf-v2 .pf-kpis { grid-template-columns: 1fr; }
}

/* ==================== PERFIL v2 — refuerzo look mockup ==================== */
/* 1) Quitar el panel exterior: que las areas sean tarjetas limpias sobre el fondo */
.profile-view-layout.pf-v2 #profileSection.overview-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    backdrop-filter: none !important;
}

/* 2) Cada area = tarjeta real (como el mockup) */
.pf-v2 .profile-area {
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-lg);
    padding: 20px;
    gap: 16px;
}

.pf-v2 #profileSection .section-head {
    margin-bottom: 0;
    align-items: center;
}
.pf-v2 #profileSection .section-head h3,
body[data-active-view="profile"] .pf-v2 #profileSection .profile-area--personal > .section-head h3,
body[data-active-view="profile"] .pf-v2 #profileSection .profile-availability-card > .section-head h3,
body[data-active-view="profile"] .pf-v2 #profileSection .profile-area--contract > .section-head h3 {
    font-family: var(--font-display);
    font-size: 1rem !important;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}

/* 3) Campos apilados: etiqueta (uppercase, chica) arriba, valor (bold) abajo */
.pf-v2 #profileSection .profile-form-grid {
    gap: 16px 22px;
}
.pf-v2 #profileSection .metric-row--field:not(.metric-toggle) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-height: 0;
}
body[data-active-view="profile"] .pf-v2 #profileSection .metric-row--field:not(.metric-toggle) .metric-label {
    font-family: var(--font-ui);
    font-size: 0.68rem !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted) !important;
}

/* Modo ver: los campos deshabilitados se leen como valores de texto */
.pf-v2 #profileSection .metric-row--field input:disabled,
.pf-v2 #profileSection .metric-row--field select:disabled,
body[data-active-view="profile"] .pf-v2 #profileSection .metric-row--field input:disabled,
body[data-active-view="profile"] .pf-v2 #profileSection .metric-row--field select:disabled {
    -webkit-appearance: none;
    appearance: none;
    border: none !important;
    background: transparent !important;
    color: var(--text) !important;
    opacity: 1 !important;
    font-size: 0.95rem !important;
    font-weight: 700;
    padding: 0 !important;
    min-height: 0;
    height: auto;
}
.pf-v2 #profileSection .phone-prefix-field:has(input:disabled) {
    border: none;
    background: transparent;
    padding: 0;
    gap: 4px;
}
.pf-v2 #profileSection .phone-prefix-field:has(input:disabled) > span {
    color: var(--text);
    font-weight: 700;
}

/* Modo editar: los campos vuelven a verse como campos */
.pf-v2 #profileSection .metric-row--field input:not(:disabled),
.pf-v2 #profileSection .metric-row--field select:not(:disabled) {
    border: 1px solid var(--field-border);
    background: var(--field);
    border-radius: 10px;
    padding: 8px 10px !important;
}

/* Toggles (asignacion, permiso gremial) siguen como fila */
.pf-v2 #profileSection .metric-row--field.metric-toggle {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
}

/* Documentos: la lista sube un poco su contraste sobre la tarjeta clara */
.pf-v2 #profileSection .attachment-list {
    margin-top: 4px;
}

/* ==================== PERFIL v2 — Registros RRHH estilo mockup ==================== */
.pf-v2 .profile-records-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.pf-v2 .record-card {
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pf-v2 .pf-rec-head {
    display: flex;
    align-items: center;
    gap: 9px;
}
.pf-v2 .pf-rec-ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex: none;
}
.pf-v2 .pf-rec-ico svg { width: 15px; height: 15px; }
.pf-v2 .pf-rec-ico.blue { background: var(--accent-soft); color: var(--accent); }
.pf-v2 .pf-rec-ico.green { background: rgba(34, 197, 94, 0.16); color: var(--green); }
.pf-v2 .pf-rec-ico.purple { background: rgba(143, 44, 201, 0.16); color: var(--purple); }
.pf-v2 .pf-rec-ico.amber { background: rgba(240, 177, 0, 0.18); color: var(--yellow); }
.pf-v2 .pf-rec-ico.teal { background: rgba(20, 184, 166, 0.16); color: var(--teal); }
.pf-v2 .pf-rec-head h4 {
    margin: 0 !important;
    font-family: var(--font-display);
    font-size: 0.9rem !important;
    font-weight: 800;
    color: var(--text);
}
.pf-v2 .pf-rec-spacer { flex: 1; }
.pf-v2 .pf-rec-count {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
}
.pf-v2 .pf-rec-count.zero { background: var(--panel-hover); color: var(--text-muted); }
.pf-v2 .pf-rec-edit {
    width: 27px;
    height: 27px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text-soft);
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
    flex: none;
}
.pf-v2 .pf-rec-edit:hover { color: var(--accent); border-color: var(--accent); }
.pf-v2 .pf-rec-edit svg { width: 14px; height: 14px; }

.pf-v2 .record-year-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.pf-v2 .record-year-filter span {
    font-size: 0.64rem !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}
.pf-v2 .record-year-filter select {
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 4px 8px;
    cursor: pointer;
}

.pf-v2 .record-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.pf-v2 .pf-rec-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 11px;
    background: var(--panel);
    border: 1px solid var(--border);
}
.pf-v2 .pf-rec-item.merit { border-left: 3px solid var(--green); }
.pf-v2 .pf-rec-item.demerit { border-left: 3px solid var(--red); }
.pf-v2 .pf-rec-date {
    flex: none;
    min-width: 40px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    padding-top: 1px;
    line-height: 1.25;
}
.pf-v2 .pf-rec-body { flex: 1; min-width: 0; }
.pf-v2 .pf-rec-body b { display: block; font-size: 0.84rem; font-weight: 700; color: var(--text); }
.pf-v2 .pf-rec-body small { display: block; color: var(--text-muted); font-size: 0.75rem; margin-top: 1px; }
.pf-v2 .pf-tag {
    flex: none;
    align-self: center;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.pf-v2 .pf-tag.g { background: rgba(34, 197, 94, 0.16); color: var(--green); }
.pf-v2 .pf-tag.r { background: rgba(239, 68, 68, 0.16); color: var(--red); }

.pf-v2 .pf-rec-bal { display: flex; gap: 8px; }
.pf-v2 .pf-rec-bal span {
    flex: 1;
    text-align: center;
    border-radius: 10px;
    padding: 8px;
    font-size: 0.72rem;
    font-weight: 700;
}
.pf-v2 .pf-rec-bal .pos { background: rgba(34, 197, 94, 0.16); color: var(--green); }
.pf-v2 .pf-rec-bal .neg { background: rgba(239, 68, 68, 0.16); color: var(--red); }
.pf-v2 .pf-rec-bal b { display: block; font-size: 1.15rem; }

.pf-v2 .pf-rec-empty {
    padding: 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border: 1px dashed var(--border-strong);
    border-radius: 11px;
}

@media (max-width: 900px) {
    .pf-v2 .profile-records-grid { grid-template-columns: 1fr; }
}

/* ==================== PERFIL v2 — encabezados de tarjeta + botones ==================== */
.pf-v2 #profileSection .pf-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
}
.pf-v2 .pf-card-ico {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: none;
}
.pf-v2 .pf-card-ico svg { width: 17px; height: 17px; }
.pf-v2 .pf-card-ico.blue { background: var(--accent-soft); color: var(--accent); }
.pf-v2 .pf-card-ico.green { background: rgba(34, 197, 94, 0.16); color: var(--green); }
.pf-v2 .pf-card-ico.purple { background: rgba(143, 44, 201, 0.16); color: var(--purple); }
.pf-v2 .pf-card-ico.teal { background: rgba(20, 184, 166, 0.16); color: var(--teal); }
.pf-v2 .pf-card-ico.orange { background: rgba(249, 115, 22, 0.16); color: var(--orange); }
.pf-v2 .pf-card-head h3 { margin: 0; flex: 0 0 auto; }
.pf-v2 .pf-card-spacer { flex: 1; }
.pf-v2 .pf-edit-link {
    background: none;
    border: none;
    color: var(--accent);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
}
.pf-v2 .pf-edit-link:hover { background: var(--accent-soft); }
.pf-v2 .pf-rec-total {
    font-size: 0.74rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
}

.pf-v2 .pf-btn {
    text-transform: none !important;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    letter-spacing: normal;
}
.pf-v2 .pf-btn svg { width: 16px; height: 16px; flex: none; }
.pf-v2 .primary-button.pf-btn svg { color: #fff; }
.pf-v2 .secondary-button.pf-btn svg { color: var(--accent); }

/* ==================== PERFIL v2 — Vacaciones donut + ausencias + timeline ==================== */
/* Vacaciones + ausencias a lo ancho para que la grilla respire */
.pf-v2 .profile-availability-card { grid-column: 1 / -1; }

.pf-v2 .pf-vac { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.pf-v2 .pf-donut { position: relative; width: 122px; height: 122px; flex: none; }
.pf-v2 .pf-donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.pf-v2 .pf-donut-center b { font-size: 1.7rem; font-weight: 800; color: var(--text); line-height: 1; }
.pf-v2 .pf-donut-center small { font-size: 0.68rem; color: var(--text-muted); }
.pf-v2 .pf-vac-legend { flex: 1; min-width: 200px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px 18px; }
.pf-v2 .pf-vac-legend .row { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-soft); }
.pf-v2 .pf-vac-legend .row .d { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.pf-v2 .pf-vac-legend .row b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }

.pf-v2 .pf-leave { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.pf-v2 .pf-leave-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pf-v2 .pf-leave-head > strong { font-family: var(--font-display); font-size: 0.92rem; font-weight: 800; color: var(--text); }
.pf-v2 .pf-leave-year { display: inline-flex; align-items: center; gap: 6px; }
.pf-v2 .pf-leave-year span { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700; color: var(--text-muted); }
.pf-v2 .pf-leave-year select { font: inherit; font-size: 0.78rem; font-weight: 700; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 9px; padding: 4px 8px; cursor: pointer; }
.pf-v2 .pf-leave-sum { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-v2 .pf-leave-sum span { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; color: var(--text-soft); background: var(--panel); border: 1px solid var(--border); padding: 5px 10px; border-radius: 999px; }
.pf-v2 .pf-leave-sum .d { width: 8px; height: 8px; border-radius: 50%; }
.pf-v2 .pf-leave-sum b { color: var(--text); }
.pf-v2 .pf-leave-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pf-v2 .pf-leave-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 11px; background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--muted); }
.pf-v2 .pf-leave-item .lx { flex: 1; min-width: 0; }
.pf-v2 .pf-leave-item .lx b { display: block; font-size: 0.82rem; font-weight: 700; color: var(--text); }
.pf-v2 .pf-leave-item .lx small { color: var(--text-muted); font-size: 0.74rem; font-variant-numeric: tabular-nums; }
.pf-v2 .pf-leave-item .ldays { flex: none; font-size: 0.74rem; font-weight: 800; color: var(--text-soft); background: var(--panel-alt); border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
/* Documentos del permiso: abre el mismo cuadro que la casilla del calendario.
   Si no cabe junto al periodo, baja a su propia linea en vez de apretarlo. */
.pf-v2 .pf-leave-item { flex-wrap: wrap; row-gap: 6px; }
.pf-v2 .pf-leave-item .lx { flex-basis: 140px; }
.pf-v2 .pf-leave-item .pf-leave-docs { flex: none; margin-top: 0; white-space: nowrap; }
.pf-v2 .pf-leave-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 0.8rem; border: 1px dashed var(--border-strong); border-radius: 11px; }

.pf-v2 .profile-area--history { grid-column: 1 / -1; }
.pf-v2 .contract-history-empty { color: var(--text-muted); font-size: 0.84rem; padding: 8px 2px; }
.pf-v2 .pf-tl { position: relative; margin-left: 6px; padding-left: 20px; }
.pf-v2 .pf-tl::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--border-strong); }
.pf-v2 .pf-tl-item { position: relative; padding-bottom: 16px; }
.pf-v2 .pf-tl-item:last-child { padding-bottom: 0; }
.pf-v2 .pf-tl-dot { position: absolute; left: -20px; top: 3px; width: 11px; height: 11px; border-radius: 50%; border: 3px solid var(--panel); }
.pf-v2 .pf-tl-dot.g { background: var(--green); }
.pf-v2 .pf-tl-dot.a { background: var(--yellow); }
.pf-v2 .pf-tl-dot.p { background: var(--purple); }
.pf-v2 .pf-tl-dot.b { background: var(--accent); }
.pf-v2 .pf-tl-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pf-v2 .pf-tl-top b { font-size: 0.86rem; color: var(--text); }
.pf-v2 .pf-tl-badge { font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--panel-alt); color: var(--text-soft); border: 1px solid var(--border); }
.pf-v2 .pf-tl-top time { font-size: 0.72rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
/* Eliminar un registro del historial de turnos aceptados. */
.pf-v2 .pf-tl-remove {
    margin-left: auto;
    padding: 0 6px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.2;
    cursor: pointer;
}
.pf-v2 .pf-tl-remove:hover { color: var(--red); background: rgba(239, 68, 68, 0.1); }
.pf-v2 .pf-tl-body p { margin: 3px 0 0; font-size: 0.8rem; color: var(--text-soft); }
/* Quien hizo el cambio y cuando quedo registrado. Va mas apagado que la linea
   de cambios: es el respaldo, no lo que se viene a leer. */
.pf-v2 .pf-tl-meta { font-size: 0.72rem; color: var(--text-muted); }

@media (max-width: 900px) {
    .pf-v2 .pf-leave-grid,
    .pf-v2 .pf-vac-legend { grid-template-columns: 1fr; }
}

/* ==================== PERFIL v2 — ajustes finales layout + botones ==================== */
/* Vacaciones vuelve a columna derecha; el registro de ausencias es full-width */
.pf-v2 .profile-availability-card { grid-column: 2; }
.pf-v2 .profile-area--leave { grid-column: 1 / -1; }
.pf-v2 .pf-vac-legend { grid-template-columns: 1fr; }
.pf-v2 .pf-vac { align-items: center; }
.pf-v2 .profile-area--leave .pf-leave { margin-top: 0; }

/* Botones del hero: misma fuente, tamaño y alto; con icono; formato titulo */
.pf-v2 .pf-hero-actions .pf-btn {
    height: 40px;
    padding: 0 14px;
    font-family: var(--font-ui);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none !important;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.pf-v2 .pf-hero-actions .pf-btn svg { width: 16px; height: 16px; flex: none; }

/* Fix: el contenedor flex del perfil debe estirar los hijos a lo ancho
   (el base .profile-view-layout trae align-items:start, que encogia los KPIs) */
.profile-view-layout.pf-v2 {
    align-items: stretch;
}
.pf-v2 .pf-kpis,
.pf-v2 .pf-hero,
.pf-v2 .pf-alert,
.pf-v2 #profileSection { width: 100%; }

/* ---- Aviso dentro del perfil ---- */
/* Va entre el encabezado y los KPIs: lo primero que se lee al abrir la ficha. */
.pf-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    color: var(--text, #0f172a);
}

.pf-alert[hidden] {
    display: none;
}

.pf-alert__ico {
    flex: none;
    width: 22px;
    height: 22px;
    color: #b45309;
}

.pf-alert__body {
    display: grid;
    gap: 3px;
}

.pf-alert__title {
    font-size: 0.92rem;
    font-weight: 700;
}

.pf-alert__text {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--text-soft, #475569);
}

/* El perfil inactivo se pinta en gris entero; el aviso no es la excepcion. */
.pf-inactive .pf-alert {
    filter: grayscale(1);
}

/* ==================== PERFIL v2 — columnas anidadas, botones, condiciones ==================== */
/* Columna derecha anidada: apila Vacaciones/HH.EE/Turnos sin acoplarse al alto
   de la columna izquierda (evita el hueco entre HH.EE y Turnos). */
.pf-v2 .pf-col-right {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-self: start;
    min-width: 0;
}
.pf-v2 .pf-col-right .profile-area { margin: 0; }

/* Hero: botones en una fila y el toggle "Perfil activo" debajo (solo en edicion) */
.pf-v2 .pf-hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}
.pf-v2 .pf-hero-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.pf-v2 .pf-active { margin: 0; }

/* Rotativa: valor + "desde" en una linea */
.pf-v2 .pf-rotativa-value { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pf-v2 .pf-since { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; }

/* Condiciones como chips (modo ver) */
.pf-v2 #profileSection .profile-form-grid .pf-full { grid-column: 1 / -1; }
.pf-v2 .pf-conditions { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-v2 .pf-cond {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 11px;
    border-radius: 999px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    color: var(--text-soft);
}
.pf-v2 .pf-cond.on { background: rgba(34, 197, 94, 0.16); color: var(--green); border-color: transparent; }
.pf-v2 .pf-cond.off { background: var(--panel-alt); color: var(--text-muted); }
.pf-v2 .pf-cond b { color: var(--text); }
.pf-v2 .pf-cond svg { width: 14px; height: 14px; }

/* Boton "Actualizar" (topbar): icono girando mientras recarga */
.icon-button.is-spinning svg { animation: app-reload-spin 0.8s linear infinite; }
@keyframes app-reload-spin { to { transform: rotate(360deg); } }

/* El logo tambien actualiza la app: es el gesto que la gente intenta primero
   cuando ve algo desactualizado. */
.brand-mark--reload {
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.brand-mark--reload:hover {
    transform: scale(1.04);
}

.brand-mark--reload:active {
    transform: scale(0.97);
}

.brand-mark--reload:focus-visible {
    outline: 2px solid rgba(var(--brand-blue-rgb), 0.65);
    outline-offset: 3px;
}

.brand-mark--reload.is-reloading {
    opacity: 0.55;
    animation: app-reload-pulse 0.9s ease-in-out infinite;
}

@keyframes app-reload-pulse {
    50% { opacity: 0.9; }
}

/* Un turno D+N ocupa dos lineas en las celdas de marcaje: arriba el diurno y
   abajo la noche. Son dos presencias con horas de por medio, no un turno
   corrido, y verlas en una sola linea confundiria una con otra. */
.report-table td.report-cell--stacked {
    white-space: pre-line;
    line-height: 1.5;
}

/* Dia sin turno: el guion dice que no habia nada que marcar. Centrado, para
   que no se confunda con una hora alineada a la derecha. */
.report-table td.report-cell--idle-day {
    text-align: center;
    color: var(--text-soft);
}

/* Publicar la programacion de la semana que se esta viendo, desde el modal. */

/* Elegir la hoja del Excel: solo aparece cuando el nombre no permitio
   decidirla, asi que conviene que se lea de un vistazo. */

/* Notas de RRHH que rotan en el inicio. Van en la fila de widgets, con color
   propio para que no se lean como una dotacion mas. */
.hm-stat--indigo { background: linear-gradient(140deg, #4338ca, #6366f1); }
.hm-notas { cursor: default; }
.hm-nota {
    margin: 10px 0 0; font-size: 0.86rem; line-height: 1.45;
    transition: opacity 0.2s ease;
}
.hm-nota.is-fading { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
    .hm-nota { transition: none; }
}

/* Incidencias de marcaje del mes, en el inicio. */
.hm-kv[disabled] { opacity: 0.55; cursor: default; }
.hm-inc-detail { display: flex; flex-direction: column; gap: 2px; }
.hm-inc-row {
    display: grid; grid-template-columns: 1fr auto; gap: 2px 12px;
    padding: 8px 10px; border-radius: 10px;
    width: 100%; text-align: left; cursor: pointer;
    border: 0; background: transparent; color: inherit; font: inherit;
}
/* Las rayas se cuentan por tipo y no por posicion: entre dos filas puede
   haber abierto un reporte -que es un div- y el rayado no debe correrse. */
.hm-inc-row:nth-of-type(odd) { background: rgba(148, 163, 184, 0.12); }
.hm-inc-row:hover { background: rgba(148, 163, 184, 0.22); }
.hm-inc-row[aria-expanded="true"] { background: rgba(59, 130, 246, 0.16); }
.hm-inc-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hm-inc-row b { font-size: 0.9rem; }
.hm-inc-date { font-size: 0.85rem; color: var(--text-soft); white-space: nowrap; }
.hm-inc-row small { grid-column: 1 / -1; color: var(--text-soft); }

/* Adjuntar el .xls del reloj sin salir del inicio, al pie de la tarjeta. Es
   el mismo input que el de Reportes, solo que apretado desde aqui. */
.hm-inc-import {
    display: flex; margin-top: 10px; padding-top: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

/* El reporte de la vispera, el dia y el dia siguiente, abierto bajo la fila.
   En pantalla angosta la tabla se desplaza sola en vez de apretar el modal. */
.hm-inc-ctx { padding: 4px 10px 10px; }
/* Solo la tabla se desplaza: los dos botones de abajo se quedan donde
   estan aunque la tabla no quepa. */
.hm-inc-ctx-scroll { overflow-x: auto; }
.hm-inc-ctx-table {
    width: 100%; min-width: 440px;
    border-collapse: collapse; font-size: 0.82rem;
}
.hm-inc-ctx-table th, .hm-inc-ctx-table td {
    padding: 6px 8px; text-align: center; white-space: nowrap;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}
.hm-inc-ctx-table thead th {
    font-size: 0.76rem; font-weight: 600; color: var(--text-soft);
}
.hm-inc-ctx-table tbody th { text-align: left; font-weight: 600; }
.hm-inc-ctx-table tbody tr.is-incident { background: rgba(245, 158, 11, 0.16); }
.hm-inc-ctx-table tbody tr:last-child th,
.hm-inc-ctx-table tbody tr:last-child td { border-bottom: 0; }

/* Horario propio del trabajador, en su perfil y en su editor. */
.pf-schedule-value { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-schedule-custom { font-weight: 600; }
/* Dos columnas: los horarios registrados (con su propio scroll, del mas
   reciente al mas antiguo) y el formulario del nuevo. El modal nunca pasa del
   alto de la pantalla: crece la lista, no el modal. */
.ws-dialog {
    width: min(920px, 100%);
    max-width: none;
    /* El fondo deja 24 px por lado. */
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
}
.ws-head .ws-intro { margin-bottom: 0; }
.ws-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 20px;
    min-height: 0;
    flex: 1 1 auto;
}
.ws-col { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.ws-col--form { overflow-y: auto; padding-right: 4px; }
.ws-col--form .ws-segment { margin: 0; }
.ws-col__title { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 700; color: var(--text-strong); }
.ws-col__title span { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--panel-alt); color: var(--text-soft); font-size: 0.78rem; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
.ws-col--list .ws-periods { margin-bottom: 0; overflow-y: auto; min-height: 0; padding-right: 4px; }
.ws-chip { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #0f766e; color: #fff; font-size: 0.7rem; font-weight: 700; vertical-align: 1px; }
.ws-period.is-current { box-shadow: inset 0 0 0 1.5px rgba(13, 148, 136, 0.55); }
.ws-dialog .ws-actions { display: flex; justify-content: flex-end; gap: 10px; flex: none; }
.ws-dialog .ws-actions > button { width: auto; flex: 0 0 auto; min-width: 140px; }
.ws-empty-periods { padding: 14px; border: 1px dashed var(--border-strong); border-radius: 14px; }

@media (max-width: 760px) {
    .ws-dialog { overflow-y: auto; }
    .ws-body { grid-template-columns: minmax(0, 1fr); }
    .ws-col--form { overflow: visible; }
    .ws-col--list .ws-periods { max-height: 30vh; }
}
.ws-intro { margin: 2px 0 14px; color: var(--text-soft); font-size: 0.9rem; }
.ws-segment {
    border: 1px solid var(--border-soft, rgba(148, 163, 184, 0.35));
    border-radius: 12px; padding: 10px 14px 14px; margin: 0 0 12px;
}
.ws-segment legend { padding: 0 6px; font-weight: 600; font-size: 0.9rem; }
.ws-fields { display: flex; gap: 12px; flex-wrap: wrap; }
.ws-field { display: flex; flex-direction: column; gap: 4px; }
.ws-field span { font-size: 0.82rem; color: var(--text-soft); }
.ws-note { margin: 6px 0 0; font-size: 0.82rem; color: var(--text-soft); }

/* Periodos de vigencia del horario propio. */
.ws-periods { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.ws-period {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 10px; border-radius: 10px;
    background: rgba(148, 163, 184, 0.14);
}
.ws-period.is-open { background: rgba(13, 148, 136, 0.16); }
.ws-period b { display: block; font-size: 0.86rem; }
.ws-period small { color: var(--text-soft); font-size: 0.82rem; }
.ws-validity legend { color: var(--text-soft); }
.ws-free-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    cursor: pointer;
}
.ws-free-toggle input { width: 16px; height: 16px; }
.ws-segment[disabled] { opacity: 0.45; }
.ws-segment[disabled] legend { color: var(--text-soft); }


/* Aviso de sesion sin sincronizacion. Va fijo abajo y ocupa poco: informa de
   que los cambios estan en espera, sin tapar el trabajo ni pedir una accion
   que el supervisor no puede tomar. */
.sync-blocked-banner {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 9000;
    max-width: min(560px, calc(100vw - 32px));
    transform: translateX(-50%);
    padding: 11px 18px;
    border: 1px solid rgba(220, 38, 38, 0.35);
    border-radius: 13px;
    background: #fef2f2;
    box-shadow: 0 10px 26px rgba(11, 18, 32, 0.16);
    color: #991b1b;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
}

/* Sin conexion NO es lo mismo que bloqueado: aqui los cambios se guardan y
   salen solos al reconectar, asi que el aviso es ambar y no rojo. */
.sync-blocked-banner.is-offline {
    border-color: rgba(245, 158, 11, 0.4);
    background: #fffbeb;
    color: #92400e;
}

.sync-blocked-banner[hidden] {
    display: none !important;
}

/* Copia local de mas de un dia, o muy distinta de la del servidor: no se edita
   hasta aplicar la version del servidor (js/syncBanner.js). */
.sync-lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(11, 18, 32, 0.42);
    backdrop-filter: blur(3px);
}

.sync-lock-overlay[hidden] {
    display: none !important;
}

.sync-lock-card {
    display: grid;
    gap: 10px;
    width: min(440px, 100%);
    padding: 20px 22px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(var(--panel), var(--panel)), var(--bg-bottom, #ffffff);
    box-shadow: var(--shadow-lg);
    color: var(--text);
}

.sync-lock-card strong {
    font-size: 1rem;
    font-weight: 900;
}

.sync-lock-card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.45;
}

.sync-lock-bar {
    position: relative;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(var(--brand-blue-rgb), 0.14);
}

.sync-lock-bar span {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -40%;
    width: 40%;
    border-radius: inherit;
    background: rgba(var(--brand-blue-rgb), 0.9);
    animation: sync-lock-progress 1.2s ease-in-out infinite;
}

@keyframes sync-lock-progress {
    from {
        left: -40%;
    }

    to {
        left: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sync-lock-bar span {
        left: 0;
        width: 100%;
        animation: none;
        opacity: 0.6;
    }
}

.sync-lock-reload {
    justify-self: end;
}

.sync-lock-reload[hidden] {
    display: none !important;
}
/* Visible desde el HTML inicial, antes de que el modulo principal termine. */
.app-startup-loader {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #f4f7fb;
    opacity: 1;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.app-startup-loader.is-finished {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.app-startup-loader__content {
    width: min(320px, 78vw);
    text-align: center;
}

.app-startup-loader__content img {
    display: block;
    width: min(220px, 64vw);
    height: auto;
    margin: 0 auto 28px;
}

.app-startup-loader__track {
    position: relative;
    height: 6px;
    overflow: hidden;
    border-radius: 3px;
    background: #dce5f0;
}

.app-startup-loader__track span {
    position: absolute;
    inset: 0 auto 0 -42%;
    width: 42%;
    border-radius: inherit;
    background: #15549a;
    animation: app-startup-progress 1.05s ease-in-out infinite;
}

.app-startup-loader__content p {
    margin: 14px 0 0;
    color: #465a74;
    font-size: 14px;
    font-weight: 700;
}

.theme-dark .app-startup-loader {
    background: #0d1728;
}

.theme-dark .app-startup-loader__content p {
    color: #d8e3f0;
}

.theme-dark .app-startup-loader__track {
    background: #26364d;
}

.theme-dark .app-startup-loader__track span {
    background: #62a8f1;
}

@keyframes app-startup-progress {
    0% { transform: translateX(0); }
    55% { transform: translateX(170%); }
    100% { transform: translateX(340%); }
}

@media (prefers-reduced-motion: reduce) {
    .app-startup-loader__track span {
        animation-duration: 2.2s;
    }
}


/* Comentario obligatorio al guardar un turno aceptado que no se cumplio. */
[data-shift-attendance-comment].is-invalid {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ==========================================================================
   Ajustes del sistema (rediseño 2026-09-30): menu lateral por areas,
   buscador, usuarios plegables con permisos No / Ver / Editar y aviso de
   cambios sin guardar. Todo bajo .sx-dialog.
   ========================================================================== */

.turn-change-dialog.sx-dialog {
    width: min(1120px, calc(100vw - 32px));
    height: min(792px, calc(100vh - 40px));
    max-height: none;
    padding: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0;
    border-radius: 20px;
    background: var(--panel-alt);
    overflow: hidden;
}

.sx-dialog strong {
    display: inline;
    margin: 0;
    font-size: inherit;
    color: inherit;
}

.sx-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

.sx-header__title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.sx-header__title strong {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-strong, var(--text));
}

.sx-header__title p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sx-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(300px, 40%);
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--field);
    color: var(--text-muted);
}

.sx-search svg {
    width: 16px;
    height: 16px;
    flex: none;
}

.sx-search input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
    outline: none;
}

.sx-dialog .sx-search input[type="search"] {
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.sx-dialog .settings-request-field,
.sx-dialog .settings-limit-field {
    width: auto;
    max-width: none;
    margin: 0;
}

.sx-dialog .sx-row__text small {
    font-weight: 500;
}

.sx-icon-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: none;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--field);
    color: var(--text);
    cursor: pointer;
}

.sx-icon-btn svg {
    width: 18px;
    height: 18px;
}

.sx-body {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    min-height: 0;
}

.sx-nav {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 14px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.sx-nav__group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sx-nav__group[hidden],
.sx-nav__item[hidden] {
    display: none;
}

.sx-nav__label {
    padding: 0 12px 6px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sx-nav__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.sx-nav__item:hover {
    background: var(--panel-hover);
}

.sx-nav__item.is-active {
    background: var(--accent-soft);
    color: var(--accent);
}

.sx-nav__item > span:nth-child(2) {
    flex: 1 1 auto;
}

.sx-nav__dot {
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
}

.sx-nav__badge {
    height: 20px;
    padding: 0 8px;
    font-size: 0.7rem;
}

.sx-nav__empty {
    margin: 0;
    padding: 0 12px;
    font-size: 0.84rem;
    color: var(--text-muted);
}

.sx-main.settings-panel {
    padding: 24px 28px 28px;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sx-section-head h2 {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--text-strong, var(--text));
}

.sx-section-head p {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.sx-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sx-dialog .sx-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    cursor: default;
}

.sx-dialog label.sx-row {
    cursor: pointer;
}

.sx-dialog .sx-row.is-disabled {
    opacity: 0.55;
}

.sx-row__text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1 1 auto;
    min-width: 0;
}

.sx-row__text strong {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-strong, var(--text));
}

.sx-row__text small {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-muted);
}

/* Interruptor: sigue siendo un checkbox (lo leen las funciones read*). */
.sx-dialog .sx-switch {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: none;
    width: 44px;
    height: 26px;
    margin: 0;
    border-radius: 999px;
    background: var(--border-strong);
    cursor: pointer;
    transition: background 0.15s;
}

.sx-dialog .sx-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(14, 26, 44, 0.25);
    transition: transform 0.15s;
}

.sx-dialog .sx-switch:checked {
    background: var(--accent);
}

.sx-dialog .sx-switch:checked::after {
    transform: translateX(18px);
}

.sx-dialog .sx-switch:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.sx-inline-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-muted);
}

.sx-inline-field input {
    width: 90px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--field);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    text-align: center;
}

.settings-short-diurno-row {
    align-items: flex-start !important;
}

.settings-short-diurno-times {
    display: grid;
    grid-template-columns: repeat(2, minmax(126px, 1fr));
    gap: 10px;
    flex: 0 0 auto;
}

.settings-short-diurno-times label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.settings-short-diurno-times input {
    width: 126px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--field);
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    text-align: center;
}

.sx-placeholder {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px dashed var(--border-strong);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.sx-placeholder svg {
    width: 18px;
    height: 18px;
    flex: none;
}

.sx-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
}

.sx-card--pad {
    padding: 16px;
}

.sx-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.sx-field input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--field);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
}

.sx-field--inline {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.sx-field--inline input {
    width: 240px;
}

.sx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

.sx-btn--primary {
    border: 0;
    background: var(--accent);
    color: #fff;
}

.sx-btn--primary:hover {
    filter: brightness(0.92);
}

.sx-btn--ghost {
    border: 1px solid var(--border-strong);
    background: var(--field);
    color: var(--text);
}

.sx-btn--ghost:hover {
    background: var(--panel-hover);
}

.sx-btn--sm {
    height: 32px;
    padding: 0 12px;
    font-size: 0.8rem;
}

.sx-btn--wide {
    min-width: 170px;
}

.sx-btn-danger-text {
    height: 32px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #b42335;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.sx-btn-danger-text:hover {
    background: rgba(239, 68, 68, 0.1);
}

.sx-chip {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--field);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.sx-chip--edit {
    background: var(--accent-soft);
    color: var(--accent);
}

.sx-chip--none {
    background: rgba(180, 35, 53, 0.1);
    color: #b42335;
}

/* Feriados */
.sx-dialog .settings-holiday-form {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.sx-date-badge {
    width: 58px;
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0;
    border-radius: 10px;
    background: rgba(180, 83, 9, 0.12);
    color: #9a4b00;
}

.sx-date-badge strong {
    font-size: 1.1rem;
    line-height: 1;
}

.sx-date-badge small {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Documentos y firma */
.sx-signature {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
}

.sx-dialog .sx-signature .settings-signature-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sx-dialog .sx-signature .settings-signature-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    text-align: left;
}

.sx-dialog .sx-signature .settings-signature-field span {
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
}

.sx-dialog .sx-signature .settings-signature-field input {
    border-color: var(--border-strong);
    background: var(--field);
}

.sx-signature__preview {
    margin: 0;
}

.sx-signature__preview figcaption {
    margin-bottom: 12px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sx-signature__paper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 40px 20px 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfcfe;
    color: #34435a;
    font-size: 0.8rem;
    text-align: center;
}

.sx-signature__paper .is-name {
    color: #0e1a2c;
    font-size: 0.82rem;
    font-weight: 800;
}

.sx-signature__paper .is-placeholder {
    color: #8794a8;
}

.sx-signature__line {
    width: 180px;
    margin-bottom: 8px;
    border-top: 1px solid #0e1a2c;
}

/* Usuarios */
.sx-dialog .settings-user-invite {
    display: grid;
    gap: 12px;
    margin: 0;
}

.sx-invite__title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sx-invite__title strong {
    font-size: 0.95rem;
    font-weight: 700;
}

.sx-invite__title span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.sx-user {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    overflow: hidden;
}

.sx-user[open] {
    border-color: var(--accent-soft);
    box-shadow: 0 0 0 1px var(--accent-soft);
}

.sx-dialog .settings-user-card.sx-user {
    display: block;
    gap: 0;
    padding: 0;
    border-radius: 14px;
    background: var(--panel);
}

.sx-dialog .settings-user-invite__form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.sx-user__head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    list-style: none;
    cursor: pointer;
}

.sx-user__head::-webkit-details-marker {
    display: none;
}

.sx-user__head:hover {
    background: var(--panel-hover);
}

.sx-avatar {
    width: 40px;
    height: 40px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 800;
    font-size: 0.85rem;
}

.sx-user__id {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.sx-user__name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sx-user__name strong {
    font-size: 0.95rem;
    font-weight: 700;
}

.sx-user__name em {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--field);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 700;
}

.sx-user__id small {
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sx-user__counts {
    display: flex;
    gap: 6px;
    flex: none;
}

.sx-user__chevron {
    width: 18px;
    height: 18px;
    flex: none;
    color: var(--text-muted);
    transition: transform 0.15s;
}

.sx-user[open] .sx-user__chevron {
    transform: rotate(180deg);
}

.sx-user__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--border);
}

.sx-user__tools {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sx-user__tools .sx-btn-danger-text {
    margin-left: auto;
}

.sx-field--inline input {
    width: 200px;
}

.sx-user__presets {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.sx-perm-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.sx-perm-area {
    padding: 10px 12px 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.sx-perm-area h3 {
    margin: 0 0 4px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sx-perm-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    border-top: 1px solid var(--border);
}

.sx-perm-row:first-of-type {
    border-top: 0;
}

.sx-perm-row > span:first-child {
    flex: 1 1 auto;
    font-size: 0.88rem;
    font-weight: 600;
}

/* No / Ver / Editar: radios con aspecto de segmentos. */
.sx-seg {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border-radius: 10px;
    background: var(--field);
    border: 1px solid var(--border);
}

.sx-seg__opt {
    position: relative;
    cursor: pointer;
}

.sx-seg__opt input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sx-seg__opt span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.sx-seg__opt input:checked + span {
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(14, 26, 44, 0.14);
}

.sx-seg__opt--edit input:checked + span {
    background: var(--accent);
    color: #fff;
}

.sx-seg__opt--none input:checked + span {
    color: #b42335;
}

.sx-seg__opt input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* Pie */
.sx-footer.settings-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: var(--panel);
    border-top: 1px solid var(--border);
}

.sx-dirty {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f7a4d;
}

.sx-dirty::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.sx-dirty.is-dirty {
    color: #9a4b00;
}

@media (max-width: 860px) {
    .sx-body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
    }

    .sx-nav {
        flex-direction: row;
        gap: 6px;
        padding: 10px;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .sx-nav__group {
        flex-direction: row;
    }

    .sx-nav__label,
    .sx-nav__dot {
        display: none;
    }

    .sx-nav__item {
        white-space: nowrap;
    }

    .sx-header {
        flex-wrap: wrap;
    }

    .sx-search {
        order: 3;
        width: 100%;
    }

    .sx-perm-grid,
    .sx-signature,
    .sx-dialog .settings-holiday-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .sx-user__counts {
        display: none;
    }

    .settings-short-diurno-row {
        flex-direction: column;
        align-items: stretch !important;
    }

    .settings-short-diurno-times {
        width: 100%;
    }

    .settings-short-diurno-times input {
        width: 100%;
    }
}

/* ==========================================================================
   Cambios de turno (mockup aprobado 2026-10-01): registrar en tres pasos,
   solicitudes desde la app y los cambios del mes con su Anexo 4 (descargar
   para firmar / escanear el firmado). Prefijo swx-.
   ========================================================================== */
#swapPanel.swap-panel {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    overflow: visible;
}

.swx,
.swx-scan-backdrop {
    --swx-panel: #ffffff;
    --swx-panel-alt: #fbfcfe;
    --swx-field: #f7faff;
    --swx-soft: #f1f4f9;
    --swx-border: #dde4ef;
    --swx-border-soft: #e3e9f2;
    --swx-text: #0f1b2d;
    --swx-text-soft: #23324a;
    --swx-muted: #4b5a70;
    --swx-faint: #5b6b82;
    --swx-brand: #10498b;
    --swx-brand-ink: #10498b;
    --swx-brand-soft: #e3edf9;
    --swx-ok: #1a8a4a;
    --swx-ok-ink: #156a3a;
    --swx-ok-soft: #e7f6ee;
    --swx-ok-doc: #f2faf5;
    --swx-ok-border: #cdebd8;
    --swx-warn: #b45309;
    --swx-warn-ink: #8a4b00;
    --swx-warn-soft: #fff1d6;
    --swx-late-ink: #9f1c13;
    --swx-late-soft: #fde2e1;
    --swx-danger: #b42318;
    --swx-req-bg: #fff8eb;
    --swx-req-border: #f3d9a4;
    --swx-req-card-border: #f0dfba;
    --swx-req-ink: #5c3f00;
    --swx-summary-bg: #f3f7fd;
    --swx-summary-border: #d6e2f3;
    --swx-shadow: 0 14px 30px rgba(17, 24, 39, 0.06);
    color: var(--swx-text);
    font-family: var(--font-ui);
}

.theme-dark .swx,
.theme-dark .swx-scan-backdrop {
    --swx-panel: #0e1828;
    --swx-panel-alt: #132036;
    --swx-field: #132036;
    --swx-soft: #182842;
    --swx-border: rgba(255, 255, 255, 0.09);
    --swx-border-soft: rgba(255, 255, 255, 0.08);
    --swx-text: #f3f6fb;
    --swx-text-soft: #d5ddea;
    --swx-muted: #b4c0d2;
    --swx-faint: #9aa7bb;
    --swx-brand: #1d5fae;
    --swx-brand-ink: #8dbaf3;
    --swx-brand-soft: rgba(93, 156, 236, 0.16);
    --swx-ok-ink: #7ee2a8;
    --swx-ok-soft: rgba(34, 197, 94, 0.14);
    --swx-ok-doc: rgba(34, 197, 94, 0.1);
    --swx-ok-border: rgba(34, 197, 94, 0.3);
    --swx-warn-ink: #fbbf6a;
    --swx-warn-soft: rgba(245, 158, 11, 0.16);
    --swx-late-ink: #fca5a5;
    --swx-late-soft: rgba(239, 68, 68, 0.16);
    --swx-danger: #f87171;
    --swx-req-bg: rgba(245, 158, 11, 0.08);
    --swx-req-border: rgba(245, 158, 11, 0.3);
    --swx-req-card-border: rgba(245, 158, 11, 0.22);
    --swx-req-ink: #fcd38d;
    --swx-summary-bg: rgba(93, 156, 236, 0.08);
    --swx-summary-border: rgba(93, 156, 236, 0.22);
    --swx-shadow: none;
}

.swx { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.swx-i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Botones */
.swx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 11px; border: 1px solid transparent; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.swx-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.swx-btn .swx-i { width: 16px; height: 16px; }
.swx-btn--lg { height: 48px; padding: 0 18px; border-radius: 12px; font-size: 14px; }
.swx-btn--ghost { background: var(--swx-panel); border-color: #c9d5e6; color: var(--swx-brand-ink); }
.theme-dark .swx-btn--ghost { border-color: rgba(255, 255, 255, 0.16); }
.swx-btn--danger-text { color: var(--swx-danger); }
.swx-btn--primary { background: var(--swx-brand); color: #fff; font-weight: 800; box-shadow: 0 10px 22px rgba(16, 73, 139, 0.28); }
.swx-btn--ok { background: var(--swx-ok); color: #fff; font-weight: 800; }
.swx-btn--warn { background: var(--swx-warn); color: #fff; font-weight: 800; }
.swx-link { padding: 0; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 700; color: var(--swx-brand-ink); cursor: pointer; }
.swx-link:hover { text-decoration: underline; }
.swx-link--danger { color: var(--swx-danger); }
.swx-icon-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--swx-faint); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

/* Encabezado */
.swx-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.swx-head__spacer { flex: 1 1 auto; }
.swx-head__title { display: flex; flex-direction: column; gap: 4px; flex: 1 1 260px; min-width: 0; }
.swx-head__title h1 { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--swx-text); }
.swx-head__title p { margin: 0; font-size: 14px; color: var(--swx-muted); }
.swx-month { display: flex; align-items: center; gap: 6px; padding: 6px; background: var(--swx-panel); border: 1px solid var(--swx-border); border-radius: 14px; }
.swx-month__nav { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--swx-soft); color: var(--swx-brand-ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.swx-month__label { min-width: 170px; height: 40px; border: 0; background: transparent; font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--swx-text); cursor: pointer; }

.swx-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.swx-card { background: var(--swx-panel); border: 1px solid var(--swx-border); border-radius: 22px; box-shadow: var(--swx-shadow); }
.swx-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Registrar cambio */
.swx-new { padding: 24px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.swx-new__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.swx-new__head h2 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 700; flex: 1 1 auto; color: var(--swx-text); }
.swx-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; font-weight: 700; }
.swx-steps li { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--swx-soft); color: var(--swx-faint); }
.swx-steps li span { width: 22px; height: 22px; border-radius: 999px; background: #94a3b8; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.swx-steps li.is-done { background: var(--swx-ok-soft); color: var(--swx-ok-ink); }
.swx-steps li.is-done span { background: var(--swx-ok); }
.swx-steps li.is-current { background: var(--swx-brand-soft); color: var(--swx-brand-ink); }
.swx-steps li.is-current span { background: var(--swx-brand); }

.swx-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.swx-people__col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.swx-person { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.swx-person__label { font-size: 13px; font-weight: 700; color: var(--swx-muted); }
.swx-person__box { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px solid var(--swx-brand); border-radius: 14px; background: var(--swx-field); min-width: 0; }
.swx-person__field { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.swx-person__field small { font-size: 12px; color: var(--swx-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swx-from-search { display: flex; align-items: center; gap: 4px; margin: 0; min-width: 0; }
.swx .swx-from-search input,
.swx .swx-person__field select { flex: 1 1 auto; min-width: 0; width: 100%; border: 0; background: transparent; padding: 0; font: inherit; font-size: 15px; font-weight: 700; color: var(--swx-text); outline: none; box-shadow: none; height: auto; min-height: 0; text-overflow: ellipsis; }
.swx .swx-person__field select { cursor: pointer; }
.swx-person__field select option { color: #0f1b2d; }
.swx-note { font-size: 12px; color: var(--swx-faint); }
.swx-note strong { color: var(--swx-text); }

.swx-av { width: 32px; height: 32px; border-radius: 10px; background: var(--swx-brand); color: #fff; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; border: 2px solid var(--swx-panel); }
.swx-av--alt { background: #0e7c6b; }
.swx-av--lg { width: 40px; height: 40px; border-radius: 12px; font-size: 14px; border: 0; }

.swx-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swx-chips > span { font-size: 12px; color: var(--swx-faint); }
.swx-chip { height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid #c9d5e6; background: var(--swx-panel); color: var(--swx-text-soft); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.theme-dark .swx-chip { border-color: rgba(255, 255, 255, 0.16); }
.swx-chip.is-active { border-color: var(--swx-brand); background: var(--swx-brand); color: #fff; font-weight: 700; }

/* Calendarios */
.swx-cals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.swx-cal { border: 1px solid var(--swx-border-soft); border-radius: 18px; padding: 16px; background: var(--swx-panel-alt); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.swx-cal__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.swx-cal__head strong { font-size: 14px; color: var(--swx-text); }
.swx-cal__head span { font-size: 12px; color: var(--swx-faint); }
.swx-weekdays,
.swx-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.swx-weekdays { font-size: 11px; font-weight: 700; color: #8a97ab; text-align: center; margin-bottom: 6px; }
.swx-day { height: 46px; border-radius: 11px; border: 1px solid var(--swx-border-soft); background: var(--swx-soft); color: var(--swx-faint); font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0; min-width: 0; }
.swx-day span { font-size: 14px; font-weight: 800; line-height: 1; }
.swx-day small { font-size: 10px; font-weight: 800; line-height: 1; min-height: 10px; }
.swx-day--spacer { visibility: hidden; }
.swx-day.is-turn { background: var(--swx-turn, #2563eb); border-color: var(--swx-turn, #2563eb); color: #fff; }
.swx-day.is-on { cursor: pointer; border: 2px solid var(--swx-text); }
.swx-day.is-on:hover { transform: translateY(-1px); }
.swx-day.is-off { opacity: 0.38; cursor: not-allowed; }
.swx-day.is-picked { cursor: pointer; box-shadow: 0 0 0 3px var(--swx-panel-alt), 0 0 0 6px #f97316; }

.swx-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--swx-muted); align-items: center; }
.swx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swx-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.swx-legend i.is-plain { background: var(--swx-soft); border: 1px solid #d5dde8; }
.swx-legend i.is-picked { background: var(--swx-panel); box-shadow: 0 0 0 3px #f97316; }
.swx-legend i.is-off { background: var(--swx-soft); opacity: 0.4; }

/* Resumen */
.swx-summary { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; padding: 18px; border-radius: 18px; background: var(--swx-summary-bg); border: 1px solid var(--swx-summary-border); }
.swx-summary--empty { display: block; font-size: 13px; color: var(--swx-muted); }
.swx-summary__lines { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.swx-summary__lines p { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--swx-text); }
.swx-kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--swx-brand-ink); }
.swx-turn { padding: 4px 8px; border-radius: 8px; background: var(--swx-turn, #2563eb); color: #fff; font-weight: 800; font-size: 12px; flex: none; }
.swx-summary__checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--swx-text-soft); }
.swx-summary__checks li { display: flex; gap: 8px; align-items: center; }
.swx-summary__checks .swx-i { width: 16px; height: 16px; stroke: var(--swx-ok); stroke-width: 2.6; }

.swx-new__foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.swx-new__foot > span { font-size: 13px; color: var(--swx-muted); flex: 1 1 260px; }

/* Solicitudes desde la app */
.swx-requests { background: var(--swx-req-bg); border-color: var(--swx-req-border); padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: none; }
.swx-requests__head { display: flex; align-items: center; gap: 10px; }
.swx-requests__head h2 { margin: 0; font-size: 15px; font-weight: 800; color: var(--swx-req-ink); }
.swx-requests__icon { width: 34px; height: 34px; border-radius: 10px; background: #f6c453; color: #6b4a00; display: inline-flex; align-items: center; justify-content: center; }
.swx-request { background: var(--swx-panel); border: 1px solid var(--swx-req-card-border); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.swx-request__text { display: flex; flex-direction: column; gap: 3px; }
.swx-request__text strong { font-size: 14px; }
.swx-request__text span { font-size: 12px; color: var(--swx-faint); }
.swx-request__text em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--swx-ok-ink); }
.swx-request__actions { display: flex; gap: 8px; }
.swx-request__actions .swx-btn { flex: 1 1 0; height: 40px; padding: 0 8px; }

/* Lista del mes */
.swx-list { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.swx-list__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.swx-list__head h2 { margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 700; flex: 1 1 auto; color: var(--swx-text); }
.swx-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--swx-border); border-radius: 10px; width: 190px; max-width: 100%; color: var(--swx-faint); box-sizing: border-box; }
.swx-search .swx-i { width: 16px; height: 16px; }
.swx .swx-search input { border: 0; outline: none; font: inherit; font-size: 13px; width: 100%; background: transparent; color: var(--swx-text); padding: 0; height: auto; min-height: 0; box-shadow: none; }
.swx-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--swx-soft); border-radius: 12px; }
.swx-tabs button { height: 36px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: 12px; font-weight: 700; color: var(--swx-muted); cursor: pointer; white-space: nowrap; }
.swx-tabs button.is-active { background: var(--swx-panel); box-shadow: 0 2px 6px rgba(15, 27, 45, 0.1); font-weight: 800; color: var(--swx-brand-ink); }
.swx-tabs button.is-active.is-pending { color: var(--swx-warn); }
.swx-tabs button.is-active.is-signed { color: var(--swx-ok-ink); }
.swx-list__items { display: flex; flex-direction: column; gap: 14px; }

.swx-item { border: 1px solid var(--swx-border-soft); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--swx-panel); }
.swx-item.is-canceled { background: var(--swx-panel-alt); }
.swx-item__top { display: flex; align-items: center; gap: 10px; }
.swx-pair { display: flex; flex: none; }
.swx-pair .swx-av + .swx-av { margin-left: -4px; }
.swx-item__text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.swx-item__text strong { font-size: 14px; }
.swx-item__text span { font-size: 12px; color: var(--swx-faint); }
.swx-badge { padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.swx-badge--warn { background: var(--swx-warn-soft); color: var(--swx-warn-ink); }
.swx-badge--late { background: var(--swx-late-soft); color: var(--swx-late-ink); }
.swx-badge--ok { background: var(--swx-ok-soft); color: var(--swx-ok-ink); }
.swx-badge--muted { background: var(--swx-soft); color: var(--swx-muted); }
.swx-item__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.swx-item__doc { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; background: var(--swx-ok-doc); border: 1px solid var(--swx-ok-border); color: var(--swx-ok); }
.swx-item__doc span { font-size: 13px; flex: 1 1 auto; min-width: 0; color: var(--swx-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swx-item__doc .swx-link { font-size: 13px; }
.swx-item__links { display: flex; gap: 14px; }

@media (max-width: 1180px) {
    .swx-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
    .swx-people,
    .swx-cals,
    .swx-summary { grid-template-columns: minmax(0, 1fr); }
    .swx-head__title h1 { font-size: 22px; }
    .swx-new { padding: 16px; }
    .swx-month__label { min-width: 0; }
    .swx-head .swx-btn--lg { width: 100%; }
    .swx-new__foot .swx-btn--lg { width: 100%; }
}

/* ---------- Modal de escaneo ---------- */
.swx-scan-backdrop { position: fixed; inset: 0; z-index: 1300; background: rgba(10, 18, 32, 0.55); display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
.swx-scan { width: min(1040px, 100%); max-height: calc(100vh - 32px); background: var(--swx-panel); border-radius: 24px; box-shadow: 0 24px 60px rgba(7, 13, 27, 0.32); display: flex; flex-direction: column; overflow: hidden; }
.swx-scan__head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 18px; border-bottom: 1px solid var(--swx-border-soft); }
.swx-scan__icon { width: 44px; height: 44px; border-radius: 14px; background: var(--swx-warn-soft); color: var(--swx-warn); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.swx-scan__icon svg { width: 22px; height: 22px; }
.swx-scan__title { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; }
.swx-scan__title h2 { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--swx-text); }
.swx-scan__title span { font-size: 13px; color: var(--swx-muted); }
.swx-scan__close { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--swx-soft); color: var(--swx-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.swx-scan__close svg { width: 18px; height: 18px; }
.swx-scan__body { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); overflow: auto; min-height: 0; }
.swx-scan__capture { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; border-right: 1px solid var(--swx-border-soft); min-width: 0; }
.swx-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--swx-soft); border-radius: 12px; }
.swx-seg button { height: 40px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--swx-muted); display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.swx-seg button svg { width: 16px; height: 16px; }
.swx-seg button.is-active { background: var(--swx-panel); box-shadow: 0 2px 6px rgba(15, 27, 45, 0.1); font-weight: 800; color: var(--swx-brand-ink); }
/* El video manda la altura (height: auto): asi el recuadro de la hoja, que se
   ubica en % del cuadro, cae justo sobre la imagen y no sobre bandas negras. */
.swx-scan__viewer { position: relative; min-height: 300px; border-radius: 18px; background: #1b2433; overflow: hidden; }
.swx-scan__viewer video { width: 100%; height: auto; display: block; }
.swx-scan__sheet { position: absolute; border-radius: 4px; box-shadow: 0 0 0 3px #22c55e, 0 0 0 9999px rgba(10, 18, 32, 0.25); pointer-events: none; transition: all 0.25s ease; }
.swx-scan__badge { position: absolute; top: 14px; left: 14px; padding: 6px 12px; border-radius: 999px; background: rgba(148, 163, 184, 0.25); color: #e2e8f0; font-size: 12px; font-weight: 800; }
.swx-scan__badge.is-found { background: rgba(34, 197, 94, 0.18); color: #b9f5cf; }
.swx-scan__tip { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #c8d2e2; font-size: 12px; }
.swx-scan__error { position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center; padding: 40px; text-align: center; color: #e2e8f0; font-size: 14px; }
.swx-scan__controls { display: flex; align-items: center; gap: 12px; }
.swx-scan__shutter { width: 64px; height: 64px; margin: 0 auto; border-radius: 999px; border: 4px solid var(--swx-brand); background: #ffffff; box-shadow: inset 0 0 0 4px #ffffff, inset 0 0 0 30px var(--swx-brand); cursor: pointer; }
.swx-scan__shutter:disabled { opacity: 0.4; cursor: not-allowed; }
.swx-scan__count { font-size: 12px; color: var(--swx-faint); width: 128px; text-align: right; }
.swx-scan__drop { position: relative; height: 430px; border-radius: 18px; border: 2px dashed #c9d5e6; background: var(--swx-panel-alt); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; cursor: pointer; color: var(--swx-muted); box-sizing: border-box; }
.swx-scan__drop svg { width: 40px; height: 40px; color: var(--swx-brand-ink); }
.swx-scan__drop strong { font-size: 15px; color: var(--swx-text); }
.swx-scan__drop span { font-size: 13px; max-width: 360px; }
.swx-scan__drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.swx-scan__review { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; background: var(--swx-panel-alt); min-width: 0; }
.swx-scan__pages { display: flex; flex-direction: column; gap: 10px; }
.swx-scan__pages > strong { font-size: 13px; color: var(--swx-muted); }
.swx-scan__thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.swx-scan__thumb { position: relative; width: 92px; height: 120px; border-radius: 10px; background: #f4f1ea center / cover no-repeat; border: 2px solid var(--swx-brand); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; box-sizing: border-box; font-size: 11px; font-weight: 800; color: #10498b; }
.swx-scan__thumb > span { background: rgba(255, 255, 255, 0.9); padding: 2px 6px; border-radius: 6px; }
.swx-scan__thumb button { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 999px; border: 0; background: #23324a; color: #fff; font-size: 13px; cursor: pointer; }
.swx-scan__thumb--empty { border: 2px dashed #c9d5e6; background: transparent; align-items: center; padding: 0; color: #8a97ab; font-weight: 600; font-size: 12px; }
.swx-scan__thumb--pdf { width: 140px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; text-align: center; }
.swx-scan__thumb--pdf small { font-size: 10px; font-weight: 600; color: #4b5a70; word-break: break-all; }
.swx-scan__checks { margin: 0; padding: 14px; border: 1px solid var(--swx-border-soft); border-radius: 14px; background: var(--swx-panel); display: flex; flex-direction: column; gap: 4px; }
.swx-scan__checks legend { padding: 0 6px; font-size: 13px; font-weight: 800; color: var(--swx-text-soft); }
.swx-scan__checks label { display: flex; align-items: center; gap: 10px; font-size: 13px; min-height: 36px; cursor: pointer; color: var(--swx-text); }
.swx-scan__checks input { width: 18px; height: 18px; accent-color: var(--swx-brand); flex: none; }
.swx-scan__name { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--swx-muted); }
.swx-scan__name input { height: 44px; padding: 0 12px; border: 1px solid var(--swx-border); border-radius: 11px; font: inherit; font-size: 13px; color: var(--swx-text); background: var(--swx-panel); }
.swx-scan__note { font-size: 12px; color: var(--swx-faint); }
.swx-scan__foot { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--swx-border-soft); flex-wrap: wrap; }
.swx-scan__foot .swx-link { flex: 1 1 auto; text-align: left; font-size: 13px; }
.swx-scan__foot .swx-btn { height: 48px; padding: 0 20px; font-size: 14px; }
.swx-scan__foot .swx-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; }

@media (max-width: 820px) {
    .swx-scan__body { grid-template-columns: minmax(0, 1fr); }
    .swx-scan__capture { border-right: 0; border-bottom: 1px solid var(--swx-border-soft); }
    .swx-scan__drop { height: 240px; }
    .swx-scan__foot .swx-link { flex-basis: 100%; }
}

/* Visto bueno de horas (menu Horas extras, hoursValidationPanel.js). */
.hh-v2 .hh-validation {
    padding: 0 0 14px;
}

.hh-validation__count {
    font-weight: 800;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.hh-validation__hint,
.hh-validation__empty {
    margin: 0;
    padding: 0 20px 10px;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.hh-validation__loading {
    min-height: 116px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 20px 28px;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 750;
}

.hh-validation__spinner {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    border: 3px solid rgba(var(--brand-blue-rgb), 0.18);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: app-busy-spin 0.7s linear infinite;
}

.hh-validation__list {
    display: grid;
    gap: 6px;
    padding: 0 14px;
}

.hh-validation__retry {
    margin: 0 20px 12px;
}

.hh-validation__row {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto minmax(150px, auto);
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
    border-radius: 12px;
    background: var(--surface, #fff);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.hh-validation__row:hover {
    border-color: rgba(37, 99, 235, 0.35);
}

.hh-validation__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e1;
}

.hh-validation__name {
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hh-validation__hours {
    color: var(--text-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.hh-validation__status {
    display: grid;
    justify-items: end;
    font-size: 0.82rem;
    font-weight: 800;
    color: #64748b;
}

.hh-validation__status small {
    font-weight: 600;
    opacity: 0.8;
}

.hh-validation__row.is-validated {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.08);
}

.hh-validation__row.is-validated .hh-validation__dot {
    background: #22c55e;
}

.hh-validation__row.is-validated .hh-validation__status {
    color: #15803d;
}

.hh-validation__row.is-changed {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.09);
}

.hh-validation__row.is-changed .hh-validation__dot {
    background: #f59e0b;
}

.hh-validation__row.is-changed .hh-validation__status {
    color: #b45309;
}

@media (max-width: 720px) {
    .hh-validation__row {
        grid-template-columns: 12px minmax(0, 1fr);
    }

    .hh-validation__hours,
    .hh-validation__status {
        grid-column: 2;
        justify-items: start;
    }
}

/* Unidad de practica: franja bajo la barra superior (js/practiceUnit.js). */
.practice-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 12px 6px 0;
    padding: 10px 14px;
    border: 1px dashed #d97706;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.12);
    color: var(--text);
    font-size: 0.9rem;
}

.practice-banner strong {
    color: #b45309;
}

.practice-banner span {
    flex: 1 1 260px;
}

body.theme-dark .practice-banner strong {
    color: #fbbf24;
}
