@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

* {
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f0f4f8;
    font-family: 'Montserrat', sans-serif;
    color: #0f172a;
}

.app-layout {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

/* ========= SIDEBAR ========= */
.sidebar {
    width: 260px;
    background: linear-gradient(145deg, #0f172a 0%, #0a0f1c 100%);
    color: #eef2ff;
    display: flex;
    flex-direction: column;
    padding: 28px 18px;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: nowrap;
    transition: width 0.3s ease, padding 0.3s ease;
}

.sidebar.collapsed {
    width: 72px;
    padding: 28px 8px;
}

.sidebar.collapsed .sidebar-link span {
    display: none;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    gap: 0;
    padding: 12px 0;
}

.sidebar.collapsed .sidebar-logo {
    display: none;
}

.sidebar-logo {
    width: auto;
    max-width: 180px;
    height: 48px;
    object-fit: contain;
    margin: 0 auto 30px;
    display: block;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-radius: 16px;
    font-weight: 500;
    font-size: 0.95rem;
    color: #cbd5e6;
    transition: all 0.2s ease;
    text-decoration: none;
}

.sidebar-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #ffffff;
    transform: translateX(4px);
}

.sidebar-link.active {
    background: linear-gradient(90deg, #6366f1, #818cf8);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ========= MAIN WRAPPER ========= */
.main-wrapper {
    flex: 1;
    min-width: 0;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-wrapper.sidebar-collapsed {
    margin-left: 72px;
}

/* ========= TOPBAR ========= */
.topbar {
    height: 72px;
    background: #ffffff;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #1e293b;
    cursor: pointer;
    padding: 8px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e293b, #334155);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: -0.3px;
    margin: 0;
}

.titulo-unace {
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #ffb300, #ffcc33);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.titulo-seccion {
    font-size: 22px;
    font-weight: 500;
    color: #2c2c2c;
}

/* ========= USER BOX ========= */
.user-box {
    display: flex;
    align-items: center;
    gap: 18px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(145deg, #e0e7ff, #c7d2fe);
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.2);
}

.btn-logout {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 40px;
    padding: 8px 20px;
    font-weight: 500;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-logout:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
    transform: scale(0.97);
}

/* ========= CONTENT ========= */
.main-content {
    padding: 28px 32px;
    flex: 1;
}

/* ========= TARJETAS DASHBOARD ========= */
.dashboard-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.08);
    transition: all 0.25s ease;
    border: 1px solid rgba(226, 232, 240, 0.6);
    height: 100%;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 35px -12px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e1;
}

.dashboard-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.dashboard-card:hover .dashboard-card-icon {
    transform: scale(1.03);
}

.bg-primary-soft { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #4338ca; }
.bg-success-soft { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #15803d; }
.bg-warning-soft { background: linear-gradient(135deg, #fef9c3, #fde047); color: #a16207; }
.bg-danger-soft  { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #b91c1c; }

.dashboard-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: #0f172a;
    margin: 0;
}

.dashboard-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

/* ========= TARJETAS DE CONTENIDO ========= */
.content-card {
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #edf2f7;
    overflow: hidden;
    transition: box-shadow 0.2s;
    height: 100%;
}

.content-card:hover {
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.1);
}

.card-header-custom {
    padding: 20px 24px 10px 24px;
}

.card-header-custom h5 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
}

.card-body-custom {
    padding: 10px 24px 24px 24px;
}

.text-muted {
    color: #64748b !important;
    font-size: 0.95rem;
    line-height: 1.5;
}

.lista-trabajadores td {
    text-align: center;
}

/* ========= MODALES ========= */
.modal-header {
    background: #2c3e50 !important;
}

.modal-title {
    color: white !important;
}

/* ========= CARDS HOVER ========= */
.stat-card {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.1) !important;
}

.stat-card:hover .icon-box {
    transform: scale(1.02);
    transition: transform 0.2s ease-in-out;
}

.info-block {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.info-block:hover {
    background-color: white !important;
    border-color: #dee2e6 !important;
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.05);
}

.summary-card {
    transition: box-shadow 0.2s ease-in-out;
}

.summary-card:hover {
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.08) !important;
}

.badge.border:hover {
    background-color: #f8f9fa !important;
    transition: background-color 0.2s ease;
}

/* ========= VISOR LOADER ========= */
.visor-loader {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.88);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}

.visor-loader-box {
    text-align: center;
    font-family: Arial, sans-serif;
    color: #333;
}

/* ========= SCROLLBAR ========= */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #eef2ff;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb {
    background: #a5b4fc;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: #818cf8;
}

/* ========= ANTI-PARPADEO SIDEBAR ========= */
html.sidebar-pre-collapsed #sidebar {
    width: 72px;
    padding: 28px 8px;
}

html.sidebar-pre-collapsed #sidebar .sidebar-link span,
html.sidebar-pre-collapsed #sidebar .sidebar-logo {
    display: none;
}

html.sidebar-pre-collapsed .main-wrapper {
    margin-left: 72px !important;
}

/* ========= RESPONSIVE ========= */
@media (max-width: 768px) {
    .sidebar {
        z-index: 1055 !important;
        transform: translateX(-100%);
        width: 280px;
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    .sidebar.show,
    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0 !important;
    }

    .mobile-menu-btn {
        display: block;
    }

    .topbar {
        padding: 0 20px;
    }

    .main-content {
        padding: 20px 16px;
    }

    .sidebar-overlay {
        z-index: 1045 !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .titulo-unace {
        font-size: 20px;
        line-height: 1.2;
        letter-spacing: 0.2px;
    }

    .titulo-seccion {
        font-size: 16px;
        line-height: 1.3;
    }
}

@media (max-width: 576px) {
    .dashboard-number {
        font-size: 1.5rem;
    }

    .dashboard-card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .page-title {
        font-size: 1.2rem;
    }

    .user-avatar {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .btn-logout span {
        display: none;
    }

    .btn-logout {
        padding: 8px 12px;
    }

    .btn-logout i {
        margin: 0;
    }

    .card-header-custom {
        padding: 16px 20px 8px 20px;
    }

    .card-body-custom {
        padding: 8px 20px 20px 20px;
    }

    .titulo-unace {
        font-size: 12px;
    }

    .titulo-seccion {
        font-size: 10px;
    }
}

