:root {
    --primary: #00bba7;
    --primary-dark: #009688;
    --primary-light: #e6f9f6;
    --accent: #ff4d6d;
    --accent-dark: #e63956;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0284c7;
    --light: #f8fafc;
    --dark: #212529;
    --brand-dark: #2c3034;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
}

/* Header */
.main-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.brand-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.brand-text span {
    font-size: 0.875rem;
    opacity: 0.9;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: rgba(0, 19, 189, 0.9);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-1px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: capitalize;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-menu {
    border: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 0.5rem 0;
    min-width: 200px;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: var(--gray-100);
}

.logout-btn {
    color: var(--danger) !important;
}

.logout-btn:hover {
    background: #fef2f2 !important;
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    color: white;
    padding: 0.5rem;
    cursor: pointer;
}

.mobile-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Alert Messages */
.alert {
    margin-bottom: 1rem;
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert-danger {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border-left: 4px solid #dc3545;
}

.alert-success {
    background: linear-gradient(135deg, #51cf66, #40c057);
    color: white;
    border-left: 4px solid #28a745;
}

.alert-warning {
    background: linear-gradient(135deg, #ffd43b, #fab005);
    color: #212529;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background: linear-gradient(135deg, #74c0fc, #339af0);
    color: white;
    border-left: 4px solid #17a2b8;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--gray-600);
    font-size: 1rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    justify-content: center;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Tables */
.table-responsive {
    border-radius: 12px;
    overflow: hidden;
}

.table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: var(--gray-50);
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 1rem;
    border: none;
    border-bottom: 1px solid var(--gray-200);
}

.table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--gray-100);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table tbody td {
    padding: 0rem;
    vertical-align: middle;
    border: none;
}

/* Forms */
.form-control {
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-select {
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge.bg-success {
    background: var(--success) !important;
    color: white;
}

.badge.bg-danger {
    background: var(--danger) !important;
    color: white;
}

.badge.bg-warning {
    background: var(--warning) !important;
    color: white;
}

.badge.bg-primary {
    background: var(--primary) !important;
    color: white;
}

.badge.bg-secondary {
    background: var(--secondary) !important;
    color: white;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: #f0f9ff;
    color: #1e40af;
    border-left: 4px solid var(--info);
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stats-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Loading */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 1rem;
    }

    .nav-menu {
        gap: 0.25rem;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .nav-link span {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-container {
        height: 60px;
    }

    .brand-text h1 {
        font-size: 1.25rem;
    }

    .brand-text span {
        display: none;
    }

    .nav-menu {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .page-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 0.75rem;
    }

    .user-details {
        display: none;
    }

    .content-wrapper {
        padding: 0.75rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.d-flex {
    display: flex;
}

.d-block {
    display: block;
}

.d-none {
    display: none;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.p-0 {
    padding: 0;
}

.p-1 {
    padding: 0.25rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.w-100 {
    width: 100%;
}

.h-100 {
    height: 100%;
}

/* Indicador de Solicitudes */
#solicitudes-badge {
    font-size: 0.75rem;
    min-width: 18px;
    height: 18px;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    background: var(--danger) !important;
    color: white;
    font-weight: 600;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#solicitudes-badge:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Responsive para el indicador */
@media (max-width: 768px) {
    #solicitudes-badge {
        font-size: 0.7rem;
        min-width: 16px;
        height: 16px;
        padding: 0.2rem 0.4rem;
    }
}

/* ========================================================
   INDICADORES ECONÓMICOS BAR (ESTADO DE CHILE)
   ======================================================== */
.indicadores-bar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.indicador-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    font-weight: 500;
}

.indicador-pill .label {
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.indicador-pill .val {
    color: #0f172a;
    font-weight: 700;
}

.indicador-pill.highlight {
    background: #f0fdfb;
    border-color: #00bba7;
}

.indicador-pill.highlight .val {
    color: #009688;
}

/* ========================================================
   LIQUIDACIÓN DE SUELDO OFICIAL (FORMATO LEGAL CHILE)
   ======================================================== */
.liquidacion-voucher {
    background: #ffffff;
    color: #1e293b;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    padding: 2.2rem;
    max-width: 900px;
    margin: 0 auto;
    font-family: 'Segoe UI', Arial, sans-serif;
    position: relative;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

.liquidacion-voucher .voucher-header {
    border-bottom: 2px solid #00bba7;
    padding-bottom: 1.2rem;
    margin-bottom: 1.5rem;
}

.voucher-logo {
    max-height: 55px;
    max-width: 200px;
    object-fit: contain;
}

.voucher-title {
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.voucher-periodo-badge {
    background: #00bba7;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 4px;
    display: inline-block;
}

.voucher-info-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.85rem 1rem;
    font-size: 0.825rem;
    line-height: 1.5;
}

.voucher-info-box strong {
    color: #334155;
}

.voucher-table {
    width: 100%;
    font-size: 0.84rem;
    border-collapse: collapse;
}

.voucher-table th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
}

.voucher-table td {
    padding: 0.45rem 0.75rem;
    border: 1px solid #e2e8f0;
}

.voucher-table .row-total {
    background: #f8fafc;
    font-weight: 700;
    border-top: 2px solid #cbd5e1;
}

.voucher-table .text-right,
.voucher-table .text-end {
    text-align: right;
}

.voucher-liquido-box {
    background: linear-gradient(135deg, #00bba7 0%, #009688 100%);
    color: #ffffff;
    border-radius: 8px;
    padding: 1.2rem;
    text-align: center;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 187, 167, 0.2);
}

.voucher-liquido-box .monto {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.voucher-liquido-box .palabras {
    font-size: 0.85rem;
    text-transform: uppercase;
    opacity: 0.95;
    font-style: italic;
    margin-top: 0.25rem;
}

.voucher-clausula {
    font-size: 0.75rem;
    color: #64748b;
    text-align: justify;
    line-height: 1.4;
    margin: 1.2rem 0;
    border-left: 3px solid #00bba7;
    padding-left: 0.75rem;
}

.voucher-firmas {
    display: flex;
    justify-content: space-around;
    margin-top: 3.5rem;
    padding-top: 1rem;
}

.voucher-firma-col {
    text-align: center;
    width: 40%;
}

.voucher-firma-linea {
    border-top: 1px solid #334155;
    margin-bottom: 0.5rem;
}

.voucher-firma-nombre {
    font-weight: 700;
    font-size: 0.85rem;
}

.voucher-firma-sub {
    font-size: 0.75rem;
    color: #64748b;
}

/* ========================================================
   ESTILOS DE IMPRESIÓN (PDF / PRINT READY)
   ======================================================== */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .navbar,
    .indicadores-bar,
    .modal-header .btn-close,
    .modal-footer,
    .btn,
    footer,
    .no-print {
        display: none !important;
    }

    .modal {
        position: static !important;
        display: block !important;
        overflow: visible !important;
    }

    .modal-dialog {
        max-width: 100% !important;
        margin: 0 !important;
    }

    .modal-content {
        border: none !important;
        box-shadow: none !important;
    }

    .liquidacion-voucher {
        border: 1px solid #94a3b8 !important;
        box-shadow: none !important;
        padding: 1.5rem !important;
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    .voucher-liquido-box {
        background: #f1f5f9 !important;
        color: #000000 !important;
        border: 2px solid #000000 !important;
    }
}