/* CSS Personalizado Ultra-Uniforme & Reporte Gerencial de Impresión - Muebles Suecia SPA */
:root {
    --trato-primary: #6366f1;
    --trato-bg-dark: #0f172a;
    --trato-card-bg: rgba(30, 41, 59, 0.85);
    --trato-border: rgba(255, 255, 255, 0.15);
}

body.tratos-app {
    background-color: var(--trato-bg-dark);
    color: #f8fafc;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
}

.text-slate { color: #cbd5e1 !important; }
.text-muted, small.text-muted { color: #94a3b8 !important; }
.form-label { color: #f1f5f9 !important; font-weight: 600; }

.navbar-tratos {
    background: rgba(15, 23, 42, 0.98) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--trato-border);
}

.navbar-tratos .nav-link {
    color: #cbd5e1 !important;
    font-weight: 500;
}

.navbar-tratos .nav-link:hover, .navbar-tratos .nav-link.active {
    color: #818cf8 !important;
}

.trato-card-box {
    background: var(--trato-card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--trato-border);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.form-control, .form-select {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.form-control:focus, .form-select:focus {
    background-color: #0f172a !important;
    color: #ffffff !important;
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 0.25rem rgba(129, 140, 248, 0.25) !important;
}

.form-select option {
    background-color: #0f172a !important;
    color: #ffffff !important;
}

/* CONTENEDOR RESPONSIVO CON FIJACIÓN (STICKY) DE ENCABEZADOS Y COLUMNAS */
.table-responsive {
    max-height: 78vh;
    overflow: auto;
    position: relative;
    border-radius: 12px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    scrollbar-width: thin;
    scrollbar-color: #6366f1 #0f172a;
}

.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 10px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #0f172a;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #6366f1;
    border-radius: 4px;
}

/* TABLA ULTRA-UNIFORME & ALTA LEGIBILIDAD CON CABECERA ESTÁTICA */
.table-dark-custom {
    --bs-table-bg: transparent;
    --bs-table-color: #f1f5f9;
    --bs-table-border-color: rgba(255, 255, 255, 0.15);
    margin-bottom: 0;
    font-size: 0.84rem;
    border-collapse: separate;
    border-spacing: 0;
}

/* Fila 1 de Encabezado Sticky */
.table-dark-custom thead tr:nth-child(1) th {
    position: sticky;
    top: 0;
    z-index: 20;
}

/* Fila 2 de Encabezado Sticky */
.table-dark-custom thead tr:nth-child(2) th {
    position: sticky;
    top: 45px;
    z-index: 19;
}

/* Columnas Sticky Horizontales */
.col-sticky-1 {
    position: sticky !important;
    left: 0 !important;
    z-index: 15 !important;
    background-color: #0f172a !important;
    border-right: 3px solid #6366f1 !important;
    box-shadow: 4px 0 8px rgba(0, 0, 0, 0.5);
    min-width: 110px;
    white-space: nowrap;
}

/* Intersección de Encabezado y Columna Sticky (Esquina Superior Izquierda) */
.table-dark-custom thead th.col-sticky-1 {
    z-index: 30 !important;
    top: 0 !important;
}

.table-dark-custom th {
    color: #ffffff !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.76rem;
    letter-spacing: 0.5px;
    padding: 10px 8px !important;
    vertical-align: middle !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.table-dark-custom td {
    color: #e2e8f0;
    padding: 10px 8px !important;
    vertical-align: middle !important;
}

/* ENCABEZADOS DE GRUPO 100% OPACOS (EVITA TRANSPARENCIA Y TEXTO SOLAPADO AL DESPLAZAR) */
.th-group-unit {
    background: #0f172a linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    border-bottom: 2px solid #64748b !important;
}

.th-group-base-cocina {
    background: #0c4a6e linear-gradient(180deg, #075985 0%, #0c4a6e 100%) !important;
    border-bottom: 2px solid #38bdf8 !important;
    color: #38bdf8 !important;
}

.th-group-base-closet {
    background: #451a03 linear-gradient(180deg, #78350f 0%, #451a03 100%) !important;
    border-bottom: 2px solid #fbbf24 !important;
    color: #fbbf24 !important;
}

.th-group-cocina {
    background: #0369a1 linear-gradient(180deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    border-bottom: 3px solid #38bdf8 !important;
}

.th-group-closet {
    background: #78350f linear-gradient(180deg, #92400e 0%, #78350f 100%) !important;
    color: #ffffff !important;
    border-bottom: 3px solid #fbbf24 !important;
}

.th-group-totales {
    background: #047857 linear-gradient(180deg, #059669 0%, #047857 100%) !important;
    color: #ffffff !important;
    border-bottom: 3px solid #34d399 !important;
}

.th-group-entregas {
    background: #581c87 linear-gradient(180deg, #7e22ce 0%, #581c87 100%) !important;
    color: #ffffff !important;
    border-bottom: 3px solid #c084fc !important;
}

/* GRUPOS DE COLUMNAS DE TABLA CON FONDOS SUAVES DE SECCIÓN */
.td-section-cocina {
    background-color: rgba(14, 165, 233, 0.05) !important;
}

.td-section-closet {
    background-color: rgba(245, 158, 11, 0.05) !important;
}

.td-section-entregas {
    background-color: rgba(168, 85, 247, 0.05) !important;
}

.td-section-totales {
    background-color: rgba(16, 185, 129, 0.07) !important;
}

/* FILAS ALTERNADAS Y EFFECTO HOVER ELEGANTE */
.table-dark-custom tbody tr:nth-child(even) {
    background-color: rgba(15, 23, 42, 0.45);
}

.table-dark-custom tbody tr:nth-child(odd) {
    background-color: rgba(30, 41, 59, 0.35);
}

.table-dark-custom tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.18) !important;
}

/* TARJETAS DE SUBPARTIDAS CON MAYOR ESPACIADO Y LEGIBILIDAD */
.box-subpartida-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 120px;
    min-width: 175px;
    padding: 8px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease-in-out;
}

.box-subpartida-item:hover {
    border-color: rgba(129, 140, 248, 0.6);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.fs-8 { font-size: 0.82rem !important; }
.fs-9 { font-size: 0.75rem !important; }

/* DASHBOARD GERENCIAL MODERN STYLING CON ALTO CONTRASTE */
.text-muted {
    color: #cbd5e1 !important;
}

.text-slate {
    color: #f1f5f9 !important;
}

.text-primary {
    color: #38bdf8 !important; /* Azul celeste brillante en lugar de azul oscuro */
}

.card-kpi-gerencial {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card-kpi-gerencial:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.3);
    border-color: rgba(129, 140, 248, 0.7);
}

.icon-box-gerencial {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.chart-card-gerencial {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* CHECKBOX INTERACTIVO UNIFORME */
.form-check-input:checked {
    background-color: #22c55e !important;
    border-color: #22c55e !important;
}

/* ESTILOS DE IMPRESIÓN GERENCIAL - REPORTE CORPORATIVO */
@media print {
    body.tratos-app {
        background-color: #ffffff !important;
        color: #0f172a !important;
        font-size: 10pt;
    }

    .no-print, nav, .navbar, footer {
        display: none !important;
    }

    .trato-card-box {
        background: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
    }

    .table-printable {
        width: 100% !important;
        color: #0f172a !important;
        border-collapse: collapse !important;
    }

    .table-printable th {
        background-color: #f1f5f9 !important;
        color: #0f172a !important;
        border: 1px solid #94a3b8 !important;
        font-weight: 800 !important;
        text-transform: uppercase !important;
        font-size: 8pt !important;
        padding: 6px 8px !important;
    }

    .table-printable td {
        color: #0f172a !important;
        border: 1px solid #cbd5e1 !important;
        font-size: 8.5pt !important;
        padding: 6px 8px !important;
    }

    .table-printable tfoot tr {
        background-color: #e2e8f0 !important;
        color: #0f172a !important;
        font-weight: bold !important;
    }

    .badge {
        border: 1px solid #cbd5e1 !important;
        color: #0f172a !important;
        background: #f8fafc !important;
        font-size: 7.5pt !important;
        padding: 2px 5px !important;
    }

    .badge.bg-success {
        background-color: #dcfce7 !important;
        color: #166534 !important;
    }

    .badge.bg-info {
        background-color: #e0f2fe !important;
        color: #075985 !important;
    }

    code {
        color: #0f172a !important;
        font-weight: bold;
    }

    .printable-row {
        page-break-inside: avoid !important;
    }
}
