/* ===== ESTILOS PARA JSPREADSHEET ===== */

/* Estilos para ocultar columnas de precios sin desplazamiento */
.hide-price-columns {
    position: relative;
}

.hide-price-columns table {
    table-layout: fixed !important;
    width: 100% !important;
}

/* Solo ocultar celdas de datos (tbody), no encabezados (thead) */
.hide-price-columns tbody td:nth-child(6),
.hide-price-columns tbody td:nth-child(7) {
    visibility: hidden !important;
    width: 0px !important;
    padding: 0px !important;
    border: none !important;
    overflow: hidden !important;
    max-width: 0px !important;
    min-width: 0px !important;
}

/* Prevenir scroll horizontal innecesario */
.jexcel_content {
    overflow-x: hidden !important;
}

/* Ajustar anchos de columnas visibles para mejor distribución */
.hide-price-columns td:nth-child(2) { width: 30% !important; } /* Descripción */
.hide-price-columns td:nth-child(3) { width: 15% !important; } /* Unidad */
.hide-price-columns td:nth-child(4) { width: 15% !important; } /* Cantidad */
.hide-price-columns td:nth-child(5) { width: 40% !important; } /* Restante para otras columnas */

/* ===== ESTILOS DEL PANEL ADMINISTRATIVO - ESTRUCTURAS J&E ===== */

/* ===== ESTILOS GENERALES ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
}

/* ===== ESTILOS DE LOGIN ===== */
body.login-page {
    background: linear-gradient(135deg, #044484 0%, #1c548c 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
}

.login-header {
    background: #ffffff;
    color: #2c3e50;
    padding: 30px;
    text-align: center;
    border-bottom: 2px solid #044484;
}

.login-body {
    padding: 40px;
}

.login-page .form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.login-page .form-control:focus {
    border-color: #044484;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.btn-login {
    background: linear-gradient(135deg, #044484 0%, #1c548c 100%);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.login-page .input-group-text {
    background: transparent;
    border: 2px solid #e9ecef;
    border-right: none;
}

.login-page .input-group .form-control {
    border-left: none;
}

/* ===== ESTILOS DEL SIDEBAR ===== */
.sidebar {
    background: #fff;
    min-height: 100vh;
    color: white;
}

.sidebar .nav-link {
    color: #000;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 2px 0;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: #34495e;
    color: white;
}

/* ===== ESTILOS DEL CONTENIDO PRINCIPAL ===== */
.main-content {
    background: #f8f9fa;
    min-height: 100vh;
}

.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ===== ESTILOS DE TARJETAS ===== */
.card-stats {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.card-stats:hover {
    transform: translateY(-5px);
}

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

/* ===== GRADIENTES DE FONDO ===== */
.bg-primary-gradient {
    background: linear-gradient(135deg, #044484 0%, #1c548c 100%);
}

.bg-success-gradient {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.bg-warning-gradient {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.bg-info-gradient {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* ===== ESTILOS DE TABLAS ===== */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* ===== ESTILOS DE CONFIGURACIÓN ===== */
.config-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

/* ===== ESTILOS DE MODALES ===== */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    background: #2c3e50;
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* ===== ESTILOS DE FORMULARIOS ===== */
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #044484;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    color: #2c3e50;
}

/* ===== ESTILOS DE BOTONES ===== */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #044484 0%, #1c548c 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border: none;
}

/* ===== ESTILOS DE ALERTAS ===== */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ===== ESTILOS DE BADGES ===== */
.badge {
    border-radius: 20px;
    font-weight: 600;
}

/* ===== ESTILOS DE NAVEGACIÓN ===== */
.navbar-text {
    color: #2c3e50;
    font-weight: 600;
}

/* ===== ESTILOS RESPONSIVOS ===== */

/* Botón hamburguesa */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #2c3e50;
    cursor: pointer;
    padding: 0.5rem;
}

/* Overlay para cerrar sidebar en móvil */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* Estilos para tablas scrolleables */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
    max-width: 100%;
    overflow-x: auto;
}

.table-responsive table {
    min-width: 800px; /* Ancho mínimo para mantener legibilidad */
}

/* Modales más pequeños verticalmente */
.modal-dialog {
    max-height: 90vh;
}

.modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-body {
    max-height: 70vh !important;
    overflow-y: auto;
    flex: 1;
}

/* Responsivo para tablets */
@media (max-width: 992px) {
    .sidebar {
        width: 200px;
    }
    
    .sidebar .nav-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .main-content {
        padding-left: 0;
    }
}

/* Responsivo para móviles */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -250px;
        width: 250px;
        z-index: 1000;
        transition: left 0.3s ease;
        height: 100vh;
        overflow-y: auto;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .navbar {
        padding-left: 1rem;
    }
    
    .login-container {
        margin: 20px;
        max-width: 100%;
    }
    
    /* Ajustes para cards en móvil */
    .card-stats {
        margin-bottom: 1rem;
    }
    
    /* Ajustes para modales en móvil */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
        max-height: 95vh;
    }
    
    .modal-body {
        max-height: 60vh !important;
        padding: 1rem;
    }
    
    /* Ajustes para formularios en móvil */
    .row .col-md-6,
    .row .col-md-4,
    .row .col-md-3 {
        margin-bottom: 1rem;
    }
    
    /* Botones más grandes en móvil */
    .btn-action {
        padding: 0.375rem 0.75rem;
        margin: 0.125rem;
    }
}

/* Responsivo para móviles pequeños */
@media (max-width: 576px) {
    .sidebar {
        width: 280px;
        left: -280px;
    }
    
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }
    
    .modal-body {
        max-height: 55vh !important;
        padding: 0.75rem;
    }
    
    .table-responsive table {
        min-width: 600px;
        font-size: 0.875rem;
    }
    
    .btn-action {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Stack de botones en móvil pequeño */
    .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
}

/* Sidebar solo iconos para pantallas medianas */
@media (min-width: 769px) and (max-width: 991px) {
    .sidebar {
        width: 80px;
    }
    
    .sidebar .nav-link {
        text-align: center;
        padding: 15px 10px;
    }
    
    .sidebar .nav-link span {
        display: none;
    }
    
    .sidebar h4 {
        font-size: 1rem;
        text-align: center;
    }
    
    .main-content {
        margin-left: 80px;
    }
}

/* ===== ESTILOS DE ANIMACIONES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== ESTILOS DE UTILIDAD ===== */
.shadow-custom {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.rounded-custom {
    border-radius: 15px;
}

.text-gradient {
    background: linear-gradient(135deg, #044484 0%, #1c548c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== ESTILOS PARA ELIMINACIÓN DE IMÁGENES ===== */
.image-container {
    position: relative;
    display: inline-block;
}

.image-container .delete-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    border-radius: 0.375rem;
}

.image-container:hover .delete-overlay {
    opacity: 1;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.3);
}

.delete-btn:hover {
    background: #c82333;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.5);
}

.delete-btn i {
    font-size: 16px;
}