/**
 * Estilos para el Modal de Consolidado de Producto - Versión Optimizada
 */

.modal-consolidado-producto {
    display: none;
    position: fixed;
    z-index: 20000; /* Mayor que otros modales para aparecer encima */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Más opaco para mayor contraste */
    backdrop-filter: blur(5px);
}

.modal-consolidado-content {
    background-color: #ffffff;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #333;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-consolidado-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-consolidado-header h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
}

.close-consolidado {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.close-consolidado:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-consolidado-body {
    padding: 20px;
}

.modal-consolidado-content h1 {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: #444;
    text-align: center;
}

/* Diseño horizontal compacto y colorido */
.seccion-horizontal-completa {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.bloque-stock,
.bloque-salidas,
.bloque-notas {
    min-width: 200px;
    padding: 20px;
    border-radius: 12px;
    color: #fff;
    font-weight: bold;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    transition: transform 0.2s ease;
}

.bloque-stock {
    flex: 1.4;
}

.bloque-salidas {
    flex: 0.6;
}

.bloque-notas {
    flex: 1;
}

.bloque-stock:hover,
.bloque-salidas:hover,
.bloque-notas:hover {
    transform: translateY(-2px);
}

.bloque-stock {
    background: linear-gradient(135deg, #388E3C, #2E7D32);
}

.bloque-salidas {
    background: linear-gradient(135deg, #1976D2, #1565C0);
}

.bloque-notas {
    background: linear-gradient(135deg, #F57C00, #EF6C00);
}

.bloque-stock h4,
.bloque-salidas h4,
.bloque-notas h4 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.stock-items-verticales {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
}

.stock-item-mini {
    text-align: center;
    min-width: 60px;
}

.stock-numero {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stock-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

.salidas-info {
    text-align: center;
}

.salidas-numero {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.salidas-label {
    font-size: 1rem;
    opacity: 0.9;
}

.notas-contenedor-horizontal {
    text-align: left;
}

.nueva-nota-horizontal {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.nueva-nota-horizontal textarea {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1rem;
}

.nueva-nota-horizontal textarea::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.btn-agregar-nota-mini {
    padding: 6px 8px;
    width: 32px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.btn-agregar-nota-mini:hover {
    background: rgba(255, 255, 255, 0.4);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .seccion-horizontal-completa {
        flex-direction: column;
        gap: 10px;
    }
    
    .bloque-stock,
    .bloque-salidas,
    .bloque-notas {
        min-width: 100%;
        padding: 15px;
    }
    
    .modal-consolidado-content {
        width: 95%;
        margin: 1% auto;
    }
    
    .modal-consolidado-header {
        padding: 15px;
    }
    
    .modal-consolidado-header h2 {
        font-size: 1.4rem;
    }
    
    .stock-items-verticales {
        justify-content: space-between;
    }
    
    .stock-item-mini {
        min-width: 50px;
    }
    
    .stock-numero {
        font-size: 1.5rem;
    }
    
    .salidas-numero {
        font-size: 2rem;
    }
}

.modal-consolidado-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.modal-consolidado-header h2 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
    color: white !important;
}

.modal-consolidado-header .codigo-producto {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 15px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    margin-left: 12px;
    font-size: 0.9em;
}

.close-consolidado {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-consolidado:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-consolidado-body {
    padding: 0;
    max-height: calc(95vh - 70px);
    overflow-y: auto;
    background: linear-gradient(135deg, #f8fffe 0%, #f0f7ff 100%);
}

/* Layout Unificado */
.consolidado-unified-layout {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.seccion-principal {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
}

/* Información Básica Compacta */
.info-basica-compacta {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 12px;
    border-left: 4px solid #007bff;
}

.info-row {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    align-items: flex-start;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-col {
    flex: 1;
    min-width: 0;
}

.descripcion-col {
    flex: 2;
}

.detalle-col {
    flex: 1;
}

.info-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.85em;
    display: block;
    margin-bottom: 2px;
}

.info-value {
    color: #2c3e50;
    font-size: 0.9em;
    word-wrap: break-word;
}

/* Detalle con iconos */
.detalle-con-iconos .detalle-contenido {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detalle-texto {
    flex: 1;
    color: #2c3e50;
    font-size: 0.9em;
}

.detalle-iconos {
    display: flex;
    gap: 8px;
}

.detalle-iconos i {
    color: #6c757d;
    font-size: 1.1em;
    padding: 4px;
    border-radius: 4px;
    background: rgba(108, 117, 125, 0.1);
    transition: all 0.3s ease;
}

.detalle-iconos i:hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    transform: scale(1.1);
}

/* Fotografías Compactas */
.fotos-compactas {
    background: white;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #e9ecef;
    height: fit-content;
}

.fotos-compactas h4 {
    margin: 0 0 10px 0;
    font-size: 1em;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fotos-grid-compacta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
}

.foto-miniatura {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.foto-miniatura:hover {
    border-color: #007bff;
    transform: scale(1.05);
}

.foto-miniatura img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foto-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 0.7em;
}

.sin-fotos-compacta {
    text-align: center;
    color: #6c757d;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.85em;
}

.sin-fotos-compacta i {
    display: block;
    margin-bottom: 5px;
    font-size: 1.5em;
}

.fotos-extras {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #6c757d;
    font-size: 0.8em;
    font-weight: 600;
    border-radius: 6px;
}

/* Stock y Estadísticas */
.seccion-stock-estadisticas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.stock-info-compacta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.stock-item {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stock-numero {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 2px;
}

.stock-label {
    font-size: 0.8em;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.estadisticas-compactas {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.estadistica-item {
    text-align: center;
    padding: 15px 10px;
    border-radius: 10px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.estadistica-numero {
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 4px;
}

.estadistica-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

/* Notas Únicas */
.seccion-notas-unica {
    background: white;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e9ecef;
    margin-bottom: 15px;
}

.seccion-notas-unica h4 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notas-contenedor-unico {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.notas-lista-compacta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nota-item-compacta {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    border-left: 3px solid #ffc107;
}

.nota-header-compacta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85em;
}

.nota-autor {
    font-weight: 600;
    color: #495057;
}

.nota-fecha {
    color: #6c757d;
}

.nota-contenido-compacta {
    color: #2c3e50;
    font-size: 0.9em;
    line-height: 1.4;
}

.sin-notas-compacta {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9em;
}

.sin-notas-compacta i {
    display: block;
    margin-bottom: 8px;
    font-size: 2em;
}

.notas-extras {
    text-align: center;
    color: #6c757d;
    font-size: 0.85em;
    font-style: italic;
}

.nueva-nota-compacta {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.nueva-nota-compacta textarea {
    flex: 1;
    min-height: 60px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.9em;
}

.nueva-nota-compacta textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.btn-agregar-nota-compacto {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
    height: fit-content;
}

.btn-agregar-nota-compacto:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

/* Tabla de Salidas */
.seccion-tabla-salidas {
    background: white;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.seccion-tabla-salidas h4 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tabla-salidas-container {
    overflow-x: auto;
}

.tabla-salidas-compacta {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.tabla-salidas-compacta th,
.tabla-salidas-compacta td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.tabla-salidas-compacta th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75em;
}

.fila-salida-clickeable {
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.fila-salida-clickeable:hover {
    background-color: #f8f9fa;
}

.estado-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.estado-0 {
    background: #fff3cd;
    color: #856404;
}

.estado-1 {
    background: #d4edda;
    color: #155724;
}

.estado-2 {
    background: #d1ecf1;
    color: #0c5460;
}

.btn-ver-salida {
    background: #007bff;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8em;
}

.btn-ver-salida:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.sin-salidas-tabla {
    text-align: center;
    color: #6c757d;
    padding: 40px;
    font-size: 0.9em;
}

.sin-salidas-tabla i {
    display: block;
    margin-bottom: 10px;
    font-size: 3em;
}

/* Utilidades de color */
.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

/* Loading spinner */
.consolidado-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.consolidado-loading i {
    display: block;
    margin-bottom: 15px;
    font-size: 2em;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-consolidado-content {
        width: 98%;
        margin: 1% auto;
        max-height: 98vh;
    }
    
    .seccion-principal {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .seccion-stock-estadisticas {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stock-info-compacta {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .estadisticas-compactas {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .estadistica-item {
        padding: 10px 5px;
    }
    
    .estadistica-numero {
        font-size: 1.4em;
    }
    
    .estadistica-label {
        font-size: 0.7em;
    }
    
    .info-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .nueva-nota-compacta {
        flex-direction: column;
        gap: 8px;
    }
    
    .tabla-salidas-compacta {
        font-size: 0.75em;
    }
    
    .tabla-salidas-compacta th,
    .tabla-salidas-compacta td {
        padding: 6px 4px;
    }
}

/* ===== ESTILOS PARA FOTOGRAFÍAS COMPACTAS ===== */
.consolidado-fotos-section {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #e3f2fd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.consolidado-fotos-section h3 {
    margin: 0 0 12px 0;
    font-size: 1.1em;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.consolidado-fotos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
    max-width: 280px;
}

.consolidado-foto-item {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
    background: #f8f9fa;
    width: 60px;
    height: 60px;
}

.consolidado-foto-item:hover {
    border-color: #667eea;
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
    z-index: 10;
    position: relative;
}

.consolidado-foto-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.consolidado-foto-item:hover img {
    transform: scale(1.1);
}

.consolidado-foto-mas {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    font-size: 0.8em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.consolidado-foto-mas:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scale(1.05);
}

.consolidado-foto-mas i {
    font-size: 1.2em;
    margin-bottom: 4px;
}

.consolidado-sin-fotos {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9em;
    border: 2px dashed #dee2e6;
}

.consolidado-sin-fotos i {
    display: block;
    margin-bottom: 8px;
    font-size: 2em;
    color: #adb5bd;
}

/* ===== SECCIONES CON MÁS COLOR ===== */
.consolidado-info-section {
    background: linear-gradient(135deg, #fff5f5 0%, #fff0f0 100%);
    border-radius: 12px;
    padding: 12px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.consolidado-stats-section {
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
    border-radius: 12px;
    padding: 12px;
    border-left: 4px solid #48bb78;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.consolidado-historial-section {
    background: linear-gradient(135deg, #fefcbf 0%, #fef5e7 100%);
    border-radius: 12px;
    padding: 12px;
    border-left: 4px solid #ed8936;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.consolidado-notas-section {
    background: linear-gradient(135deg, #e6fffa 0%, #f0fff4 100%);
    border-radius: 12px;
    padding: 12px;
    border-left: 4px solid #38b2ac;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ===== NUEVO LAYOUT DE DOS COLUMNAS ===== */
.consolidado-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.consolidado-columna-izquierda,
.consolidado-columna-derecha {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.consolidado-section-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.consolidado-section-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.consolidado-section-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.consolidado-section-card h3 i {
    color: #667eea;
    font-size: 1.1em;
}

/* ===== GRILLA DE ESTADÍSTICAS ===== */
.consolidado-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.consolidado-stat-card {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.consolidado-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.consolidado-stat-card i {
    font-size: 1.5em;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
}

.consolidado-stat-primary i {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.consolidado-stat-success i {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

.consolidado-stat-content {
    display: flex;
    flex-direction: column;
}

.consolidado-stat-number {
    font-size: 1.8em;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
}

.consolidado-stat-label {
    font-size: 0.9em;
    color: #718096;
    font-weight: 500;
}

/* ===== TABLA DE HISTORIAL MEJORADA ===== */
.consolidado-historial-tabla-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.consolidado-historial-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.consolidado-historial-tabla thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.consolidado-historial-tabla th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85em;
    border-bottom: none;
    color: #222 !important;
}

.consolidado-historial-tabla th i {
    margin-right: 5px;
    opacity: 0.8;
}

.consolidado-historial-tabla tbody tr {
    transition: background-color 0.2s ease;
}

.consolidado-historial-tabla tbody tr:nth-child(even) {
    background: #f8fafc;
}

.consolidado-historial-tabla tbody tr:hover {
    background: #e6fffa;
}

.consolidado-historial-tabla td {
    padding: 10px 8px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.consolidado-cantidad-badge {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8em;
}

.consolidado-retorno-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8em;
}

.consolidado-retorno-badge.con-retorno {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

.consolidado-retorno-badge.sin-retorno {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #721c24;
}

.consolidado-tiempo-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8em;
}

.consolidado-estado-badge {
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.8em;
    text-transform: uppercase;
}

.consolidado-estado-solicitado { background: #fef5e7; color: #744210; }
.consolidado-estado-aprobado { background: #e6fffa; color: #065f46; }
.consolidado-estado-en-terreno { background: #dbeafe; color: #1e40af; }
.consolidado-estado-retorno-incompleto { background: #fef3c7; color: #92400e; }
.consolidado-estado-devuelto { background: #d1fae5; color: #047857; }
.consolidado-estado-perdido { background: #fee2e2; color: #991b1b; }
.consolidado-estado-danado { background: #fde2e7; color: #be123c; }

.consolidado-btn-ver-salida {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.consolidado-btn-ver-salida:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.consolidado-historial-mas {
    text-align: center;
    padding: 15px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.consolidado-btn-ver-mas {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.consolidado-btn-ver-mas:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.consolidado-sin-historial {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.consolidado-sin-historial i {
    font-size: 3em;
    margin-bottom: 15px;
    color: #cbd5e0;
}

.consolidado-sin-historial p {
    margin: 0;
    font-size: 1.1em;
}

/* ===== RESPONSIVE PARA MÓVILES ===== */
@media (max-width: 768px) {
    .consolidado-grid-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .consolidado-historial-tabla {
        font-size: 0.8em;
    }
    
    .consolidado-historial-tabla th,
    .consolidado-historial-tabla td {
        padding: 8px 4px;
    }
    
    .consolidado-section-card {
        padding: 15px;
    }
    
    .modal-consolidado-content {
        width: 98%;
        margin: 1% auto;
    }
}

/* ===== MODAL DE DETALLE DE SALIDA ===== */
.consolidado-modal-detalle-salida {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

.consolidado-modal-detalle-salida .modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.consolidado-modal-detalle-salida .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.consolidado-modal-detalle-salida .modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.consolidado-modal-detalle-salida .modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.consolidado-modal-detalle-salida .modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.consolidado-modal-detalle-salida .modal-body {
    padding: 25px;
}

.consolidado-modal-detalle-salida .info-grupo {
    margin-bottom: 25px;
}

.consolidado-modal-detalle-salida .info-grupo h4 {
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
}

.consolidado-modal-detalle-salida .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.consolidado-modal-detalle-salida .info-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.consolidado-modal-detalle-salida .info-item label {
    font-weight: 600;
    color: #4a5568;
    min-width: 80px;
}

.consolidado-modal-detalle-salida .info-item .valor {
    color: #2d3748;
}

.consolidado-modal-detalle-salida .equipos-detalle {
    display: grid;
    gap: 15px;
}

.consolidado-modal-detalle-salida .equipo-detalle-item {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.consolidado-modal-detalle-salida .equipo-nombre {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.consolidado-modal-detalle-salida .equipo-codigo {
    font-size: 0.9em;
    color: #718096;
    margin-bottom: 8px;
}

.consolidado-modal-detalle-salida .equipo-cantidades {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
}

.consolidado-modal-detalle-salida .equipo-cantidades span {
    background: white;
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.consolidado-modal-detalle-salida .modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.consolidado-modal-detalle-salida .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.consolidado-modal-detalle-salida .btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.consolidado-modal-detalle-salida .btn-secondary:hover {
    background: #cbd5e0;
}

.modal-consolidado-content .seccion-horizontal-completa .bloque-stock {
    background: linear-gradient(135deg, #388E3C, #2E7D32);
}

.modal-consolidado-content .seccion-horizontal-completa .bloque-stock,
.modal-consolidado-content .seccion-horizontal-completa .bloque-stock * {
    color: #ffffff !important;
}

.modal-consolidado-content .seccion-horizontal-completa .bloque-stock .stock-numero,
.modal-consolidado-content .seccion-horizontal-completa .bloque-stock .stock-label {
    color: #ffffff !important;
}

.modal-consolidado-content .seccion-horizontal-completa .bloque-salidas {
    background: linear-gradient(135deg, #1976D2, #1565C0);
}

.modal-consolidado-content .seccion-horizontal-completa .bloque-notas {
    background: linear-gradient(135deg, #F57C00, #EF6C00);
}

.modal-consolidado-content .seccion-horizontal-completa .stock-items-verticales {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-consolidado-content .seccion-horizontal-completa .stock-item-mini {
    text-align: center;
    min-width: 60px;
}

.modal-consolidado-content .seccion-horizontal-completa .stock-numero {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.modal-consolidado-content .seccion-horizontal-completa .stock-label {
    font-size: 0.85rem;
    opacity: 0.9;
}
