/* FUENTES */
    @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=Playfair+Display:wght@700;900&display=swap');
    @import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=JetBrains+Mono:wght@500;800&display=swap');
    @import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Roboto+Condensed:wght@400;700&display=swap');
    @import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700;900&family=Roboto+Condensed:wght@400;700&display=swap');

   body {
    margin: 0;
    padding-top: 80px;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    color: #e5e1da; /* Blanco hueso/crema para el texto */
    
    /* 1. FONDO BASE: Gris grafito con un toque de marrón oscuro (Moka profundo) */
    background-color: #1a1816;

    /* 2. LA MAGIA: Capas de luz en Gris Cálido, Marrón Claro y Brillo Azul */
    background-image: 
        /* Reflejo Azul Eléctrico (Sutil, para que el contenedor azul "vibre") */
        radial-gradient(circle at 20% 30%, rgba(28, 155, 224, 0.1) 0%, transparent 40%),
        /* Luz Marrón Claro / Oro (Esquina superior derecha) */
        radial-gradient(circle at 90% 0%, rgba(226, 199, 146, 0.15) 0%, transparent 40%),
        /* Resplandor Gris Seda (Centro superior) */
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
        /* Degradado de profundidad en Marrón Topo */
        linear-gradient(180deg, #24211e 0%, #1a1816 100%);

    background-attachment: fixed;
    position: relative;
    
    /* Suavizado de fuente premium */
    -webkit-font-smoothing: antialiased;
}

/* 3. LÍNEA DE CRISTAL TÉCNICO (Gris/Marrón Brillante) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    /* Un degradado elegante: Marrón Claro -> Gris Plata -> Marrón Claro */
    background: linear-gradient(90deg, 
        rgba(226, 199, 146, 0) 0%, 
        rgba(226, 199, 146, 0.8) 20%, 
        rgba(255, 255, 255, 0.9) 50%, 
        rgba(226, 199, 146, 0.8) 80%, 
        rgba(226, 199, 146, 0) 100%
    );
    box-shadow: 0 0 15px rgba(226, 199, 146, 0.3);
    z-index: 10000;
}

/* 4. TEXTURA DE MICRO-GRANO (Efecto seda/moderno) */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Puntos color arena muy tenues para quitar lo plano al gris */
    background-image: radial-gradient(rgba(226, 199, 146, 0.04) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.8;
}

 .app {
    width: 100%;
    max-width: 1600px; /* O el ancho que tengas */
    margin: 0 auto;
    overflow-x: hidden; /* Esto mata cualquier desborde rebelde */
    padding: 0.5rem;
    box-sizing: border-box;
}

    /* HEADER */
    .header { 
        text-align: center; 
        color: #e2c792; 
        margin-bottom: 40px; 
        border-bottom: 2px double rgba(226, 199, 146, 0.3);
        padding-bottom: 20px;
    }
    .header h1 { 
        font-family: 'Playfair Display', serif;
        font-size: 3rem; 
        margin: 0;
        text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    }

    /* Estilo del botón disparador */
.btn-desplegable {
    width: 100%;
    padding: 12px;
    background: rgba(226, 199, 146, 0.1);
    border: 1px solid rgba(226, 199, 146, 0.4);
    color: #e2c792;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

/* El menú que aparece y desaparece */
.menu-check-oculto {
    display: none; /* Oculto por defecto */
    position: absolute;
    z-index: 1000;
    width: 100%;
    max-width: 300px;
    background: #1a1a1d;
    border: 1px solid #e2c792;
    border-radius: 12px;
    padding: 15px;
    margin-top: 5px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
}

.acciones-check {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

.acciones-check button {
    background: transparent;
    border: 1px solid #e2c792;
    color: #e2c792;
    font-size: 0.7rem;
    padding: 3px 8px;
    cursor: pointer;
    border-radius: 4px;
}
#contenedor-checks {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 4px 8px;
    padding: 10px 5px;
    width: auto;
}

.contenedor-cards-vertical {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 150px;
}

.item-check {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px; /* Espacio entre el check y el texto */
    
    /* Dimensiones y Forma */
    padding: 6px 14px;
    border-radius: 50px; /* Forma de píldora */
    width: max-content; /* Se ajusta al texto */
    
    /* Fondo y Borde Inicial (Desactivado) */
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(226, 199, 146, 0.1); /* Borde dorado muy sutil */
    
    /* Efectos */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Animación suave */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.item-check:hover {
    background: rgba(226, 199, 146, 0.08);
    border-color: rgba(226, 199, 146, 0.3);
    transform: translateY(-1px); /* Pequeña elevación */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.item-check:has(input:checked) {
    background: linear-gradient(135deg, rgba(226, 199, 146, 0.2) 0%, rgba(226, 199, 146, 0.05) 100%);
    border-color: rgba(226, 199, 146, 0.6);
    box-shadow: 0 0 15px rgba(226, 199, 146, 0.15), inset 0 0 10px rgba(226, 199, 146, 0.05);
}

.item-check input, 
.item-check span {
    cursor: pointer;
}

.item-check span {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7); /* Texto sutil por defecto */
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    user-select: none;
    transition: color 0.3s ease;
}

.item-check:has(input:checked) span {
    color: #e2c792; /* Texto dorado */
    text-shadow: 0 0 5px rgba(226, 199, 146, 0.3);
}

.item-check input[type="checkbox"] {
    appearance: none; /* Quitamos el estilo por defecto del navegador */
    -webkit-appearance: none;
    
    /* Dimensiones */
    width: 16px;
    height: 16px;
    margin: 0;
    
    /* Forma y Borde */
    border-radius: 4px;
    border: 2px solid rgba(226, 199, 146, 0.4);
    background: rgba(0, 0, 0, 0.2);
    
    /* Efectos */
    cursor: pointer;
    transition: all 0.3s ease;
    display: grid;
    place-content: center; /* Centrar el tick */
}



.item-check input[type="checkbox"]:checked {
    background: #e2c792; /* Fondo dorado */
    border-color: #e2c792;
    transform: scale(1.1); /* Pequeño pulso */
}

/* Crear el "Tick" (V) personalizado dentro del checkbox */
.item-check input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0); /* Oculto por defecto */
    transition: 0.2s transform ease-in-out;
    
    /* Imagen del Tick (V) en SVG blanco */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

/* Mostrar el "Tick" cuando está activado */
.item-check input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.item-check label {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ddd;
}

@media (max-width: 1200px) {
    .detalle-wrapper.corporativa-container {
        grid-template-columns: 1fr !important;
        padding: 20px;
    }
    .columna-gestion {
        padding-left: 0 !important;
        margin-top: 30px;
    }
}

@media (max-width: 768px) {
    #lista-corporativas {
        min-width: 90% !important;
        left: 5% !important;
    }
    #contenedor-checks {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en tablets */
    }
}

@media (max-width: 480px) {
    #contenedor-checks {
        grid-template-columns: 1fr; /* 1 columna en móviles */
    }
}

.item-check input {
    cursor: pointer;
    margin: 0;
}

    /* PANEL PRINCIPAL */
    .panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 199, 146, 0.2);
    border-radius: 20px;
    padding: 15px; /* Bajamos de 35px a 15px */
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

    /* FILTROS */
    .filtros-container {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        background: rgba(0, 0, 0, 0.2);
        padding: 25px;
        border-radius: 12px;
        margin-bottom: 30px;
    }

    .filtro-item {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-width: 200px;
    }

    .filtro-item label {
        font-size: 0.75rem;
        font-weight: 600;
        color: #e2c792;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        margin-bottom: 8px;
    }

    .filtro-item input[type="text"], 
    .filtro-item select,
    #input-busqueda, #select-socio {
        background: rgba(255, 255, 255, 0.05);
        border: none;
        border-bottom: 2px solid #e2c792;
        padding: 10px;
        color: white;
        font-family: 'Inter', sans-serif;
        outline: none;
        transition: background 0.3s;
    }

    .filtro-item input:focus {
        background: rgba(255, 255, 255, 0.1);
    }

    /* SLIDER */
    .filtro-item input[type="range"] {
        -webkit-appearance: none;
        width: 100%;
        height: 4px;
        background: rgba(226, 199, 146, 0.2);
        margin: 15px 0;
    }

    .filtro-item input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 18px;
        height: 18px;
        background: #e2c792;
        border-radius: 50%;
        cursor: pointer;
        box-shadow: 0 0 10px rgba(0,0,0,0.5);
    }

    /* GRID */
.listado-barriles-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    /* Añadimos un padding lateral generoso */
    padding: 20px 40px !important; 
    box-sizing: border-box !important; /* CRÍTICO: Para que el padding no sume al ancho total */
}

.historial-modal-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 500px !important;
    max-width: 95vw !important;
    height: 75vh !important;
    padding: 30px !important;
    margin: auto !important;
    gap: 0 !important; /* Eliminamos el gap criminal de 50px */
    background: #1a1816;
    border: 2px solid rgba(226, 199, 146, 0.2);
    border-radius: 20px;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

/* Aseguramos que las tarjetas dentro del historial no tengan márgenes raros */
.historial-modal-content #scroll-historial {
    flex: 1;
    overflow-y: auto;
    margin-top: 20px;
    margin-bottom: 20px;
}

.historial-modal-content .card-historial-item {
    margin-bottom: 12px; /* Espaciado controlado entre partidas */
}



.corporativa-container {
    width: 100%;
    border-left: 4px solid #e2c792;
    margin-bottom: 3px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(8px);
    /* Bordes de cápsula tumbada (extremos redondeados) */
    border-radius: 30px; 
    border: 1px solid rgba(226, 199, 146, 0.2);
    padding: 10px 20px; /* Mucho aire en los laterales */
    box-sizing: border-box;
    gap: 15px;
    display: flex;
    flex-direction: row;
    align-items: center; /* Centra el título y el grid horizontalmente */
    box-shadow: inset 0 0 30px rgba(226, 199, 146, 0.05);
}

.panel-control-izquierda {
    width: 60px; /* Reducido de 140px a 60px */
    background: #e2c792; /* Invertimos: fondo dorado para que resalte */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 10px 5px;
}

.corporativa-titulo-tumbada {
    writing-mode: horizontal-tb !important;
    transform: none !important;
    text-align: left !important;
    display: block !important;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: #e2c792;
    background: rgba(226, 199, 146, 0.03);
    padding: 15px 8px;
    text-transform: uppercase;
    letter-spacing: 3px;
    min-width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.area-depositos-derecha {
    flex-grow: 1;
}

.area-depositos-derecha::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(226, 199, 146, 0.1), transparent);
    transform: skewX(-20deg);
    animation: flashPass 4s infinite;
    pointer-events: none;
}

@keyframes escanerHorizontal {
    0% { left: -100%; }
    /* El destello cruza y desaparece por la derecha */
    100% { left: 100%; } 
}

@keyframes pulsoEnergia {
    0%, 100% { opacity: 1; box-shadow: 0 0 15px #9fe292; }
    50% { opacity: 0.5; box-shadow: 0 0 5px #9fe292; }
}

@keyframes flashPass {
    0% { left: -100%; }
    100% { left: 200%; }
}

@keyframes flashSuave {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.indicador-estado {
    width: 8px;
    height: 8px;
    background: #000;
    border-radius: 50%;
    margin-bottom: 10px;
}

.corporativa-container::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(226, 199, 146, 0.03), transparent);
    animation: flashSuave 8s infinite;
    pointer-events: none;
}

.barril-card.is-vendido {
    border: 1px solid #ff9800 !important; /* Dorado/Naranja industrial */
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.2);
}

.barril-data-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10; /* Prioridad máxima */
    pointer-events: none;
}

/* EXTRA - VERDE */
.barril-card.cap-extra .barril-container::after {
    background: #7fbe09 !important;
    box-shadow: 0 1px 8px rgba(127, 190, 9, 0.6);
}

/* VIRGEN - NARANJA / AZUL (Según tu preferencia, aquí forzamos el AZUL moderno) */
.barril-card.cap-virgen .barril-container::after {
    background: #e0921c !important; /* Azul Eléctrico */
    box-shadow: 0 1px 8px rgba(224, 132, 28, 0.6);
}

/* LAMPANTE - ROJO */
.barril-card.cap-lampante .barril-container::after {
    background: #e03636 !important;
    box-shadow: 0 1px 8px rgba(224, 54, 54, 0.6);
}

/* SIN CLASIFICAR - AZUL CLARO / GRIS */
.barril-card.cap-desc .barril-container::after { 
    background: #00d4ff !important; 
    box-shadow: 0 1px 8px rgba(0, 212, 255, 0.5);
}

/* VACÍO - GRIS */
.barril-card.cap-desconocido .barril-container::after { 
    background: #666 !important;
    box-shadow: none;
}

.corporativa-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(rgba(226, 199, 146, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(226, 199, 146, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit; /* Sigue la curva del padre */
    overflow: hidden; 
    animation: parpadeoElectrico 5s infinite;
}
@keyframes escaner {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes parpadeoElectrico {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
    51% { opacity: 0.8; }
    52% { opacity: 0.4; }
    53% { opacity: 0.9; }
    98% { opacity: 1; }
}


    .corporativa-container:hover {
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        border-color: rgba(226, 199, 146, 0.3);
    }

/* Asegura que el scroll sea vertical y visible */
#scroll-historial {
    scrollbar-width: thin;
    scrollbar-color: #e2c792 rgba(0,0,0,0.2);
}

#scroll-historial::-webkit-scrollbar {
    width: 8px;
}

#scroll-historial::-webkit-scrollbar-thumb {
    background: #e2c792;
    border-radius: 10px;
    border: 2px solid #121212;
}
#scroll-historial .card-historial-item {
    min-width: 100% !important;
}

/* Estructura para el Historial (Vertical y Estrecho) */
.historial-wrapper {
    max-width: 500px; /* Aquí controlamos que el historial sea más chico */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.historial-wrapper.corporativa-container {
    width: 100% !important;
    max-width: 1400px !important; /* El límite de expansión que desees */
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.historial-scroll {
    /* Quitamos el ancho fijo */
    width: 100% !important; 
    
    /* Mantenemos el scroll vertical */
    height: 502px; 
    max-height: 567px;
    overflow-y: auto;

    /* Espaciado interno */
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-right: 15px; /* Un poco más de aire para el scrollbar */
    
    /* Aseguramos que los hijos (las cards) se estiren */
    align-items: stretch; 
}

/* Estructura Base para TODAS las tarjetas */
.card-historial-v2 {
    display: flex !important;
    flex-direction: column;
    height: auto !important; 
    min-height: 180px;
    
    /* LIMITADOR DE ANCHO: Para que no se ponga por todo el contenedor */
    width: 100%;
    max-width: 900px; /* Ajusta este valor según tu preferencia */
    margin: 15px auto 15px auto; /* La centra y le da espacio abajo */
    
    position: relative;
    background-color: rgba(226, 199, 146, 0.03);
    border: 1px solid rgba(226, 199, 146, 0.15); /* Borde normal más tenue */
    border-radius: 15px;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden; 
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* Diferenciador para la tarjeta ACTUAL (Solo lo que cambia) */
.card-historial-v2.es-actual {
    border: 1px solid rgba(226, 199, 146, 0.8); /* Borde mucho más intenso */
    background: rgba(226, 199, 146, 0.05); /* Fondo ligeramente más cálido */
    
    /* AURA DORADA: Resplandor exterior e interior */
    box-shadow: 
        0 0 25px rgba(226, 199, 146, 0.15),
        inset 0 0 40px rgba(226, 199, 146, 0.08);
}

/* Efecto al pasar el ratón (Hover) */
.card-historial-v2:hover {
    border-color: rgba(226, 199, 146, 0.4);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px); /* Pequeña elevación */
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.7),
        inset 0 0 25px rgba(226, 199, 146, 0.05);
}

.mini-params-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    width: 100% !important;
    box-sizing: border-box;
    padding: 10px;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.15); /* Fondo sutil para la fila */
    border-radius: 8px;
}

/* Estilo base del item con aura */
.mini-param-item {
    flex: 1; /* Todos crecen igual */
    min-width: 0; /* Permite que el texto se ajuste si el espacio es poco */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px;
    border-top: 2px solid transparent;
    transition: all 0.3s ease;
}

/* El Mini Container para cada parámetro */
.mini-param-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    position: relative;
    transition: all 0.3s ease;
}

/* Aplicación de tus colores específicos */
.p-acidez { border-top: 3px solid #a4ff00; box-shadow: inset 0 5px 15px rgba(164, 255, 0, 0.05); }
.p-frutado { border-top: 3px solid #4e6e10; box-shadow: inset 0 5px 15px rgba(78, 110, 16, 0.05); }
.p-peroxidos { border-top: 3px solid #ff9d00; box-shadow: inset 0 5px 15px rgba(255, 157, 0, 0.05); }
.p-k270 { border-top: 3px solid #00d4ff; box-shadow: inset 0 5px 15px rgba(0, 212, 255, 0.05); }
.p-etilicos { border-top: 3px solid #e600ff; box-shadow: inset 0 5px 15px rgba(230, 0, 255, 0.05); }
.p-ceras { border-top: 3px solid #f5d547; box-shadow: inset 0 5px 15px rgba(245, 213, 71, 0.05); }
.p-eritrodiol { border-top: 3px solid #ff4d4d; box-shadow: inset 0 5px 15px rgba(255, 77, 77, 0.05); }

/* Hover: El aura se intensifica */
.mini-param-container:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-3px);
}

.mini-param-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
}

/* Efecto hover con brillo real (Aura expandida) */
.mini-param-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-3px);
}

.mini-param-item:last-child { border-right: none; }

.p-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
}

.corporativa-titulo {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #000;
    background: #e2c792;
    display: table;
    margin: -35px auto 25px auto; /* Flota sobre el borde sin ser cortado */
    padding: 6px 30px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0,0,0,0.8);
}

.barriles-mini-grid {
    display: grid;
    /* Ajustamos el mínimo a 75px para que se peguen más */
    grid-template-columns: repeat(auto-fit, minmax(75px, 1fr)); 
    gap: 8px;
    justify-content: center;
}
    /* TARJETA BARRIL */
.barril-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(226, 199, 146, 0.1);
    border-radius: 8px; /* Curva más sutil por ser más pequeña */
    padding: 4px 4px;   /* Padding mínimo */
    width: 75px;        /* Bajamos de ~110px a 75px */
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.2s ease;
}

 .barril-card:hover {
    transform: scale(1.05);
    border-color: #e2c792;
}

    .barril-card h3 {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 0.62rem; /* Antes 0.9rem */
    font-weight: 800;
    color: #e2c792;
    margin: 2px 0 5px 0; /* Margen muy ajustado */
    letter-spacing: 0.5px;
}

    .badge {
        font-size: 0.65rem;
        text-transform: uppercase;
        color: rgba(255,255,255,0.5);
        letter-spacing: 1px;
    }

    .badge-partida {
    background: rgba(226, 199, 146, 0.1);
    border: 1px solid rgba(226, 199, 146, 0.4);
    color: #e2c792;
    padding: 2px 10px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
}

.card-historial-v2.auditando-ahora {
    border: 1px solid #00e5ff !important;
    background: rgba(0, 229, 255, 0.08) !important;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
    transform: scale(1.02);
}

.tag-auditando-v2 {
    position: static !important; /* Anulamos tu right: 15px */
    
    background: linear-gradient(180deg, #00e5ff 0%, #0097a7 100%);
    color: #000;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 4px 25px;
    
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-top: none;
    white-space: nowrap;
}

/* Punto parpadeante para la auditoría */
.dot-blink {
    height: 6px;
    width: 6px;
    background-color: #000;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.contenedor-tags-historial {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex; /* Pone los tags en fila */
    gap: 0;        /* Pegaditos, o 2px si quieres separación */
    z-index: 20;   /* Por encima de todo */
}

.barril-container {
    width: 35px;
    height: 55px;
    background: #111;
    border-radius: 4px;
    border: 1px solid rgba(226, 199, 146, 0.3);
    position: relative;
    margin: 4px 0;
    overflow: hidden;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.9);
}

/* El líquido: Nivel base */
.liquido {
    background: linear-gradient(to top, #7d5a00, #e2c792);
    position: absolute;
    bottom: 0;
    width: 100%;
    z-index: 1; 
    transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 10px 20px rgba(0,0,0,0.3);
}

/* Reflejo vertical: Nivel 2 */
.barril-container::before {
    content: '';
    position: absolute;
    top: 5%; left: 20%; width: 15%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
    z-index: 2; /* Bajado para que el texto gane */
    pointer-events: none;
}

/* Tapa superior: Nivel 3 */
.barril-container::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 5px;
    background: linear-gradient(to bottom, #3a3a3a, #2a2a2a);
    border-bottom: 1px solid rgba(226, 199, 146, 0.3);
    z-index: 3; 
}
.contenedor-historial {
    padding: 10px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.lista-timeline {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Reducimos espacio entre tarjetas */
    padding-top: 10px;
    padding-bottom: 10px;
}

.card-historial-item {
    display: flex;
    align-items: center; /* Alinea verticalmente al centro */
    padding: 10px 20px;
    gap: 20px;
    width: 100%;
    transition: transform 0.2s ease, border-color 0.2s ease;
    cursor: default;
}

.card-historial-item:hover {
    border-color: var(--gold);
    background: rgba(226, 199, 146, 0.05);
}

.info-partida-historial {
    flex-grow: 1; /* Esto empuja el contenido a los bordes */
}

.tag-actual {
    background: var(--gold);
    color: #000;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 900;
}

.tag-actual-vibrante {
    position: static !important; /* IMPORTANTE: Anulamos el absolute */
    transform: none !important;  /* Anulamos el centrado individual */
    
    background: linear-gradient(180deg, #e2c792 0%, #b89b5e 100%);
    color: #000;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 4px 25px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-top: none;
    white-space: nowrap;
}

.detalle-kilos {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    margin: 4px 0;
}

.fecha-partida {
    font-size: 0.7rem;
    opacity: 0.5;
    text-transform: uppercase;
}

.info-campana {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 20px;
    background: rgba(226, 199, 146, 0.1);
    border: 1px solid rgba(226, 199, 146, 0.3);
    border-radius: 50px;
    color: #e2c792;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
}

.info-central-historial {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1; /* Esto hace que el centro ocupe el espacio sobrante */
}

#dias-restantes {
    color: #fff;
    text-shadow: 0 0 10px rgba(226, 199, 146, 0.5);
}

    .barril-data-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* Centrado perfecto */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    z-index: 5; /* Mayor que el del líquido para que nunca lo tape */
    pointer-events: none; /* Para que el click llegue al barril-card */
}

    .border-actual {
    border: 2px solid rgba(226, 199, 146, 0.5) !important;
    background: rgba(226, 199, 146, 0.08) !important;
    position: relative;
}

   .liquido {
        position: absolute;
        bottom: 0;
        width: 100%;
        z-index: 1;
        transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: inset 0 10px 20px rgba(0,0,0,0.3);
        /* Efecto onda suave */
        border-radius: 10px 10px 0 0;
    }

    .liquido::after, .mini-liquido::after {
        content: '';
        position: absolute;
        top: 0; left: 0; width: 100%; height: 100%;
        background: linear-gradient(to right, transparent 20%, rgba(255,255,255,0.1) 50%, transparent 80%);
    } 

    .fleje { display: none; }
    .f-sup { top: 20%; }
    .f-inf { bottom: 20%; }

    .lectura-kilos, #pct-contador {
    transition: color 0.8s ease;
}

.pct-text {
    /* Quitamos el position absolute y transform porque ya lo centra el padre (overlay) */
    font-size: 0.75rem; 
    font-weight: 800;
    color: #fff; /* Blanco puro para que destaque */
    text-shadow: 0 0 5px rgba(0,0,0,1);
    background: rgba(0,0,0,0.4); /* Fondo sutil para legibilidad */
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1;
}

.bloque-parametros-derecha {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end; /* Alinea los tags a la derecha */
}

/* El contenedor del mini depósito */
.mini-deposito-historial {
    width: 40px;
    height: 60px;
    background: rgba(0, 0, 0, 0.4); /* Fondo más oscuro para contraste */
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    
    /* BORDE MARCADO: Más grueso y con luz propia */
    border: 2px solid rgba(226, 199, 146, 0.4) !important;
    
    /* EFECTO CRISTAL: Sombra interna para dar volumen */
    box-shadow: 
        inset 0 0 10px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(226, 199, 146, 0.1);
}

/* El líquido interior */
.mini-liquido {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    transition: height 1s ease-in-out;
    
    /* Gradiente para que el aceite no sea un color plano */
    background: linear-gradient(to top, rgba(0,0,0,0.2) 0%, transparent 100%);
    
    /* LÍNEA DE NIVEL: Un borde superior brillante en el líquido */
    border-top: 2px solid rgba(255, 255, 255, 0.5);
}

/* El porcentaje flotante sobre el depósito */
.mini-pct {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 4px #000, 0 0 8px #000;
    z-index: 3;
    pointer-events: none;
}

#lista-corporativas {
    min-width: 230px; /* Ajusta el ancho para que quepan las 3 columnas */
    padding: 15px;
    width: max-content !important;
    background: #1a1a1a;
    border: 1px solid #e2c792;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

    .pct-text.pct-full {
    color: #ff4d4d; /* Rojo vibrante */
    border-color: #ff4d4d;
    text-shadow: 0 0 12px rgba(255, 77, 77, 0.8); /* Brillo rojo */
    box-shadow: inset 0 0 5px rgba(255, 77, 77, 0.3);
}

/* Stats de Kilos Totales (Los que ya tenías, ajustados) */
.stats { 
    font-size: 0.55rem;
    opacity: 0.8;
    color: #ffffff;
    margin-top: 5px;
    text-align: center;
    border-bottom: 1px solid rgba(226, 199, 146, 0.1);
    padding-bottom: 4px;
}

.stats strong {
    color: #9fe292; /* Kilos en verde suave */
}

/* Contenedor de contratos: Sin scroll, solo ajuste */
.stats-contrato {
    margin-top: 2px !important;
    display: flex !important;
    flex-direction: column !important;
    /* Reducimos el gap entre contratos al mínimo */
    gap: 2px !important; 
    width: 100% !important;
}

.contenedor-notificacion-contrato {
    display: flex !important;
    height: auto !important;
    padding: 0 !important;
}
/* Fila de contrato: Ultra fina */
.linea-contrato {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 4px !important; /* Reducimos el radio para que pegue con el tamaño */
    
    /* ELIMINAMOS min-height o la ponemos muy baja */
    min-height: 16px !important; 
    
    /* PADDING mínimo para que casi no haya aire arriba y abajo */
    padding: 2px 5px !important; 
    
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    line-height: 1 !important; /* Ajusta el interlineado al mínimo */
}

.linea-contrato:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

/* Número de contrato: Micro */
.num-c {
    font-size: 0.5rem !important;
    color: #e2c792 !important;
    font-weight: bold !important;
    white-space: nowrap !important;
}

/* Tag de estado: El tamaño justo para el texto */
.tag-estado {
    /* Mantenemos el tamaño micro para que no fuerce el alto */
    font-size: 0.55rem !important; 
    gap: 3px !important;
    line-height: 1 !important;
}

/* Colores de los Tags */
.tag-estado.pendiente {
    color: #ffb74d !important; /* Naranja */
    background: rgba(255, 183, 77, 0.15) !important;
}

.tag-estado.entregado {
    color: #81c784 !important; /* Verde */
    background: rgba(129, 199, 132, 0.15) !important;
}

.tag-estado.proceso {
    color: #4fc3f7 !important; /* Azul */
    background: rgba(79, 195, 247, 0.15) !important;
}

.tag-estado.vencido { 
    color: #ff3e3e !important;
    background-color: rgba(255, 62, 62, 0.2) !important;
}

.seccion-filtros-wrapper {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(226, 199, 146, 0.2);
    border-radius: 8px;
    margin-bottom: 25px;
    overflow: hidden; /* Importante para el recorte */
}
.header-filtros-toggle {
    background: rgba(226, 199, 146, 0.05);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.75rem;
    color: #e2c792;
    letter-spacing: 1.5px;
    transition: background 0.3s;
}
header-filtros-toggle:hover {
    background: rgba(226, 199, 146, 0.1);
}

#filtros-desplegable-contenido {
    /* Cambiamos 500px por un valor que cubra tus datos pero no sea infinito */
    max-height: 1000px; 
    opacity: 1;
    /* Cambiamos el padding a visible solo cuando está abierto */
    padding: 20px; 
    transition: max-height 0.5s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease;
    overflow: hidden;
}
.filtros-colapsados #filtros-desplegable-contenido {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
    /* Sincronizamos la salida */
    transition: max-height 0.5s cubic-bezier(1, 0, 1, 0), opacity 0.3s ease;
}
    /* STATUS & UPLOAD */
    .upload-section {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 25px;
        padding: 15px;
        border-top: 1px solid rgba(226, 199, 146, 0.1);
    }

    .custom-file-upload {
        background: transparent;
        border: 1px solid #e2c792;
        color: #e2c792;
        padding: 8px 20px;
        border-radius: 30px;
        cursor: pointer;
        font-size: 0.8rem;
        font-weight: bold;
        transition: all 0.3s;
    }

    .custom-file-upload:hover {
        background: #e2c792;
        color: #1a0f0a;
    }

    #file-status {
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    @keyframes parpadeoAlerta {
    0% { opacity: 1; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.7; transform: translateX(-50%) scale(1.05); box-shadow: 0 0 20px #ff4d4d; }
    100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

.alerta-lleno {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4d4d;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    z-index: 20;
    display: none; /* Oculto por defecto */
    animation: parpadeoAlerta 1s infinite;
    white-space: nowrap;
}

.status-label {
    font-size: 0.5rem;
    color: #9fe292;
    font-family: monospace;
}

    .status-loading { color: #5bc0de; }
    .status-success { color: #9fe292; text-transform: uppercase; }
    .status-error   { color: #d9534f; }

    /* MODAL OVERLAY */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0; pointer-events: none;
    transition: all 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

/* CONTENIDO DEL MODAL */
.modal-content {
    background: #121212;
    border: 1px solid rgba(226, 199, 146, 0.4);
    border-radius: 24px;
    width: 95%; 
    max-width: 800px;
    padding: 40px;
    box-shadow: 0 0 100px rgba(0,0,0,0.9);
}

#modal-detalle .modal-content {
    max-width: 1200px; /* Modal mucho más ancho */
    width: 90%;
    background: #0a0a0a;
    border: 2px solid rgba(226, 199, 146, 0.3);
    overflow: hidden;
    position: relative;
}

.close-btn {
    position: absolute; top: 15px; right: 20px;
    background: none; border: none; color: #e2c792;
    font-size: 2rem; cursor: pointer;
}

/* DISEÑO INTERNO */
.detalle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px; margin-top: 20px;
}
.detalle-card {
    background: rgba(255,255,255,0.03);
    padding: 15px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}
.detalle-card label { display: block; font-size: 0.7rem; color: #e2c792; text-transform: uppercase; }
.detalle-card .valor { font-size: 1.2rem; font-weight: 600; margin-top: 5px; }
.detalle-card .valor-grande { font-size: 2.5rem; font-weight: 800; color: #9fe292; }

.text-red { color: #ff4d4d !important; text-shadow: 0 0 10px rgba(255,77,77,0.5); }

.btn-accion {
    padding: 16px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Animación suave */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-accion:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.btn-accion:active {
    transform: translateY(-1px);
}

.btn-accion.outline { background: transparent; border: 1px solid #e2c792; color: #e2c792; margin-left: 10px; }

/* CONTENEDOR VISUAL CON PROFUNDIDAD */
.detalle-visual {
    display: grid;
    grid-template-columns: 220px 1fr; /* Columna fija tanque, resto info */
    gap: 40px;
    align-items: center;
}

.deposito-container-3d {
    position: relative;
    padding-bottom: 20px; /* Espacio para las patas */
}

.deposito-container-3d::after {
    content: '';
    position: absolute;
    bottom: 0; left: 10%; width: 80%; height: 30px;
    background: 
        linear-gradient(90deg, #222 15%, transparent 15%, transparent 85%, #222 85%);
    z-index: -1;
}

.deposito-gigante-pro {
    width: 180px;
    min-width: 180px;
    background: linear-gradient(180deg, #0f0f0f 0%, #1a1a1a 100%);
    border: 3px solid #333;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 20px #000;
}

/* Efecto de acero pulido */
.deposito-gigante::before {
    content: '';
    position: absolute;
    top: 0; left: 15%; width: 20%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.05), transparent);
    z-index: 2;
}

/* Panel de lectura digital (el cristal) */
.deposito-gigante .lectura-digital {
    position: absolute;
    top: 20px;
    right: 15px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid rgba(226, 199, 146, 0.3);
    z-index: 10;
    font-family: 'monospace';
}

.lectura-digital-gigante {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: #e2c792; /* Amarillo/Dorado Interóleo */
    padding: 6px 15px;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    border: 1px solid rgba(0,0,0,0.1);
}

.lectura-digital-gigante span {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: 1.4rem;
    color: #000; /* Texto Negro para contraste total */
}

.grid-stats-modern {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    border-top: 1px solid rgba(226,199,146,0.1);
    padding-top: 20px;
}

.stat-card label { display: block; font-size: 0.7rem; color: #e2c792; margin-bottom: 5px; opacity: 0.8; }
.stat-card .val { font-size: 1.2rem; font-weight: 600; }

.lectura-digital {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    padding: 5px 15px;
    border-radius: 4px;
    border: 2px solid #e2c792; /* Borde amarillo/dorado */
    box-shadow: 0 0 15px rgba(226, 199, 146, 0.3);
    z-index: 10;
    min-width: 60px;
    text-align: center;
}

lectura-digital span {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 900;
    font-size: 1.4rem;
    color: #e2c792; /* Texto Amarillo Ámbar */
    text-shadow: 0 0 8px rgba(226, 199, 146, 0.8);
}

/* Líquido con efecto cristalino */
.liquido-gigante {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0; /* Empezamos en 0 para la animación */
    transition: height 2s cubic-bezier(0.4, 0, 0.2, 1), background 1s ease-in-out; /* 2 segundos de llenado */
    box-shadow: inset 0 20px 40px rgba(0,0,0,0.3);
}
/* Burbujas o reflejos en el aceite */
.liquido-gigante::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 8px;
    background: rgba(255,255,255,0.4);
    filter: blur(2px);
    box-shadow: 0 0 15px rgba(255,255,255,0.5);
}

.liquido-gigante::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 10px;
    background: rgba(255,255,255,0.2);
    box-shadow: 0 0 15px rgba(255,255,255,0.3);
    z-index: 5;
}

.info-tecnica {
    flex: 1;
}

.dato-box {
    background: rgba(255,255,255,0.03);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #e2c792;
    margin-bottom: 15px;
}

.dato-box-gigante {
    margin: 30px 0;
}

.dato-box label {
    font-size: 0.7rem;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 5px;
}

.lectura-kilos {
    font-size: 3.5rem;
    font-weight: 800;
    display: flex;
    align-items: baseline;
    gap: 15px;
    color: #fff;
    padding-bottom: 10px;
}

.lectura-kilos .separador { opacity: 0.2; font-weight: 200; }
.lectura-kilos .total { font-size: 1.5rem; opacity: 0.4; color: #e2c792; }

.valor-principal {
    font-size: 2rem;
    font-weight: 800;
}

.grid-detalles-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mini-item {
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.8rem;
}

.mini-item label {
    display: block;
    color: #e2c792;
    font-size: 0.6rem;
}

/* Contenedor que envuelve Depósito + Parámetros */
.layout-deposito-info {
    display: flex;
    align-items: flex-end; /* Alinea los parámetros con la base del depósito */
    gap: 20px;
}

.layout-deposito-analitica {
    display: flex;
    gap: 15px; /* Espacio entre tanque y datos */
    align-items: flex-start;
}

/* Columna de parámetros (tus cuadraditos) */
.columna-parametros {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Espacio entre cuadraditos */
    padding-bottom: 10px;
}
/* ==========================================================================
   SECCIÓN DETALLES: ESTILO CORPORATIVO INDUSTRIAL
   ========================================================================== */

:root {
    --gold: #e2c792;
    --gold-dim: rgba(226, 199, 146, 0.2);
    --bg-dark: #0a0a0a;
    --glass: rgba(255, 255, 255, 0.03);
    --ticket-paper: #fdfcf0;
}

/* --- CONTENEDOR PRINCIPAL (Estructura de 3 columnas) --- */
.detalle-wrapper.corporativa-container {
    display: grid;
    grid-template-columns: 340px 1fr 280px;
    gap: 20px;
    min-height: 650px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    background: radial-gradient(circle at center, #1a1a1a 0%, #050505 100%);
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    box-sizing: border-box;
    align-items: stretch;
    box-shadow: 0 50px 100px -20px rgba(0,0,0,0.8);
}

/* --- COLUMNA 1: DEPÓSITO MINI Y ANALÍTICA --- */
.columna-tecnica {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 50px;
    border-right: 1px solid rgba(226, 199, 146, 0.1); 
    padding-right: 20px;
}

#pct-contador {
    font-size: 2.5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 10px rgba(0,0,0,1), 0 0 20px rgba(255,255,255,0.2);
}

.liquido-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0%; /* Se anima vía JS */
    transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.8;
}

.lista-parametros {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.parametro-fila {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass);
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 4px solid var(--gold-dim);
    transition: all 0.3s ease;
}

.parametro-fila:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(5px);
    border-left-color: var(--gold);
}

.parametro-fila span:first-child { 
    font-size: 0.7rem; 
    color: #888; 
    font-weight: 800; 
    letter-spacing: 0.5px;
}

.parametro-fila span:last-child { 
    font-size: 0.95rem; 
    color: #fff; 
    font-weight: bold; 
    font-family: 'JetBrains Mono', monospace; 
}

/* --- COLUMNA 2: DISPLAY CENTRAL (DATOS MAESTROS) --- */
.columna-centro {
    display: flex;
    padding-top: 30px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    text-align: center;
}

.deposito-id-main {
    font-size: 3rem;
    color: #fff;
    margin: 0;
    line-height: 0.8;
    letter-spacing: -4px;
    font-weight: 900;
    filter: drop-shadow(0 0 15px rgba(226, 199, 146, 0.15));
}

.badge-partida {
    color: var(--gold);
    font-size: 0.75rem;
    letter-spacing: 2px;
    margin-top: 20px;
    font-weight: 900;
    background: rgba(226, 199, 146, 0.1);
    padding: 8px 20px;
    border-radius: 50px;
    border: 1px solid var(--gold-dim);
}

.stock-box { margin: 60px 0; }

.stock-label { 
    color: #555; 
    font-size: 1rem; 
    letter-spacing: 4px; 
    font-weight: 900; 
    display: block;
    margin-bottom: 15px;
}

.stock-main-numero .n { 
    font-size: 3rem; 
    font-weight: 900; 
    color: #fff; 
    line-height: 1;
}

.stock-main-numero .u { 
    font-size: 2rem; 
    color: #444; 
    font-weight: 300; 
    margin-left: 5px;
}

.stock-capacidad { 
    font-size: 1rem; 
    color: rgba(255, 246, 192, 0.418); 
    font-weight: 700; 
    margin-top: 15px;
    letter-spacing: 1px;
}

/* --- COLUMNA 3: TICKETS COMPACTOS --- */
.columna-contratos {
    display: flex;
    flex-direction: column;
    height: 100%; /* Ocupa todo el alto del modal */
    max-height: 550px; /* Ajusta esta medida según el alto de tu modal */
}

.titulo-derecha {
    flex-shrink: 0;     /* Evita que el título se encoja */
    padding: 15px;
    font-weight: bold;
}

/* Contenedor de Scroll Vertical Estricto */
.scroll-tickets {
    flex: 1; /* Ocupa el espacio restante bajo el título */
    overflow-y: auto; /* Activa el scroll vertical */
    padding-right: 8px; /* Espacio para que el scroll no tape el ticket */
    display: flex;
    flex-direction: column;
    gap: 12px; /* Espacio entre contratos */
}

.scroll-tickets::-webkit-scrollbar {
    width: 6px;
}

.scroll-tickets::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.scroll-tickets::-webkit-scrollbar-thumb {
    background: rgba(191, 161, 95, 0.4); /* Color dorado corporativo con opacidad */
    border-radius: 10px;
}

.scroll-tickets::-webkit-scrollbar-thumb:hover {
    background: rgba(191, 161, 95, 0.8);
}

/* El Ticket */
.ticket-vinicola {
    background: rgba(255, 255, 255, 0.03); /* Casi transparente */
    border: 1px solid rgba(212, 175, 55, 0.3); /* Borde dorado tenue */
    border-radius: 4px;
    color: #e0e0e0;
    font-family: 'Inter', sans-serif; /* O la que uses en el panel */
    position: relative;
}

/* Colores de Borde Dinámicos */
.ticket-vinicola.detalle-v2.pendiente { border-color: #ffb74d !important; } /* Naranja */
.ticket-vinicola.detalle-v2.proceso   { border-color: #4fc3f7 !important; } /* Azul */
.ticket-vinicola.detalle-v2.entregado { border-color: #81c784 !important; } /* Verde */
.ticket-vinicola.detalle-v2.vencido {border-color: #ff3e3e !important;}

/* Colores de Texto del Badge Dinámicos */
.ticket-vinicola.pendiente .ticket-badge { color: #ffb74d !important; background: rgba(255, 183, 77, 0.1); }
.ticket-vinicola.proceso   .ticket-badge { color: #4fc3f7 !important; background: rgba(79, 195, 247, 0.1); }
.ticket-vinicola.entregado .ticket-badge { color: #81c784 !important; background: rgba(129, 199, 132, 0.1); }
.ticket-vinicola.vencido .ticket-badge {color: #ff3e3e !important; background: #ff3e3e23;}

/* Ajuste general para limpiar el estilo previo */
.ticket-badge {
    text-transform: uppercase;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Cabecera del ticket */
.ticket-header {
    background: rgba(212, 175, 55, 0.1); /* Fondo dorado muy suave */
    padding: 10px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.ticket-numero {
    color: #ffffff;
    font-family: monospace;
}

/* Cuerpo del ticket */
.ticket-body {
    padding: 15px;
}

.cliente-nombre {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 2px;
}

.intermediario {
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
}

.separator {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 15px 0;
}

/* Rejilla de datos */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-item small {
    color: #666;
    display: block;
    font-size: 10px;
    margin-bottom: 2px;
}

.stat-item b {
    font-size: 15px;
}

.stat-item span {
    font-weight: 700;
    font-size: 14px;
}

.text-acordado { color: #d1d1d1; }
.text-entregado { color: #a3ff00; } /* Verde neón como el de Acidez */
.text-pendiente { color: #ff4d4d; } /* Rojo como el de Erritro */
.text-precio { color: #00e5ff; }    /* Cyan como el de K270 *

/* Pie del ticket */
.footer-info {
    margin-top: 15px;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    color: #aaa;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
}

.ticket-content { 
    padding: 10px 12px; 
}

.ticket-cliente-box { 
    margin-bottom: 8px; 
    border-bottom: 1px dashed #ccc; 
    padding-bottom: 5px; 
}

.ticket-cliente-box small { font-size: 0.55rem; color: #777; }
.ticket-cliente-box div { 
    font-weight: 900; 
    font-size: 0.8rem; /* Nombre más pequeño */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Evita que nombres largos rompan el ticket */
}

.ticket-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Mantenemos 2 columnas pero más densas */
    gap: 4px 10px;
}

.ticket-data-grid div {
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.ticket-data-grid small { 
    font-size: 0.5rem; 
    color: #888; 
    text-transform: uppercase;
}

.ticket-data-grid b { 
    font-size: 0.85rem; 
    color: #000; 
}

.ticket-pie {
    margin-top: 8px;
    font-size: 0.55rem;
    color: #999;
    text-align: right;
}

/* --- LAYOUT DE LABORATORIO --- */
.layout-laboratorio {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.contenedor-probeta {
    width: 180px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}



.contenedor-instrumentacion {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: fit-content; /* Se ajusta a lo que sumen Tanque + Datos */
}

/* --- DEPÓSITO ESTILO PROBETA --- */
.deposito-mini-visual {
    height: 360px;
    width: 180px;
    position: relative;
    background: #060606; /* Fondo casi negro para contraste */
    border: 3px solid #333;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 
        inset 0 0 30px rgba(0,0,0,1),
        0 5px 15px rgba(0,0,0,0.5);
}

.deposito-mini-visual::after {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    width: 30%;
    height: 100%;
    background: linear-gradient(
        to right, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.08) 50%, 
        rgba(255,255,255,0) 100%
    );
    z-index: 5;
    pointer-events: none;
}

.liquido-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    /* Degradado de densidad: más oscuro abajo, más claro arriba */
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.3) 0%,
        rgba(255,255,255,0.1) 100%
    );
    box-shadow: inset 0 10px 20px rgba(255,255,255,0.2);
}

/* Efecto de partículas/burbujas sutiles */
.liquido-fill::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(circle, rgba(255,255,255,0.15) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: bubbles 10s linear infinite;
    opacity: 0.3;
}

@keyframes bubbles {
    0% { background-position: 0 0; }
    100% { background-position: 0 -200px; }
}

.pct-texto #pct-contador {
    font-size: 3.5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px rgba(255,255,255,0.2);
}

.deposito-mini-visual .pct-texto {
    position: absolute;
    top: 50%; /* Lo centramos verticalmente para que impacte más */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    z-index: 10;
}

#pct-contador {
    font-size: 2.2rem; /* Ahora que hay espacio, el número puede ser grande */
    font-weight: 900;
    color: #fff;
    text-shadow: 
        2px 2px 4px rgba(0,0,0,0.8),
        0 0 15px rgba(226, 199, 146, 0.4);
}


/* --- BADGE DE CLASIFICACIÓN (Debajo del depósito) --- */
.badge-clasif-dinamico {
    width: 100%; /* Ahora ocupará el ancho del tanque + el ancho de los datos */
    padding: 12px 5px;
    font-size: 0.85rem;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    box-sizing: border-box; /* Importante para que el padding no lo ensanche más del 100% */
}

.badge-historial {
    /* Ajuste de tamaño */
    width: auto;             /* IMPORTANTE: Ya no ocupa todo el ancho */
    display: inline-block;   /* Se ajusta al ancho del texto */
    margin-left: auto;       /* Lo empuja a la derecha en contenedores Flex */
    
    /* Estética técnica */
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 4px;
    
    /* Efecto Neón sutil para el historial */
    background: rgba(0, 0, 0, 0.3); 
    border: 1px solid currentColor; /* Usa el color del texto para el borde */
    transition: all 0.2s ease;
    text-align: center;
}

/* --- PARÁMETROS CIENTÍFICOS (Derecha) --- */
.lista-parametros-compacta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
    width: 100px; /* Controlamos el ancho total del grupo */
}

.parametro-pildora {
    background: rgba(255, 255, 255, 0.03);
    /* Mantenemos tu borde superior de color si lo tenías, 
       si no, el border-left que pusiste ahora se verá más compacto */
    padding: 5px 8px; 
    border-radius: 4px;
    width: 100%; /* Se ajusta a los 100px del contenedor */
    box-sizing: border-box;
}

.parametro-pildora:hover {
    background: rgba(226, 199, 146, 0.05);
    border-left-color: var(--gold);
}
.p-label {
    font-size: 0.55rem; /* Un pelín más pequeña para que no haga wrap */
    color: #666;
    text-transform: uppercase;
    font-weight: 800;
    display: block;
    margin-bottom: 1px;
    white-space: nowrap;
}   

.p-val {
    font-size: 0.85rem; /* Ajustado para que el número quepa bien en 100px */
    color: #fff;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: bold;
}
/* BOTONES DE ACCIÓN */
.footer-acciones { display: flex; gap: 12px; width: 100%; margin-top: auto; }

.btn-gold {
    flex: 1;
    height: 50px;
    background: var(--gold);
    color: #000;
    font-weight: 900;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-gold:hover { background: #fff; transform: translateY(-2px); }

.btn-outline {
    width: 60px;
    background: transparent;
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-outline:hover { background: var(--gold-dim); }
/* Estilo EXTRA (Dorado/Verde Brillante) */
/* Variaciones de color para el Modal */
.cls-extra { 
    background: rgba(33, 125, 8, 0.2); 
    color: #4bf10f; 
    border-color: #5af10f; 
    box-shadow: 0 0 15px rgba(83, 241, 15, 0.3);
}
.cls-virgen { 
    background: rgba(125, 76, 8, 0.2); 
    color: #f18f0f; 
    border-color: #f1a60f; 
    box-shadow: 0 0 15px rgba(241, 177, 15, 0.3);
}
.cls-lampante { 
    background: rgba(125, 8, 8, 0.2); 
    color: #f12d0f; 
    border-color: #f14b0f; 
    box-shadow: 0 0 15px rgba(241, 49, 15, 0.3);
}
.cls-desc { 
    background: rgba(8, 100, 125, 0.2); 
    color: #0fa6f1; 
    border-color: #0fbcf1; 
    box-shadow: 0 0 15px rgba(15, 139, 241, 0.3);
}
.cls-desconocido { 
    background: rgba(62, 66, 61, 0.2); 
    color: #4e554b; 
    border-color: #41463f; 
}

/* Contenedor de etiquetas en el historial */
.mini-stats-historial {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.fecha-retirada-box {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 242, 255, 0.05);
    padding: 3px 8px;
    border-radius: 4px;
    border-left: 2px solid #00f2ff;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
}

/* Etiquetas ultra-compactas */
.tag-param-historial {
    padding: 1px 6px; /* Más pequeño */
    font-size: 0.65rem;
}

.glosario-container {
    width: 100%; /* Ocupa todo el ancho del contenedor padre */
    padding: 12px;
    background: rgba(10, 12, 14, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.glosario-subtitulo {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    text-align: center;
    color: #e2c792;
}

.glosario-item .tag-estado {
    font-size: 1rem !important;
    min-height: 14px !important;
    border-radius: 2px !important;
    flex-shrink: 0;
}

.glosario-fila {
    display: flex;
    flex-wrap: nowrap; /* Forzamos que se mantengan en una línea */
    justify-content: space-between; /* Distribuye los elementos de extremo a extremo */
    align-items: flex-start;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
}

.glosario-bloque {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centramos el contenido dentro de su columna */
    flex: 1; /* Esto hace que todos los bloques midan lo mismo */
    text-align: center;
}

.glosario-desc {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #777;
    line-height: 1.1;
    max-width: 300px; /* Evita que el texto se estire demasiado */
}

.glosario-bloque .glosario-item {
    font-size: 0.9em;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
}

.glosario-bloque .tag-estado {
    width: 100%; /* El tag se ajusta al ancho de su columna */
    max-width: 110px;
    justify-content: center;
}

.glosario-linea .glosario-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: bold;
}

.glosario-titulo {
    padding: 15px;
    border-top: 1px solid rgba(226, 199, 146, 0.1);
    font-size: 0.6rem;
    color: #e2c792;
    letter-spacing: 2px;
    margin-bottom: 10px;
    opacity: 0.7;
    text-align: center;
}

.glosario-grid {
    display: flex !important;
    flex-direction: row !important; /* Fuerza la dirección en fila */
    flex-wrap: nowrap !important;  /* Evita que bajen a la siguiente fila */
    justify-content: space-between; /* Los separa equitativamente */
    align-items: center;
    gap: 10px; /* Espacio mínimo entre ellos */
    width: 100%;
}

.glosario-seccion {
    margin-bottom: 15px;
}

.glosario-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap; /* Evita que el texto de cada item se parta en dos líneas */
    flex: 1; /* Hace que todos ocupen el mismo ancho proporcional */
    justify-content: center; /* Centra el contenido dentro de su espacio */
}

.g-indicador {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.g-texto {
    font-size: 0.6rem; /* Reducimos un poco el tamaño para asegurar que quepan en pantallas pequeñas */
    text-transform: uppercase;
}

/* Aplicación de tus colores específicos */
.g-extra .g-indicador { background: #4bf10f; box-shadow: 0 0 8px #5af10f; }
.g-virgen .g-indicador { background: #f18f0f; box-shadow: 0 0 8px #f1a60f; }
.g-lampante .g-indicador { background: #f12d0f; box-shadow: 0 0 8px #f14b0f; }
.g-desc .g-indicador { background: #0fa6f1; box-shadow: 0 0 8px #0fbcf1; }
.g-vacio .g-indicador { background: #4e554b; border: 1px solid #41463f; }

.tag-vendido-mini {
    font-size: 0.6rem;
    color: #ff9800;
    font-weight: 900;
    margin-top: 2px;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(0,0,0,1);
}

.modo-auditoria {
    border: 2px solid #00e5ff66 !important;
}

.aviso-auditoria {
    color: #00e5ff;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin-top: 5px;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.cant-vendida-mini {
    font-size: 0.5rem;
    color: #e2c792;
    margin-top: 1px;
    font-family: monospace;
}

/* Badge de clasificación versión "historial" */
.mini-badge-clasif {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 800;
    display: inline-block;
    margin-top: 5px;
}

@keyframes pulsoAlerta {
    0% { box-shadow: 0 0 0px rgba(255, 77, 77, 0); }
    50% { box-shadow: 0 0 20px rgba(255, 77, 77, 0.4); }
    100% { box-shadow: 0 0 0px rgba(255, 77, 77, 0); }
}

    @media (max-width: 600px) {
        .filtros-container { flex-direction: column; }
    }

    @media (max-width: 1100px) {
        .listado-barriles-grid {
            grid-template-columns: repeat(auto-fill, minmax(calc(50% - 20px), 1fr));
        }
    }

    @media (max-width: 700px) {
        .listado-barriles-grid {
            grid-template-columns: 1fr;
        }
        .app { padding: 10px; }
        .panel { padding: 15px; }
    }
