/* ============================================================
   THEME-ID: default (tema scuro)
   Theme Name: Tema scuro
   Purpose: Base theme stylesheet for the dashboard.
   Always loaded by index.html.
============================================================ */
/* ============================================================================
   TECHNICAL REPORTS DASHBOARD - STYLESHEET
   Italiana Ferramenta | ItalianaLAB

   NOTA: Questo file contiene tutti gli stili del dashboard.
         NON modificare a meno di sapere esattamente cosa si sta facendo.
============================================================================ */

:root {
    --primary: #c62828;
    --primary-dark: #8e0000;
    --success: #4caf50;
}

body {
    margin: 0;
    font-family: "Futura Md", "Futura", "Poppins", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    background: radial-gradient(circle at top, #1f1f1f 0%, #0b0b0b 55%, #050505 100%);
    color: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.site-header {
    background: #8a8684;
    box-shadow: 0 6px 18px rgba(0,0,0,0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.4rem 1.2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.site-header__title {
    flex: 1;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #f5f5f5;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.28);
    margin: 0;
    font-family: "Futura Md", "Futura", "Poppins", "Inter", sans-serif;
}

.site-header__logo {
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.28));
}

.site-header__logo--primary {
    height: 49px;
    transition: 0.3s;
    cursor: pointer;
}

.site-header__logo--primary:hover {
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.6));
    transform: scale(1.05);
}

.site-header__logo--lab {
    height: 45px;
    transition: all 0.2s ease;
}

main {
    max-width: 1500px; /* Via di mezzo tra 1400px (prima) e 1600px (dopo) */
    margin: 0 auto 3rem;
    padding: 0 0.5rem;
}

/* === TABS (SEGMENTED CONTROL BOLD) === */
.tabs-container {
    display: inline-flex;
    justify-content: center;
    align-items: stretch;
    margin: 1.5rem auto 2rem;
    gap: 0;
    padding: 5px;
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    border: 2px solid rgba(198, 40, 40, 0.28);
    border-radius: 14px;
    box-shadow: 0 0 18px rgba(198, 40, 40, 0.2),
                inset 0 1px 2px rgba(255, 255, 255, 0.04);
    position: relative;
}

.tabs-container::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    padding: 2px;
    background: linear-gradient(135deg,
        rgba(198, 40, 40, 0.45) 0%,
        rgba(198, 40, 40, 0.16) 50%,
        rgba(198, 40, 40, 0.45) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.tab-button {
    position: relative;
    padding: 0.85rem 2.5rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #999;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: "Futura Md", "Futura", "Poppins", "Inter", sans-serif;
    white-space: nowrap;
    z-index: 1;
}

.tab-button:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background: linear-gradient(to bottom,
        transparent,
        rgba(255, 255, 255, 0.15) 30%,
        rgba(255, 255, 255, 0.15) 70%,
        transparent);
    transition: opacity 0.3s ease;
}

.tab-button:hover {
    color: #e0e0e0;
    background: rgba(198, 40, 40, 0.08);
}

.tab-button.active {
    background: linear-gradient(135deg, #c62828 0%, #8e0000 100%);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(198, 40, 40, 0.35),
                inset 0 1px 2px rgba(255, 255, 255, 0.12),
                inset 0 -1px 2px rgba(0, 0, 0, 0.25);
}

.tab-button.active::after {
    opacity: 0;
}

.tab-button.active:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    color: #ffffff;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.35s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}


/* === STAT CARDS (COUNTERS) - PREMIUM VERSION =================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.4rem;
    margin-bottom: 1.5rem;
}

/* DEMO PREMIUM: Stat cards con effetto glow pulsante */
.stat-card {
    position: relative;
    background: linear-gradient(145deg, rgba(28, 28, 28, 0.85) 0%, rgba(17, 17, 17, 0.85) 60%);
    backdrop-filter: blur(3px) brightness(1.1);
    border: 1px solid rgba(198, 40, 40, 0.16);
    border-radius: 18px;
    padding: 0.7rem 0.5rem; /* Uniformato con filters-card */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: statCardFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
    overflow: hidden;
    /* Layout con numeri centrati rispetto all'intero container */
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 100px; /* Altezza fissa uniformata con filters-card */
}

/* Animazione scaglionata per ogni card */
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes statCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Nessuna animazione pulse */

/* Odometer Count-Up Animation (Dynamic Speed) */

/* Container per odometer count-up */
.stat-value-wrapper {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}

/* Singola cifra del contatore */
.stat-value-digit {
    position: relative;
    width: 2.8rem; /* Aumentato da 2.5rem per più risalto */
    height: 3.8rem; /* Aumentato da 3.3rem per più risalto */
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.32);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Bordi colorati per le cifre in base al colore della stat-card */
.stat-card.counter-green .stat-value-digit {
    border-color: rgba(0, 255, 0, 0.5);
}

.stat-card.counter-blue .stat-value-digit {
    border-color: rgba(33, 150, 243, 0.5);
}

.stat-card.counter-red .stat-value-digit {
    border-color: rgba(198, 40, 40, 0.5);
}

.stat-card.counter-orange .stat-value-digit {
    border-color: rgba(255, 152, 0, 0.5);
}

.stat-card.counter-purple .stat-value-digit {
    border-color: rgba(186, 104, 200, 0.5);
}

/* ========================================= */
/* OPZIONE D: Glow esterno + interno sulle stat-card */
/* ========================================= */
.stat-card.counter-green {
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.6),
        0 0 14px rgba(0, 255, 0, 0.2),
        inset 0 0 40px rgba(0, 255, 0, 0.04);
}

.stat-card.counter-green:hover {
    box-shadow:
        0 12px 26px rgba(0, 0, 0, 0.68),
        0 0 20px rgba(0, 255, 0, 0.35),
        inset 0 0 50px rgba(0, 255, 0, 0.06);
}

.stat-card.counter-blue {
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.6),
        0 0 14px rgba(33, 150, 243, 0.2),
        inset 0 0 40px rgba(33, 150, 243, 0.04);
}

.stat-card.counter-blue:hover {
    box-shadow:
        0 12px 26px rgba(0, 0, 0, 0.68),
        0 0 20px rgba(33, 150, 243, 0.35),
        inset 0 0 50px rgba(33, 150, 243, 0.06);
}

.stat-card.counter-red {
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.6),
        0 0 14px rgba(198, 40, 40, 0.2),
        inset 0 0 40px rgba(198, 40, 40, 0.04);
}

.stat-card.counter-red:hover {
    box-shadow:
        0 12px 26px rgba(0, 0, 0, 0.68),
        0 0 20px rgba(198, 40, 40, 0.35),
        inset 0 0 50px rgba(198, 40, 40, 0.06);
}

.stat-card.counter-orange {
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.6),
        0 0 14px rgba(255, 152, 0, 0.2),
        inset 0 0 40px rgba(255, 152, 0, 0.04);
}

.stat-card.counter-orange:hover {
    box-shadow:
        0 12px 26px rgba(0, 0, 0, 0.68),
        0 0 20px rgba(255, 152, 0, 0.35),
        inset 0 0 50px rgba(255, 152, 0, 0.06);
}

.stat-card.counter-purple {
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.6),
        0 0 14px rgba(186, 104, 200, 0.2),
        inset 0 0 40px rgba(186, 104, 200, 0.04);
}

.stat-card.counter-purple:hover {
    box-shadow:
        0 12px 26px rgba(0, 0, 0, 0.68),
        0 0 20px rgba(186, 104, 200, 0.35),
        inset 0 0 50px rgba(186, 104, 200, 0.06);
}

/* Reel che contiene tutti i numeri 0-9 */
.stat-value-reel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Singolo numero nel reel */
.stat-value-number {
    width: 100%;
    height: 3.8rem; /* Aumentato da 3.3rem per più risalto */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem; /* Aumentato da 2.8rem per più risalto */
    font-weight: 900; /* Aumentato da 800 per linee più spesse */
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    /* Text stroke per linee ancora più definite */
    -webkit-text-stroke: 0.8px rgba(255, 255, 255, 0.35);
}

/* Nessuna animazione sulla card */

/* Effetto glow premium al hover */
.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: linear-gradient(
        135deg,
        rgba(198, 40, 40, 0.07) 0%,
        transparent 50%,
        rgba(198, 40, 40, 0.035) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-2px) scale(1.005);
    box-shadow:
        0 16px 32px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(198, 40, 40, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.stat-card:hover::before {
    opacity: 1;
}

/* Ambient depth lighting */
.stat-card::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 20%;
    right: 20%;
    height: 30px;
    background: radial-gradient(
        ellipse at center,
        rgba(198, 40, 40, 0.12) 0%,
        rgba(198, 40, 40, 0.04) 50%,
        transparent 80%
    );
    z-index: -1;
    filter: blur(8px);
    opacity: 0.45;
    transition: all 0.4s ease;
}

.stat-card:hover::after {
    bottom: -20px;
    opacity: 1;
    filter: blur(12px);
}

.stat-label {
    font-size: 0.8rem; /* Aumentato da 0.76rem */
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
    color: #c9c2bb;
    font-weight: 600;
    text-align: left;
    /* Permetti massimo 3 righe per titoli lunghi */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* Container per digit boxes del contatore - centrato rispetto all'intero stat-card */
.stat-value {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* Nessuna animazione pulse sui wrapper */

.stat-note {
    margin-top: 0;
    font-size: 0.75rem; /* Aumentato da 0.7rem */
    color: #a7a09a;
    line-height: 1.3;
    font-weight: 400;
    text-align: right;
    position: relative;
    z-index: 2;
    max-width: 30%;
    flex-shrink: 0;
    padding: 0.3rem 0.7rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
}

/* Header section per layout Variante 2 */
.header-section {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    position: relative;
    z-index: 2;
    max-width: 30%;
    flex-shrink: 0;
}

/* Badge "LIVE" per layout Variante 2 */
.stat-badge {
    padding: 0.3rem 0.7rem;
    border-radius: 12px;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
    align-self: flex-start;
}

/* Badge colorati per ogni tipo di contatore */
.counter-green .stat-badge {
    background: rgba(0, 255, 0, 0.15);
    color: #0f0;
    border: 1px solid rgba(0, 255, 0, 0.3);
}

.counter-blue .stat-badge {
    background: rgba(33, 150, 243, 0.15);
    color: #2196F3;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.counter-red .stat-badge {
    background: rgba(198, 40, 40, 0.15);
    color: #c62828;
    border: 1px solid rgba(198, 40, 40, 0.3);
}

.counter-orange .stat-badge {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.counter-purple .stat-badge {
    background: rgba(186, 104, 200, 0.15);
    color: #ba68c8;
    border: 1px solid rgba(186, 104, 200, 0.3);
}

/* Colora "ongoing updates" con lo stesso colore del badge */
.stat-card.counter-green .stat-note { color: #0f0; }
.stat-card.counter-blue .stat-note { color: #2196F3; }
.stat-card.counter-red .stat-note { color: #c62828; }
.stat-card.counter-orange .stat-note { color: #ff9800; }
.stat-card.counter-purple .stat-note { color: #ba68c8; }

.stat-card.counter-green .stat-note {
    background: rgba(0, 255, 0, 0.15);
    border-color: rgba(0, 255, 0, 0.3);
}

.stat-card.counter-blue .stat-note {
    background: rgba(33, 150, 243, 0.15);
    border-color: rgba(33, 150, 243, 0.3);
}

.stat-card.counter-red .stat-note {
    background: rgba(198, 40, 40, 0.15);
    border-color: rgba(198, 40, 40, 0.3);
}

.stat-card.counter-orange .stat-note {
    background: rgba(255, 152, 0, 0.15);
    border-color: rgba(255, 152, 0, 0.3);
}

.stat-card.counter-purple .stat-note {
    background: rgba(186, 104, 200, 0.15);
    border-color: rgba(186, 104, 200, 0.3);
}

/* Variante con banda colorata laterale */
.stat-card.primary-stat {
    padding-left: 2.2rem;
}

/* Skeleton loader per stato caricamento */
.stat-card.loading .stat-label,
.stat-card.loading .stat-value,
.stat-card.loading .stat-note {
    background: linear-gradient(
        90deg,
        #1a1a1a 0%,
        #2a2a2a 50%,
        #1a1a1a 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 6px;
    color: transparent;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.stat-card.loading .stat-label::after,
.stat-card.loading .stat-value::after,
.stat-card.loading .stat-note::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: skeleton-shimmer 2s infinite;
}

.stat-card.loading .stat-label {
    display: inline-block;
    width: 60%;
    height: 1em;
}

.stat-card.loading .stat-value {
    display: inline-block;
    width: 80%;
    height: 1.2em;
}

.stat-card.loading .stat-note {
    display: inline-block;
    width: 70%;
    height: 0.9em;
}

@keyframes skeleton-loading {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 0%; }
}

@keyframes skeleton-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}



/* === TABLES — HIGH READABILITY =============================== */
.table-section {
    margin-top: 1.75rem;
    position: relative;
}

/* Ambient light effect for tables */
.table-section::after {
    content: '';
    position: absolute;
    inset: -40px -20px;
    border-radius: 50%;
    background: radial-gradient(
        ellipse at 50% 50%,
        rgba(198, 40, 40, 0.04) 0%,
        rgba(198, 40, 40, 0.015) 50%,
        transparent 75%
    );
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
}

/* PREMIUM: Table container con glass-morphism */
.table-container {
    position: relative;
    max-height: 520px;
    overflow-y: auto;
    overflow-x: clip;

    background: rgba(27, 27, 27, 0.75);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);

    border-radius: 16px;
    padding: 0 0.5rem 1.1rem 0.5rem; /* Ridotto da 0.8rem per allargare ulteriormente tabella */

    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.35),
        0 3px 12px rgba(198, 40, 40, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);

    border: 2px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    /* Rimosso isolation: isolate per evitare conflitti con sticky header */
}

/* ========================================= */
/* SCROLL ENHANCEMENT: Hover Effect         */
/* ========================================= */
.table-container:hover {
    /* Bordo rosso luminoso quando mouse è sulla tabella */
    border-color: rgba(198, 40, 40, 0.7);

    box-shadow:
        0 12px 34px rgba(0, 0, 0, 0.45),
        0 5px 16px rgba(198, 40, 40, 0.14),
        /* Glow rosso esterno */
        0 0 0 2px rgba(198, 40, 40, 0.14),
        0 0 14px rgba(198, 40, 40, 0.2),
        /* Glow rosso interno */
        inset 0 0 24px rgba(198, 40, 40, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ========================================= */
/* SCROLL ENHANCEMENT: Dynamic Shadows      */
/* ========================================= */

/* Ombra superiore (quando scrolli verso il basso) */
.table-container::before {
    content: '';
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom,
        rgba(198, 40, 40, 0.32) 0%,
        rgba(198, 40, 40, 0.16) 50%,
        transparent 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    border-radius: 16px 16px 0 0;
}

/* Ombra inferiore (quando scrolli verso l'alto) */
.table-container::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to top,
        rgba(198, 40, 40, 0.32) 0%,
        rgba(198, 40, 40, 0.16) 50%,
        transparent 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    border-radius: 0 0 16px 16px;
}

/* Classi aggiunte dinamicamente via JavaScript */
.table-container.show-top-shadow::before {
    opacity: 1;
}

.table-container.show-bottom-shadow::after {
    opacity: 1;
}

.table-container table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
    position: relative;
    z-index: 0;
    overflow: visible;
}

.table-container thead th {
    text-align: left;
    /* Gli stili sono definiti alla fine del CSS */
}

.table-container thead th:first-child {
    border-top-left-radius: 18px;
}

.table-container thead th:last-child {
    border-top-right-radius: 18px;
}

.table-container tbody td {
    padding: 0.75rem 0.6rem;
    color: #f0f0f0;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    text-align: center;
    vertical-align: middle;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* PREMIUM: Row animations e hover effect */
.table-container tbody tr {
    background: #202020;
    border-bottom: 1px solid rgba(255,255,255,0.25);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
}

.table-container tbody tr:nth-child(even) {
    background: #2a2a2a;
}

/* Subtle gradient underline on hover */
.table-container tbody tr::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(198, 40, 40, 0.6) 50%,
        transparent 100%);
    opacity: 0;
    transform: scaleX(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.table-container tbody tr:hover {
    background: rgba(47, 47, 47, 0.7);
    transform: scale(1.002);
    box-shadow:
        inset 0 0 0 1px rgba(198, 40, 40, 0.2),
        0 3px 8px rgba(0, 0, 0, 0.25);
}

.table-container tbody tr:hover::after {
    opacity: 1;
    transform: scaleX(1);
}


/* ========================================= */
/* SCROLL ENHANCEMENT: Custom Scrollbar     */
/* ========================================= */

/* Scrollbar - dimensioni FISSE (8px sempre) */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

/* Track - SEMPRE uguale (non cambia MAI) */
.table-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

/* Thumb (pillola) - TUTTE le proprietà FISSE tranne background */
.table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
        rgba(198, 40, 40, 0.3) 0%,
        rgba(198, 40, 40, 0.4) 50%,
        rgba(198, 40, 40, 0.3) 100%);
    border-radius: 8px;
    border: none;
    margin: 0;
    padding: 0;
    /* Transizione SOLO su background */
    transition: background-color 0.3s ease, background-image 0.3s ease;
}

/* Thumb - quando mouse è DENTRO la tabella */
/* Cambia SOLO background - TUTTO IL RESTO identico */
.table-container:hover::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
        #ff5252 0%,
        #c62828 50%,
        #ff5252 100%);
    /* Tutto il resto IDENTICO - nessun filter, nessun box-shadow */
    border-radius: 8px;
    border: none;
    margin: 0;
    padding: 0;
}

/* Thumb - quando mouse è sulla scrollbar STESSA */
/* Colore ancora più luminoso - TUTTO IL RESTO identico */
.table-container:hover::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
        #ff6b6b 0%,
        #ff5252 50%,
        #ff6b6b 100%);
    /* Tutto il resto IDENTICO */
    border-radius: 8px;
    border: none;
    margin: 0;
    padding: 0;
}

/* Firefox Scrollbar - dimensione FISSA, cambia SOLO colore */
.table-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(198, 40, 40, 0.3) rgba(0, 0, 0, 0.3);
}

.table-container:hover {
    /* Dimensione UGUALE - cambia SOLO colore */
    scrollbar-width: thin;
    scrollbar-color: #ff5252 rgba(0, 0, 0, 0.3);
}

/* === FILTERS — PREMIUM RESTORE ===================================== */

/* ============================================================
   DEMO PREMIUM: Glass-morphism + Glow Effect
   Applicato alla filters-card come esempio del nuovo stile
============================================================ */

/* OPZIONE C - Layout inline (label e input stessa riga) */
.filters-card {
    /* Glass-morphism background */
    background: rgba(29, 29, 29, 0.7);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);

    border-radius: 14px;
    padding: 0.7rem 0.5rem; /* Ridotto a 0.5rem per uniformità con table-container */
    margin-bottom: 1.5rem;
    min-height: 100px; /* Altezza fissa uniformata con stat-card */

    /* Multi-layer shadow per profondità 3D */
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.35),
        0 3px 12px rgba(198, 40, 40, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25);

    /* Gradient border */
    border: 1px solid transparent;
    background-clip: padding-box;

    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gradient border effect usando pseudo-elemento */
.filters-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(198, 40, 40, 0.4) 0%,
        rgba(198, 40, 40, 0.12) 50%,
        rgba(198, 40, 40, 0.32) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.6;
    transition: all 0.4s ease;
}

/* Hover effect - Glow intenso e lift */
.filters-card:hover {
    background: rgba(29, 29, 29, 0.82);
    transform: translateY(-1px);

    box-shadow:
        0 12px 38px rgba(0, 0, 0, 0.45),
        0 6px 18px rgba(198, 40, 40, 0.18),
        0 0 40px rgba(198, 40, 40, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.filters-card:hover::before {
    opacity: 0.9;
    background: linear-gradient(135deg,
        rgba(198, 40, 40, 0.55) 0%,
        rgba(198, 40, 40, 0.2) 50%,
        rgba(198, 40, 40, 0.5) 100%);
}

/* Ambient light effect sotto la card */
.filters-card::after {
    content: '';
    position: absolute;
    bottom: -25px;
    left: 5%;
    right: 5%;
    height: 25px;
    background: radial-gradient(ellipse, rgba(198, 40, 40, 0.2) 0%, transparent 70%);
    filter: blur(15px);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
}

.filters-card:hover::after {
    opacity: 0.6;
}

/* === ACTIVE FILTERS INDICATOR ===================================== */
/* Filtri attivi inline (accanto al titolo "Filters") */
.active-filters-container-inline {
    display: none; /* Hidden by default, shown when filters are active */
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    max-width: 70%;
}

.active-filters-container-inline.visible {
    display: flex;
}

/* Vecchio stile mantenuto per compatibilità (non più usato) */
.active-filters-container {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(198, 40, 40, 0.25);
    display: none;
    align-items: center;
    gap: 0.6rem;
}

.active-filters-container.visible {
    display: flex;
    flex-wrap: wrap;
}

.active-filters-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #d0d0d0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    flex-shrink: 0;
    opacity: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    flex: 1;
}

/* Sfondo scuro elegante con accento rosso - OPZIONE C: Bordo spesso + Glow moderato */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    position: relative;
    z-index: 10;
    background: linear-gradient(135deg, rgba(45, 20, 20, 0.98) 0%, rgba(30, 15, 15, 1) 100%);
    border: 3px solid rgba(255, 100, 100, 1);
    border-radius: 7px;
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
    color: #ffffff;
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.4),
        0 0 12px rgba(198, 40, 40, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: chipFadeIn 0.3s ease;
    backdrop-filter: blur(8px) saturate(150%);
}

@keyframes chipFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.filter-chip:hover {
    background: linear-gradient(135deg, rgba(60, 25, 25, 1) 0%, rgba(40, 18, 18, 1) 100%);
    border-color: rgba(255, 120, 120, 1);
    transform: translateY(-2px);
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(198, 40, 40, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.filter-chip-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    font-size: 0.85rem;
}

.filter-chip-value {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-size: 0.85rem;
}

.filter-chip-remove {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.1rem 0.25rem;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.3rem;
    font-weight: 700;
}

.filter-chip-remove:hover {
    color: #ffffff;
    background: rgba(198, 40, 40, 0.3);
    transform: scale(1.2) rotate(90deg);
    box-shadow: 0 0 8px rgba(198, 40, 40, 0.4);
}

/* Reset All Filters Button - Option B: Red Accent */
.reset-filters-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: transparent;
    border: 2px solid rgba(198, 40, 40, 0.5);
    border-radius: 7px;
    color: rgba(255, 100, 100, 0.9);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    animation: chipFadeIn 0.3s ease;
}

.reset-filters-button:hover {
    background: rgba(198, 40, 40, 0.15);
    border-color: rgba(198, 40, 40, 0.9);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(198, 40, 40, 0.4), 0 0 15px rgba(198, 40, 40, 0.3);
}

.reset-filters-button .reset-icon {
    display: inline-block;
    transition: transform 0.5s ease;
}

.reset-filters-button:hover .reset-icon {
    transform: rotate(360deg);
}

.filters-grid-2col { display:flex; flex-wrap:nowrap; gap:0.65rem; }

/* Layout verticale - Label sopra, input sotto */
.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 0.3rem;
    display: block;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-input,
.filter-select {
    /* Sfondo scuro con leggera sfumatura rossa coerente con i select globali */
    background: linear-gradient(145deg, rgba(30, 10, 10, 0.92) 0%, rgba(18, 18, 18, 0.92) 100%);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);

    color: #ffffff;
    font-weight: 500;

    /* Bordo rosso più marcato */
    border: 2px solid rgba(198, 40, 40, 0.5);

    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(198, 40, 40, 0.1),
        inset 0 1px 2px rgba(198, 40, 40, 0.08);

    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

input.filter-input,
select.filter-select,
select#chartLimitSelector,
select {
    box-sizing: border-box;
}

/* Hover su filtri - glow rosso delicato */
.filter-input:hover,
.filter-select:hover {
    border-color: rgba(198, 40, 40, 0.7);

    /* Sfondo leggermente più luminoso */
    background: linear-gradient(145deg, rgba(35, 12, 12, 0.95) 0%, rgba(22, 22, 22, 0.95) 100%);

    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.35),
        0 0 15px rgba(198, 40, 40, 0.3),
        inset 0 1px 2px rgba(198, 40, 40, 0.12);

    transform: translateY(-1px);
}

.filter-input:focus,
.filter-select:focus {
    /* Bordo rosso intenso con glow */
    border-color: rgba(198, 40, 40, 1);

    /* Sfondo più luminoso */
    background: linear-gradient(145deg, rgba(40, 15, 15, 0.95) 0%, rgba(25, 25, 25, 0.95) 100%);

    box-shadow:
        0 0 0 3px rgba(198, 40, 40, 0.25),
        0 0 18px rgba(198, 40, 40, 0.5),
        0 4px 10px rgba(0, 0, 0, 0.4),
        inset 0 1px 3px rgba(198, 40, 40, 0.15);

    outline: none;
    transform: translateY(-1px);
}

/* OPZIONE B - Section title ridotto */
.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg,
        #ffffff 0%,
        rgba(198, 40, 40, 0.9) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(198, 40, 40, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-family: "Futura Md", "Futura", "Poppins", "Inter", sans-serif;
}

.filter-hint {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: #9e9e9e;
}


.filter-col,
.filter-full {
    flex: 1 1 0;
}

/* === HYPER PREMIUM MODE === */

/* Micro-pulse hover */
.table-container tbody tr {
    transition: box-shadow .25s cubic-bezier(0.4, 0, 0.2, 1);
}
.table-container tbody tr:hover {
    box-shadow: inset 0 0 0 1px rgba(198,40,40,0.25),
                0 0 12px rgba(0,150,255,0.1);
}

/* ========================================= */
/* GLOBAL SELECT STYLING - COERENZA DESIGN  */
/* ========================================= */

/* Tutti i select del dashboard */
select {
    /* Sfondo scuro con leggera sfumatura rossa */
    background: linear-gradient(145deg, rgba(30, 10, 10, 0.95) 0%, rgba(18, 18, 18, 0.95) 100%);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);

    /* Testo bianco pulito */
    color: #ffffff;
    font-weight: 500;

    /* Bordo rosso più visibile + doppio bordo interno */
    border: 2px solid rgba(198, 40, 40, 0.6);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(198, 40, 40, 0.15),
        inset 0 1px 2px rgba(198, 40, 40, 0.1);

    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    /* MANTIENI freccia nativa del browser per compatibilità menu */
    /* appearance: none; */ /* DISABILITATO - causa menu bianco illeggibile */

    padding: 0.5rem 0.8rem;
    border-radius: 8px;
}

/* Rimuovi outline di default del browser e sostituisci con bordo rosso */
select:focus {
    outline: none !important;

    /* Bordo rosso intenso + glow luminoso */
    border-color: rgba(198, 40, 40, 1) !important;
    box-shadow:
        0 0 0 3px rgba(198, 40, 40, 0.25),
        0 0 20px rgba(198, 40, 40, 0.6),
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 3px rgba(198, 40, 40, 0.2) !important;

    /* Sfondo leggermente più chiaro */
    background: linear-gradient(145deg, rgba(40, 15, 15, 0.98) 0%, rgba(25, 25, 25, 0.98) 100%);

    /* Leggero lift effect */
    transform: translateY(-1px);
}

/* Hover su tutti i select */
select:hover {
    border-color: rgba(198, 40, 40, 0.8);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 18px rgba(198, 40, 40, 0.4),
        inset 0 1px 2px rgba(198, 40, 40, 0.15);

    /* Sfondo più luminoso */
    background: linear-gradient(145deg, rgba(35, 12, 12, 0.98) 0%, rgba(22, 22, 22, 0.98) 100%);
    transform: translateY(-1px);
}

/* Active state (quando si clicca) */
select:active {
    border-color: rgba(198, 40, 40, 1);
    transform: scale(0.98) translateY(0);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.4),
        0 0 12px rgba(198, 40, 40, 0.5),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Stile per le opzioni dei dropdown - TEMA SCURO */
/* NOTA: Chrome/Edge hanno supporto limitato per option styling,
   usiamo menu nativo del browser per garantire leggibilità */
select option {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 0.5rem;
}

/* Firefox supporta meglio lo styling delle opzioni */
@-moz-document url-prefix() {
    select option {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    select option:checked {
        background: linear-gradient(135deg, #c62828 0%, #8e0000 100%);
        color: #ffffff;
        font-weight: 600;
    }
}

/* Chart limit selector specifico - EREDITA GLI STILI GLOBALI */
#chartLimitSelector {
    /* Eredita gli stili globali dei select, aggiungi solo specifiche */
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Gli stili hover, focus e option sono ereditati dagli stili globali select */

/* Section soft blend */
.table-section,
.filters-card,
.stats-grid {
    background: radial-gradient(circle at top left, #2d2d2d 0%, #1a1a1a 60%);
}

/* === ITALIANALAB COMPACT STYLES - OPZIONE C === */
.ita-label-compact {
    font-size: 0.75rem;
    margin-bottom: 0;
    min-width: 60px;
    margin-right: 0.4rem;
}

.ita-input-compact {
    padding: 0.4rem 0.6rem;
    font-size: 0.82rem;
}

.ita-hint-compact {
    margin-top: 0.5rem;
    font-size: 0.78rem;
}

/* Scrollbar styles moved to line 757 (SCROLL ENHANCEMENT section) */


/* ==== HEADER TABLE ROSSO SPENTO BRAND ==== */

/* ========================================================================
   SOLUZIONE ATTIVA: SOLUZIONE 1 - MULTI-RIGA COMPATTA (CONSIGLIATA)

   Per passare alla SOLUZIONE 2 (Rotazione diagonale):
   1. Commenta tutto il blocco "SOLUZIONE 1" (da riga sotto fino a "FINE SOLUZIONE 1")
   2. Decommenta il blocco "SOLUZIONE 2" più sotto
   ======================================================================== */

/* ====== SOLUZIONE 1: MULTI-RIGA COMPATTA - INIZIO ====== */
.table-container thead {
    position: relative;
    z-index: 100 !important;
}

/* STILE BASE HEADER - REPORT (CATAS) - STANDARD */
table thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    height: 30px !important;
    padding: 4px 10px !important;
    background: #c62828 !important;
    color: #ffffff !important;
    border-bottom: 2px solid rgba(255,255,255,0.35) !important;
    font-family: "Futura Md", "Futura", "Poppins", "Inter", sans-serif !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em !important;
    text-transform: uppercase !important;
    text-align: center !important;
    white-space: nowrap !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.65) !important;
    background-clip: padding-box !important;
    transform: translateZ(0) !important;
    will-change: transform !important;
}

/* OVERRIDE PER ITALIANALAB - Titoli completi senza abbreviazioni */
/* ALTEZZA FISSA uguale a REPORT per scrollbar uniforme */
#itaTableHead th {
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    padding: 2px 8px !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em !important;
    text-align: center !important;
    white-space: normal !important;
    line-height: 1.1 !important;
    vertical-align: middle !important;
    cursor: help !important;
    transition: background-color 0.2s ease !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

table thead th:hover {
    background: #cc2b2b !important;
}
/* ====== SOLUZIONE 1: MULTI-RIGA COMPATTA - FINE ====== */


/* ====== SOLUZIONE 2: ROTAZIONE DIAGONALE - INIZIO (COMMENTATA) ====== */
/*
.table-container thead {
    position: relative;
    z-index: 100 !important;
}

table thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    height: 120px !important;
    padding: 0 !important;
    background: #c62828 !important;
    color: #ffffff !important;
    border-bottom: 2px solid rgba(255,255,255,0.35) !important;
    border-right: 1px solid rgba(255,255,255,0.15) !important;
    font-family: "Futura Md", "Futura", "Poppins", "Inter", sans-serif !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.03em !important;
    text-transform: uppercase !important;
    text-align: left !important;
    white-space: nowrap !important;
    vertical-align: bottom !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.65) !important;
    background-clip: padding-box !important;
    will-change: transform !important;
    cursor: help !important;
    transition: background-color 0.2s ease !important;
}

table thead th > * {
    display: block;
    transform: rotate(-45deg) translateX(-10px);
    transform-origin: bottom left;
    padding: 8px 12px;
    width: 140px;
    text-align: left;
    line-height: 1.2;
}

table thead th:hover {
    background: #d32f2f !important;
}

table thead th:last-child {
    border-right: none !important;
}
*/
/* ====== SOLUZIONE 2: ROTAZIONE DIAGONALE - FINE ====== */

/* Assicura che tbody sia sotto thead */
.table-container tbody {
    position: relative;
    z-index: 0;
    overflow: visible;
}

.table-container tbody tr {
    /* Rimosso position: relative per evitare sovrapposizioni con thead sticky */
}

.table-container tbody td {
    position: static !important;
    z-index: auto !important;
}

/* === CHARTS === */
/* PREMIUM: Charts card con glass-morphism */
.charts-card {
    background: rgba(29, 29, 29, 0.7);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: 16px;
    padding: 1.2rem 1.6rem;
    margin-bottom: 2.5rem;

    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.35),
        0 3px 12px rgba(198, 40, 40, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25);

    border: 1px solid transparent;
    background-clip: padding-box;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.charts-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(198, 40, 40, 0.32) 0%,
        rgba(198, 40, 40, 0.08) 50%,
        rgba(198, 40, 40, 0.26) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.4s ease;
}

.charts-card:hover {
    background: rgba(29, 29, 29, 0.82);
    transform: translateY(-1px);
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.45),
        0 6px 18px rgba(198, 40, 40, 0.16),
        0 0 28px rgba(198, 40, 40, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.charts-card:hover::before {
    opacity: 1;
}

/* Ambient light effect */
.charts-card::after {
    content: '';
    position: absolute;
    inset: -30px;
    border-radius: 50%;
    background: radial-gradient(
        circle at 50% 0%,
        rgba(198, 40, 40, 0.06) 0%,
        rgba(198, 40, 40, 0.02) 40%,
        transparent 70%
    );
    z-index: -1;
    pointer-events: none;
    opacity: 0.55;
    transition: opacity 0.4s ease;
}

.charts-card:hover::after {
    opacity: 1;
}

/* PREMIUM: Chart title con gradient text */
.chart-title {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg,
        #ffffff 0%,
        rgba(198, 40, 40, 0.9) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(198, 40, 40, 0.3);
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-align: center;
    font-family: "Futura Md", "Futura", "Poppins", "Inter", sans-serif;
    letter-spacing: 0.02em;
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

.footer-note {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    font-size: 0.9rem;
    color: #b0b0b0;
}

/* === ICONE PDF ELEGANTI === */

/* PDF Column Header - Uniformato agli altri */
table thead th.pdf-column-header {
    min-width: 72px !important;
    width: 72px !important;
}

/* PDF Column Cells - Uniformato alle altre colonne */
.pdf-icon-cell {
    text-align: center;
    padding: 0.65rem !important;
    overflow: visible !important;
    position: relative !important;
    min-width: 76px !important;
    width: 76px !important;
}

.pdf-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 7px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    text-decoration: none;
}

/* PDF disponibile - icona senza bagliore di default */
.pdf-available {
    background: rgba(76, 175, 80, 0.12);
}

.pdf-available:hover {
    transform: translateY(-2px) scale(1.08);
    background: rgba(76, 175, 80, 0.2);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35),
                0 0 12px rgba(76, 175, 80, 0.55);
}

.pdf-available svg {
    transition: filter 0.3s ease;
}

.pdf-available:hover svg {
    filter: drop-shadow(0 0 8px rgba(76, 175, 80, 0.8));
}

/* PDF non disponibile - X rossa senza riquadro di default */
.pdf-unavailable {
    background: transparent;
    box-shadow: none;
    border: none;
    cursor: not-allowed;
    opacity: 0.85;
    background: rgba(239, 83, 80, 0.12);
}

.pdf-unavailable:hover {
    opacity: 1;
    background: rgba(239, 83, 80, 0.22);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35),
                0 0 12px rgba(239, 83, 80, 0.55);
}

.pdf-unavailable svg {
    transition: filter 0.3s ease;
}

.pdf-unavailable:hover svg {
    filter: drop-shadow(0 0 6px rgba(239, 83, 80, 0.6));
}

/* Animazione pulsante per richiamare attenzione */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3),
                    0 0 20px rgba(76, 175, 80, 0.4),
                    inset 0 1px 3px rgba(76, 175, 80, 0.2);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.5),
                    0 0 30px rgba(76, 175, 80, 0.6),
                    inset 0 1px 5px rgba(76, 175, 80, 0.3);
    }
}

/* ========================================= */
/* EASTER EGG MODAL STYLES                   */
/* ========================================= */
.easter-egg-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: eggFadeIn 0.3s ease;
}

.easter-egg-modal.active {
    display: flex;
}

@keyframes eggFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.easter-egg-content {
    background: radial-gradient(circle at top left, #2d2d2d 0%, #1a1a1a 60%);
    border-radius: 16px;
    padding: 2rem;
    max-width: 550px;
    width: 90%;
    position: relative;
    border: 2px solid rgba(198, 40, 40, 0.3);
    animation: eggSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 85vh;
    overflow-y: auto;
}

@keyframes eggSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.easter-egg-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(198, 40, 40, 0.2);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.easter-egg-close:hover {
    background: rgba(198, 40, 40, 0.5);
    transform: rotate(90deg);
}

.easter-egg-title {
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: 0.3rem;
    text-align: center;
}

.easter-egg-subtitle {
    color: #aaa;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 0.95rem;
}

.easter-egg-department {
    text-align: center;
    color: #ff9800;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.8rem;
}

.easter-egg-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.easter-egg-image-container img {
    width: 100%;
    max-width: 180px;
    height: auto;
    border-radius: 10px;
    border: 2px solid rgba(198, 40, 40, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    animation: eggPhotoFadeIn 0.8s ease backwards;
    transition: all 0.3s ease;
}

.easter-egg-image-container img:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 10px 30px rgba(198, 40, 40, 0.5);
}

@keyframes eggPhotoFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.easter-egg-image-placeholder {
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    text-align: center;
}

.easter-egg-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.easter-egg-stat-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid #2196f3;
    text-align: center;
}

.easter-egg-stat-label {
    color: #999;
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.easter-egg-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
}

.easter-egg-achievement {
    margin-top: 1rem;
    color: #4caf50;
    font-size: 0.95rem;
    text-align: center;
}

/* Logo shake animation on click */
@keyframes logoShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px) rotate(-3deg); }
    75% { transform: translateX(5px) rotate(3deg); }
}

/* Confetti animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    z-index: 100000;
    pointer-events: none;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ========================================= */
/* EXPORT BUTTON STYLES                      */
/* ========================================= */
.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.65rem;
    background: linear-gradient(135deg, #c62828 0%, #8e0000 100%);
    color: #ffffff;
    border: none;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(198, 40, 40, 0.3);
    font-family: "Futura Md", "Futura", "Poppins", "Inter", sans-serif;
}

.export-btn:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.5);
}

.export-btn:active {
    transform: translateY(0);
}

.export-btn svg {
    width: 13px;
    height: 13px;
}

/* ========================================= */
/* SORTABLE COLUMN HEADERS                   */
/* ========================================= */
.table-container thead th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.table-container thead th.sortable:hover {
    background: #cc2b2b !important;
}

.table-container thead th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 8px;
    opacity: 0.3;
    font-size: 0.8rem;
}

.table-container thead th.sorted-asc::after {
    content: '↑';
    opacity: 1;
    color: #fff;
}

.table-container thead th.sorted-desc::after {
    content: '↓';
    opacity: 1;
    color: #fff;
}

/* ========================================= */
/* LOADING SKELETON                          */
/* ========================================= */
.skeleton-row {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton-cell {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    height: 20px;
    border-radius: 4px;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ========================================= */
/* ADDITIONAL CHARTS                         */
/* ========================================= */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

/* Responsive layout for charts grid */
@media (max-width: 900px) {
    .charts-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================= */
/* MOBILE HAMBURGER MENU FOR FILTERS        */
/* ========================================= */

/* Hamburger toggle button (visible only on mobile) */
.filter-toggle-btn {
    display: none; /* Nascosto su desktop */
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c62828 0%, #8e0000 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.4);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
}

.filter-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(198, 40, 40, 0.6);
}

.filter-toggle-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Sidebar mobile per filtri */
.filters-sidebar-mobile {
    display: none; /* Nascosto su desktop */
    position: fixed;
    top: 0;
    right: -100%; /* Inizialmente fuori schermo */
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

.filters-sidebar-mobile.open {
    right: 0;
}

.filters-sidebar-mobile .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(198, 40, 40, 0.3);
}

.filters-sidebar-mobile .sidebar-title {
    color: #c62828;
    font-size: 20px;
    font-weight: 600;
}

.filters-sidebar-mobile .sidebar-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.filters-sidebar-mobile .sidebar-close:hover {
    color: #c62828;
    transform: rotate(90deg);
}

/* Overlay scuro quando sidebar è aperta */
.filters-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filters-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile responsive */
@media (max-width: 768px) {
    /* Rendi i filtri verticali su schermi stretti */
    .filters-card {
        padding: 0.8rem;
        margin-bottom: 1rem;
    }
    
    /* Forza layout verticale per TUTTI i div nei filtri che hanno display flex inline */
    .filters-card div[style*="display"][style*="flex"],
    .filters-card div[style*="display: flex"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.8rem !important;
        align-items: stretch !important;
    }
    
    /* Rimuovi flex: 1 dai figli perche ora sono verticali */
    .filters-card div[style*="flex: 1"] {
        flex: none !important;
        width: 100% !important;
    }
    
    /* Fai in modo che tutti gli elementi dei filtri prendano larghezza piena */
    .filters-card input,
    .filters-card select,
    .filters-card .filter-input,
    .filters-card .filter-select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    /* Riduci padding per salvare spazio */
    .filter-label {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }
    

    .filter-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .filters-sidebar-mobile {
        display: block;
    }
    
    /* FILTRI SEMPRE VISIBILI - hamburger menu opzionale */
    /*
    .filters-card {
        display: none !important;
    }
    */
}

/* Badge con contatore filtri attivi */
.filter-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff5722;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Assicura che body e main non taglino contenuto su mobile */
@media (max-width: 600px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
        padding: 10px;
    }
    
    main {
        padding: 0.5rem;
        overflow: visible;
    }
    
    /* Filtri ancora più compatti su schermi molto stretti */
    .filters-card {
        padding: 0.5rem;
    }
    
    .filter-input,
    .filter-select {
        padding: 0.5rem !important;
        font-size: 14px !important;
    }
    
    /* Assicura che tutti i div con style inline si adattino */
    .filters-card div[style] {
        max-width: 100% !important;
    }
}


/* ============================================================
   MOBILE RESPONSIVENESS - IMPLEMENTAZIONE COMPLETA
   Zero impatto su desktop - Tutte modifiche in media queries
============================================================ */

/* ===== FASE 1: CORREZIONI CRITICHE ===== */

/* 1.1 TABELLE - Overflow Orizzontale + Prima Colonna Sticky */
@media (max-width: 768px) {
    .table-section {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .table-container {
        border-radius: 12px;
        padding: 0 0.3rem 0.8rem 0.3rem;
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-container table {
        min-width: 600px;
        font-size: 0.85rem;
    }

    /* Prima colonna sticky per migliore UX */
    .table-container tbody td:first-child,
    .table-container thead th:first-child {
        position: sticky;
        left: 0;
        z-index: 10;
        background: inherit;
        box-shadow: 2px 0 4px rgba(0,0,0,0.1);
    }

    /* 1.2 STAT CARDS - Griglia Adattiva */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
        gap: 1.4rem;
        margin-bottom: 1.2rem;
    }

    .stat-card {
        padding: 0.6rem 0.4rem;
        min-height: 90px;
    }

    .stat-value-digit {
        width: 2.4rem;
        height: 3.2rem;
    }

    .stat-value-number {
        height: 3.2rem;
        font-size: 3rem;
    }

    .stat-label {
        font-size: 0.75rem;
        max-width: 28%;
    }

    .stat-note {
        font-size: 0.7rem;
        max-width: 28%;
    }

    /* 1.3 NAVIGAZIONE TAB - Overflow Fix */
    .tabs-container {
        padding: 4px;
        border-radius: 12px;
        gap: 0;
        width: 95%;
        margin: 1.2rem auto 1.5rem;
    }

    .tab-button {
        padding: 0.75rem 1.8rem;
        font-size: 0.82rem;
        letter-spacing: 0.08em;
        border-radius: 9px;
    }

    /* 1.4 GRAFICI - Griglia Responsive */
    .charts-grid {
        grid-template-columns: 1fr !important;
    }

    .chart-container {
        height: 240px;
    }

    /* 2.1 ICONE PDF - Touch Target */
    .pdf-icon-link {
        width: 42px;
        height: 42px;
        border-radius: 6px;
    }

    .pdf-icon-link svg {
        width: 26px;
        height: 26px;
    }

    .pdf-icon-cell {
        padding: 0.8rem !important;
        min-width: 74px !important;
        width: 74px !important;
    }

    table thead th.pdf-column-header {
        min-width: 76px !important;
        width: 76px !important;
    }

    /* 2.2 FILTRI - Touch Target */
    .filter-chip {
        padding: 0.5rem 0.85rem;
        font-size: 0.88rem;
        border-width: 2px;
        gap: 0.6rem;
    }

    .filter-chip-label,
    .filter-chip-value {
        font-size: 0.88rem;
    }

    .filter-chip-remove {
        font-size: 1.1rem;
        padding: 0.2rem 0.35rem;
        min-width: 28px;
        min-height: 28px;
    }

    .reset-filters-button {
        padding: 0.5rem 1rem;
        font-size: 0.88rem;
        min-height: 44px;
    }

    /* 2.3 LEGGIBILITÀ TESTO */
    body {
        font-size: 15px;
    }

    .section-title {
        font-size: 1.1rem;
    }

    .filter-label {
        font-size: 0.85rem;
    }

    .filter-input,
    .filter-select {
        font-size: 0.9rem;
        padding: 0.55rem 0.75rem;
        min-height: 44px;
    }

    .filter-hint {
        font-size: 0.82rem;
    }

    /* 3.1 HEADER RESPONSIVE */
    header {
        padding: 1.2rem 1rem !important;
    }

    header > div {
        gap: 0.8rem !important;
    }

    header img[alt="Italiana Ferramenta"] {
        height: 42px !important;
    }

    header h1 {
        font-size: 1.6rem !important;
        letter-spacing: 0 !important;
    }

    header img[alt="Italiana Lab"] {
        height: 38px !important;
    }

    /* 3.2 SPAZIATURA CONTAINER */
    main {
        padding: 0 0.8rem;
        margin-bottom: 2.5rem;
    }

    /* 3.4 MODAL EASTER EGG */
    .easter-egg-content {
        width: 95%;
        max-width: 450px;
        padding: 1.5rem;
        max-height: 80vh;
    }

    .easter-egg-title {
        font-size: 1.4rem;
    }

    .easter-egg-subtitle {
        font-size: 0.9rem;
    }

    .easter-egg-department {
        font-size: 0.8rem;
    }

    .easter-egg-image-container img {
        max-width: 150px;
    }

    .easter-egg-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    /* 3.5 MODAL NOTIFICHE */
    .modal-content {
        width: 95%;
        max-width: 450px;
        margin: 5% auto;
        border-radius: 16px;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-icon-bg {
        width: 70px;
        height: 70px;
        margin-bottom: 0.8rem;
    }

    .modal-icon-svg {
        font-size: 2.5rem;
    }

    .modal-title {
        font-size: 1.3rem;
    }

    .modal-body {
        padding: 2rem;
    }

    .modal-message {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.8rem;
    }

    .modal-btn {
        padding: 16px 24px;
        width: 100%;
    }

    /* 3.6 TOOLTIP MOBILE */
    .modern-tooltip {
        right: auto;
        left: 50%;
        top: auto;
        bottom: calc(100% + 8px);
        transform: translateX(-50%);
        width: auto;
        min-width: 150px;
        padding: 8px 12px;
        font-size: 0.78rem;
    }

.modern-tooltip.tooltip-long {
    min-width: 150px;
}

.modern-tooltip::after {
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: 6px solid transparent;
        border-top-color: #2d2d2d;
        border-left-color: transparent;
    }

    .tooltip-success::after {
        border-top-color: #2e7d32;
        border-left-color: transparent;
    }

    .tooltip-warning::after {
        border-top-color: #f57c00;
        border-left-color: transparent;
    }

.tooltip-info {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    border-color: rgba(33, 150, 243, 0.35);
}

.tooltip-info::after {
    border-top-color: #2196f3;
    border-left-color: transparent;
}
.tooltip-error::after {
        border-top-color: #c62828;
        border-left-color: transparent;
    }

    /* 3.7 EXPORT BUTTON MOBILE */
    .export-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        gap: 0.3rem;
        min-height: 44px;
    }

    .export-btn svg {
        width: 15px;
        height: 15px;
    }
}

/* ===== BREAKPOINT 640px - Telefoni Standard ===== */
@media (max-width: 640px) {
    /* STAT CARDS */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
        gap: 0.8rem;
    }

    .stat-card {
        padding: 0.5rem 0.3rem;
        min-height: 85px;
    }

    .stat-value-digit {
        width: 2.2rem;
        height: 3rem;
    }

    .stat-value-number {
        height: 3rem;
        font-size: 2.7rem;
    }

    /* TAB NAVIGATION */
    .tabs-container {
        padding: 3px;
        border-radius: 10px;
        width: 92%;
        flex-wrap: wrap;
    }

    .tab-button {
        padding: 0.7rem 1.5rem;
        font-size: 0.78rem;
        letter-spacing: 0.06em;
        border-radius: 8px;
    }

    /* HEADER */
    header {
        padding: 1rem 0.8rem !important;
    }

    header > div {
        flex-direction: column !important;
        gap: 0.6rem !important;
    }

    header img[alt="Italiana Ferramenta"] {
        height: 38px !important;
    }

    header h1 {
        font-size: 1.4rem !important;
        text-align: center !important;
    }

    header img[alt="Italiana Lab"] {
        height: 35px !important;
    }
}

/* ===== BREAKPOINT 480px - Telefoni Piccoli ===== */
@media (max-width: 480px) {
    /* TABELLE */
    .table-container {
        padding: 0 0.2rem 0.6rem 0.2rem;
    }

    .table-container table {
        min-width: 500px;
        font-size: 0.8rem;
    }

    .table-container thead th {
        font-size: 0.68rem !important;
        padding: 6px 8px !important;
        height: 34px !important;
    }

    .table-container tbody td {
        padding: 0.6rem 0.5rem;
    }

    /* STAT CARDS */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 0.7rem;
    }

    .stat-card {
        padding: 0.5rem 0.3rem;
        min-height: 80px;
    }

    .stat-value-digit {
        width: 2rem;
        height: 2.8rem;
    }

    .stat-value-number {
        height: 2.8rem;
        font-size: 2.5rem;
    }

    .stat-label {
        font-size: 0.72rem;
    }

    .stat-note {
        font-size: 0.68rem;
    }

    /* TAB NAVIGATION - Stack Verticale */
    .tabs-container {
        padding: 3px;
        border-radius: 8px;
        width: 90%;
        flex-direction: column;
    }

    .tab-button {
        padding: 0.65rem 1.2rem;
        font-size: 0.75rem;
        width: 100%;
        border-radius: 7px;
    }

    .tab-button:not(:last-child)::after {
        display: none;
    }

    /* GRAFICI */
    .charts-grid {
        gap: 0.8rem;
    }

    .charts-card {
        padding: 0.8rem 1rem;
        margin-bottom: 1.5rem;
    }

    .chart-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .chart-container {
        height: 220px;
    }

    /* PDF ICONS */
    .pdf-icon-link {
        width: 44px;
        height: 44px;
    }

    .pdf-icon-link svg {
        width: 28px;
        height: 28px;
    }

    .pdf-icon-cell {
        padding: 0.9rem !important;
        min-width: 76px !important;
        width: 76px !important;
    }

    table thead th.pdf-column-header {
        min-width: 80px !important;
        width: 80px !important;
    }

    /* FILTRI - Stack Verticale */
    .filter-chip {
        padding: 0.55rem 0.9rem;
        font-size: 0.9rem;
    }

    .filter-chip-remove {
        min-width: 32px;
        min-height: 32px;
    }

    .filter-chips {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-chip {
        width: 100%;
        justify-content: space-between;
    }

    /* LEGGIBILITÀ */
    body {
        font-size: 14px;
    }

    .section-title {
        font-size: 1.05rem;
    }

    .filter-label {
        font-size: 0.88rem;
        margin-bottom: 0.4rem;
    }

    .filter-input,
    .filter-select {
        font-size: 0.92rem;
        padding: 0.6rem 0.8rem;
        min-height: 46px;
    }

    /* HEADER */
    header {
        padding: 0.8rem 0.6rem !important;
    }

    header img[alt="Italiana Ferramenta"] {
        height: 35px !important;
    }

    header h1 {
        font-size: 1.2rem !important;
    }

    header img[alt="Italiana Lab"] {
        height: 32px !important;
    }

    /* CONTAINER */
    main {
        padding: 0 0.5rem;
        margin-bottom: 2rem;
    }

    /* EASTER EGG MODAL */
    .easter-egg-content {
        width: 98%;
        padding: 1.2rem;
        max-height: 85vh;
    }

    .easter-egg-title {
        font-size: 1.3rem;
    }

    .easter-egg-close {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
        top: 0.8rem;
        right: 0.8rem;
    }

    .easter-egg-image-container img {
        max-width: 130px;
    }

    /* NOTIFICHE MODAL */
    .modal-content {
        width: 98%;
        margin: 3% auto;
        border-radius: 14px;
    }

    .modal-header {
        padding: 1.2rem;
    }

    .modal-icon-bg {
        width: 60px;
        height: 60px;
    }

    .modal-title {
        font-size: 1.2rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-message {
        font-size: 0.9rem;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }

    /* EXPORT BUTTON */
    .export-btn {
        padding: 0.55rem 0.9rem;
        font-size: 0.82rem;
        min-height: 46px;
    }

    .export-btn svg {
        width: 16px;
        height: 16px;
    }
}


/* ===== BUTTON RIPPLE EFFECT ===== */
.tab-button {
    position: relative;
    overflow: hidden;
}

.tab-button .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 600ms ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}


/* ===== PDF NOT SATISFACTORY ICONS (Yellow warning state) ===== */
.pdf-pending-cell {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.05) 0%, rgba(255, 152, 0, 0.1) 100%) !important;
}

.pdf-pending {
    cursor: pointer;
    animation: pulse-pending 2s infinite ease-in-out;
    background: rgba(255, 152, 0, 0.12);
}

@keyframes pulse-pending {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.pdf-pending:hover {
    animation: none;
    transform: scale(1.08) !important;
    filter: drop-shadow(0 0 12px rgba(255, 152, 0, 0.6));
    background: rgba(255, 152, 0, 0.2);
}


/* ===== PDF PENDING CLOCK (Blue pending state) ===== */
.pdf-pending-clock-cell {
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.06) 0%, rgba(79, 195, 247, 0.12) 100%) !important;
}

.pdf-pending-clock {
    cursor: default;
    background: rgba(79, 195, 247, 0.12);
}

.pdf-pending-clock:hover {
    transform: scale(1.06) !important;
    filter: drop-shadow(0 0 12px rgba(79, 195, 247, 0.55));
    background: rgba(79, 195, 247, 0.2);
}

.pdf-pending-clock svg {
    animation: pendingClockSpin 1.4s linear infinite;
    transform-origin: 50% 50%;
    transform-box: fill-box;
    display: block;
    will-change: transform;
}

/* ===== MODERN TOOLTIPS ===== */
.pdf-icon-wrapper {
    display: inline-block;
    position: relative;
}

.modern-tooltip {
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    color: #fff;
    padding: 7px 10px; /* Aumentato ulteriormente per più spazio */
    border-radius: 6px;
    font-size: 0.75rem; /* Aumentato per migliore leggibilità */
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease,
                visibility 0.15s ease;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.65); /* Aumentato per tooltip più grande */
    border: 1px solid rgba(255,255,255,0.15);
    pointer-events: none;
    width: auto;
    min-width: 150px; /* Più spazio per testi lunghi (es. NOT SATISFACTORY) */
    text-align: center;
    line-height: 1.3;
}

.modern-tooltip.tooltip-long {
    min-width: 150px;
}

.pdf-icon-wrapper:hover .modern-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Tooltip Arrow - Points from left side */
.modern-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border: 6px solid transparent; /* Aumentato per proporzionare al tooltip più grande */
    border-left-color: #2d2d2d;
}

/* Tooltip Icons */
.tooltip-icon {
    display: inline-block;
    margin-right: 2px;
    font-size: 0.7rem; /* Aumentato per proporzionare al tooltip */
}

.modern-tooltip strong {
    font-weight: 600;
    font-size: 0.75rem; /* Aumentato per proporzionare al tooltip */
}

/* Tooltip variants */
.tooltip-success {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    border-color: rgba(76, 175, 80, 0.3);
}

.tooltip-success::after {
    border-left-color: #2e7d32;
    border-width: 6px;
}

.tooltip-warning {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    border-color: rgba(255, 152, 0, 0.3);
}

.tooltip-warning::after {
    border-left-color: #f57c00;
    border-width: 6px;
}

.tooltip-info {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    border-color: rgba(33, 150, 243, 0.35);
}

.tooltip-info::after {
    border-left-color: #2196f3;
    border-width: 6px;
}

.tooltip-error {
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    border-color: rgba(239, 83, 80, 0.3);
}

.tooltip-error::after {
    border-left-color: #c62828;
    border-width: 6px;
}

.pdf-icon-wrapper:hover .pdf-pending {
    animation: none;
}

/* Tooltip positioning - Always left side (variants removed) */

/* ===== MODERN MODAL ===== */
.notification-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
    margin: 8% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    border: 2px solid rgba(255, 152, 0, 0.3);
    animation: slideDown 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

@keyframes slideDown {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #f57c00 0%, #ff9800 100%);
    padding: 2rem;
    text-align: center;
    position: relative;
}

.modal-icon-bg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin-bottom: 1rem;
    animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
    }
}

.modal-icon-svg {
    font-size: 3rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.modal-body {
    padding: 2.5rem;
}

.modal-message {
    color: #ddd;
    font-size: 1rem;
    line-height: 1.8;
    text-align: center;
    margin-bottom: 2rem;
}

.modal-message strong {
    color: #fff;
    font-weight: 600;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(33, 150, 243, 0.15);
    border: 1px solid rgba(33, 150, 243, 0.3);
    padding: 12px 20px;
    border-radius: 12px;
    color: #64b5f6;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 1rem auto;
    max-width: fit-content;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #f57c00 0%, #ff9800 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.theme-toggle-btn {
    border: 1px solid rgba(0, 0, 0, 0.25);
    background: #6f6f6f;
    color: #f5f5f5;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle-btn:hover {
    background: #7a7a7a;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.tabs-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0.6rem 1rem 0;
    position: relative;
}

/* === ITALIANALAB LANDING ================================================== */
.italab-landing {
    margin: 0.5rem auto 2.5rem;
}

.italab-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 1.2rem;
    align-items: stretch;
}

.italab-card {
    padding: 0.5rem 1rem 1rem;
    min-height: 520px;
    height: 100%;
    position: relative;
}

.italab-card:first-child {
    border-left: none;
}

.italab-card:not(:first-child)::before {
    content: '';
    position: absolute;
    left: -0.6rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 1px 0 0 rgba(255, 255, 255, 0.05);
}

.italab-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin: 0.3rem 0 0.8rem;
    color: #ffffff;
    font-family: "Futura Md", "Futura", "Poppins", "Inter", sans-serif;
    line-height: 1.2;
    min-height: 2.4em;
    border-left: 3px solid #c62828;
    padding-left: 10px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6), 0 0 8px rgba(198, 40, 40, 0.25);
}

.italab-image {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0.6rem;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2);
    margin-bottom: 1.2rem;
}

.italab-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.italab-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.italab-action-btn {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.08);
    color: #e8e8e8;
    font-size: 0.85rem;
    text-decoration: none;
    text-align: left;
    line-height: 1.2;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.italab-action-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}


/* Outer glow for chart button on hover */
.italab-action-btn--chart:hover {
    box-shadow:
        0 0 0 1px rgba(198, 40, 40, 0.35),
        0 0 18px rgba(198, 40, 40, 0.45),
        0 0 36px rgba(198, 40, 40, 0.25);
}

/* Emphasize chart button on hover (dark theme) */
.italab-action-btn:hover .italab-action-icon--chart {
    box-shadow:
        0 0 0 1px rgba(198, 40, 40, 0.45),
        0 0 12px rgba(198, 40, 40, 0.6),
        0 0 24px rgba(198, 40, 40, 0.35);
    border-color: rgba(198, 40, 40, 0.7);
}

.italab-action-btn .italab-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.italab-action-icon--video,
.italab-action-icon--chart {
    position: relative;
    background: rgba(20, 20, 20, 0.75);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Filmstrip icon (closer to example) */
.italab-action-icon--video {
    border-radius: 4px;
    background-color: #141414;
    background-image:
        radial-gradient(#f2f2f2 2px, transparent 3px),
        radial-gradient(#f2f2f2 2px, transparent 3px);
    background-size: 10px 10px, 10px 10px;
    background-position: 5px 5px, 5px calc(100% - 5px);
    background-repeat: repeat-x;
}

.italab-action-icon--video::before {
    content: '';
    position: absolute;
    inset: 7px 6px;
    background: #f2f2f2;
    border-radius: 2px;
}

.italab-action-icon--video::after {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid #2b2b2b;
}

/* Chart icon (bigger + colored bars) */
.italab-action-icon--chart {
    width: 42px;
    height: 42px;
    border-radius: 6px;
}

.italab-action-icon--chart::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-left: 2px solid #f2f2f2;
    border-bottom: 2px solid #f2f2f2;
    border-radius: 2px;
}

.italab-action-icon--chart::after {
    content: '';
    position: absolute;
    left: 14px;
    bottom: 11px;
    width: 5px;
    height: 16px;
    background: #ff5252;
    border-radius: 1px;
    box-shadow:
        7px -4px 0 0 #4fc3f7,
        14px -9px 0 0 #ffee58;
}


@media (max-width: 1100px) {
    .italab-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .italab-card {
        border-left: none;
        border-top: 2px solid rgba(255, 255, 255, 0.08);
        padding-top: 1rem;
    }

    .italab-card::before {
        content: none;
    }

    .italab-card:nth-child(-n + 2) {
        border-top: none;
    }
}

@media (max-width: 640px) {
    .italab-grid {
        grid-template-columns: 1fr;
    }

    .italab-card {
        border-top: 2px solid rgba(255, 255, 255, 0.08);
        padding-top: 1rem;
        min-height: auto;
    }

    .italab-card::before {
        content: none;
    }

    .italab-card:first-child {
        border-top: none;
    }
}

.theme-toggle-pill {
    --toggle-width: 115px;
    --toggle-height: 44px;
    --toggle-pad: 10px;
    --toggle-thumb: 32px;
    --thumb-right: calc(var(--toggle-width) - (var(--toggle-pad) * 2) - var(--toggle-thumb));
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #f5f5f5;
    padding: 0 0.6rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    position: absolute;
    right: 1rem;
    width: var(--toggle-width);
    height: var(--toggle-height);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
}

.theme-toggle-pill:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.theme-toggle-thumb {
    position: absolute;
    top: 6px;
    left: var(--toggle-pad);
    width: var(--toggle-thumb);
    height: var(--toggle-thumb);
    background: #f2f2f2;
    border-radius: 50%;
    transition: transform 0.32s ease-out, background 0.2s ease;
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
    transform: translateX(var(--thumb-right));
    z-index: 1;
}

.theme-toggle-pill:not(.theme-toggle-elegante) .theme-toggle-thumb {
    box-shadow:
        0 6px 14px rgba(0,0,0,0.35),
        inset 0 2px 3px rgba(255,255,255,0.55),
        inset 0 -3px 5px rgba(0,0,0,0.25);
}

.theme-toggle-elegante .theme-toggle-thumb {
    transform: translateX(0);
    background: #f2f2f2;
    box-shadow:
        0 6px 14px rgba(0,0,0,0.28),
        inset 0 2px 3px rgba(255,255,255,0.6),
        inset 0 -3px 5px rgba(0,0,0,0.18);
}

.theme-toggle-pill.theme-toggle-animating.theme-toggle-to-elegante .theme-toggle-thumb {
    animation: thumbMagnetToLeft 0.45s cubic-bezier(0.22, 0.8, 0.2, 1) both;
}

.theme-toggle-pill.theme-toggle-animating.theme-toggle-to-default .theme-toggle-thumb {
    animation: thumbMagnetToRight 0.45s cubic-bezier(0.22, 0.8, 0.2, 1) both;
}

@keyframes thumbMagnetToLeft {
    0% { transform: translateX(var(--thumb-right)); }
    70% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

@keyframes thumbMagnetToRight {
    0% { transform: translateX(0); }
    70% { transform: translateX(calc(var(--thumb-right) + 4px)); }
    100% { transform: translateX(var(--thumb-right)); }
}

.theme-toggle-line {
    position: absolute;
    left: 46px;
    right: 46px;
    top: 50%;
    height: 2px;
    background: rgba(255,255,255,0.35);
    transform: translateY(-50%);
    z-index: 0;
}

.theme-toggle-icon {
    width: var(--toggle-thumb);
    height: var(--toggle-thumb);
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
    position: absolute;
    top: 6px;
    opacity: 0.3;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.theme-toggle-icon-left { left: var(--toggle-pad); }
.theme-toggle-icon-right { right: var(--toggle-pad); }

.theme-toggle-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.theme-toggle-pill:not(.theme-toggle-elegante) .theme-toggle-icon-right svg path,
.theme-toggle-pill:not(.theme-toggle-elegante) .theme-toggle-icon-right svg circle {
    fill: #0d47a1;
}

.theme-toggle-elegante .theme-toggle-icon-left,
.theme-toggle-pill:not(.theme-toggle-elegante) .theme-toggle-icon-right {
    opacity: 1;
}

.theme-toggle-pill:not(.theme-toggle-elegante) .theme-toggle-icon-right {
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.35), inset 0 -2px 4px rgba(0,0,0,0.45);
}

.theme-toggle-pill.theme-toggle-elegante .theme-toggle-icon-left,
.theme-toggle-pill:not(.theme-toggle-elegante) .theme-toggle-icon-right {
    background: transparent;
    box-shadow: none;
}

@media (max-width: 700px) {
    .tabs-row {
        flex-direction: column;
        align-items: center;
    }

    .theme-toggle-pill {
        position: static;
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: rotate(90deg);
}

/* Pending clock animation (icone PDF pending) */
.pending-clock {
    animation: pendingClockSpin 1.4s linear infinite;
    transform-origin: 50% 50%;
    transform-box: fill-box;
    display: block;
    will-change: transform;
}

@keyframes pendingClockSpin {
    to {
        transform: rotate(360deg);
    }
}



/* Fade + Slide transition for tab panels */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-panel--anim {
    animation: tabClipReveal 220ms ease both;
}

@keyframes tabClipReveal {
    from { opacity: 0; clip-path: inset(0 0 100% 0); }
    to { opacity: 1; clip-path: inset(0 0 0 0); }
}


/* ============================================================================
   MOBILE USABILITY OVERRIDES (NON-FUNCTIONAL)
   Obiettivo: migliorare leggibilita e fruibilita su smartphone/tablet senza
   toccare logiche o comportamenti JavaScript.
============================================================================ */

html {
    -webkit-text-size-adjust: 100%;
}

@media (max-width: 900px) {
    .site-header {
        padding: 1rem 0.8rem;
    }

    .site-header__inner {
        gap: 0.7rem;
        padding: 0.45rem 0.6rem;
    }

    .site-header__title {
        font-size: clamp(1.25rem, 3.2vw, 1.6rem);
        line-height: 1.2;
    }

    .tabs-row {
        padding: 0.45rem 0.7rem 0;
        gap: 0.75rem;
    }

    .tabs-container {
        width: min(100%, 620px);
        margin: 1rem auto 1.1rem;
    }

    .tab-button {
        min-height: 44px;
        padding: 0.78rem 1.25rem;
        font-size: 0.82rem;
        letter-spacing: 0.07em;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
        gap: 0.8rem;
    }

    .stat-card {
        min-height: 94px;
        padding: 0.65rem 0.45rem;
    }

    .stat-value-digit {
        width: 2.35rem;
        height: 3rem;
    }

    .stat-value-number {
        height: 3rem;
        font-size: 2.8rem;
    }

    .filters-card {
        padding: 0.85rem 0.7rem;
    }

    .filter-label {
        font-size: 0.82rem;
    }

    .filter-input,
    .filter-select,
    .export-btn,
    #chartLimitSelector {
        min-height: 44px;
        font-size: 16px;
    }

    .table-container {
        border-radius: 12px;
        padding: 0 0.35rem 0.75rem 0.35rem;
    }

    .table-container table {
        min-width: 680px;
    }

    .table-container thead th,
    .table-container tbody td {
        padding: 0.72rem 0.55rem;
        white-space: nowrap;
    }

    .pdf-icon-link {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
    }

    .charts-grid {
        gap: 1.4rem;
    }

    .chart-container {
        height: 250px;
    }
}

@media (max-width: 768px) {
    .tabs-container {
        width: 100%;
    }

    .theme-toggle-pill {
        --toggle-height: 42px;
        height: var(--toggle-height);
    }

    .table-section {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }

    .table-container {
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-container table {
        min-width: 700px;
    }

    .table-container thead th:first-child,
    .table-container tbody td:first-child {
        left: 0;
        z-index: 11;
        background: #202020;
    }

    .table-container tbody tr:nth-child(even) td:first-child {
        background: #2a2a2a;
    }

    .filter-toggle-btn {
        width: 60px;
        height: 60px;
        bottom: 16px;
        right: 16px;
    }

    .filters-sidebar-mobile {
        width: min(88vw, 340px);
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: 0.9rem 0.65rem;
    }

    .site-header__logo--primary {
        height: 40px;
    }

    .site-header__logo--lab {
        height: 38px;
    }

    .site-header__title {
        font-size: clamp(1.1rem, 4.5vw, 1.35rem);
    }

    .tabs-row {
        gap: 0.6rem;
    }

    .tabs-container {
        display: flex;
        width: 100%;
    }

    .tab-button {
        flex: 1;
        padding: 0.75rem 0.6rem;
        font-size: 0.74rem;
        letter-spacing: 0.05em;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .table-container table {
        min-width: 620px;
        font-size: 0.82rem;
    }

    .table-container thead th,
    .table-container tbody td {
        padding: 0.67rem 0.5rem;
    }

    .chart-container {
        height: 220px;
    }
}

.tab-button:focus-visible,
.theme-toggle-pill:focus-visible,
.filter-toggle-btn:focus-visible,
.export-btn:focus-visible,
.pdf-icon-link:focus-visible {
    outline: 2px solid rgba(198, 40, 40, 0.95);
    outline-offset: 2px;
}

.tab-button:active,
.export-btn:active,
.filter-toggle-btn:active {
    transform: scale(0.98);
}


/* MOBILE HOTFIX: COUNTERS + THEME TOGGLE (VERTICAL) */
@media (max-width: 768px) {
    /* JS odometer usa step fisso 3.8rem: manteniamo altezza coerente */
    .stat-value-digit {
        height: 3.8rem !important;
    }

    .stat-value-number {
        height: 3.8rem !important;
        line-height: 1;
    }

    .stat-value {
        left: 50%;
        transform: translate(-50%, -50%);
    }

    /* Toggle tema: icone sempre dentro la pill */
    .theme-toggle-pill {
        --toggle-width: 120px;
        --toggle-height: 44px;
        --toggle-pad: 10px;
        --toggle-thumb: 32px;
        overflow: hidden;
    }

    .theme-toggle-thumb,
    .theme-toggle-icon {
        top: calc((var(--toggle-height) - var(--toggle-thumb)) / 2);
    }

    .theme-toggle-line {
        left: calc(var(--toggle-pad) + var(--toggle-thumb) + 4px);
        right: calc(var(--toggle-pad) + var(--toggle-thumb) + 4px);
    }
}

@media (max-width: 480px) {
    .theme-toggle-pill {
        --toggle-width: 116px;
    }

    .theme-toggle-icon svg {
        width: 16px;
        height: 16px;
    }
}


/* Unsatisfactory modal title alignment */
.modal-title--warning {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    text-align: center;
    line-height: 1.15;
}

.modal-title--warning .modal-title-top {
    font-size: 0.68em;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.modal-title--warning .modal-title-main {
    font-size: 1em;
    font-weight: 800;
}

@media (max-width: 768px) {
    .modal-title--warning .modal-title-top {
        font-size: 0.72em;
    }
}

/* Unsatisfactory modal vertical alignment */
.modal-header--warning {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
}

.modal-icon-bg--warning {
    margin-bottom: 0;
    flex-shrink: 0;
}

.modal-title--warning {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.1rem;
    line-height: 1.1;
    text-align: left;
}

.modal-title--warning .modal-title-top,
.modal-title--warning .modal-title-main {
    font-size: 1em;
    font-weight: 800;
    letter-spacing: 0;
}






/* INLINE STYLE EXTRACTION UTILITIES (index.html) */
.u-link-plain { text-decoration: none; }
.u-stats-grid-3 { grid-template-columns: repeat(3, 1fr); }
.u-stats-grid-mb-15 { margin-bottom: 1.5rem; }
.u-stat-accent-green { border-left: 6px solid #0f0; }
.u-stat-accent-blue { border-left: 6px solid #2196F3; }
.u-stat-accent-red { border-left: 6px solid #c62828; }
.u-stat-accent-orange { border-left: 6px solid #ff9800; }
.u-stat-accent-purple { border-left: 6px solid #ba68c8; }
.u-flex-between-center-mb-075 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.u-section-title-inline { display: flex; align-items: center; gap: 10px; margin-bottom: 0; }
.u-flex-end-gap-065 { display: flex; gap: 0.65rem; align-items: flex-end; }
.u-flex-1 { flex: 1; }
.u-table-section-flush { margin-top: 0; padding-top: 0; }
.u-charts-grid-split { grid-template-columns: 3fr 1fr; }
.u-flex-between-center-mb-08 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.u-chart-title-reset { margin: 0; }
.u-chart-controls { display: flex; align-items: center; gap: 0.5rem; }
.u-chart-controls-label { color: #aaa; font-size: 0.85rem; font-weight: 500; }
.u-chart-container-280 { height: 280px; }
.u-chart-container-300 { height: 300px; }
.u-chart-info-label { text-align: center; color: #aaa; font-size: 0.8rem; margin-top: 0.5rem; font-weight: 500; }
.u-egg-icon { font-size: 2.5rem; text-align: center; margin-bottom: 0.8rem; }
.u-egg-dept-tight { margin-bottom: 0.5rem; margin-top: 0; }
.u-hidden { display: none; }
.u-egg-placeholder-text { color: #666; font-size: 0.85rem; }
.u-egg-placeholder-path { color: #444; font-size: 0.7rem; margin-top: 0.5rem; }
.u-egg-border-left-green { border-left-color: #4caf50; }
.u-egg-border-left-orange { border-left-color: #ff9800; }
.u-egg-border-left-blue { border-left-color: #2196f3; }
.u-egg-border-left-purple { border-left-color: #9c27b0; }
.u-egg-current-view { font-size: 1.1rem; line-height: 1.3; }
.u-modal-message-mt-075 { margin-top: 0.75rem; }
.u-svg-no-shrink { flex-shrink: 0; }




