﻿:root {
    --ink: #172033;
    --muted: #64748b;
    --line: #e2e8f0;
    --panel: #ffffff;
    --bg: #f6f8fb;
    --primary: #1457d9;
    --primary-dark: #0f3f9f;
    --accent: #17a673;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 270px;
    background: #111827;
    color: #fff;
    min-height: 100vh;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    padding: 22px 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-bottom: 18px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}

.brand-mark.lg {
    width: 58px;
    height: 58px;
    font-size: 1.25rem;
}

.brand-title {
    font-weight: 800;
}

.brand small,
.nav-caption {
    color: #aab4c5;
}

.nav-caption {
    font-size: .75rem;
    text-transform: uppercase;
    margin: 18px 10px 8px;
}

.sidebar .nav-link {
    color: #dbe4f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
}

.sidebar button.nav-link {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.nav-parent {
    margin-top: 8px;
}

.nav-caret {
    margin-left: auto;
    font-size: .75rem;
    transition: transform .2s ease;
}

.nav-parent:not(.collapsed) .nav-caret {
    transform: rotate(180deg);
}

.submenu {
    margin: 4px 0 6px 18px;
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,.14);
}

.sidebar .sub-link {
    color: #c7d2e4;
    font-size: .94rem;
    padding: 9px 10px;
}

.sidebar .sub-link i {
    font-size: .9rem;
}

.app-main {
    flex: 1;
    margin-left: 270px;
    min-width: 0;
}

.topbar {
    height: 70px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.content-wrap {
    padding: 24px;
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(17,24,39,.12);
}

.login-hero {
    background: #111827;
    color: #fff;
    padding: 54px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-hero h1 {
    margin-top: 18px;
    font-weight: 800;
}

.login-card {
    padding: 48px;
}

.login-card h2,
.work-panel h2 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 18px;
}

.attendance-dashboard-content {
    display: flex;
    flex-direction: column;
}

.attendance-dashboard-matrix {
    order: 1;
}

.attendance-monthly-summary {
    order: 2;
}

.attendance-dashboard-secondary {
    order: 3;
}

.page-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
}

.page-title h1 {
    font-size: 1.6rem;
    font-weight: 850;
    margin: 0;
}

.page-title p {
    margin: 2px 0 0;
    color: var(--muted);
}

.work-panel,
.metric {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15,23,42,.04);
}

.weekly-schedule-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 10px;
    overflow-x: auto;
}

.weekly-day {
    min-height: 190px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #f8fafc;
}

.weekly-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.schedule-pill {
    border-radius: 8px;
    padding: 7px 8px;
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.schedule-entry {
    background: #dcfce7;
    color: #166534;
}

.schedule-break {
    background: #fef3c7;
    color: #92400e;
}

.schedule-exit {
    background: #dbeafe;
    color: #1d4ed8;
}

.empty-day {
    height: 120px;
    display: grid;
    place-items: center;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: var(--muted);
    font-size: .85rem;
}

.attendance-map {
    height: 360px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

/* Modal amplio para configurar lugares y revisar el radio sobre el mapa. */
#locationModal .location-modal-dialog {
    width: 94vw;
    max-width: 1500px;
}

#locationModal .modal-content {
    max-height: 94vh;
}

#locationModal #locationMap {
    height: clamp(430px, 58vh, 650px);
    min-height: 430px;
}

@media (max-width: 991.98px) {
    #locationModal .location-modal-dialog {
        width: auto;
        max-width: calc(100vw - 24px);
        margin: 12px auto;
    }

    #locationModal #locationMap {
        height: 420px;
        min-height: 420px;
    }
}

@media (max-width: 575.98px) {
    #locationModal #locationMap {
        height: 340px;
        min-height: 340px;
    }
}

.camera-box {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #0f172a;
}

.camera-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mark-photo-preview {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.attendance-status-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.attendance-marking-panel .info-list {
    grid-template-columns: minmax(112px, 34%) minmax(0, 1fr);
    gap: 6px 12px;
    align-items: start;
    margin-bottom: 14px;
    font-size: 0.84rem;
}

.attendance-marking-panel .info-list dt,
.attendance-marking-panel .info-list dd {
    line-height: 1.25;
    min-width: 0;
}

.attendance-marking-panel .info-list dt {
    font-weight: 700;
}

.attendance-marking-panel .info-list dd {
    overflow-wrap: anywhere;
}

.attendance-marking-panel .attendance-time-value {
    overflow-wrap: normal;
    max-width: 100%;
}

.attendance-marking-panel .attendance-time-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
    max-width: 100%;
    font-size: 0.79rem;
    line-height: 1.25;
}

.attendance-marking-panel .attendance-time-main > span {
    white-space: nowrap;
}

.attendance-marking-panel .attendance-time-separator {
    color: var(--muted);
    font-weight: 500;
}

.attendance-marking-panel .attendance-time-value small {
    margin-top: 2px;
    font-size: 0.74rem;
    line-height: 1.2;
}

.attendance-marking-panel .attendance-status-stack .badge {
    white-space: normal;
    text-align: left;
    line-height: 1.15;
    font-size: 0.69rem;
    padding: 0.32rem 0.48rem;
}

.work-panel.attendance-marking-panel h2 {
    margin-bottom: 14px !important;
}

.attendance-marking-panel > .form-label {
    margin-bottom: 5px;
}

.attendance-marking-panel > .form-select {
    margin-bottom: 12px !important;
}

.attendance-marking-panel .attendance-status-stack {
    gap: 4px;
    margin-bottom: 12px !important;
}

.attendance-marking-panel #markObservations {
    min-height: 74px;
    margin-bottom: 12px !important;
}

.attendance-marking-layout > [class*="col-"] {
    min-width: 0;
}

.attendance-recent-table {
    margin-bottom: 0;
    font-size: 0.85rem;
}

.attendance-recent-table th,
.attendance-recent-table td {
    padding: 0.48rem 0.32rem;
    line-height: 1.25;
    vertical-align: middle;
}

.attendance-recent-table th {
    font-size: 0.78rem;
    white-space: nowrap;
}

.attendance-recent-table .badge {
    max-width: 100%;
    white-space: nowrap;
    font-size: 0.71rem;
    line-height: 1.1;
    text-align: center;
}

.attendance-recent-table td:last-child .d-flex {
    gap: 3px !important;
    justify-content: center;
}

.attendance-recent-table td:last-child .btn {
    display: inline-flex;
    width: 29px;
    height: 29px;
    padding: 0;
    align-items: center;
    justify-content: center;
}

.attendance-recent-table .attendance-mark-type {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
    white-space: nowrap;
}

.attendance-recent-table .attendance-mark-type-entrada {
    color: #15803d;
}

.attendance-recent-table .attendance-mark-type-salida {
    color: #1d4ed8;
}

@media (min-width: 768px) {
    .attendance-recent-table {
        width: 100%;
        min-width: 0 !important;
        table-layout: fixed;
    }

    .attendance-recent-table th:nth-child(1) { width: 14%; }
    .attendance-recent-table th:nth-child(2) { width: 10%; }
    .attendance-recent-table th:nth-child(3) { width: 10%; }
    .attendance-recent-table th:nth-child(4) { width: 13%; }
    .attendance-recent-table th:nth-child(5) { width: 11%; }
    .attendance-recent-table th:nth-child(6) { width: 13%; }
    .attendance-recent-table th:nth-child(7) { width: 19%; }
    .attendance-recent-table th:nth-child(8) { width: 10%; }

    .attendance-recent-table th:nth-child(7),
    .attendance-recent-table td:nth-child(7),
    .attendance-recent-table th:nth-child(8),
    .attendance-recent-table td:nth-child(8) {
        text-align: center;
    }

    .attendance-trips-table th:nth-child(1) { width: 9%; }
    .attendance-trips-table th:nth-child(2) { width: 7%; }
    .attendance-trips-table th:nth-child(3) { width: 7%; }
    .attendance-trips-table th:nth-child(4) { width: 9%; }
    .attendance-trips-table th:nth-child(5) { width: 9%; }
    .attendance-trips-table th:nth-child(6) { width: 15%; }
    .attendance-trips-table th:nth-child(7) { width: 17%; }
    .attendance-trips-table th:nth-child(8) { width: 15%; }
    .attendance-trips-table th:nth-child(9) { width: 12%; }
    .attendance-trips-table th:nth-child(9),
    .attendance-trips-table td:nth-child(9) { text-align:center; white-space:nowrap; }

    .attendance-trips-table {
        min-width: 1050px !important;
    }

    .attendance-trips-table th,
    .attendance-trips-table td {
        padding: 0.68rem 0.58rem;
    }

    .attendance-trips-table td:nth-child(-n+5) {
        white-space: nowrap;
    }

    .attendance-trips-table th:nth-child(9),
    .attendance-trips-table td:nth-child(9) {
        position: sticky;
        right: 0;
        z-index: 2;
        background-color: var(--bs-table-bg, #fff);
        box-shadow: -7px 0 10px -9px rgba(15, 23, 42, .65);
    }

    .attendance-trips-table th:nth-child(9) {
        z-index: 3;
        background-color: #f8fafc;
    }
}

@media (max-width: 767.98px) {
    .attendance-recent-table {
        min-width: 680px;
    }
}

@media (min-width: 1300px) {
    .attendance-marking-panel .attendance-time-main {
        flex-wrap: nowrap;
        font-size: 0.76rem;
        gap: 3px;
    }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    .attendance-marking-layout > .col-xl-4 {
        flex: 0 0 35%;
        width: 35%;
        max-width: 35%;
    }

    .attendance-marking-layout > .col-xl-8 {
        flex: 0 0 65%;
        width: 65%;
        max-width: 65%;
    }

    .attendance-marking-panel {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .attendance-marking-panel .info-list {
        grid-template-columns: minmax(108px, 35%) minmax(0, 1fr);
        gap: 6px 9px;
    }
}

@media (max-width: 575.98px) {
    .attendance-marking-panel .info-list {
        grid-template-columns: minmax(104px, 38%) minmax(0, 1fr);
        gap: 7px 9px;
    }
}

.attendance-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 16px;
}

.attendance-kpi-grid.attendance-kpi-grid-five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.attendance-kpi-grid-five .attendance-kpi-card {
    min-width: 0;
    min-height: 124px;
    padding: 16px 50px 16px 16px;
}

.attendance-kpi-grid-five .attendance-kpi-card > span {
    min-height: 2.5em;
    line-height: 1.25;
}

.attendance-kpi-grid-five .attendance-kpi-card > strong {
    margin-top: 7px;
    font-size: 1.85rem;
}

.attendance-kpi-grid-five .attendance-kpi-card > small {
    line-height: 1.3;
}

.attendance-kpi-grid-five .attendance-kpi-card > i {
    right: 12px;
    bottom: 12px;
    width: 36px;
    height: 36px;
}

.attendance-kpi-card {
    position: relative;
    min-height: 128px;
    padding: 20px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
}

.attendance-kpi-card span {
    display: block;
    color: #475569;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.attendance-kpi-card strong {
    display: block;
    margin-top: 10px;
    color: #0f172a;
    font-size: 2.1rem;
    line-height: 1;
    font-weight: 850;
}

.attendance-kpi-card small {
    display: block;
    margin-top: 6px;
    color: #475569;
    font-weight: 600;
}

.attendance-kpi-card i {
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
}

.kpi-blue {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.kpi-blue i {
    background: #2563eb;
}

.kpi-green {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.kpi-green i {
    background: #16a34a;
}

.kpi-orange {
    background: #fff7ed;
    border-color: #fed7aa;
}

.kpi-orange i {
    background: #f97316;
}

.kpi-yellow {
    background: #fffbeb;
    border-color: #fde68a;
}

.kpi-yellow i {
    background: #ca8a04;
}

.kpi-red {
    background: #fef2f2;
    border-color: #fecaca;
}

.kpi-red i {
    background: #dc2626;
}

.kpi-rose {
    background: #fff1f2;
    border-color: #fecdd3;
}

.kpi-rose i {
    background: #e11d48;
}

@media (max-width: 1199.98px) {
    .attendance-kpi-grid.attendance-kpi-grid-five {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .attendance-kpi-grid.attendance-kpi-grid-five {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .attendance-kpi-grid.attendance-kpi-grid-five {
        grid-template-columns: 1fr;
    }
}

.kpi-sky {
    background: #ecfeff;
    border-color: #a5f3fc;
}

.kpi-sky i {
    background: #0891b2;
}

.attendance-mini-bars {
    display: grid;
    gap: 12px;
}

.mini-bar-row {
    display: grid;
    grid-template-columns: 52px 1fr 32px;
    align-items: center;
    gap: 10px;
    color: #334155;
    font-size: .85rem;
    font-weight: 700;
}

.mini-bar-track {
    position: relative;
    height: 16px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.mini-bar-track i {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
}

.mini-bar-track .bar-entry {
    background: #2563eb;
}

.mini-bar-track .bar-late {
    background: #f97316;
    opacity: .9;
}

.attendance-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: #475569;
    font-size: .85rem;
    font-weight: 700;
}

.attendance-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 50%;
}

.legend-entry {
    background: #2563eb;
}

.legend-late {
    background: #f97316;
}

.attendance-matrix-wrap {
    max-height: 620px;
}

.attendance-matrix {
    width: 100%;
    min-width: calc(220px + (var(--matrix-days, 31) * 54px));
    table-layout: fixed;
    border: 1px solid #c7cbd1;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
}

.attendance-matrix th,
.attendance-matrix td {
    min-width: 54px;
    height: 54px;
    border-right: 1px solid #d9dde2;
    border-bottom: 1px solid #d9dde2;
    text-align: center;
    vertical-align: middle;
    font-size: .72rem;
}

.attendance-matrix tr > :last-child {
    border-right: 1px solid #d9dde2;
}

.attendance-matrix tbody tr:last-child > * {
    border-bottom: 0;
}

.attendance-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    border-bottom: 2px solid #9ca3af;
    background-color: #e5e7eb !important;
    color: #1f2937;
}

.attendance-matrix .matrix-person {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    border-left: 1px solid #d9dde2;
    border-right-color: #c7cbd1;
    text-align: left;
    background: #ffffff;
    box-shadow: none;
}

.attendance-matrix thead .matrix-person {
    z-index: 4;
    border-left-color: #d9dde2;
    border-right-color: #aeb4bc;
    background-color: #d1d5db !important;
    box-shadow: none;
}

.attendance-matrix .matrix-day-heading {
    padding: 6px 4px;
    line-height: 1.1;
}

.attendance-matrix .matrix-day-heading span {
    display: block;
}

.attendance-matrix .matrix-weekday {
    margin-bottom: 5px;
    color: #4b5563;
    font-size: .66rem;
    font-weight: 800;
}

.attendance-matrix .matrix-day-number {
    color: #111827;
    font-size: .74rem;
    font-weight: 800;
}

.attendance-matrix .matrix-person strong,
.attendance-matrix .matrix-person span {
    display: block;
}

.attendance-matrix .matrix-person span {
    color: #64748b;
    font-size: .72rem;
}

.attendance-matrix td span {
    display: block;
    white-space: nowrap;
    font-weight: 800;
}

.matrix-ok {
    background: #dcfce7 !important;
    color: #166534 !important;
}

.matrix-late {
    background: #fff7ed !important;
    color: #9a3412 !important;
}

.matrix-attendance-warning {
    background: #fef9c3 !important;
    color: #854d0e !important;
}

.matrix-early-exit {
    background: #ffedd5 !important;
    color: #c2410c !important;
}

.matrix-attendance-critical {
    background: #fce7f3 !important;
    color: #be185d !important;
}

.matrix-absent {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

.matrix-absent span {
    font-size: .82rem;
}

.matrix-day-off {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

.matrix-vacation {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
}

.matrix-permission {
    background: #ede9fe !important;
    color: #6d28d9 !important;
}

.matrix-rest {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

.matrix-holiday {
    background: #cffafe !important;
    color: #0e7490 !important;
}

.matrix-non-working {
    background: #f5f5f4 !important;
    color: #44403c !important;
}

.attendance-matrix td:not(.matrix-person) > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 22px;
    margin: 0 auto;
    padding: 3px 6px;
    border-radius: 4px;
    color: #fff;
    font-size: .68rem;
    line-height: 1;
}

.attendance-matrix .matrix-ok > span { background: #15803d; }
.attendance-matrix .matrix-absent > span { background: #dc2626; }
.attendance-matrix .matrix-attendance-warning > span { background: #ca8a04; }
.attendance-matrix .matrix-early-exit > span { background: #ea580c; }
.attendance-matrix .matrix-attendance-critical > span { background: #e11d48; }
.attendance-matrix .matrix-vacation > span { background: #2563eb; }
.attendance-matrix .matrix-permission > span { background: #7c3aed; }
.attendance-matrix .matrix-rest > span { background: #334155; }
.attendance-matrix .matrix-holiday > span { background: #0891b2; }
.attendance-matrix .matrix-non-working > span { background: #78716c; }

.attendance-matrix .matrix-empty > span,
.attendance-matrix .matrix-day-off > span {
    min-width: 0;
    min-height: 0;
    padding: 0;
    background: transparent;
    color: inherit;
}

.attendance-matrix .matrix-empty > span {
    color: #475569 !important;
}

.attendance-monthly-summary {
    margin-top: 18px;
}

.attendance-monthly-summary-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.attendance-monthly-summary-header h3 {
    margin: 0 0 3px;
    color: #172033;
    font-size: 1rem;
    font-weight: 800;
}

.attendance-monthly-summary-header p {
    margin: 0;
    color: #64748b;
    font-size: .78rem;
}

.attendance-monthly-summary-header > span {
    flex: 0 0 auto;
    color: #64748b;
    font-size: .75rem;
    font-weight: 700;
}

.attendance-monthly-summary-wrap {
    border: 1px solid #dbe4ef;
    border-radius: 6px;
}

.attendance-monthly-summary-table {
    width: 100%;
    min-width: 940px;
    border-collapse: collapse;
    background: #ffffff;
}

.attendance-monthly-summary-table th {
    padding: 10px 14px;
    border-bottom: 1px solid #cbd5e1;
    background: #eef2f6;
    color: #334155;
    font-size: .7rem;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
}

.attendance-monthly-summary-table th:not(:first-child),
.attendance-monthly-summary-table td:not(:first-child) {
    width: 13%;
    text-align: center;
}

.attendance-monthly-summary-table th:first-child {
    width: 35%;
}

.attendance-monthly-summary-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
}

.attendance-monthly-summary-table tbody tr:last-child td {
    border-bottom: 0;
}

.attendance-monthly-summary-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.attendance-summary-worker strong,
.attendance-summary-worker span {
    display: block;
}

.attendance-summary-worker strong {
    font-size: .84rem;
}

.attendance-summary-worker span {
    margin-top: 2px;
    color: #64748b;
    font-size: .72rem;
    font-weight: 600;
}

.attendance-summary-metric {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 66px;
    font-size: .86rem;
}

.attendance-summary-metric i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #ffffff;
    font-size: .68rem;
}

.metric-attendance { color: #15803d; }
.metric-attendance i { background: #16a34a; }
.metric-late { color: #b45309; }
.metric-late i { background: #f59e0b; }
.metric-early-exit { color: #c2410c; }
.metric-early-exit i { background: #ea580c; }
.metric-late-early-exit { color: #be123c; }
.metric-late-early-exit i { background: #e11d48; }
.metric-absence { color: #b91c1c; }
.metric-absence i { background: #dc2626; }

.attendance-summary-empty {
    padding: 18px !important;
    color: #64748b !important;
    text-align: center !important;
}

@media (max-width: 575px) {
    .attendance-monthly-summary-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}

.attendance-matrix-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #dbe4ef;
    border-radius: 6px;
    background: #f8fafc;
    color: #475569;
    font-size: .78rem;
}

.attendance-matrix-legend span,
.calendar-event-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 3px 9px 3px 4px;
    border: 1px solid transparent;
    border-radius: 5px;
    white-space: nowrap;
    font-weight: 600;
}

.attendance-matrix-legend strong,
.calendar-event-chip strong {
    min-width: 28px;
    padding: 3px 5px;
    border-radius: 4px;
    color: #fff;
    text-align: center;
}

.calendar-event-chip {
    font-size: .78rem;
    line-height: 1;
}

.attendance-matrix-legend .legend-attended,
.attendance-report-state.legend-attended { background: #dcfce7; border-color: #86efac; color: #166534; }
.attendance-matrix-legend .legend-attended strong,
.attendance-report-state.legend-attended strong { background: #15803d; }
.attendance-matrix-legend .legend-absent,
.attendance-report-state.legend-absent { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.attendance-matrix-legend .legend-absent strong,
.attendance-report-state.legend-absent strong { background: #dc2626; }
.attendance-matrix-legend .legend-attendance-warning,
.attendance-report-state.legend-attendance-warning { background: #fef9c3; border-color: #fde047; color: #854d0e; }
.attendance-matrix-legend .legend-attendance-warning strong,
.attendance-report-state.legend-attendance-warning strong { background: #ca8a04; }
.attendance-matrix-legend .legend-early-exit,
.attendance-report-state.legend-early-exit { background: #ffedd5; border-color: #fdba74; color: #c2410c; }
.attendance-matrix-legend .legend-early-exit strong,
.attendance-report-state.legend-early-exit strong { background: #ea580c; }
.attendance-matrix-legend .legend-attendance-critical,
.attendance-report-state.legend-attendance-critical { background: #fce7f3; border-color: #f9a8d4; color: #be185d; }
.attendance-matrix-legend .legend-attendance-critical strong,
.attendance-report-state.legend-attendance-critical strong { background: #e11d48; }
.attendance-matrix-legend .legend-vacation,
.calendar-event-chip.legend-vacation,
.attendance-report-state.legend-vacation { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.attendance-matrix-legend .legend-vacation strong,
.calendar-event-chip.legend-vacation strong,
.attendance-report-state.legend-vacation strong { background: #2563eb; }
.attendance-matrix-legend .legend-permission,
.calendar-event-chip.legend-permission,
.attendance-report-state.legend-permission { background: #ede9fe; border-color: #c4b5fd; color: #6d28d9; }
.attendance-matrix-legend .legend-permission strong,
.calendar-event-chip.legend-permission strong,
.attendance-report-state.legend-permission strong { background: #7c3aed; }
.attendance-matrix-legend .legend-rest,
.calendar-event-chip.legend-rest,
.attendance-report-state.legend-rest { background: #e2e8f0; border-color: #64748b; color: #1e293b; }
.attendance-matrix-legend .legend-rest strong,
.calendar-event-chip.legend-rest strong,
.attendance-report-state.legend-rest strong { background: #334155; }
.attendance-matrix-legend .legend-holiday,
.calendar-event-chip.legend-holiday,
.attendance-report-state.legend-holiday { background: #cffafe; border-color: #67e8f9; color: #0e7490; }
.attendance-matrix-legend .legend-holiday strong,
.calendar-event-chip.legend-holiday strong,
.attendance-report-state.legend-holiday strong { background: #0891b2; }
.attendance-matrix-legend .legend-non-working,
.calendar-event-chip.legend-non-working,
.attendance-report-state.legend-non-working { background: #f5f5f4; border-color: #a8a29e; color: #44403c; }
.attendance-matrix-legend .legend-non-working strong,
.calendar-event-chip.legend-non-working strong,
.attendance-report-state.legend-non-working strong { background: #78716c; }

.calendar-legend {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    color: #475569;
    font-size: .82rem;
    font-weight: 700;
}

.calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.calendar-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.calendar-dot-vacation { background: #2563eb; }
.calendar-dot-permission { background: #eab308; }
.calendar-dot-rest { background: #6b7280; }
.calendar-dot-holiday { background: #64748b; }
.calendar-dot-off { background: #cbd5e1; }

.calendar-badge-vacation { background: #dbeafe; color: #1d4ed8; }
.calendar-badge-permission { background: #fef3c7; color: #92400e; }
.calendar-badge-rest { background: #e5e7eb; color: #4b5563; }
.calendar-badge-holiday { background: #e2e8f0; color: #475569; }
.calendar-badge-non-working { background: #f8fafc; color: #64748b; border: 1px solid #cbd5e1; }

.matrix-empty {
    background: #f8fafc !important;
    color: #64748b !important;
}

.attendance-matrix tbody tr:nth-child(odd) .matrix-person,
.attendance-matrix tbody tr:nth-child(odd) .matrix-empty {
    background-color: #ffffff !important;
}

.attendance-matrix tbody tr:nth-child(even) .matrix-person,
.attendance-matrix tbody tr:nth-child(even) .matrix-empty {
    background-color: #f1f3f5 !important;
}

.attendance-matrix tbody tr:hover .matrix-person,
.attendance-matrix tbody tr:hover .matrix-empty {
    background-color: #e9ecef !important;
}

.js-attendance-matrix-cell {
    cursor: pointer;
    transition: box-shadow .15s ease, filter .15s ease;
}

.js-attendance-matrix-cell:hover,
.js-attendance-matrix-cell:focus-visible {
    position: relative;
    z-index: 1;
    outline: 0;
    box-shadow: inset 0 0 0 2px #2563eb;
    filter: brightness(.98);
}

.attendance-matrix-detail-modal .modal-header,
.attendance-matrix-detail-modal .modal-body,
.attendance-matrix-detail-modal .modal-footer {
    padding: 14px 16px;
}

.attendance-matrix-detail-modal .modal-title {
    font-size: 1rem;
}

.attendance-detail-person {
    padding: 10px 12px;
    border: 1px solid #dbe3ef;
    border-radius: 6px;
    background: #f8fafc;
}

.attendance-detail-person strong,
.attendance-detail-person span {
    display: block;
}

.attendance-detail-person span {
    margin-top: 2px;
    color: #64748b;
    font-size: .78rem;
}

.attendance-detail-status {
    display: flex;
    align-items: center;
    gap: 9px;
}

.attendance-detail-status strong {
    font-size: .82rem;
}

.attendance-detail-badge {
    min-width: 38px;
}

.detail-badge-ok { background: #16a34a; color: #fff; }
.detail-badge-warning { background: #f59e0b; color: #111827; }
.detail-badge-early-exit { background: #ea580c; color: #fff; }
.text-bg-early-exit { background-color: #ea580c !important; color: #fff !important; }
.text-bg-late-early-exit { background-color: #e11d48 !important; color: #fff !important; }
.detail-badge-danger { background: #dc2626; color: #fff; }
.detail-badge-neutral { background: #64748b; color: #fff; }

.attendance-detail-grid {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 8px 12px;
    font-size: .82rem;
}

.attendance-detail-grid dt {
    color: #475569;
}

.attendance-detail-grid dd {
    margin: 0;
    color: #0f172a;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.metric {
    position: relative;
    min-height: 122px;
}

.metric span {
    color: var(--muted);
    font-weight: 700;
}

.metric strong {
    display: block;
    font-size: 2rem;
    margin-top: 12px;
}

.metric i {
    position: absolute;
    right: 20px;
    bottom: 18px;
    color: var(--primary);
    font-size: 1.5rem;
}

.metric.danger i {
    color: #dc3545;
}

.btn {
    border-radius: 8px;
    font-weight: 700;
}

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

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

.form-control,
.form-select,
.select2-container--bootstrap4 .select2-selection {
    border-radius: 8px;
    border-color: #cfd8e3;
}

.puestos-control {
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.puestos-control.is-invalid {
    border-color: #dc3545;
}

.puestos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 48px;
    align-items: flex-start;
}

.puesto-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    border: 1px solid #c8d6ec;
    border-radius: 8px;
    padding: 7px 11px;
    color: #17315f;
    background: #f8fbff;
    cursor: pointer;
    line-height: 1.2;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.puesto-chip i {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #9fb4d4;
    color: transparent;
    font-size: .72rem;
}

.btn-check:checked + .puesto-chip {
    border-color: #1457d9;
    background: #eef5ff;
    color: #0f3f9f;
}

.btn-check:checked + .puesto-chip i {
    background: #1457d9;
    border-color: #1457d9;
    color: #fff;
}

.puesto-chip:hover {
    border-color: #1457d9;
}

.masivo-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.masivo-filtro {
    width: 220px;
    flex: 0 0 220px;
}

@media (max-width: 991px) {
    .masivo-toolbar {
        width: 100%;
        justify-content: stretch;
    }

    .masivo-toolbar .btn,
    .masivo-filtro {
        width: 100%;
    }
}
.masivo-table {
    min-width: 1180px;
}

.masivo-table th {
    white-space: nowrap;
}

.masivo-table td {
    vertical-align: middle;
}

.masivo-table input[type="date"],
.masivo-table select {
    min-width: 150px;
}

.documento-masivo {
    min-width: 240px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.documento-masivo .form-control {
    min-width: 190px;
}

.progress-thin {
    height: 8px;
    min-width: 120px;
}

.preview-box {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #f8fafc;
}

.preview-box img,
.worker-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-box span {
    color: #94a3b8;
    font-size: 2rem;
}

.worker-card img {
    width: 180px;
    height: 180px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #eef2f7;
}

.info-list {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 7px 10px;
}

.info-list dt {
    color: var(--muted);
    font-size: .86rem;
}

.info-list dd {
    margin: 0;
    font-weight: 700;
}

.file-current {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #f8fafc;
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .login-panel {
        grid-template-columns: 1fr;
    }

    .login-hero {
        padding: 32px;
    }

    .login-card {
        padding: 32px;
    }
}

@media (max-width: 575px) {
    .content-wrap,
    .auth-wrap {
        padding: 16px;
    }

    .page-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        padding: 0 12px;
    }
}

.estado-calculado-box {
    min-height: 38px;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 12px;
    background: #f8fafc;
}

.estado-calculado-box small {
    color: #64748b;
    font-weight: 700;
}

.estado-calculado-box.estado-activo {
    border-color: #9ed7b5;
    background: #f0fdf4;
}

.estado-calculado-box.estado-inactivo {
    border-color: #f1b5bd;
    background: #fff5f5;
}

.maquinaria-foto-modal {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    object-fit: contain;
}

#machineDocumentsTable th,
#maquinariaTable th {
    white-space: nowrap;
}

.bulk-requirements-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
}

.bulk-requirements-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.bulk-requirement-item {
    border: 1px solid #d8e1ee;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.dashboard-title {
    align-items: stretch;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 14px;
}

.attendance-dashboard-filters {
    display: grid;
    grid-template-columns: minmax(180px, 1.15fr) minmax(220px, 1.4fr) minmax(145px, .8fr) minmax(145px, .8fr) auto;
    align-items: end;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    border: 1px solid #dbe5f1;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
}

.attendance-dashboard-filters .form-label {
    display: block;
    margin-bottom: 6px;
    color: #334155 !important;
    font-size: .78rem !important;
    letter-spacing: .01em;
}

.attendance-dashboard-filters .select2-container {
    width: 100% !important;
    min-width: 0;
}

.attendance-dashboard-filters .form-control,
.attendance-dashboard-filters .form-select,
.attendance-dashboard-filters .select2-selection--single {
    min-height: 42px;
    border-color: #cbd8e8;
    background-color: #fff;
}

.attendance-dashboard-filters .form-control:focus,
.attendance-dashboard-filters .form-select:focus,
.attendance-dashboard-filters .select2-container--focus .select2-selection--single,
.attendance-dashboard-filters .select2-container--open .select2-selection--single {
    border-color: #6ea8fe !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12) !important;
}

.attendance-filter-submit {
    min-height: 42px;
    padding-inline: 22px;
    white-space: nowrap;
    box-shadow: 0 5px 12px rgba(37, 99, 235, .2);
}

@media (max-width: 1180px) {
    .attendance-dashboard-filters {
        grid-template-columns: repeat(2, minmax(190px, 1fr));
    }

    .attendance-filter-submit {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 620px) {
    .attendance-dashboard-filters {
        grid-template-columns: 1fr;
        gap: 11px;
        padding: 14px;
    }

    .attendance-filter-submit {
        grid-column: auto;
        width: 100%;
    }
}

.dashboard-total {
    min-width: 170px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 12px 16px;
    display: grid;
    align-content: center;
    text-align: right;
}

.dashboard-total span {
    color: var(--muted);
    font-weight: 700;
    font-size: .85rem;
}

.dashboard-total strong {
    font-size: 1.8rem;
    line-height: 1;
}

.executive-card {
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    min-height: 138px;
    padding: 18px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15,23,42,.05);
}

.executive-card span,
.executive-card small {
    display: block;
    color: var(--muted);
    font-weight: 700;
}

.executive-card strong {
    display: block;
    margin-top: 8px;
    font-size: 2.35rem;
    line-height: 1;
}

.executive-card i {
    position: absolute;
    right: 18px;
    bottom: 16px;
    font-size: 2rem;
    opacity: .18;
}

.executive-green {
    border-left: 5px solid #16a34a;
}

.executive-green strong,
.executive-green i {
    color: #15803d;
}

.executive-yellow {
    border-left: 5px solid #facc15;
}

.executive-yellow strong,
.executive-yellow i {
    color: #b45309;
}

.executive-red {
    border-left: 5px solid #dc2626;
}

.executive-red strong,
.executive-red i {
    color: #b91c1c;
}

.dashboard-chart-panel {
    min-height: 310px;
}

.dashboard-chart-panel h2 {
    margin-bottom: 12px;
}

.dashboard-chart-panel canvas {
    width: 100% !important;
    height: 230px !important;
}

.dashboard-filters {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr 1fr .8fr;
    gap: 10px;
    align-items: end;
}

.dashboard-table th {
    white-space: nowrap;
}

@media (max-width: 991px) {
    .dashboard-filters {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 575px) {
    .dashboard-filters {
        grid-template-columns: 1fr;
    }
    .dashboard-total {
        width: 100%;
        text-align: left;
    }
}

/* Refinamiento tipografico y login empresarial */
:root {
    --font-sans: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --shadow-soft: 0 20px 60px rgba(15, 23, 42, .12);
    --shadow-control: 0 8px 18px rgba(20, 87, 217, .18);
}

html {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: .94rem;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.btn,
.form-label,
th {
    letter-spacing: 0;
}

.form-label {
    color: #263247;
    font-size: .88rem;
    font-weight: 700;
    margin-bottom: 7px;
}

.form-control,
.form-select,
.select2-container--bootstrap4 .select2-selection {
    min-height: 40px;
    font-size: .94rem;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .22rem rgba(20, 87, 217, .12);
}

.btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    box-shadow: 0 8px 18px rgba(20, 87, 217, .18);
}

.btn-primary:hover,
.btn-primary:focus {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 63, 159, .22);
}

.auth-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(24px, 5vw, 56px);
    background:
        radial-gradient(circle at 18% 16%, rgba(20, 87, 217, .12), transparent 34%),
        linear-gradient(135deg, #f8fbff 0%, #eef3f9 100%);
}

.login-panel {
    width: min(940px, 100%);
    min-height: 430px;
    grid-template-columns: 1.08fr .92fr;
    border: 1px solid rgba(203, 213, 225, .9);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    background: #fff;
}

.login-hero {
    position: relative;
    padding: clamp(38px, 5vw, 64px);
    background:
        linear-gradient(145deg, rgba(20, 87, 217, .2), transparent 42%),
        #111827;
    overflow: hidden;
}

.login-hero::before {
    content: "";
    position: absolute;
    inset: 22px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    pointer-events: none;
}

.login-hero::after {
    content: "Sistema empresarial";
    position: absolute;
    left: clamp(38px, 5vw, 64px);
    bottom: 34px;
    color: rgba(255, 255, 255, .58);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.login-hero .brand-mark.lg {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #1457d9);
    box-shadow: 0 16px 34px rgba(20, 87, 217, .32);
    font-size: 1.05rem;
}

.login-hero h1 {
    position: relative;
    margin: 28px 0 10px;
    font-size: clamp(2rem, 3.3vw, 2.75rem);
    line-height: 1.02;
    font-weight: 900;
    color: #fff;
}

.login-hero p {
    position: relative;
    max-width: 360px;
    margin: 0;
    color: rgba(255, 255, 255, .82);
    font-size: .98rem;
    line-height: 1.65;
}

.login-card {
    padding: clamp(34px, 4vw, 56px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-card h2 {
    margin-bottom: 6px;
    color: #111827;
    font-size: 1.35rem;
    font-weight: 900;
}

.login-card h2::after {
    content: "Ingrese sus credenciales para continuar";
    display: block;
    margin: 7px 0 24px;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 600;
}

.login-card .form-control {
    min-height: 46px;
    border-color: #cbd5e1;
    background: #f8fafc;
    border-radius: 10px;
    padding: 10px 13px;
}

.login-card .form-control:focus {
    background: #fff;
}

.login-card .btn-primary {
    min-height: 48px;
    margin-top: 4px;
    border-radius: 10px;
    font-size: .98rem;
    font-weight: 850;
}

.login-card .alert {
    border-radius: 10px;
    font-weight: 700;
}

@media (max-width: 991px) {
    .login-panel {
        width: min(620px, 100%);
        grid-template-columns: 1fr;
    }

    .login-hero {
        min-height: 260px;
    }

    .login-hero::after {
        bottom: 26px;
    }
}

@media (max-width: 575px) {
    .auth-wrap {
        padding: 18px;
        align-items: stretch;
    }

    .login-panel {
        min-height: 0;
        border-radius: 14px;
    }

    .login-hero,
    .login-card {
        padding: 28px;
    }

    .login-hero {
        min-height: 230px;
    }

    .login-hero::before {
        inset: 14px;
    }

    .login-hero::after {
        left: 28px;
        bottom: 22px;
    }

    .login-hero h1 {
        font-size: 1.9rem;
    }
}

/* Login centrado tipo panel corporativo */
.auth-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 30%, rgba(20, 87, 217, .12), transparent 32%),
        #071222;
}

.login-panel.login-panel-centered {
    width: min(352px, 100%);
    min-height: auto;
    display: block;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
}

.login-panel-centered .login-card {
    width: 100%;
    padding: 34px 26px 30px;
    border: 1px solid rgba(226, 232, 240, .86);
    border-radius: 12px;
    background: #f8fafc;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
    display: block;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.login-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #168f63, #0f7a52);
    box-shadow: 0 12px 24px rgba(15, 122, 82, .32);
    font-size: 1.2rem;
}

.login-heading {
    text-align: center;
    margin-bottom: 24px;
}

.login-heading h1 {
    margin: 0;
    color: #172033;
    font-size: 1.2rem;
    line-height: 1.15;
    font-weight: 900;
    text-transform: uppercase;
}

.login-heading p {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: .78rem;
    font-weight: 600;
}

.login-panel-centered .form-label {
    color: #697586;
    font-size: .8rem;
    font-weight: 800;
    margin-bottom: 7px;
}

.login-input-group {
    border-radius: 8px;
    box-shadow: none;
}

.login-input-group .input-group-text {
    min-width: 38px;
    justify-content: center;
    border-color: #d6deeb;
    border-right: 0;
    border-radius: 8px 0 0 8px;
    background: #eaf1fb;
    color: #5f6b7a;
}

.login-panel-centered .login-input-group .form-control {
    min-height: 36px;
    border-left: 0;
    border-color: #d6deeb;
    border-radius: 0 8px 8px 0;
    background: #eaf1fb;
    color: #172033;
    font-size: .84rem;
    padding: 8px 10px;
}

.login-panel-centered .login-input-group:focus-within .input-group-text,
.login-panel-centered .login-input-group:focus-within .form-control {
    border-color: #7aa7f8;
    background: #fff;
}

.login-panel-centered .login-input-group .form-control:focus {
    box-shadow: none;
}

.login-panel-centered .btn-primary {
    min-height: 40px;
    border-radius: 7px;
    background: #1677f2;
    border-color: #1677f2;
    box-shadow: 0 10px 22px rgba(22, 119, 242, .32);
    font-size: .88rem;
    font-weight: 850;
}

.login-panel-centered .btn-primary:hover,
.login-panel-centered .btn-primary:focus {
    background: #0f63d7;
    border-color: #0f63d7;
    transform: translateY(-1px);
}

.login-divider {
    height: 1px;
    margin-top: 26px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
}

.login-panel-centered .alert {
    border-radius: 8px;
    padding: 10px 12px;
    font-size: .84rem;
}

@media (max-width: 575px) {
    .auth-wrap {
        padding: 18px;
    }

    .login-panel.login-panel-centered {
        width: 100%;
    }

    .login-panel-centered .login-card {
        padding: 30px 22px 26px;
    }
}

.app-main.auth-main {
    margin-left: 0;
    width: 100%;
}

/* Sidebar corporativo estilo dashboard */
.sidebar {
    width: 250px;
    background: #071222;
    color: #fff;
    padding: 0;
    box-shadow: 8px 0 28px rgba(15, 23, 42, .12);
    transition: width .2s ease, transform .2s ease;
}

.sidebar-brand {
    min-height: 88px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.09);
    margin: 0;
}

.sidebar-brand .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #13925f;
    box-shadow: 0 10px 18px rgba(19, 146, 95, .28);
    font-size: 1rem;
    flex: 0 0 36px;
}

.brand-copy .brand-title,
.sidebar-brand .brand-title {
    color: #fff;
    font-size: .98rem;
    line-height: 1.05;
    text-transform: uppercase;
    font-weight: 900;
}

.sidebar-brand small {
    display: block;
    margin-top: 2px;
    color: #cbd5e1;
    font-size: .9rem;
    line-height: 1.05;
    text-transform: uppercase;
    font-weight: 800;
}

.sidebar .nav-caption {
    margin: 20px 26px 10px;
    color: #94a3b8;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
}

.sidebar-menu {
    padding: 0 12px 92px;
}

.sidebar .nav-link {
    min-height: 42px;
    color: rgba(226,232,240,.82);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 4px;
    font-weight: 800;
    gap: 12px;
    transition: background .16s ease, color .16s ease, opacity .16s ease;
}

.sidebar .nav-link i:first-child {
    width: 21px;
    min-width: 21px;
    text-align: center;
    font-size: 1.02rem;
    color: rgba(226,232,240,.86);
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus,
.sidebar .nav-link.active,
.sidebar .nav-parent.active {
    background: #1677f2;
    color: #fff;
}

.sidebar .nav-link:hover i:first-child,
.sidebar .nav-link:focus i:first-child,
.sidebar .nav-link.active i:first-child,
.sidebar .nav-parent.active i:first-child {
    color: #fff;
}

.sidebar .nav-parent {
    margin-top: 0;
}

.nav-caret {
    color: rgba(226,232,240,.7);
}

.submenu {
    margin: 2px 0 8px 22px;
    padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,.12);
}

.sidebar .sub-link {
    min-height: 36px;
    padding: 8px 10px;
    font-size: .86rem;
    color: rgba(226,232,240,.72);
    font-weight: 750;
}

.sidebar-logout {
    margin-top: 26px;
    color: #fb7185 !important;
}

.sidebar-logout i:first-child {
    color: #fb7185 !important;
}

.sidebar-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px 18px;
    border-top: 1px solid rgba(255,255,255,.09);
    text-align: center;
    color: #718096;
    font-size: .74rem;
}

.sidebar-footer strong,
.sidebar-footer span {
    display: block;
}

.app-main {
    margin-left: 250px;
    background: #f5f6f8;
    transition: margin-left .2s ease;
}

.topbar {
    height: 88px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 28px;
    gap: 16px;
}

.sidebar-toggle-btn {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    color: #64748b;
    background: #f3f4f6;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.sidebar-toggle-btn:hover,
.sidebar-toggle-btn:focus {
    background: #e8eef8;
    color: #1457d9;
    transform: translateY(-1px);
}

.topbar-spacer {
    flex: 1;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #111827;
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: #e9eef7;
    color: #334155;
}

.topbar-user strong,
.topbar-user span {
    display: block;
    line-height: 1.15;
}

.topbar-user strong {
    font-size: .9rem;
    font-weight: 900;
}

.topbar-user span {
    color: #64748b;
    font-size: .78rem;
}

.content-wrap {
    padding: 24px 22px;
}

body.sidebar-collapsed .sidebar {
    width: 78px;
}

body.sidebar-collapsed .app-main {
    margin-left: 78px;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-caption,
body.sidebar-collapsed .sidebar .nav-link span,
body.sidebar-collapsed .nav-caret,
body.sidebar-collapsed .submenu,
body.sidebar-collapsed .sidebar-footer {
    display: none !important;
}

body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .sidebar-menu {
    padding-left: 10px;
    padding-right: 10px;
}

body.sidebar-collapsed .sidebar .nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

@media (max-width: 991px) {
    .sidebar {
        width: 250px;
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .app-main,
    body.sidebar-collapsed .app-main {
        margin-left: 0;
    }

    body.sidebar-collapsed .sidebar {
        width: 250px;
    }

    body.sidebar-collapsed .brand-copy,
    body.sidebar-collapsed .nav-caption,
    body.sidebar-collapsed .sidebar .nav-link span,
    body.sidebar-collapsed .nav-caret,
    body.sidebar-collapsed .sidebar-footer {
        display: block !important;
    }

    body.sidebar-collapsed .submenu {
        display: block !important;
    }

    .topbar {
        height: 74px;
        padding: 0 16px;
    }
}

/* Ajustes moviles del sidebar tipo referencia */
.sidebar-backdrop {
    display: none;
}

.topbar-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

@media (max-width: 991px) {
    .topbar {
        height: 112px;
        padding: 0 48px;
        background: #fff;
        border-bottom: 1px solid #e5e7eb;
    }

    .sidebar-toggle-btn {
        width: 80px;
        height: 80px;
        font-size: 1.55rem;
        color: #68727f;
        background: #f1f3f5;
        box-shadow: none;
    }

    .topbar-avatar {
        width: 62px;
        height: 62px;
        background: #e5e7eb;
        box-shadow: 0 8px 18px rgba(15,23,42,.16);
        overflow: hidden;
    }

    .topbar-user > div {
        display: none;
    }

    .sidebar {
        top: 112px;
        width: min(78vw, 560px);
        height: calc(100vh - 112px);
        min-height: 0;
        padding-top: 0;
        transform: translateX(-100%);
        z-index: 1050;
        box-shadow: 20px 0 42px rgba(15,23,42,.25);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-brand,
    .sidebar-footer {
        display: none;
    }

    .sidebar .nav-caption {
        margin: 48px 32px 24px;
        font-size: 1.05rem;
        letter-spacing: .12em;
    }

    .sidebar-menu {
        padding: 0 32px 42px;
    }

    .sidebar .nav-link {
        min-height: 76px;
        border-radius: 12px;
        padding: 16px 30px;
        margin-bottom: 10px;
        gap: 28px;
        font-size: 1.85rem;
        color: rgba(226,232,240,.82);
    }

    .sidebar .nav-link i:first-child {
        width: 46px;
        min-width: 46px;
        font-size: 2.05rem;
    }

    .sidebar .sub-link {
        min-height: 58px;
        font-size: 1.35rem;
        padding: 12px 22px;
    }

    .submenu {
        margin-left: 44px;
        margin-bottom: 14px;
    }

    .sidebar-logout {
        margin-top: 44px;
        color: #fb5268 !important;
    }

    body.sidebar-mobile-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 112px 0 0 0;
        background: rgba(255,255,255,.72);
        backdrop-filter: blur(2px);
        z-index: 1045;
    }

    .content-wrap {
        padding: 34px 48px;
    }

    .page-title h1 {
        font-size: 2.35rem;
    }

    .page-title p {
        font-size: 1.12rem;
        line-height: 1.45;
    }
}

@media (max-width: 575px) {
    .topbar {
        height: 102px;
        padding: 0 28px;
    }

    .sidebar-toggle-btn {
        width: 64px;
        height: 64px;
        font-size: 1.35rem;
    }

    .topbar-avatar {
        width: 54px;
        height: 54px;
    }

    .sidebar {
        top: 102px;
        width: min(78vw, 420px);
        height: calc(100vh - 102px);
    }

    body.sidebar-mobile-open .sidebar-backdrop {
        inset: 102px 0 0 0;
    }

    .sidebar .nav-caption {
        margin: 38px 28px 22px;
        font-size: .95rem;
    }

    .sidebar-menu {
        padding: 0 26px 36px;
    }

    .sidebar .nav-link {
        min-height: 62px;
        padding: 13px 22px;
        gap: 22px;
        font-size: 1.35rem;
    }

    .sidebar .nav-link i:first-child {
        width: 34px;
        min-width: 34px;
        font-size: 1.55rem;
    }

    .sidebar .sub-link {
        min-height: 48px;
        font-size: 1rem;
    }

    .content-wrap {
        padding: 30px 24px;
    }

    .page-title h1 {
        font-size: 2rem;
    }

    .page-title p {
        font-size: 1.02rem;
    }
}

/* Correccion final: topbar no fijo y sidebar movil compacto */
.topbar {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
}

@media (max-width: 991px) {
    .topbar {
        height: 82px !important;
        padding: 0 28px !important;
    }

    .sidebar-toggle-btn {
        width: 54px !important;
        height: 54px !important;
        font-size: 1.25rem !important;
    }

    .topbar-avatar {
        width: 48px !important;
        height: 48px !important;
    }

    .sidebar,
    body.sidebar-collapsed .sidebar {
        top: 82px !important;
        width: min(72vw, 340px) !important;
        height: calc(100vh - 82px) !important;
    }

    body.sidebar-mobile-open .sidebar-backdrop {
        inset: 82px 0 0 0 !important;
    }

    .sidebar .nav-caption {
        margin: 28px 24px 16px !important;
        font-size: .78rem !important;
        letter-spacing: .11em !important;
    }

    .sidebar-menu {
        padding: 0 20px 28px !important;
    }

    .sidebar .nav-link {
        min-height: 50px !important;
        padding: 11px 18px !important;
        margin-bottom: 7px !important;
        gap: 14px !important;
        border-radius: 10px !important;
        font-size: 1rem !important;
    }

    .sidebar .nav-link i:first-child {
        width: 24px !important;
        min-width: 24px !important;
        font-size: 1.1rem !important;
    }

    .sidebar .sub-link {
        min-height: 42px !important;
        padding: 9px 14px !important;
        font-size: .9rem !important;
    }

    .submenu {
        margin-left: 22px !important;
        margin-bottom: 8px !important;
    }

    .sidebar-logout {
        margin-top: 24px !important;
    }
}

@media (max-width: 575px) {
    .topbar {
        height: 76px !important;
        padding: 0 24px !important;
    }

    .sidebar-toggle-btn {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.1rem !important;
    }

    .topbar-avatar {
        width: 44px !important;
        height: 44px !important;
    }

    .sidebar,
    body.sidebar-collapsed .sidebar {
        top: 76px !important;
        width: min(72vw, 310px) !important;
        height: calc(100vh - 76px) !important;
    }

    body.sidebar-mobile-open .sidebar-backdrop {
        inset: 76px 0 0 0 !important;
    }

    .sidebar .nav-caption {
        margin: 24px 20px 14px !important;
    }

    .sidebar-menu {
        padding: 0 18px 24px !important;
    }

    .sidebar .nav-link {
        min-height: 48px !important;
        padding: 10px 16px !important;
        gap: 13px !important;
        font-size: .96rem !important;
    }

    .sidebar .nav-link i:first-child {
        width: 22px !important;
        min-width: 22px !important;
        font-size: 1.05rem !important;
    }
}

/* Ajuste visual sidebar tipo referencia: tipografia compacta y sin difuminado */
.sidebar {
    width: 250px !important;
    background: #071426 !important;
    box-shadow: none !important;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

.sidebar-brand {
    min-height: 88px !important;
    padding: 18px 20px !important;
}

.sidebar-brand .brand-mark {
    width: 36px !important;
    height: 36px !important;
    flex-basis: 36px !important;
    font-size: .95rem !important;
    box-shadow: none !important;
}

.sidebar-brand .brand-title,
.brand-copy .brand-title {
    font-size: .9rem !important;
    font-weight: 800 !important;
    line-height: 1.05 !important;
    letter-spacing: 0 !important;
}

.sidebar-brand small {
    font-size: .9rem !important;
    font-weight: 800 !important;
    line-height: 1.05 !important;
    letter-spacing: 0 !important;
}

.sidebar .nav-caption {
    margin: 20px 26px 12px !important;
    color: #9aa6b8 !important;
    font-size: .72rem !important;
    font-weight: 800 !important;
    letter-spacing: .08em !important;
}

.sidebar-menu {
    padding: 0 14px 92px !important;
}

.sidebar .nav-link {
    min-height: 36px !important;
    padding: 8px 12px !important;
    margin-bottom: 6px !important;
    gap: 12px !important;
    border-radius: 7px !important;
    font-size: .9rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: rgba(255,255,255,.74) !important;
}

.sidebar .nav-link.active,
.sidebar .nav-parent.active {
    color: #fff !important;
    background: #1677f2 !important;
}

.sidebar .nav-link i:first-child {
    width: 20px !important;
    min-width: 20px !important;
    font-size: .98rem !important;
    color: rgba(255,255,255,.78) !important;
}

.sidebar .nav-link.active i:first-child,
.sidebar .nav-parent.active i:first-child {
    color: #fff !important;
}

.sidebar .sub-link {
    min-height: 32px !important;
    padding: 7px 10px !important;
    font-size: .82rem !important;
    font-weight: 650 !important;
}

.sidebar-logout {
    margin-top: 24px !important;
    color: #fb5268 !important;
}

body.sidebar-mobile-open .sidebar-backdrop {
    background: rgba(255,255,255,.42) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

@media (max-width: 991px) {
    .sidebar,
    body.sidebar-collapsed .sidebar {
        width: min(70vw, 320px) !important;
        box-shadow: none !important;
    }

    .sidebar .nav-caption {
        margin: 28px 24px 16px !important;
        font-size: .78rem !important;
    }

    .sidebar-menu {
        padding: 0 20px 28px !important;
    }

    .sidebar .nav-link {
        min-height: 46px !important;
        padding: 10px 16px !important;
        gap: 13px !important;
        font-size: .95rem !important;
        border-radius: 9px !important;
    }

    .sidebar .nav-link i:first-child {
        width: 22px !important;
        min-width: 22px !important;
        font-size: 1.05rem !important;
    }

    .sidebar .sub-link {
        min-height: 38px !important;
        font-size: .86rem !important;
    }
}

@media (max-width: 575px) {
    .sidebar,
    body.sidebar-collapsed .sidebar {
        width: min(70vw, 300px) !important;
    }

    .sidebar .nav-link {
        min-height: 44px !important;
        font-size: .92rem !important;
    }
}

/* Correccion estado contraido desktop */
@media (min-width: 992px) {
    body.sidebar-collapsed .sidebar {
        width: 78px !important;
    }

    body.sidebar-collapsed .app-main {
        margin-left: 78px !important;
    }

    body.sidebar-collapsed .brand-copy,
    body.sidebar-collapsed .nav-caption,
    body.sidebar-collapsed .sidebar .nav-link span,
    body.sidebar-collapsed .nav-caret,
    body.sidebar-collapsed .submenu,
    body.sidebar-collapsed .sidebar-footer {
        display: none !important;
    }

    body.sidebar-collapsed .sidebar-brand {
        justify-content: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body.sidebar-collapsed .sidebar-menu {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    body.sidebar-collapsed .sidebar .nav-link {
        justify-content: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        gap: 0 !important;
    }

    body.sidebar-collapsed .sidebar .nav-link i:first-child {
        margin: 0 !important;
    }
}

@media (min-width: 992px) {
    body.sidebar-collapsed .topbar {
        margin-left: 0 !important;
    }

    body.sidebar-collapsed .content-wrap {
        width: 100% !important;
    }
}

/* Sincroniza textos al reabrir sidebar en escritorio */
@media (min-width: 992px) {
    .brand-copy,
    .sidebar .nav-caption,
    .sidebar .nav-link span,
    .sidebar .nav-caret,
    .sidebar .submenu,
    .sidebar-footer {
        transition: opacity .14s ease .08s, visibility 0s linear .08s;
    }

    body.sidebar-expanding .brand-copy,
    body.sidebar-expanding .sidebar .nav-caption,
    body.sidebar-expanding .sidebar .nav-link span,
    body.sidebar-expanding .sidebar .nav-caret,
    body.sidebar-expanding .sidebar .submenu,
    body.sidebar-expanding .sidebar-footer {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

/* Sidebar desktop compacto: sin retraso al abrir */
@media (min-width: 992px) {
    .sidebar,
    .app-main {
        transition: none !important;
    }

    .brand-copy,
    .sidebar .nav-caption,
    .sidebar .nav-link span,
    .sidebar .nav-caret,
    .sidebar .submenu,
    .sidebar-footer {
        transition: none !important;
    }

    body.sidebar-expanding .brand-copy,
    body.sidebar-expanding .sidebar .nav-caption,
    body.sidebar-expanding .sidebar .nav-link span,
    body.sidebar-expanding .sidebar .nav-caret,
    body.sidebar-expanding .sidebar .submenu,
    body.sidebar-expanding .sidebar-footer {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

/* Correccion movil: sidebar completo y header no sticky */
@media (max-width: 991px) {
    .topbar {
        position: static !important;
        top: auto !important;
        z-index: auto !important;
    }

    .sidebar,
    body.sidebar-collapsed .sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: auto !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    body.sidebar-mobile-open .sidebar-backdrop {
        inset: 0 !important;
        background: rgba(255,255,255,.42) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    body.sidebar-mobile-open {
        overflow: hidden;
    }
}

/* Sidebar movil estilo panel completo */
@media (max-width: 991px) {
    .sidebar,
    body.sidebar-collapsed .sidebar {
        top: 0 !important;
        width: min(78vw, 560px) !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        background: #071426 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
        box-shadow: none !important;
    }

    .sidebar-brand,
    body.sidebar-collapsed .sidebar-brand {
        display: flex !important;
        min-height: 146px !important;
        padding: 30px 48px !important;
        border-bottom: 1px solid rgba(255,255,255,.11) !important;
        gap: 24px !important;
        justify-content: flex-start !important;
    }

    .sidebar-brand .brand-mark {
        width: 80px !important;
        height: 80px !important;
        flex: 0 0 80px !important;
        font-size: 1.85rem !important;
        background: #15945f !important;
        color: #fff !important;
        border-radius: 50% !important;
    }

    .brand-copy,
    body.sidebar-collapsed .brand-copy {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .sidebar-brand .brand-title,
    .brand-copy .brand-title,
    .sidebar-brand small {
        color: #fff !important;
        font-size: 1.55rem !important;
        font-weight: 900 !important;
        line-height: 1.18 !important;
        text-transform: uppercase !important;
        letter-spacing: 0 !important;
    }

    .sidebar .nav-caption,
    body.sidebar-collapsed .nav-caption {
        display: block !important;
        margin: 48px 64px 26px !important;
        color: #9eabba !important;
        font-size: 1.08rem !important;
        font-weight: 900 !important;
        letter-spacing: .14em !important;
        text-transform: uppercase !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .sidebar-menu,
    body.sidebar-collapsed .sidebar-menu {
        flex: 1 1 auto !important;
        padding: 0 32px 36px !important;
    }

    .sidebar .nav-link,
    body.sidebar-collapsed .sidebar .nav-link {
        min-height: 76px !important;
        padding: 17px 32px !important;
        margin-bottom: 12px !important;
        gap: 28px !important;
        border-radius: 12px !important;
        justify-content: flex-start !important;
        color: rgba(226,232,240,.83) !important;
        font-size: 1.65rem !important;
        font-weight: 800 !important;
        line-height: 1.2 !important;
    }

    .sidebar .nav-link span,
    body.sidebar-collapsed .sidebar .nav-link span,
    .sidebar .nav-caret,
    body.sidebar-collapsed .nav-caret {
        display: inline-flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .sidebar .nav-link i:first-child,
    body.sidebar-collapsed .sidebar .nav-link i:first-child {
        width: 44px !important;
        min-width: 44px !important;
        font-size: 2rem !important;
        margin: 0 !important;
        color: rgba(226,232,240,.85) !important;
    }

    .sidebar .nav-link.active,
    .sidebar .nav-parent.active {
        background: #1677f2 !important;
        color: #fff !important;
    }

    .sidebar .nav-link.active i:first-child,
    .sidebar .nav-parent.active i:first-child {
        color: #fff !important;
    }

    .nav-caret {
        margin-left: auto !important;
        font-size: 1.2rem !important;
    }

    .submenu,
    body.sidebar-collapsed .submenu {
        display: block !important;
        margin-left: 62px !important;
        margin-bottom: 14px !important;
    }

    .sidebar .sub-link {
        min-height: 50px !important;
        padding: 10px 18px !important;
        font-size: 1.15rem !important;
    }

    .sidebar-logout {
        margin-top: 52px !important;
        color: #fb5268 !important;
    }

    .sidebar-logout i:first-child {
        color: #fb5268 !important;
    }

    .sidebar-footer,
    body.sidebar-collapsed .sidebar-footer {
        display: block !important;
        position: static !important;
        margin-top: auto !important;
        padding: 26px 22px 30px !important;
        border-top: 1px solid rgba(255,255,255,.11) !important;
        color: rgba(226,232,240,.55) !important;
        text-align: center !important;
        font-size: 1.1rem !important;
        line-height: 1.35 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .sidebar-footer strong,
    .sidebar-footer span {
        display: block !important;
    }
}

@media (max-width: 575px) {
    .sidebar,
    body.sidebar-collapsed .sidebar {
        width: 78vw !important;
    }

    .sidebar-brand,
    body.sidebar-collapsed .sidebar-brand {
        min-height: 136px !important;
        padding: 26px 40px !important;
        gap: 20px !important;
    }

    .sidebar-brand .brand-mark {
        width: 72px !important;
        height: 72px !important;
        flex-basis: 72px !important;
        font-size: 1.6rem !important;
    }

    .sidebar-brand .brand-title,
    .brand-copy .brand-title,
    .sidebar-brand small {
        font-size: 1.35rem !important;
    }

    .sidebar .nav-caption,
    body.sidebar-collapsed .nav-caption {
        margin: 38px 48px 22px !important;
        font-size: .98rem !important;
    }

    .sidebar-menu,
    body.sidebar-collapsed .sidebar-menu {
        padding: 0 32px 30px !important;
    }

    .sidebar .nav-link,
    body.sidebar-collapsed .sidebar .nav-link {
        min-height: 66px !important;
        padding: 14px 26px !important;
        gap: 22px !important;
        font-size: 1.28rem !important;
    }

    .sidebar .nav-link i:first-child,
    body.sidebar-collapsed .sidebar .nav-link i:first-child {
        width: 34px !important;
        min-width: 34px !important;
        font-size: 1.58rem !important;
    }

    .sidebar-footer,
    body.sidebar-collapsed .sidebar-footer {
        font-size: .95rem !important;
        padding: 22px 18px 28px !important;
    }
}

/* Correccion sidebar movil compacto y desplazable */
@media (max-width: 991px) {
    .sidebar,
    body.sidebar-collapsed .sidebar {
        width: min(76vw, 360px) !important;
        max-width: calc(100vw - 64px) !important;
        height: 100vh !important;
        height: 100dvh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .sidebar-brand,
    body.sidebar-collapsed .sidebar-brand {
        min-height: auto !important;
        padding: 22px 24px !important;
        gap: 14px !important;
        align-items: center !important;
        flex: 0 0 auto !important;
    }

    .sidebar-brand .brand-mark {
        width: 54px !important;
        height: 54px !important;
        flex: 0 0 54px !important;
        font-size: 1.18rem !important;
    }

    .brand-copy,
    body.sidebar-collapsed .brand-copy {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .sidebar-brand .brand-title,
    .brand-copy .brand-title,
    .sidebar-brand small {
        font-size: 1.05rem !important;
        line-height: 1.16 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    .sidebar .nav-caption,
    body.sidebar-collapsed .nav-caption {
        margin: 28px 28px 18px !important;
        font-size: .78rem !important;
        letter-spacing: .12em !important;
    }

    .sidebar-menu,
    body.sidebar-collapsed .sidebar-menu {
        padding: 0 18px 24px !important;
        flex: 1 0 auto !important;
    }

    .sidebar .nav-link,
    body.sidebar-collapsed .sidebar .nav-link {
        min-height: 52px !important;
        padding: 11px 16px !important;
        margin-bottom: 9px !important;
        gap: 15px !important;
        border-radius: 10px !important;
        font-size: 1rem !important;
        font-weight: 800 !important;
    }

    .sidebar .nav-link i:first-child,
    body.sidebar-collapsed .sidebar .nav-link i:first-child {
        width: 26px !important;
        min-width: 26px !important;
        font-size: 1.18rem !important;
    }

    .nav-caret {
        font-size: .9rem !important;
    }

    .submenu,
    body.sidebar-collapsed .submenu {
        margin-left: 34px !important;
        margin-bottom: 8px !important;
    }

    .sidebar .sub-link {
        min-height: 38px !important;
        padding: 8px 12px !important;
        font-size: .86rem !important;
    }

    .sidebar-logout {
        margin-top: 22px !important;
    }

    .sidebar-footer,
    body.sidebar-collapsed .sidebar-footer {
        margin-top: auto !important;
        padding: 18px 16px 22px !important;
        font-size: .78rem !important;
        flex: 0 0 auto !important;
    }
}

@media (max-width: 575px) {
    .sidebar,
    body.sidebar-collapsed .sidebar {
        width: 76vw !important;
        max-width: calc(100vw - 56px) !important;
    }

    .sidebar-brand,
    body.sidebar-collapsed .sidebar-brand {
        padding: 20px 22px !important;
    }

    .sidebar-brand .brand-mark {
        width: 50px !important;
        height: 50px !important;
        flex-basis: 50px !important;
        font-size: 1.08rem !important;
    }

    .sidebar-brand .brand-title,
    .brand-copy .brand-title,
    .sidebar-brand small {
        font-size: .98rem !important;
    }

    .sidebar .nav-link,
    body.sidebar-collapsed .sidebar .nav-link {
        min-height: 50px !important;
        font-size: .96rem !important;
    }
}

/* Gestión de catálogos en formulario de personal */
.puesto-item {
    display: inline-flex;
    align-items: stretch;
    gap: 4px;
}

.puesto-item .puesto-chip {
    margin: 0;
}

.puesto-delete-btn {
    width: 34px;
    min-width: 34px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
}

.puesto-delete-btn i {
    font-size: .82rem;
}


/* Hover profesional del sidebar: evita que el foco del click quede como hover pegado */
.sidebar .nav-link {
    border-radius: 10px;
    transition: background-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.sidebar .nav-link:not(.active):hover {
    background: rgba(22, 119, 242, .16) !important;
    color: #ffffff !important;
    transform: translateX(2px);
    box-shadow: inset 3px 0 0 rgba(22, 119, 242, .9);
}

.sidebar .nav-link:not(.active):hover i:first-child,
.sidebar .nav-link:not(.active):hover .nav-caret {
    color: #ffffff !important;
}

.sidebar .nav-link:not(.active):focus:not(:focus-visible) {
    background: transparent !important;
    color: rgba(226,232,240,.82) !important;
    transform: none !important;
    box-shadow: none !important;
}

.sidebar .nav-link:not(.active):focus:not(:focus-visible) i:first-child,
.sidebar .nav-link:not(.active):focus:not(:focus-visible) .nav-caret {
    color: rgba(226,232,240,.86) !important;
}

.sidebar .nav-link:focus-visible {
    outline: 2px solid rgba(96, 165, 250, .85);
    outline-offset: 2px;
    background: rgba(22, 119, 242, .18) !important;
    color: #ffffff !important;
}

.sidebar .nav-link.active,
.sidebar .nav-parent.active {
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(22, 119, 242, .18);
}

.sidebar .sub-link:not(.active):hover {
    background: rgba(255,255,255,.08) !important;
    box-shadow: none;
}

/* Hover sidebar estilo Plantillas: suave, oscuro y sin quedarse pegado */
.sidebar .nav-link {
    border-radius: 8px !important;
    transition: background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.sidebar .nav-link:not(.active):hover {
    background: rgba(255, 255, 255, .085) !important;
    color: #ffffff !important;
    transform: none !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .16) !important;
}

.sidebar .nav-link:not(.active):hover i:first-child,
.sidebar .nav-link:not(.active):hover .nav-caret {
    color: #ffffff !important;
}

.sidebar .nav-link:not(.active):focus:not(:focus-visible) {
    background: transparent !important;
    color: rgba(226,232,240,.82) !important;
    box-shadow: none !important;
    transform: none !important;
}

.sidebar .nav-link:not(.active):focus:not(:focus-visible) i:first-child,
.sidebar .nav-link:not(.active):focus:not(:focus-visible) .nav-caret {
    color: rgba(226,232,240,.86) !important;
}

.sidebar .nav-link.active,
.sidebar .nav-parent.active {
    background: #1677f2 !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 22px rgba(22, 119, 242, .28) !important;
}

/* ==========================================================================
   NUEVO REDISEÑO PREMIUM PARA EL DASHBOARD Y EL APP SHELL (ESTILO STRIPE/LINEAR)
   ========================================================================== */

/* Variables base modernizadas - Enfoque Serio y Corporativo */
:root {
    --ink: #000000 !important;       /* Negro absoluto para textos principales */
    --muted: #475569 !important;     /* Slate 600 para textos secundarios legibles */
    --line: #cbd5e1 !important;      /* Slate 300 para bordes definidos y serios */
    --bg: #f1f5f9 !important;        /* Slate 100 para fondo de dashboard corporativo */
    --panel: #ffffff !important;
    --primary: #2563eb !important;   /* Blue 600 corporativo */
    --primary-dark: #1d4ed8 !important; /* Blue 700 */
    --accent: #198754 !important;    /* Verde original */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

body {
    background-color: var(--bg) !important;
    color: var(--ink) !important;
    font-family: var(--font-sans) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Modificaciones al App Shell / Sidebar / Topbar */
.sidebar {
    background: #0f172a !important; /* Slate 900 */
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.sidebar-brand {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.sidebar-brand .brand-mark {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25) !important;
    border-radius: 8px !important;
}

.sidebar .nav-link {
    color: #94a3b8 !important; /* Slate 400 */
    font-weight: 500 !important;
    font-size: 0.875rem !important;
}

.sidebar .nav-link i:first-child {
    color: #94a3b8 !important;
}

.sidebar .nav-link:not(.active):hover {
    background: rgba(255, 255, 255, 0.04) !important;
    color: #f8fafc !important;
}

.sidebar .nav-link:not(.active):hover i:first-child {
    color: #f8fafc !important;
}

.sidebar .nav-link.active,
.sidebar .nav-parent.active {
    background: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2) !important;
}

.sidebar .nav-link.active i:first-child,
.sidebar .nav-parent.active i:first-child {
    color: #ffffff !important;
}

.topbar {
    background: #ffffff !important;
    border-bottom: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

.sidebar-toggle-btn {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
}

.sidebar-toggle-btn:hover {
    background: #e2e8f0 !important;
    color: #000000 !important;
}

/* Rediseño de Contenedores de Paneles del Dashboard */
.work-panel {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 16px !important;
    padding: 24px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
    margin-bottom: 24px !important;
}

.work-panel h2 {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #000000 !important;
    letter-spacing: -0.01em !important;
    margin-bottom: 20px !important;
}

.page-title.dashboard-title h1 {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    color: #000000 !important;
    letter-spacing: -0.02em !important;
}

.page-title.dashboard-title p {
    font-size: 0.925rem !important;
    color: #475569 !important;
}

/* Rediseño de Tarjetas de KPIs - Estilo Moderno y Corporativo con Badge Circular Izquierdo */
.executive-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    border-radius: 16px !important;
    padding: 20px 24px !important;
    min-height: auto !important;
    gap: 20px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
}

.executive-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03) !important;
}

.executive-card-body {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 1px !important;
    z-index: 2;
}

.executive-card span {
    font-size: 0.72rem !important;
    font-weight: 750 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    margin-bottom: 2px !important;
}

.executive-card strong {
    font-size: 2.1rem !important;
    font-weight: 850 !important;
    line-height: 1 !important;
    letter-spacing: -0.02em !important;
    margin-top: 0 !important;
    margin-bottom: 4px !important;
    color: #0f172a !important; /* Negro/Slate oscuro para todos los números */
}

.executive-card small {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    color: #475569 !important; /* Gris oscuro para todas las descripciones */
}

.executive-card-icon {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2;
    width: 52px !important;
    height: 52px !important;
    border-radius: 50% !important;
    margin-left: 0 !important;
}

.executive-card-icon svg {
    width: 24px !important;
    height: 24px !important;
    display: block !important;
    opacity: 1 !important;
}

/* Verde - APTO (Fondo Verde Bebé con Badge Verde Sólido y Sombra de Brillo) */
.executive-green {
    background: linear-gradient(135deg, #f4fbf7 0%, #e8f8ee 100%) !important;
    border: 1px solid rgba(25, 135, 84, 0.16) !important;
}
.executive-green span {
    color: #198754 !important;
}
.executive-green .executive-card-icon {
    background: #198754 !important;
    box-shadow: 0 6px 12px rgba(25, 135, 84, 0.22) !important;
}

/* Amarillo - POR VENCER (Fondo Amarillo Bebé con Badge Naranja Sólido y Sombra de Brillo) */
.executive-yellow {
    background: linear-gradient(135deg, #fffdf5 0%, #fff9e6 100%) !important;
    border: 1px solid rgba(217, 119, 6, 0.16) !important;
}
.executive-yellow span {
    color: #d97706 !important;
}
.executive-yellow .executive-card-icon {
    background: #f59e0b !important;
    box-shadow: 0 6px 12px rgba(245, 158, 11, 0.22) !important;
}

/* Rojo - NO APTO (Fondo Rojo Bebé con Badge Rojo Sólido y Sombra de Brillo) */
.executive-red {
    background: linear-gradient(135deg, #fffdfd 0%, #ffebee 100%) !important;
    border: 1px solid rgba(220, 53, 69, 0.16) !important;
}
.executive-red span {
    color: #dc3545 !important;
}
.executive-red .executive-card-icon {
    background: #dc3545 !important;
    box-shadow: 0 6px 12px rgba(220, 53, 69, 0.22) !important;
}

/* Ocultar iconos antiguos de posición absoluta si quedasen sueltos */
.executive-card > i {
    display: none !important;
}

/* Gráficos - Estilo Oficial Recomendado por Chart.js para Nitidez Absoluta y Cero Desencajado */
.dashboard-chart-panel {
    min-height: auto !important;
    height: 320px !important; /* Altura fija corporativa del panel */
    display: flex !important;
    flex-direction: column !important;
}

.dashboard-chart-panel h2 {
    flex: 0 0 auto !important;
    margin-bottom: 14px !important;
}

.dashboard-chart-wrapper {
    position: relative !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    height: 200px !important; /* Altura reducida para evitar recortar la leyenda */
    min-height: 0 !important; /* Evita desbordamiento en flexbox */
}

.dashboard-chart-panel .dashboard-chart-wrapper canvas {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    max-width: none !important;
}

/* Barra de Filtros (Estilo Base de Datos de Notion/Linear) */
.dashboard-filters {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    padding: 18px !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
}

.dashboard-filters .form-label {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #475569 !important;
    margin-bottom: 6px !important;
}

.dashboard-filters .form-select,
.dashboard-filters .form-control {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    font-size: 0.875rem !important;
    color: #000000 !important;
    padding: 6px 12px !important;
    height: 38px !important;
    min-height: 38px !important;
    transition: all 0.15s ease-in-out !important;
}

.dashboard-filters .form-select:focus,
.dashboard-filters .form-control:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
    outline: none !important;
}

/* Tabla de Detalles del Dashboard (Estilo Notion/Stripe) - Letras en Negro para claridad */
.dashboard-detail-panel {
    padding-top: 24px !important;
}

.dashboard-table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin-top: 8px !important;
}

.dashboard-table thead th {
    background: #f1f5f9 !important; /* Gris claro más definido */
    color: #000000 !important; /* Cabeceras en negro sólido para máxima claridad */
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 12px 16px !important;
    border-top: 1px solid #cbd5e1 !important;
    border-bottom: 2px solid #94a3b8 !important;
    border-left: 0 !important;
    border-right: 0 !important;
}

.dashboard-table tbody td {
    padding: 14px 16px !important;
    border-bottom: 1px solid #cbd5e1 !important; /* Borde más serio */
    color: #000000 !important; /* Letras en negro para máxima visibilidad */
    font-size: 0.9rem !important;
}

.dashboard-table tbody tr {
    transition: background-color 0.12s ease !important;
}

.dashboard-table tbody tr:hover {
    background-color: #f8fafc !important;
}

.dashboard-table tbody tr.dashboard-row-observed {
    background: #fff7d6 !important;
    box-shadow: inset 4px 0 0 #f59e0b !important;
}

.dashboard-table tbody tr.dashboard-row-observed:hover {
    background: #fff1bd !important;
}

.dashboard-table tbody td strong {
    color: #000000 !important; /* Nombres en negro sólido */
    font-weight: 700 !important;
}

.dashboard-table tbody td span.text-muted.small {
    color: #475569 !important; /* ID/Documento más legible */
    font-size: 0.78rem !important;
    margin-top: 2px;
}

/* Rediseño de Badges de Estado (Restaurado a Colores Originales Sólidos con Bordes) */
.dashboard-table .badge {
    display: inline-flex !important;
    align-items: center !important;
    font-size: 0.725rem !important;
    font-weight: 700 !important;
    padding: 5px 10px !important;
    border-radius: 6px !important; /* Estilo cápsula corporativo */
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    border: 1px solid transparent !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

/* Verde - APTO (Color original #198754) */
.dashboard-table .badge.text-bg-success {
    background-color: #198754 !important;
    color: #ffffff !important;
    border-color: #157347 !important;
}

/* Amarillo - POR VENCER (Color original #ffc107) */
.dashboard-table .badge.text-bg-warning {
    background-color: #ffc107 !important;
    color: #000000 !important;
    border-color: #e0a800 !important;
}

/* Rojo - NO APTO (Color original #dc3545) */
.dashboard-table .badge.text-bg-danger {
    background-color: #dc3545 !important;
    color: #ffffff !important;
    border-color: #bd2130 !important;
}

.dashboard-action-group {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
}

.dashboard-pdf-preview-btn,
.dashboard-observation-btn,
.dashboard-approve-observation-btn {
    width: 34px !important;
    height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 7px !important;
    padding: 0 !important;
}

.dashboard-pdf-preview-btn i,
.dashboard-observation-btn i,
.dashboard-approve-observation-btn i {
    font-size: 1rem !important;
}

.dashboard-observation-btn.btn-outline-info {
    border-color: #0ea5e9 !important;
    color: #0284c7 !important;
    background: #f0f9ff !important;
}

.dashboard-observation-btn.btn-outline-info:hover {
    background: #0ea5e9 !important;
    color: #ffffff !important;
}

.dashboard-observation-summary {
    background: #f8fafc !important;
    border: 1px solid #dbe3ef !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
}

.dashboard-observation-summary strong,
.dashboard-observation-summary span {
    display: block !important;
}

.dashboard-observation-summary strong {
    color: #0f172a !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
}

.dashboard-observation-summary span {
    color: #475569 !important;
    font-size: 0.82rem !important;
    margin-top: 2px !important;
}

.dashboard-observation-status,
.requirement-audit-box {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
}

.requirement-audit-box h6 {
    color: #0f172a !important;
    font-size: 0.86rem !important;
    font-weight: 800 !important;
    margin: 0 0 8px !important;
}

.requirement-audit-item {
    border-top: 1px solid #fde68a !important;
    padding: 8px 0 !important;
}

.requirement-audit-item:first-of-type {
    border-top: 0 !important;
    padding-top: 0 !important;
}

.requirement-audit-item strong {
    color: #0f172a !important;
    display: block !important;
    font-size: 0.82rem !important;
}

.requirement-audit-item span {
    color: #475569 !important;
    display: block !important;
    font-size: 0.78rem !important;
    margin-top: 2px !important;
}

.requirement-image-preview {
    background: #f8fafc;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    display: block;
    margin-bottom: 10px;
    overflow: hidden;
    width: min(220px, 100%);
}

.requirement-image-preview img {
    display: block;
    height: 110px;
    object-fit: cover;
    width: 100%;
}

.observation-history-box {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    padding: 14px !important;
}

.observation-input-locked {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #64748b !important;
    cursor: not-allowed !important;
}

.requirement-observation-heading {
    align-items: center !important;
    display: flex !important;
    gap: 10px !important;
    justify-content: space-between !important;
}

.requirement-observation-state {
    border: 1px solid transparent !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    padding: 6px 10px !important;
}

.requirement-observation-state.is-observed {
    background: #fef3c7 !important;
    border-color: #fbbf24 !important;
    color: #92400e !important;
}

.requirement-observation-state.is-approved {
    background: #dcfce7 !important;
    border-color: #86efac !important;
    color: #166534 !important;
}

.requirement-observation-state.d-none {
    display: none !important;
}

.observation-readonly-notice {
    align-items: flex-start !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    color: #475569 !important;
    display: flex !important;
    font-size: 0.78rem !important;
    gap: 9px !important;
    line-height: 1.45 !important;
    margin-top: 10px !important;
    padding: 9px 11px !important;
}

.observation-readonly-notice i {
    color: #64748b !important;
    margin-top: 2px !important;
}

.observation-readonly-notice.d-none {
    display: none !important;
}

.observation-history-box h6 {
    align-items: center !important;
    display: flex !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
}

.observation-history-box h6::before {
    align-items: center !important;
    background: #dbeafe !important;
    border-radius: 7px !important;
    color: #2563eb !important;
    content: "\f1da" !important;
    display: inline-flex !important;
    font-family: "Font Awesome 6 Free" !important;
    font-size: 0.78rem !important;
    font-weight: 900 !important;
    height: 27px !important;
    justify-content: center !important;
    width: 27px !important;
}

.observation-timeline {
    display: grid !important;
    gap: 10px !important;
}

.observation-entry {
    background: #fff !important;
    border: 1px solid #dbe3ef !important;
    border-left: 4px solid #2563eb !important;
    border-radius: 9px !important;
    padding: 11px 12px !important;
}

.observation-entry-header {
    align-items: center !important;
    display: grid !important;
    gap: 9px !important;
    grid-template-columns: 30px minmax(0, 1fr) auto !important;
}

.observation-avatar {
    align-items: center !important;
    background: #dbeafe !important;
    border-radius: 50% !important;
    color: #1d4ed8 !important;
    display: inline-flex !important;
    font-size: 0.72rem !important;
    height: 30px !important;
    justify-content: center !important;
    width: 30px !important;
}

.observation-author strong,
.observation-author span {
    display: block !important;
}

.observation-author strong {
    color: #0f172a !important;
    font-size: 0.82rem !important;
    line-height: 1.2 !important;
}

.observation-author span,
.observation-entry time {
    color: #64748b !important;
    font-size: 0.72rem !important;
}

.observation-entry p {
    color: #334155 !important;
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
    margin: 9px 0 0 39px !important;
    overflow-wrap: anywhere !important;
    white-space: pre-wrap !important;
}

@media (max-width: 575.98px) {
    .observation-entry-header {
        grid-template-columns: 30px minmax(0, 1fr) !important;
    }

    .observation-entry time {
        grid-column: 2 !important;
    }

    .observation-entry p {
        margin-left: 0 !important;
    }
}

.dashboard-pdf-modal .modal-content {
    border: 0 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28) !important;
}

.dashboard-pdf-modal .modal-header {
    background: #ffffff !important;
    border-bottom: 1px solid #dbe3ef !important;
    padding: 14px 18px !important;
}

.dashboard-pdf-modal .modal-title {
    color: #0f172a !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
}

.dashboard-pdf-modal .modal-body {
    height: min(78vh, 760px) !important;
    padding: 0 !important;
    background: #0f172a !important;
}

.dashboard-pdf-modal iframe {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    border: 0 !important;
    background: #111827 !important;
}

/* Botones y otros controles */
.btn-outline-primary {
    border-color: #cbd5e1 !important;
    color: #000000 !important;
    background: #ffffff !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    border-radius: 6px !important;
    transition: all 0.15s ease !important;
}

.btn-outline-primary:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #000000 !important;
    transform: translateY(0) !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08) !important;
}

/* Soporte para los nuevos iconos SVG en las tarjetas ejecutivas */
.executive-card-icon svg {
    width: 24px !important;
    height: 24px !important;
    display: block !important;
    opacity: 1 !important;
    transition: none !important;
}

/* --- SISTEMA DE NOTIFICACIONES PREMIUM --- */
.topbar-notif-container {
    position: relative;
    margin-right: 20px;
}

.topbar-notif-btn {
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    position: relative;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    outline: none;
}

.topbar-notif-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.topbar-notif-btn i {
    font-size: 1.15rem;
}

.topbar-notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc3545;
    color: white;
    border: 2px solid #fff;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 0.68rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.35);
    padding: 0 4px;
}

.topbar-notif-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 400px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    display: none;
    z-index: 1050;
    overflow: hidden;
    animation: notifFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes notifFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.topbar-notif-container.active .topbar-notif-dropdown {
    display: block;
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 750;
    font-size: 0.95rem;
    color: #0f172a;
    background: #f8fafc;
}

.notif-search-container {
    position: relative;
    padding: 10px 16px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
}

.notif-search-container .search-icon {
    position: absolute;
    left: 28px;
    color: #94a3b8;
    font-size: 0.85rem;
    pointer-events: none;
}

.notif-search-container input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    font-size: 0.825rem;
    color: #0f172a;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    transition: all 0.15s ease;
}

.notif-search-container input:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.notif-dropdown-list {
    max-height: 380px;
    overflow-y: auto;
}

.notif-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.notif-dropdown-list::-webkit-scrollbar-track {
    background: transparent;
}

.notif-dropdown-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.notif-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    color: inherit;
}

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

.notif-item:hover {
    background: #f8fafc;
}

.notif-item.unread {
    background: #f8fafc;
}

.notif-item.unread:hover {
    background: #f1f5f9;
}

.notif-icon-container {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
    background: #e2e8f0;
    color: #475569;
}

.notif-icon-container.obs-status-observed {
    background: #fef3c7 !important;
    color: #d97706 !important;
}

.notif-observation-text {
    color: #0f172a !important;
    font-size: 0.78rem !important;
    margin-top: 3px !important;
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-body {
    font-size: 0.825rem;
    color: #334155;
    margin: 0 0 6px 0;
    line-height: 1.45;
    word-wrap: break-word;
}

.notif-body strong {
    color: #475569;
    font-weight: 600;
}

.notif-worker-name {
    font-weight: 700;
    color: #0f172a;
}

.notif-missing-fields {
    color: #d97706;
    font-weight: 550;
    display: block;
    margin-top: 2px;
    font-size: 0.775rem;
}

.notif-time {
    font-size: 0.725rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.notif-empty {
    padding: 36px 16px;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}

.notif-empty i {
    font-size: 1.8rem;
    color: #cbd5e1;
    margin-bottom: 8px;
    display: block;
}

@media (max-width: 767px) {
    .topbar {
        position: relative !important;
    }
    .topbar-notif-container {
        position: static !important;
    }
    .topbar-notif-dropdown {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: none !important;
        top: 100% !important;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15) !important;
    }
}



/* Tabla PMI Individual compacta */
#requirementsTable {
    table-layout: auto;
    font-size: 0.86rem;
}

#requirementsTable th,
#requirementsTable td {
    padding: 0.48rem 0.42rem;
    vertical-align: middle;
}

#requirementsTable th:nth-child(1),
#requirementsTable td:nth-child(1) {
    width: 72px;
    text-align: center;
}

#requirementsTable th:nth-child(2),
#requirementsTable td:nth-child(2) {
    min-width: 170px;
    max-width: 260px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

#requirementsTable th:nth-child(3),
#requirementsTable td:nth-child(3),
#requirementsTable th:nth-child(4),
#requirementsTable td:nth-child(4),
#requirementsTable th:nth-child(5),
#requirementsTable td:nth-child(5) {
    min-width: 92px;
    white-space: nowrap;
}

#requirementsTable th:nth-child(6),
#requirementsTable td:nth-child(6) {
    min-width: 92px;
    white-space: nowrap;
}

#requirementsTable th:nth-child(7),
#requirementsTable td:nth-child(7) {
    min-width: 142px;
    white-space: nowrap;
}

#requirementsTable .badge {
    font-size: 0.68rem;
    line-height: 1;
    padding: 0.32rem 0.45rem;
    white-space: nowrap;
}

#requirementsTable td.text-nowrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

#requirementsTable .btn-sm {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 0.78rem;
    flex: 0 0 auto;
}

#requirementsTable .form-check-input {
    width: 0.9rem;
    height: 0.9rem;
}

/* Layout PMI Individual más amplio para requisitos */
@media (min-width: 992px) {
    #requirementsWorkspace .requirements-profile-col,
    #machineDocumentsWorkspace .machine-profile-col,
    #companyDocumentsWorkspace .machine-profile-col {
        flex: 0 0 29% !important;
        width: 29% !important;
        max-width: 29% !important;
    }

    #requirementsWorkspace .requirements-table-col,
    #machineDocumentsWorkspace .machine-table-col,
    #companyDocumentsWorkspace .machine-table-col {
        flex: 0 0 71% !important;
        width: 71% !important;
        max-width: 71% !important;
    }

    #requirementsWorkspace .requirements-profile-col .work-panel,
    #machineDocumentsWorkspace .machine-profile-col .work-panel,
    #companyDocumentsWorkspace .machine-profile-col .work-panel {
        padding: 18px;
    }

    #requirementsWorkspace .worker-card img {
        width: min(170px, 100%);
        height: 170px;
        object-fit: cover;
    }

    #requirementsWorkspace .worker-card .btn {
        font-size: 0.82rem;
        padding: 0.42rem 0.62rem;
    }

    #requirementsWorkspace .info-list {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 8px 10px;
        font-size: 0.84rem;
    }

    #requirementsWorkspace .info-list dt,
    #requirementsWorkspace .info-list dd {
        line-height: 1.35;
    }

    #requirementsWorkspace .form-label,
    #requirementsWorkspace .form-check-label {
        font-size: 0.84rem;
    }

    #requirementsWorkspace #positionSelect {
        font-size: 0.84rem;
    }
}

@media (min-width: 1200px) {
    #requirementsWorkspace .requirements-profile-col,
    #machineDocumentsWorkspace .machine-profile-col,
    #companyDocumentsWorkspace .machine-profile-col {
        flex-basis: 28% !important;
        width: 28% !important;
        max-width: 28% !important;
    }

    #requirementsWorkspace .requirements-table-col,
    #machineDocumentsWorkspace .machine-table-col,
    #companyDocumentsWorkspace .machine-table-col {
        flex-basis: 72% !important;
        width: 72% !important;
        max-width: 72% !important;
    }
}

@media (max-width: 991px) {
    #requirementsWorkspace .requirements-profile-col,
    #requirementsWorkspace .requirements-table-col,
    #machineDocumentsWorkspace .machine-profile-col,
    #machineDocumentsWorkspace .machine-table-col,
    #companyDocumentsWorkspace .machine-profile-col,
    #companyDocumentsWorkspace .machine-table-col {
        width: 100% !important;
        max-width: 100% !important;
    }
}


/* Tabla Documentos de maquinaria compacta */
#machineDocumentsTable {
    table-layout: auto;
    font-size: 0.86rem;
}

#machineDocumentsTable th,
#machineDocumentsTable td {
    padding: 0.48rem 0.42rem;
    vertical-align: middle;
}

#machineDocumentsTable th:nth-child(1),
#machineDocumentsTable td:nth-child(1) {
    width: 72px;
    text-align: center;
}

#machineDocumentsTable th:nth-child(2),
#machineDocumentsTable td:nth-child(2) {
    min-width: 170px;
    max-width: 260px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

#machineDocumentsTable th:nth-child(3),
#machineDocumentsTable td:nth-child(3),
#machineDocumentsTable th:nth-child(4),
#machineDocumentsTable td:nth-child(4),
#machineDocumentsTable th:nth-child(5),
#machineDocumentsTable td:nth-child(5) {
    min-width: 92px;
    white-space: nowrap;
}

#machineDocumentsTable th:nth-child(6),
#machineDocumentsTable td:nth-child(6) {
    min-width: 92px;
    white-space: nowrap;
}

#machineDocumentsTable th:nth-child(7),
#machineDocumentsTable td:nth-child(7) {
    min-width: 142px;
    white-space: nowrap;
}

#machineDocumentsTable .badge {
    font-size: 0.68rem;
    line-height: 1;
    padding: 0.32rem 0.45rem;
    white-space: nowrap;
}

#machineDocumentsTable td.text-nowrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

#machineDocumentsTable .btn-sm {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 0.78rem;
    flex: 0 0 auto;
}

#machineDocumentsTable .form-check-input {
    width: 0.9rem;
    height: 0.9rem;
}

/* Layout Documentos de maquinaria/empresa alineado con PMI Individual */
@media (min-width: 992px) {
    #machineDocumentsWorkspace .machine-profile-col,
    #companyDocumentsWorkspace .machine-profile-col {
        flex: 0 0 29%;
        max-width: 29%;
    }

    #machineDocumentsWorkspace .machine-table-col,
    #companyDocumentsWorkspace .machine-table-col {
        flex: 0 0 71%;
        max-width: 71%;
    }

    #machineDocumentsWorkspace .machine-profile-col .work-panel,
    #companyDocumentsWorkspace .machine-profile-col .work-panel {
        padding: 18px;
    }

    #machineDocumentsWorkspace .worker-card img,
    #companyDocumentsWorkspace .worker-card img {
        width: min(170px, 100%);
        height: 170px;
        object-fit: cover;
    }

    #machineDocumentsWorkspace .worker-card .btn,
    #companyDocumentsWorkspace .worker-card .btn {
        font-size: 0.82rem;
        padding: 0.42rem 0.62rem;
    }

    #machineDocumentsWorkspace .info-list,
    #companyDocumentsWorkspace .info-list {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 8px 10px;
        font-size: 0.84rem;
    }

    #machineDocumentsWorkspace .info-list dt,
    #machineDocumentsWorkspace .info-list dd,
    #companyDocumentsWorkspace .info-list dt,
    #companyDocumentsWorkspace .info-list dd {
        line-height: 1.35;
    }
}

@media (min-width: 1200px) {
    #machineDocumentsWorkspace .machine-profile-col,
    #companyDocumentsWorkspace .machine-profile-col {
        flex-basis: 28%;
        max-width: 28%;
    }

    #machineDocumentsWorkspace .machine-table-col,
    #companyDocumentsWorkspace .machine-table-col {
        flex-basis: 72%;
        max-width: 72%;
    }
}

@media (max-width: 991px) {
    #machineDocumentsWorkspace .machine-profile-col,
    #machineDocumentsWorkspace .machine-table-col,
    #companyDocumentsWorkspace .machine-profile-col,
    #companyDocumentsWorkspace .machine-table-col {
        width: 100%;
    }
}

/* Botonera compacta de documentos/requisitos */
#requirementsWorkspace .work-panel > .d-flex:first-child,
#machineDocumentsWorkspace .work-panel > .d-flex:first-child,
#companyDocumentsWorkspace .work-panel > .d-flex:first-child {
    align-items: center !important;
}

#requirementsWorkspace .work-panel > .d-flex:first-child > .d-flex,
#machineDocumentsWorkspace .work-panel > .d-flex:first-child > .d-flex,
#companyDocumentsWorkspace .work-panel > .d-flex:first-child > .d-flex {
    flex-wrap: nowrap !important;
    gap: 7px !important;
    align-items: center;
}

#downloadSelectedRequirementsBtn,
#downloadRequirementsBtn,
#addRequirementBtn,
#downloadSelectedMachineDocumentsBtn,
#downloadMachineDocumentsBtn,
#addMachineDocumentBtn {
    min-height: 38px;
    padding: 0.48rem 0.72rem;
    font-size: 0.84rem;
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
}

#downloadSelectedRequirementsBtn i,
#downloadRequirementsBtn i,
#addRequirementBtn i,
#downloadSelectedMachineDocumentsBtn i,
#downloadMachineDocumentsBtn i,
#addMachineDocumentBtn i {
    margin-right: 0.25rem !important;
    font-size: 0.86rem;
}

@media (max-width: 1199px) {
    #downloadSelectedRequirementsBtn,
    #downloadRequirementsBtn,
    #addRequirementBtn,
    #downloadSelectedMachineDocumentsBtn,
    #downloadMachineDocumentsBtn,
    #addMachineDocumentBtn {
        padding-inline: 0.58rem;
        font-size: 0.78rem;
    }
}

@media (max-width: 767px) {
    #requirementsWorkspace .work-panel > .d-flex:first-child > .d-flex,
    #machineDocumentsWorkspace .work-panel > .d-flex:first-child > .d-flex {
        flex-wrap: wrap !important;
    }
}

/* Control de asistencia */
.attendance-filters .form-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.3rem;
}

#attendanceTable {
    font-size: 0.86rem;
}

#attendanceTable th,
#attendanceTable td {
    padding: 0.55rem 0.5rem;
    vertical-align: middle;
}

#attendanceTable th:nth-child(1),
#attendanceTable td:nth-child(1) {
    min-width: 92px;
    white-space: nowrap;
}

#attendanceTable th:nth-child(2),
#attendanceTable td:nth-child(2) {
    min-width: 160px;
    white-space: normal;
    overflow-wrap: anywhere;
}

#attendanceTable th:nth-child(3),
#attendanceTable td:nth-child(3) {
    min-width: 280px;
    max-width: 420px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.3;
}

#attendanceTable th:nth-child(4),
#attendanceTable td:nth-child(4) {
    min-width: 180px;
    white-space: normal;
    overflow-wrap: anywhere;
}

#attendanceTable th:nth-child(5),
#attendanceTable td:nth-child(5) {
    min-width: 130px;
    white-space: normal;
    overflow-wrap: anywhere;
}

#attendanceTable th:nth-child(6),
#attendanceTable td:nth-child(6) {
    min-width: 112px;
    white-space: nowrap;
}

#attendanceTable th:nth-child(7),
#attendanceTable td:nth-child(7) {
    min-width: 92px;
    white-space: nowrap;
}

#attendanceTable .badge {
    font-size: 0.7rem;
    padding: 0.34rem 0.48rem;
}

#attendanceTable .btn-sm {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
}

.attendance-activity-cell {
    color: #334155;
}

/* Mejora visual general para tablas y checkboxes */
.table {
    --bs-table-bg: #ffffff;
    --bs-table-color: #0f172a;
    --bs-table-border-color: #d8e1ee;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    border-bottom: 1px solid #cbd5e1;
    padding-top: 0.78rem;
    padding-bottom: 0.78rem;
}

.table tbody td {
    color: #111827;
    border-bottom: 1px solid #e2e8f0;
}

.table tbody tr {
    transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.table tbody tr:hover {
    background: #f8fbff;
}

.table tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 #2563eb;
}

.table-responsive {
    border-radius: 8px;
}

.form-check-input,
input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    min-width: 1.15rem;
    border: 1.8px solid #94a3b8;
    border-radius: 5px;
    background-color: #ffffff;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.form-check-input:hover,
input[type="checkbox"]:hover {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.form-check-input:focus,
input[type="checkbox"]:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.form-check-input:checked,
input[type="checkbox"]:checked {
    background-color: #16a34a;
    border-color: #15803d;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16);
}

.form-check-input:active,
input[type="checkbox"]:active {
    transform: scale(0.94);
}

.table .form-check-input,
.table input[type="checkbox"] {
    display: inline-grid;
    vertical-align: middle;
    margin: 0;
}

.table th.text-center,
.table td.text-center {
    text-align: center;
}

#requirementsTable .form-check-input,
#machineDocumentsTable .form-check-input,
.masivo-table .form-check-input {
    width: 1.12rem;
    height: 1.12rem;
    min-width: 1.12rem;
}

#requirementsTable thead th,
#machineDocumentsTable thead th,
#attendanceTable thead th,
.masivo-table thead th,
.dashboard-table thead th,
.dataTable thead th {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-top: 1px solid #eef2f7;
}

#requirementsTable tbody tr:hover,
#machineDocumentsTable tbody tr:hover,
#attendanceTable tbody tr:hover,
.masivo-table tbody tr:hover,
.dashboard-table tbody tr:hover,
.dataTable tbody tr:hover {
    background: #f8fbff !important;
}

/* Mantener los interruptores tipo switch con su forma original */
.form-switch .form-check-input {
    width: 2.25em;
    height: 1.15em;
    min-width: 2.25em;
    border-radius: 2em;
    background-position: left center;
}

.form-switch .form-check-input:checked {
    background-color: #16a34a;
    border-color: #15803d;
    background-position: right center;
}

/* Visualización profesional de Foto y Firma Digital */
.file-box {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
}

.file-box .form-label {
    margin-bottom: 0;
    font-weight: 700;
    color: #172033;
}

.file-box .preview-box {
    width: 100%;
    height: clamp(230px, 25vw, 320px);
    min-height: 230px;
    border: 1px dashed #c7d4e5;
    border-radius: 8px;
    background: linear-gradient(180deg, #fbfdff 0%, #f4f7fb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 12px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.file-box .preview-box img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain !important;
    object-position: center center;
    border-radius: 6px;
    image-rendering: auto;
}

.file-box .preview-box span {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #94a3b8;
    font-size: 2rem;
}

.file-box .input-group,
.file-box .d-flex {
    width: 100%;
}

@media (max-width: 991px) {
    .file-box .preview-box {
        height: clamp(210px, 48vw, 300px);
        min-height: 210px;
    }
}

@media (max-width: 575px) {
    .file-box .preview-box {
        height: 220px;
        min-height: 220px;
        padding: 10px;
    }
}

/* Visualización completa de imágenes en PMI Individual y Documentos de maquinaria */
#requirementsWorkspace .worker-card,
#machineDocumentsWorkspace .worker-card,
#companyDocumentsWorkspace .worker-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#requirementsWorkspace .worker-card img,
#machineDocumentsWorkspace .worker-card img,
#companyDocumentsWorkspace .worker-card img {
    width: min(180px, 100%) !important;
    height: 180px !important;
    max-width: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    padding: 8px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background: linear-gradient(180deg, #fbfdff 0%, #eef3f9 100%) !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.7) !important;
    image-rendering: auto;
}

/* Empresa Seguridad usa el mismo layout visual que Empresa Documentos */
@media (min-width: 992px) {
    #companySecurityWorkspace .machine-profile-col {
        flex: 0 0 29% !important;
        width: 29% !important;
        max-width: 29% !important;
    }

    #companySecurityWorkspace .machine-table-col {
        flex: 0 0 71% !important;
        width: 71% !important;
        max-width: 71% !important;
    }

    #companySecurityWorkspace .machine-profile-col .work-panel {
        padding: 18px;
    }

    #companySecurityWorkspace .info-list {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 8px 10px;
        font-size: 0.84rem;
    }
}

@media (min-width: 1200px) {
    #companySecurityWorkspace .machine-profile-col {
        flex-basis: 28% !important;
        width: 28% !important;
        max-width: 28% !important;
    }

    #companySecurityWorkspace .machine-table-col {
        flex-basis: 72% !important;
        width: 72% !important;
        max-width: 72% !important;
    }
}

@media (max-width: 991px) {
    #companySecurityWorkspace .machine-profile-col,
    #companySecurityWorkspace .machine-table-col {
        width: 100% !important;
        max-width: 100% !important;
    }
}

#companySecurityWorkspace .worker-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#companySecurityWorkspace .worker-card img {
    width: 190px !important;
    height: 190px !important;
    max-width: 100% !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: #eef2f7 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
}

#companySecurityWorkspace .worker-card .btn {
    max-width: 100%;
    white-space: normal;
    text-align: center;
    font-size: 0.82rem;
    padding: 0.42rem 0.62rem;
}

.company-generic-module .worker-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.company-generic-module .worker-card img {
    width: 190px !important;
    height: 190px !important;
    max-width: 100% !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: #eef2f7 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
}

.company-generic-module .worker-card .btn {
    max-width: 100%;
    white-space: normal;
    text-align: center;
    font-size: 0.82rem;
    padding: 0.42rem 0.62rem;
}

.usuario-tabs {
    background: #eef2f7;
    border-radius: 8px;
    display: inline-flex;
    gap: 4px;
    padding: 4px;
}

.usuario-tabs .nav-link {
    border-radius: 6px;
    color: #475569;
    font-weight: 700;
}

.usuario-tabs .nav-link.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.permission-section {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 14px;
    background: #ffffff;
}

.permission-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.permission-card {
    border: 1px solid #d7e0ea;
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
}

.permission-parent {
    font-weight: 800;
    color: #0f172a;
}

.permission-child-list {
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
    padding-top: 8px;
}

.permission-child-list .form-check {
    margin-bottom: 6px;
}

.permission-table th {
    background: #f8fafc;
    font-size: 0.76rem;
    text-transform: uppercase;
    color: #334155;
}

.permission-table td,
.permission-table th {
    padding: 0.65rem 0.75rem;
}

.permission-scope-header {
    position: relative;
}

.permission-scope-header .accordion-button {
    padding-right: 118px;
}

.permission-scope-all {
    align-items: center;
    display: flex;
    gap: 4px;
    margin: 0;
    padding-left: 0;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
}

.permission-scope-all .form-check-input {
    height: 1.15em;
    margin: 0;
    min-width: 2.25em;
    width: 2.25em;
}

.permission-scope-all .form-check-label {
    color: #334155;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

@media (max-width: 575px) {
    .permission-scope-header .accordion-button {
        padding-right: 1.25rem;
    }

    .permission-scope-all {
        background: #eef4ff;
        border-top: 1px solid #cbd5e1;
        justify-content: flex-end;
        padding: 8px 12px;
        position: static;
        transform: none;
    }
}

@media (min-width: 992px) {
    .company-generic-module .machine-profile-col {
        flex: 0 0 29% !important;
        width: 29% !important;
        max-width: 29% !important;
    }

    .company-generic-module .machine-table-col {
        flex: 0 0 71% !important;
        width: 71% !important;
        max-width: 71% !important;
    }

    .company-generic-module .machine-profile-col .work-panel {
        padding: 18px;
    }

    .company-generic-module .info-list {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 8px 10px;
        font-size: 0.84rem;
    }
}

@media (min-width: 1200px) {
    .company-generic-module .machine-profile-col {
        flex-basis: 28% !important;
        width: 28% !important;
        max-width: 28% !important;
    }

    .company-generic-module .machine-table-col {
        flex-basis: 72% !important;
        width: 72% !important;
        max-width: 72% !important;
    }
}

@media (max-width: 991px) {
    .company-generic-module .machine-profile-col,
    .company-generic-module .machine-table-col {
        width: 100% !important;
        max-width: 100% !important;
    }
}

#requirementsWorkspace .worker-card .btn,
#machineDocumentsWorkspace .worker-card .btn,
#companyDocumentsWorkspace .worker-card .btn {
    max-width: 100%;
    white-space: normal;
    text-align: center;
}

@media (min-width: 992px) {
    #requirementsWorkspace .worker-card img,
    #machineDocumentsWorkspace .worker-card img,
    #companyDocumentsWorkspace .worker-card img {
        width: min(178px, 100%) !important;
        height: 178px !important;
    }
}

@media (max-width: 575px) {
    #requirementsWorkspace .worker-card img,
    #machineDocumentsWorkspace .worker-card img,
    #companyDocumentsWorkspace .worker-card img {
        width: min(210px, 100%) !important;
        height: 210px !important;
    }
}

/* Ajuste fino: imagen completa aprovechando mejor el cuadrado */
#requirementsWorkspace .worker-card img,
#machineDocumentsWorkspace .worker-card img,
#companyDocumentsWorkspace .worker-card img {
    width: min(190px, 100%) !important;
    height: 190px !important;
    padding: 2px !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: #f8fafc !important;
}

@media (min-width: 992px) {
    #requirementsWorkspace .worker-card img,
    #machineDocumentsWorkspace .worker-card img,
    #companyDocumentsWorkspace .worker-card img {
        width: min(188px, 100%) !important;
        height: 188px !important;
        padding: 2px !important;
    }
}

@media (max-width: 575px) {
    #requirementsWorkspace .worker-card img,
    #machineDocumentsWorkspace .worker-card img,
    #companyDocumentsWorkspace .worker-card img {
        width: min(220px, 100%) !important;
        height: 220px !important;
        padding: 2px !important;
    }
}

/* Ajuste final: llenar el cuadrado sin deformar en PMI y maquinaria */
#requirementsWorkspace .worker-card img,
#machineDocumentsWorkspace .worker-card img,
#companyDocumentsWorkspace .worker-card img {
    width: 190px !important;
    height: 190px !important;
    padding: 0 !important;
    object-fit: cover !important;
    object-position: center top !important;
    background: #f8fafc !important;
}

@media (min-width: 992px) {
    #requirementsWorkspace .worker-card img,
    #machineDocumentsWorkspace .worker-card img,
    #companyDocumentsWorkspace .worker-card img {
        width: 188px !important;
        height: 188px !important;
    }
}

@media (max-width: 575px) {
    #requirementsWorkspace .worker-card img,
    #machineDocumentsWorkspace .worker-card img,
    #companyDocumentsWorkspace .worker-card img {
        width: min(220px, 100%) !important;
        height: 220px !important;
    }
}

/* Estado actual del submodulo: visible sin competir con el modulo padre. */
.sidebar .sub-link.active {
    background: rgba(148, 163, 184, 0.14) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: none !important;
    transform: none !important;
}

.sidebar .sub-link.active i:first-child {
    color: #ffffff !important;
}

.state-alert-icon {
    align-items: center;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    color: #f59e0b;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.25rem;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.state-alert-rules {
    display: grid;
    gap: 4px;
    font-size: .875rem;
}

.config-alert-accordion {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
}

.config-alert-accordion .accordion-button {
    font-weight: 700;
}

.config-alert-table th {
    color: #27364a;
    font-size: .75rem;
    text-transform: uppercase;
}

.config-alert-days-input {
    display: inline-block;
    max-width: 120px;
    text-align: center;
}

.sticky-form-actions {
    align-items: center;
    background: rgba(248, 250, 252, .96);
    border-top: 1px solid #cbd5e1;
    bottom: 0;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
    padding: 12px 0;
    position: sticky;
    z-index: 4;
}

.dashboard-filters {
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .78fr) minmax(0, .95fr) !important;
}

.dashboard-filter-company {
    max-width: 220px;
}

@media (max-width: 1399px) {
    .dashboard-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    .dashboard-filter-company {
        max-width: none;
    }
}

.dashboard-detail-panel,
.dashboard-detail-panel .dashboard-filters,
.dashboard-detail-panel .dashboard-filters > div,
.dashboard-detail-panel .table-responsive {
    min-width: 0;
    max-width: 100%;
}

.dashboard-detail-panel .dashboard-filters .form-control,
.dashboard-detail-panel .dashboard-filters .form-select {
    width: 100%;
    max-width: 100%;
}

.dashboard-detail-panel .table-responsive {
    overflow-x: auto;
}

@media (max-width: 1279px) {
    .dashboard-detail-panel .table-responsive {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .dashboard-detail-panel .dashboard-table {
        min-width: 1000px;
    }
}

@media (min-width: 1280px) {
    .dashboard-detail-panel .table-responsive {
        overflow-x: hidden;
    }

    .dashboard-detail-panel .dashboard-table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed !important;
    }

    .dashboard-detail-panel .dashboard-table th,
    .dashboard-detail-panel .dashboard-table td {
        padding: 10px 8px !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    .dashboard-detail-panel .dashboard-table th {
        letter-spacing: 0 !important;
    }

    .dashboard-detail-panel .dashboard-table th:nth-child(1),
    .dashboard-detail-panel .dashboard-table td:nth-child(1) { width: 14%; }
    .dashboard-detail-panel .dashboard-table th:nth-child(2),
    .dashboard-detail-panel .dashboard-table td:nth-child(2) { width: 18%; }
    .dashboard-detail-panel .dashboard-table th:nth-child(3),
    .dashboard-detail-panel .dashboard-table td:nth-child(3) { width: 17%; }
    .dashboard-detail-panel .dashboard-table th:nth-child(4),
    .dashboard-detail-panel .dashboard-table td:nth-child(4) { width: 14%; }
    .dashboard-detail-panel .dashboard-table th:nth-child(5),
    .dashboard-detail-panel .dashboard-table td:nth-child(5) { width: 12%; }
    .dashboard-detail-panel .dashboard-table th:nth-child(6),
    .dashboard-detail-panel .dashboard-table td:nth-child(6) { width: 14%; }
    .dashboard-detail-panel .dashboard-table th:nth-child(7),
    .dashboard-detail-panel .dashboard-table td:nth-child(7) { width: 11%; }

    .dashboard-detail-panel .dashboard-action-group {
        display: flex !important;
        flex-wrap: nowrap;
        justify-content: center;
        width: 100%;
        gap: 3px !important;
    }

    .dashboard-detail-panel .dashboard-action-group .btn {
        flex: 0 0 28px;
        width: 28px;
        min-width: 28px;
        max-width: 28px;
        height: 28px;
        min-height: 28px;
        padding: 0 !important;
        font-size: .72rem !important;
    }
}

@media (max-width: 767px) {
    .dashboard-filters {
        grid-template-columns: 1fr !important;
    }
}

/* Reportes ya organiza sus controles con la grilla de Bootstrap. */
.attendance-report-filters {
    display: block !important;
}

.attendance-report-filters > .row {
    width: auto;
}

.attendance-report-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1.25fr);
    gap: 16px;
    align-items: end;
}

.attendance-report-grid > div,
.attendance-report-grid .form-control,
.attendance-report-grid .form-select {
    min-width: 0;
    width: 100%;
}

.attendance-report-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    align-items: center;
}

.attendance-report-actions .btn {
    width: auto;
}

@media (max-width: 1199px) {
    .attendance-report-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .attendance-report-grid {
        grid-template-columns: 1fr;
    }

    .attendance-report-actions {
        grid-column: auto;
        flex-wrap: wrap;
    }
}

/* Reporte diario de asistencias */
.attendance-summary-panel {
    margin-bottom: 0 !important;
}

.attendance-summary-panel h2 {
    margin-bottom: 0 !important;
}

.attendance-summary-count {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #475569;
    background: #f8fafc;
    font-size: .8rem;
    font-weight: 700;
}

.attendance-summary-table th,
.attendance-summary-table td {
    vertical-align: middle;
}

.attendance-summary-table th {
    white-space: nowrap;
}

.attendance-summary-table td {
    padding-top: .8rem !important;
    padding-bottom: .8rem !important;
}

.attendance-time-cell {
    white-space: nowrap;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.attendance-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1e293b;
    font-size: .84rem;
    font-weight: 700;
    white-space: nowrap;
}

.attendance-state-dot {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border: 1px solid rgba(15, 23, 42, .25);
    border-radius: 50%;
    background: #94a3b8;
}

.attendance-report-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 3px 9px 3px 4px;
    border: 1px solid transparent;
    border-radius: 5px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}

.attendance-report-state strong {
    min-width: 28px;
    padding: 3px 5px;
    border-radius: 4px;
    color: #fff !important;
    text-align: center;
}

.dashboard-table tbody td .attendance-report-state > strong {
    color: #fff !important;
}

.report-state-attended { background: #dcfce7; border-color: #86efac; color: #166534; }
.report-state-attended strong { background: #15803d; }
.report-state-absent { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.report-state-absent strong { background: #dc2626; }
.report-state-late { background: #fef9c3; border-color: #fde047; color: #854d0e; }
.report-state-late strong { background: #ca8a04; }
.report-state-early-exit { background: #ffedd5; border-color: #fdba74; color: #c2410c; }
.report-state-early-exit strong { background: #ea580c; }
.report-state-critical { background: #fce7f3; border-color: #f9a8d4; color: #be185d; }
.report-state-critical strong { background: #e11d48; }
.report-state-vacation { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.report-state-vacation strong { background: #2563eb; }
.report-state-permission { background: #ede9fe; border-color: #c4b5fd; color: #6d28d9; }
.report-state-permission strong { background: #7c3aed; }
.report-state-rest { background: #e2e8f0; border-color: #64748b; color: #1e293b; }
.report-state-rest strong { background: #334155; }
.report-state-holiday { background: #cffafe; border-color: #67e8f9; color: #0e7490; }
.report-state-holiday strong { background: #0891b2; }
.report-state-non-working { background: #f5f5f4; border-color: #a8a29e; color: #44403c; }
.report-state-non-working strong { background: #78716c; }
.report-state-incomplete { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.report-state-incomplete strong { background: #d97706; }
.report-state-unscheduled { background: #f8fafc; border-color: #cbd5e1; color: #475569; }
.report-state-unscheduled strong { background: #475569; }
.report-state-pending { background: #f1f5f9; border-color: #cbd5e1; color: #475569; }
.report-state-pending strong { background: #64748b; }

.journey-state {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 10px;
    border: 1px solid transparent;
    border-radius: 5px;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}

.journey-state-pending { background: #f1f5f9; border-color: #cbd5e1; color: #475569; }
.journey-state-active { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.journey-state-completed { background: #dcfce7; border-color: #86efac; color: #166534; }
.journey-state-exit-pending { background: #ffedd5; border-color: #fdba74; color: #c2410c; }
.journey-state-exit-incomplete { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.journey-state-na { padding-inline: 4px; border-color: transparent; background: transparent; color: #94a3b8; }

.state-attended .attendance-state-dot { background: #22c55e; }
.state-late .attendance-state-dot { background: #f97316; }
.state-absent .attendance-state-dot { background: #ef4444; }
.state-vacation .attendance-state-dot { background: #0ea5e9; }
.state-permission .attendance-state-dot { background: #eab308; }
.state-rest .attendance-state-dot { background: #6b7280; }
.state-holiday .attendance-state-dot { background: #64748b; }
.state-non-working .attendance-state-dot { background: #cbd5e1; }
.state-incomplete .attendance-state-dot { background: #eab308; }
.state-pending .attendance-state-dot { background: #cbd5e1; }

.attendance-incidence {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    color: #334155;
    font-size: .84rem;
    font-weight: 600;
    line-height: 1.35;
}

.attendance-incidence-dot {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    margin-top: 2px;
    border: 1px solid rgba(15, 23, 42, .3);
    border-radius: 50%;
    background: #f97316;
}

@media (max-width: 767px) {
    .attendance-summary-panel {
        padding: 16px !important;
    }

    .attendance-summary-table {
        min-width: 900px;
    }
}

/* Sidebar de escritorio: menu desplazable sin superponerse al pie. */
@media (min-width: 992px) {
    .sidebar,
    body.sidebar-collapsed .sidebar {
        display: flex;
        flex-direction: column;
        height: 100vh;
        min-height: 0;
        overflow: hidden;
    }

    .sidebar-brand,
    .sidebar .nav-caption,
    .sidebar-footer {
        flex: 0 0 auto;
    }

    .sidebar-menu,
    body.sidebar-collapsed .sidebar-menu {
        display: block !important;
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        padding-bottom: 24px !important;
    }

    .sidebar-footer,
    body.sidebar-collapsed .sidebar-footer {
        position: static;
        margin-top: 0;
        padding: 12px 14px;
        background: #071426;
        line-height: 1.35;
    }

    .sidebar-menu::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar-menu::-webkit-scrollbar-thumb {
        border-radius: 6px;
        background: rgba(148, 163, 184, .38);
    }
}

.attendance-report-filters .form-label {
    display: block;
    white-space: nowrap;
}

.assignment-workers-box {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
}

.assignment-groups-panel{padding:18px}.assignment-groups-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}.assignment-groups-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.assignment-group-search{width:min(390px,100%)}.assignment-groups{display:grid;gap:14px}.assignment-group{--group-color:#2563eb;--group-soft:#eff6ff;--group-border:#bfdbfe;border:1px solid var(--group-border);border-radius:14px;overflow:hidden;background:#fff;box-shadow:0 3px 12px rgba(15,23,42,.045)}.assignment-group-color-1{--group-color:#2563eb;--group-soft:#eff6ff;--group-border:#bfdbfe}.assignment-group-color-2{--group-color:#059669;--group-soft:#ecfdf5;--group-border:#a7f3d0}.assignment-group-color-3{--group-color:#d97706;--group-soft:#fffbeb;--group-border:#fde68a}.assignment-group-color-4{--group-color:#7c3aed;--group-soft:#f5f3ff;--group-border:#ddd6fe}.assignment-group-color-5{--group-color:#0891b2;--group-soft:#ecfeff;--group-border:#a5f3fc}.assignment-group-color-6{--group-color:#e11d48;--group-soft:#fff1f2;--group-border:#fecdd3}.assignment-group-header{width:100%;border:0;border-left:5px solid var(--group-color);background:linear-gradient(90deg,var(--group-soft),#fff);display:grid;grid-template-columns:44px minmax(150px,1fr) 1px 44px minmax(170px,1fr) auto 20px;align-items:center;gap:14px;padding:15px 18px;text-align:left;color:#172033}.assignment-group-header:hover{filter:brightness(.99)}.assignment-group-symbol{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:var(--group-color);color:#fff;font-size:18px;box-shadow:0 6px 14px color-mix(in srgb,var(--group-color) 25%,transparent)}.assignment-group-symbol-location{background:#fff;color:var(--group-color);border:1px solid var(--group-border);box-shadow:none}.assignment-group-heading{display:flex;flex-direction:column;min-width:0}.assignment-group-heading strong{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#0f172a}.assignment-group-label{font-size:10px;text-transform:uppercase;letter-spacing:.055em;font-weight:700;color:var(--group-color);margin-bottom:2px}.assignment-group-divider{height:34px;background:var(--group-border)}.assignment-group-count{background:#fff;border:1px solid var(--group-border);border-radius:999px;padding:6px 11px;color:#475569;font-size:12px;white-space:nowrap}.assignment-group-count b{color:var(--group-color);font-size:14px}.assignment-group-chevron{color:var(--group-color);transition:transform .2s ease}.assignment-group-header:not(.collapsed) .assignment-group-chevron{transform:rotate(180deg)}.assignment-group-table thead th{background:#f8fafc;color:#475569;font-size:11px;text-transform:uppercase;letter-spacing:.035em;border-bottom:1px solid #dbe3ef;padding:11px 14px}.assignment-group-table td{padding:12px 14px;border-color:#e8edf4}.assignment-group-table tbody tr:last-child td{border-bottom:0}.assignment-member-row td:first-child{border-left:3px solid transparent}.assignment-member-row:hover td:first-child{border-left-color:var(--group-color)}
@media(max-width:900px){.assignment-groups-toolbar{align-items:stretch;flex-direction:column}.assignment-groups-actions{justify-content:flex-start}.assignment-group-search{width:100%}.assignment-group-header{grid-template-columns:40px minmax(0,1fr) auto 18px;gap:8px 10px}.assignment-group-divider{display:none}.assignment-group-symbol-schedule{grid-column:1;grid-row:1}.assignment-group-heading-schedule{grid-column:2;grid-row:1}.assignment-group-symbol-location{grid-column:1;grid-row:2}.assignment-group-heading-location{grid-column:2;grid-row:2}.assignment-group-count{grid-column:3;grid-row:1 / span 2}.assignment-group-chevron{grid-column:4;grid-row:1 / span 2}.assignment-group-table{min-width:850px}}

/* Ambos identificadores del grupo conservan la misma jerarquía visual. */
.assignment-group-symbol-location{
    background:var(--group-color);
    color:#fff;
    border:0;
    box-shadow:0 6px 14px color-mix(in srgb,var(--group-color) 25%,transparent);
}

.assignment-calendar-dialog{max-width:min(1180px,calc(100vw - 2rem))}.assignment-calendar-header{color:#fff;background:linear-gradient(135deg,#2563eb,#1d4ed8)}.assignment-calendar-header small{color:#dbeafe}.assignment-calendar-guide{display:flex;align-items:center;gap:.65rem;padding:.7rem .85rem;margin-bottom:1rem;color:#1e40af;background:#eff6ff;border:1px solid #bfdbfe;border-radius:.65rem;font-size:.88rem}#assignmentCalendar{min-height:560px}@media(max-width:767.98px){.assignment-calendar-dialog{max-width:calc(100vw - 1rem);margin:.5rem auto}#assignmentCalendar{min-height:480px}}

.assignment-group-bulkbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.7rem .9rem;background:#fff;border-bottom:1px solid #e2e8f0}.assignment-group-bulkbar>div{display:flex;flex-direction:column}.assignment-group-bulkbar strong{font-size:.82rem;color:#334155}.assignment-group-bulkbar small{font-size:.75rem;color:#64748b}@media(max-width:680px){.assignment-group-bulkbar{align-items:stretch;flex-direction:column}.assignment-group-bulkbar .btn{width:100%}}

.assignment-safety-card {
    align-items: flex-start;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    display: flex;
    gap: 12px;
    padding: 13px;
}

.assignment-safety-icon {
    align-items: center;
    background: #2563eb;
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 34px;
    height: 34px;
    justify-content: center;
}

.assignment-availability-card { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid #bbf7d0; border-radius: 10px; background: #f0fdf4; }
.assignment-availability-card > div { flex: 1 1 auto; min-width: 0; }
.assignment-availability-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: #16a34a; color: #fff; }
.assignment-availability-card strong,
.assignment-availability-card small { display: block; }
.assignment-availability-card strong { color: #166534; font-size: .86rem; }
.assignment-availability-card small { margin-top: 2px; color: #475569; font-size: .75rem; }
.assignment-availability-card.has-conflicts { border-color: #fde68a; background: #fffbeb; }
.assignment-availability-card.has-conflicts .assignment-availability-icon { background: #d97706; }
.assignment-availability-card.has-conflicts strong { color: #92400e; }
.assignment-availability-card.none-available { border-color: #fecaca; background: #fff7f7; }
.assignment-availability-card.none-available .assignment-availability-icon { background: #dc2626; }
.assignment-availability-card.none-available strong { color: #991b1b; }
.assignment-availability-view { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; border: 1px solid #f59e0b; background: #fff; color: #92400e; font-size: .72rem; font-weight: 750; }
.assignment-availability-view:hover { border-color: #d97706; background: #fff7ed; color: #78350f; }
.assignment-available-workers-list { display: grid; gap: 8px; max-height: 45vh; overflow-y: auto; padding: 2px; text-align: left; }
.assignment-available-worker { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid #dbe3ee; border-radius: 9px; background: #f8fafc; }
.assignment-available-worker > span { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: #dcfce7; color: #15803d; }
.assignment-available-worker strong,
.assignment-available-worker small { display: block; }
.assignment-available-worker strong { color: #0f172a; font-size: .86rem; }
.assignment-available-worker small { margin-top: 2px; color: #64748b; font-size: .73rem; }

@media (max-width: 620px) {
    .assignment-availability-card { align-items: flex-start; flex-wrap: wrap; }
    .assignment-availability-view { width: 100%; justify-content: center; }
}

.assignment-conflict-heading { display: block; margin: 1px 0 8px; color: #1e293b; font-size: .82rem; font-weight: 800; }
.assignment-conflict-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.assignment-conflict-choice { display: flex; align-items: center; gap: 9px; margin: 0; padding: 10px 11px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.assignment-conflict-choice:hover { border-color: #93c5fd; background: #f8fbff; }
.assignment-conflict-choice:has(input:checked) { border-color: #22c55e; background: #f0fdf4; box-shadow: 0 0 0 2px rgba(34,197,94,.1); }
.assignment-conflict-choice.is-replace:has(input:checked) { border-color: #f59e0b; background: #fffbeb; box-shadow: 0 0 0 2px rgba(245,158,11,.1); }
.assignment-conflict-choice input { flex: 0 0 auto; margin: 0; accent-color: #16a34a; }
.assignment-conflict-choice.is-replace input { accent-color: #d97706; }
.assignment-conflict-choice span,
.assignment-conflict-choice strong,
.assignment-conflict-choice small { display: block; }
.assignment-conflict-choice strong { color: #0f172a; font-size: .8rem; }
.assignment-conflict-choice small { margin-top: 2px; color: #64748b; font-size: .7rem; line-height: 1.3; }

@media (max-width: 620px) {
    .assignment-conflict-choices { grid-template-columns: 1fr; }
}

.assignment-conflict-summary { max-height: 55vh; overflow-y: auto; padding: 0 4px; text-align: left; }
.assignment-conflict-summary > p { margin-bottom: 12px; color: #475569; text-align: center; }
.assignment-conflict-comparison { overflow: hidden; margin-bottom: 12px; border: 1px solid #dbe3ee; border-radius: 12px; background: #fff; }
.assignment-conflict-comparison > header { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; color: #0f172a; }
.assignment-conflict-comparison > header > i { color: #2563eb; font-size: 1.1rem; }
.assignment-conflict-comparison header strong,
.assignment-conflict-comparison header small,
.assignment-conflict-columns section > * { display: block; }
.assignment-conflict-comparison header small { margin-top: 1px; color: #64748b; font-size: .72rem; }
.assignment-conflict-columns { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); align-items: center; gap: 8px; padding: 13px; }
.assignment-conflict-columns section { min-height: 126px; padding: 11px 12px; border: 1px solid #fecaca; border-radius: 9px; background: #fff7f7; }
.assignment-conflict-columns section.is-requested { border-color: #bfdbfe; background: #eff6ff; }
.assignment-conflict-label { margin-bottom: 7px; color: #b91c1c; font-size: .69rem; font-weight: 800; letter-spacing: .025em; text-transform: uppercase; }
.is-requested .assignment-conflict-label { color: #1d4ed8; }
.assignment-conflict-columns section b { margin-bottom: 6px; color: #0f172a; font-size: .9rem; }
.assignment-conflict-columns section small { margin-top: 4px; color: #475569; font-size: .73rem; }
.assignment-conflict-columns section small i { width: 17px; color: #64748b; }
.assignment-conflict-versus { color: #94a3b8; text-align: center; }
.assignment-conflict-comparison > p { margin: 0; padding: 9px 13px; border-top: 1px solid #fde68a; background: #fffbeb; color: #92400e; font-size: .75rem; }
.assignment-conflict-comparison > p i { margin-right: 6px; }

@media (max-width: 620px) {
    .assignment-conflict-columns { grid-template-columns: 1fr; }
    .assignment-conflict-versus { transform: rotate(90deg); }
}

.assignment-history-list {
    display: grid;
    gap: 12px;
}

.assignment-history-item {
    background: #fff;
    border: 1px solid #dbe3ee;
    border-left: 4px solid #64748b;
    border-radius: 10px;
    padding: 13px 14px;
}

.assignment-history-item.is-active {
    background: #f0fdf4;
    border-color: #bbf7d0;
    border-left-color: #16a34a;
}

.assignment-history-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.assignment-history-head strong,
.assignment-history-head span {
    display: block;
}

.assignment-history-head strong {
    color: #0f172a;
    font-size: 0.92rem;
}

.assignment-history-head div > span {
    color: #475569;
    font-size: 0.78rem;
    margin-top: 3px;
}

.assignment-history-status {
    background: #e2e8f0;
    border-radius: 999px;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 5px 9px;
}

.assignment-history-item.is-active .assignment-history-status {
    background: #dcfce7;
    color: #166534;
}

.assignment-history-meta {
    color: #475569;
    display: grid;
    font-size: 0.77rem;
    gap: 7px 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 12px;
}

@media (max-width: 575.98px) {
    .assignment-history-meta {
        grid-template-columns: 1fr;
    }
}

.assignment-workers-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.assignment-workers-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.assignment-worker-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #dbe3ee;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
}

.assignment-worker-option:hover {
    border-color: #93b4ef;
    background: #f3f7ff;
}

.assignment-worker-option span {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 767px) {
    .assignment-workers-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .assignment-workers-grid {
        grid-template-columns: 1fr;
    }
}

/* Ajuste definitivo: mostrar imagen completa dentro del cuadrado sin deformar */
#requirementsWorkspace .worker-card img,
#machineDocumentsWorkspace .worker-card img,
#companyDocumentsWorkspace .worker-card img {
    width: 190px !important;
    height: 190px !important;
    max-width: 100% !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: #eef2f7 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
}

@media (min-width: 992px) {
    #requirementsWorkspace .worker-card img,
    #machineDocumentsWorkspace .worker-card img,
    #companyDocumentsWorkspace .worker-card img {
        width: 188px !important;
        height: 188px !important;
    }
}

@media (max-width: 575px) {
    #requirementsWorkspace .worker-card img,
    #machineDocumentsWorkspace .worker-card img,
    #companyDocumentsWorkspace .worker-card img {
        width: min(220px, 100%) !important;
        height: 220px !important;
    }
}

/* Reporte individual de asistencia */
.attendance-report-title{align-items:center}.attendance-report-filters-simple{margin-bottom:20px}.attendance-report-empty{text-align:center;padding:64px 24px}.attendance-report-empty-icon{width:72px;height:72px;border-radius:22px;margin:0 auto 18px;display:grid;place-items:center;background:#eaf2ff;color:#2468e8;font-size:30px}.attendance-report-empty h2{font-size:22px}.attendance-report-empty p{max-width:560px;margin:8px auto 0;color:#66758c}.individual-report-preview{padding:24px}.individual-report-heading{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;padding-bottom:18px;border-bottom:1px solid #d9e2ee}.individual-report-heading h2{margin:4px 0;font-size:26px}.individual-report-heading p{margin:0;color:#67758a}.report-eyebrow{font-size:12px;font-weight:800;color:#2468e8;letter-spacing:.08em}.report-record-count{padding:8px 12px;border:1px solid #d3ddea;border-radius:8px;background:#f7f9fc;color:#40506a;font-weight:700}.individual-report-profile{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:18px 0}.individual-report-profile>div,.individual-report-metrics>div,.individual-report-indicators>div{border:1px solid #d9e2ee;border-radius:10px;padding:12px;background:#f9fbfd}.individual-report-profile span,.individual-report-metrics span,.individual-report-indicators span{display:block;margin-bottom:5px;color:#6b788d;font-size:11px;font-weight:800;text-transform:uppercase}.individual-report-profile strong{font-size:13px}.individual-report-metrics{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}.individual-report-metrics strong{font-size:22px}.individual-report-metrics .metric-success{background:#edfbf4;border-color:#b5ecd0}.individual-report-metrics .metric-warning{background:#fff9e9;border-color:#f5db86}.individual-report-metrics .metric-danger{background:#fff1f2;border-color:#ffc8ce}.individual-report-indicators{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:10px}.individual-report-indicators>div{background:#f2f6fc}.individual-report-indicators strong{font-size:17px;color:#174fae}.individual-report-section-title{margin:24px 0 10px}.individual-report-section-title h3{font-size:18px;margin:0}.individual-report-section-title p{margin:3px 0 0;color:#6c788b}.individual-report-table{min-width:1080px;font-size:13px}.individual-report-table thead th{white-space:nowrap;background:#f1f5fa;color:#263750;border-bottom:2px solid #8da4c3;font-size:11px;text-transform:uppercase}.individual-report-table td{border-color:#dce4ee}.report-observation-cell{min-width:190px;color:#56657b}.individual-report-bottom{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(300px,1fr);gap:18px;margin-top:20px}.report-note-card,.report-signatures-preview{border:1px solid #d9e2ee;border-radius:12px;padding:16px;background:#f9fbfd}.report-note-card label{display:block;font-weight:800;margin-bottom:8px}.report-note-card textarea{width:100%;border:1px solid #cbd7e6;border-radius:8px;padding:10px;resize:vertical;background:white}.report-note-card>div{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:10px}.report-note-card small{color:#6a778b}.report-signatures-preview{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:end}.report-signatures-preview>div{padding-top:32px;border-bottom:1px solid #53627a;padding-bottom:6px;text-align:center}.report-signatures-preview span,.report-signatures-preview small{display:block;color:#718096;font-size:11px}.report-signatures-preview strong{display:block;font-size:13px}
.individual-report-metrics .metric-vacation{background:#eef5ff;border-color:#91b9ff;color:#174fae}
.individual-report-metrics .metric-vacation strong{color:#111827}
.report-note-card-full{grid-column:1/-1}
.marking-report-table-wrap{max-height:68vh;overflow:auto}.marking-report-table{min-width:1040px}.marking-report-table thead th{position:sticky;top:0;z-index:2;background:#f3f6fa;box-shadow:inset 0 -2px 0 #91a6c3}.marking-photo-button{width:36px;height:36px;display:inline-grid;place-items:center}.marking-report-panel .attendance-summary-count{white-space:nowrap}
@media(max-width:767px){.marking-report-title{align-items:flex-start}.marking-report-title>div:last-child{width:100%}.marking-report-title .btn{flex:1}}

/* Gestión semanal de horarios */
.schedule-selector-panel{padding:18px 20px}.schedule-management-toolbar{display:flex;align-items:flex-end;justify-content:space-between;gap:18px}.schedule-picker{width:min(100%,460px)}.schedule-picker form{margin:0}.schedule-selected-actions{display:flex;flex-wrap:wrap;gap:8px}.schedule-overview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:4px 0 20px}.schedule-overview>div{border:1px solid #d8e2ee;border-radius:10px;padding:13px 15px;background:#f7f9fc}.schedule-overview span{display:block;color:#6b788c;font-size:11px;font-weight:800;text-transform:uppercase;margin-bottom:4px}.schedule-overview strong{font-size:20px;color:#12223d}.weekly-schedule-grid{grid-template-columns:repeat(4,minmax(210px,1fr));gap:14px;overflow:visible}.weekly-day{min-height:245px;border-radius:12px;padding:14px;background:#fff;transition:border-color .2s,box-shadow .2s}.weekly-day:hover{border-color:#a9bdd8;box-shadow:0 8px 20px rgba(15,35,65,.07)}.weekly-day-configured{border-top:4px solid #2468e8}.weekly-day-empty{background:#f8fafc}.weekly-day-head{margin-bottom:12px}.weekly-day-head strong{font-size:16px}.weekly-day-head .btn{width:38px;height:38px;display:inline-grid;place-items:center}.schedule-time-block{border-radius:9px;padding:10px 11px;margin-bottom:10px}.schedule-time-block span{display:block;font-size:11px;font-weight:800;text-transform:uppercase;margin-bottom:2px}.schedule-time-block strong{display:block;font-size:18px;margin-bottom:3px}.schedule-time-block small{display:block;font-size:12px}.schedule-time-entry{background:#eafaf1;color:#11633a}.schedule-time-exit{background:#eaf2ff;color:#174fae}.schedule-tolerance{font-size:12px;color:#56657b;padding:2px}.empty-day{height:165px;display:flex;flex-direction:column;text-align:center;gap:7px;padding:18px}.empty-day i{font-size:28px;color:#94a3b8}.empty-day span{font-weight:800;color:#526176}.empty-day small{max-width:190px}.schedule-empty-state{text-align:center;padding:55px 20px;color:#68768a}.schedule-empty-state i{font-size:40px;color:#2468e8;margin-bottom:14px}
@media(max-width:1199px){.weekly-schedule-grid{grid-template-columns:repeat(3,minmax(210px,1fr))}}
@media(max-width:991px){.weekly-schedule-grid{grid-template-columns:repeat(2,minmax(210px,1fr))}}
@media(max-width:767px){.schedule-management-toolbar{align-items:stretch;flex-direction:column}.schedule-picker{width:100%}.schedule-selected-actions .btn{flex:1}.schedule-overview{grid-template-columns:1fr}.weekly-schedule-grid{grid-template-columns:1fr}.weekly-day{min-height:auto}}

/* Paleta visual de horarios */
.schedule-selector-panel{background:linear-gradient(115deg,#f7faff 0%,#eef5ff 100%);border-color:#bfd3f3;box-shadow:0 9px 24px rgba(36,104,232,.08)}.schedule-picker .form-label{color:#174fae}.schedule-picker .form-select{border-color:#a9c4ef;background-color:#fff;box-shadow:0 3px 9px rgba(36,104,232,.06)}.schedule-selected-actions .btn-outline-primary{background:#fff}.schedule-overview>div{position:relative;overflow:hidden;padding-left:60px;min-height:76px}.schedule-overview>div>i{position:absolute;left:15px;top:50%;transform:translateY(-50%);width:34px;height:34px;border-radius:10px;display:grid;place-items:center;font-size:16px}.schedule-overview-configured{background:#edfbf4!important;border-color:#9fe0bd!important}.schedule-overview-configured>i{background:#c9f2dc;color:#0b8a4a}.schedule-overview-configured strong{color:#08783e!important}.schedule-overview-pending{background:#fff9e8!important;border-color:#f1d57b!important}.schedule-overview-pending>i{background:#ffedb3;color:#b27300}.schedule-overview-pending strong{color:#8a5900!important}.schedule-overview-hours{background:#eef5ff!important;border-color:#9fc1f7!important}.schedule-overview-hours>i{background:#d6e7ff;color:#1b5fd1}.schedule-overview-hours strong{color:#174fae!important}.schedule-color-legend{display:flex;flex-wrap:wrap;gap:8px;margin:-4px 0 16px}.schedule-color-legend span{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:700;border:1px solid}.schedule-legend-entry{background:#eafaf1;border-color:#a6e4c2!important;color:#11633a}.schedule-legend-exit{background:#eaf2ff;border-color:#a9c8f8!important;color:#174fae}.schedule-legend-empty{background:#f1f5f9;border-color:#cbd5e1!important;color:#526176}.weekly-day-configured{border-color:#bdd1ee;border-top-color:#2468e8;background:linear-gradient(180deg,#f5f9ff 0,#fff 62px)}.weekly-day-configured .weekly-day-head strong{color:#173b75}.weekly-day-configured .weekly-day-head .btn{background:#eaf2ff;border-color:#a9c8f8;color:#1b5fd1}.weekly-day-configured .weekly-day-head .btn:hover{background:#2468e8;color:#fff}.weekly-day-empty{border-color:#e0c77b;border-top:4px solid #dfa310;background:linear-gradient(180deg,#fff9e8 0,#fffdf7 62px)}.weekly-day-empty .weekly-day-head strong{color:#805600}.weekly-day-empty .weekly-day-head .btn{background:#fff3c9;border-color:#edca60;color:#9b6800}.weekly-day-empty .empty-day{border-color:#e7cf88;background:rgba(255,249,232,.65)}.schedule-time-entry{border-left:4px solid #18a65e;background:linear-gradient(105deg,#e4f9ed,#effcf5)}.schedule-time-exit{border-left:4px solid #2468e8;background:linear-gradient(105deg,#e5efff,#f1f6ff)}.schedule-tolerance{border-radius:7px;background:#f6f8fb;padding:7px 9px;border:1px solid #e2e8f0}.schedule-tolerance i{color:#8b5d00}
/* Estado sin asignación en control de asistencia */
.attendance-availability-notice{display:flex;align-items:flex-start;gap:10px;margin:0 0 14px;padding:11px 12px;border:1px solid #f0c55d;border-radius:10px;background:#fff8df;color:#704b00}
.attendance-availability-notice>i{width:30px;height:30px;display:grid;place-items:center;flex:0 0 30px;border-radius:9px;background:#e3a300;color:#fff}.attendance-availability-notice strong,.attendance-availability-notice span{display:block}.attendance-availability-notice strong{font-size:13px}.attendance-availability-notice span{margin-top:2px;font-size:12px;color:#755d2b}
.attendance-no-assignment{display:flex;align-items:flex-start;gap:12px;margin:4px 0 18px;padding:15px;border:1px solid #f0c55d;border-radius:12px;background:linear-gradient(120deg,#fff8df,#fffdf5);color:#704b00}
.attendance-no-assignment-icon{width:42px;height:42px;display:grid;place-items:center;flex:0 0 42px;border-radius:12px;background:#f4b400;color:#fff;font-size:18px}
.attendance-no-assignment strong{display:block;margin-bottom:4px;font-size:15px}.attendance-no-assignment p{margin:0;color:#755d2b;font-size:13px;line-height:1.45}
.camera-box,.attendance-map-wrap{position:relative}.attendance-capture-panel{min-height:440px}.attendance-map-wrap{height:360px;min-height:360px}.attendance-map-wrap .attendance-map{height:360px;min-height:360px}
.attendance-media-empty{position:absolute;inset:0;z-index:500;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px;padding:24px;text-align:center;border:1px dashed #b9c7d8;border-radius:8px;background:#f4f7fb;color:#63728a}
.attendance-media-empty>i{width:48px;height:48px;display:grid;place-items:center;border-radius:14px;background:#e4ebf5;color:#718096;font-size:20px}.attendance-media-empty strong{color:#34445c}.attendance-media-empty span{max-width:260px;font-size:13px}
.attendance-marking-panel .btn:disabled{cursor:not-allowed;filter:saturate(.55);opacity:.58}.attendance-marking-panel textarea:disabled{background:#f1f4f8;cursor:not-allowed}

/* Modal de reglas del horario */
.schedule-day-modal-content{overflow:hidden;border:0;box-shadow:0 24px 70px rgba(15,35,65,.28)}
.schedule-day-modal-header{color:#fff;border:0;background:linear-gradient(120deg,#174fae,#2d74ef)}
.schedule-day-modal-header .modal-title{font-weight:800}.schedule-day-modal-header .btn-close{filter:brightness(0) invert(1);opacity:.9}
.schedule-rule-modal-body{padding:20px;background:#f4f7fb}
.schedule-rule-intro{display:flex;align-items:center;gap:12px;margin-bottom:16px;padding:12px 14px;border:1px solid #b8d1f7;border-radius:10px;background:#eaf2ff;color:#174fae}
.schedule-rule-intro>i{width:36px;height:36px;display:grid;place-items:center;flex:0 0 36px;border-radius:10px;background:#2468e8;color:#fff}
.schedule-rule-intro strong,.schedule-rule-intro span{display:block}.schedule-rule-intro span{margin-top:2px;font-size:13px;color:#496991}
.schedule-rule-section{position:relative;margin-top:14px;padding:17px;border:1px solid #d7e1ed;border-radius:12px;background:#fff;box-shadow:0 5px 14px rgba(15,35,65,.05)}
.schedule-rule-entry{border-left:5px solid #18a65e}.schedule-rule-exit{border-left:5px solid #2468e8}
.schedule-rule-section-title{display:flex;align-items:center;gap:11px;margin-bottom:14px}.schedule-rule-section-title>i{width:38px;height:38px;display:grid;place-items:center;flex:0 0 38px;border-radius:10px;color:#fff}
.schedule-rule-entry .schedule-rule-section-title>i{background:#18a65e}.schedule-rule-exit .schedule-rule-section-title>i{background:#2468e8}
.schedule-rule-section-title h6{margin:0 0 2px;font-size:16px;font-weight:800}.schedule-rule-section-title p{margin:0;color:#6b788c;font-size:13px}
.schedule-rule-section .form-label{font-weight:700;color:#263750}.schedule-rule-section .form-control,.schedule-rule-section .input-group-text{min-height:42px}
.schedule-rule-preview{display:flex;align-items:center;gap:8px;margin-top:14px;padding:10px 12px;border-radius:8px;font-size:13px;font-weight:600}
.schedule-rule-preview-entry{border:1px solid #a6e4c2;background:#eafaf1;color:#11633a}.schedule-rule-preview-exit{border:1px solid #a9c8f8;background:#eaf2ff;color:#174fae}
.schedule-day-modal-content .modal-footer{border-top:1px solid #dce5ef;background:#fff}
@media(max-width:575px){.schedule-rule-modal-body{padding:14px}.schedule-rule-section{padding:14px}.schedule-day-modal-content .modal-footer{align-items:stretch;gap:10px}.schedule-day-modal-content .modal-footer>div{display:flex}.schedule-day-modal-content .modal-footer .btn{flex:1}}

/* Vistas de Plantillas de horarios y calendario de jornadas */
.schedule-view-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0 0 18px}
.schedule-view-tab{display:flex;align-items:center;gap:12px;min-height:70px;padding:12px 16px;border:1px solid #ccd8e8;border-radius:12px;background:#fff;color:#42536b;text-align:left;transition:.2s ease}
.schedule-view-tab>i{width:40px;height:40px;display:grid;place-items:center;flex:0 0 40px;border-radius:11px;background:#edf3fc;color:#2468e8;font-size:18px}
.schedule-view-tab span,.schedule-view-tab small{display:block}.schedule-view-tab strong{color:#172942}.schedule-view-tab small{margin-top:2px;color:#718096}
.schedule-view-tab:hover{border-color:#8eb4ef;box-shadow:0 6px 18px rgba(36,104,232,.08)}
.schedule-view-tab.active{border-color:#2468e8;background:linear-gradient(120deg,#edf4ff,#f8fbff);box-shadow:0 7px 20px rgba(36,104,232,.12)}
.schedule-view-tab.active>i{background:#2468e8;color:#fff}.schedule-view-tab.active strong{color:#174fae}
.journeys-calendar-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:14px}
.journeys-calendar-filter{width:min(100%,390px)}
.journeys-calendar-filters{display:grid;grid-template-columns:repeat(2,minmax(220px,310px));gap:12px;width:min(100%,650px)}
.programming-view-title{margin-top:0}.programming-view-title h2{margin:0;font-size:22px}.programming-view-title p{margin:4px 0 0}
.journeys-calendar-legend{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px;padding:12px;border:1px solid #d8e2ee;border-radius:10px;background:#f7f9fc}
.journeys-calendar-legend span{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;color:#fff;font-size:12px;font-weight:800}
.legend-regular{background:#16a34a}.legend-extraordinary{background:#f97316}.legend-special{background:#0891b2}
.journeys-calendar-guide{display:flex;align-items:flex-start;gap:9px;margin:-7px 0 16px;padding:10px 12px;border:1px solid #bfd3f3;border-radius:9px;background:#eef5ff;color:#365e96;font-size:13px}.journeys-calendar-guide i{margin-top:2px;color:#2468e8}
#scheduleJourneysCalendar{min-height:590px}.fc .fc-toolbar-title{font-size:20px;text-transform:capitalize}.fc .fc-button{font-weight:700}.fc .fc-daygrid-event{padding:3px 5px;border-radius:5px;cursor:pointer}.fc .fc-day-today{background:#eef5ff!important}
.empty-calendar-state{min-height:420px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:#68768a}
.empty-calendar-state i{font-size:42px;color:#7ba4df}.empty-calendar-state strong{color:#243750;font-size:18px}.empty-calendar-state span{max-width:480px}
.journey-detail-status{display:inline-flex;margin-bottom:15px;padding:6px 10px;border-radius:999px;color:#fff;font-size:12px;font-weight:800}.journey-detail-status.is-regular{background:#16a34a}.journey-detail-status.is-program{background:#f97316}.journey-detail-status.is-special{background:#0891b2}
.journey-detail-list{display:grid;grid-template-columns:145px minmax(0,1fr);margin:0 0 16px}.journey-detail-list dt,.journey-detail-list dd{margin:0;padding:9px 0;border-bottom:1px solid #e2e8f0}.journey-detail-list dt{color:#66758c}.journey-detail-list dd{font-weight:700;color:#1f2f46}
@media(max-width:767px){.schedule-view-tabs{grid-template-columns:1fr}.journeys-calendar-head{align-items:stretch;flex-direction:column}.journeys-calendar-filter,.journeys-calendar-filters{width:100%}.journeys-calendar-filters{grid-template-columns:1fr}#scheduleJourneysCalendar{min-height:480px}.fc .fc-toolbar{align-items:stretch;flex-direction:column;gap:9px}.journey-detail-list{grid-template-columns:1fr}.journey-detail-list dt{padding-bottom:2px;border-bottom:0}.journey-detail-list dd{padding-top:2px}}

@media(max-width:1199px){.individual-report-profile{grid-template-columns:repeat(3,1fr)}.individual-report-metrics{grid-template-columns:repeat(3,1fr)}}
@media(max-width:767px){.attendance-report-title{align-items:flex-start}.individual-report-preview{padding:16px}.individual-report-heading{display:block}.report-record-count{display:inline-block;margin-top:10px}.individual-report-profile,.individual-report-metrics,.individual-report-indicators,.individual-report-bottom{grid-template-columns:1fr 1fr}.report-note-card{grid-column:1/-1}}
@media(max-width:520px){.individual-report-profile,.individual-report-metrics,.individual-report-indicators,.individual-report-bottom{grid-template-columns:1fr}}
