﻿: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-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 (alertas + calendario) ── */
.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;
}

.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;
}

    .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-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px; /* ← AÑADIR */
    border-bottom: 1px solid var(--gray-200); /* ← AÑADIR */
}

.card-body {
    padding: 16px 20px 20px; /* ← subir el top de 12 a 16 */
}

/* ── ALERTAS ── */
.alerta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
}

    .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 th {
        text-align: center;
        font-size: 11px;
        font-weight: 500;
        color: var(--gray-500);
        padding: 4px 0 6px;
    }

    .cal-mini td {
        text-align: center;
        font-size: 12px;
        padding: 5px 3px;
        border-radius: 6px;
        color: var(--gray-600);
    }*/

.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 (heredado) ── */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ── ALERTAS DOCUMENTALES (estilos heredados) ── */
.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-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

    .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: 12px 16px;
        border-bottom: 1px solid var(--gray-200);
        color: var(--gray-900);
    }

    .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);
}

    .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: 600px;
}

.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;
}

/* ── 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, 1fr);
    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-num {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.cal-cell.today .cal-num {
    color: var(--red);
    font-weight: 700;
}

.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;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .docs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        width: 56px;
    }


    .nav-item span,
    .sidebar-label,
    .sidebar-user .info {
        display: none;
    }
}
