/* ==========================================================================
   FOGLIO DI STILE DEDICATO ALLA VISUALIZZAZIONE MOBILE (< 768px)
   ========================================================================== */

@media (max-width: 767.98px) {

    /* --- 1. BARRA PULSANTI SUPERIORE --- */
    .top-action-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem;
    }

    .top-action-bar .btn {
        width: 100% !important;
        margin: 0 !important;
    }

    /* --- 2. CARD INTESTAZIONE E TITOLO --- */
    .header-card {
        padding: 0.75rem !important;
    }

    .header-card h3 {
        font-size: 1.15rem !important;
        line-height: 1.35 !important;
        margin-bottom: 0.5rem !important;
    }

    /* --- 3. BARRA STATO E DATA (Affiancati puliti su Mobile) --- */
    .header-status-date {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        margin-top: 0.6rem !important;
        padding-top: 0.5rem !important;
        border-top: 1px solid #e9ecef !important;
    }

    .header-status-date .badge {
        font-size: 0.8rem !important;
        padding: 0.4em 0.6em !important;
    }

    /* --- 4. COLONNA STAZIONE BLOCCATA (Sticky Column) --- */
    .table-responsive {
        position: relative;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Blocchiamo la 1ª colonna (Stazione) a sinistra durante lo scroll */
    .table-responsive table th:nth-child(1),
    .table-responsive table td:nth-child(1) {
        position: -webkit-sticky;
        position: sticky;
        left: 0;
        z-index: 5;
        background-color: #ffffff !important;
        box-shadow: 3px 0px 5px rgba(0, 0, 0, 0.12);
    }

    .table-responsive table thead tr:first-child th:nth-child(1) {
        background-color: #f8f9fa !important;
        z-index: 6;
    }

    .table-responsive table th, 
    .table-responsive table td {
        padding: 0.4rem 0.3rem !important;
        font-size: 0.85rem !important;
        white-space: nowrap;
    }
}