/* Righe evidenziate nelle liste (le classi Tailwind non compilate da Filament non funzionano
   nelle viste custom, quindi le definiamo qui). */
.riga-prossima > td:first-child,
.riga-prossima > .fi-ta-cell:first-child { box-shadow: inset 4px 0 0 #f59e0b; }
.riga-alert > td:first-child,
.riga-alert > .fi-ta-cell:first-child { box-shadow: inset 4px 0 0 #ef4444; }
.riga-passata { opacity: .6; }

/* Barra in alto e ricerca su telefono/tablet. */
@media (max-width: 1023px) {
    /* Nome del club su una riga; orologio nascosto. */
    .topbar-club-nome {
        display: inline-block;
        max-width: 38vw;
        margin-right: 8px !important;
        font-size: .8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }
    #topbar-clock { display: none !important; }

    /* Ricerca: toccando il campo passa su una seconda riga a tutta larghezza sotto la barra. */
    .fi-topbar .fi-global-search-ctn:focus-within {
        position: fixed;
        top: 4rem;
        left: 0;
        right: 0;
        z-index: 40;
        padding: .6rem .75rem;
        background: #18181b;
        box-shadow: 0 8px 16px rgba(0, 0, 0, .4);
    }
    .fi-topbar .fi-global-search-ctn:focus-within .fi-global-search,
    .fi-topbar .fi-global-search-ctn:focus-within .fi-global-search-field {
        width: 100%;
        flex: 1 1 100%;
    }
    .fi-topbar .fi-global-search-ctn:focus-within .fi-input-wrp,
    .fi-topbar .fi-global-search-ctn:focus-within input[type="search"] {
        width: 100%;
        min-width: 0;
    }
    .fi-topbar .fi-global-search-ctn:focus-within .fi-global-search-results-ctn {
        position: fixed;
        top: calc(4rem + 3.6rem);
        left: .5rem;
        right: .5rem;
        width: auto;
        max-width: none;
        max-height: 60vh;
    }
}

/* Toni (ok / attenzione / errore / info / neutro) leggibili sia su tema chiaro sia scuro. */
.tono-ok { color: #15803d; }
.tono-attenzione { color: #b45309; }
.tono-errore { color: #b91c1c; }
.tono-info { color: #1d4ed8; }
.tono-neutro { color: #475569; }
.sfondo-ok { background: rgba(34,197,94,.14); border-color: rgba(21,128,61,.55) !important; }
.sfondo-attenzione { background: rgba(245,158,11,.16); border-color: rgba(180,83,9,.55) !important; }
.sfondo-errore { background: rgba(239,68,68,.14); border-color: rgba(185,28,28,.55) !important; }
.sfondo-info { background: rgba(59,130,246,.14); border-color: rgba(29,78,216,.55) !important; }
.sfondo-neutro { background: rgba(148,163,184,.16); border-color: rgba(71,85,105,.45) !important; }
:where(.dark, .dark *) .tono-ok { color: #4ade80; }
:where(.dark, .dark *) .tono-attenzione { color: #fbbf24; }
:where(.dark, .dark *) .tono-errore { color: #f87171; }
:where(.dark, .dark *) .tono-info { color: #60a5fa; }
:where(.dark, .dark *) .tono-neutro { color: #cbd5e1; }
:where(.dark, .dark *) .sfondo-ok { border-color: rgba(34,197,94,.45) !important; }
:where(.dark, .dark *) .sfondo-attenzione { border-color: rgba(245,158,11,.45) !important; }
:where(.dark, .dark *) .sfondo-errore { border-color: rgba(239,68,68,.45) !important; }
:where(.dark, .dark *) .sfondo-info { border-color: rgba(59,130,246,.45) !important; }
:where(.dark, .dark *) .sfondo-neutro { border-color: rgba(148,163,184,.35) !important; }

/* Scheda socio e moduli su telefono: una colonna, schede scorrevoli, spazio per Salva sempre visibile. */
@media (max-width: 767px) {
    .fi-sc-form .fi-grid { grid-template-columns: minmax(0, 1fr) !important; }
    .fi-sc-form .fi-grid > * { grid-column: 1 / -1 !important; }
    .fi-sc-form { padding-bottom: 4.5rem; }
    .fi-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
    .fi-tabs > * { flex: 0 0 auto; }
}
