/* ===== HEADER DESKTOP ===== */
.container-header {
    background-color: #ffffff !important;
    background-image: none !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

.container-header .mod-menu a, 
.container-header .mod-menu button {
    color: #000000 !important;
    font-weight: 600;
}

.container-header .mod-menu a:hover {
    color: #c62828 !important;
}

/* ===== MOBILE MENU ===== */
@media (max-width: 991px) {
    .container-header .navbar {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
        flex-wrap: wrap !important;
    }

    .container-header .navbar-toggler {
        order: 1 !important;
        margin-right: 15px !important;
        border: 1px solid #000000 !important;
        background-color: transparent !important;
    }

    .navbar-brand {
        order: 2 !important;
        margin: 0 !important;
        text-align: left !important;
    }

    .container-header .navbar-toggler .icon-menu,
    .container-header .navbar-toggler .icon-menu::before {
        filter: invert(1) brightness(0) !important;
    }

    .navbar-collapse {
        order: 3 !important;
        flex-basis: 100% !important;
    }

    .mod-menu {
        text-align: left !important;
        margin-top: 10px !important;
        padding-left: 0 !important;
    }
}

/* ===== CAMPI CUSTOM ===== */
.fields-container {
    font-size: 1.2rem !important;
    margin-top: 20px;
}

.fields-container a[href^="tel:"] {
    color: #c62828 !important;
    font-weight: bold;
    font-size: 1.4rem !important;
    text-decoration: none;
}

.fields-container a[href^="tel:"]:hover {
    text-decoration: underline;
}

/* ===== FIX FINALE TABELLA - COLORE BLU ISTITUZIONALE ===== */
.custom-container-table {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.disclaimer-left {
    flex: 1 1 100%;
    border-left: 4px solid #c62828;
    padding-left: 15px;
    font-size: 0.9rem;
}

.table-wrapper {
    width: 100% !important;
    overflow: hidden !important;
}

.tabella-fixed {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse;
    border: 1px solid #e0e0e0;
}

.tabella-fixed th, .tabella-fixed td {
    padding: 10px 5px !important;
    font-size: 1.05rem !important;
    border: 1px solid #eee;
    word-wrap: break-word !important;
    white-space: normal !important;
    vertical-align: middle;
}

/* Stile per i link dei comuni in BLU SCURO ISTITUZIONALE */
.tabella-fixed td a {
    text-decoration: underline !important;
    color: #0056b3 !important; /* Blu più profondo e professionale */
    font-weight: 600;
}

.tabella-fixed td a:hover {
    color: #003d7a !important; /* Ancora più scuro al passaggio del mouse */
    text-decoration: none !important;
}

/* Proporzioni colonne */
.tabella-fixed th:nth-child(1), .tabella-fixed td:nth-child(1) { width: 45%; }
.tabella-fixed th:nth-child(2), .tabella-fixed td:nth-child(2) { width: 25%; text-align: center; }
.tabella-fixed th:nth-child(3), .tabella-fixed td:nth-child(3) { width: 30%; text-align: center; }

.status-green { color: green; font-weight: bold; }

/* Adattamento specifico per Mobile */
@media (max-width: 767px) {
    .tabella-fixed th, .tabella-fixed td {
        font-size: 0.95rem !important;
        padding: 8px 3px !important;
    }
}

@media (min-width: 768px) {
    .disclaimer-left { flex: 0 0 25%; }
    .table-wrapper { flex: 0 0 70%; }
}

/* ===== MIGLIORIA MOBILE TABELLA (OTTIMIZZATA) ===== */
@media (max-width: 767px) {

    /* Mette il disclaimer SOPRA la tabella invece che di fianco */
    .custom-container-table {
        flex-direction: column !important;
        gap: 20px;
    }

    .disclaimer-left, 
    .table-wrapper {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    /* Migliora leggibilità e spaziatura tasti */
    .tabella-fixed th, 
    .tabella-fixed td {
        font-size: 0.95rem !important;
        padding: 12px 6px !important; /* Aumentato per facilitare il tocco con le dita */
    }

    /* Manteniamo proporzioni fisse per evitare che la tabella sfori */
    .tabella-fixed th:nth-child(1), .tabella-fixed td:nth-child(1) { width: 40% !important; }
    .tabella-fixed th:nth-child(2), .tabella-fixed td:nth-child(2) { width: 30% !important; }
    .tabella-fixed th:nth-child(3), .tabella-fixed td:nth-child(3) { width: 30% !important; }
}