body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    text-align: center;
    background-color: #f8f8f8;
}

#productos-container {
    margin-top: 100px; /* Espacio para el header negro */
    padding: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    padding: 15px;
    justify-items: center;
}

.producto-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 12px;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
    width: 100%;
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
}

.producto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.producto-imagen {
    position: relative;
    width: 100%;
    height: 200px;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
    cursor: pointer;
}

.producto-imagen img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.producto-card:hover .producto-imagen img {
    transform: scale(1.1);
}

.producto-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.producto-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #333;
}

.producto-info p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 0.9em;
    flex-grow: 1;
}

.producto-precio {
    font-size: 1.2em;
    font-weight: bold;
    color: #f04;
    margin: 10px 0;
}

.producto-stock {
    color: #666;
    font-size: 0.9em;
    margin: 5px 0;
}

.producto-cantidad {
    margin: 10px 0;
}

.producto-cantidad input {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
}

.producto-acciones {
    margin-top: 10px;
}

.producto-acciones button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background-color: #f04;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.producto-acciones button:hover {
    background-color: #d03;
}

@media (max-width: 768px) {
    #productos-container {
        margin-top: 80px;
        padding: 10px;
    }

    .producto-imagen {
        height: 180px;
    }

    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
        padding: 10px;
    }

    .producto-card {
        max-width: 220px;
        padding: 10px;
    }

    .producto-info h3 {
        font-size: 1em;
    }

    .producto-precio {
        font-size: 1.1em;
    }

    .imagen-modal-contenido {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .producto-card {
        max-width: 100%;
    }
    
    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

button {
    background-color: #f04;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
}

button:hover {
    background-color: #c03;
}

/* Product styles */
.producto {
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 15px;
    margin: 15px;
    width: 250px;
    display: inline-block;
    background: white;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.producto .precio {
    color: #d9534f;
    font-weight: bold;
    font-size: 18px;
}

.producto img {
    width: 220px;
    height: 200px;
    border-radius: 10px;
    border: 2px solid #ddd;
}

.producto input {
    width: 90px;
    height: 40px;
    font-size: 20px;
    text-align: center;
    border: 2px solid #f04;
    border-radius: 10px;
    margin-top: 10px;
    transition: all 0.3s ease-in-out;
    background-color: #fffbe0;
}

.producto input:focus {
    border-color: #d9534f;
    background-color: #ffefcc;
    outline: none;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px; /* Espacio para el header negro */
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    width: 300px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    position: relative;
    max-height: calc(100vh - 140px); /* Ajuste para evitar que se salga de la pantalla */
    overflow-y: auto;
}

.modal-content input, 
.modal-content select {
    width: 90%;
    padding: 10px;
    margin: 5px auto;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.close {
    float: right;
    cursor: pointer;
    font-size: 20px;
}

.resaltado {
    color: #008000;
    font-size: 24px;
}

/* User info styles */
#username {
    font-size: 15px;
    padding: 2px 5px;
    line-height: 1.1;
    margin: 0;
}

#username small {
    font-size: 17px;
    margin-top: 0;
    margin-bottom: 0;
    color: #00e676;
    animation: saldo-blink 1.5s linear infinite alternate;
}

@keyframes saldo-blink {
    0%, 80% {
        opacity: 1;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        opacity: 1;
    }
}

/* Order accordion styles */
.pedido {
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 10px 0;
    background: #f9f9f9;
    overflow: visible;
}

.pedido-header {
    background: transparent !important;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

.pedido-header:hover {
    background-color: #e9e9e9;
}

.pedido-header.active {
    background-color: #e1e1e1;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.pedido-contenido {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: #f9f9f9;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    position: relative;
    z-index: 1;
}

.pedido-contenido.abierto {
    max-height: 400px;
    overflow-y: auto;
}

/* Order item styles */
.pedido-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    align-items: center;
    position: relative;
    overflow: visible;
    z-index: 1;
}

.pedido-item:last-child {
    border-bottom: none;
}

.pedido-item-info {
    margin-left: 60px;
    transition: margin-left 0.3s ease;
    flex-grow: 1;
}

.pedido-item-precio {
    min-width: 80px;
    text-align: right;
}

.pedido-total {
    text-align: right;
    font-weight: bold;
    padding: 10px 0;
    color: #d9534f;
}

/* Status styles */
.estado-pendiente {
    color: #f0ad4e;
    font-weight: bold;
}

.estado-completado {
    color: #5cb85c;
    font-weight: bold;
}

.estado-cancelado {
    color: #d9534f;
    font-weight: bold;
}

/* Image zoom styles */
.img-container {
    display: inline-block;
    position: relative;
    z-index: auto;
}

.pedido-item-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 3px;
    transition: transform 0.3s ease, z-index 0.3s ease;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transform-origin: left center;
}

.pedido-item-img:hover {
    transform: translateY(-50%) scale(3.5);
    z-index: 1000;
    box-shadow: 0 0 15px rgba(0,0,0,0.4);
    border: 3px solid #fff;
    position: absolute;
    left: 0;
    top: 50%;
}

.pedido-item:hover .pedido-item-info {
    margin-left: 180px;
}

/* Tooltip styles */
.img-tooltip {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.img-container:hover .img-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Scrollbar styles */
.pedido-contenido.abierto::-webkit-scrollbar {
    width: 8px;
}

.pedido-contenido.abierto::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.pedido-contenido.abierto::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.pedido-contenido.abierto::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Modal de pedidos con scroll */
#pedidosModal .modal-content {
    max-height: 80vh;
    overflow-y: auto;
    width: 90%;
    max-width: 800px;
}

/* Contenedor de lista de pedidos */
#pedidosList {
    max-height: calc(80vh - 100px);
    overflow-y: auto;
}

/* Estilos para el scroll */
#pedidosList::-webkit-scrollbar {
    width: 8px;
}

#pedidosList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#pedidosList::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#pedidosList::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Ajustes para el header del modal */
#pedidosModal .modal-content h2 {
    position: sticky;
    top: 0;
    background: white;
    padding: 10px 0;
    margin: 0;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Filtros de pedidos */
.filtro-pedidos {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
    flex-wrap: wrap;
}

.filtro-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    background-color: #e0e0e0;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.filtro-btn:hover {
    background-color: #d0d0d0;
}

.filtro-btn.active {
    background-color: #f04;
    color: white;
}

/* Contenedor de lista con scroll */
#listaPedidosContainer {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 5px;
}

/* Loading spinner */
.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #f04;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 100;
    border-radius: 5px;
    overflow: hidden;
}

.menu-dropdown.show {
    display: block;
}

.menu-item {
    width: 100%;
    text-align: left;
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    color: #333;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.menu-item:hover {
    background-color: #f5f5f5;
    color: #f04;
}

/* Ajustar para móviles */
@media (max-width: 600px) {
    .menu-dropdown {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        width: 100%;
    }
}

/* Modal de saldo insuficiente */
#saldoInsuficienteModal .modal-content {
    max-width: 400px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

#contenidoSaldoInsuficiente {
    padding: 20px;
}

#saldoInsuficienteModal button {
    transition: all 0.2s;
    font-size: 15px;
}

#saldoInsuficienteModal button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    opacity: 0.9;
}

/* Añadir al final de styles.css */
#adminModal .modal-content {
    max-width: 90%;
    width: 800px;
    animation: fadeIn 0.3s;
}

#recargaModal .modal-content {
    max-width: 400px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Estilos para tablas */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f5f5f5;
    font-weight: bold;
}

tr:hover {
    background-color: #d3cbcb;
}

.trheader:hover {
    background-color: #000000;
}

/* Estilos para botones pequeños */
button.small {
    padding: 5px 10px;
    font-size: 12px;
    margin: 2px;
}

/* Estilos para selects en tablas */
table select {
    padding: 5px;
    border-radius: 3px;
    border: 1px solid #ddd;
    background-color: white;
}

/*********************  estilos hedaer */

 /* Reset y estilos base */
 * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.header-logo {
    max-width: 80px;
    max-height: 80px;
    transition: all 0.3s ease;
}

/* Contenedor del menú */
.menu-container {
    position: relative;
    display: inline-block;
    z-index: 1001;
}

/* Botón hamburguesa */
.hamburger-btn {
    background: #f04;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    color: #fff;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.hamburger-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Menú desplegable */
.menu-dropdown {
    display: none;
    position: fixed;
    top: 60px;
    right: 0;
    width: 70%;
    max-width: 300px;
    height: calc(100vh - 60px);
    background-color: #222;
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    z-index: 1002;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.menu-dropdown.show {
    display: block;
    transform: translateX(0);
}

/* Items del menú */
.menu-item {
    width: 100%;
    text-align: left;
    padding: 15px 20px;
    border: none;
    background: none;
    cursor: pointer;
    color: #fff;
    font-size: 16px;
    border-bottom: 1px solid #333;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background-color: #333;
}

.menu-divider {
    height: 1px;
    background-color: #444;
    margin: 8px 0;
}

.admin-item {
    color: #aaa;
    font-size: 0.9em;
    padding-left: 30px !important;
}

/* Overlay para cerrar menú */
.menu-overlay {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background-color: rgba(0,0,0,0.5);
    z-index: 1001;
    display: none;
}

/* Estilos responsive */
@media (max-width: 768px) {
    header table {
        width: 100%;
        table-layout: fixed;
    }
    
    header td {
        display: table-cell;
        padding: 8px 10px !important;
        vertical-align: middle;
        background-color: transparent !important; /* Asegura que no cambie de color */
    }
    
    header td:first-child {
        width: 30% !important;
        text-align: left;
    }
    
    header td:nth-child(2) {
        width: 50% !important;
        text-align: right;
        padding-right: 5px !important;
    }
    
    header td:last-child {
        width: 20% !important;
        text-align: right;
    }
    
    
    
    #username {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        display: inline-block;
    }
}

@media (min-width: 769px) {
    header td:first-child {
        width: 20% !important;
    }
    
    header td:nth-child(2) {
        width: 60% !important;
    }
    
    header td:last-child {
        width: 20% !important;
    }
    
    .menu-dropdown {
        position: absolute;
        width: auto;
        min-width: 200px;
        height: auto;
        max-height: 80vh;
        top: 100%;
        right: 0;
        transform: none;
        border-radius: 0 0 5px 5px;
    }
    
    .menu-overlay {
        display: none !important;
    }
}

/******************************* mejorar header pantallas grandes */


/************************ESTILOS VENDEDOR***************************/
/* Estilos para el modal de producto */
#productoModal {
    background: rgba(0,0,0,0.55) !important;
    z-index: 1002 !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    min-height: 100vh !important;
    min-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    padding-top: 0 !important;
}
#productoModal .modal-content {
    background: #fff !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22) !important;
    padding: 36px 28px !important;
    min-width: 340px !important;
    max-width: 98vw !important;
    max-height: none !important;
    overflow-y: visible !important;
    margin: 40px 0 40px 0 !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
}

#formProducto label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

#formProducto input,
#formProducto select,
#formProducto textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#formProducto textarea {
    resize: vertical;
    min-height: 80px;
}

/* Responsive para el grid */
@media (max-width: 600px) {
    #productoModal .modal-content > form > div {
        grid-template-columns: 1fr !important;
    }
}


/* Estilos para el input de archivo */
input[type="file"] {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

/* Spinner de carga pequeño */
.loading-spinner-small {
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 2px solid #fff;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

/* Vista previa de imagen */
#imagenPreview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 10px;
    display: none;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Mejoras para el formulario en móviles */
@media (max-width: 600px) {
    #productoModal .modal-content > form > div {
        grid-template-columns: 1fr !important;
    }
    
    input[type="file"] {
        padding: 10px;
    }
}

.producto-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    border-bottom-color: #f04;
    font-weight: bold;
}

.producto-contador {
    background-color: #f04;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
    display: inline-block;
    min-width: 20px;
    text-align: center;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.producto-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.producto-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.producto-imagen img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
}

.producto-info h3 {
    margin: 10px 0 5px;
    font-size: 18px;
}

.producto-precio {
    font-weight: bold;
    color: #f04;
    margin: 10px 0;
    font-size: 18px;
}

.producto-stock input {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.producto-acciones {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.btn-editar, .btn-eliminar, .btn-guardar {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-editar {
    background-color: #5bc0de;
    color: white;
}

.btn-eliminar {
    background-color: #d9534f;
    color: white;
}

.btn-guardar {
    background-color: #5cb85c;
    color: white;
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.error-message {
    color: #d9534f;
    text-align: center;
    padding: 20px;
}

@media (max-width: 600px) {
    .productos-grid {
        grid-template-columns: 1fr;
    }
    
    .producto-acciones {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-editar, .btn-eliminar {
        width: 100%;
    }
}

/* Modal para imagen ampliada */
.imagen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.imagen-modal.activo {
    display: flex;
}

.imagen-modal-contenido {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

.imagen-modal-contenido img {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
    transition: transform 0.3s ease;
    cursor: zoom-in;
    transform-origin: center center;
}

.cerrar-modal {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: #f04;
    color: white;
    font-size: 24px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2001;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.cerrar-modal:hover {
    background-color: #d03;
    transform: scale(1.1);
}

/* Estilos para hacer las imágenes clickeables */
.producto-imagen {
    cursor: zoom-in;
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.producto-imagen::before {
    content: "🔍";
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.producto-imagen:hover::before {
    opacity: 1;
}

.producto-imagen:hover {
    transform: scale(1.02);
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); }
    to { transform: scale(1); }
}

.imagen-modal.activo {
    animation: fadeIn 0.3s ease;
}

.imagen-modal.activo .imagen-modal-contenido img {
    animation: scaleIn 0.3s ease;
}

/* Ajustes responsive */
@media (max-width: 768px) {
    .cerrar-modal {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .imagen-modal-contenido {
        padding: 10px;
    }

    .producto-imagen::before {
        top: 5px;
        right: 5px;
        width: 25px;
        height: 25px;
        font-size: 14px;
    }
}

/* Estilos para las pestañas del panel de vendedor */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 1.5rem;
}

.nav-tabs .nav-item {
    margin-bottom: -2px;
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    padding: 1rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-tabs .nav-link:hover {
    color: #0d6efd;
    border: none;
    background: transparent;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    background: transparent;
    border: none;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #0d6efd;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link i {
    margin-right: 0.5rem;
}

.tab-content {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tab-pane {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-pane.show {
    display: block;
}

.tab-pane.active {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .tab-content {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .nav-tabs {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .nav-tabs .nav-link i {
        margin-right: 0.25rem;
    }
}

/* Estilos para el modal de gestión de productos */
#gestionProductosModal .modal-content {
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px;
    margin: 50px auto; /* Ajustado para que aparezca más arriba */
    position: relative;
    top: 0;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.producto-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    position: relative;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #f04;
}

.tab-btn.active {
    color: #f04;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #f04;
}

.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
}

/* Estilos para la sección de datos financieros */
.datos-financieros {
    padding: 20px;
}

.info-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    font-weight: bold;
    color: #666;
}

.info-item span {
    font-size: 18px;
    color: #f04;
}

/* Estilos para el formulario de información personal */
#formInfoPersonal {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-group input:read-only {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .producto-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .info-item span {
        margin-top: 5px;
    }
}

/* --- Carrito de compras mejorado --- */
.cart-item {
  padding: 16px 0 8px 0;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s;
}
.cart-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 1.05em;
}
.cart-item-nombre {
  flex: 2;
  font-weight: 600;
  color: #222;
}
.cart-item-precio {
  flex: 1;
  color: #007bff;
  font-weight: 500;
}
.cart-item-cantidad {
  flex: 0 0 50px;
  text-align: center;
  color: #444;
}
.cart-item-subtotal {
  flex: 1;
  color: #28a745;
  font-weight: 500;
}
.cart-btn {
  background: #f5f5f5;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  margin-left: 4px;
  font-size: 1.1em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.cart-btn:hover {
  background: #007bff;
  color: #fff;
}
.cart-btn-eliminar {
  background: #f8d7da;
  color: #c82333;
  font-weight: bold;
}
.cart-btn-eliminar:hover {
  background: #c82333;
  color: #fff;
}
.cart-separator {
  border: none;
  border-top: 1px solid #eee;
  margin: 10px 0 0 0;
}
.cart-total-bar {
  margin-top: 18px;
  padding: 12px 0 0 0;
  border-top: 2px solid #007bff;
  font-size: 1.2em;
  text-align: right;
  background: #f7faff;
  border-radius: 0 0 8px 8px;
}
.cart-total-valor {
  color: #007bff;
  font-weight: bold;
  margin-left: 10px;
  font-size: 1.25em;
}

/* Modal del carrito */
#cartModal .modal-content {
  background: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  padding: 32px 24px 24px 24px;
  max-width: 480px;
  margin: 40px auto;
  min-width: 320px;
}
#cartModal h2 {
  color: #007bff;
  text-align: center;
  margin-bottom: 18px;
}
#cartItems {
  max-height: 350px;
  overflow-y: auto;
  margin-bottom: 10px;
}

/* Opciones de pago visuales tipo card */
.opciones-pago-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 18px 0 18px 0;
}
.opcion-pago-card {
  display: flex;
  align-items: center;
  background: #f7faff;
  border: 2px solid #e0e7ef;
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border 0.2s, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  position: relative;
  user-select: none;
}
.opcion-pago-card input[type="radio"] {
  accent-color: #007bff;
  width: 22px;
  height: 22px;
  margin-right: 16px;
  cursor: pointer;
}
.opcion-pago-card .opcion-pago-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.opcion-pago-titulo {
  font-weight: bold;
  font-size: 1.08em;
  color: #007bff;
}
.opcion-pago-desc {
  font-size: 0.97em;
  color: #555;
  margin-top: 2px;
}
.opcion-pago-card:hover, .opcion-pago-card:has(input[type="radio"]:checked) {
  border: 2.5px solid #007bff;
  background: #eaf4ff;
  box-shadow: 0 4px 16px rgba(0,123,255,0.08);
}

@media (max-width: 480px) {
  .opciones-pago-group {
    gap: 8px;
  }
  .opcion-pago-card {
    padding: 10px 8px;
  }
  .opcion-pago-titulo {
    font-size: 1em;
  }
  .opcion-pago-desc {
    font-size: 0.9em;
  }
}

/* --- Modal de recarga llamativo --- */
.recarga-modal-content {
  max-width: 420px !important;
  background: linear-gradient(135deg, #eaf4ff 0%, #f8f8f8 100%);
  border-radius: 16px;
  box-shadow: 0 6px 32px rgba(0,123,255,0.10);
  padding: 32px 28px 28px 28px;
  margin: 0 auto;
  animation: fadeIn 0.3s;
}
.recarga-titulo {
  color: #007bff;
  font-size: 1.4em;
  margin-bottom: 18px;
  font-weight: bold;
}
.recarga-nombre {
  color: #28a745;
  font-weight: bold;
}
.recarga-form-group {
  margin-bottom: 18px;
  text-align: left;
}
.recarga-label {
  display: block;
  margin-bottom: 6px;
  color: #333;
  font-weight: 500;
}
.recarga-input-group {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  border: 1.5px solid #cce0ff;
  padding: 4px 10px;
  box-shadow: 0 1px 4px rgba(0,123,255,0.04);
}
.recarga-currency {
  color: #007bff;
  font-size: 1.2em;
  font-weight: bold;
  margin-right: 6px;
}
.recarga-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.15em;
  color: #222;
  width: 100%;
  padding: 8px 0;
  font-weight: bold;
}
.recarga-input:focus {
  background: #eaf4ff;
}
.recarga-textarea {
  width: 100%;
  min-height: 30px;
  border-radius: 8px;
  border: 1.5px solid #cce0ff;
  padding: 8px 10px;
  font-size: 1em;
  resize: vertical;
  background: #fff;
  color: #333;
}
.recarga-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(90deg, #28a745 60%, #007bff 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.15em;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 2px 8px rgba(40,167,69,0.08);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.recarga-btn:hover {
  background: linear-gradient(90deg, #007bff 60%, #28a745 100%);
  box-shadow: 0 4px 16px rgba(0,123,255,0.12);
  transform: translateY(-2px) scale(1.03);
}

@media (max-width: 600px) {
  .recarga-modal-content {
    padding: 18px 6px 18px 6px;
    max-width: 98vw !important;
  }
}

.user-rol {
  font-size: 0.92em;
  padding: 1px 7px;
  margin-top: 2px;
  margin-bottom: 0;
}
.user-rol b {
  color: #28a745;
  font-weight: bold;
}

header {
    min-height: 48px;
}

header td {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

/* Modal Detalle Pedido responsive */
#detallePedidoModal .modal-content {
  max-width: 98vw;
  width: 98vw;
  min-width: 0;
  margin: 0 auto;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  position: fixed !important;
  box-sizing: border-box;
  padding: 0;
}
@media (max-width: 600px) {
  #detallePedidoModal .modal-content {
    width: 99vw;
    max-width: 99vw;
    min-width: 0;
    padding: 0;
    font-size: 0.98em;
  }
}
.pendiente-pago {
  color: #e74c3c;
  font-weight: bold;
  font-size: 1.1em;
  margin-top: 8px;
}

/* Carrusel y previsualización de imágenes para productos */
.preview-imagenes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 8px;
}
.preview-img-item {
  position: relative;
  display: inline-block;
}
.preview-img-item img {
  max-width: 90px;
  max-height: 90px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 8px #0001;
  border: 2px solid #eee;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.preview-img-item img:hover {
  box-shadow: 0 4px 16px #0002;
  border-color: #f04;
}
.remove-img-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #f04;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 16px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 1px 4px #0002;
  border: none;
  transition: background 0.2s;
}
.remove-img-btn:hover {
  background: #c03;
}

/* Carrusel de imágenes en cards y modales */
.producto-carrusel {
  position: relative;
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  background: #f8f8f8;
}
.carrusel-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  transition: opacity 0.3s;
  cursor: pointer;
}
.carrusel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.18);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s;
}
.carrusel-arrow:hover {
  background: #f04;
}
.carrusel-arrow.left { left: 8px; }
.carrusel-arrow.right { right: 8px; }
.carrusel-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}
.carrusel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
  transition: background 0.2s;
}
.carrusel-dot.active {
  background: #f04;
}

/* Estilos para la tabla de productos financieros */
.tabla-productos-financieros {
    margin-top: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.tabla-productos-financieros table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tabla-productos-financieros th,
.tabla-productos-financieros td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e7ef;
}

.tabla-productos-financieros th {
    background: #f5faff;
    color: #007bff;
    font-weight: bold;
    font-size: 13px;
}

.tabla-productos-financieros tr:hover {
    background: #eaf4ff;
    cursor: pointer;
}

.tabla-productos-financieros .producto-nombre {
    font-weight: bold;
    color: #007bff;
    cursor: pointer;
}

.tabla-productos-financieros .producto-nombre:hover {
    text-decoration: underline;
}

.tabla-productos-financieros .valor-positivo {
    color: #28a745;
    font-weight: bold;
}

.tabla-productos-financieros .valor-negativo {
    color: #dc3545;
    font-weight: bold;
}

.tabla-productos-financieros .valor-neutral {
    color: #6c757d;
}

/* Estilos para el modal de detalles financieros */
.detalle-financiero-content {
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
}

.detalle-financiero-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 25px;
    border-radius: 10px 10px 0 0;
}

.producto-info-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.producto-imagen-detalle {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    border: 3px solid rgba(255,255,255,0.3);
}

.producto-datos-header h2 {
    margin: 0 0 5px 0;
    font-size: 24px;
}

.producto-datos-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.detalle-financiero-body {
    padding: 25px;
}

.metricas-principales {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metrica-card {
    background: white;
    border: 1px solid #e0e7ef;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.metrica-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.metrica-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 10px;
}

.metrica-info label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 500;
}

.metrica-info span {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
}

.grafico-container {
    background: white;
    border: 1px solid #e0e7ef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.grafico-container h3 {
    margin: 0 0 20px 0;
    color: #007bff;
    font-size: 18px;
}

.detalles-tabla {
    background: white;
    border: 1px solid #e0e7ef;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.detalles-tabla h3 {
    margin: 0 0 20px 0;
    color: #007bff;
    font-size: 18px;
}

.tabla-detalles {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tabla-detalles th,
.tabla-detalles td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e7ef;
}

.tabla-detalles th {
    background: #f5faff;
    color: #007bff;
    font-weight: bold;
    font-size: 13px;
}

.tabla-detalles tr:hover {
    background: #eaf4ff;
}

/* Responsive */
@media (max-width: 768px) {
    .detalle-financiero-content {
        width: 95%;
        margin: 10px;
    }
    
    .producto-info-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .metricas-principales {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .metrica-card {
        padding: 15px;
    }
    
    .detalle-financiero-header,
    .detalle-financiero-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .tabla-productos-financieros th,
    .tabla-productos-financieros td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .detalle-financiero-header,
    .detalle-financiero-body {
        padding: 15px;
    }
    
    .producto-imagen-detalle {
        width: 60px;
        height: 60px;
    }
    
    .producto-datos-header h2 {
        font-size: 20px;
    }
}

/* Estilos para badges de rendimiento */
.rendimiento-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.rendimiento-excelente {
    background-color: #d4edda;
    color: #155724;
}

.rendimiento-bueno {
    background-color: #d1ecf1;
    color: #0c5460;
}

.rendimiento-regular {
    background-color: #fff3cd;
    color: #856404;
}

.rendimiento-bajo {
    background-color: #f8d7da;
    color: #721c24;
}

/* Colores diferenciados para pedidos según estado en Operaciones */
.pedido[style*='#e6ffe6'], .estado-entregado { background: #e6ffe6 !important; }
.pedido[style*='#ffeaea'], .estado-cancelado { background: #ffeaea !important; }
.pedido[style*='#fffbe6'], .estado-pendiente { background: #fffbe6 !important; }

/* Opcional: refuerzo de borde para mayor visibilidad */
.pedido[style*='#e6ffe6'] { border-left: 5px solid #3bb143; }
.pedido[style*='#ffeaea'] { border-left: 5px solid #e53935; }
.pedido[style*='#fffbe6'] { border-left: 5px solid #ffd600; }

/* Fondo de cabecera de pedido según estado */
.header-entregado { background: #e6ffe6 !important; }
.header-cancelado { background: #ffeaea !important; }
.header-pendiente { background: #fffbe6 !important; }

/* Opcional: refuerzo de borde en la cabecera */
.header-entregado { border-left: 5px solid #3bb143; }
.header-cancelado { border-left: 5px solid #e53935; }
.header-pendiente { border-left: 5px solid #ffd600; }

/* Colores de fondo para cada item de pedido según estado en el listado de Operaciones */
.pedido-entregado { background: #e6ffe6 !important; border-left: 5px solid #3bb143; }
.pedido-cancelado { background: #ffeaea !important; border-left: 5px solid #e53935; }
.pedido-pendiente { background: #fffbe6 !important; border-left: 5px solid #ffd600; }

/* Fondo sólido y sombra solo para el modal de agregar producto */
#productoModal {
    background: rgba(0,0,0,0.45) !important;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    min-height: 100vh;
    min-width: 100vw;
}
#productoModal .modal-content {
    background: #fff !important;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    padding: 32px 24px;
    min-width: 340px;
    max-width: 98vw;
    max-height: 92vh;
    overflow-y: auto;
    margin: 0;
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}

/* barra de progreso */
.upload-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px;
    z-index: 9999;
    text-align: center;
}

.progress-container {
    width: 80%;
    margin: 0 auto;
    background: #333;
    border-radius: 5px;
    padding: 3px;
}

.progress-bar {
    height: 20px;
    background: #4CAF50;
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s;
}

#uploadProgressText {
    display: inline-block;
    margin-left: 10px;
    font-weight: bold;
}

/* Estilos mejorados para el modal de surtido */
#modalSurtidoAdicional {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85); /* Fondo más oscuro */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1003; /* Mayor que el modal de producto */
}

#modalSurtidoAdicional .modal-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    animation: fadeIn 0.3s ease-out;
    position: relative;
    border: none;
}

#modalSurtidoAdicional .close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
    z-index: 1;
}

#modalSurtidoAdicional .close:hover {
    color: #f04;
}

#modalSurtidoAdicional h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5em;
    text-align: center;
}

#modalSurtidoAdicional .form-group {
    margin-bottom: 20px;
}

#modalSurtidoAdicional label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #444;
}

#modalSurtidoAdicional input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    background-color: #fff;
}

#modalSurtidoAdicional input[type="number"]:focus {
    border-color: #f04;
    outline: none;
    box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.2);
}

#modalSurtidoAdicional button[type="submit"] {
    width: 100%;
    padding: 14px;
    background-color: #f04;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 10px;
}

#modalSurtidoAdicional button[type="submit"]:hover {
    background-color: #d03;
    transform: translateY(-2px);
}

#modalSurtidoAdicional .stock-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1em;
    border-left: 4px solid #f04;
}


.modal-spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* ESTILOS PARA ELIMINAR PRODUCTOS */

/* Estilos para productos inactivos */
.producto-inactivo {
    opacity: 0.5;
    position: relative;
    border: 1px dashed #ccc;
}

.producto-inactivo::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 1;
}

.badge-inactivo {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #ff6b6b;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
}

.btn-reactivar {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
}

.btn-reactivar:hover {
    background-color: #218838;
}

/* Estilos para los filtros */
.filtros-container {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filtros-container label {
    font-weight: bold;
    margin-right: 5px;
}

.filtros-container select {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: white;
}

/* Estilos para la confirmación de eliminación */
.confirmacion-eliminacion {
    background-color: #fff8f8;
    border-left: 4px solid #ff6b6b;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    text-align: left;
}

.confirmacion-eliminacion ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.confirmacion-eliminacion li {
    color: #d33;
    margin-bottom: 5px;
}

/* tabla productos vendedor */

/* Añadir estos estilos al CSS existente */
.table-financiera {
    table-layout: fixed;
    width: 100%;
    font-size: 0.85em;
}

.table-financiera th, 
.table-financiera td {
    padding: 8px 4px;
    text-align: left;
    vertical-align: middle;
}

.table-financiera th:nth-child(1) { width: 18%; } /* Producto */
.table-financiera th:nth-child(2) { width: 12%; } /* Stock */
.table-financiera th:nth-child(3) { width: 12%; } /* Costo */
.table-financiera th:nth-child(4) { width: 18%; } /* Ventas */
.table-financiera th:nth-child(5) { width: 12%; } /* Ganancia */
.table-financiera th:nth-child(6) { width: 10%; } /* Por entregar */
.table-financiera th:nth-child(7) { width: 10%; } /* Entregadas */
.table-financiera th:nth-child(8) { width: 8%; }  /* Acciones */

.producto-nombre {
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

.acciones-producto {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 80px;
}

.btn-reactivar {
    padding: 4px 6px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75em;
    white-space: nowrap;
    width: 100%;
}

.btn-editar {
    padding: 4px 6px;
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75em;
    white-space: nowrap;
    width: 100%;
}

.badge-inactivo {
    display: inline-block;
    padding: 2px 4px;
    background: #dc3545;
    color: white;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: bold;
}

/* Hacer la tabla responsive */
@media (max-width: 1200px) {
    .table-financiera {
        font-size: 0.8em;
    }
    
    .table-financiera th, 
    .table-financiera td {
        padding: 6px 3px;
    }
}

/* fin tabla productos vendedor */


/* funciones modal pagar abono */

/* CSS específico para el modal de entrega - NO afecta otros modales */
.modal-entregar-pedido {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000 !important; /* Alto z-index específico */
}

.modal-content-entregar {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    z-index: 10001;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalEntregarFadeIn 0.3s ease-out;
}

/* Animación solo para este modal */
@keyframes modalEntregarFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Botones específicos para este modal */
.modal-content-entregar button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
    margin-bottom: 10px;
}

.modal-content-entregar button:first-of-type {
    background: #007bff;
    color: white;
}

.modal-content-entregar button:first-of-type:hover {
    background: #0056b3;
}

.modal-content-entregar button:last-of-type {
    background: #28a745;
    color: white;
}

.modal-content-entregar button:last-of-type:hover {
    background: #1e7e34;
}

/* Cerrar button específico */
.modal-content-entregar .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.modal-content-entregar .close:hover {
    color: #000;
}

/* estilos carga de productos */

.filtros-productos {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.busqueda-productos {
    display: flex;
    flex: 1;
    min-width: 300px;
}

.busqueda-productos input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px 0 0 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.busqueda-productos input:focus {
    border-color: #007bff;
    outline: none;
}

.busqueda-productos button {
    padding: 12px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.busqueda-productos button:hover {
    background-color: #0056b3;
}

.ordenamiento-productos {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ordenamiento-productos label {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.ordenamiento-productos select {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.ordenamiento-productos select:focus {
    border-color: #007bff;
    outline: none;
}

.contador-productos {
    margin-left: auto;
    padding: 8px 16px;
    background-color: #e9ecef;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
}

.sin-resultados {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.sin-resultados p {
    margin-bottom: 15px;
    font-size: 18px;
}

.btn-limpiar-filtros {
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-limpiar-filtros:hover {
    background-color: #5a6268;
}

@media (max-width: 768px) {
    .filtros-productos {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .busqueda-productos {
        min-width: 100%;
    }
    
    .ordenamiento-productos {
        flex-direction: column;
        align-items: stretch;
    }
    
    .contador-productos {
        margin-left: 0;
        text-align: center;
    }
}

/* Estilos para el modal financiero */
/* Estilos para el modal financiero */
.financiera-modal {
    max-width: 95%;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.filtro-fechas {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-group-inline {
    display: flex;
    flex-direction: column;
    margin-right: 15px;
}

.financiera-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.financiera-tabs .tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
}

.financiera-tabs .tab-btn.active {
    border-bottom-color: #007bff;
    font-weight: bold;
}

.tab-pane-financiera {
    display: none;
}

.tab-pane-financiera.active {
    display: block;
}

.panel-financiero {
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
}

.panel-header {
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
}

.panel-body {
    padding: 15px;
}

.table-financiera {
    width: 100%;
    border-collapse: collapse;
}

.table-financiera th, .table-financiera td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
}

.table-financiera th {
    background-color: #f8f9fa;
}

.metricas-rentabilidad {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.metrica-card {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f8f9fa;
}

.metrica-icon {
    font-size: 24px;
    margin-right: 15px;
}

.metrica-info {
    display: flex;
    flex-direction: column;
}

.metrica-info label {
    font-weight: bold;
    margin-bottom: 5px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .filtro-fechas {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .metricas-rentabilidad {
        grid-template-columns: 1fr;
    }
}

/* ESTILOS PAGOS ABONOS*/
.modal-entregar-pedido {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content-entregar {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
}

.modal-content-entregar h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #f04;
    padding-bottom: 10px;
}

.modal-content-entregar button {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: none;
    border-radius: 6px;
    background: #f04;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.modal-content-entregar button:hover {
    background: #e00;
}

.modal-content-entregar .close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.modal-content-entregar .close:hover {
    color: #000;
}

* Estilos para el módulo financiero mejorado */
.clickable {
    cursor: pointer;
    color: #007bff;
    text-decoration: underline;
}

.clickable:hover {
    color: #0056b3;
    background-color: #f8f9fa;
}

.table-financiera {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.9em;
}

.table-financiera th, 
.table-financiera td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.table-financiera th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.table-financiera tr:nth-child(even) {
    background-color: #f9f9f9;
}

.table-financiera tr:hover {
    background-color: #f1f1f1;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 80%;
    max-width: 900px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

/* Estilos para valores numéricos */
.valor-numerico {
    text-align: right;
    font-family: monospace;
}

/* Mejora visual para las tablas de resumen */
.resumen-table td:nth-child(3), 
.resumen-table td:nth-child(4), 
.resumen-table td:nth-child(5) {
    text-align: right;
    font-family: monospace;
    font-weight: bold;
}

/* Estilos para valores numéricos en el módulo de rentabilidad */
.valor-numerico {
    text-align: right;
    font-family: monospace;
    font-weight: bold;
}

.metricas-rentabilidad .valor-numerico {
    font-size: 1.2em;
    color: #2c3e50;
}

.desglose-ingresos p {
    font-size: 1.1em;
    margin: 10px 0;
}

.desglose-ingresos strong {
    color: #2c3e50;
    min-width: 250px;
    display: inline-block;
}

/* Estilos para las tablas de detalle */
.table-financiera {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.table-financiera th, 
.table-financiera td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.table-financiera th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.table-financiera tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Panel de rentabilidad */
.panel-financiero {
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.panel-header {
    background-color: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid #ddd;
}

.panel-header h4 {
    margin: 0;
    color: #2c3e50;
}

.panel-body {
    padding: 15px;
}

/* estilo modal de pendientes productos para vendedors el que muestra a quien hay que entregar */
#modalPendientesProducto h3 {
  margin-top: 0;
  font-size: 18px;
  border-bottom: 1px solid #ccc;
  padding-bottom: 6px;
  margin-bottom: 12px;
}
#modalPendientesProducto table th {
  background: #f2f2f2;
  text-align: left;
}
#modalPendientesProducto table td, 
#modalPendientesProducto table th {
  font-size: 14px;
}

/* Fondo oscuro */
.modal-financiera {
    display: none; 
    position: fixed; 
    z-index: 9999; /* siempre al frente */
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.5); 
}

/* Caja del modal */
.modal-financiera-content {
    background: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 1000px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    z-index: 10000;
}

/* Botón de cerrar */
.modal-financiera .close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
}
.modal-financiera .close:hover {
    color: red;
}

/* Paneles de habilitación de compras */
#habilitacionComprasModal .panel-financiero .panel-body {
    min-height: 120px;   /* más espacio vertical */
    padding: 20px;       /* aire interno */
}

#habilitacionComprasModal .panel-financiero {
    margin-bottom: 20px;  /* separación entre paneles */
}
