﻿/* RESET E BASE */
body.kiosk-mode {
    margin: 0;
    background: #0b0f14;
    color: #eaeaea;
    font-family: "Segoe UI", sans-serif;
    overflow-x: hidden; /* Evita scroll laterali fastidiosi */
}

.top-bar {
    height: 60px;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    background: #121826;
    align-items: center;
    font-size: 18px;
    box-sizing: border-box;
}

/* GRID PRINCIPALE */
.dashboard-grid {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 20px;
    padding: 15px;
    box-sizing: border-box;
}

/* WIDGETS */
.top-cards, .bottom-widgets {
    display: grid;
    gap: 15px;
}

.top-cards {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.bottom-widgets {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.widget {
    background: #161c2d;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* COMPORTAMENTO MONITOR (PC/KIOSK) */
@media (min-width: 769px) {
    .dashboard-grid {
        height: calc(100vh - 60px); /* Blocca l'altezza allo schermo */
        overflow: hidden; /* Evita lo scroll della pagina intera */
    }

    .bottom-widgets {
        overflow-y: auto; /* Permette lo scroll solo se i widget eccedono lo spazio */
        padding-right: 5px; /* Spazio per la scrollbar */
    }

        /* OPZIONALE: Nasconde la scrollbar esteticamente su PC */
        .bottom-widgets::-webkit-scrollbar {
            width: 6px;
        }

        .bottom-widgets::-webkit-scrollbar-thumb {
            background: #333;
            border-radius: 10px;
        }
}

/* COMPORTAMENTO MOBILE */
@media (max-width: 768px) {
    .dashboard-grid {
        height: auto; /* La grid si allunga quanto serve */
        display: flex; /* Cambiamo in flex per impilare meglio */
        flex-direction: column;
    }

    .top-cards, .bottom-widgets {
        display: flex;
        flex-direction: column;
        height: auto;
        overflow: visible; /* Disabilita scroll interni, usa quello di sistema */
    }

    .widget {
        min-height: 200px;
        margin-bottom: 5px;
    }

    /* Header cliente nella Index */
    .header {
        font-size: 1.5em !important;
        text-align: center;
    }
}

/* VALORI INTERNI (CLAMP) */
.widget-inner {
    padding: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.widget-value {
    font-size: clamp(2rem, 5vw, 4rem); /* Ridotto leggermente il max per evitare scroll */
    font-weight: bold;
    line-height: 1.1;
    text-align:center;
}
