/* SISTEMA DE INSUMOS - TEMA PERSONALIZADO */

:root {
    --color-terracota: #da8359;
    --color-sage: #a5b68d;
    --color-beige: #ecdfcc;
    --color-terracota-dark: #c26d42;
    --color-sage-dark: #8fa073;
    --color-beige-dark: #d4c4a8;
}

/* === COLORES DE FONDO === */
.bg-custom-terracota { background-color: var(--color-terracota) !important; }
.bg-custom-sage { background-color: var(--color-sage) !important; }
.bg-custom-beige { background-color: var(--color-beige) !important; }

/* === NAVBAR Y BRAND === */
.navbar-custom-sage {
    background-color: var(--color-sage) !important;
    border-bottom: 2px solid var(--color-sage-dark);
}

.navbar-custom-sage .navbar-nav .nav-link {
    color: white !important;
}

.brand-link.bg-custom-sage {
    background-color: var(--color-sage) !important;
    border-bottom: 1px solid var(--color-sage-dark);
}

/* === SIDEBAR === */
.sidebar-light-custom {
    background: linear-gradient(180deg, var(--color-beige) 0%, #f5f2ed 100%) !important;
    border-right: 1px solid var(--color-sage) !important;
}

.sidebar-light-custom .nav-sidebar > .nav-item > .nav-link {
    color: #4a4a4a !important;
    border-radius: 10px;
    margin: 3px 6px;
    padding: 10px 15px;
    text-align: left;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-light-custom .nav-sidebar > .nav-item > .nav-link .nav-icon {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-light-custom .nav-sidebar > .nav-item > .nav-link:hover {
    background: linear-gradient(135deg, var(--color-sage) 0%, #8fa073 100%) !important;
    color: white !important;
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(165, 182, 141, 0.3);
    border-left: 3px solid white;
}

.sidebar-light-custom .nav-sidebar > .nav-item > .nav-link.active {
    background: linear-gradient(135deg, var(--color-terracota) 0%, #c26d42 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(218, 131, 89, 0.4);
    border-left: 3px solid white;
    font-weight: 600;
}

/* === CONTENT WRAPPER === */
.content-wrapper.bg-custom-beige {
    background-color: var(--color-beige) !important;
}

/* === BOTONES === */
.btn-primary {
    background-color: var(--color-terracota) !important;
    border-color: var(--color-terracota) !important;
    color: white !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--color-terracota-dark) !important;
    border-color: var(--color-terracota-dark) !important;
    color: white !important;
}

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

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

/* === CARDS === */
.card {
    background-color: white !important;
    border: 1px solid var(--color-sage) !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(165, 182, 141, 0.15) !important;
}

.card-header {
    background-color: var(--color-sage) !important;
    color: white !important;
    border-bottom: 1px solid var(--color-sage-dark) !important;
    border-radius: 10px 10px 0 0 !important;
}

.card-header .card-title {
    color: white !important;
    font-weight: 600;
}

/* === TÍTULOS === */
.content-header h1 {
    color: var(--color-sage) !important;
    font-weight: 700;
}

/* === SMALL BOXES === */
.small-box {
    border-radius: 10px !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

.small-box.bg-info {
    background-color: var(--color-sage) !important;
}

.small-box.bg-success {
    background-color: var(--color-terracota) !important;
}

.small-box.bg-primary {
    background-color: var(--color-sage) !important;
}

.small-box.bg-warning {
    background-color: #f39c12 !important;
}

/* === BADGES === */
.badge-primary {
    background-color: var(--color-terracota) !important;
}

.badge-info {
    background-color: var(--color-sage) !important;
}

/* === TABLAS === */
.table {
    background-color: white !important;
}

.table thead th {
    background-color: var(--color-sage) !important;
    color: white !important;
    border-color: var(--color-sage-dark) !important;
}

/* === FORMULARIOS === */
.form-control:focus {
    border-color: var(--color-sage) !important;
    box-shadow: 0 0 0 0.2rem rgba(165, 182, 141, 0.25) !important;
}

/* === DATATABLES === */
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--color-sage) !important;
    color: white !important;
    border: 1px solid var(--color-sage) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--color-beige) !important;
    color: #333 !important;
    border: 1px solid var(--color-terracota) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid #ddd !important;
    color: #333 !important;
}

/* Paginación Bootstrap */
.page-item.active .page-link {
    background-color: var(--color-sage) !important;
    border-color: var(--color-sage) !important;
}

.page-link {
    color: var(--color-sage) !important;
    background-color: white !important;
}

.page-link:hover {
    color: var(--color-terracota) !important;
    background-color: var(--color-beige) !important;
    border-color: var(--color-terracota) !important;
}

/* Fondo del área de paginación */
.dataTables_wrapper .dataTables_paginate {
    background-color: transparent !important;
}

.dataTables_wrapper .dataTables_info {
    color: #666 !important;
}

/* === SWEETALERT2 === */
.swal2-popup {
    border: 2px solid var(--color-sage) !important;
}

.swal2-confirm {
    background-color: var(--color-terracota) !important;
}

/* === SIDEBAR SUBMENU === */
.sidebar-light-custom .nav-treeview > .nav-item > .nav-link {
    color: #5a5a5a !important;
    padding: 8px 15px 8px 45px;
    margin: 2px 8px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
}

.sidebar-light-custom .nav-treeview > .nav-item > .nav-link:hover {
    background: linear-gradient(135deg, rgba(165, 182, 141, 0.8) 0%, rgba(143, 160, 115, 0.8) 100%) !important;
    color: white !important;
    transform: translateX(3px);
    border-left: 2px solid white;
}

.sidebar-light-custom .nav-treeview > .nav-item > .nav-link.active {
    background: linear-gradient(135deg, rgba(218, 131, 89, 0.9) 0%, rgba(194, 109, 66, 0.9) 100%) !important;
    color: white !important;
    border-left: 2px solid white;
    font-weight: 500;
}

/* === BRAND LOGO === */
.brand-link {
    padding: 12px 20px !important;
    background: linear-gradient(135deg, var(--color-sage) 0%, #8fa073 100%) !important;
    border-bottom: 2px solid var(--color-sage-dark) !important;
    transition: all 0.3s ease;
}

.brand-link:hover {
    background: linear-gradient(135deg, #8fa073 0%, var(--color-sage) 100%) !important;
    transform: none !important;
}

.brand-text {
    font-weight: 700 !important;
    margin-left: 10px !important;
    font-size: 1.1rem !important;
    letter-spacing: 0.5px !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .card {
        margin-bottom: 20px;
    }
    
    .sidebar-light-custom .nav-sidebar > .nav-item > .nav-link {
        margin: 2px 2px;
        padding: 8px 10px;
    }
}

/* === ANIMACIONES === */
.btn, .card, .small-box {
    transition: all 0.3s ease !important;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* === EFECTOS ADICIONALES SIDEBAR === */
.sidebar-light-custom .nav-sidebar > .nav-item > .nav-link .nav-icon {
    transition: all 0.3s ease;
}

.sidebar-light-custom .nav-sidebar > .nav-item > .nav-link:hover .nav-icon {
    transform: scale(1.1);
}

.sidebar-light-custom .nav-sidebar > .nav-item > .nav-link.active .nav-icon {
    transform: scale(1.1);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Línea divisoria sutil entre items */
.sidebar-light-custom .nav-sidebar > .nav-item:not(:last-child) {
    border-bottom: 1px solid rgba(165, 182, 141, 0.1);
    margin-bottom: 2px;
    padding-bottom: 2px;
}

/* Efecto de focus para accesibilidad */
.sidebar-light-custom .nav-sidebar > .nav-item > .nav-link:focus {
    outline: 2px solid var(--color-terracota);
    outline-offset: 2px;
}

/* === DATATABLES RESPONSIVE - ANCHO COMPLETO === */
/* Asegurar que las tablas usen todo el ancho disponible */
.dataTables_wrapper {
    width: 100% !important;
}

.dataTables_wrapper table.dataTable {
    width: 100% !important;
    table-layout: auto !important;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Contenedor de la tabla */
.dataTables_scroll {
    width: 100% !important;
}

.dataTables_scrollHead, 
.dataTables_scrollBody {
    width: 100% !important;
}

/* Ajustes para móviles */
@media (max-width: 768px) {
    /* Stack de controles en móvil */
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length {
        float: none !important;
        text-align: left !important;
        margin-bottom: 10px;
        width: 100%;
    }
    
    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        display: block;
        margin-top: 5px;
    }
    
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        text-align: center !important;
        margin-top: 10px;
        width: 100%;
    }
    
    /* Hacer las tablas scrollables horizontalmente en móvil */
    .table-responsive {
        border: 1px solid var(--color-beige-dark);
        border-radius: 4px;
        margin-bottom: 10px;
    }
    
    /* Prevenir wrap en celdas para mejor scrolling horizontal */
    .dataTables_wrapper table th,
    .dataTables_wrapper table td {
        white-space: nowrap;
        padding: 8px 5px !important;
    }
    
    /* Botones de paginación más grandes en móvil */
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 8px 12px !important;
        margin: 2px !important;
    }
}

/* Tablets y escritorio */
@media (min-width: 769px) {
    .dataTables_wrapper .dataTables_filter {
        text-align: left !important;
    }
    
    /* En escritorio, permitir que las celdas se ajusten */
    .dataTables_wrapper table th,
    .dataTables_wrapper table td {
        white-space: normal;
        word-wrap: break-word;
    }
}

/* Ajustes específicos para vista horizontal (consulta-solicitudes) */
#proveedores-table {
    min-width: 100%;
}

#proveedores-table th,
#proveedores-table td {
    vertical-align: middle;
}

/* Cards y contenedores */
.card-body {
    padding: 15px;
    overflow-x: auto;
}

/* Asegurar que el contenido use todo el ancho */
.content-wrapper > .content {
    width: 100%;
    padding: 15px;
}

@media (min-width: 1200px) {
    .content-wrapper > .content {
        padding: 20px 30px;
    }
}