/* ============================================================================
 * Sistema de Calendario · Tránsito y Transporte
 * Diseño moderno mobile-first (2025)
 * ========================================================================== */

:root {
    /* Colores base */
    --bg:          #f8fafc;
    --surface:     #ffffff;
    --surface-2:   #f1f5f9;
    --surface-3:   #e2e8f0;
    --border:      #e2e8f0;
    --border-2:    #cbd5e1;
    --text:        #0f172a;
    --text-2:      #334155;
    --text-muted:  #64748b;
    --text-soft:   #94a3b8;

    /* Acentos — azul institucional */
    --primary:        #1f4e79;
    --primary-2:      #1a4267;
    --primary-3:      #153655;
    --primary-dark:   #0f2740;
    --primary-light:  #eef3f8;
    --primary-soft:   #d8e3ee;

    /* Semánticos */
    --success:     #10b981;
    --success-bg:  #d1fae5;
    --success-dk:  #065f46;
    --danger:      #ef4444;
    --danger-bg:   #fee2e2;
    --danger-dk:   #991b1b;
    --warning:     #f59e0b;
    --warning-bg:  #fef3c7;
    --warning-dk:  #92400e;
    --info:        #0ea5e9;
    --info-bg:     #e0f2fe;
    --info-dk:     #075985;

    /* Sombras */
    --shadow-sm:  0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow:     0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
    --shadow-md:  0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg:  0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl:  0 20px 25px -5px rgba(15, 23, 42, 0.1),  0 8px 10px -6px rgba(15, 23, 42, 0.05);

    /* Radios */
    --r-xs:  4px;
    --r-sm:  6px;
    --r:     8px;
    --r-md:  10px;
    --r-lg:  12px;
    --r-xl:  16px;

    /* Sidebar */
    --sidebar-w: 240px;
    --topbar-h:  56px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
html { font-size: 15px; }

body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
    overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
    margin: 0 0 0.5rem;
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--text);
}
h1 { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 0.92rem; }

p { margin: 0 0 0.75rem; color: var(--text-2); }

a {
    color: var(--primary-2);
    text-decoration: none;
    transition: color 0.15s;
}
a:hover { color: var(--primary-3); }

code {
    font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
    background: var(--surface-2);
    padding: 0.12rem 0.4rem;
    border-radius: var(--r-xs);
    font-size: 0.85em;
    color: var(--primary-dark);
    border: 1px solid var(--border);
}

small { font-size: 0.8rem; color: var(--text-muted); }
hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ============================================================================
 * LAYOUT — Topbar + Sidebar + Main
 * ========================================================================== */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    background: var(--primary-dark);
    border-bottom: 1px solid var(--primary-3);
    padding: 0 1rem;
    height: var(--topbar-h);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
    gap: 0.75rem;
}

.topbar .brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    color: #ffffff;
    font-size: 0.95rem;
    letter-spacing: -0.015em;
    flex: 1;
    min-width: 0;
}
.topbar .brand::before {
    content: "DGTT";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 4px;
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #ffffff;
}
.topbar .brand small {
    display: block;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0;
}

.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}
.topbar .user-info span:not(.badge-rol) {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar .badge-rol {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.topbar .user-info a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--r-sm);
    transition: all 0.15s;
    white-space: nowrap;
}
.topbar .user-info a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.45);
}

/* Botón hamburguesa (solo mobile) */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--r-sm);
    width: 38px;
    height: 38px;
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
    transition: all 0.15s;
}
.menu-toggle:hover { background: rgba(255, 255, 255, 0.12); }
.menu-toggle svg { width: 20px; height: 20px; }

.layout { display: flex; flex: 1; min-height: 0; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.25rem 0.75rem;
    flex-shrink: 0;
    overflow-y: auto;
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
}
.sidebar h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-soft);
    letter-spacing: 0.1em;
    margin: 0 0.5rem 0.65rem;
    font-weight: 700;
}
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-2);
    border-radius: var(--r-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.sidebar a:hover {
    background: var(--surface-2);
    color: var(--text);
}
.sidebar a.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
    border-color: var(--primary-soft);
}

/* Overlay para drawer mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.2s;
}

.main {
    flex: 1;
    padding: 1.5rem 2rem 4rem;
    min-width: 0;
    max-width: 100%;
}

/* ============================================================================
 * CARDS
 * ========================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.card-header h2 { margin: 0; }
.card > .card-header:last-child { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
.card-header + p { margin-top: -0.25rem; }

/* ============================================================================
 * BOTONES
 * ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.95rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
    font-family: inherit;
}
.btn:hover {
    background: var(--surface-2);
    border-color: var(--text-soft);
    color: var(--text);
    transform: translateY(-0.5px);
    box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.btn-primary {
    background: var(--primary-2);
    border-color: var(--primary-2);
    color: white;
    box-shadow: 0 1px 2px 0 rgba(26, 66, 103, 0.15);
}
.btn-primary:hover {
    background: var(--primary-3);
    border-color: var(--primary-3);
    color: white;
    box-shadow: 0 4px 8px -2px rgba(26, 66, 103, 0.3);
}
.btn-danger {
    background: var(--surface);
    border-color: #fca5a5;
    color: var(--danger-dk);
}
.btn-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}
.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: white;
}
.btn-success:hover {
    background: var(--success-dk);
    border-color: var(--success-dk);
    color: white;
}
.btn-sm {
    padding: 0.32rem 0.7rem;
    font-size: 0.8rem;
}

/* ============================================================================
 * FORMS
 * ========================================================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.form-group { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}
.form-group small {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.form-group .req { color: var(--danger); }

input[type="text"], input[type="email"], input[type="number"], input[type="password"],
input[type="date"], input[type="time"], input[type="search"], input[type="tel"], input[type="file"],
select, textarea {
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    min-width: 0;
}
input:hover, select:hover, textarea:hover { border-color: var(--text-soft); }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin-right: 0.4rem;
    accent-color: var(--primary-2);
    cursor: pointer;
}
input[type="file"] { padding: 0.4rem; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ============================================================================
 * TABLAS
 * ========================================================================== */
.tabla-wrap {
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow-x: auto;
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
}
.tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.tabla thead th {
    background: var(--surface-2);
    text-align: left;
    padding: 0.65rem 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.tabla tbody td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.tabla tbody tr:last-child td { border-bottom: none; }
.tabla tbody tr { transition: background 0.1s; }
.tabla tbody tr:hover { background: var(--surface-2); }
.tabla tr.inactivo td { opacity: 0.55; }
.tabla .acciones {
    display: flex;
    gap: 0.35rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.tabla .acciones form { display: inline; margin: 0; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* ============================================================================
 * CHIPS / BADGES
 * ========================================================================== */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.005em;
    border: 1px solid transparent;
}
.chip-success { background: var(--success-bg); color: var(--success-dk); border-color: rgba(16, 185, 129, 0.2); }
.chip-danger  { background: var(--danger-bg);  color: var(--danger-dk);  border-color: rgba(239, 68, 68, 0.2); }
.chip-warning { background: var(--warning-bg); color: var(--warning-dk); border-color: rgba(245, 158, 11, 0.2); }
.chip-info    { background: var(--info-bg);    color: var(--info-dk);    border-color: rgba(14, 165, 233, 0.2); }
.chip-muted   { background: var(--surface-2);  color: var(--text-muted); border-color: var(--border); }
.chip-estado-borrador  { background: var(--surface-2);  color: var(--text-muted); border-color: var(--border); }
.chip-estado-publicado { background: var(--info-bg);    color: var(--info-dk);    border-color: rgba(14, 165, 233, 0.2); }
.chip-estado-firmado   { background: var(--success-bg); color: var(--success-dk); border-color: rgba(16, 185, 129, 0.2); }
.chip-estado-cerrado   { background: #1f2937;           color: white; border-color: transparent; }

/* ============================================================================
 * FLASHES
 * ========================================================================== */
.flash {
    padding: 0.8rem 1.1rem;
    border-radius: var(--r);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border: 1px solid;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    box-shadow: var(--shadow-sm);
}
.flash::before { font-weight: 700; flex-shrink: 0; font-size: 1.1em; line-height: 1.3; }
.flash.success { background: var(--success-bg); color: var(--success-dk); border-color: #6ee7b7; }
.flash.success::before { content: "✓"; }
.flash.danger  { background: var(--danger-bg);  color: var(--danger-dk);  border-color: #fca5a5; }
.flash.danger::before { content: "⚠"; }
.flash.info    { background: var(--info-bg);    color: var(--info-dk);    border-color: #7dd3fc; }
.flash.info::before { content: "ℹ"; }
.flash.warning { background: var(--warning-bg); color: var(--warning-dk); border-color: #fcd34d; }
.flash.warning::before { content: "⚠"; }

/* ============================================================================
 * UTILITIES
 * ========================================================================== */
.flex { display: flex; }
.gap-half { gap: 0.5rem; }
.flex-wrap { flex-wrap: wrap; }

.kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.kpi .card {
    padding: 1rem 1.25rem;
    margin: 0;
}
.kpi .lbl {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.kpi .num {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.action-banner {
    background: var(--primary-light);
    border: 1px solid var(--primary-soft);
    padding: 1.25rem;
    border-radius: var(--r-md);
    margin-bottom: 1.25rem;
}
.action-banner h3 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.guia-pasos {
    background: #fefce8;
    border: 1px solid #e8d9a8;
    border-radius: var(--r);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.guia-pasos h4 {
    color: #92400e;
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
}
.guia-pasos ol {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-2);
    line-height: 1.7;
}
.guia-pasos ol li { padding-left: 0.25rem; }
.guia-pasos strong { color: var(--text); }

/* ============================================================================
 * PARTES — Grilla semanal
 * ========================================================================== */
.parte-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.parte-header h2 { margin: 0 0 0.4rem; }
.parte-header .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}


.parte-grilla {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 0.85rem;
    table-layout: fixed;
}
.parte-grilla thead th {
    background: var(--text);
    color: white;
    padding: 0.6rem 0.5rem;
    text-align: center;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
}
.parte-grilla thead th:first-child {
    text-align: left;
    width: 200px;
    min-width: 200px;
}
.parte-grilla thead th small {
    display: block;
    font-weight: 400;
    opacity: 0.7;
    text-transform: none;
    font-size: 0.7rem;
    margin-top: 2px;
    letter-spacing: 0;
}
.parte-grilla thead th.finde { background: #475569; }

.parte-grilla tbody td {
    padding: 0.55rem;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    text-align: center;
    background: var(--surface);
    vertical-align: middle;
    transition: background 0.1s;
}
.parte-grilla tbody td:first-child {
    text-align: left;
    background: var(--surface-2);
    font-weight: 500;
    position: sticky;
    left: 0;
    z-index: 1;
}
.parte-grilla tbody tr:hover td { background: var(--primary-light); }
.parte-grilla tbody tr:hover td:first-child { background: var(--primary-soft); }
.parte-grilla td.finde { background: #fafbfc; }
.parte-grilla tbody tr:hover td.finde { background: var(--primary-light); }

.celda-turno {
    position: relative;
    min-width: 95px;
    min-height: 50px;
}
.celda-turno .t-horario {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.2rem 0.55rem;
    border-radius: var(--r-sm);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.78rem;
    white-space: nowrap;
    border: 1px solid var(--primary-soft);
}
.celda-turno .t-tipo {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: var(--r-sm);
    font-weight: 700;
    color: white;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}
.celda-turno .t-vacio {
    color: var(--text-soft);
    font-size: 1.1rem;
    line-height: 1;
}
.celda-turno .badge-extra {
    display: inline-block;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    margin-left: 3px;
    font-weight: 700;
    vertical-align: middle;
}
.celda-turno .link-edit {
    position: absolute;
    top: 4px;
    right: 4px;
    text-decoration: none;
    opacity: 0;
    font-size: 0.7rem;
    color: var(--primary-2);
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    width: 22px;
    height: 22px;
    line-height: 20px;
    text-align: center;
    transition: opacity 0.15s, background 0.15s;
}
.celda-turno:hover .link-edit { opacity: 1; }
.celda-turno .link-edit:hover { background: var(--primary-2); color: white; border-color: var(--primary-2); }


.parte-grilla .agente-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.parte-grilla .agente-info strong { font-size: 0.85rem; font-weight: 600; }
.parte-grilla .agente-info small { font-size: 0.7rem; color: var(--text-muted); }

/* Convocatorias del parte diario */
.convocatorias {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.convocatoria-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 0.85rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, box-shadow 0.15s;
}
.convocatoria-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.convocatoria-card .info { flex: 1; min-width: 0; }
.convocatoria-card .nombre { font-weight: 600; margin-bottom: 0.15rem; font-size: 0.92rem; }
.convocatoria-card .legajo { color: var(--text-muted); font-size: 0.72rem; }
.convocatoria-card .horario {
    color: var(--primary-dark);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 0.95rem;
    margin-top: 0.4rem;
}
.convocatoria-card .duracion {
    background: var(--danger-bg);
    color: var(--danger-dk);
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 0.4rem;
    display: inline-block;
}
.convocatoria-card .obs {
    margin-top: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}
.convocatoria-card form { margin: 0; }

.parte-totales {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.parte-totales .stat {
    background: var(--surface);
    padding: 0.85rem 1rem;
    border-radius: var(--r);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.parte-totales .lbl {
    color: var(--text-muted);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    display: block;
    margin-bottom: 0.2rem;
}
.parte-totales .val {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.tabla-partes td.fecha-dia { font-variant-numeric: tabular-nums; font-weight: 600; }
.tabla-partes .dia-tag {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: var(--r-xs);
    margin-left: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ============================================================================
 * RESPONSIVE — Tablet
 * ========================================================================== */
@media (max-width: 1024px) {
    .main { padding: 1.25rem 1.5rem 3rem; }
    .form-grid { gap: 0.85rem 1rem; }
}

/* ============================================================================
 * RESPONSIVE — Mobile (drawer sidebar)
 * ========================================================================== */
@media (max-width: 768px) {
    html { font-size: 14px; }

    .topbar { padding: 0 0.85rem; gap: 0.5rem; }
    .topbar .brand { font-size: 0.85rem; }
    .topbar .brand small { font-size: 0.65rem; }
    .topbar .user-info span:not(.badge-rol) { display: none; }
    .topbar .user-info { gap: 0.4rem; }
    .topbar .user-info a { padding: 0.35rem 0.6rem; }

    .menu-toggle {
        display: inline-flex;
    }

    /* Sidebar como drawer */
    .layout { flex-direction: column; }
    .sidebar {
        position: fixed;
        top: var(--topbar-h);
        left: 0;
        bottom: 0;
        width: 80%;
        max-width: 280px;
        height: auto;
        transform: translateX(-105%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 45;
        box-shadow: var(--shadow-lg);
        padding: 1rem 0.75rem;
    }
    .sidebar.open { transform: translateX(0); }

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }
    .sidebar a { padding: 0.7rem 0.85rem; font-size: 0.92rem; }

    .main { padding: 1rem; }
    .card { padding: 1rem 1.15rem; border-radius: var(--r); }
    .form-grid { grid-template-columns: 1fr; gap: 0.75rem; }
    .card-header { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .card-header > div:last-child { display: flex; gap: 0.5rem; flex-wrap: wrap; }

    /* Tablas: scroll horizontal con indicador */
    .tabla-wrap {
        position: relative;
        max-width: 100vw;
    }
    .tabla { font-size: 0.82rem; }
    .tabla thead th, .tabla tbody td { padding: 0.55rem 0.65rem; }
    .tabla .acciones {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    .tabla .acciones .btn { font-size: 0.75rem; padding: 0.3rem 0.5rem; }

    /* Parte semanal */
    .parte-grilla { font-size: 0.72rem; min-width: 640px; }
    .parte-grilla thead th:first-child { width: 110px; min-width: 110px; }
    .parte-grilla thead th { padding: 0.5rem 0.3rem; font-size: 0.62rem; }
    .parte-grilla tbody td { padding: 0.4rem 0.3rem; }
    .celda-turno { min-width: 75px; }
    .celda-turno .t-horario { font-size: 0.66rem; padding: 0.15rem 0.35rem; }
    .celda-turno .link-edit { opacity: 1; width: 18px; height: 18px; line-height: 16px; font-size: 0.6rem; }
    .celda-turno .t-tipo { font-size: 0.65rem; padding: 0.18rem 0.45rem; }

    .convocatorias { grid-template-columns: 1fr; }
    .parte-header { flex-direction: column; align-items: stretch; }
    .parte-totales { grid-template-columns: repeat(2, 1fr); }
    .parte-totales .val { font-size: 1.2rem; }

    .kpi { grid-template-columns: repeat(2, 1fr); }
    .kpi .num { font-size: 1.5rem; }

    .form-actions { flex-direction: column-reverse; gap: 0.5rem; }
    .form-actions .btn { width: 100%; }

    .action-banner { padding: 1rem; }
    .action-banner h3 { font-size: 0.9rem; }
}

@media (max-width: 480px) {
    .parte-totales { grid-template-columns: 1fr; }
    .topbar .user-info a { font-size: 0.75rem; padding: 0.3rem 0.55rem; }
}

/* Horarios base (antes CSS inline en admin/horarios_base.php) */
.fila-dia.finde { background: #fafbfc; }
.dur-output { font-variant-numeric: tabular-nums; }

/* ============================================================================
 * Animations
 * ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.flash { animation: fadeIn 0.2s ease-out; }
.card { animation: fadeIn 0.2s ease-out; }



/* ============================================================================
 * IMPRESIÓN — Formato oficial (réplica del PDF del organismo)
 * ========================================================================== */

/* Por defecto en pantalla, ocultar todo lo que es solo print */
.print-encabezado { display: none; }
.print-firma { display: none; }

/* (bloque @media print obsoleto eliminado en etapa 14 — reglas pisadas por el bloque final) */

/* En pantalla ocultar todo lo print */
@media screen {
    .print-encabezado, .print-firma { display: none; }
}

/* ============================================================================
 * LOGIN
 * ========================================================================== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--primary-dark);
    position: relative;
}
.login-wrap::before {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 45%;
    background: #0b1d30;
    pointer-events: none;
}
.login-card {
    background: white;
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem;
    border-radius: var(--r-lg);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(255,255,255,0.1);
    position: relative;
    z-index: 1;
}
.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 0.25rem;
    color: var(--text);
    letter-spacing: -0.02em;
}
.login-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0 0 1.75rem;
}
.login-card::before {
    content: "DGTT";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 52px;
    margin: 0 auto 1.1rem;
    background: var(--primary-dark);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #ffffff;
}
.login-card .form-group { margin-bottom: 1rem; }
.login-card .btn-primary {
    width: 100%;
    padding: 0.7rem;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}
.login-card .flash { margin-bottom: 1rem; }

/* ============================================================================
 * Ancho máximo del main + main sin estirar al infinito
 * ========================================================================== */
.main {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================================================
 * CALENDARIO DEL AGENTE — Grilla visual tipo agenda
 * ========================================================================== */
.calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.cal-dia {
    background: var(--surface);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}
.cal-dia:nth-child(7n) { border-right: none; }
.cal-dia.finde { background: #fafbfc; }
.cal-dia.hoy { background: var(--primary-light); }
.cal-dia.pasado { opacity: 0.5; }

.cal-dia-header {
    padding: 0.6rem 0.75rem 0.4rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.cal-dia.finde .cal-dia-header { background: #e5e7eb; }
.cal-dia.hoy .cal-dia-header {
    background: var(--primary-2);
    color: white;
}
.cal-dia-nombre {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}
.cal-dia.hoy .cal-dia-nombre { color: rgba(255,255,255,0.85); }
.cal-dia-fecha {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    margin-top: 0.15rem;
    font-variant-numeric: tabular-nums;
}
.cal-dia.hoy .cal-dia-fecha { color: white; }

.cal-dia-contenido {
    padding: 0.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.cal-turno {
    padding: 0.45rem 0.55rem;
    border-radius: var(--r-sm);
    font-size: 0.78rem;
    line-height: 1.3;
    border-left: 3px solid var(--primary-2);
    background: var(--primary-light);
    color: var(--primary-dark);
}
.cal-turno.extra {
    border-left-color: var(--danger);
    background: var(--danger-bg);
    color: var(--danger-dk);
}
.cal-turno.confirmado {
    border-left-color: var(--success);
    background: var(--success-bg);
    color: var(--success-dk);
}
.cal-turno.tipo-ausencia {
    border-left-color: #6b7280;
    background: #f3f4f6;
    color: #374151;
    font-weight: 600;
    text-align: center;
}
.cal-turno-horario { font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-turno-label   { font-size: 0.7rem; opacity: 0.85; margin-top: 0.15rem; }
.cal-vacio {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    font-size: 0.7rem;
    font-style: italic;
}

/* En mobile: calendario apilado verticalmente */
@media (max-width: 768px) {
    .calendario-grid {
        grid-template-columns: 1fr;
    }
    .cal-dia {
        border-right: none;
        min-height: auto;
    }
    .cal-dia-header { display: flex; align-items: baseline; gap: 0.5rem; }
    .cal-dia-fecha { font-size: 1.1rem; }
}

/* ============================================================================
 * IMPRESIÓN COMPACTA — Forzar 1 hoja A4 landscape
 * ========================================================================== */
/* (bloque @media print obsoleto eliminado en etapa 14 — reglas pisadas por el bloque final) */

/* ============================================================================
 * BANNER MODO OBSERVADOR
 * ========================================================================== */
.banner-observador {
    background: #fdf6e3;
    border-bottom: 1px solid #e3d9b8;
    color: #6b5d1f;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 60;
}
.banner-observador a {
    color: #6b5d1f;
    font-weight: 700;
    text-decoration: underline;
    margin-left: 0.75rem;
}
.banner-observador .icon { vertical-align: -3px; margin-right: 0.3rem; }

/* ============================================================================
 * MAPA DE OPERATIVOS
 * ========================================================================== */
.mapa-marker {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2.5px solid #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: inherit;
}
.mk-realizado  { background: #64748b; }
.mk-en_curso   { background: var(--success); }
.mk-programado { background: var(--info); }
.mapa-leyenda {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-2);
    margin-right: 0.75rem;
}
.mapa-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--border-2);
}
.dot-realizado  { background: #64748b; }
.dot-en_curso   { background: var(--success); }
.dot-programado { background: var(--info); }
/* Etiqueta permanente junto a cada punto del mapa */
.leaflet-tooltip.mapa-etiqueta {
    background: #ffffff;
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow);
    color: var(--text);
    font-family: inherit;
    font-size: 0.7rem;
    line-height: 1.35;
    padding: 0.3rem 0.5rem;
    white-space: nowrap;
}
.leaflet-tooltip.mapa-etiqueta strong { color: var(--primary-dark); font-size: 0.72rem; }
.leaflet-tooltip.mapa-etiqueta { cursor: pointer; }
.leaflet-tooltip.mapa-etiqueta::before { display: none; }

/* Popups de Leaflet acordes al sistema */
.leaflet-popup-content { font-family: inherit; font-size: 0.82rem; line-height: 1.5; }
.leaflet-popup-content a { color: var(--primary-2); font-weight: 600; }

/* ============================================================================
 * MODALES
 * ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    z-index: 200;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.15s ease-out;
}
.modal-overlay.show { display: flex; }

.modal {
    background: white;
    border-radius: var(--r-lg);
    max-width: 820px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    flex-shrink: 0;
}
.modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
}
.modal-close {
    background: transparent;
    border: 1px solid var(--border-2);
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-size: 1.1rem;
    line-height: 1;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); border-color: var(--text-soft); }

.modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}
.modal-footer {
    padding: 0.85rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .modal-overlay { padding: 0; align-items: stretch; }
    .modal {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        max-width: none;
    }
    .modal-body { padding: 1rem; }
    .modal-header, .modal-footer { padding: 0.85rem 1rem; }
    .modal-footer { flex-direction: column-reverse; align-items: stretch; gap: 0.5rem; }
    .modal-footer .btn { width: 100%; }
    .modal-footer small { text-align: center; }
}

/* Body scroll lock cuando modal abierto */
body.modal-open { overflow: hidden; }

/* ============================================================================
 * ICONOS SVG
 * ========================================================================== */
.icon {
    display: inline-block;
    vertical-align: -3px;
    flex-shrink: 0;
    stroke: currentColor;
}
.icon + span,
span + .icon {
    margin-left: 0.1rem;
}
.btn .icon { vertical-align: -3px; margin-right: 0.05rem; }
.btn .icon:only-child { margin-right: 0; }
.sidebar a .icon { vertical-align: -3px; margin-right: 0.45rem; opacity: 0.7; }
.sidebar a.active .icon { opacity: 1; }
.modal-header .icon { vertical-align: -3px; margin-right: 0.4rem; color: var(--primary-2); }
.card-header h2 .icon { vertical-align: -3px; margin-right: 0.4rem; color: var(--primary-2); }
.chip .icon { vertical-align: -2px; width: 12px; height: 12px; }

.icon-missing {
    display: inline-block;
    width: 18px; height: 18px;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 4px;
    font-size: 0.7rem;
    text-align: center;
    line-height: 18px;
}

/* ============================================================================
 * TABS
 * ========================================================================== */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--surface);
    border-radius: var(--r-md) var(--r-md) 0 0;
    padding: 0.25rem 0.25rem 0;
    box-shadow: var(--shadow-sm);
}
.tab {
    padding: 0.7rem 1.1rem;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
    border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active {
    color: var(--primary-2);
    border-bottom-color: var(--primary-2);
    background: var(--surface);
    font-weight: 600;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.2s ease-out; }

@media (max-width: 640px) {
    .tabs { gap: 0; padding: 0; }
    .tab { padding: 0.6rem 0.8rem; font-size: 0.8rem; }
    .tab .icon { width: 16px; height: 16px; }
}

/* Modal extra grande para perfiles completos */
.modal.modal-xl { max-width: 1100px; }

/* Dentro del modal: header del perfil más compacto */
.modal .perfil-wrap { margin-top: 0; }
.modal .card { box-shadow: none; border-color: var(--border); }
.modal h1 { font-size: 1.4rem; }

/* ============================================================================
 * CARDS DE AGENTES (lista moderna)
 * ========================================================================== */
.agentes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.75rem;
}
.agente-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 0.9rem 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    position: relative;
}
.agente-card:hover {
    border-color: var(--primary-soft);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.agente-card.inactivo { opacity: 0.55; }
.agente-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.agente-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--r-sm);
    flex-shrink: 0;
    background: var(--surface-3);
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    overflow: hidden;
    border: 1px solid var(--border-2);
}
.agente-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.agente-avatar-lg {
    width: 64px; height: 64px; font-size: 1.2rem;
}
.agente-card-nombre {
    flex: 1;
    min-width: 0;
}
.agente-card-nombre strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.agente-card-nombre small {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 0.15rem;
}
.agente-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 0.6rem;
    font-size: 0.8rem;
}
.agente-info-row {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.agente-info-row .lbl {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.agente-info-row .val {
    font-size: 0.82rem;
    color: var(--text);
    font-weight: 500;
}
.agente-card-footer {
    display: flex;
    gap: 0.35rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.agente-card-footer .btn { flex: 1; min-width: 0; font-size: 0.78rem; padding: 0.35rem 0.5rem; }

/* Subir foto */
.foto-upload {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 2px dashed var(--border-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.15s;
    color: var(--text-soft);
    flex-shrink: 0;
}
.foto-upload:hover { border-color: var(--primary); color: var(--primary-2); }
.foto-upload img { width: 100%; height: 100%; object-fit: cover; }
.foto-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

@media (max-width: 640px) {
    .agentes-grid { grid-template-columns: 1fr; gap: 0.6rem; }
    .agente-card-body { font-size: 0.78rem; }
}

/* ============================================================================
 * BOXES INFORMATIVOS DEL OPERATIVO
 * ========================================================================== */
.info-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
    margin: 1rem 0 1.5rem;
    align-items: stretch;
}
.info-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.95rem 1rem;
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    box-shadow:
        0 1px 2px rgba(15,23,42,0.04),
        0 2px 8px rgba(15,23,42,0.04);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    position: relative;
    overflow: hidden;
}
.info-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--primary);
}
.info-box:hover {
    transform: translateY(-2px);
    box-shadow:
        0 1px 2px rgba(15,23,42,0.04),
        0 8px 24px rgba(31,78,121,0.12);
    border-color: #c3d3e2;
}
.info-box-empty {
    background: #fafbfc;
    border: 1px dashed #cbd5e1;
    box-shadow: none;
}

.info-box-icon {
    color: #1f4e79;
    flex-shrink: 0;
    background: var(--primary-light);
    border-radius: 10px;
    padding: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(31,78,121,0.15);
}
.info-box-empty .info-box-icon {
    color: #94a3b8;
    background: #f1f5f9;
    box-shadow: none;
}
.info-box-lbl {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.info-box-val {
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    word-break: break-word;
    letter-spacing: -0.01em;
}
.info-box-empty .info-box-val {
    color: #94a3b8;
    font-weight: 500;
    font-style: italic;
}
.info-box-edit {
    align-self: center;
    padding: 0.45rem 0.7rem;
    background: white;
    border: 1px dashed var(--border-2);
    color: var(--primary-2);
    font-weight: 500;
}
.info-box-edit:hover { background: var(--primary-light); border-color: var(--primary-2); }

/* Versión imprimible */
.print-info-operativo {
    border: 1px solid #000;
    padding: 0.25cm 0.4cm;
    margin: 0.3cm 0;
    font-size: 10pt;
    line-height: 1.5;
}
.print-info-operativo strong { letter-spacing: 0.05em; }

@media (max-width: 768px) {
    .info-boxes {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .info-box-edit { justify-self: stretch; }
}

/* Print sólo */
.print-only { display: none; }
@media print {
    .print-only { display: block; }
    .no-print-screen { display: none !important; }
}

/* ============================================================================
 * Mejorar tabla en mobile (responsive)
 * ========================================================================== */
@media (max-width: 768px) {
    .tabla { font-size: 0.82rem; }
    .tabla th, .tabla td { padding: 0.5rem 0.55rem; }
    .tabla .acciones .btn { font-size: 0.75rem; padding: 0.3rem 0.5rem; }
    .form-grid { grid-template-columns: 1fr !important; }
    .kpi { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .kpi .card { padding: 0.65rem 0.8rem; }
    .kpi .num { font-size: 1.1rem; }
    .card { padding: 0.9rem 1rem; }
    .parte-totales { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* ============================================================================
 * REEMPLAZOS - items mejorados
 * ========================================================================== */
.reemplazo-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 0.85rem 1rem;
    transition: all 0.15s;
}
.reemplazo-item:hover { box-shadow: var(--shadow-sm); }
.reemplazo-item-compact {
    padding: 0.6rem 0.85rem;
    font-size: 0.88rem;
}

/* Banner notificación */
.banner-pendientes {
    background: #fdf6e3;
    border: 1px solid #f59e0b;
    border-radius: var(--r-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}
.banner-pendientes .icon { color: #d97706; flex-shrink: 0; }
.banner-pendientes-text { flex: 1 }
.banner-pendientes strong { color: #78350f; }
.banner-pendientes small { color: #92400e; }

/* ============================================================================
 * RESUMEN GRID (boxes de totales)
 * ========================================================================== */
.resumen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
    margin-top: 0.6rem;
}
.resumen-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 0.7rem 0.85rem;
    transition: all 0.15s;
    text-align: left;
}
.resumen-stat:hover {
    border-color: var(--primary-soft);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.resumen-stat-primary {
    background: var(--primary-2);
    color: white;
    border-color: var(--primary);
}
.resumen-stat-primary .resumen-lbl,
.resumen-stat-primary small { color: rgba(255,255,255,0.85); }
.resumen-lbl {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}
.resumen-num {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.resumen-stat-primary .resumen-num { color: white; }
.resumen-stat small {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.2rem;
}

@media (max-width: 640px) {
    .resumen-grid { grid-template-columns: repeat(2, 1fr); }
    .resumen-num { font-size: 1.3rem; }
}

/* ============================================================================
 * IMPRESIÓN — Membrete oficial
 * ========================================================================== */
@media print {
    .print-membrete {
        display: grid;
        grid-template-columns: 80px 1fr 130px;
        gap: 0.4cm;
        align-items: center;
        padding-bottom: 0.25cm;
        border-bottom: 2px solid #000;
        margin-bottom: 0.3cm;
    }
    .print-logo-box {
        width: 70px;
        height: 70px;
        background: #1e3a8a;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 18pt;
        font-family: Arial, sans-serif;
        letter-spacing: 0.05em;
        border: 2px solid #000;
        border-radius: 6px;
    }
    .print-membrete-texto { line-height: 1.3; }
    .print-org-1 { font-size: 8pt; text-transform: uppercase; letter-spacing: 0.1em; color: #555; }
    .print-org-2 { font-size: 10pt; font-style: italic; margin: 1pt 0 2pt; }
    .print-org-3 { font-size: 13pt; font-weight: 800; letter-spacing: 0.05em; }
    .print-membrete-fecha {
        text-align: center;
        border: 1.5px solid #000;
        padding: 0.15cm 0.2cm;
        line-height: 1.2;
    }
    .print-fecha-grande { font-size: 11pt; font-weight: 800; letter-spacing: 0.08em; }
    .print-fecha-num    { font-size: 13pt; font-weight: 700; margin-top: 1pt; }
    .print-fecha-anio   { font-size: 11pt; font-weight: 600; }

    .print-titulo-doc {
        text-align: center;
        font-size: 13pt;
        margin: 0.3cm 0;
        letter-spacing: 0.08em;
        font-weight: 800;
        text-transform: uppercase;
        text-decoration: underline;
    }

    .print-datos-operativo {
        border: 1px solid #000;
        padding: 0.2cm 0.35cm;
        margin: 0.25cm 0;
        font-size: 10pt;
        line-height: 1.5;
        background: #f5f5f5;
    }
    .print-datos-operativo strong { letter-spacing: 0.05em; min-width: 4cm; display: inline-block; }
}

/* ============================================================================
 * TABLAS PROLIJAS — fix de estilos
 * ========================================================================== */
.tabla {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    font-size: 0.88rem;
}
.tabla thead th {
    background: var(--surface-2);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.65rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.tabla tbody td {
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.tabla tbody tr:last-child td { border-bottom: none; }
.tabla tbody tr:hover { background: var(--surface-2); }
.tabla .acciones {
    display: flex;
    gap: 0.3rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.tabla .text-right { text-align: right; }
.tabla .text-center { text-align: center; }
.tabla-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
}

/* TABLA DE CONVOCADOS — compacta para imprimir 20 en una hoja */
.tabla-convocados th, .tabla-convocados td {
    padding: 0.4rem 0.65rem;
    font-size: 0.83rem;
}
.tabla-convocados tbody tr:nth-child(even) { background: var(--surface-2); }
.tabla-convocados tbody tr:hover { background: #eef3f8; }

/* FORMS — filtros prolijos */
.form-group label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.form-group input[type="text"],
.form-group input[type="search"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="month"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.92rem;
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.12s, box-shadow 0.12s;
    font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 66, 103, 0.12);
}

/* Esconder columnas en móvil */
@media (max-width: 640px) {
    .hide-mobile { display: none; }
}

/* Print: ocultar columnas de acción y #s */
@media print {
    .no-print, .no-print * { display: none !important; }
    .tabla-convocados th, .tabla-convocados td {
        padding: 0.15cm 0.25cm;
        font-size: 9.5pt;
        border: 1px solid #000 !important;
    }
    .tabla-convocados tbody tr:nth-child(even) { background: #f5f5f5 !important; -webkit-print-color-adjust: exact; }
}

/* ============================================================================
 * Tabla de convocados - COMPACTA (tanto pantalla como impresión)
 * ========================================================================== */
.tabla-convocados {
    font-size: 0.85rem;
}
.tabla-convocados th,
.tabla-convocados td {
    padding: 0.4rem 0.55rem;
    line-height: 1.25;
}
.tabla-convocados td strong { font-weight: 600; }
.tabla-convocados td small { font-size: 0.72rem; }

@media print {
    .tabla-convocados {
        font-size: 9pt;
        width: 100%;
        border-collapse: collapse;
        margin-top: 0.3cm;
    }
    .tabla-convocados th {
        background: #e5e7eb !important;
        color: #000 !important;
        font-size: 8pt;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        padding: 0.15cm 0.2cm;
        border: 1px solid #000;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .tabla-convocados td {
        padding: 0.1cm 0.2cm;
        border: 1px solid #000;
        font-size: 9pt;
    }
    .tabla-convocados td small { font-size: 7pt; }
    .tabla-convocados td strong { font-weight: 700; }
}

/* Listado de partes - filtros */
.filtros-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.6rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 0.85rem;
    background: var(--surface-2);
    border-radius: var(--r-md);
    border: 1px solid var(--border);
}
.filtros-bar .form-group { margin: 0; }
.filtros-bar label { font-size: 0.72rem; }
.filtros-bar .btn { white-space: nowrap; }

/* ============================================================================
 * FIX COLORES BOXES RESUMEN
 * Solo asegurar que el <small> dentro del box primario (azul) se vea blanco.
 * NO tocar el hover ni los otros boxes.
 * ========================================================================== */
.resumen-stat-primary small { color: rgba(255, 255, 255, 0.95) !important; }

/* Botón eliminar */
.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: white; }

/* ============================================================================
 * VISTA EN CASCADA DE PARTES SEMANALES
 * Muestra varias grillas de partes una abajo de otra agrupadas por mes
 * ========================================================================== */
.cal-mes-titulo {
    font-size: 1.15rem;
    margin: 1.5rem 0 0.8rem;
    color: var(--text);
    font-weight: 700;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
}
.cal-mes-titulo:first-child { margin-top: 0; }

.parte-cascada {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--surface);
}
.parte-cascada-header {
    padding: 0.75rem 1rem;
    background: var(--surface-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    border-bottom: 1px solid var(--border);
}
.parte-cascada-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}
.parte-cascada-tabla {
    border: none;
    border-radius: 0;
}
.parte-grilla-mini {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.parte-grilla-mini th, .parte-grilla-mini td {
    padding: 0.4rem 0.5rem;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.parte-grilla-mini th:last-child, .parte-grilla-mini td:last-child { border-right: none; }
.parte-grilla-mini thead th {
    background: var(--surface-2);
    text-transform: none;
    letter-spacing: 0;
}
.parte-grilla-mini .finde { background: rgba(31, 78, 121, 0.03); }
.parte-grilla-mini .t-horario { font-weight: 600; color: var(--primary); white-space: nowrap; }
.parte-grilla-mini .t-tipo {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    color: white;
    font-weight: 700;
    font-size: 0.72rem;
}

/* ============================================================================
 * COPIAR/PEGAR CELDAS DEL PARTE SEMANAL
 * ========================================================================== */
.celda-turno { position: relative; }
.celda-acciones {
    position: absolute;
    top: 2px;
    right: 2px;
    display: flex;
    gap: 0.15rem;
    opacity: 0.35;
    transition: opacity 0.12s;
    z-index: 3;
}
.celda-turno:hover .celda-acciones { opacity: 1; }
.celda-acciones .link-edit {
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.celda-acciones .link-edit:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: white;
    transform: scale(1.1);
}
.celda-acciones .btn-editar {
    color: var(--primary-2) !important;
    border-color: var(--primary-2) !important;
    background: rgba(31, 78, 121, 0.12) !important;
}
.celda-acciones .btn-editar:hover {
    background: var(--primary-2) !important;
    color: white !important;
}
/* Editable: cursor de "grab" + doble click abre editor */
.celda-editable { cursor: grab; }
.celda-editable[draggable="true"]:active { cursor: grabbing; }
.celda-editable:not([data-vacio="0"]) { cursor: cell; }

/* Estados durante drag & drop */
.celda-dragging {
    opacity: 0.4;
    background: rgba(31, 78, 121, 0.15) !important;
}
.celda-drop-target {
    background: rgba(16, 185, 129, 0.15) !important;
    outline: 2px dashed var(--success);
    outline-offset: -3px;
}

/* Tooltip flotante al hover */
.celda-editable::after {
    content: 'Doble click: editar · Arrastrar: mover';
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 5;
}
.celda-editable:hover::after { opacity: 0.9; }
.btn-paste {
    color: var(--success) !important;
    border-color: var(--success) !important;
    background: rgba(16, 185, 129, 0.08) !important;
}
.btn-paste:hover {
    background: var(--success) !important;
    color: white !important;
}

/* ============================================================================
 * FILAS BLOQUEADAS / ADVERTENCIA EN MODAL CONVOCAR
 * ========================================================================== */
.fila-bloqueada {
    opacity: 0.5;
    background: var(--surface-2);
}
.fila-bloqueada td { color: var(--text-muted) !important; }
.fila-bloqueada strong { color: var(--text-muted) !important; }
.fila-advertencia {
    background: #fffbeb;
}
.fila-advertencia:hover { background: #fef3c7; }

/* ============================================================================
 * SERVICIOS DEL DÍA — CARDS por sector (pantalla)
 * ========================================================================== */
.sec-dia-titulo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    margin: 1.8rem 0 1.1rem;
    padding-bottom: 0.7rem;
    color: var(--text);
    font-weight: 800;
    letter-spacing: 0.01em;
    border-bottom: 2px solid transparent;
    background: white;
    text-transform: none;
}
.sec-dia-titulo::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--border);
    margin-left: 0.5rem;
}
.sec-dia-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.sec-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 1px 2px rgba(15,23,42,0.04),
        0 4px 12px rgba(15,23,42,0.05);
    transition: transform 0.15s, box-shadow 0.15s;
    page-break-inside: avoid;
}
.sec-card:hover {
    transform: translateY(-1px);
    box-shadow:
        0 1px 2px rgba(15,23,42,0.04),
        0 8px 24px rgba(31,78,121,0.10);
    border-color: #c3d3e2;
}
.sec-card-header {
    background: var(--surface-2);
    padding: 0.85rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid #e2e8f0;
}
.sec-card-header h4 {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #1e293b;
    text-transform: uppercase;
}
.sec-card-header small {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
    display: block;
    margin-top: 2px;
}
.sec-card-header .btn-sm {
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 1px 3px rgba(31,78,121,0.3);
    font-weight: 700;
}
.sec-card-header .btn-sm:hover {
    background: var(--primary-2);
    transform: scale(1.05);
}
.sec-card-body {
    padding: 0.3rem 0;
    flex: 1;
}
.sec-card-fila {
    display: grid;
    grid-template-columns: minmax(90px, 130px) 1fr;
    gap: 0.7rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px dashed #e2e8f0;
    align-items: center;
}
.sec-card-fila:last-child { border-bottom: none; }
.sec-card-horario {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
    font-weight: 700;
    font-size: 0.78rem;
    color: #153655;
    background: var(--primary-light);
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    white-space: nowrap;
    border: 1px solid rgba(31, 78, 121, 0.18);
    justify-self: start;
    letter-spacing: -0.01em;
}
.sec-card-horario::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #1f4e79;
    flex-shrink: 0;
}
.sec-card-vacio {
    padding: 1.2rem 1rem;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    font-size: 0.82rem;
}
.sec-card-agentes {
    line-height: 1.7;
    font-size: 0.85rem;
    color: #334155;
}
.sec-card-agentes strong {
    color: #0f172a;
    font-weight: 700;
}
.badge-extra-inline {
    display: inline-flex;
    align-items: center;
    background: #fbecec;
    color: #b91c1c;
    padding: 0.1rem 0.45rem;
    border-radius: 99px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin-left: 0.25rem;
    vertical-align: middle;
    border: 1px solid rgba(220, 38, 38, 0.2);
    text-transform: uppercase;
}
.print-only { display: none; }

/* ============================================================================
 * IMPRESIÓN — Parte de finde en HOJA OFICIO (216 x 330 mm)
 * ========================================================================== */
/* (bloque @media print obsoleto eliminado en etapa 14 — reglas pisadas por el bloque final) */

/* Boxes clickeables del dashboard */
.resumen-stat-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
}
.resumen-stat-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
.resumen-stat-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Grilla de datos personales del agente */
.datos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.6rem 1rem;
}
.dato-item {
    padding: 0.55rem 0.8rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}
.dato-lbl {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.dato-val { font-size: 0.92rem; font-weight: 600; color: var(--text); }

/* Compañeros del sector en calendario del agente */
.cal-companeros {
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--border);
}
.cal-companeros-titulo {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
    font-weight: 700;
}
.cal-companero {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    padding: 0.2rem 0;
    font-size: 0.75rem;
    line-height: 1.3;
    flex-wrap: wrap;
}
.cal-companero strong { color: var(--primary); font-family: 'Courier New', monospace; font-size: 0.72rem; }
.cal-companero span { color: var(--text); }

/* ============================================================================
 * CALENDARIO MENSUAL del agente
 * ========================================================================== */
.mes-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    background: var(--border);
    padding: 4px;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
}
.mes-cabecera {
    background: var(--surface-2);
    padding: 0.4rem 0.3rem;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    text-transform: uppercase;
    border-radius: var(--r-sm);
}
.mes-celda {
    background: var(--surface);
    padding: 0.4rem;
    min-height: 96px;
    border-radius: var(--r-sm);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
}
.mes-celda-vacia {
    background: transparent;
    min-height: 60px;
}
.mes-celda-hoy {
    border: 2px solid var(--primary);
    background: rgba(31, 78, 121, 0.05);
}
.mes-celda-finde {
    background: rgba(248, 250, 252, 0.7);
}
.mes-celda-num {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.2rem;
}
.mes-celda-hoy .mes-celda-num {
    color: var(--primary);
}

.mes-turno {
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    line-height: 1.2;
    border-left: 3px solid;
}
.mes-turno-hora {
    display: block;
    font-family: 'Courier New', monospace;
    font-weight: 700;
}
.mes-turno-lbl {
    display: block;
    font-size: 0.6rem;
    margin-top: 0.1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.mes-turno-normal {
    background: rgba(31, 78, 121, 0.08);
    border-left-color: var(--primary);
    color: var(--primary-2, #153655);
}
.mes-turno-extra {
    background: rgba(239, 68, 68, 0.08);
    border-left-color: var(--danger);
    color: var(--danger);
}
.mes-turno-confirmado {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--success);
    color: #059669;
}
.mes-turno-ausencia {
    background: #f3f4f6;
    border-left-color: #6b7280;
    color: #4b5563;
}
.mes-turno-solicitud {
    background: rgba(245, 158, 11, 0.12) !important;
    border-left-color: #f59e0b !important;
    color: #b45309 !important;
    outline: 1px dashed rgba(245, 158, 11, 0.5);
    outline-offset: -2px;
}
.mes-turno-solicitud .mes-turno-lbl {
    color: #b45309;
    font-weight: 700;
    font-size: 0.65rem;
}
.btn-mini {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    width: 100%;
}
.btn-mini.btn-success {
    background: var(--success);
    color: white;
}
.btn-mini.btn-success:hover {
    background: #059669;
}
.leyenda-color {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    vertical-align: middle;
    border-left: 3px solid;
}

/* Móvil: scroll horizontal o vista compacta */
@media (max-width: 640px) {
    .mes-celda {
        min-height: 70px;
        padding: 0.25rem;
    }
    .mes-celda-num {
        font-size: 0.75rem;
    }
    .mes-turno {
        padding: 0.15rem 0.25rem;
        font-size: 0.6rem;
    }
    .mes-turno-hora {
        font-size: 0.6rem;
    }
    .mes-turno-lbl {
        display: none;
    }
}

/* Turno previsto en el calendario (horario base sin parte firmado) */
.mes-turno-previsto {
    background: rgba(148, 163, 184, 0.12);
    border-left-color: #94a3b8;
    color: #475569;
    border-style: dashed;
    border-left-style: solid;
    border-width: 1px;
    border-left-width: 3px;
}
.mes-turno-previsto .mes-turno-lbl {
    font-style: italic;
    text-transform: none;
}

/* ============================================================================
 * HORARIOS LABORALES del agente - vista simple (no es un calendario)
 * ========================================================================== */
.horarios-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.6rem;
}
.horario-dia {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 1rem 0.8rem;
    text-align: center;
    background: var(--surface);
    transition: transform 0.12s;
}
.horario-dia-trabaja {
    border-left: 4px solid var(--primary);
    background: var(--surface);
}
.horario-dia-libre {
    border-left: 4px solid #94a3b8;
    background: #f8fafc;
    opacity: 0.85;
}
.horario-dia-finde {
    background: #fefce8;
}
.horario-dia-finde.horario-dia-libre {
    background: #fefce8;
    opacity: 0.7;
}
.horario-dia-nombre {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-bottom: 0.6rem;
}
.horario-dia-trabaja .horario-dia-nombre {
    color: var(--primary);
}
.horario-dia-rango {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.3rem;
}
.horario-sep {
    color: var(--text-muted);
    margin: 0 0.15rem;
}
.horario-dia-dur {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}
.horario-dia-libre-txt {
    color: #94a3b8;
    font-style: italic;
    font-size: 0.88rem;
    padding: 0.5rem 0;
}

/* Mobile: una columna por fila, día al costado */
@media (max-width: 720px) {
    .horarios-grid {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }
    .horario-dia {
        display: grid;
        grid-template-columns: 110px 1fr auto;
        align-items: center;
        text-align: left;
        padding: 0.6rem 0.85rem;
        gap: 0.8rem;
    }
    .horario-dia-nombre {
        margin-bottom: 0;
        font-size: 0.85rem;
    }
    .horario-dia-rango {
        margin-bottom: 0;
        font-size: 0.9rem;
    }
    .horario-dia-dur {
        text-align: right;
    }
    .horario-dia-libre-txt {
        padding: 0;
        text-align: center;
        grid-column: 2 / 4;
    }
}

/* Celda con operativo clickeable */
.mes-turno-clickable {
    cursor: pointer;
    transition: all 0.12s;
}
.mes-turno-clickable:hover {
    transform: scale(1.03);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    filter: brightness(1.05);
}

/* ============================================================================
 * MODAL: Parte de operativo completo (visualización tipo impreso)
 * ========================================================================== */
.parte-doc-bloque {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--border);
}
.parte-doc-bloque:last-child { border-bottom: none; margin-bottom: 0; }

.parte-doc-titulo {
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    border-top: 2px solid var(--text);
    border-bottom: 2px solid var(--text);
    padding: 0.5rem 0;
    margin: 0 0 0.85rem;
}
.parte-doc-subtitulo {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border);
}
.parte-doc-datos {
    display: grid;
    gap: 0.35rem;
    font-size: 0.9rem;
    padding: 0.6rem 0.85rem;
    background: var(--surface-2);
    border-radius: var(--r-sm);
}
.parte-doc-datos strong { color: var(--text-muted); margin-right: 0.4rem; }

.parte-doc-jerarquia {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.parte-doc-jerarquia td {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
}
.parte-doc-jerarquia .cargo {
    background: var(--surface-2);
    font-weight: 600;
    text-transform: uppercase;
    width: 45%;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
}
.parte-doc-jerarquia .persona {
    font-weight: 600;
}

.parte-doc-sector {
    margin-bottom: 0.85rem;
}
.parte-doc-sector-nombre {
    background: var(--primary);
    color: white;
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.parte-doc-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    border: 1px solid var(--border);
    border-top: none;
}
.parte-doc-tabla th {
    background: var(--surface-2);
    padding: 0.35rem 0.5rem;
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.parte-doc-tabla td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--border);
}
.parte-doc-tabla tr:last-child td { border-bottom: none; }
.parte-doc-yo {
    background: rgba(31, 78, 121, 0.08);
}
.parte-doc-yo td {
    border-bottom-color: rgba(31, 78, 121, 0.2);
}

.parte-doc-mi {
    background: rgba(31, 78, 121, 0.04);
    padding: 0.85rem;
    border-radius: var(--r-md);
    border: 1px solid rgba(31, 78, 121, 0.15);
    border-bottom: 1px solid rgba(31, 78, 121, 0.15) !important;
}

.parte-doc-acciones {
    background: rgba(245, 158, 11, 0.05);
    padding: 0.85rem;
    border-radius: var(--r-md);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-bottom: 1px solid rgba(245, 158, 11, 0.2) !important;
}

@media (max-width: 640px) {
    .parte-doc-titulo { font-size: 0.78rem; }
    .parte-doc-datos { font-size: 0.82rem; }
    .parte-doc-tabla, .parte-doc-jerarquia { font-size: 0.72rem; }
    .parte-doc-tabla th, .parte-doc-tabla td,
    .parte-doc-jerarquia td { padding: 0.25rem 0.35rem; }
}


/* ============================================================================
 * IMPRESIÓN — Documento oficial B/N — diseño cuidado y compacto
 * - Borde decorativo doble alrededor
 * - Datos en 2 columnas
 * - Tabla UNIFICADA de servicios (no cards)
 * - Headers con barra decorativa
 * - Filas zebreadas en tabla semanal
 * ============================================================================ */
@media print {
    @page { size: A4; margin: 1.1cm 1.2cm 1.2cm; }

    body, .app, .layout, .main, .card, .card-header {
        background: white !important;
        color: #000 !important;
        font-family: 'Georgia', 'Times New Roman', serif !important;
        font-size: 10pt !important;
        line-height: 1.4 !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
        height: auto !important;
    }

    /* Pestañas: al imprimir se muestra todo el contenido */
    .tabs { display: none !important; }
    .tab-panel { display: block !important; }

    /* Estructura: lo que mostraba/ocultaba el bloque base eliminado */
    .app, .layout { display: block !important; }
    .no-print-screen { display: none !important; }
    .print-only, .print-encabezado, .print-firma { display: block !important; }

    /* OCULTAR todo lo decorativo de pantalla */
    .topbar, .sidebar, .sidebar-overlay, .menu-toggle,
    .no-print, .flash, .form-actions, .info-box-edit,
    .filtros-bar, .guia-pasos, [class*="leyenda"],
    .card-header > div:last-child, button, .btn,
    .info-boxes, .info-box, .print-info-operativo,
    .convocatorias-titulo, .convocatoria-card form,
    .parte-totales, .tabla-convocados,
    h3:not(.print-titulo-doc) svg, h4 svg, h2 svg,
    .agente-avatar, [class*="avatar"],
    .sec-dia-grid,
    .sec-card,
    h3.sec-dia-titulo + .parte-totales { display: none !important; }

    .tabla-wrap:has(> .tabla-convocados) { display: none !important; }

    /* tabla-wrap no debe recortar contenido en papel */
    .tabla-wrap { overflow: visible !important; border: none !important; box-shadow: none !important; }

    /* DOCUMENTO con borde decorativo doble (tipo certificado) */
    .card {
        border: 2px solid #000 !important;
        outline: 1px solid #000 !important;
        outline-offset: 4px !important;
        padding: 0.4cm 0.5cm !important;
    }

    /* ============================================================
     * ENCABEZADO - layout 3 columnas: logo | datos | fecha
     * ============================================================ */
    .print-encabezado {
        margin: 0 0 0.4cm !important;
        padding-bottom: 0.3cm !important;
        border-bottom: 2px double #000 !important;
        position: relative !important;
    }
    .print-membrete {
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        align-items: center !important;
        gap: 0.6cm !important;
    }
    .print-logo, .print-logo-box {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 1.7cm !important;
        height: 1.7cm !important;
        background: #000 !important;
        color: #fff !important;
        font-family: 'Georgia', serif !important;
        font-weight: 700 !important;
        font-size: 14pt !important;
        letter-spacing: 0.05em !important;
        border-radius: 3px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .print-membrete-texto { text-align: left !important; line-height: 1.25 !important; }
    .print-org-1 {
        font-family: 'Georgia', serif !important;
        font-size: 8pt !important;
        text-transform: uppercase !important;
        letter-spacing: 0.22em !important;
        color: #555 !important;
        font-weight: 400 !important;
    }
    .print-org-2 {
        font-family: 'Georgia', serif !important;
        font-size: 9.5pt !important;
        font-style: italic !important;
        color: #333 !important;
        margin: 2pt 0 !important;
    }
    .print-org-3 {
        font-family: 'Georgia', serif !important;
        font-size: 15pt !important;
        font-weight: 700 !important;
        letter-spacing: 0.04em !important;
        color: #000 !important;
        line-height: 1.1 !important;
        text-transform: uppercase !important;
    }
    .print-membrete-fecha {
        font-family: 'Georgia', serif !important;
        text-align: center !important;
        padding: 6pt 14pt !important;
        border: 1.5px solid #000 !important;
        background: white !important;
        font-style: italic !important;
        line-height: 1.3 !important;
        min-width: 2.6cm !important;
        position: relative !important;
    }
    .print-membrete-fecha::after {
        content: '' !important;
        position: absolute !important;
        inset: 2pt !important;
        border: 1px solid #000 !important;
        pointer-events: none !important;
    }
    .print-fecha-grande {
        font-size: 9.5pt !important;
        font-weight: 700 !important;
        letter-spacing: 0.08em !important;
        text-transform: uppercase !important;
        position: relative !important;
        z-index: 1 !important;
    }
    .print-fecha-num {
        font-size: 13pt !important;
        font-weight: 400 !important;
        margin: 2pt 0 !important;
        position: relative !important;
        z-index: 1 !important;
    }
    .print-fecha-anio {
        font-size: 9pt !important;
        color: #555 !important;
        position: relative !important;
        z-index: 1 !important;
    }

    /* ============================================================
     * TÍTULO DEL DOCUMENTO - banda decorativa
     * ============================================================ */
    h1.print-titulo-doc, .print-titulo-doc {
        text-align: center !important;
        font-family: 'Georgia', serif !important;
        font-size: 14pt !important;
        font-weight: 700 !important;
        font-style: italic !important;
        letter-spacing: 0.15em !important;
        text-transform: uppercase !important;
        color: #000 !important;
        margin: 0.3cm 0 0.4cm !important;
        padding: 8pt 0 !important;
        background: #f0f0f0 !important;
        border-top: 1px solid #000 !important;
        border-bottom: 1px solid #000 !important;
        text-decoration: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* ============================================================
     * DATOS DEL OPERATIVO — caja destacada 2 columnas
     * ============================================================ */
    .print-datos-operativo {
        background: white !important;
        border: 1.5px solid #000 !important;
        padding: 8pt 12pt !important;
        margin: 0 0 0.35cm !important;
        font-family: 'Georgia', serif !important;
        font-size: 10pt !important;
        line-height: 1.55 !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        column-gap: 0.8cm !important;
        row-gap: 3pt !important;
        position: relative !important;
    }
    .print-datos-operativo::before {
        content: '' !important;
        position: absolute !important;
        left: 50% !important;
        top: 8pt !important;
        bottom: 8pt !important;
        width: 1px !important;
        background: #ccc !important;
    }
    .print-datos-operativo div { padding: 0 !important; }
    .print-datos-operativo strong {
        font-family: 'Georgia', serif !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        font-size: 8pt !important;
        letter-spacing: 0.1em !important;
        color: #444 !important;
        display: block !important;
        margin-bottom: 1pt !important;
    }

    /* ============================================================
     * SECCIÓN HEADER - banda decorativa con líneas
     * ============================================================ */
    h3.sec-dia-titulo, .sec-dia-titulo,
    .seccion-titulo {
        background: white !important;
        font-family: 'Georgia', serif !important;
        font-size: 10pt !important;
        font-weight: 700 !important;
        text-align: center !important;
        text-transform: uppercase !important;
        letter-spacing: 0.2em !important;
        border: none !important;
        padding: 0 !important;
        margin: 0.4cm 0 0.2cm !important;
        color: #000 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8pt !important;
    }
    /* no-print le gana al display:flex del título de sección */
    h3.sec-dia-titulo.no-print, .sec-dia-titulo.no-print { display: none !important; }
    h3.sec-dia-titulo::before, .sec-dia-titulo::before,
    h3.sec-dia-titulo::after, .sec-dia-titulo::after {
        content: '' !important;
        flex: 1 !important;
        height: 3px !important;
        border-top: 1px solid #000 !important;
        border-bottom: 1px solid #000 !important;
        display: block !important;
    }

    /* ============================================================
     * TABLA DE JERARQUÍA
     * ============================================================ */
    .tabla-jerarquia {
        width: 100% !important;
        border-collapse: collapse !important;
        margin: 0.2cm 0 0.35cm !important;
        font-family: 'Georgia', serif !important;
        font-size: 9.5pt !important;
        border: 1.5px solid #000 !important;
    }
    .tabla-jerarquia td {
        border: 1px solid #999 !important;
        padding: 3pt 10pt !important;
        background: white !important;
        vertical-align: middle !important;
    }
    .tabla-jerarquia tr:nth-child(even) td { background: #f9f9f9 !important; -webkit-print-color-adjust: exact !important; }
    .tabla-jerarquia td.cargo {
        font-weight: 500 !important;
        font-size: 8.5pt !important;
        letter-spacing: 0.06em !important;
        text-transform: uppercase !important;
        color: #444 !important;
        width: 60% !important;
        border-right: 1.5px solid #000 !important;
    }
    .tabla-jerarquia td.persona {
        font-weight: 700 !important;
        font-size: 10pt !important;
        letter-spacing: 0.02em !important;
    }

    /* ============================================================
     * TABLA UNIFICADA DE SERVICIOS DEL DÍA (parte finde)
     * ============================================================ */
    .tabla-servicios-print {
        width: 100% !important;
        border-collapse: collapse !important;
        border: 1.5px solid #000 !important;
        font-family: 'Georgia', serif !important;
        font-size: 10pt !important;
        margin: 0.1cm 0 0.4cm !important;
        background: white !important;
        page-break-inside: auto;
    }
    .tabla-servicios-print thead { display: table-header-group !important; }
    .tabla-servicios-print tbody tr { page-break-inside: avoid !important; }
    .tabla-servicios-print thead th {
        background: #1a1a1a !important;
        color: white !important;
        border: 1px solid #000 !important;
        padding: 6pt 8pt !important;
        font-family: 'Georgia', serif !important;
        font-weight: 700 !important;
        font-size: 9pt !important;
        text-transform: uppercase !important;
        letter-spacing: 0.12em !important;
        text-align: left !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .tabla-servicios-print thead th.col-sector { width: 28% !important; }
    .tabla-servicios-print thead th.col-horario { width: 18% !important; text-align: center !important; }
    .tabla-servicios-print tbody td {
        border: 1px solid #aaa !important;
        padding: 5pt 8pt !important;
        background: white !important;
        font-family: 'Georgia', serif !important;
        vertical-align: middle !important;
    }
    .tabla-servicios-print tbody td.col-sector {
        font-weight: 700 !important;
        font-size: 10pt !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
        background: #f0f0f0 !important;
        border-right: 1.5px solid #000 !important;
        -webkit-print-color-adjust: exact !important;
    }
    .tabla-servicios-print tbody td.col-horario {
        font-family: 'Georgia', serif !important;
        font-weight: 700 !important;
        font-size: 9.5pt !important;
        text-align: center !important;
        font-variant-numeric: tabular-nums !important;
        white-space: nowrap !important;
        background: #fafafa !important;
        -webkit-print-color-adjust: exact !important;
    }
    .tabla-servicios-print tbody td.col-agentes {
        font-family: 'Georgia', serif !important;
        font-size: 10pt !important;
        line-height: 1.5 !important;
    }
    .tabla-servicios-print .mk-extra {
        background: #000 !important;
        color: white !important;
        padding: 0 4pt !important;
        font-size: 6pt !important;
        font-weight: 700 !important;
        letter-spacing: 0.08em !important;
        margin-left: 3pt !important;
        vertical-align: 1pt !important;
        -webkit-print-color-adjust: exact !important;
    }

    /* ============================================================
     * GRILLA SEMANAL — moderna y prolija
     * ============================================================ */
    .parte-grilla {
        width: 100% !important;
        border-collapse: collapse !important;
        border: 1.5px solid #000 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        font-family: 'Georgia', serif !important;
        font-size: 9.5pt !important;
        margin: 0.2cm 0 0.15cm !important;
        background: white !important;
        page-break-inside: auto;
    }
    .parte-grilla thead { display: table-header-group !important; }
    .parte-grilla tbody tr { page-break-inside: avoid !important; }
    .parte-grilla thead th {
        background: #1a1a1a !important;
        color: white !important;
        border: 1px solid #000 !important;
        padding: 6pt 4pt !important;
        font-family: 'Georgia', serif !important;
        font-weight: 700 !important;
        font-size: 8.5pt !important;
        text-transform: uppercase !important;
        letter-spacing: 0.08em !important;
        text-shadow: none !important;
        -webkit-print-color-adjust: exact !important;
    }
    .parte-grilla thead th:first-child {
        background: #000 !important;
        text-align: left !important;
        padding-left: 8pt !important;
        width: 3.4cm !important;
    }
    .parte-grilla thead th small {
        display: block !important;
        font-family: 'Georgia', serif !important;
        font-weight: 400 !important;
        color: #ccc !important;
        font-size: 8pt !important;
        font-style: italic !important;
        margin-top: 1pt !important;
        opacity: 1 !important;
        letter-spacing: 0 !important;
        text-transform: none !important;
    }
    .parte-grilla thead th.finde { background: #333 !important; }
    .parte-grilla thead th.col-hoy::after { display: none !important; }

    .parte-grilla tbody td {
        border: 1px solid #aaa !important;
        background: white !important;
        padding: 3pt 2pt !important;
        text-align: center !important;
        font-family: 'Georgia', serif !important;
        font-size: 9pt !important;
        vertical-align: middle !important;
        overflow: hidden !important;
    }
    .parte-grilla tbody tr:nth-child(even) td {
        background: #fafafa !important;
        -webkit-print-color-adjust: exact !important;
    }
    .parte-grilla tbody td:first-child {
        text-align: left !important;
        background: #f2f2f2 !important;
        padding-left: 6pt !important;
        padding-right: 3pt !important;
        font-weight: 700 !important;
        border-right: 1.5px solid #000 !important;
        font-size: 9pt !important;
        -webkit-print-color-adjust: exact !important;
    }
    .parte-grilla tbody tr:nth-child(even) td:first-child { background: #eaeaea !important; -webkit-print-color-adjust: exact !important; }
    .parte-grilla tbody tr:hover td { background: white !important; }
    .parte-grilla td.finde { background: #f5f5f5 !important; -webkit-print-color-adjust: exact !important; }
    .parte-grilla tbody tr:nth-child(even) td.finde { background: #ececec !important; -webkit-print-color-adjust: exact !important; }
    .parte-grilla td.col-hoy { box-shadow: none !important; background: white !important; }

    /* En pantalla .celda-turno tiene min-height 50px / min-width 95px:
       en papel eso infla las filas — resetear */
    .celda-turno {
        min-width: 0 !important;
        min-height: 0 !important;
        height: auto !important;
    }

    /* Celdas de turno: texto plano, NUNCA cortar el horario en dos líneas */
    .celda-turno .t-horario,
    .celda-turno .t-horario.t-tarde,
    .celda-turno .t-horario.t-noche {
        display: inline-block !important;
        white-space: nowrap !important;
        background: transparent !important;
        color: #000 !important;
        border: none !important;
        padding: 0 !important;
        font-family: 'Georgia', serif !important;
        font-variant-numeric: tabular-nums !important;
        font-weight: 600 !important;
        font-size: 8pt !important;
        box-shadow: none !important;
        letter-spacing: -0.01em !important;
    }
    .celda-turno .t-horario::before { display: none !important; }

    .celda-turno .t-tipo,
    .celda-turno .t-tipo.t-franco,
    .celda-turno .t-tipo.t-licencia,
    .celda-turno .t-tipo.t-carpeta,
    .celda-turno .t-tipo.t-rp,
    .celda-turno .t-tipo.t-vacaciones {
        display: inline-block !important;
        background: white !important;
        color: #000 !important;
        border: 1.5px solid #000 !important;
        padding: 1pt 6pt !important;
        font-family: 'Georgia', serif !important;
        font-style: italic !important;
        font-weight: 700 !important;
        font-size: 9pt !important;
        box-shadow: none !important;
        text-transform: uppercase !important;
    }
    .celda-turno .badge-extra {
        display: block !important;
        width: fit-content !important;
        margin: 1.5pt auto 0 !important;
        background: #000 !important;
        color: white !important;
        border: none !important;
        padding: 0 4pt !important;
        font-size: 6pt !important;
        font-family: 'Georgia', serif !important;
        font-weight: 700 !important;
        letter-spacing: 0.08em !important;
        border-radius: 0 !important;
        text-transform: uppercase !important;
        -webkit-print-color-adjust: exact !important;
    }
    .celda-turno .t-vacio { color: #aaa !important; font-size: 10pt !important; }

    /* Agente: solo texto */
    .parte-grilla .agente-info { gap: 0 !important; display: block !important; }
    .parte-grilla .agente-info-text { display: block !important; }
    .parte-grilla .agente-info strong {
        display: inline !important;
        font-family: 'Georgia', serif !important;
        font-weight: 700 !important;
        font-size: 8.5pt !important;
        line-height: 1.2 !important;
    }
    .parte-grilla .agente-info small {
        display: inline !important;
        font-family: 'Georgia', serif !important;
        font-size: 7.5pt !important;
        font-style: italic !important;
        color: #777 !important;
        margin: 0 0 0 4pt !important;
    }

    /* FIRMA */
    .parte-firma, .firma-jefe, .print-firma {
        margin-top: 0.35cm !important;
        text-align: center !important;
        font-family: 'Georgia', serif !important;
        page-break-inside: avoid !important;
    }
    .firma-linea {
        display: block !important;
        border-top: 1px solid #000 !important;
        width: 6cm !important;
        margin: 0 auto 3pt !important;
    }
    .firma-nombre {
        font-weight: 700 !important;
        font-size: 10pt !important;
        letter-spacing: 0.08em !important;
        text-transform: uppercase !important;
    }
    .firma-cargo {
        font-size: 8.5pt !important;
        font-style: italic !important;
        color: #555 !important;
        margin-top: 1pt !important;
    }

    @page {
        @bottom-center {
            content: counter(page) " / " counter(pages);
            font-family: 'Georgia', serif;
            font-size: 8pt;
            color: #888;
        }
    }
}
