/* ========================================
   VARIABLES GLOBALES
   ======================================== */
:root {
    --primary-color: #e43716;
    --secondary-color: #f3960e;
    --success-color: #198754;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-color: #f8f9fc;
    --dark-color: #010102;
    --gray-color: #6c757d;
    --main-gradient: linear-gradient(180deg, var(--primary-color) 10%, var(--secondary-color) 100%);
}


/* ========================================
   ESTILOS BÁSICOS
   ======================================== */
body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--light-color);
}

/* ========================================
   NAVEGACIÓN Y SIDEBAR
   ======================================== */
/* Sidebar */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    background-color: #1a1a1a;
    transition: all 0.2s ease;
    z-index: 1000;
    overflow-y: auto;
    height:100%;
}

#sidebar.collapsed {
    width: 85px;
}

#sidebar.collapsed:hover {
    width: 250px;
}

#sidebar .logo-container {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#sidebar .logo-container img {
    height: 40px;
}

#sidebar .nav-item {
    padding: 0.5rem 1rem;
}

#sidebar ul.flex-column {
    height: calc(100% - 100px);
    flex-wrap: nowrap;
}

#sidebar .nav-item:last-child {
    margin-top: auto;
}

#sidebar .nav-link {
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.35rem;
    transition: all 0.3s;
    white-space: wrap;
    line-height: 22px;
    position: relative;
}

#sidebar .nav-link:hover {
    background-color: var(--secondary-color);
    color: #fff;
}

#sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: #fff;
}

#sidebar .nav-icon {
    width: 24px;
    text-align: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

#sidebar .nav-link .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

#sidebar.collapsed .nav-text {
    display: none;
}

#sidebar.collapsed:hover .nav-text {
    display: inline;
}

#sidebar.collapsed .badge {
    display: none;
}

#sidebar.collapsed:hover .badge {
    display: inline;
}

/* Estilos específicos para el botón de logout en el sidebar */
#sidebar .logout-btn {
    color: #fff !important;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.35rem;
    transition: all 0.3s;
    white-space: nowrap;
    line-height: 16px;
    position: relative;
    cursor: pointer;
}

#sidebar .logout-btn:hover {
    background-color: var(--secondary-color) !important;
    color: #fff !important;
}

#sidebar .logout-btn:focus {
    outline: none;
    box-shadow: none;
    background-color: var(--secondary-color) !important;
    color: #fff !important;
}

/* Widget del Sidebar */
.nav-widget {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 0.35rem;
    padding: 0.75rem;
    margin: 0 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-widget-title {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.nav-widget-content .btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
}

.recent-companies {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.recent-companies a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    transition: color 0.2s;
}

.recent-companies a:hover {
    color: var(--secondary-color);
}

#sidebar.collapsed .nav-widget {
    display: none;
}

#sidebar.collapsed:hover .nav-widget {
    display: block;
}

/* Top Navigation */
.top-nav {
    background-color: #fff;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    padding: 0.5rem 1rem;
    position: relative;
    z-index: 999;
}

.navbar {
    padding: 0.5rem 1rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}


/* Main Content */
#main-content {
    margin-left: 250px;
    transition: all 0.2s ease;
    min-height: 100vh;
    /* Prueba para que el footer esté pegado al final de la página */
    display: flex;
    flex-direction: column;
}

/* Prueba para que el footer esté pegado al final de la página */
footer.mt-5 {
    margin-top: auto !important;
}

#main-content.expanded {
    margin-left: 80px;
}

.container-fluid, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
    padding-left: 0;
    padding-right: 0;
}

/* ========================================
   COMPONENTES UI
   ======================================== */
/* Cards y Contenedores */
.card {
    border: none;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    max-height: 100vh;
    overflow: hidden;
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid #e3e6f0;
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.card-body {
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

/* Headers y títulos */
.font-weight-bold {
    font-weight: 700 !important;
}
.text-gray-800 {
    color: var(--dark-color) !important;
}

/* Secciones con estilo hero */
.hero-section {
    background: var(--main-gradient);
}

/* ========================================
   ESTILOS DE FLEX-BOX
   ======================================== */
.flex-g10 {
    display: flex;
    gap: 10px;
    align-items: center;
}

.flex-g20 {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* ========================================
   ESTILOS DE FLEX-BOX
   ======================================== */
.info-box-content {
    line-height: normal;
}


/* ========================================
   MENÚ DE ADMINISTRACIÓN
   ======================================== */
/*.admin-menu {
    background-color: white;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    z-index: 100;
}

.admin-menu .nav-item {
    text-align: center;
    padding: 0.5rem 0;
}

.admin-menu .nav-link {
    color: var(--dark-color);
    padding: 0.5rem;
    transition: all 0.3s;
    border-radius: 0.35rem;
}

.admin-menu .nav-link:hover {
    background-color: var(--light-color);
    color: var(--secondary-color);
}

.admin-menu .nav-link.active {
    background-color: var(--light-color);
    color: var(--primary-color);
    font-weight: 500;
}

.admin-menu .nav-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.25rem;
    color: var(--dark-color);
    transition: all 0.3s;
}

.admin-menu .nav-link:hover .nav-icon {
    color: var(--secondary-color);
}

.admin-menu .nav-link.active .nav-icon {
    color: var(--primary-color);
} */

/* ========================================
   ESTILOS DE TARJETAS
   ======================================== */
/* Bordes de cards */
.border-left-primary {
    border-left: 0.25rem solid var(--primary-color) !important;
}

.border-left-secondary {
    border-left: 0.25rem solid var(--secondary-color) !important;
}

.border-left-success {
    border-left: 0.25rem solid var(--success-color) !important;
}

.border-left-info {
    border-left: 0.25rem solid var(--info-color) !important;
}

.border-left-warning {
    border-left: 0.25rem solid var(--warning-color) !important;
}

.border-left-danger {
    border-left: 0.25rem solid var(--danger-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* ========================================
   FONDOS Y COLORES
   ======================================== */
/* Fondos */
.bg-primary {
    background-color: var(--primary-color) !important;
}

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

.bg-gray {
    background-color: var(--gray-color) !important;
}

.bg-gradient-primary {
    background: var(--main-gradient) !important;
}

/* Textos */
.text-primary {
    color: var(--primary-color) !important;
}

/* ========================================
   BOTONES Y CONTROLES
   ======================================== */
/* Botones generales */
.btn {
    border-radius: 0.35rem;
    padding: 0.375rem 0.75rem;
    font-weight: 400;
    box-shadow: 0 0.125rem 0.25rem 0 rgba(58, 59, 69, 0.2);
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem 0 rgba(58, 59, 69, 0.3);
}

.btn-block {
    width: 100%;
    /* min-height: 80px; */
    max-height: 120px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 5px;
}

/* Botones de color */
/* .btn-danger {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
} */

.btn-info, .btn-success, .btn-warning, .btn-danger {
    color: var(--light-color);
}

.btn-info:hover, .btn-success:hover, .btn-warning:hover, .btn-danger:hover {
    color: var(--light-color);
}

/* Botones primarios */
.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Botones outline */
.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

/* Botones border-radius (ajuste para el grupo de botones en algunas vistas, cuando se usa el botón de eliminar dentro de un form) */
.btn-group>form>:not(.btn-check)+.btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
} 

/* ========================================
   ELEMENTOS INTERACTIVOS
   ======================================== */
/* Links */
.link-primary {
    color: var(--primary-color);
    text-decoration: none;
}

.link-primary:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Badges */
.badge-primary {
    background-color: var(--primary-color);
}

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

/* Elementos de formulario */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(228, 55, 22, 0.25);
}

.form-group {
    margin-bottom: 0.5rem;
}

.form-control {
    /* margin-bottom: 1rem; */
}

.form-label, .form-group label {
    margin-bottom: 0.2rem;
}

.form-control[type="date"] {
    width: fit-content;
}


.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Elementos de progreso */
.progress-bar {
    background-color: var(--primary-color);
}

/* Tablas */
.table th {
    font-weight: 500;
}

/* ========================================
   OTROS
   ======================================== */
.rounded-circle {
    aspect-ratio: 1/1;
}



/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
    }

    #sidebar.show {
        transform: translateX(0);
    }

    #main-content {
        margin-left: 0;
    }

    #main-content.expanded {
        margin-left: 0;
    }
} 

/* Tarjetas de estadísticas específicas */
.card.border-left-primary,
.card.border-left-success,
.card.border-left-info,
.card.border-left-warning,
.card.border-left-secondary,
.card.border-left-danger {
    min-height: 120px;
    max-height: 200px;
}

/* Gráficos */
#riskChart {
    max-height: 250px;
}

/* Tablas responsivas */
.table-responsive {
    max-height: 400px;
    overflow-y: auto;
}

/* Prevenir overflow en contenedores flex */
.d-flex {
    min-height: 0;
}

.flex-column {
    min-height: 0;
}

/* Limitar altura de progress bars */
.progress {
    height: 12px !important;
    max-height: 12px;
    font-size: 0.65rem;
}

/* Reglas específicas para el dashboard del cliente */
.container-fluid .row .card {
    max-height: 800px;
    overflow: hidden;
}

.container-fluid .row .card-body {
    max-height: 700px;
    overflow-y: auto;
}

/* Prevenir que las tarjetas de estadísticas crezcan infinitamente */
.card.border-left-primary .card-body,
.card.border-left-success .card-body,
.card.border-left-info .card-body,
.card.border-left-warning .card-body {
    height: auto;
    max-height: 150px;
    overflow: hidden;
}

/* Gráfico de Chart.js */
.card-body canvas {
    max-height: 200px !important;
    height: 200px !important;
}

/* Tablas en el dashboard */
.card-body .table-responsive {
    max-height: 460px;
    overflow-y: auto;
}

/* Prevenir flex grow infinito */
.row .col-xl-3,
.row .col-lg-4,
.row .col-lg-6 {
    flex: 0 0 auto;
}

