* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 240px;
    --enfermera: #8b5cf6;
    --tecnico-anestesia: #06b6d4;
    --tecnico-rotante: #f59e0b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: white;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.nav-links {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    padding: 12px 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-700);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--gray-400);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s;
}

.nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}

.nav-link.active {
    color: white;
    background: rgba(37, 99, 235, 0.3);
    border-right: 3px solid var(--primary);
}

.nav-link .icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* MAIN */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 32px;
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section > h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--gray-900);
}

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--gray-200);
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-card .stat-sub {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

.stat-card.primary { border-left: 4px solid var(--primary); }
.stat-card.success { border-left: 4px solid var(--success); }
.stat-card.warning { border-left: 4px solid var(--warning); }
.stat-card.danger { border-left: 4px solid var(--danger); }

/* CARDS */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--gray-200);
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-800);
}

.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* TABLES */
.table-container {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--gray-100);
}

tr:hover td {
    background: var(--gray-50);
}

/* BADGES */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-enfermera { background: #ede9fe; color: #7c3aed; }
.badge-tecnico_anestesia { background: #cffafe; color: #0891b2; }
.badge-pabellonera { background: #fef3c7; color: #d97706; }
.badge-clickable {
    cursor: pointer;
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
}
.badge-clickable:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.badge-clickable::after {
    content: ' \21C4';
    font-size: 9px;
    opacity: 0.5;
}
.badge-activo { background: var(--success-light); color: var(--success); }
.badge-inactivo { background: var(--gray-100); color: var(--gray-500); }
.badge-vacaciones { background: var(--primary-light); color: var(--primary); }
.badge-licencia { background: var(--warning-light); color: var(--warning); }

/* BUTTONS */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    transition: all 0.15s;
}

.btn:hover {
    background: var(--gray-50);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-danger {
    color: var(--danger);
    border-color: var(--danger-light);
}

.btn-danger:hover {
    background: var(--danger-light);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 12px;
}

/* FORMS */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-800);
    background: white;
}

.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(37, 99, 235, 0.1);
}

.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* SECTION ACTIONS */
.section-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-group {
    display: flex;
    gap: 8px;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

/* DATE NAV */
.date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-nav input {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
}

/* TURNO TOGGLE */
.turno-toggle {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: 10px;
}

.turno-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* AREAS GRID */
.areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.area-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.area-card-header {
    padding: 16px 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.area-card-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.area-card-body {
    padding: 16px 20px;
    min-height: 120px;
}

.asignado-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}

.asignado-item:last-child {
    border-bottom: none;
}

.asignado-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.empty-state {
    color: var(--gray-400);
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

/* PROGRAMACION GRID (Excel-style) */
.programacion-container {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    overflow-x: auto;
}

.prog-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 900px;
    font-size: 12px;
}

.prog-table th,
.prog-table td {
    border: 1px solid #bdc3c7;
    text-align: center;
    padding: 0;
    height: 32px;
    min-width: 32px;
}

/* Title row */
.prog-title {
    background: #20124d;
    color: white;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 10px !important;
    height: auto !important;
}

/* Day-of-week row */
.prog-dow {
    background: #cfe2f3;
    color: #073763;
    font-weight: 700;
    font-size: 11px;
}

/* Day number row */
.prog-daynum {
    background: #073763;
    color: white;
    font-weight: 700;
    font-size: 12px;
}

/* Collaborator name */
.prog-name {
    text-align: left !important;
    padding: 4px 10px !important;
    font-weight: 700;
    font-size: 11px;
    white-space: nowrap;
    background: white;
    color: #1a1a1a;
    min-width: 180px;
    position: sticky;
    left: 0;
    z-index: 2;
}

.prog-name.group-b {
    background: #d9ead3;
}

/* Shift cells */
.prog-cell {
    font-weight: 700;
    font-size: 11px;
    padding: 2px !important;
}

.prog-cell-d {
    background: #fff2cc;
    color: #7f6000;
}

.prog-cell-n {
    background: #cfe2f3;
    color: #073763;
}

.prog-cell-dn {
    background: #f4cccc;
    color: #990000;
}

.prog-cell-empty {
    background: #f8f9fa;
    color: #ccc;
}

.prog-cell-ma {
    background: #d1fae5;
    color: #065f46;
}

.prog-cell-mp {
    background: #fef3c7;
    color: #92400e;
}

.prog-cell-m {
    background: #a7f3d0;
    color: #064e3b;
}

.prog-cell-dl {
    background: #fed7aa;
    color: #92400e;
    font-weight: 700;
}

.prog-cell-nl {
    background: #c7d2fe;
    color: #3730a3;
    font-weight: 700;
}

/* Weekend columns */
.prog-weekend {
    background: #f0f0f0;
}

/* Separator row between groups */
.prog-separator td {
    background: #e8e8e8;
    height: 6px !important;
    border-left-color: #e8e8e8;
    border-right-color: #e8e8e8;
}

/* Collapsible role group header */
.prog-group-header {
    cursor: pointer;
    user-select: none;
}
.prog-group-header:hover .prog-group-header-td {
    filter: brightness(1.15);
}
.prog-group-header-td {
    text-align: left !important;
    padding: 7px 12px !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: white !important;
    height: auto !important;
    border-color: rgba(0,0,0,0.2) !important;
}
.prog-group-arrow {
    display: inline-block;
    width: 14px;
    font-size: 10px;
    margin-right: 6px;
}
.prog-group-count {
    font-weight: 400;
    opacity: 0.75;
    margin-left: 8px;
    font-size: 11px;
}

/* Pabellonera/o name cell */
.prog-name.group-c {
    background: #ede7f6;
}

/* Total column in calendar */
.prog-total-header {
    background: #20124d !important;
    color: #fbbf24 !important;
    font-weight: 700;
    font-size: 11px;
    position: sticky;
    right: 0;
    z-index: 2;
}
.prog-total-header-dow {
    background: #cfe2f3;
    position: sticky;
    right: 0;
    z-index: 2;
}
.prog-total-cell {
    background: #fffbeb;
    color: #1e3a5f;
    font-weight: 700;
    font-size: 12px;
    position: sticky;
    right: 0;
    z-index: 2;
    border-left: 2px solid #fbbf24 !important;
}

/* Multi-role checkboxes in personal form */
.roles-checks {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0;
}
.roles-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-700);
}
.roles-check-item input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Header cell for COLABORADOR */
.prog-collab-header {
    background: #073763;
    color: white;
    font-weight: 700;
    text-align: left !important;
    padding: 4px 10px !important;
    font-size: 11px;
    position: sticky;
    left: 0;
    z-index: 3;
}

/* Sticky header for day-of-week and day-number name cells */
.prog-dow-name,
.prog-daynum-name {
    position: sticky;
    left: 0;
    z-index: 3;
}

.prog-dow-name {
    background: #cfe2f3;
}

.prog-daynum-name {
    background: #073763;
}

/* Legend */
.prog-legend {
    display: flex;
    gap: 20px;
    padding: 12px 16px;
    font-size: 12px;
    color: var(--gray-600);
    border-top: 1px solid var(--gray-200);
}

.prog-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.prog-legend-swatch {
    width: 20px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid #ddd;
    display: inline-block;
}

/* Calendar day click */
.prog-daynum-click {
    cursor: pointer;
    transition: background 0.15s;
}
.prog-daynum-click:hover {
    background: #d0e4f7 !important;
}
.prog-day-selected {
    background: #4a90d9 !important;
    color: white !important;
    font-weight: 700;
}

/* Calendar day detail panel */
.cal-detalle {
    margin-top: 16px;
    background: white;
    border-radius: 12px;
    border: 2px solid var(--primary);
    overflow: hidden;
}
.cal-detalle-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: var(--gray-900);
    color: white;
}
.cal-detalle-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: white;
}
.cal-detalle-stats {
    display: flex;
    gap: 10px;
    flex: 1;
}
.cal-stat {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}
.cal-stat-d { background: #fff2cc; color: #7a5900; }
.cal-stat-n { background: #cfe2f3; color: #1a4a7a; }
.cal-stat-total { background: var(--primary); color: white; }

.cal-detalle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--gray-200);
}
.cal-detalle-area {
    background: white;
    padding: 12px 16px;
}
.cal-area-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--gray-800);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--primary);
}
.cal-area-turnos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.cal-area-turno-label {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    text-align: center;
}
.cal-label-d { background: #fff2cc; color: #7a5900; }
.cal-label-n { background: #cfe2f3; color: #1a4a7a; }
.cal-staff-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 12px;
}

/* MODAL */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-400);
    padding: 0;
    line-height: 1;
}

/* CHECKLIST */
.checklist {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
}

.checklist-item:hover {
    background: var(--gray-50);
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* REPORTES */
.reportes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 16px;
}

.reporte-card p {
    color: var(--gray-500);
    font-size: 13px;
    margin-bottom: 16px;
}

.reporte-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.reporte-controls input {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
}

.reporte-resultado-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
}

.reporte-resultado-table th,
.reporte-resultado-table td {
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    text-align: left;
}

.reporte-resultado-table th {
    background: var(--gray-50);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    color: #475569;
}
.reporte-resultado-table tbody tr:hover {
    background: #f8fafc;
}
.reporte-num {
    text-align: center !important;
    font-weight: 600;
    color: #1e3a5f;
}
.reporte-d { color: #7f6000 !important; }
.reporte-n { color: #073763 !important; }

/* RESUMEN HE */
.resumen-he {
    margin-top: 16px;
}

.resumen-he-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.resumen-he-item {
    text-align: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
}

.resumen-he-item .he-nombre {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

.resumen-he-item .he-total {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.resumen-he-item .he-label {
    font-size: 11px;
    color: var(--gray-400);
}

/* TURNO HOY */
.turno-hoy-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.turno-hoy-item:last-child {
    border-bottom: none;
}

.turno-hoy-area {
    font-weight: 600;
    color: var(--gray-700);
}

.turno-hoy-names {
    color: var(--gray-500);
}

/* LOGIN */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3a5f 0%, #111827 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}


.login-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.login-header p {
    font-size: 14px;
    color: var(--gray-500);
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 12px;
    min-height: 18px;
}

.btn-block {
    width: 100%;
    padding: 10px;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.login-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.login-footer p {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 10px;
}

/* USER INFO */
.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 12px;
}

.user-info span {
    color: var(--gray-400);
}

.btn-logout {
    background: none;
    border: 1px solid var(--gray-600);
    color: var(--gray-400);
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-logout-mobile {
    display: none;
}

/* PRIVACY / COMMUNICATION */
.privacy-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.privacy-option {
    padding: 16px;
    background: var(--gray-50);
    border-radius: 10px;
    border: 1px solid var(--gray-200);
}

.privacy-option h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-800);
}

.privacy-option p {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 12px;
}

/* FICHAS PRINT */
.ficha-individual {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    page-break-after: always;
}

.ficha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--gray-800);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.ficha-header h3 {
    font-size: 18px;
    margin: 0;
}

.ficha-header .ficha-periodo {
    font-size: 13px;
    color: var(--gray-500);
}

.ficha-nombre {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.ficha-rol {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.ficha-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 16px;
}

.ficha-tabla th,
.ficha-tabla td {
    padding: 6px 10px;
    border: 1px solid var(--gray-200);
    text-align: center;
}

.ficha-tabla th {
    background: var(--gray-100);
    font-weight: 600;
}

.ficha-tabla td.turno-d {
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
}

.ficha-tabla td.turno-n {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

.ficha-tabla td.turno-dn {
    background: #fce7f3;
    color: #9d174d;
    font-weight: 600;
}

.ficha-codigo {
    font-size: 12px;
    color: var(--gray-400);
    text-align: right;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed var(--gray-300);
}

.codigos-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.codigos-table th,
.codigos-table td {
    padding: 10px 16px;
    border: 1px solid var(--gray-200);
    font-size: 13px;
}

.codigos-table th {
    background: var(--gray-50);
    font-weight: 600;
}

.codigos-table .codigo {
    font-family: monospace;
    font-size: 13px;
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 4px;
}

/* CONSULTA RESULTADO */
.consulta-resultado {
    margin-top: 24px;
    text-align: left;
}

.consulta-resultado h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

/* TURNO DEL DIA */
.turno-dia-card {
    margin-bottom: 16px;
}

.turno-dia-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}

.turno-dia-badge-d {
    background: #fef3c7;
    color: #92400e;
}

.turno-dia-badge-n {
    background: #dbeafe;
    color: #1e40af;
}

.turno-dia-area {
    margin-bottom: 16px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
}

.turno-dia-area:last-child {
    margin-bottom: 0;
}

.turno-dia-area-header {
    background: var(--gray-50);
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--gray-200);
}

.turno-dia-count {
    background: var(--primary);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.turno-dia-staff-list {
    padding: 4px 0;
}

.turno-dia-staff-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

.turno-dia-staff-item:last-child {
    border-bottom: none;
}

.turno-dia-staff-name {
    font-weight: 500;
    color: var(--gray-800);
}

.turno-dia-tel {
    margin-left: auto;
    font-size: 12px;
    color: var(--gray-400);
}

/* TURNO DIA - Dependencia */
.turno-dia-dep {
    font-size: 11px;
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: auto;
}

.turno-dia-tel {
    font-size: 12px;
    color: var(--gray-400);
    margin-left: 8px;
}

/* DASHBOARD TURNOS HOY */
.dash-turnos-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dash-turnos-col-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    font-size: 14px;
}

.dash-turno-area {
    margin-bottom: 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.dash-turno-area:last-child {
    margin-bottom: 0;
}

.dash-turno-area-name {
    background: var(--gray-50);
    padding: 8px 12px;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--gray-200);
}

.dash-turno-person {
    padding: 6px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-turno-person:last-child {
    border-bottom: none;
}

/* ACUMULADO GRID */
.acumulado-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.acumulado-item {
    padding: 16px;
    background: var(--gray-50);
    border-radius: 10px;
}

.acumulado-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 4px;
}

.acumulado-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
}

.acumulado-sub {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 2px;
}

/* VALORES TURNO EDITABLES */
.valores-turno-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.valor-turno-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.valor-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 6px 10px;
}

.valor-input-wrap span {
    font-weight: 600;
    color: var(--gray-500);
    font-size: 14px;
}

.valor-input-wrap input {
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    width: 100%;
    outline: none;
    font-family: inherit;
}

/* LIQUIDACIONES */
.liquidacion-total {
    color: var(--success);
}

#tabla-liquidaciones tfoot td {
    padding: 14px 16px;
    font-size: 14px;
    border-top: 2px solid var(--gray-300);
}

/* AGENDA - Asignar Turnos */
.agenda-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.agenda-header {
    margin-bottom: 4px;
    grid-column: 1 / -1;
}

.agenda-date-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    text-transform: capitalize;
}

.agenda-dep {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.agenda-dep-header {
    padding: 14px 20px;
    background: var(--gray-900);
    color: white;
}

.agenda-dep-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.agenda-dep-title h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: white;
}

.agenda-dep-icon {
    color: var(--primary);
    font-size: 10px;
}

.agenda-dep-count {
    background: var(--primary);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.agenda-dep-body {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.agenda-turno-col {
    border-right: 1px solid var(--gray-200);
}

.agenda-turno-col:last-child {
    border-right: none;
}

.agenda-turno-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid var(--gray-200);
}

.agenda-turno-d {
    background: #fef9e7;
    color: #92400e;
}

.agenda-turno-n {
    background: #eef2ff;
    color: #1e40af;
}

.agenda-turno-ma {
    background: #ecfdf5;
    color: #065f46;
}

.agenda-turno-mp {
    background: #fffbeb;
    color: #92400e;
}

.agenda-turno-list {
    padding: 4px 12px;
    min-height: 60px;
}

.agenda-turno-list .asignado-item {
    padding: 8px 4px;
}

.agenda-turno-list .empty-state {
    padding: 16px 0;
}

/* LIQUIDACION EDIT INPUT */
.liq-edit-input {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--gray-50);
}

.liq-edit-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    background: white;
}

/* ===== BACKUP PANEL ===== */
.sidebar-backup {
    flex-shrink: 0;
    padding: 12px 20px;
    background: rgba(0,0,0,0.35);
    border-top: 1px solid var(--gray-700);
    cursor: pointer;
    transition: background 0.15s;
}
.sidebar-backup:hover { background: rgba(255,255,255,0.07); }
.sidebar-backup #backup-status-label { font-size: 12px; display: block; font-weight: 600; }
.sidebar-backup-hint { font-size: 10px; color: var(--gray-500); display: block; margin-top: 2px; }

.backup-section h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--gray-800); }
.backup-section p  { font-size: 13px; color: var(--gray-600); margin-bottom: 10px; }
.backup-section code { background: var(--gray-100); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.backup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 6px;
}
.backup-item-info { display: flex; flex-direction: column; gap: 2px; }
.backup-item-info strong { font-size: 13px; }
.backup-item-info span  { font-size: 11px; color: var(--gray-500); }

/* Fila de encabezado de grupo en tabla liquidaciones */
.liq-group-header td {
    font-size: 13px;
    letter-spacing: .3px;
    border-top: 3px solid rgba(0,0,0,.15);
}
.liq-group-header:first-child td {
    border-top: none;
}

.liq-detalle {
    width: 160px;
    text-align: left;
}

.liq-fecha-transf {
    width: 140px;
    text-align: left;
}

.valores-turno-grid {
    grid-template-columns: repeat(4, 1fr);
}

@media print {
    .sidebar, .section-actions, .login-screen, #app-container > nav { display: none !important; }
    .main-content { margin: 0 !important; width: 100% !important; padding: 0 !important; }
    .ficha-individual { border: none; box-shadow: none; margin: 0; padding: 20px; }
}

/* AGENDA EMPTY STATE */
.agenda-dep-empty {
    opacity: 0.6;
}

.agenda-dep-empty .agenda-dep-header {
    background: var(--gray-700);
}

/* ========== RESPONSIVE - TABLET ========== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-row {
        grid-template-columns: 1fr;
    }
    .reportes-grid {
        grid-template-columns: 1fr;
    }
    .acumulado-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .privacy-options {
        grid-template-columns: 1fr;
    }
}

/* ========== RESPONSIVE - MOBILE ========== */
@media (max-width: 768px) {
    body {
        display: block;
    }

    #app-container {
        display: block !important;
    }

    /* Sidebar: bottom nav on mobile */
    .sidebar {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
        z-index: 200;
        overflow: visible;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
    }

    .sidebar-header {
        display: none;
    }

    .nav-logout-mobile {
        display: block;
    }

    .nav-logout-mobile .nav-link {
        color: #f87171;
    }

    .nav-links {
        display: flex;
        overflow-x: auto;
        padding: 0;
        gap: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links li {
        flex-shrink: 0;
    }

    .nav-link {
        flex-direction: column;
        padding: 8px 12px;
        font-size: 10px;
        gap: 2px;
        white-space: nowrap;
        text-align: center;
        border-right: none;
    }

    .nav-link.active {
        border-right: none;
        border-top: 3px solid var(--primary);
    }

    .nav-link .icon {
        font-size: 18px;
    }

    /* Main content */
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 16px 12px;
        padding-bottom: 80px; /* space for bottom nav */
        min-height: auto;
    }

    .section > h1 {
        font-size: 20px;
        margin-bottom: 16px;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-card .stat-value {
        font-size: 20px;
    }

    .stat-card .stat-label {
        font-size: 11px;
    }

    /* Section actions */
    .section-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .filter-group {
        flex-direction: column;
        gap: 6px;
    }

    .filter-group select,
    .filter-group input {
        width: 100%;
    }

    .date-nav {
        justify-content: center;
    }

    .date-nav input {
        flex: 1;
    }

    /* Grids */
    .dashboard-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .areas-grid {
        grid-template-columns: 1fr;
    }

    /* Agenda - single column on mobile */
    .agenda-grid {
        grid-template-columns: 1fr;
    }

    .agenda-dep-body {
        grid-template-columns: 1fr;
    }

    .agenda-turno-col {
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }

    .agenda-turno-col:last-child {
        border-bottom: none;
    }

    .agenda-turno-header {
        padding: 8px 12px;
        font-size: 12px;
    }

    .agenda-turno-list {
        padding: 4px 8px;
        min-height: 40px;
    }

    .agenda-dep-header {
        padding: 10px 14px;
    }

    .agenda-dep-title h3 {
        font-size: 14px;
    }

    /* Turno dia staff */
    .turno-dia-staff-item {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 10px;
    }

    .turno-dia-staff-name {
        font-size: 13px;
    }

    .turno-dia-tel {
        width: 100%;
        margin-left: 0;
    }

    /* Tables */
    .table-container {
        border-radius: 8px;
    }

    table th, table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    th {
        font-size: 10px;
    }

    /* Liquidaciones */
    .valores-turno-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .liq-edit-input {
        width: 50px;
        padding: 3px 4px;
        font-size: 12px;
    }

    #tabla-liquidaciones th,
    #tabla-liquidaciones td {
        padding: 6px 6px;
        font-size: 11px;
    }

    /* Acumulado */
    .acumulado-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .acumulado-value {
        font-size: 18px;
    }

    /* Cards */
    .card {
        padding: 14px;
    }

    .card h3 {
        font-size: 14px;
    }

    /* Modals */
    .modal {
        max-width: 95vw;
        max-height: 90vh;
        padding: 16px;
        margin: 0 8px;
    }

    .modal-header h2 {
        font-size: 16px;
    }

    /* Login */
    .login-card {
        padding: 24px 20px;
        max-width: 95vw;
        margin: 0 10px;
    }

    /* Reportes */
    .reportes-grid {
        grid-template-columns: 1fr;
    }

    .reporte-controls {
        flex-direction: column;
    }

    .reporte-controls input,
    .reporte-controls button {
        width: 100%;
    }

    /* Privacy options */
    .privacy-options {
        grid-template-columns: 1fr;
    }

    /* Dash turnos columns */
    .dash-turnos-cols {
        grid-template-columns: 1fr;
    }

    /* Checklist */
    .checklist {
        max-height: 250px;
    }

    .checklist-item {
        padding: 8px 10px;
        gap: 8px;
        font-size: 13px;
    }

    /* Programacion container scroll */
    .programacion-container {
        border-radius: 8px;
    }

    .cal-detalle-grid {
        grid-template-columns: 1fr;
    }

    .cal-detalle-header {
        flex-wrap: wrap;
        padding: 10px 14px;
        gap: 8px;
    }

    .cal-detalle-stats {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Buttons */
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Charts */
    canvas {
        max-width: 100%;
        height: auto !important;
    }
}

/* ========== RESPONSIVE - SMALL MOBILE ========== */
@media (max-width: 420px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .nav-link {
        padding: 6px 8px;
        font-size: 9px;
    }

    .nav-link .icon {
        font-size: 16px;
    }

    .main-content {
        padding: 12px 8px;
        padding-bottom: 75px;
    }

    .section > h1 {
        font-size: 18px;
    }

    .valores-turno-grid {
        grid-template-columns: 1fr;
    }

    .agenda-dep-title h3 {
        font-size: 13px;
    }

    .badge {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* ===== ASIGNACION DE TURNOS ===== */
.asig-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-confirmar-asig {
    margin-left: auto;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, transform 0.1s;
}
.btn-confirmar-asig:hover {
    background: #15803d;
    transform: translateY(-1px);
}
.btn-confirmar-asig.confirmado {
    background: #1e3a5f;
    cursor: default;
}
.btn-confirmar-asig.confirmado:hover {
    background: #1e3a5f;
    transform: none;
}

/* Toast notification */
.app-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e3a5f;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    pointer-events: none;
}
.app-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.app-toast.app-toast-success { background: #16a34a; }
.app-toast.app-toast-warning { background: #d97706; }
.app-toast.app-toast-error   { background: #dc2626; }

.asig-dia-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.asig-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.asig-card {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border: 1px solid var(--border);
}

.asig-card-header {
    background: #1e3a5f;
    color: #ffffff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.asig-card-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.asig-card-count {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 13px;
    font-weight: 600;
}

.asig-card-body {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.asig-card-body-largo {
    grid-template-columns: repeat(2, 1fr);
    border-top: 2px dashed var(--border);
    background: rgba(0,0,0,0.015);
}

.asig-turno-col-largo .asig-turno-tag {
    font-size: 12px;
    white-space: nowrap;
}

.asig-turno-col-largo .asig-turno-time {
    font-size: 11px;
}

.asig-turno-col {
    padding: 12px;
    border-right: 1px solid var(--border);
}

.asig-turno-col:last-child {
    border-right: none;
}

.asig-turno-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.asig-turno-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 6px;
}

.asig-turno-tag.diurno {
    background: #fef3c7;
    color: #92400e;
}

.asig-turno-tag.nocturno {
    background: #e0e7ff;
    color: #3730a3;
}

.asig-turno-tag.medio_am {
    background: #d1fae5;
    color: #065f46;
}

.asig-turno-tag.medio_pm {
    background: #fef3c7;
    color: #92400e;
    border: 1px dashed #d97706;
}

.asig-turno-tag.diurno_largo {
    background: #fed7aa;
    color: #7c2d12;
    border: 2px solid #f97316;
    font-weight: 700;
}

.asig-turno-tag.nocturno_largo {
    background: #c7d2fe;
    color: #312e81;
    border: 2px solid #6366f1;
    font-weight: 700;
}

/* Columna de medios turnos: subdivision interna */

.asig-turno-time {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
}

.asig-staff-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 32px;
    margin-bottom: 8px;
}

.asig-staff-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--gray-100);
    border-radius: 8px;
    padding: 5px 8px;
}

.asig-staff-name {
    font-size: 12px;
    font-weight: 500;
    flex: 1;
    color: var(--text);
}

.asig-staff-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #ef4444;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.asig-staff-remove:hover {
    opacity: 1;
}

.asig-empty {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 6px 0;
    font-style: italic;
}

.btn-asig-add {
    width: 100%;
    padding: 6px;
    font-size: 12px;
    border: 1.5px dashed var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}

.btn-asig-add:hover {
    background: var(--primary);
    color: #fff;
}

/* ── Resumen diario ── */
.rd-card {
    margin-top: 24px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}
.rd-header {
    background: #0f2942;
    color: white;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.rd-stats {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
}
.rd-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 8px;
    border-right: 1px solid var(--border);
}
.rd-stat:last-child { border-right: none; }
.rd-stat-num {
    font-size: 28px;
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1;
}
.rd-stat-lbl {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.rd-stat-d .rd-stat-num { color: #7f6000; }
.rd-stat-n .rd-stat-num { color: #073763; }
.rd-turnos { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.rd-turno-block {}
.rd-turno-title {
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: inline-block;
}
.rd-turno-d { background: #fff9db; color: #7f6000; }
.rd-turno-n { background: #dbeafe; color: #1e40af; }
.rd-table { width: 100%; border-collapse: collapse; }
.rd-table tr { border-bottom: 1px solid #f1f5f9; }
.rd-table tr:last-child { border-bottom: none; }
.rd-area {
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
    width: 130px;
}
.rd-pills { padding: 6px 8px; }
.rd-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 3px 8px 3px 4px;
    font-size: 12px;
    margin: 2px;
    color: #334155;
}
.rd-empty {
    padding: 20px;
    text-align: center;
    color: var(--gray-400);
    font-size: 13px;
}

/* ── Resumen de turnos acumulados ── */
.resumen-card {
    margin-top: 24px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}
.resumen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e3a5f;
    color: white;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.resumen-hint {
    font-weight: 400;
    opacity: 0.75;
    font-size: 12px;
}
.resumen-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.resumen-table thead th {
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.resumen-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}
.resumen-table tbody tr:hover {
    background: #f8fafc;
}
.resumen-table tbody tr:last-child {
    border-bottom: none;
}
.resumen-nombre {
    padding: 8px 12px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}
.resumen-rol {
    padding: 6px 12px;
}
.resumen-num {
    padding: 8px 12px;
    text-align: center;
    font-weight: 600;
    min-width: 40px;
}
.resumen-d  { color: #7f6000; }
.resumen-n  { color: #073763; }
.resumen-total { color: #1e3a5f; font-size: 14px; }
.resumen-bar-td {
    padding: 8px 12px;
    width: 120px;
}
.resumen-bar {
    height: 8px;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    border-radius: 4px;
    min-width: 2px;
    transition: width 0.3s;
}
.resumen-sin-turno .resumen-nombre,
.resumen-sin-turno .resumen-total {
    opacity: 0.45;
}

@media (max-width: 768px) {
    .asig-grid {
        grid-template-columns: 1fr;
    }
    .asig-card-body {
        grid-template-columns: 1fr;
    }
    .asig-turno-col {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .asig-turno-col:last-child {
        border-bottom: none;
    }
}
