﻿:root {
    --red: #C8102E;
    --red-dark: #9e0b23;
    --red-light: #f9e8eb;
    --red-mid: #f0c0c8;
    --gray-100: #f7f7f8;
    --gray-200: #eeeeef;
    --gray-300: #d8d8da;
    --gray-400: #b0b0b5;
    --gray-500: #8a8a90;
    --gray-600: #5e5e65;
    --gray-700: #3c3c42;
    --gray-800: #2a2a30;
    --gray-900: #1a1a1e;
    --white: #ffffff;
    --font: 'DM Sans', sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.10), 0 8px 32px rgba(0,0,0,0.08);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--gray-100);
    color: var(--gray-900);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── TOP BAR ── */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .topbar-logo .logo-mark {
        width: 32px;
        height: 32px;
        background: var(--red);
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .topbar-logo .logo-mark svg {
            width: 18px;
            height: 18px;
            fill: white;
        }

    .topbar-logo .logo-text {
        font-size: 16px;
        font-weight: 600;
        color: var(--gray-900);
        letter-spacing: -0.3px;
    }

    .topbar-logo .logo-sub {
        font-size: 11px;
        font-weight: 400;
        color: var(--gray-500);
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notif-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--gray-200);
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background .15s;
}

    .notif-btn:hover {
        background: var(--gray-100);
    }

.notif-badge {
    width: 8px;
    height: 8px;
    background: var(--red);
    border-radius: 50%;
    position: absolute;
    top: 6px;
    right: 6px;
}

.avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--red);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── LAYOUT ── */
.layout {
    display: flex;
    flex: 1;
}

/* ── SIDEBAR ── */
.sidebar {
    width: 220px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 0.25rem;
}

.sidebar-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gray-500);
    padding: 0.5rem 1.25rem 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 1.25rem;
    font-size: 14px;
    font-weight: 400;
    color: var(--gray-700);
    cursor: pointer;
    border-radius: 0;
    transition: all .15s;
    border-left: 3px solid transparent;
    text-decoration: none;
}

    .nav-item:hover {
        background: var(--gray-100);
        color: var(--gray-900);
    }

    .nav-item.active {
        background: var(--red-light);
        color: var(--red);
        font-weight: 500;
        border-left-color: var(--red);
    }

    .nav-item svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        opacity: 0.7;
    }

    .nav-item.active svg {
        opacity: 1;
    }

.sidebar-spacer {
    flex: 1;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-200);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .sidebar-user .avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--red);
        color: white;
        font-size: 12px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .sidebar-user .info {
        min-width: 0;
    }

    .sidebar-user .name {
        font-size: 13px;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar-user .dept {
        font-size: 11px;
        color: var(--gray-500);
    }

/* ── MAIN ── */
.main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.page {
    display: none;
}

    .page.active {
        display: block;
    }

.page-header {
    margin-bottom: 1.75rem;
}

.page-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.4px;
    color: var(--gray-900);
}

.page-sub {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ── KPIs ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 1.75rem;
}


.kpi-cards {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 14px;
    margin-bottom: 14px;
}
@media (max-width: 768px) {

    .kpi-cards {
        display: grid;
        grid-template-columns: repeat(2,1fr);
        gap: 14px;
        margin-bottom: 14px;
    }

}


    .kpi-card {
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        padding: 1.25rem;
    }



    .kpi-label {
        font-size: 12px;
        color: var(--gray-500);
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 8px;
    }

    .kpi-value {
        font-size: 28px;
        font-weight: 600;
        color: var(--gray-900);
        letter-spacing: -1px;
        line-height: 1;
    }

        .kpi-value.red {
            color: var(--red);
        }

    .kpi-sub {
        font-size: 12px;
        color: var(--gray-500);
        margin-top: 6px;
    }

    .kpi-badge {
        display: inline-block;
        padding: 2px 8px;
        border-radius: 20px;
        font-size: 11px;
        font-weight: 500;
    }

        .kpi-badge.green {
            background: #e6f4ea;
            color: #1a7a38;
        }

        .kpi-badge.amber {
            background: #fff3e0;
            color: #b45309;
        }

        .kpi-badge.red {
            background: var(--red-light);
            color: var(--red);
        }

    /* ── DASHBOARD GRID ── */
    .dashboard-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        margin-top: 24px;
    }

    /* ── CARDS ── */
    .card {
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        overflow: hidden;
        padding: 0;
        margin-bottom: 16px;
    }

    .card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid var(--gray-200);
    }

    .card-title {
        font-size: 14px;
        font-weight: 600;
        color: var(--gray-900);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid var(--gray-200);
    }

        .card-title a,
        .card-link {
            font-size: 12px;
            font-weight: 400;
            color: var(--red);
            text-decoration: none;
        }

            .card-title a:hover,
            .card-link:hover {
                text-decoration: underline;
            }

    .card-body {
        padding: 16px 20px 20px;
    }

    .card > div:not(.card-title):not(.cal-header):not(.cal-grid) {
        padding: 16px 20px;
    }

    .card .cal-header {
        padding: 20px 20px 12px 20px;
    }

    .card .cal-grid {
        padding: 0 20px 20px 20px;
    }

    .cal-header + div {
        padding: 0 20px 14px 20px;
        gap: 14px;
    }

    .card + .card {
        margin-top: 16px;
    }

    .card-resumen {
        padding: 16px 20px 20px 20px;
    }

    .alerta-item:last-child {
        border-bottom: none;
    }

    .alerta-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .icon-red {
        background: #fff0f0;
        color: var(--red);
    }

    .icon-amber {
        background: #fff8e1;
        color: #f59e0b;
    }

    .icon-green {
        background: #f0fdf4;
        color: #16a34a;
    }

    .alerta-info {
        flex: 1;
        min-width: 0;
    }

    .alerta-nombre {
        font-size: 13px;
        font-weight: 500;
        color: var(--gray-800);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .alerta-sub {
        font-size: 12px;
        color: var(--gray-400);
        margin-top: 2px;
    }

    /* ── ESTADO VACÍO ── */
    .empty-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 32px 0;
        color: var(--gray-300);
        gap: 8px;
        font-size: 13px;
    }

    /* ── CALENDARIO MINI ── */
    .cal-mini {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
        margin-top: 8px;
    }

    .cal-mini-day,
    .cmn,
    .cal-mini-num {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 28px;
        font-size: 12px;
    }

        .cal-mini-num.empty {
            background: transparent;
        }

    .cal-hoy {
        background: var(--red) !important;
        color: #fff !important;
        font-weight: 700;
        border-radius: 50%;
    }

    .cal-turno {
        background: #e8f5e9;
        color: #2e7d32;
    }

    .cal-vacaciones {
        background: #e3f0ff;
        color: #1565c0;
    }

    .cal-incidencia {
        background: #fff3e0;
        color: #e65100;
    }

    .cal-descanso {
        background: #f5f5f5;
        color: #78909c;
    }

    /* ── LEYENDA ── */
    .cal-leyenda {
        display: flex;
        gap: 14px;
        margin-top: 14px;
        flex-wrap: wrap;
        font-size: 11px;
        color: var(--gray-500);
    }

    .dot {
        display: inline-block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        margin-right: 4px;
        vertical-align: middle;
    }

    .dot-turno {
        background: #2e7d32;
    }

    .dot-vacaciones {
        background: #1565c0;
    }

    .dot-incidencia {
        background: #e65100;
    }

    .dot-descanso {
        background: #78909c;
    }

    /* ── DASH GRID ── */
    .dash-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        margin-bottom: 20px;
    }

    /* ── ALERTAS DOCUMENTALES ── */
    .doc-alert {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 20px;
        border-bottom: 1px solid var(--gray-200);
    }

        .doc-alert:last-child {
            border-bottom: none;
            padding-bottom: 16px;
        }

    .doc-alert-icon {
        width: 36px;
        height: 36px;
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

        .doc-alert-icon.red {
            background: var(--red-light);
        }

        .doc-alert-icon.amber {
            background: #fff3e0;
        }

        .doc-alert-icon svg {
            width: 18px;
            height: 18px;
        }

    .doc-alert-info {
        flex: 1;
        min-width: 0;
    }

    .doc-alert-name {
        font-size: 13px;
        font-weight: 500;
    }

    .doc-alert-date {
        font-size: 12px;
        color: var(--gray-500);
        margin-top: 2px;
    }

    /* ── TAGS ── */
.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    width: 118px;
    text-align: center;
}

        .tag.red {
            background: var(--red-light);
            color: var(--red);
        }

        .tag.amber {
            background: #fff3e0;
            color: #b45309;
        }

        .tag.green {
            background: #e6f4ea;
            color: #1a7a38;
        }

        .tag.blue {
            background: #e8f0fe;
            color: #1a56db;
        }

    /* ── NÓMINAS ── */
    .nominas-table {
        width: 100%;
        border-collapse: collapse;
    }

        .nominas-table th {
            font-size: 12px;
            font-weight: 600;
            color: var(--gray-500);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding: 10px 16px;
            text-align: left;
            border-bottom: 1px solid var(--gray-200);
        }

        .nominas-table td {
            font-size: 14px;
            padding: 5px 5px;
            border-bottom: 1px solid var(--gray-200);
            color: var(--gray-900);
            text-align: center;
        }

        .nominas-table tr:last-child td {
            border-bottom: none;
        }

        .nominas-table tr:hover td {
            background: var(--gray-100);
        }


    /* ── BOTONES ── */
    .btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 7px 14px;
        border-radius: var(--radius-sm);
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        border: none;
        transition: all .15s;
        font-family: var(--font);
        text-decoration: none;
    }

    .btn-primary {
        background: var(--red);
        color: white;
    }

        .btn-primary:hover {
            background: var(--red-dark);
        }

.btn-ghost {
    background: transparent;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    width: 118px;
    justify-content: center;
}

        .btn-ghost:hover {
            background: var(--gray-100);
        }

    .btn-sm {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* ── PERFIL ── */
    .profile-header {
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        padding: 1.75rem;
        margin-bottom: 1.25rem;
        display: flex;
        align-items: center;
        gap: 1.5rem;
    }

    .profile-grid-card {
        padding: 20px;
    }

    .profile-avatar {
        width: 72px;
        height: 72px;
        border-radius: 50%;
        background: var(--red);
        color: white;
        font-size: 26px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .profile-name {
        font-size: 20px;
        font-weight: 600;
        letter-spacing: -0.3px;
    }

    .profile-role {
        font-size: 14px;
        color: var(--gray-500);
        margin-top: 3px;
    }

    .profile-tags {
        display: flex;
        gap: 8px;
        margin-top: 10px;
    }

    .profile-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        padding: 20px;
    }

    .field-group {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .field-label {
        font-size: 12px;
        font-weight: 500;
        color: var(--gray-500);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .field-value {
        font-size: 14px;
        color: var(--gray-900);
        background: var(--gray-100);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius-sm);
        padding: 10px 12px;
    }

    /* ── DOCUMENTOS ── */
    .docs-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .doc-card {
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        padding: 1.25rem;
        cursor: pointer;
        transition: all .15s;
    }

        .doc-card:hover {
            border-color: var(--red-mid);
            box-shadow: var(--shadow);
        }

    .doc-icon {
        width: 40px;
        height: 40px;
        background: var(--red-light);
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 12px;
    }

        .doc-icon svg {
            width: 20px;
            height: 20px;
            color: var(--red);
        }

    .doc-name {
        font-size: 14px;
        font-weight: 500;
        color: var(--gray-900);
        margin-bottom: 4px;
    }

    .doc-meta {
        font-size: 12px;
        color: var(--gray-500);
    }

    /* ── TICKET ── */
    .ticket-form {
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        padding: 1.5rem;
        max-width: 100%;
    }

    .form-row {
        margin-bottom: 1rem;
    }

    .form-label {
        font-size: 13px;
        font-weight: 500;
        color: var(--gray-700);
        margin-bottom: 6px;
        display: block;
    }

    .form-input,
    .form-select,
    .form-textarea {
        width: 100%;
        padding: 9px 12px;
        border: 1px solid var(--gray-300);
        border-radius: var(--radius-sm);
        font-size: 14px;
        font-family: var(--font);
        color: var(--gray-900);
        background: var(--white);
        outline: none;
        transition: border .15s;
    }

        .form-input:focus,
        .form-select:focus,
        .form-textarea:focus {
            border-color: var(--red);
            box-shadow: 0 0 0 3px rgba(200,16,46,0.08);
        }

    .form-textarea {
        min-height: 100px;
        resize: vertical;
    }

    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }

    .modal-box {
        background: white;
        border-radius: var(--radius-sm, 8px);
        padding: 20px;
        max-width: 500px;
        width: 90%;
        max-height: 80vh;
        overflow-y: auto;
    }

    /* ── CALENDARIO COMPLETO ── */
    .cal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1rem;
    }

    .cal-nav {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .cal-month {
        font-size: 18px;
        font-weight: 600;
    }

    .cal-grid {
        display: grid;
        grid-template-columns: repeat(7, 13%);
        gap: 4px;
    }

    .cal-head {
        text-align: center;
        font-size: 12px;
        font-weight: 600;
        color: var(--gray-500);
        padding: 8px 0;
    }

    .cal-cell {
        min-height: 80px;
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius-sm);
        padding: 6px 8px;
        cursor: pointer;
        transition: border .15s;
    }

        .cal-cell:hover {
            border-color: var(--red-mid);
        }

        .cal-cell.today {
            border-color: var(--red);
            background: var(--red-light);
        }

        .cal-cell.empty {
            background: transparent;
            border-color: transparent;
        }

        .cal-cell.today .cal-num {
            color: var(--red);
            font-weight: 700;
        }

    .cal-num {
        font-size: 13px;
        font-weight: 500;
        margin-bottom: 4px;
    }

    .cal-event {
        font-size: 11px;
        padding: 2px 5px;
        border-radius: 4px;
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

        .cal-event.vac {
            background: #e6f4ea;
            color: #1a7a38;
        }

        .cal-event.inc {
            background: #fff3e0;
            color: #b45309;
        }

        .cal-event.baj {
            background: var(--red-light);
            color: var(--red);
        }

    /* ── LOGIN ── */
    .login-wrap {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--gray-100);
    }

    .login-card {
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: 20px;
        padding: 2.5rem;
        width: 380px;
        box-shadow: var(--shadow-md);
    }

    .login-logo {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 2rem;
    }

        .login-logo .lm {
            width: 40px;
            height: 40px;
            background: var(--red);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

            .login-logo .lm svg {
                width: 22px;
                height: 22px;
                fill: white;
            }

    .login-title {
        font-size: 20px;
        font-weight: 600;
    }

    .login-sub {
        font-size: 22px;
        color: var(--gray-500);
    }

    .login-heading {
        font-size: 24px;
        font-weight: 600;
        margin-bottom: 6px;
    }

    .login-desc {
        font-size: 14px;
        color: var(--gray-500);
        margin-bottom: 1.5rem;
    }

    .recover-link {
        font-size: 13px;
        color: var(--red);
        text-decoration: none;
        display: block;
        text-align: right;
        margin-top: -4px;
        margin-bottom: 1rem;
    }

        .recover-link:hover {
            text-decoration: underline;
        }

    .login-btn {
        width: 100%;
        padding: 11px;
        background: var(--red);
        color: white;
        border: none;
        border-radius: var(--radius-sm);
        font-size: 15px;
        font-weight: 500;
        cursor: pointer;
        font-family: var(--font);
        transition: background .15s;
    }

        .login-btn:hover {
            background: var(--red-dark);
        }

    /* ── UTILS ── */
    .divider {
        height: 1px;
        background: var(--gray-200);
        margin: 1.25rem 0;
    }

    .flex-between {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .mt-1 {
        margin-top: 0.75rem;
    }

    .gap-row {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    /* ── COMUNICACIONES ── */
    .com-filter-bar {
        display: flex;
        gap: 8px;
        margin-bottom: 1.25rem;
        flex-wrap: wrap;
    }

    .com-filter-btn {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 6px 14px;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 500;
        border: 1px solid var(--gray-300);
        background: var(--white);
        color: var(--gray-700);
        cursor: pointer;
        text-decoration: none;
        transition: all .15s;
        font-family: var(--font);
    }

        .com-filter-btn:hover {
            background: var(--gray-100);
        }

        .com-filter-btn.active {
            background: var(--red);
            border-color: var(--red);
            color: #fff;
        }

    .com-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        margin-bottom: 14px;
    }

    .com-card {
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        padding: 1.25rem;
        transition: box-shadow .15s;
        display: flex;
        flex-direction: column;
    }

        .com-card:hover {
            box-shadow: var(--shadow);
        }

        .com-card.urgente {
            border-color: var(--red-mid);
        }

    .com-card-top {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 10px;
    }

    .com-card-icon {
        width: 38px;
        height: 38px;
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        flex-shrink: 0;
    }

    .com-card-fecha {
        font-size: 12px;
        color: var(--gray-500);
        margin-left: auto;
        white-space: nowrap;
    }

    .com-card-titulo {
        font-size: 14px;
        font-weight: 600;
        color: var(--gray-900);
        margin-bottom: 5px;
    }

    .com-card-desc {
        font-size: 13px;
        color: var(--gray-500);
        line-height: 1.5;
        flex: 1;
    }

    .com-card-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 12px;
        padding-top: 10px;
        border-top: 1px solid var(--gray-200);
        flex-wrap: wrap;
        gap: 6px;
    }

    .com-card-dates {
        font-size: 11px;
        color: var(--gray-500);
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
    }

        .com-card-dates span {
            display: flex;
            align-items: center;
            gap: 3px;
        }

    .fecha-urgente {
        color: var(--red) !important;
        font-weight: 600;
    }

    .pill-urgente {
        display: inline-block;
        background: var(--red-light);
        color: var(--red);
        font-size: 10px;
        font-weight: 600;
        padding: 1px 7px;
        border-radius: 20px;
        margin-left: 5px;
        vertical-align: middle;
    }

    .com-empty {
        text-align: center;
        padding: 3rem 1rem;
        color: var(--gray-500);
    }

    .com-empty-icon {
        font-size: 2.25rem;
        margin-bottom: .75rem;
    }

    .com-empty-title {
        font-size: 15px;
        font-weight: 500;
        color: var(--gray-900);
        margin-bottom: 4px;
    }

    /* ── MODAL (compartido: MisDocumentos + Comunicaciones) ── */
    .modal-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 1000;
        align-items: center;
        justify-content: center;
    }

        .modal-overlay.active {
            display: flex;
        }

    .modal {
        background: var(--white);
        border-radius: 12px;
        padding: 28px 32px;
        width: 520px;
        max-width: 95vw;
        box-shadow: 0 20px 60px rgba(0,0,0,.18);
    }

    .modal-wide {
        width: 820px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-title {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 4px;
        color: var(--gray-900);
    }

    .modal-sub {
        font-size: 13px;
        color: var(--gray-500);
        margin-bottom: 20px;
    }

    .modal-actions {
        display: flex;
        gap: 10px;
        justify-content: flex-end;
        margin-top: 20px;
    }

    /* ── COM MODAL (alias por compatibilidad) ── */
    .com-modal-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 1000;
        align-items: center;
        justify-content: center;
    }

        .com-modal-overlay.active {
            display: flex;
        }

    .com-modal-wide {
        background: var(--white);
        border-radius: var(--radius);
        padding: 28px 32px;
        width: 820px;
        max-width: 95vw;
        max-height: 90vh;
        overflow-y: auto;
        box-shadow: var(--shadow-md);
    }

    .com-modal-title {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 4px;
        color: var(--gray-900);
    }

    .com-modal-sub {
        font-size: 13px;
        color: var(--gray-500);
        margin-bottom: 16px;
    }

    .com-modal-actions {
        display: flex;
        gap: 10px;
        justify-content: flex-end;
        margin-top: 16px;
    }

    /* ── FIRMA (MisDocumentos) ── */
    #visor-firma-wrap {
        position: relative;
        width: 100%;
        height: auto; /* ← era 600px, ahora se adapta al contenido */
        min-height: 300px;
        background: #f0f0f0;
        border-radius: 8px;
        overflow: visible; /* ← era auto */
        cursor: crosshair;
        border: 2px solid var(--gray-200);
        margin-bottom: 10px;
    }

    #marcador-firma {
        display: none;
        position: absolute;
        border: 2px dashed var(--red);
        background: rgba(200,16,46,0.08);
        border-radius: 4px;
        pointer-events: none;
        transform: translate(-50%, -50%);
        width: 160px;
        height: 55px;
    }

        #marcador-firma::after {
            content: '✍ Firma aquí';
            position: absolute;
            bottom: -20px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 10px;
            color: var(--red);
            font-weight: 600;
            white-space: nowrap;
        }

    .paso-instruccion {
        font-size: 12px;
        color: var(--gray-500);
        background: #f8fafc;
        border: 1px solid var(--gray-200);
        border-radius: 6px;
        padding: 7px 12px;
        margin-bottom: 8px;
    }

        .paso-instruccion.activo {
            border-color: var(--red);
            color: var(--red);
        }

    .pdf-nav {
        display: none;
        align-items: center;
        gap: 8px;
        font-size: 12px;
        color: var(--gray-500);
        margin-bottom: 8px;
    }

        .pdf-nav button {
            padding: 3px 8px;
            border: 1px solid var(--gray-300);
            background: white;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
        }

            .pdf-nav button:disabled {
                opacity: .4;
                cursor: default;
            }

    /* ── TOAST ── */
    .toast {
        position: fixed;
        bottom: 28px;
        right: 28px;
        background: #111;
        color: #fff;
        padding: 12px 20px;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 500;
        opacity: 0;
        transform: translateY(12px);
        transition: opacity .3s, transform .3s;
        z-index: 2000;
        pointer-events: none;
    }

        .toast.show {
            opacity: 1;
            transform: translateY(0);
        }

        .toast.green {
            background: #16a34a;
        }

        .toast.red {
            background: #dc2626;
        }

    /* ── RESPONSIVE ── */
    /* ════════════════════ RESPONSIVE ════════════════════ */

    /* ---- Tablet (≤1024px) ---- */
    @media (max-width: 1024px) {
        .kpi-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .docs-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .dashboard-grid {
            grid-template-columns: 1fr;
        }

        .dash-grid {
            grid-template-columns: 1fr;
        }

        .com-grid {
            grid-template-columns: 1fr;
        }
    }

    /* ---- Móvil / tablet vertical (≤768px) ---- */
    @media (max-width: 768px) {

        /* Topbar más compacta */
        .topbar {
            padding: 0 1rem;
        }

        .topbar-logo .logo-sub {
            display: none;
        }

        /* Sidebar → riel de iconos */
        .sidebar {
            width: 60px;
            padding: 1rem 0;
        }

        .sidebar-label,
        .nav-item span,
        .sidebar-user .info {
            display: none;
        }

        .nav-item {
            justify-content: center;
            padding: 0.7rem 0;
        }

        .sidebar-footer {
            padding: 1rem 0;
        }

        .sidebar-user {
            justify-content: center;
        }

        /* Contenido principal */
        .main {
            padding: 1.25rem 1rem;
        }

        .page-header.flex-between {
            flex-wrap: wrap;
            gap: 12px;
        }

        .page-title {
            font-size: 19px;
        }

        /* Grids a 1 columna */
        .docs-grid,
        .profile-grid {
            grid-template-columns: 1fr;
        }

        /* Perfil */
        .profile-header {
            flex-direction: column;
            text-align: center;
            gap: 1rem;
        }

        .profile-tags {
            justify-content: center;
        }

        /* Tablas → scroll horizontal (no se rompen) */
        .nominas-table {
            display: block;
            overflow-x: auto;
            white-space: nowrap;
            -webkit-overflow-scrolling: touch;
        }

        /* Modales */
        .modal,
        .com-modal-wide {
            padding: 22px 18px;
        }

        .modal-actions,
        .com-modal-actions {
            flex-wrap: wrap;
        }

        /* Visor de firma */
        #visor-firma-wrap {
            min-height: 220px;
        }

        /* Calendario */
        .cal-cell {
            min-height: 56px;
            padding: 4px 5px;
        }

        .cal-num {
            font-size: 12px;
        }

        .cal-event {
            font-size: 6px;
            padding: 1px 4px;
            white-space: normal;
        }

        .cal-month {
            font-size: 16px;
        }
    }

    /* ---- Móvil pequeño (≤480px) ---- */
    @media (max-width: 480px) {
        .kpi-grid {
            grid-template-columns: 1fr;
        }

        .toast {
            left: 16px;
            right: 16px;
            bottom: 16px;
            text-align: center;
        }

        .cal-head {
            font-size: 10px;
        }

        .cal-cell {
            min-height: 46px;
        }

        .modal {
            padding: 18px 14px;
        }
    }
    /* ── PAGINACIÓN (MisDocumentos) ── */
    .paginacion {
        display: flex;
        gap: 6px;
        justify-content: center;
        align-items: center;
        margin-top: 16px;
        flex-wrap: wrap;
    }

        .paginacion button {
            padding: 5px 12px;
            border: 1px solid var(--gray-200);
            background: var(--white);
            border-radius: 6px;
            font-size: 12px;
            cursor: pointer;
            color: var(--gray-700);
            font-family: var(--font);
            transition: all .15s;
        }

            .paginacion button:hover {
                border-color: var(--red);
                color: var(--red);
            }

            .paginacion button.activa {
                background: var(--red);
                color: var(--white);
                border-color: var(--red);
                font-weight: 600;
            }

            .paginacion button:disabled {
                opacity: .35;
                cursor: default;
            }

    .pag-info {
        font-size: 12px;
        color: var(--gray-400);
        text-align: right;
        margin-bottom: 6px;
        padding: 0 16px;
    }

.ticket-div {
    display:grid;
    grid-template-columns:1fr 60%;
    gap:14px;
}
.grid1rowMovil{

}
@media (max-width: 1000px) {
    .ticket-div {
        display: block;
    }
    .grid1rowMovil {
        grid-template-columns: repeat(1, 1fr) !important;
    }
}