/* /v2/assets/css/custom.css */

:root {
    --sidebar-width: 260px;
    --navbar-height: 60px;
}

body {
    background-color: #f4f7f6; /* Un gris muy claro para el fondo */
}

.container {
    max-width: 100%;
    margin: auto;
    overflow-x: hidden;
    margin-bottom: 50px;
}

/* --- Barra Lateral (Sidebar) --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1020;
    background-color: #ffffff;
    border-right: 1px solid #dee2e6;
    transition: margin-left 0.35s ease-in-out;
    padding-top: var(--navbar-height); /* Espacio para la navbar fija */
}

.sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    font-weight: bold;
    border-bottom: 1px solid #dee2e6;
}

.sidebar .nav-link {
    color: #343a40;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 0;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
}

.sidebar .nav-link.active {
    background-color: #0d6efd;
    color: #fff;
    font-weight: bold;
}

/* --- Contenido Principal --- */
.content {
    margin-left: var(--sidebar-width);
    padding-top: var(--navbar-height); /* Espacio para la navbar fija */
    transition: margin-left 0.35s ease-in-out;
    width: calc(100% - var(--sidebar-width));
}

.content.expanded {
    margin-left: 0;
    width: 100%;
}


/* --- Barra de Navegación Superior (Navbar) --- */
.navbar.fixed-top {
    z-index: 1021; /* Debe estar por encima del sidebar */
    height: var(--navbar-height);
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: #343a40;
    font-size: 1.25rem;
}

.sidebar-toggle-btn:hover {
    color: #0d6efd;
}

/* --- Diseño Responsivo --- */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 220px;
    }

    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width)); /* Oculta por defecto en móvil */
    }
    
    .sidebar.collapsed {
        margin-left: 0; /* Muestra cuando se presiona el botón */
    }

    .content {
        margin-left: 0;
        width: 100%;
    }
    
    .content.expanded {
        /* No aplica en móvil, el contenido siempre es 100% */
    }
}

/* --- Estilos para mejorar las tarjetas de contenido --- */
.card {
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    border: none;
}

/* --- Estilos unificados para tablas y acciones --- */
.table-modern thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #6c757d;
}

.table-modern tbody td {
    font-size: 0.9rem;
}

.table-modern .dropdown-toggle {
    font-weight: 600;
}

.table-modern .dropdown-menu {
    min-width: 220px;
}

.table-modern .dropdown-item i {
    width: 1.25rem;
}

.extra-payment-row {
    background-color: #fff8e1;
}

.extra-payment-row td {
    font-size: 0.85rem;
}

.badge {
    font-weight: 600;
}

.modal .form-text {
    font-size: 0.85rem;
}


/* --- Estilos para la Tabla con Cabecera Fija (Sticky) --- */
.table-sticky-header {
    max-height: 90vh; /* Altura máxima de la tabla, ajusta según necesites */
    overflow-y: auto; /* Activa el scroll vertical */
    position: relative;
}

.table-sticky-header thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8f9fa; /* Color de fondo para que no se transparente */
    box-shadow: inset 0 -2px 0 #dee2e6; /* Línea inferior sutil */
}


/* --- Estilos para el Interruptor tipo Píldora --- */
.pill-switch .form-check-input {
    background-color: #6c757d;
    border-color: #6c757d;
    width: 3.5em;
    height: 1.75em;
    cursor: pointer;
}

.pill-switch .form-check-input:checked {
    background-color: #198754; /* Verde de éxito */
    border-color: #198754;
}

.pill-switch .form-check-label {
    cursor: pointer;
}
