:root {
    --bg-dark: #0f172a;
    --bg-sidebar: #1e293b;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
}

/* 1. Estilos Globales */
html, body {
    background-color: var(--bg-dark) !important;
    color: var(--text-main) !important;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* 2. Layout (Sidebar + Content) */
#wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

#sidebar-wrapper {
    height: 100vh;
    width: 260px;
    background-color: #1e293b !important; /* Valor directo para asegurar */
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
}

#page-content-wrapper {
    margin-left: 260px;
    width: calc(100% - 260px);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Responsive Sidebar */
@media (max-width: 991.98px) {
    #sidebar-wrapper {
        margin-left: -260px;
    }
    #page-content-wrapper {
        margin-left: 0;
        width: 100%;
    }
    #sidebar-wrapper.toggled {
        margin-left: 0;
    }
}

/* Mobile adjustments */
@media (max-width: 576px) {
    .p-4 {
        padding: 1.5rem !important;
    }
    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .d-flex.justify-content-between .btn {
        width: 100%;
        margin-top: 1rem;
    }
}

/* 3. Sidebar Items */
.sidebar-heading {
    padding: 1.5rem 1.5rem;
    background: rgba(0,0,0,0.2) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#sidebar-wrapper .list-group-item {
    background-color: transparent !important;
    color: var(--text-dim) !important;
    border: none;
    padding: 1rem 1.5rem;
    margin: 5px 12px;
    border-radius: 10px;
    transition: 0.3s all;
}

#sidebar-wrapper .list-group-item:hover {
    color: var(--accent-cyan) !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
}

#sidebar-wrapper .list-group-item.active {
    background-color: var(--accent-blue) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* 4. Glass Cards & Footer */
.glass-card {
    background: var(--bg-sidebar);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem;
}

footer .glass-card {
    margin-bottom: 1rem;
}

/* 5. Tablas & DataTables (Corregido con bordes) */
.table-responsive {
    border-radius: 12px;
    overflow-x: auto !important; /* Permitir scroll horizontal */
    -webkit-overflow-scrolling: touch;
}

/* Ocultar columnas menos importantes en móviles muy pequeños */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

.table {
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--text-main) !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin-bottom: 0 !important;
}

/* Bordes para las celdas */
.table td {
    padding: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    background-color: transparent !important;
}

/* El bordecito suave del encabezado */
.table thead th {
    background-color: rgba(0, 0, 0, 0.2) !important;
    color: var(--accent-cyan) !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 1.2rem;
    border-bottom: 2px solid rgba(6, 182, 212, 0.2) !important; /* Borde cyan muy suave */
}

/* Efecto hover para las filas para que resalten al pasar el mouse */
.table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02) !important;
    transition: background-color 0.3s ease;
}

/* Quitar borde a la última fila */
.table tbody tr:last-child td {
    border-bottom: none !important;
}

.dataTables_info { color: #888 !important; font-size: 0.85rem; padding-top: 15px; }

/* Custom DataTables Responsive Fixes */
.dataTables_wrapper .dataTables_length, 
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

@media (max-width: 576px) {
    .dataTables_wrapper .dataTables_length, 
    .dataTables_wrapper .dataTables_filter {
        text-align: center !important;
        float: none !important;
        width: 100%;
    }
    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 0.5rem;
    }
    .table td, .table th {
        padding: 0.8rem !important;
        font-size: 0.85rem;
    }
}

/* 6. Modales */
.modal-content {
    background-color: var(--bg-sidebar) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px !important;
    color: white !important;
}

.modal-header, .modal-footer {
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.modal-title {
    color: var(--accent-cyan) !important;
}

/* 7. Form Inputs */
.glass-input {
    background-color: var(--bg-dark) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
}

.glass-input:focus {
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2) !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* 8. Botones & Colores */
.btn-primary {
    background: var(--accent-blue) !important;
    border: none !important;
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--accent-cyan) !important;
    transform: translateY(-1px);
}

.text-cyan { color: var(--accent-cyan) !important; }
.text-dim { color: var(--text-dim) !important; }