
:root {
    --color-primario: #0e2a47;
    --color-secundario: #163b63;
    --color-fondo: #eef2f6;
    --ancho-sidebar: 260px;
    --ancho-sidebar-mini: 70px;
}

body {
    background-color: var(--color-fondo);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* === MEJORA DE CONTROLES (CHECKBOX & RADIO) === */
.form-check-input {
    width: 1.4em;   /* Más grande */
    height: 1.4em;  /* Más grande */
    border: 2px solid #6c757d; /* Borde más oscuro y visible */
    cursor: pointer;
    margin-top: 0.1em; /* Ajuste de alineación */
}

.form-check-input:checked {
    background-color: var(--color-primario);
    border-color: var(--color-primario);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(14, 42, 71, 0.25); /* Sombra azul al enfocar */
    border-color: var(--color-primario);
}

.form-switch .form-check-input {
    width: 2.5em; /* Switch más ancho */
    border-radius: 2em;
}

.form-check-label {
    padding-left: 0.5rem;
    padding-top: 2px;
    cursor: pointer;
    font-weight: 500; /* Texto un poco más grueso */
    color: #333;
}

/* === SIDEBAR === */
.sidebar {
    width: var(--ancho-sidebar);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--color-primario);
    color: #fff;
    z-index: 1000;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    box-shadow: 3px 0 10px rgba(0,0,0,0.1);
}

.form-control, .form-select, .input-group-text, .btn-outline-secondary { 
    border: 1px solid #888 !important; 
}
.form-control:focus, .form-select:focus { 
    border-color: #0d6efd !important; 
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25); 
}
.form-control:disabled, .form-control[readonly] { 
    background-color: #e9ecef; 
    border-color: #adb5bd !important; 
    color: #495057; 
}
.table-bordered { 
    border-color: #dee2e6;
}

.sidebar a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    border-left: 4px solid transparent;
    transition: 0.2s;
}

.sidebar a:hover {
    background-color: var(--color-secundario);
    color: #fff;
    border-left-color: #fff;
}

.sidebar i {
    min-width: 30px;
    font-size: 1.2rem;
    text-align: center;
}

.sidebar-text {
    margin-left: 10px;
    opacity: 1;
    transition: opacity 0.2s;
}

.sidebar hr {
    border-color: rgba(255,255,255,0.2);
    margin: 10px 0;
}

/* === NAVBAR SUPERIOR === */
.top-navbar {
    background-color: #fff;
    padding: 10px 20px;
    margin: -20px -20px 20px -20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1100; 
}

.btn-toggle {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--color-primario);
    cursor: pointer;
    padding: 5px;
}

/* === CONTENIDO PRINCIPAL === */
.content {
    margin-left: var(--ancho-sidebar);
    padding: 20px;
    transition: all 0.3s ease;
}

/* === LÓGICA DESKTOP (Mini Sidebar) === */
@media (min-width: 769px) {
    body.sb-collapsed .sidebar {
        width: var(--ancho-sidebar-mini);
    }
    body.sb-collapsed .sidebar-text,
    body.sb-collapsed .sidebar-header-text {
        opacity: 0;
        display: none;
    }
    body.sb-collapsed .sidebar .mt-auto {
        text-align: center;
    }
    body.sb-collapsed .content {
        margin-left: var(--ancho-sidebar-mini);
    }
}

/* === LÓGICA MÓVIL === */
@media (max-width: 768px) {
    .sidebar {
        left: calc(var(--ancho-sidebar) * -1); 
        z-index: 1050;
    }
    .content { margin-left: 0; }
    body.sb-mobile-open .sidebar {
        left: 0;
        z-index: 1050;
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    }
    body.sb-mobile-open::before {
        content: '';
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        backdrop-filter: blur(2px);
    }
}

/* Utilidades */
.to-upper { text-transform: uppercase; }
.card { border: none; box-shadow: 0 4px 6px rgba(0,0,0,0.05); border-radius: 8px; }
.card-header { background-color: var(--color-primario); color: white; border-radius: 8px 8px 0 0 !important; font-weight: 600; }
