/* /css/bandi.css */

/* -----------------------------
   Layout split bandi: 2 colonne
   - sinistra: lista
   - destra: dettaglio
----------------------------- */
.bandi-split-layout {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 18px;
    align-items: start;
}

.bandi-split-layout .left-column-list,
.bandi-split-layout .center-column-details {
    min-width: 0;
}

/* Sticky dettagli */
#center-column-details-container {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow: auto;
}

/* Evidenzia card selezionata */
.bando-card-compact.selected-card {
    outline: 2px solid color-mix(in srgb, var(--meedico-bando, #047857) 40%, transparent);
}

/* Responsive: sotto 992px layout a colonna singola */
@media (max-width: 991px) {
    .bandi-split-layout {
        display: block;
    }

    #center-column-details-container {
        position: static;
        max-height: none;
        overflow: visible;
        margin-top: 16px;
    }
}

/* -----------------------------
   Barra ricerca top row (no inline)
----------------------------- */
.bandi-filter-top-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.bandi-search-input {
    flex: 1;
    min-width: 220px;
}

/* -----------------------------
   Barra filtri stile "subito.it"
   - input con icona
   - tooltip flottanti (hover/focus e tap mobile)
----------------------------- */
.bandi-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.bandi-subito-form.filter-form {
    /* RESET: evita che erediti layout obsoleto da offerte.css (.filter-form) */
    display: block;
    flex-direction: unset;
    align-items: stretch;
    gap: 0;
    padding: 0;
    margin: 0 0 18px 0;
    background: transparent !important;
    box-shadow: none;
    backdrop-filter: none;
    border: 0;
}

/* Variabili colore (devono valere anche dentro i modali) */
:root {
    --bandi-primary: #0b5fff;
    --bandi-primary-hover: #0a53e6;
    --bandi-text: #141414;
    --bandi-muted: rgba(20,20,20,0.72);
    --bandi-border: rgba(0,0,0,0.10);
}

.bandi-searchbar {
    width: 100%;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 14px;
    padding: 10px 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.07);
    max-width: 920px; /* evita tagli su desktop */
    margin: 0 auto;
}

@media (min-width: 992px) {
    .bandi-searchbar {
        position: sticky;
        top: 78px; /* sotto la navbar */
        z-index: 50;
    }
}

/* Migliora tap/UX su mobile */
.bandi-searchbar button,
.bandi-searchbar input,
.bandi-searchbar select {
    touch-action: manipulation;
}

@media (prefers-reduced-motion: reduce) {
    .bandi-filters-sheet,
    .bandi-filters-overlay,
    .meedico-tooltip {
        transition: none !important;
    }
}

.bandi-searchbar-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
    overflow: visible; /* non tagliare i bottoni su desktop */
}

.bandi-searchbar-field {
    min-width: 0;
}

.bandi-searchbar-field {
    flex: 0 0 auto;
}

.bandi-searchbar-field:first-child {
    min-width: 360px;
    flex: 1 1 520px;
}

.bandi-searchbar-actions {
    flex: 0 0 auto;
}

.bandi-input-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 14px;
    border: 1px solid var(--bandi-border);
    background: rgba(255, 255, 255, 0.92);
    transition: box-shadow 160ms ease, border-color 160ms ease;
}

.bandi-input-pill:focus-within {
    border-color: rgba(11, 95, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(11, 95, 255, 0.14);
}

.bandi-input-pill i {
    color: rgba(60,60,60,0.70);
    flex: 0 0 auto;
}

.bandi-input-pill input {
    border: 0;
    outline: none;
    background: transparent;
    width: 100%;
    min-width: 0;
    font-size: 0.98rem;
    padding: 0;
    height: 22px;
}

.bandi-pill-info {
    flex: 0 0 auto;
}

.bandi-searchbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.bandi-btn-save-search {
    height: 42px;
    align-self: center;
    gap: 8px;
    flex: 0 0 auto;
    white-space: nowrap;
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.bandi-btn-save-search i {
    font-size: 1.05rem;
}

.bandi-btn-save-search:hover {
    background: #218838;
    border-color: #218838;
}

.bandi-btn-save-search:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.22);
}

/* Evita stili ereditati da offerte.css (.save-search-btn ha margin-top su mobile) */
.bandi-subito-form .save-search-btn {
    margin-top: 0 !important;
}

.bandi-save-label {
    font-weight: 900;
    font-size: 0.92rem;
}

/* Desktop: testo completo */
.bandi-save-label--short {
    display: none;
}

/* Mobile: manteniamo i 3 bottoni visibili senza overflow,
   ma accorciamo la label del salva ricerca */
@media (max-width: 900px) {
    .bandi-save-label--full {
        display: none;
    }
    .bandi-save-label--short {
        display: inline;
    }
}

/* Desktop "medio": evita che la label lunga venga troncata nella barra */
@media (max-width: 1200px) {
    .bandi-save-label--full {
        display: none;
    }
    .bandi-save-label--short {
        display: inline;
    }
}

.bandi-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    padding: 10px 14px;
    height: 42px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 120ms ease, background-color 160ms ease, border-color 160ms ease;
    white-space: nowrap;
}

.bandi-btn:hover {
    transform: translateY(-1px);
}

.bandi-btn:active {
    transform: translateY(1px);
}

.bandi-btn-primary {
    background: var(--bandi-primary);
    color: #fff;
    border-color: rgba(0,0,0,0.06);
}
.bandi-btn-primary:hover {
    background: var(--bandi-primary-hover);
}

.bandi-btn-outline {
    background: rgba(255,255,255,0.85);
    border-color: rgba(0,0,0,0.14);
    color: #222;
}
.bandi-btn-outline:hover {
    background: rgba(255,255,255,0.95);
}

.bandi-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.bandi-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,123,255,0.08);
    border: 1px solid rgba(0,123,255,0.18);
    color: #0b3d91;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 0.9rem;
}

.bandi-chip button {
    border: 0;
    background: transparent;
    cursor: pointer;
    color: rgba(11,61,145,0.75);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 2px;
}

.bandi-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 10px;
}

.bandi-link-btn {
    border: 0;
    background: transparent;
    padding: 6px 4px;
    cursor: pointer;
    color: rgba(20,20,20,0.80);
    font-weight: 800;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bandi-link-btn:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .bandi-searchbar {
        max-width: none;
        margin: 0;
    }
    .bandi-searchbar-row {
        /* Mobile: niente scroll orizzontale, bottoni sempre visibili */
        flex-wrap: wrap;
        overflow-x: visible;
    }
    .bandi-searchbar-field:first-child {
        min-width: 0;
        flex: 1 1 100%;
    }
    .bandi-searchbar-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 10px;
        justify-content: stretch;
    }
    .bandi-searchbar-actions .bandi-btn {
        width: 100%;
    }
}

.bandi-filters-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(11, 95, 255, 0.12);
    border: 1px solid rgba(11, 95, 255, 0.22);
    color: rgba(11, 61, 145, 0.95);
    font-size: 0.82rem;
    font-weight: 900;
}

.bandi-filters-secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: stretch;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

/* Nel modale filtri: allinea i CTA come bottoni */
.bandi-filters-secondary-actions .bandi-btn {
    height: 42px;
    width: 100%;
    justify-content: center;
}

/* Override del CSS globale (richiedi_regioni.css) che aggiunge margin-bottom a #toggleRegionSidebarBtn */
.bandi-filters-secondary-actions #toggleRegionSidebarBtn {
    margin-bottom: 0 !important;
}

@media (max-width: 640px) {
    .bandi-filters-secondary-actions {
        grid-template-columns: 1fr;
    }
}

/* CTA stato vuoto per area geo non coperta */
.bandi-empty-geo-cta {
    margin-top: 14px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.65);
    border: 1px solid rgba(0,0,0,0.08);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.bandi-empty-geo-cta-text {
    margin: 0;
    color: rgba(20,20,20,0.78);
    font-weight: 700;
}

.bandi-load-more {
    margin-top: 14px;
    display: flex;
    justify-content: center;
}

/* Paginazione */
.bandi-pagination {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.bandi-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(255,255,255,0.85);
    color: rgba(20,20,20,0.85);
    text-decoration: none;
    font-weight: 900;
    transition: transform 120ms ease, background-color 160ms ease, border-color 160ms ease;
}

.bandi-page:hover {
    background: rgba(255,255,255,0.95);
    transform: translateY(-1px);
}

.bandi-page-current {
    background: rgba(11,95,255,0.10);
    border-color: rgba(11,95,255,0.22);
    color: rgba(11,61,145,0.95);
}

.bandi-page-disabled {
    opacity: 0.45;
    cursor: default;
    transform: none !important;
}

.bandi-page-ellipsis {
    border: 0;
    background: transparent;
    min-width: auto;
    padding: 0 2px;
}

/* Bottom-sheet filtri */
.bandi-filters-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.50);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
    z-index: 9998;
}

.bandi-filters-sheet {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%) translateY(18px);
    width: min(760px, 96vw);
    /* dvh = viewport dinamico (PWA/mobile): evita che i fixed finiscano sotto UI di sistema */
    max-height: calc(100dvh - 36px);
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.26);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 9999;
    overflow: hidden;
}

.bandi-filters-sheet.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.bandi-filters-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.bandi-filters-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.bandi-filters-sheet-title {
    font-size: 1.05rem;
    font-weight: 900;
    color: #222;
}

.bandi-filters-sheet-close {
    border: 0;
    background: transparent;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: rgba(0,0,0,0.65);
    padding: 2px 8px;
}

.bandi-filters-sheet-body {
    padding: 14px;
    overflow: auto;
    max-height: calc(100dvh - 180px);
    overflow-x: hidden; /* evita scroll orizzontale */
}

.bandi-filters-sheet-footer {
    /* 48px: fallback robusto quando la webview non espone correttamente la safe-area */
    padding-bottom: max(48px, calc(12px + env(safe-area-inset-bottom, 0px)));
}

.bandi-filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    min-width: 0;
}

.bandi-filter-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.bandi-filter-block label,
.bandi-filter-block span {
    font-weight: 900;
    font-size: 0.9rem;
    color: rgba(20,20,20,0.85);
}

.bandi-filter-block select,
.bandi-filter-block input[type="date"],
.bandi-filter-block input[type="text"] {
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.12);
    padding: 10px 12px;
    font-size: 0.95rem;
    background: rgba(255,255,255,0.90);
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.bandi-filter-block input[type="text"]:focus,
.bandi-filter-block input[type="date"]:focus,
.bandi-filter-block select:focus {
    outline: none;
    border-color: rgba(11, 95, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(11, 95, 255, 0.14);
}

/* Override mirato: offerte.css applica regole molto specifiche a #search_query */
.bandi-filters-sheet #search_query {
    width: 100% !important;
    height: 44px !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(0,0,0,0.12) !important;
    background: rgba(255,255,255,0.90) !important;
    box-shadow: none !important;
    background-image: none !important;
    box-sizing: border-box !important;
}

.bandi-filters-sheet #search_query:focus {
    border-color: rgba(11, 95, 255, 0.45) !important;
    box-shadow: 0 0 0 4px rgba(11, 95, 255, 0.14) !important;
    outline: none !important;
}

.bandi-filter-block-label-with-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.bandi-filter-block-dates {
    grid-column: 1 / -1;
}

.bandi-date-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.bandi-date-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bandi-filters-sheet-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 12px 14px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

/* Contrasto garantito nel footer del modale filtri */
.bandi-filters-sheet-footer .bandi-btn-primary {
    background: var(--bandi-primary, #0b5fff) !important;
    color: #ffffff !important;
    border-color: rgba(0,0,0,0.10) !important;
}

.bandi-filters-sheet-footer .bandi-btn-primary:hover {
    background: var(--bandi-primary-hover, #0a53e6) !important;
}

.bandi-filters-sheet-footer .bandi-btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(11, 95, 255, 0.22);
}

/* Fallback ultra-specifico: se altri CSS sovrascrivono i bottoni submit */
.bandi-filters-sheet-footer button[type="submit"] {
    background: var(--bandi-primary, #0b5fff) !important;
    color: #ffffff !important;
}

.bandi-filters-sheet-footer button[type="submit"]:hover {
    background: var(--bandi-primary-hover, #0a53e6) !important;
}

@media (max-width: 640px) {
    .bandi-filters-sheet {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        transform: translateY(18px);
        border-radius: 18px 18px 0 0;
        max-height: 100dvh;
    }
    .bandi-filters-sheet.show {
        transform: translateY(0);
    }
    .bandi-filters-grid {
        grid-template-columns: 1fr;
    }
    .bandi-date-row {
        grid-template-columns: 1fr;
    }
    .bandi-filters-sheet-footer {
        justify-content: stretch;
    }
    .bandi-filters-sheet-footer .bandi-btn {
        flex: 1;
    }
}

/* -----------------------------
   Dropdown autocomplete geo (copiato/armonizzato da offerte)
----------------------------- */
.geo-autocomplete-dropdown {
    position: absolute;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.16);
    max-height: 280px;
    overflow-y: auto;
    z-index: 99999;
    display: none;
    width: 100%;
}

.geo-autocomplete-dropdown.active {
    display: block;
}

.geo-option {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: background 0.15s ease;
}

.geo-option:last-child {
    border-bottom: none;
}

.geo-option:hover {
    background-color: rgba(0, 123, 255, 0.06);
}

.geo-option-label {
    font-weight: 700;
    color: #333;
}

.geo-option-type {
    font-size: 0.78rem;
    color: rgba(70,70,70,0.75);
    background: rgba(233, 236, 239, 0.9);
    padding: 2px 7px;
    border-radius: 6px;
}

/* -----------------------------
   Tooltip flottante (mobile-friendly)
----------------------------- */
.meedico-tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.18);
    background: rgba(255,255,255,1);
    color: rgba(40,40,40,0.85);
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.meedico-tooltip-trigger--inline {
    margin-left: -6px; /* avvicina all'azione precedente */
}

.bandi-btn-with-corner-info {
    position: relative;
    display: inline-flex;
}

.meedico-tooltip-trigger--corner {
    position: absolute;
    top: -6px;
    right: -6px;
    z-index: 2;
}

.meedico-tooltip {
    position: fixed;
    max-width: min(320px, 86vw);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 16px 50px rgba(0,0,0,0.22);
    z-index: 100000;
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 120ms ease, transform 120ms ease;
    color: #333;
    font-size: 0.9rem;
    line-height: 1.35;
}

.meedico-tooltip.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.meedico-tooltip .meedico-tooltip-title {
    font-weight: 800;
    margin-bottom: 6px;
    font-size: 0.92rem;
}

.meedico-tooltip .meedico-tooltip-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: 0;
    background: transparent;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    color: rgba(0,0,0,0.55);
}

/* -----------------------------
   Stato vuoto dettaglio
----------------------------- */
.bandi-empty-detail {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    margin-top: 20%;
}

.bandi-empty-detail i {
    margin-bottom: 15px;
    color: #ccc;
}

.bandi-empty-detail p {
    font-size: 1.05rem;
    margin: 0;
}

.bandi-empty-detail-text {
    text-align: center;
    padding: 20px;
}

/* -----------------------------
   Card compatta: titolo troncato (max 2 righe)
   Evita card altissime per titoli lunghi
----------------------------- */
.bando-compact-title {
    font-size: 1rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Righe compatte */
.bando-compact-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.bando-compact-row {
    background: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #444;
}

.bando-compact-row i {
    color: #666;
    width: 16px;
    text-align: center;
    margin-top: 2px;
}

.bando-compact-deadline {
    color: #d9534f;
    font-weight: 700;
}

.bando-compact-spec {
    color: #007bff;
    font-weight: 700;
}

/* -----------------------------
   Card espansa: niente inline
   Titolo più piccolo rispetto a prima
----------------------------- */
.bando-expanded {
    padding: 0;
}

.bando-expanded-header {
    position: relative;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.bando-open-external {
    position: absolute;
    top: 0;
    right: 0;
    color: #666;
    font-size: 1.15rem;
    transition: color 0.2s;
    text-decoration: none;
}

.bando-open-external:hover {
    color: #007bff;
}

.bando-expanded-title {
    font-size: 1.15rem; /* ridotto */
    color: #333;
    margin: 0 0 8px 0;
    padding-right: 30px;
    line-height: 1.25;
}

.bando-expanded-meta {
    display: grid;
    gap: 8px;
    color: #555;
    font-size: 0.95rem;
}

.bando-expanded-meta-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.bando-expanded-meta-row i {
    color: #888;
    width: 16px;
    text-align: center;
    margin-top: 2px;
}

.bando-expanded-highlights {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.bando-pill {
    padding: 10px 14px;
    border-radius: 8px;
    flex: 1;
    min-width: 180px;
}

.bando-pill-gray {
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
}

.bando-pill-blue {
    background: var(--meedico-bando-soft, #d1fae5);
    border-left: 4px solid var(--meedico-bando, #047857);
}

.bando-pill-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 3px;
}

.bando-pill-value {
    font-size: 0.95rem;
    color: #333;
}

.bando-pill-blue .bando-pill-value {
    color: var(--meedico-bando, #047857);
}

.bando-section {
    margin-bottom: 18px;
}

.bando-section-title {
    font-size: 1.05rem;
    color: #333;
    margin-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 5px;
}

.bando-dates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    font-size: 0.95rem;
}

.bando-date-item {
    display: flex;
    flex-direction: column;
}

.bando-date-label {
    color: #666;
    font-size: 0.85rem;
}

.bando-date-value {
    font-weight: 500;
    color: #333;
}

.bando-date-deadline {
    font-weight: 700;
    color: #d9534f;
}

.bando-keywords {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.6;
}

.bando-cta {
    margin-top: 10px;
}

.bando-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.bando-footer {
    text-align: right;
    font-size: 0.8rem;
    color: #888;
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 18px;
}

/* -----------------------------
   MODALE "Richiedi bandi regione"
----------------------------- */
.bandi-region-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 9998;
}

.bandi-region-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 9999;
    padding: 18px;
}

.bandi-region-modal-content {
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 36px);
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.bandi-region-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.bandi-region-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #333;
}

.bandi-region-modal-close {
    border: 0;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
}

.bandi-region-modal-body {
    padding: 16px;
}

/* Il componente "richiedi_regioni" nasce come sidebar off-canvas.
   Qui lo mostriamo come contenuto normale dentro il nostro modal. */
.bandi-region-modal-body .sidebar-overlay {
    display: none !important;
}

.bandi-region-modal-body .sidebar-wrapper {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    transition: none !important;
    box-shadow: none; /* evita doppia ombra dentro il modal */
    padding: 0; /* il modal già ha padding */
    background: transparent;
}

.bandi-region-modal-body .sidebar-header {
    position: static;
    top: auto;
    margin: 0 0 14px 0;
    padding: 0 0 12px 0;
}

.bandi-region-modal-body .sidebar-header h3 {
    font-size: 1.2rem;
}

/* Stato aperto modale */
.bandi-region-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.bandi-region-modal.show {
    opacity: 1;
    pointer-events: auto;
}

/* blocca scroll body quando modale aperto */
body.modal-open {
    overflow: hidden;
}