/* =====================================================
   MINIALFA
   ESTILOS GLOBALES DEL SISTEMA
===================================================== */


/* =====================================================
   VARIABLES
===================================================== */

:root {
    color-scheme: light;

    /* Fondos */
    --bg: #f2f5f7;
    --surface: #ffffff;
    --surface-soft: #f8fafb;

    /* Texto */
    --text: #17212b;
    --muted: #536273;

    /* Bordes */
    --border: #d6dee5;

    /* Marca */
    --brand: #123b52;
    --brand-dark: #0a283a;

    /* Acento */
    --accent: #087a83;
    --accent-dark: #056069;

    /* Estados */
    --success: #176b43;
    --success-soft: #e7f5ed;

    --warning: #9a4d00;
    --warning-soft: #fff2dd;

    --danger: #b42318;
    --danger-soft: #ffebe9;

    --purple: #6941a5;
    --purple-soft: #f1eafb;

    /* Sombras */
    --shadow:
        0 10px 30px
        rgba(23, 33, 43, 0.08);

    --shadow-hover:
        0 14px 34px
        rgba(23, 33, 43, 0.11);

    /* Bordes redondeados */
    --radius: 16px;

    /* Sidebar */
    --sidebar-width: 246px;

    /* Tipografía */
    font-family:
        Inter,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
}


/* =====================================================
   RESET
===================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}


html {
    min-width: 320px;

    background:
        var(--bg);
}


body {
    margin: 0;

    min-height: 100vh;

    background:
        var(--bg);

    color:
        var(--text);

    line-height: 1.5;

    -webkit-font-smoothing:
        antialiased;
}


body.modal-open {
    overflow: hidden;
}


button,
input,
select,
textarea {
    font: inherit;
}


button,
a {
    -webkit-tap-highlight-color:
        transparent;
}


button {
    cursor: pointer;
}


a {
    color: inherit;
}


img,
svg {
    display: block;
}


[hidden] {
    display: none !important;
}


/* =====================================================
   ACCESIBILIDAD
===================================================== */

:focus-visible {
    outline:
        3px solid
        #f59e0b;

    outline-offset: 2px;
}


/* =====================================================
   MODALES
===================================================== */

:is(
    .employee-modal,
    .create-schedule-modal,
    .edit-schedule-modal,
    .overtime-modal,
    .checks-import-modal,
    .checks-calendar-modal,
    .justify-modal,
    .checks-pdf-modal,
    .justification-pdf-modal,
    .vacation-modal,
    .personal-permission-modal,
    .disability-modal,
    .commission-modal,
    .vacation-pdf-modal,
    .personal-pdf-modal,
    .disability-pdf-modal,
    .commission-pdf-modal,
    .permission-detail-modal
) {
    align-items: center;

    justify-content: center;
}


:is(
    .employee-modal,
    .create-schedule-modal,
    .edit-schedule-modal,
    .overtime-modal,
    .checks-import-modal,
    .checks-calendar-modal,
    .justify-modal,
    .checks-pdf-modal,
    .justification-pdf-modal,
    .vacation-modal,
    .personal-permission-modal,
    .disability-modal,
    .commission-modal,
    .vacation-pdf-modal,
    .personal-pdf-modal,
    .disability-pdf-modal,
    .commission-pdf-modal,
    .permission-detail-modal
):is(
    .active,
    .open,
    .show,
    .visible,
    .is-open
) {
    display: grid;
}


/* =====================================================
   SVG
===================================================== */

.nav-item svg,
.topbar-button svg,
.profile-button svg,
.summary-icon svg,
.home-panel-icon svg,
.quick-access-icon svg,
.quick-access-arrow,
.pending-review-button svg,
.pending-absence-footer svg,
button svg,
a svg {
    flex: 0 0 auto;

    fill: none;

    stroke: currentColor;

    stroke-width: 1.8;

    stroke-linecap: round;

    stroke-linejoin: round;

    vector-effect: non-scaling-stroke;
}

/* =====================================================
   ESTRUCTURA PRINCIPAL
===================================================== */

.dashboard {
    min-height: 100vh;

    display: grid;

    grid-template-columns:
        var(--sidebar-width)
        minmax(0, 1fr);
}


/* =====================================================
   SIDEBAR
===================================================== */

.sidebar {
    width:
        var(--sidebar-width);

    height: 100vh;

    padding:
        24px 16px;

    position: sticky;

    top: 0;

    z-index: 20;

    display: flex;

    flex-direction: column;

    overflow-y: auto;

    background:
        var(--brand-dark);

    color: #ffffff;
}


/* =====================================================
   FECHA
===================================================== */

.date-card {
    min-height: 150px;

    margin:
        0 4px 26px;

    padding: 18px;

    display: grid;

    place-items: center;

    text-align: center;

    background:
        rgba(255, 255, 255, 0.09);

    border:
        1px solid
        rgba(255, 255, 255, 0.20);

    border-radius:
        var(--radius);
}


.date-day,
.date-month {
    color: #d5edf0;

    font-size: 0.76rem;

    font-weight: 800;

    letter-spacing: 0.14em;
}


.date-number {
    color: #ffffff;

    font-size: 3rem;

    font-weight: 700;

    line-height: 1;
}


/* =====================================================
   MENÚ
===================================================== */

.sidebar-menu {
    display: grid;

    gap: 7px;
}


.nav-item {
    min-height: 48px;

    padding:
        11px 13px;

    display: flex;

    align-items: center;

    gap: 12px;

    color: #deebf1;

    background:
        transparent;

    border:
        1px solid
        transparent;

    border-radius: 11px;

    text-decoration: none;

    font-size: 0.94rem;

    font-weight: 650;

    transition:
        background-color 0.16s ease,
        color 0.16s ease,
        border-color 0.16s ease,
        transform 0.16s ease;
}


.nav-item:hover {
    color: #ffffff;

    background:
        rgba(255, 255, 255, 0.10);

    transform:
        translateX(2px);
}


.nav-item.active {
    color:
        var(--brand-dark);

    background:
        #ffffff;

    border-color:
        rgba(255, 255, 255, 0.20);
}


/* =====================================================
   CONTENIDO PRINCIPAL
===================================================== */

.main-content {
    width: 100%;

    min-width: 0;

    max-width: 1600px;

    margin-inline: auto;

    padding:
        26px
        clamp(20px, 3vw, 46px)
        48px;
}


/* =====================================================
   TOPBAR
===================================================== */

.topbar {
    margin-bottom: 24px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;
}


/* =====================================================
   EYEBROW / TEXTO SUPERIOR
===================================================== */

.topbar-text span,
.employees-title span,
.schedules-title span,
.checks-title span,
.permissions-header-text span,
.history-header-text span {
    color:
        var(--accent-dark);

    font-size: 0.76rem;

    font-weight: 800;

    letter-spacing: 0.10em;

    text-transform: uppercase;
}


/* =====================================================
   TÍTULO PRINCIPAL
===================================================== */

.topbar h1,
.topbar-text h1 {
    margin:
        2px 0 0;

    color:
        var(--brand-dark);

    font-size:
        clamp(
            1.45rem,
            2.8vw,
            2.1rem
        );

    font-weight: 700;

    line-height: 1.16;
}


/* =====================================================
   ACCIONES TOPBAR
===================================================== */

.topbar-actions {
    display: flex;

    align-items: center;

    gap: 10px;
}


.topbar-button,
.profile-button {
    width: 44px;

    height: 44px;

    padding: 0;

    display: grid;

    place-items: center;

    background:
        var(--surface);

    color:
        var(--brand);

    border:
        1px solid
        var(--border);

    border-radius: 12px;

    box-shadow:
        0 3px 12px
        rgba(23, 33, 43, 0.05);

    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        transform 0.16s ease;
}


.profile-button {
    border-radius: 50%;
}


.topbar-button:hover,
.profile-button:hover {
    color:
        var(--accent-dark);

    background:
        #edf9fa;

    border-color:
        var(--accent);

    transform:
        translateY(-1px);
}


/* =====================================================
   RESUMEN
===================================================== */

.summary-grid {
    margin-bottom: 20px;

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;
}


.summary-card,
.home-panel {
    background:
        var(--surface);

    border:
        1px solid
        var(--border);

    border-radius:
        var(--radius);

    box-shadow:
        var(--shadow);
}


.summary-card {
    min-width: 0;

    padding: 20px;

    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease;
}


.summary-card:hover {
    transform:
        translateY(-2px);

    box-shadow:
        var(--shadow-hover);
}


.summary-card-top {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;
}


.summary-card-top > span {
    color:
        var(--muted);

    font-size: 0.86rem;

    font-weight: 700;
}


.summary-card > strong {
    display: block;

    margin-top: 12px;

    color:
        var(--brand-dark);

    font-size: 2rem;

    font-weight: 750;

    line-height: 1;
}


.summary-card > small {
    display: block;

    margin-top: 8px;

    color:
        var(--muted);

    font-size: 0.82rem;
}


/* =====================================================
   ICONOS RESUMEN
===================================================== */

.summary-icon,
.home-panel-icon {
    width: 40px;

    height: 40px;

    display: grid;

    place-items: center;

    flex: 0 0 auto;

    color:
        var(--accent-dark);

    background:
        #e8f4f5;

    border-radius: 11px;
}


/* =====================================================
   COLORES SEMÁNTICOS DEL RESUMEN
===================================================== */

.summary-card:nth-child(1)
.summary-icon {
    color: #075985;

    background: #e8f3fb;
}


.summary-card:nth-child(2)
.summary-icon {
    color:
        var(--success);

    background:
        var(--success-soft);
}


.summary-card:nth-child(3)
.summary-icon {
    color:
        var(--danger);

    background:
        var(--danger-soft);
}


.summary-card:nth-child(4)
.summary-icon {
    color:
        var(--warning);

    background:
        var(--warning-soft);
}


/* =====================================================
   INICIO - ÁREA DE TRABAJO
===================================================== */

.home-workspace {
    display: grid;

    grid-template-columns:
        minmax(0, 1.02fr)
        minmax(0, 0.98fr);

    align-items: stretch;

    gap: 20px;
}


.home-panel {
    min-width: 0;

    padding: 22px;
}


.quick-access-panel,
.pending-absences-panel {
    min-height: 100%;
}


/* =====================================================
   ENCABEZADOS DE PANELES
===================================================== */

.home-panel-header {
    margin-bottom: 18px;

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 18px;
}


.home-panel-header > div:first-child {
    min-width: 0;
}


.home-panel-header span {
    color:
        var(--accent-dark);

    font-size: 0.75rem;

    font-weight: 800;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}


.home-panel-header h2 {
    margin:
        3px 0 4px;

    color:
        var(--brand-dark);

    font-size: 1.2rem;

    font-weight: 700;
}


.home-panel-header p {
    margin: 0;

    max-width: 500px;

    color:
        var(--muted);

    font-size: 0.88rem;

    line-height: 1.5;
}


/* =====================================================
   ACCESOS RÁPIDOS
===================================================== */

.quick-access-list {
    display: grid;

    gap: 11px;
}


.quick-access-item {
    min-height: 82px;

    padding: 14px;

    display: grid;

    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 14px;

    background:
        var(--surface-soft);

    border:
        1px solid
        var(--border);

    border-radius: 13px;

    text-decoration: none;

    transition:
        transform 0.16s ease,
        background-color 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease;
}


.quick-access-item:hover {
    background:
        #ffffff;

    border-color:
        currentColor;

    box-shadow:
        0 7px 20px
        rgba(23, 33, 43, 0.07);

    transform:
        translateY(-2px);
}


/* =====================================================
   ICONO ACCESO
===================================================== */

.quick-access-icon {
    width: 46px;

    height: 46px;

    display: grid;

    place-items: center;

    flex: 0 0 auto;

    background:
        #e8f2f8;

    border-radius: 11px;
}


/* =====================================================
   TEXTO ACCESO
===================================================== */

.quick-access-text {
    min-width: 0;
}


.quick-access-text strong,
.quick-access-text span {
    display: block;
}


.quick-access-text strong {
    color:
        var(--text);

    font-size: 0.94rem;

    font-weight: 700;
}


.quick-access-text span {
    margin-top: 3px;

    overflow: hidden;

    color:
        var(--muted);

    font-size: 0.83rem;

    line-height: 1.4;

    text-overflow: ellipsis;

    white-space: nowrap;
}


.quick-access-blue {
    color: #075985;
}


.quick-access-green {
    color:
        var(--success);
}


.quick-access-purple {
    color:
        var(--purple);
}


.quick-access-blue
.quick-access-icon {
    background:
        #e8f3fb;
}


.quick-access-green
.quick-access-icon {
    background:
        var(--success-soft);
}


.quick-access-purple
.quick-access-icon {
    background:
        var(--purple-soft);
}


.quick-access-arrow {
    color:
        currentColor;

    transition:
        transform 0.16s ease;
}


.quick-access-item:hover
.quick-access-arrow {
    transform:
        translateX(3px);
}


/* =====================================================
   INASISTENCIAS - ENCABEZADO
===================================================== */

.pending-total {
    min-width: 82px;

    padding:
        9px 12px;

    flex: 0 0 auto;

    text-align: center;

    color:
        var(--danger);

    background:
        var(--danger-soft);

    border-radius: 11px;
}


.pending-total strong,
.pending-total span {
    display: block;
}


.pending-total strong {
    font-size: 1.4rem;

    font-weight: 800;

    line-height: 1;
}


.pending-total span {
    margin-top: 4px;

    font-size: 0.72rem;

    font-weight: 700;
}


/* =====================================================
   LISTA DE INASISTENCIAS
===================================================== */

.pending-absence-list {
    display: grid;

    gap: 11px;
}


.pending-absence-item {
    min-width: 0;

    min-height: 86px;

    padding:
        13px 14px;

    display: grid;

    grid-template-columns:
        minmax(160px, 1.45fr)
        minmax(90px, 0.65fr)
        auto
        auto;

    align-items: center;

    gap: 14px;

    background:
        var(--surface-soft);

    border:
        1px solid
        var(--border);

    border-radius: 13px;

    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        transform 0.16s ease;
}


.pending-absence-item:hover {
    background:
        #ffffff;

    border-color:
        #c5d0d9;

    transform:
        translateY(-1px);
}


/* =====================================================
   EMPLEADO
===================================================== */

.pending-person {
    min-width: 0;

    display: flex;

    align-items: center;

    gap: 11px;
}


.pending-avatar {
    width: 42px;

    height: 42px;

    display: grid;

    place-items: center;

    flex: 0 0 auto;

    color: #ffffff;

    background:
        var(--brand);

    border-radius: 50%;

    font-size: 0.80rem;

    font-weight: 800;
}


.pending-person > div:last-child {
    min-width: 0;
}


.pending-person strong,
.pending-person span {
    display: block;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


.pending-person strong {
    color:
        var(--brand-dark);

    font-size: 0.91rem;

    font-weight: 700;
}


.pending-person span {
    margin-top: 2px;

    color:
        var(--muted);

    font-size: 0.78rem;
}


/* =====================================================
   FECHA
===================================================== */

.pending-date {
    min-width: 0;
}


.pending-date span,
.pending-date strong {
    display: block;
}


.pending-date span {
    color:
        var(--muted);

    font-size: 0.70rem;

    font-weight: 700;

    letter-spacing: 0.05em;

    text-transform: uppercase;
}


.pending-date strong {
    margin-top: 2px;

    color:
        var(--text);

    font-size: 0.86rem;

    font-weight: 650;
}


/* =====================================================
   ESTADO
===================================================== */

.pending-status {
    display: flex;

    align-items: center;

    justify-content: center;
}


.pending-status span,
.pending-status.pending {
    min-height: 30px;

    padding:
        5px 10px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    color:
        var(--warning);

    background:
        var(--warning-soft);

    border-radius: 999px;

    font-size: 0.74rem;

    font-weight: 800;

    white-space: nowrap;
}


/* =====================================================
   BOTÓN REVISAR
===================================================== */

.pending-review-button {
    min-height: 38px;

    margin: 0;

    padding:
        8px 13px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    color: #ffffff;

    background:
        var(--brand);

    border:
        1px solid
        var(--brand);

    border-radius: 10px;

    text-decoration: none;

    font-size: 0.80rem;

    font-weight: 750;

    white-space: nowrap;

    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        transform 0.16s ease;
}


.pending-review-button:hover {
    background:
        var(--brand-dark);

    border-color:
        var(--brand-dark);

    transform:
        translateX(2px);
}

/* =====================================================
   INASISTENCIAS - ESTADO VACÍO
===================================================== */

.pending-empty {
    min-height: 130px;

    padding: 24px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 5px;

    text-align: center;

    background:
        var(--surface-soft);

    border:
        1px dashed
        var(--border);

    border-radius: 13px;
}


.pending-empty strong {
    color:
        var(--brand-dark);

    font-size: 0.92rem;
}


.pending-empty span {
    color:
        var(--muted);

    font-size: 0.82rem;
}

/* =====================================================
   PIE DE INASISTENCIAS
===================================================== */

.pending-absence-footer {
    margin-top: 16px;

    padding-top: 14px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 14px;

    border-top:
        1px solid
        var(--border);
}


.pending-absence-footer > span {
    color:
        var(--muted);

    font-size: 0.79rem;
}


.pending-absence-footer a {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    color:
        var(--accent-dark);

    text-decoration: none;

    font-size: 0.81rem;

    font-weight: 750;

    white-space: nowrap;
}


.pending-absence-footer a:hover {
    text-decoration: underline;
}


/* =====================================================
   PANTALLAS MEDIANAS
===================================================== */

@media (max-width: 1120px) {

    .summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }


    .home-workspace {
        grid-template-columns:
            1fr;
    }


    .pending-absence-item {
        grid-template-columns:
            minmax(180px, 1fr)
            minmax(100px, auto)
            auto
            auto;
    }

}


/* =====================================================
   SIDEBAR COMPACTO
===================================================== */

@media (max-width: 860px) {

    :root {
        --sidebar-width: 205px;
    }


    .sidebar {
        padding-inline: 12px;
    }


    .nav-item {
        padding-inline: 10px;
    }

}


/* =====================================================
   TABLET / NAVEGACIÓN SUPERIOR
===================================================== */

@media (max-width: 720px) {

    .dashboard {
        display: block;
    }


    .sidebar {
        width: 100%;

        height: auto;

        padding:
            10px 12px;

        position: sticky;

        top: 0;

        overflow: visible;
    }


    .date-card {
        display: none;
    }


    .sidebar-menu {
        display: flex;

        gap: 7px;

        overflow-x: auto;

        overscroll-behavior-inline:
            contain;

        scrollbar-width: thin;
    }


    .nav-item {
        min-height: 44px;

        flex: 0 0 auto;

        white-space: nowrap;
    }


    .main-content {
        padding:
            18px 14px 34px;
    }


    .topbar {
        margin-bottom: 18px;

        align-items: flex-start;
    }


    .topbar-actions {
        flex: 0 0 auto;
    }


    .pending-absence-item {
        grid-template-columns:
            minmax(0, 1fr)
            auto
            auto;

        gap: 12px;
    }


    .pending-date {
        grid-column:
            1 / 2;
    }


    .pending-status {
        grid-column:
            2 / 3;
    }


    .pending-review-button {
        grid-column:
            3 / 4;
    }

}


/* =====================================================
   CELULAR
===================================================== */

@media (max-width: 540px) {

    .summary-grid {
        grid-template-columns:
            1fr 1fr;

        gap: 10px;
    }


    .summary-card {
        padding: 15px;
    }


    .summary-card > strong {
        font-size: 1.55rem;
    }


    .summary-card > small {
        font-size: 0.76rem;
    }


    .home-panel {
        padding: 16px;
    }


    .home-panel-header {
        align-items: flex-start;
    }


    .quick-access-item {
        min-height: 78px;
    }


    .quick-access-text span {
        white-space: normal;
    }


    .pending-absence-item {
        grid-template-columns:
            minmax(0, 1fr)
            auto;

        padding: 13px;
    }


    .pending-person {
        grid-column:
            1 / -1;
    }


    .pending-date {
        grid-column:
            1 / 2;

        padding-left: 53px;
    }


    .pending-status {
        grid-column:
            2 / 3;
    }


    .pending-review-button {
        grid-column:
            1 / -1;

        width: 100%;

        margin-top: 2px;
    }


    .pending-absence-footer {
        align-items: flex-start;

        flex-direction: column;
    }

}


/* =====================================================
   CELULAR PEQUEÑO
===================================================== */

@media (max-width: 390px) {

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


    .topbar h1,
    .topbar-text h1 {
        font-size: 1.35rem;
    }

}


/* =====================================================
   MOVIMIENTO REDUCIDO
===================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior:
            auto !important;

        transition-duration:
            0.01ms !important;

        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;
    }

}


/* =====================================================
   IMPRESIÓN GENERAL
===================================================== */

@media print {

    body {
        background:
            #ffffff;
    }

    .sidebar,
    .topbar {
        display:
            none !important;
    }

    .dashboard {
        display: block;
    }

    .main-content {
        max-width: none;

        padding: 0;
    }

}