/* ===========================================
   FIX STORICO VISIBILITY - CRITICAL
   Forza la visualizzazione delle card nello storico
   =========================================== */

/* CONTAINER PRINCIPALE STORICO */
#storicoList {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    padding: 1rem !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 50px !important;
}

#storicoList:not(.hidden) {
    display: flex !important;
}

/* ENTRIES CONTAINER */
.entries-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ENTRY ITEMS - FORZA VISIBILITÀ */
.entry-item {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: #fff !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    margin-bottom: 1rem !important;
    transition: all 0.3s ease;
}

.entry-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* ENTRY HEADER */
.entry-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-bottom: 12px !important;
}

.entry-name {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 !important;
}

.entry-date {
    font-size: 13px !important;
    color: #6b7280 !important;
    white-space: nowrap !important;
}

/* ENTRY VALUES */
.entry-values {
    display: flex !important;
    gap: 16px !important;
}

.entry-value {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.entry-value-label {
    font-size: 11px !important;
    text-transform: uppercase !important;
    color: #6b7280 !important;
    font-weight: 500 !important;
    letter-spacing: 0.5px !important;
}

.entry-value-number {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #2563eb !important;
}

/* CATEGORIA BADGE */
.categoria-badge-small {
    display: inline-block !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    border: 1px solid !important;
}

/* HIDDEN CLASS OVERRIDE */
.hidden {
    display: none !important;
}

#storicoList.hidden {
    display: none !important;
}

/* LOADING & EMPTY STATES */
#loadingStorico {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 3rem 1rem !important;
    text-align: center !important;
}

#loadingStorico.hidden {
    display: none !important;
}

#emptyStorico {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 3rem 1rem !important;
    text-align: center !important;
}

#emptyStorico.hidden {
    display: none !important;
}

/* SPINNER */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* RESPONSIVE */
@media (max-width: 480px) {
    #storicoList {
        padding: 0.5rem !important;
    }
    
    .entry-item {
        padding: 0.75rem !important;
    }
    
    .entry-name {
        font-size: 15px !important;
    }
    
    .entry-value-number {
        font-size: 16px !important;
    }
}

/* DEBUG: MOSTRA TUTTO SEMPRE (rimuovere dopo fix) */
body[data-debug="true"] .entry-item {
    border: 2px solid red !important;
}

body[data-debug="true"] #storicoList {
    border: 3px solid green !important;
}
