/*
 * JOORNA · Design System v2 (2026-09-30) — regole globali.
 * Token in public/css/joorna-tokens.css (--ds-*). Caricato per ULTIMO
 * (JoornaTheme): qui stanno le decisioni visive trasversali, non i
 * componenti. Vale per ogni pagina presente e futura.
 *
 *  1. Superfici: fondo app grigio chiaro, card bianche con bordo + ombra
 *     morbida, testate e pannelli interni tenui.
 *  2. Testi: niente grigio chiaro illeggibile (min. 5.3:1 su bianco).
 *  3. Tabelle: righe alternate (da 6 righe in su), hover e selezione
 *     viola tenue, colonna principale in evidenza, celle vuote discrete.
 *  4. Badge di stato a pillola: fondo chiaro, bordo, testo scuro (≥ 6:1).
 *  5. Sidebar: default / hover / attiva con filetto, focus da tastiera.
 */

/* ── 1. Superfici ───────────────────────────────────────────────── */

html body.fi-body,
html .fi-body {
    background-color: var(--ds-bg-app) !important;
}

/* Niente bianco puro nel pannello: le superfici "bianche" di Filament
 * (card, tabelle, topbar, campi, menu, modali) prendono il bianco tenue
 * della superficie. Senza !important: gli sfondi trasparenti voluti
 * (pill delle sotto-sezioni…) restano. Le anteprime delle email restano
 * bianche (sono il contenuto vero, con i loro stili). */
html:not(.dark) .fi-body .bg-white {
    background-color: var(--ds-surface);
}

/* …ma non sopra lo stato "spuntato": la regola qui sopra (più specifica di
 * checked:bg-primary-600) rendeva le caselle spuntate chiare come quelle
 * vuote. Spuntata = viola, come lo vuole Filament. */
html:not(.dark) .fi-body .bg-white:is(input[type="checkbox"], input[type="radio"]):checked {
    background-color: var(--ds-accent);
}

/* Scelta a pulsanti (ToggleButtons) selezionata: stessa causa (testo
 * bianco su fondo chiaro, illeggibile). Selezione = lilla tenue con testo
 * viola, mai viola pieno (quello è solo della CTA). */
html .fi-body input:checked + .fi-btn.bg-white {
    background-color: var(--ds-accent-soft-2, #EAE1FA);
    color: var(--ds-accent-fg, #5F45A8);
    --tw-ring-color: var(--ds-accent, #7C5CCB);
    box-shadow: 0 0 0 1px var(--ds-accent, #7C5CCB);
}

html .fi-body input:checked + .fi-btn.bg-white:hover {
    background-color: var(--ds-accent-soft-hover, #EEE7FB);
}

/* Card: bordo di 1px + ombra a riposo, così il contorno si vede anche su
 * schermi poco contrastati. Le fasce dei builder (.jo-qb) restano piatte. */
html .fi-section:not(.fi-section-not-contained):not(.fi-aside):not(.jo-qb):not(.jo-psec):not(.fi-section .fi-section),
html .fi-ta-ctn,
html .fi-wi-stats-overview-stat,
html .jo-kpi,
html .jo-listcard {
    border: 1px solid var(--ds-border) !important;
    border-radius: var(--ds-radius-card) !important;
    box-shadow: var(--ds-shadow-rest) !important;
}

html:not(.dark) .fi-modal-window {
    border-radius: var(--ds-radius-panel) !important;
    box-shadow: 0 20px 40px -8px rgba(20, 22, 40, .18) !important;
}

/* ── 1b. Dark mode: pagina nera, card un gradino sopra (token in joorna-tokens.css) ── */

/* Testi: mai bianco puro (abbaglia sul fondo scuro). */
html.dark .dark\:text-white,
html.dark .fi-header-heading,
html.dark .fi-section-header-heading {
    color: var(--ds-text-primary) !important;
}

/* Sidebar e topbar: un gradino sopra la pagina, sotto le card. */
html.dark .fi-sidebar,
html.dark .fi-sidebar-header,
html.dark .fi-topbar > nav {
    background-color: var(--ds-bg-sidebar) !important;
}

html.dark .fi-sidebar {
    border-right: 1px solid var(--ds-row-divider);
}

html.dark .fi-topbar > nav {
    box-shadow: 0 1px 0 var(--ds-row-divider) !important;
}

/* Testata sul piano della pagina (Elia 5-nov-2026): col menu in una tessera
   (sidebar.css, «Menu come tessera») la fascia con la riga sotto sembrava
   rotta. Sul computer la topbar ha il colore del fondo dell'app e nessuna
   riga, in chiaro e in scuro: ricerca e icone sono i controlli, come la card
   del menu; resta opaca e ferma, il contenuto le scivola sotto. Il suo
   contenuto scende di 12px per stare in linea col bordo alto della tessera
   del menu; --jo-topbar-h la misura dal vivo (topbar-two-rows.js), così le
   barre ferme sotto non si spostano. Alta 64px in tutto, e il titolo della
   pagina subito sotto (joorna-refine.css): prima 76px più 10px, uno spazio
   vuoto fra la ricerca e il titolo (owner 9-nov-2026). Su più righe
   (jo-topbar-2rows) tiene le sue misure; sul telefono (menu a cassetto)
   resta la barra di prima. */
@media (min-width: 1024px) {
    html:not(.dark) .fi-topbar > nav,
    html.dark .fi-topbar > nav {
        background-color: var(--ds-bg-app) !important;
        box-shadow: none !important;
    }

    html:not(.dark) .fi-topbar:not(.jo-topbar-2rows) > nav,
    html.dark .fi-topbar:not(.jo-topbar-2rows) > nav {
        height: 4rem;
        padding-top: 12px;
    }
}

/* Modali e menu: la superficie delle card, bordo sottile, ombra morbida. */
html.dark .fi-modal-window,
html.dark .fi-dropdown-panel {
    background-color: var(--ds-surface) !important;
    border: 1px solid var(--ds-border);
    box-shadow: var(--ds-shadow-raised) !important;
}

html.dark .fi-modal-window {
    border-radius: var(--ds-radius-panel) !important;
}

/* Chip della struttura in topbar: in dark niente viola pieno (abbaglia),
 * lilla tenue con testo viola chiaro; resta riconoscibile come contesto. */

/* Campi: un gradino sotto la card, non un buco nero. */
html.dark .fi-input-wrp {
    background-color: var(--ds-surface-sunken) !important;
}

/* Campi: bordo leggibile (3:1, requisito per i controlli). */
html .fi-input-wrp {
    --tw-ring-color: var(--ds-border-strong) !important;
}

/* ── 2. Testi ───────────────────────────────────────────────────── */

/* I grigi chiari di Filament (text-gray-400, #a1a1aa: 2.6:1) diventano il
 * grigio minimo leggibile; i 500 il terziario. */
html:not(.dark) .fi-main .text-gray-400,
html:not(.dark) .fi-sidebar .text-gray-400,
html:not(.dark) .fi-modal .text-gray-400,
html:not(.dark) .fi-dropdown-panel .text-gray-400 {
    color: var(--ds-text-placeholder) !important;
}

html:not(.dark) .fi-main .text-gray-500,
html:not(.dark) .fi-modal .text-gray-500 {
    color: var(--ds-text-tertiary) !important;
}

html:not(.dark) .fi-input::placeholder,
html:not(.dark) .fi-select-input::placeholder,
html:not(.dark) textarea::placeholder {
    color: var(--ds-text-placeholder) !important;
}

html .fi-header-subheading,
html .fi-section-header-description,
html .fi-fo-field-wrp-helper-text {
    color: var(--ds-text-tertiary) !important;
}

html .fi-header-heading,
html .fi-section-header-heading {
    color: var(--ds-text-primary) !important;
}

/* ── 3. Tabelle ─────────────────────────────────────────────────── */

/* Testata: fondo interno, etichette in sentence case, terziario 600. */
html .fi-ta-table > thead > tr,
html .fi-ta-table > thead > tr > th {
    background-color: var(--ds-surface-sunken) !important;
}

html .fi-ta-table > thead .fi-ta-header-cell-label {
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: .02em;
    text-transform: none !important;
    color: var(--ds-text-tertiary) !important;
}

html .fi-ta-table > thead {
    border-bottom: 1px solid var(--ds-border);
}

/* Separatori di riga appena percettibili. */
html .fi-ta-table > tbody > tr.fi-ta-row + tr.fi-ta-row {
    border-top-color: var(--ds-row-divider) !important;
}

/* Righe alternate solo nelle tabelle con almeno 6 righe (sotto bastano i
 * separatori); mai nella vista Card. Ogni cella prende il fondo della sua
 * riga, anche la colonna Azioni sticky. */
/* Righe pari, solo se le righe sono almeno sei: la 2ª con almeno 4 dopo, la
   4ª con almeno 2 dopo, poi la 6ª, 8ª… Senza :has() né ~, che Chrome
   rivalutava per ogni cella a ogni ricalcolo dello stile (28-ott-2026). */
html .fi-ta-table:not(.jo-ta-cards *) > tbody > tr.fi-ta-row:is(:nth-child(2):nth-last-child(n+5), :nth-child(4):nth-last-child(n+3), :nth-child(2n+6)) > td {
    background-color: var(--ds-row-stripe) !important;
}

html .fi-ta-table:not(.jo-ta-cards *) > tbody > tr.fi-ta-row > td {
    transition: background-color .12s ease;
}

html .fi-ta-table:not(.jo-ta-cards *) > tbody > tr.fi-ta-row:hover > td {
    background-color: var(--ds-row-hover) !important;
}

/* Riga selezionata: fondo viola tenue + filetto a sinistra. */
/* Catena di figli (markup della cella di selezione di Filament): senza, Chrome
   scandiva ogni riga per ogni cella. */
html .fi-ta-table:not(.jo-ta-cards *) > tbody > tr.fi-ta-row:has(> td > div > label > .fi-ta-record-checkbox:checked) > td {
    background-color: var(--ds-row-selected) !important;
}

html .fi-ta-table:not(.jo-ta-cards *) > tbody > tr.fi-ta-row:has(> td > div > label > .fi-ta-record-checkbox:checked) > td:first-child {
    box-shadow: inset 2px 0 0 var(--ds-accent);
}

/* Gerarchia: la colonna principale (la prima dopo la casella) in
 * evidenza; il resto è testo secondario. */
html .fi-ta-table > tbody > tr.fi-ta-row > td.fi-ta-cell .fi-ta-text-item-label {
    color: var(--ds-text-secondary);
}

html .fi-ta-table > tbody > tr.fi-ta-row > td.fi-ta-selection-cell + td.fi-ta-cell .fi-ta-text-item-label,
html .fi-ta-table > tbody > tr.fi-ta-row > td.fi-ta-cell:first-child:not(.fi-ta-selection-cell) .fi-ta-text-item-label {
    font-weight: 600;
    color: var(--ds-text-primary);
}

/* Link nelle celle: neutri a riposo, viola sottolineati al passaggio. */
html .fi-ta-table > tbody a.fi-ta-text-item:hover .fi-ta-text-item-label,
html .fi-ta-table > tbody .fi-ta-text-item a:hover {
    color: var(--ds-text-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Numeri allineati in colonna. */
html .fi-ta-table .fi-ta-text-item-label {
    font-variant-numeric: tabular-nums;
}

/* Celle vuote: il trattino resta, discreto (segnale non testuale, 3:1). */
html .fi-ta-placeholder,
html .fi-ta-cell .fi-ta-text-item-label:is([data-empty]) {
    color: var(--ds-empty) !important;
}

/* ── 4. Badge di stato a pillola ────────────────────────────────── */

html .fi-badge {
    border-radius: var(--ds-radius-pill) !important;
    padding: 2px 10px !important;
    min-height: 22px;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 18px !important;
    gap: 6px !important;
}

/* Una semantica = un colore, in tutta la piattaforma. Il colore del
 * badge Filament (success/gray/warning/danger/info/primary) sceglie la
 * variante; l'icona prende il colore del pallino. */
html .fi-badge.fi-color-success { background-color: var(--ds-ok-bg) !important;   color: var(--ds-ok-fg) !important;   --tw-ring-color: var(--ds-ok-bd) !important; }
html .fi-badge.fi-color-gray    { background-color: var(--ds-off-bg) !important;  color: var(--ds-off-fg) !important;  --tw-ring-color: var(--ds-off-bd) !important; }
html .fi-badge.fi-color-warning { background-color: var(--ds-warn-bg) !important; color: var(--ds-warn-fg) !important; --tw-ring-color: var(--ds-warn-bd) !important; }
html .fi-badge.fi-color-danger  { background-color: var(--ds-err-bg) !important;  color: var(--ds-err-fg) !important;  --tw-ring-color: var(--ds-err-bd) !important; }
html .fi-badge.fi-color-info    { background-color: var(--ds-info-bg) !important; color: var(--ds-info-fg) !important; --tw-ring-color: var(--ds-info-bd) !important; }
html .fi-badge.fi-color-primary { background-color: var(--ds-auto-bg) !important; color: var(--ds-auto-fg) !important; --tw-ring-color: var(--ds-auto-bd) !important; }

html .fi-badge.fi-color-success .fi-badge-icon { color: var(--ds-ok-dot) !important; }
html .fi-badge.fi-color-gray .fi-badge-icon    { color: var(--ds-off-dot) !important; }
html .fi-badge.fi-color-warning .fi-badge-icon { color: var(--ds-warn-dot) !important; }
html .fi-badge.fi-color-danger .fi-badge-icon  { color: var(--ds-err-dot) !important; }
html .fi-badge.fi-color-info .fi-badge-icon    { color: var(--ds-info-dot) !important; }
html .fi-badge.fi-color-primary .fi-badge-icon { color: var(--ds-auto-dot) !important; }

html .fi-badge .fi-badge-icon {
    width: 14px !important;
    height: 14px !important;
}

/* ── 4b. Celle delle tabelle: meno pill, meno colori ─────────────
 * (App\Filament\Tables\CellStyle, override text-column/icon-column)
 * Stato = pallino + testo; tag descrittivo = etichetta neutra sottile;
 * dati semplici = icona outline tenue con tooltip. */
html .jo-cell-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    font-size: 13px;
    line-height: 20px;
    color: var(--ds-text-secondary);
}

html .jo-cell-dot {
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--ds-off-dot);
}

html .jo-cell-status.fi-color-success .jo-cell-dot { background: var(--ds-ok-dot); }
html .jo-cell-status.fi-color-warning .jo-cell-dot { background: var(--ds-warn-dot); }
html .jo-cell-status.fi-color-danger .jo-cell-dot  { background: var(--ds-err-dot); }
html .jo-cell-status.fi-color-info .jo-cell-dot    { background: var(--ds-info-dot); }
html .jo-cell-status.fi-color-primary .jo-cell-dot { background: var(--ds-auto-dot); }
html .jo-cell-status.fi-color-custom:not(.fi-color-success, .fi-color-warning, .fi-color-danger, .fi-color-info, .fi-color-primary) .jo-cell-dot {
    background: rgb(var(--c-500));
}

html .jo-cell-tag {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    border: 1px solid var(--ds-border);
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    white-space: nowrap;
    color: var(--ds-text-secondary);
}

html .jo-cell-tag-more {
    color: var(--ds-text-tertiary);
    cursor: default;
}

html .jo-cell-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    line-height: 20px;
    color: var(--ds-text-secondary);
}

html .jo-cell-text-icon {
    width: 15px;
    height: 15px;
    color: var(--ds-nav-icon);
}

/* ── 4c. Valore che si cambia dalla cella (App\Filament\Tables\CellMenu) ──
 * Stato e "In carico a" della Pipeline lead: il valore (pallino + testo,
 * o il nome) è il pulsante, con un chevron discreto che dice "si apre";
 * sotto, il dropdown di Filament con le voci come nelle tendine di riga.
 * Il fondo compare al passaggio, a menu aperto e col fuoco da tastiera. */
html .jo-cell-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    /* Area di clic più ampia del testo senza spostarlo nella cella. */
    margin: -4px -6px;
    padding: 4px 6px;
    border: 0;
    border-radius: var(--ds-radius-control);
    background: transparent;
    font: inherit;
    text-align: start;
    cursor: pointer;
    transition: background-color .12s ease, box-shadow .12s ease;
}

html .jo-cell-menu-btn:hover,
html .jo-cell-menu-btn[aria-expanded='true'] {
    background: var(--ds-surface-hover);
    box-shadow: inset 0 0 0 1px var(--ds-border);
}

html .jo-cell-menu-btn:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring);
}

html .jo-cell-menu-chevron {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    color: var(--ds-text-tertiary);
    opacity: .6;
    transition: opacity .12s ease, transform .12s ease;
}

html .jo-cell-menu-btn:hover .jo-cell-menu-chevron,
html .jo-cell-menu-btn:focus-visible .jo-cell-menu-chevron,
html .jo-cell-menu-btn[aria-expanded='true'] .jo-cell-menu-chevron {
    opacity: 1;
}

html .jo-cell-menu-btn[aria-expanded='true'] .jo-cell-menu-chevron {
    transform: rotate(180deg);
}

/* Nessuno in carico: «Da assegnare», una situazione che chiede lavoro
   (cliente 6-nov-2026), col pallino e l'arancio di «da fare». */
html .jo-cell-menu-empty {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
    color: var(--ds-attention-fg);
}

html .jo-cell-menu-empty::before {
    content: '';
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--ds-attention-dot);
}

/* Al tocco (telefono, tablet) il pulsante è alto abbastanza per il dito. */
@media (pointer: coarse) {
    html .jo-cell-menu-btn {
        min-height: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html .jo-cell-menu-btn,
    html .jo-cell-menu-chevron {
        transition: none;
    }
}

/* Icone-dato (booleani, consensi, sorgente, canale, sync): solo il
 * simbolo, tenue, con il significato nel tooltip. */
html .jo-data-icon .fi-ta-icon-item.text-gray-400 {
    color: var(--ds-text-tertiary) !important;
}

html .jo-data-icon .fi-ta-icon-item.fi-color-custom {
    color: var(--ds-text-tertiary) !important;
}

html .jo-data-icon .fi-ta-icon-item.fi-color-success {
    color: var(--ds-ok-dot) !important;
}

html .jo-data-icon .fi-ta-icon-item.fi-color-danger {
    color: var(--ds-err-dot) !important;
}

html .jo-data-icon .fi-ta-icon-item.fi-color-warning {
    color: var(--ds-warn-dot) !important;
}

/* Sorgente che è un canale (chatbot, email, WhatsApp): colore del canale
 * come nell'Inbox (SourceIcons::attr, owner 7-ott-2026). */
html [data-jo-channel] .jo-data-icon .fi-ta-icon-item.fi-ta-icon-item,
html body .jo-legend-icon [data-jo-channel] :is(svg, .fi-ta-icon-item).fi-ta-icon-item,
html body .jo-legend-icon [data-jo-channel] svg {
    color: var(--jo-channel-color) !important;
}

/* Icone di dato tutte della stessa misura delle azioni (16px, owner
 * 7-ott-2026): tag, sorgente, consensi, colonne a icona e legenda. */
html body .jo-tag-icon svg,
html body .jo-gc-ico svg,
html body .jo-gc-ico .jo-ch-ic svg,
html body .jo-legend-icon svg,
html body .jo-gc-ico .jo-ch-ic,
html body :is(td, .jo-legend-icon) .fi-ta-icon-item.fi-ta-icon-item {
    width: 16px !important;
    height: 16px !important;
}

/* Tag colorati (TagIcons::tone): stesso colore in tabella, Kanban e legenda. */
html body .jo-tag-icon.jo-tag-icon[data-jo-tag-tone] { color: var(--jo-tag-c) !important; }
html body .jo-tag-icon.jo-tag-icon[data-jo-tag-tone] svg { color: inherit !important; }
.jo-tag-icon[data-jo-tag-tone='sky'] { --jo-tag-c: var(--ds-tag-sky); }
.jo-tag-icon[data-jo-tag-tone='green'] { --jo-tag-c: var(--ds-tag-green); }
.jo-tag-icon[data-jo-tag-tone='amber'] { --jo-tag-c: var(--ds-tag-amber); }
.jo-tag-icon[data-jo-tag-tone='rust'] { --jo-tag-c: var(--ds-tag-rust); }
.jo-tag-icon[data-jo-tag-tone='rose'] { --jo-tag-c: var(--ds-tag-rose); }
.jo-tag-icon[data-jo-tag-tone='violet'] { --jo-tag-c: var(--ds-tag-violet); }
.jo-tag-icon[data-jo-tag-tone='teal'] { --jo-tag-c: var(--ds-tag-teal); }
.jo-tag-icon[data-jo-tag-tone='gold'] { --jo-tag-c: var(--ds-tag-gold); }

/* Contatori della sidebar e delle pill: pillola viola compatta. */
html .fi-sidebar-item .fi-badge,
html .fi-page-sub-navigation-tabs .fi-badge {
    min-height: 18px;
    padding: 0 7px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 18px !important;
    background-color: var(--ds-accent-soft) !important;
    color: var(--ds-accent-fg) !important;
    --tw-ring-color: transparent !important;
}

/* ── 5. Sidebar e navigazione ───────────────────────────────────── */

/* Menu scuro (Elia 9-nov-2026, riferimento Atrium): fondo --ds-sb-bg (la
 * forma in sidebar.css), testi e icone bianchi a opacità diverse, la voce
 * aperta su una tessera bianca trasparente con l'icona lime del logo. Vale
 * in chiaro e in scuro: il menu è scuro in tutti e due. */
html body .fi-sidebar.fi-sidebar {
    background: var(--ds-sb-bg) !important;
    background-color: var(--ds-sb-solid) !important;
    border-right: 0 !important;
    color: var(--ds-sb-fg);
}

html body .fi-sidebar.fi-sidebar .fi-sidebar-header {
    background: transparent !important;
    box-shadow: none !important;
    --tw-ring-color: transparent;
}

html body .fi-sidebar .fi-sidebar-header .fi-icon-btn {
    color: var(--ds-sb-muted) !important;
}

html body .fi-sidebar .fi-sidebar-nav {
    scrollbar-color: rgba(255, 255, 255, .22) transparent;
    scrollbar-width: thin;
}

/* Macroarea: riga come le voci; quella in cui si lavora ha testo bianco
 * pieno, senza fondo (lo stato attivo è sulla sotto-voce). */
html .fi-sidebar-group-button {
    transition: background-color .12s ease;
}

html .fi-sidebar .fi-sidebar-group-button:hover {
    background-color: var(--ds-sb-hover);
}

html .fi-sidebar .fi-sidebar-group-label {
    color: var(--ds-sb-fg) !important;
}

html .fi-sidebar .fi-sidebar-group-icon {
    color: var(--ds-sb-icon) !important;
}

html .fi-sidebar .fi-sidebar-group-button .fi-icon-btn {
    color: var(--ds-sb-muted) !important;
}

html .fi-sidebar .fi-sidebar-group.fi-active > .fi-sidebar-group-button .fi-sidebar-group-label {
    color: var(--ds-sb-fg-strong) !important;
    font-weight: 600;
}

html .fi-sidebar .fi-sidebar-group.fi-active > .fi-sidebar-group-button .fi-sidebar-group-icon {
    color: var(--ds-sb-fg-strong) !important;
}

/* Macroaree più in evidenza delle loro voci (owner 10-nov-2026: «sennò
   sembra tutto uguale»). Il primo livello (macroaree e voci singole come la
   Panoramica) ha l'icona in un riquadro chiaro e il nome bianco; le
   sotto-voci restano più piccole e tenui, con l'icona semplice. Il riquadro
   della macroarea in cui si lavora è lime, il colore di «dove sei». A menu
   chiuso restano le icone sole. */
html body .fi-sidebar.fi-sidebar-open .fi-sidebar-group-button .fi-sidebar-group-icon,
html body .fi-sidebar.fi-sidebar-open .fi-sidebar-group:not(:has(> .fi-sidebar-group-button)) .fi-sidebar-item-icon {
    box-sizing: content-box;
    width: 16px !important;
    height: 16px !important;
    flex: 0 0 16px;
    padding: 5px;
    margin-block: -4px;
    border-radius: 8px;
    background: var(--ds-sb-active-bg);
    color: var(--ds-sb-fg-strong) !important;
}

html body .fi-sidebar.fi-sidebar-open .fi-sidebar-group.fi-active > .fi-sidebar-group-button .fi-sidebar-group-icon,
html body .fi-sidebar.fi-sidebar-open .fi-sidebar-group:not(:has(> .fi-sidebar-group-button)) .fi-sidebar-item-active .fi-sidebar-item-icon {
    background: var(--ds-lime);
    color: var(--ds-sb-solid) !important;
}

html body .fi-sidebar .fi-sidebar-group-label {
    color: var(--ds-sb-fg-strong) !important;
    font-size: 14px;
}

/* Più aria fra le righe di primo livello (owner 10-nov-2026: «troppo
   attaccate»), e la Panoramica scritta come le macroaree: prima più piccola
   e più tenue, sembrava un'altra cosa. */
html body .fi-sidebar .fi-sidebar-nav-groups {
    row-gap: 6px;
}

html body .fi-sidebar .fi-sidebar-group:not(:has(> .fi-sidebar-group-button)) .fi-sidebar-item-label {
    color: var(--ds-sb-fg-strong) !important;
    font-size: 14px;
}

/* Default */
html .fi-sidebar-item-button {
    transition: background-color .12s ease, color .12s ease;
}

html .fi-sidebar .fi-sidebar-item:not(.fi-sidebar-item-active) .fi-sidebar-item-label {
    color: var(--ds-sb-fg) !important;
    font-weight: 400;
}

html .fi-sidebar .fi-sidebar-item:not(.fi-sidebar-item-active) .fi-sidebar-item-icon {
    color: var(--ds-sb-icon) !important;
}

/* Hover */
html .fi-sidebar .fi-sidebar-item:not(.fi-sidebar-item-active) > .fi-sidebar-item-button:hover {
    background-color: var(--ds-sb-hover) !important;
}

html .fi-sidebar .fi-sidebar-item:not(.fi-sidebar-item-active) > .fi-sidebar-item-button:hover .fi-sidebar-item-label {
    color: var(--ds-sb-fg-strong) !important;
}

html .fi-sidebar .fi-sidebar-item:not(.fi-sidebar-item-active) > .fi-sidebar-item-button:hover .fi-sidebar-item-icon {
    color: var(--ds-sb-fg-strong) !important;
}

/* Attiva: tessera bianca trasparente con un filo chiaro, testo bianco e
   icona lime (il colore del logo: «dove sei», come la riga lime dei menu). */
html .fi-sidebar .fi-sidebar-item-active > .fi-sidebar-item-button {
    background-color: var(--ds-sb-active-bg) !important;
    box-shadow: inset 0 0 0 1px var(--ds-sb-active-ring);
}

html .fi-sidebar .fi-sidebar-item-active > .fi-sidebar-item-button:hover {
    background-color: var(--ds-sb-active-bg) !important;
}

html .fi-sidebar .fi-sidebar-item-active > .fi-sidebar-item-button .fi-sidebar-item-label {
    color: var(--ds-sb-fg-strong) !important;
    font-weight: 600 !important;
}

html .fi-sidebar .fi-sidebar-item-active > .fi-sidebar-item-button .fi-sidebar-item-icon {
    color: var(--ds-lime) !important;
}

/* Contatori: pillola chiara col numero viola (i moduli da attivare restano ambra). */
html .fi-sidebar-item .fi-badge {
    font-weight: 600 !important;
    background-color: var(--ds-sb-badge-bg) !important;
    color: var(--ds-sb-badge-fg) !important;
}

/* Focus da tastiera: anello visibile, mai al clic del mouse. */
html .fi-sidebar .fi-sidebar-item-button:focus-visible,
html .fi-sidebar .fi-sidebar-group-button:focus-visible {
    outline: none;
    box-shadow: var(--ds-sb-focus) !important;
}

html .fi-page-sub-navigation-tabs .fi-tabs-item:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}

/* Pill delle sotto-sezioni: default / hover / attiva. */
html:not(.dark) .fi-page-sub-navigation-tabs .fi-tabs-item {
    border-color: var(--ds-border) !important;
    background: var(--ds-surface) !important;
}

html:not(.dark) .fi-page-sub-navigation-tabs .fi-tabs-item .fi-tabs-item-label {
    color: var(--ds-text-secondary) !important;
    font-weight: 500;
}

html:not(.dark) .fi-page-sub-navigation-tabs .fi-tabs-item:hover {
    border-color: var(--ds-border-strong) !important;
    background: var(--ds-surface-hover) !important;
}

html:not(.dark) .fi-page-sub-navigation-tabs .fi-tabs-item:hover .fi-tabs-item-label {
    color: var(--ds-text-primary) !important;
}

html .fi-page-sub-navigation-tabs .fi-tabs-item.fi-active {
    border-color: var(--ds-auto-bd) !important;
    background: var(--ds-accent-soft) !important;
}

html .fi-page-sub-navigation-tabs .fi-tabs-item.fi-active .fi-tabs-item-label,
html .fi-page-sub-navigation-tabs .fi-tabs-item.fi-active .fi-tabs-item-icon {
    color: var(--ds-accent-fg) !important;
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    html .fi-sidebar-item-button,
    html .fi-ta-table > tbody > tr.fi-ta-row > td {
        transition: none !important;
    }
}

/* ── 6. Stati disegnati a mano: stessa palette dei badge ────────── */

/* Segnaposto delle select (Choices.js) come quelli dei campi. */
html:not(.dark) .choices__placeholder {
    color: var(--ds-text-placeholder) !important;
    opacity: 1 !important;
}

/* Pulsante WhatsApp della scheda ospite: verde del marchio scurito per
 * il testo bianco (5.4:1). */
html .jo-gp-btn--wa {
    background-color: #0E7A6D !important;
}

/* Anteprima messaggio WhatsApp vuota, sul fondo chat. */
html .jo-wa-template-preview__empty {
    color: #4A4A57 !important;
}

/* ── Sotto-sezioni = menu orizzontale (owner 15-ott-2026) ─────────────
 * Le sotto-sezioni sotto il titolo (cluster, ChannelNavigation, sub-
 * navigation di Filament) non sono più pill staccate, che sembravano
 * filtri: una barra di menu sola, larga quanto il contenuto, col bordo
 * delle card; le voci sono testo (e la loro icona, se c'è) e quella
 * attiva ha il testo viola e una linea viola sul bordo basso della barra.
 * I filtri rapidi (.jo-qf): stesso disegno del menu (in fondo al file), cambiano i dati, non la sezione.
 * Ultimo blocco del file: vince sulle regole delle pill in
 * joorna-refine.css e nei blocchi sopra. */
html body .fi-page-sub-navigation-tabs {
    display: flex !important;
    align-items: stretch !important;
    gap: 2px !important;
    width: 100%;
    height: 46px;
    margin-inline: 0 !important;
    padding: 0 8px !important;
    overflow-x: auto;
    scrollbar-width: none;
    border: 1px solid var(--ds-border) !important;
    border-radius: 12px !important;
    background: var(--ds-surface) !important;
    box-shadow: var(--ds-shadow-rest) !important;
}

html body .fi-page-sub-navigation-tabs::-webkit-scrollbar {
    display: none;
}

html body .fi-page-sub-navigation-tabs .fi-tabs-item {
    position: relative;
    flex: 0 0 auto;
    height: auto !important;
    gap: 7px;
    padding: 0 14px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    white-space: nowrap;
}

html body .fi-page-sub-navigation-tabs .fi-tabs-item .fi-tabs-item-label {
    color: var(--ds-text-secondary) !important;
    font-size: 13.5px;
    font-weight: 500 !important;
}

html body .fi-page-sub-navigation-tabs .fi-tabs-item .fi-tabs-item-icon {
    width: 16px;
    height: 16px;
    color: var(--ds-text-tertiary) !important;
}

html body .fi-page-sub-navigation-tabs .fi-tabs-item:hover {
    background: var(--ds-surface-hover) !important;
}

html body .fi-page-sub-navigation-tabs .fi-tabs-item:hover .fi-tabs-item-label {
    color: var(--ds-text-primary) !important;
}

/* Voce attiva: testo viola e linea sul bordo basso, come nei menu delle app. */
html body .fi-page-sub-navigation-tabs .fi-tabs-item.fi-active {
    background: transparent !important;
}

html body .fi-page-sub-navigation-tabs .fi-tabs-item.fi-active::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--ds-accent);
}

html body .fi-page-sub-navigation-tabs .fi-tabs-item.fi-active .fi-tabs-item-label,
html body .fi-page-sub-navigation-tabs .fi-tabs-item.fi-active .fi-tabs-item-icon {
    color: var(--ds-accent-fg) !important;
    font-weight: 600 !important;
}

html body .fi-page-sub-navigation-tabs .fi-tabs-item:focus-visible {
    outline: none;
    box-shadow: inset var(--ds-focus-ring) !important;
}

/* Voce con sottovoci (es. Chatbot ▸ Addestra il chatbot): stessa altezza
   delle altre (regole della barra più sotto) e una freccina che dice che si
   apre. Il trigger resta un blocco (in flex la tendina di Filament non si apre). */
html body .fi-page-sub-navigation-tabs > .fi-dropdown > .fi-dropdown-trigger {
    display: block !important;
    height: 100%;
}

/* La freccina sta nel ::before, spostato dopo l'etichetta (order): il ::after
   resta alla linea della voce attiva, come nelle altre voci. Prima stavano
   insieme nel ::after e da attiva la freccina spariva e la linea restava un
   segnetto di 10px (29-ott-2026). */
html body .fi-page-sub-navigation-tabs > .fi-dropdown > .fi-dropdown-trigger > .fi-tabs-item::before {
    content: '';
    order: 1;
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin-left: -2px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.2 7.6a.75.75 0 0 1 1.06.04L10 11.69l3.74-4.05a.75.75 0 1 1 1.1 1.02l-4.3 4.65a.75.75 0 0 1-1.1 0l-4.3-4.65a.75.75 0 0 1 .06-1.06Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.2 7.6a.75.75 0 0 1 1.06.04L10 11.69l3.74-4.05a.75.75 0 1 1 1.1 1.02l-4.3 4.65a.75.75 0 0 1-1.1 0l-4.3-4.65a.75.75 0 0 1 .06-1.06Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Sul telefono lo stesso menu, che scorre di lato, al posto della tendina. */
@media (max-width: 767.98px) {
    html body .fi-page-sub-navigation-select {
        display: none !important;
    }

    html body .fi-page-sub-navigation-tabs {
        height: 44px;
        padding: 0 4px !important;
    }

    html body .fi-page-sub-navigation-tabs .fi-tabs-item {
        padding: 0 11px !important;
    }
}

/* Da 768px la barra non taglia il pannello delle sottovoci: le voci ci
   stanno, lo scorrimento di lato serve solo sul telefono. */
@media (min-width: 768px) {
    html body .fi-page-sub-navigation-tabs {
        overflow: visible !important;
    }
}

/* ── Filtri rapidi (.jo-qf) come il menu orizzontale (owner 15-ott-2026) ──
 * "Più simili ai menu orizzontali, più semplici": voci di testo, la scelta in
 * viola con la linea sotto, niente pillole né bordi; il conteggio è un numero
 * piccolo tenue (lilla sulla voce scelta). Vale ovunque: barre delle tabelle,
 * Libreria immagini, Traffico e Ads, Attività del Preventivatore… */
html body .fi-tabs.jo-qf {
    gap: 2px !important;
}
html body .jo-qf .fi-tabs-item {
    position: relative;
    height: 34px;
    padding: 0 10px !important;
    border: 0 !important;
    border-radius: 6px 6px 0 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
html body .jo-qf .fi-tabs-item:hover {
    background: var(--ds-surface-hover) !important;
}
html body .jo-qf .fi-tabs-item .fi-tabs-item-label {
    font-size: 13.5px;
    font-weight: 500 !important;
    color: var(--ds-text-secondary) !important;
}
html body .jo-qf .fi-tabs-item .fi-tabs-item-icon {
    color: var(--ds-text-tertiary) !important;
}
html body .jo-qf .fi-tabs-item.fi-active {
    background: transparent !important;
}
html body .jo-qf .fi-tabs-item.fi-active::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--ds-accent);
}
html body .jo-qf .fi-tabs-item.fi-active .fi-tabs-item-label,
html body .jo-qf .fi-tabs-item.fi-active .fi-tabs-item-icon {
    color: var(--ds-accent-fg) !important;
    font-weight: 600 !important;
}
html body .jo-qf .fi-badge {
    background: transparent !important;
    color: var(--ds-text-tertiary) !important;
    padding: 0 2px !important;
    font-weight: 500 !important;
}
html body .jo-qf .fi-tabs-item.fi-active .fi-badge {
    background: var(--ds-accent-soft) !important;
    color: var(--ds-accent-fg) !important;
    padding: 0 6px !important;
}
html body .jo-qf .fi-tabs-item:focus-visible {
    outline: none;
    box-shadow: inset var(--ds-focus-ring) !important;
}

/* ── Menu orizzontale: scorrimento sul telefono (revisione 19-ott-2026) ── */
/* Sul telefono la barra scorre di lato: un'ombra sul bordo destro dice che
   c'è altro, e sparisce arrivati in fondo (lo strato "local" la copre). */
@media (max-width: 767.98px) {
    html body .fi-page-sub-navigation-tabs {
        background:
            linear-gradient(var(--ds-surface), var(--ds-surface)) right center / 20px 100% no-repeat local,
            linear-gradient(to left, color-mix(in srgb, var(--ds-text-primary) 14%, transparent), transparent) right center / 20px 100% no-repeat scroll,
            var(--ds-surface) !important;
    }
}


/* ── Menu orizzontale delle sotto-sezioni (owner 19-ott-2026, richiesta del
 * cliente: più colore dal marchio): la barra resta neutra, solo la voce
 * selezionata è nel verde JOORNA. ── */
/* La voce attiva ha la SCRITTA nel verde di marca, il bottone resta senza
 * fondo (owner 19-ott-2026): in chiaro un lime scuro leggibile (il pastello
 * sul bianco non si legge) con la lineetta sotto nel lime pastello, in scuro
 * il lime pastello. Al passaggio un lime chiarissimo. */
html body .fi-page-sub-navigation-tabs .fi-tabs-item {
    align-self: center;
    height: 34px !important;
    border-radius: 8px !important;
    transition: background-color .15s;
}
/* La voce con la tendina (es. "Addestra il chatbot") sulla stessa linea delle altre. */
html body .fi-page-sub-navigation-tabs > .fi-dropdown,
html body .fi-page-sub-navigation-tabs > .fi-dropdown > .fi-dropdown-trigger {
    display: flex;
    align-items: center;
    align-self: stretch;
    background: transparent !important;
    box-shadow: none !important;
}
html body .fi-page-sub-navigation-tabs .fi-tabs-item:hover:not(.fi-active) {
    background: var(--ds-lime-bg, #F5F8E8) !important;
}
html body .fi-page-sub-navigation-tabs .fi-tabs-item.fi-active {
    background: transparent !important;
}
html body .fi-page-sub-navigation-tabs .fi-tabs-item.fi-active .fi-tabs-item-label,
html body .fi-page-sub-navigation-tabs .fi-tabs-item.fi-active .fi-tabs-item-icon {
    color: var(--ds-lime-text, #6B7D12) !important;
    font-weight: 600 !important;
}
html body .fi-page-sub-navigation-tabs .fi-tabs-item.fi-active::after {
    display: block !important;
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -6px;
    height: 3px;
    border-radius: 3px;
    background: var(--ds-lime-pastel, #CEE26F);
}
.dark .fi-page-sub-navigation-tabs .fi-tabs-item:hover:not(.fi-active) {
    background: rgba(206, 226, 111, .08) !important;
}

/* ── Barra delle sezioni (.jo-sec-tabs: Scheda hotel, Configurazione canali e
 * le altre pagine di impostazioni ad accordion) uguale al menu orizzontale
 * (owner 19-ott-2026): stessa barra-card, stesse voci, voce attiva in verde.
 * La voce accesa è la sezione aperta, una alla volta (NavigatesSections). ── */
html body .jo-sec-tabs {
    align-items: stretch;
    gap: 2px;
    height: 46px;
    margin-bottom: 0;
    padding: 0 8px;
    border: 1px solid var(--ds-border) !important;
    border-radius: 12px;
    background: var(--ds-surface) !important;
    box-shadow: var(--ds-shadow-rest);
}
html body .jo-sec-tabs > button {
    position: relative;
    align-self: center;
    height: 34px;
    margin: 0;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ds-text-secondary, #3F3F46);
    transition: background-color .15s;
}
html body .jo-sec-tabs > button:hover:not(.is-active) {
    color: var(--ds-text-primary, #18181B);
    background: var(--ds-lime-bg, #F5F8E8);
}
html body .jo-sec-tabs > button.is-active {
    color: var(--ds-lime-text, #6B7D12);
    font-weight: 600;
    border: 0;
}
html body .jo-sec-tabs > button.is-active::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -6px;
    height: 3px;
    border-radius: 3px;
    background: var(--ds-lime-pastel, #CEE26F);
}
.dark .jo-sec-tabs > button:hover:not(.is-active) {
    background: rgba(206, 226, 111, .08);
}
/* Le schede di Traffico e Ads come voci del menu: il segnale "non collegato" accanto. */
html body .aa-tabs-nav .aa-tab-disconnected { display: inline-flex; width: 14px; height: 14px; color: var(--ds-warning-fg, #B45309); }
html body .aa-tabs-nav .fi-tabs-item {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 7px;
    text-decoration: none;
}
html body .aa-tabs-nav .fi-tabs-item .fi-tabs-item-icon { width: 16px; height: 16px; }

/* Filtri rapidi (.jo-qf) con la stessa logica colori del menu (owner
 * 19-ott-2026): la scelta in verde, scritta e lineetta, al passaggio lime
 * chiarissimo; il conteggio della scelta su lime tenue. */
html body .jo-qf .fi-tabs-item:hover:not(.fi-active) {
    background: var(--ds-lime-bg, #F5F8E8) !important;
}
html body .jo-qf .fi-tabs-item.fi-active::after {
    height: 3px;
    border-radius: 3px;
    background: var(--ds-lime-pastel, #CEE26F);
}
html body .jo-qf .fi-tabs-item.fi-active .fi-tabs-item-label,
html body .jo-qf .fi-tabs-item.fi-active .fi-tabs-item-icon {
    color: var(--ds-lime-text, #6B7D12) !important;
}
html body .jo-qf .fi-tabs-item.fi-active .fi-badge {
    background: var(--ds-lime-bg, #F5F8E8) !important;
    color: var(--ds-lime-text, #6B7D12) !important;
}
.dark .jo-qf .fi-tabs-item:hover:not(.fi-active) {
    background: rgba(206, 226, 111, .08) !important;
}
/* Il conteggio della voce attiva del menu nel verde, come la scritta. */
html body .fi-page-sub-navigation-tabs .fi-tabs-item.fi-active .fi-badge {
    background: var(--ds-lime-bg, #F5F8E8) !important;
    color: var(--ds-lime-text, #6B7D12) !important;
    box-shadow: inset 0 0 0 1px var(--ds-lime-light, #DCE8A3) !important;
}

/* ==========================================================================
 * 7. Colore di marca con un ruolo (cliente 28-ott-2026: «troppo piatta,
 *    il menu più evidente»). Ogni colore dice dove sei o cosa puoi fare.
 * ========================================================================== */

/* Menu: il gruppo aperto ha una linea guida chiara sul fondo scuro (prima
   viola pieno sul fondo chiaro), staccata dalle voci: il riquadro della voce
   aperta non la tocca (owner 10-nov-2026). */
.fi-sidebar-group:has(> .fi-sidebar-group-button):not([data-group-label="Analytics"]) > .fi-sidebar-group-items {
    border-left: 2px solid var(--ds-sb-line);
    padding-left: 6px;
}

/* Contatori del menu: pillola chiara col numero viola, si vede sul fondo
   scuro (i moduli da attivare restano ambra). */
html body .fi-sidebar .fi-sidebar-item .fi-badge:not(.fi-color-warning) {
    background-color: var(--ds-sb-badge-bg) !important;
    color: var(--ds-sb-badge-fg) !important;
    font-weight: 600 !important;
}

/* Percorso e freccia indietro: sono link, dicono da dove vieni. */
html body :is(.fi-main, .fi-topbar) .fi-breadcrumbs a.fi-breadcrumbs-item-label {
    color: var(--ds-accent-fg) !important;
}

.jo-topbar-back,
.jo-backlink {
    color: var(--ds-accent);
}

/* Sotto-sezione attiva (menu orizzontale e tab di sezione): resta in lime,
   con la riga più marcata. */
html body .fi-page-sub-navigation-tabs .fi-tabs-item.fi-active::after,
html body .jo-sec-tabs > button.is-active::after {
    height: 3px;
    background: var(--ds-lime);
}

/* Icone del menu chiare sul fondo scuro (prima viola, --ds-nav-icon); le
   frecce dei gruppi più tenui, al passaggio l'icona diventa bianca piena. */
html body .fi-sidebar .fi-sidebar-group-button .fi-icon-btn {
    color: var(--ds-sb-muted) !important;
}

html body .fi-sidebar .fi-sidebar-item:not(.fi-sidebar-item-active) > .fi-sidebar-item-button:hover .fi-sidebar-item-icon {
    color: var(--ds-sb-fg-strong) !important;
}

/* Più forte del grigio leggibile di Filament (.text-gray-400 nella sidebar). */
html body .fi-sidebar .fi-sidebar-group-button .fi-sidebar-group-icon,
html body .fi-sidebar .fi-sidebar-item:not(.fi-sidebar-item-active) .fi-sidebar-item-icon {
    color: var(--ds-sb-icon) !important;
}

html body .fi-sidebar .text-gray-400 {
    color: var(--ds-sb-muted) !important;
}

/* Menu chiuso (solo icone): l'icona di ogni macroarea apre la sua tendina.
   Chiara sul fondo scuro, lime quella della macroarea in cui si lavora
   (Filament la colorava di viola, che sul viola non si leggeva). */
html body .fi-sidebar .fi-sidebar-group > .fi-dropdown .fi-dropdown-trigger button {
    color: var(--ds-sb-icon);
}

html body .fi-sidebar .fi-sidebar-group > .fi-dropdown .fi-dropdown-trigger button svg {
    color: inherit !important;
}

html body .fi-sidebar .fi-sidebar-group.fi-active > .fi-dropdown .fi-dropdown-trigger button {
    color: var(--ds-lime);
    background-color: var(--ds-sb-active-bg);
}

html body .fi-sidebar .fi-sidebar-group > .fi-dropdown .fi-dropdown-trigger button:hover {
    background-color: var(--ds-sb-hover);
}

/* Tabelle e form: la stessa linea viola della sidebar dove c'è qualcosa di
   aperto, scelto o attivo. */

/* Riga al passaggio: la linea a sinistra, come la riga selezionata (si apre). */
html .fi-ta-table:not(.jo-ta-cards *) > tbody > tr.fi-ta-row:hover > td:first-child {
    box-shadow: inset 2px 0 0 var(--ds-accent);
}

/* Colonna con un filtro: l'imbuto pieno in viola, senza riquadro (owner
   9-nov-2026: «più fine ed elegante»; prima un quadratino viola pieno). Il
   riquadro tenue torna solo al passaggio, come sugli altri imbuti. */
html body .jo-colf-btn.is-active {
    background: transparent;
    color: var(--ds-accent-fg);
}

html body .jo-colf-btn.is-active:hover {
    background: var(--jo-ui-accent-soft);
}

/* Colonna ordinata: titolo e freccia viola. */
html body .fi-ta-header-cell-sort-icon:not(.text-gray-400),
html body .fi-ta-header-cell:has(.fi-ta-header-cell-sort-icon:not(.text-gray-400)) .fi-ta-header-cell-label {
    color: var(--ds-accent-fg) !important;
}

/* Accordion aperto (card-passo e sezioni che si aprono): linea viola a sinistra. */
html body .fi-main .fi-section.fi-section.fi-section.fi-section:not(.fi-collapsed):not(.fi-aside):has(> header[x-on\:click]) {
    position: relative;
}

html body .fi-main .fi-section.fi-section.fi-section.fi-section:not(.fi-collapsed):not(.fi-aside):has(> header[x-on\:click])::before {
    content: '';
    position: absolute;
    z-index: 3;
    top: 10px;
    bottom: 10px;
    left: -1px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--ds-accent);
    pointer-events: none;
}

/* Panoramica: l'icona del widget accanto al titolo di ogni blocco, nel
   colore del suo argomento su un tassello bianco, sopra la testata tinta
   (Elia 6-nov-2026, «più vivace»: prima tutte viola; --jo-hd-ic, --jo-hd-c
   e --jo-hd-cbg da DashboardWidgets::headStyle, testata in std-platform.css). Titolo in riga, non flex: se va a capo la
   "i" segue l'ultima parola invece di restare staccata a destra (Dashboard
   generale a 1280px, 28-ott-2026). */
.jo-hd-w[style*="--jo-hd-ic"] .jo-an-card h3:first-of-type {
    position: relative;
    isolation: isolate;
    padding-left: 38px;
}

.jo-hd-w[style*="--jo-hd-ic"] .jo-an-card h3:first-of-type::before {
    content: '';
    position: absolute;
    z-index: 1;
    top: calc((1lh - 16px) / 2);
    left: 6px;
    width: 16px;
    height: 16px;
    background: var(--jo-hd-c, var(--ds-accent));
    -webkit-mask: var(--jo-hd-ic) center / contain no-repeat;
    mask: var(--jo-hd-ic) center / contain no-repeat;
}

.jo-hd-w[style*="--jo-hd-ic"] .jo-an-card h3:first-of-type::after {
    content: '';
    position: absolute;
    z-index: 0;
    top: calc((1lh - 28px) / 2);
    left: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--ds-surface);
    box-shadow: 0 1px 2px rgb(0 0 0 / .06);
}

/* KPI con un valore: la linea a sinistra nel colore del suo stato
   (arancio = da fare, verde acqua = risultato buono, rosso = problema); a
   zero niente linea. */
.jo-kpi:has(.jo-kpi-ic:is(.jo-tone-todo, .jo-tone-money, .jo-tone-danger):not(.is-zero)) {
    position: relative;
}

.jo-kpi:has(.jo-kpi-ic:is(.jo-tone-todo, .jo-tone-money, .jo-tone-danger):not(.is-zero))::before,
.fi-wi-stats-overview-stat:is([data-jo-tone="todo"], [data-jo-tone="money"], [data-jo-tone="danger"]):not([data-jo-zero])::before {
    content: '';
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: -1px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--ds-warn-dot);
    pointer-events: none;
}

.jo-kpi:has(.jo-kpi-ic.jo-tone-money:not(.is-zero))::before,
.fi-wi-stats-overview-stat[data-jo-tone="money"]:not([data-jo-zero])::before {
    background: var(--ds-tone-money-solid);
}

.jo-kpi:has(.jo-kpi-ic.jo-tone-danger:not(.is-zero))::before,
.fi-wi-stats-overview-stat[data-jo-tone="danger"]:not([data-jo-zero])::before {
    background: var(--ds-err-dot);
}

/* Tessere con uno stato: anche il fondo e il bordo nel suo colore (Elia
   5-nov-2026: «il resto della piattaforma sembra piatto»), tinta leggera dai
   token (nel tema scuro sono trasparenze sul nero) e testo in inchiostro,
   così si legge; l'icona sta sul suo tassello pieno (ui-standard.css,
   Elia 6-nov-2026). I conteggi senza stato e le tessere a zero restano su
   card: il colore dice «qui c'è qualcosa» e non si consuma. */
.jo-kpi:has(.jo-kpi-ic.jo-tone-todo:not(.is-zero)),
.fi-wi-stats-overview-stat[data-jo-tone="todo"]:not([data-jo-zero]) {
    background-color: var(--ds-warn-bg) !important;
    border-color: var(--ds-warn-bd) !important;
}

.jo-kpi:has(.jo-kpi-ic.jo-tone-money:not(.is-zero)),
.fi-wi-stats-overview-stat[data-jo-tone="money"]:not([data-jo-zero]) {
    background-color: var(--ds-tone-money-bg) !important;
    border-color: color-mix(in srgb, var(--ds-tone-money-solid) 28%, transparent) !important;
}

.jo-kpi:has(.jo-kpi-ic.jo-tone-danger:not(.is-zero)),
.fi-wi-stats-overview-stat[data-jo-tone="danger"]:not([data-jo-zero]) {
    background-color: var(--ds-err-bg) !important;
    border-color: var(--ds-err-bd) !important;
}

/* Avanzamento («Da completare»): lime JOORNA. */
.jo-setup-bar > span {
    background: var(--ds-lime) !important;
}

/* Menu per esplorare (cliente 28-ott-2026: «più evidenti, con uno sfondo
   viola, sempre cliccabili»): barra viola JOORNA ferma sotto la topbar,
   voci bianche, la voce attiva in grassetto con la riga lime. */
html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs,
html body .jo-sec-tabs.jo-sec-tabs {
    position: sticky;
    top: calc(var(--jo-topbar-h, 64px) + 8px);
    /* Sotto la topbar (20) e i suoi menu (utente, ricerca), come la scheda
       dell'hotel: a 20 copriva il menu utente aperto. */
    z-index: 15;
    gap: 4px !important;
    padding: 5px !important;
    border-color: var(--ds-accent) !important;
    background: var(--ds-accent) !important;
    /* Copre la fessura sopra la barra: il contenuto non spunta mentre scorre. */
    box-shadow: 0 -8px 0 var(--ds-bg-app) !important;
    transition: box-shadow .32s cubic-bezier(.16, 1, .3, 1);
}


/* Il titolo della pagina nella barra delle sezioni si vede solo con la
   barra ferma in alto, sul computer (sotto, «Pagina scesa»). */
.jo-sec-tabs > .jo-sec-title {
    display: none;
}

/* Accordion aperto, pagina sotto il velo (form-standard.css): la fessura
   prende lo stesso velo, altrimenti resta una striscia chiara che sembra
   una seconda barra dietro quella viola. body.jo-focus-open la mette
   form-steps.js: con body:has(…) Chrome riscandiva tutta la pagina a ogni
   ricalcolo dello stile (PanelCssSelectorsTest). */
body.jo-focus-open .jo-sec-tabs.jo-sec-tabs,
body.jo-focus-open .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs {
    box-shadow: 0 -8px 0 var(--ds-focus-veil, rgb(15 17 23 / .12)), 0 -8px 0 var(--ds-bg-app) !important;
}

html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item.fi-tabs-item,
html body .jo-sec-tabs.jo-sec-tabs > button {
    align-self: stretch;
    height: auto !important;
    border-radius: 8px !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* La voce con la tendina (es. «Addestra il chatbot») sta nel trigger, un
   blocco dove align-self: stretch non vale: restava alta quanto il testo,
   attaccata in cima alla barra. Alta quanto il trigger, come le altre voci
   (29-ott-2026). */
html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs > .fi-dropdown > .fi-dropdown-trigger > .fi-tabs-item.fi-tabs-item {
    height: 100% !important;
}

/* La sua freccina nel colore delle scritte della barra (grigia sul viola si
   vedeva appena). */
html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs > .fi-dropdown > .fi-dropdown-trigger > .fi-tabs-item.fi-tabs-item::before {
    color: var(--ds-on-accent);
}

/* Voci non scelte un filo più tenui (5,3:1 sul viola) e la scelta bianca in
   grassetto con la riga lime: si vede subito dove si è (5-nov-2026,
   segnalazione utente: «menu poco visibile»; prima tutte bianche a 600 e la
   scelta a 700, quasi uguali). */
html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item .fi-tabs-item-label,
html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item .fi-tabs-item-icon,
html body .jo-sec-tabs.jo-sec-tabs > button {
    color: color-mix(in srgb, var(--ds-on-accent) 88%, transparent) !important;
    font-size: 14px;
    font-weight: 500 !important;
}

/* Nel tema scuro il viola è più chiaro: le voci restano bianche piene (più
   tenui scenderebbero sotto 4:1) e la scelta si riconosce da grassetto e riga. */
html.dark body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item .fi-tabs-item-label,
html.dark body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item .fi-tabs-item-icon,
html.dark body .jo-sec-tabs.jo-sec-tabs > button {
    color: var(--ds-on-accent) !important;
}

html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item:not(.fi-active):hover,
html body .jo-sec-tabs.jo-sec-tabs > button:not(.is-active):hover {
    background: rgb(255 255 255 / .14) !important;
}

html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item:not(.fi-active):hover .fi-tabs-item-label,
html body .jo-sec-tabs.jo-sec-tabs > button:not(.is-active):hover {
    color: var(--ds-on-accent) !important;
}

html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item.fi-active .fi-tabs-item-label,
html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item.fi-active .fi-tabs-item-icon,
html body .jo-sec-tabs.jo-sec-tabs > button.is-active {
    color: var(--ds-on-accent) !important;
    font-weight: 700 !important;
}

html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item.fi-active::after,
html body .jo-sec-tabs.jo-sec-tabs > button.is-active::after {
    bottom: 4px;
    left: 14px;
    right: 14px;
    height: 3px;
    background: var(--ds-lime);
}

html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item:focus-visible,
html body .jo-sec-tabs.jo-sec-tabs > button:focus-visible {
    box-shadow: 0 0 0 2px var(--ds-on-accent) !important;
}

/* Sul telefono la barra viola scorre di lato: un'ombra sul bordo dice che ci
   sono altre voci da quella parte e sparisce arrivati in fondo (lo strato
   "local" la copre). Quella del 19-ott era sul fondo chiaro, che il viola del
   28-ott ha coperto. La voce aperta la porta in vista ui-standard.js. */
@media (max-width: 767.98px) {
    html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs {
        background:
            linear-gradient(var(--ds-accent), var(--ds-accent)) left center / 28px 100% no-repeat local,
            linear-gradient(var(--ds-accent), var(--ds-accent)) right center / 28px 100% no-repeat local,
            linear-gradient(to right, var(--ds-backdrop), transparent) left center / 28px 100% no-repeat scroll,
            linear-gradient(to left, var(--ds-backdrop), transparent) right center / 28px 100% no-repeat scroll,
            var(--ds-accent) !important;
    }
}

/* Testata viola con le linguette (segnalazione ClickUp 9-nov-2026 sul menu
   viola a tutto schermo; tra le alternative della tela l'owner ha scelto la
   E): dal computer titolo e sotto-sezioni stanno in una fascia viola come il
   menu laterale (token --ds-side-*); le voci sono testo chiaro e quella
   aperta è bianca in grassetto con la riga lime sotto (owner 10-nov-2026: la
   fascia sì, le linguette col colore della pagina no). Il sotto-menu segue
   la testata (standard o delle bacheche, .jo-gd) e ne è la parte bassa: i KPI
   vengono dopo, anche quelli disegnati dalla pagina. Sul telefono resta
   la barra di prima, che scorre di lato. La barra delle sezioni
   (.jo-sec-tabs) non cambia. */
@media (min-width: 768px) {
    html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs {
        width: 100%;
        max-width: none;
        margin-inline: 0;
        gap: 4px !important;
        padding: 6px 16px !important;
        border: 0 !important;
        border-radius: 16px !important;
        background: linear-gradient(90deg, var(--ds-side-bg-top), var(--ds-side-bg-bottom)) !important;
        box-shadow: 0 -8px 0 var(--ds-bg-app) !important;
    }
    html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item.fi-tabs-item {
        position: relative;
        align-self: center;
        height: 40px !important;
        padding: 0 14px !important;
        border-radius: 10px !important;
    }
    html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item .fi-tabs-item-label,
    html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item .fi-tabs-item-icon {
        color: var(--ds-side-fg) !important;
        font-weight: 500 !important;
    }
    html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item:not(.fi-active):hover {
        background: var(--ds-side-hover) !important;
    }
    /* La voce aperta: scritta bianca piena in grassetto con la riga lime sotto,
       senza fondo (owner 10-nov-2026: la fascia viola sì, le linguette no). */
    html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item.fi-active {
        background: transparent !important;
    }
    html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item.fi-active .fi-tabs-item-label,
    html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item.fi-active .fi-tabs-item-icon {
        color: var(--ds-side-fg-strong) !important;
        font-weight: 700 !important;
    }
    html body .fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs .fi-tabs-item.fi-active::after {
        top: auto;
        bottom: 4px;
        left: 14px;
        right: 14px;
        height: 3px;
        border-radius: 3px;
        background: var(--ds-lime);
    }

    /* Testata standard seguita subito dal sotto-menu, senza KPI in mezzo
       (.jo-subnav-joined, override della pagina): la parte alta della fascia,
       con titolo e descrizione chiari; il sotto-menu ne è la parte bassa. Con
       i KPI fra i due la testata resta normale (owner 10-nov-2026: la fascia
       spezzata coi KPI dentro «non è UX UI oriented»). */
    html body .fi-page.jo-subnav-joined .fi-header:has(+ div > nav.fi-page-sub-navigation-tabs) {
        margin-bottom: -20px;
        padding: 14px 20px 10px;
        border-radius: 16px 16px 0 0;
        background: linear-gradient(90deg, var(--ds-side-bg-top), var(--ds-side-bg-bottom));
    }

    /* Ogni testata nella fascia viola, anche senza sotto-sezioni (owner
       10-nov-2026, «ovunque»): la testata standard (anche quelle disegnate a
       mano con .fi-header in cima) e quella delle bacheche (.jo-gd-head:
       Panoramica, Dashboard generale, Chatbot). In chiaro titolo,
       descrizione e icone (il percorso sta sopra, fuori dalla fascia); la
       CTA è bianca col testo viola (viola su viola non si vedrebbe), i
       pulsanti grigi senza fondo col bordo chiaro. Sul telefono la fascia
       sta in mobile.css. */
    html body .fi-page > section > .fi-header,
    html body .fi-page > section > div > header.fi-header:first-child,
    html body .fi-page > section > header.jo-gd > .jo-gd-head {
        padding: 14px 20px;
        border-radius: 16px;
        background: linear-gradient(90deg, var(--ds-side-bg-top), var(--ds-side-bg-bottom));
    }
    /* Fascia compatta (owner 18-nov-2026, «più compatte, col titolo e il
       sottotitolo»): da 100 a circa 78px, margini 14/20 e titolo
       --ds-fs-h1 invece di 26px. Solo sul computer: sul telefono la fascia
       sta in mobile.css. */
    html body .fi-page > section .fi-header .fi-header-heading,
    html body .fi-page > section header.jo-gd > .jo-gd-head h1,
    html body .fi-page .jo-ibx > .jo-ibx-head .jo-ibx-title h1 {
        font-size: var(--ds-fs-h1) !important;
        line-height: 28px !important;
    }
    /* Descrizione attaccata al titolo e in evidenza (owner 18-nov-2026: «troppo
       staccato», «troppo cupo», poi «ancora non messi in evidenza»): 2px sotto
       il titolo, 14px e semi-grassetta; il colore, bianco come il titolo, sta
       nelle regole della fascia più sotto. */
    html body .fi-page > section .fi-header .fi-header-subheading,
    html body .fi-page > section .fi-header .fi-header-subheading span:not(.jo-callout, .jo-callout span, .fi-badge, .fi-badge span),
    html body .fi-page > section header.jo-gd > .jo-gd-head p,
    html body .fi-page > section header.jo-gd > .jo-gd-head .jo-page-desc,
    html body .fi-page .jo-ibx > .jo-ibx-head .jo-ibx-title p {
        margin-top: 2px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
    }
    html body .fi-page > section .fi-header .fi-header-subheading .jo-page-desc { margin-top: 0 !important; }
    /* Pallini, periodo e switch a metà altezza della fascia (owner 18-nov-2026,
       «allineerei i pulsanti»), anche nelle bacheche e nell'Inbox. */
    html body .fi-page > section header.jo-gd > .jo-gd-head,
    html body .fi-page .jo-ibx > .jo-ibx-head { align-items: center !important; }
    html body .fi-page > section .fi-header .fi-header-heading,
    html body .fi-page > section header.jo-gd > .jo-gd-head h1 { color: var(--ds-side-fg-strong) !important; }
    /* Non gli avvisi (.jo-callout) e i badge di stato messi nella
       descrizione: hanno il loro fondo chiaro e il loro testo scuro
       (Configurazione chatbot con l'AI spenta, richiesta di contatto). Le
       righe sotto il titolo (.jo-stx-sub, .jo-cr-head-meta) chiare. */
    html body .fi-page > section .fi-header .fi-header-subheading,
    html body .fi-page > section .fi-header .fi-header-subheading span:not(.jo-callout, .jo-callout span, .fi-badge, .fi-badge span),
    html body .fi-page > section .fi-header .fi-header-heading .jo-stx-sub,
    html body .fi-page > section .fi-header .fi-header-heading .jo-cr-head-meta,
    html body .fi-page > section header.jo-gd > .jo-gd-head p,
    html body .fi-page > section header.jo-gd > .jo-gd-head .jo-page-desc { color: var(--ds-side-fg-strong) !important; } /* bianca come il titolo dal 18-nov-2026 (prima --ds-side-sub, 86%) */
    /* Etichette dell'ospite (Gold, VIP…) accanto al nome: su un fondo
       chiaro col loro colore, sul viola non si leggevano. */
    html body .fi-page > section .fi-header .jo-cell-tag {
        border-color: transparent;
        background: var(--ds-surface);
    }
    html body .fi-page > section .fi-header .fi-icon-btn,
    html body .fi-page > section header.jo-gd > .jo-gd-head .jo-icon-btn { color: var(--ds-side-fg) !important; }
    html body .fi-page > section .fi-header .fi-icon-btn:hover,
    html body .fi-page > section header.jo-gd > .jo-gd-head .jo-icon-btn:hover { background: var(--ds-side-hover) !important; color: var(--ds-side-fg-strong) !important; }
    html body .fi-page > section .fi-header .fi-btn.fi-color-primary {
        background: var(--ds-surface) !important;
        color: var(--ds-accent-fg) !important;
        box-shadow: none !important;
    }
    html body .fi-page > section .fi-header .fi-btn.fi-color-primary .fi-btn-icon { color: var(--ds-accent-fg) !important; }
    html body .fi-page > section .fi-header .fi-btn.fi-color-gray {
        background: transparent !important;
        color: var(--ds-side-fg-strong) !important;
        box-shadow: inset 0 0 0 1px var(--ds-side-line) !important;
    }
    html body .fi-page > section .fi-header .fi-btn.fi-color-gray .fi-btn-icon { color: var(--ds-side-fg) !important; }
    html body .fi-page > section header.jo-gd > .jo-gd-head .jo-widgets-edit[aria-pressed="true"] { background: var(--ds-surface) !important; color: var(--ds-accent-fg) !important; }

    /* Inbox: la sua testata (.jo-ibx-head) nella stessa fascia, con lo
       strumento e «+ Nuova …» in chiaro. */
    html body .fi-page .jo-ibx > .jo-ibx-head {
        padding: 14px 20px;
        border-radius: 16px;
        background: linear-gradient(90deg, var(--ds-side-bg-top), var(--ds-side-bg-bottom));
    }
    html body .fi-page .jo-ibx > .jo-ibx-head .jo-ibx-title h1 { color: var(--ds-side-fg-strong) !important; }
    html body .fi-page .jo-ibx > .jo-ibx-head .jo-ibx-title p { color: var(--ds-side-fg-strong) !important; }

    /* La barra delle sezioni delle schede e delle impostazioni nello stesso
       viola sfumato della fascia (prima viola pieno): due viola diversi uno
       sotto l'altro stonavano. */
    html body .jo-sec-tabs.jo-sec-tabs {
        border-color: transparent !important;
        background: linear-gradient(90deg, var(--ds-side-bg-top), var(--ds-side-bg-bottom)) !important;
    }
    /* Lo stesso con la testata delle bacheche (Panoramica chatbot). */
    html body .fi-page.jo-subnav-joined > section > header.jo-gd:has(+ div > nav.fi-page-sub-navigation-tabs) {
        margin-bottom: -20px;
    }
    html body .fi-page.jo-subnav-joined > section > header.jo-gd:has(+ div > nav.fi-page-sub-navigation-tabs) > .jo-gd-head {
        padding-bottom: 14px;
        border-radius: 16px 16px 0 0;
    }
    html body .fi-page.jo-subnav-joined .fi-header + div > nav.fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs,
    html body .fi-page.jo-subnav-joined > section > header.jo-gd + div > nav.fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs {
        border-radius: 0 0 16px 16px !important;
        padding-top: 0 !important;
        padding-bottom: 8px !important;
        /* Niente copertura chiara sopra: la parte alta della fascia è la testata. */
        box-shadow: none !important;
    }

    /* Menu disegnato dalla pagina, subito sotto la testata (.jo-band-joined
       sulla pagina e .jo-band-nav sul menu: Traffico e Ads): la stessa
       fascia del sotto-menu (owner 10-nov-2026). */
    html body .fi-page.jo-band-joined > section > .fi-header {
        margin-bottom: -20px;
        padding-bottom: 14px;
        border-radius: 16px 16px 0 0;
    }
    html body .fi-page.jo-band-joined nav.jo-band-nav.fi-page-sub-navigation-tabs {
        border-radius: 0 0 16px 16px !important;
        padding-top: 0 !important;
        padding-bottom: 8px !important;
        box-shadow: none !important;
    }

    /* Barra delle sezioni (schede hotel, gruppo e struttura, impostazioni:
       .jo-sec-page) subito sotto il titolo: è la parte bassa della fascia, il
       riepilogo della scheda sta sotto come i KPI (owner 10-nov-2026). */
    html body .fi-page.jo-sec-page > section > .fi-header:has(+ div > nav.jo-sec-tabs) {
        margin-bottom: -20px;
        padding-bottom: 14px;
        border-radius: 16px 16px 0 0;
    }
    html body .fi-page.jo-sec-page > section > .fi-header + div > nav.jo-sec-tabs.jo-sec-tabs {
        border-radius: 0 0 16px 16px !important;
        padding: 0 19px 8px !important;
        box-shadow: none !important;
    }

    /* Pagina scesa, menu fermo in alto (is-stuck, ui-standard.js; owner
       10-nov-2026): si stacca dalla fascia ed è una barra arrotondata, con
       la fessura sopra coperta. La barra delle sezioni porta con sé il
       titolo della pagina, senza la riga del riepilogo. Lo spazio in più
       sopra le voci (--jo-stuck-grow) cresce verso l'alto: le voci restano
       dove sono. */
    html body .fi-page.jo-subnav-joined .fi-header + div > nav.fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs,
    html body .fi-page.jo-subnav-joined > section > header.jo-gd + div > nav.fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs,
    html body .fi-page.jo-band-joined nav.jo-band-nav.fi-page-sub-navigation-tabs {
        /* Il nome della pagina sopra le voci (owner 11-nov-2026), come le sezioni. */
        --jo-stuck-grow: 40px;
    }
    html body .fi-page nav.fi-page-sub-navigation-tabs > .jo-stuck-title { display: none; }
    html body .fi-page.jo-sec-page > section > .fi-header + div > nav.jo-sec-tabs.jo-sec-tabs {
        --jo-stuck-grow: 40px;
    }
    html body .fi-page.jo-subnav-joined .fi-header + div > nav.fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs.is-stuck,
    html body .fi-page.jo-subnav-joined > section > header.jo-gd + div > nav.fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs.is-stuck,
    html body .fi-page.jo-band-joined nav.jo-band-nav.fi-page-sub-navigation-tabs.is-stuck,
    html body .fi-page.jo-sec-page > section > .fi-header + div > nav.jo-sec-tabs.jo-sec-tabs.is-stuck {
        margin-top: calc(-1 * var(--jo-stuck-grow));
        padding-top: var(--jo-stuck-grow) !important;
        border-radius: 16px !important;
        /* Una cornice del colore della pagina tutto intorno, che sale fino
           alla topbar: niente spunta dalla fessura né dagli angoli tondi. */
        box-shadow: 0 0 0 8px var(--ds-bg-app), 0 -8px 0 8px var(--ds-bg-app) !important;
    }
    html body .fi-page.jo-sec-page > section > .fi-header + div > nav.jo-sec-tabs.jo-sec-tabs.is-stuck {
        height: calc(46px + var(--jo-stuck-grow));
    }
    /* Le sotto-sezioni ferme: altezza fissa delle voci più il posto del nome della pagina. */
    html body .fi-page nav.fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs.is-stuck:has(> .jo-stuck-title) {
        height: auto !important;
        min-height: calc(48px + var(--jo-stuck-grow));
    }
    html body.jo-focus-open .fi-page.jo-subnav-joined .fi-header + div > nav.fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs.is-stuck,
    html body.jo-focus-open .fi-page.jo-subnav-joined > section > header.jo-gd + div > nav.fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs.is-stuck,
    html body.jo-focus-open .fi-page.jo-band-joined nav.jo-band-nav.fi-page-sub-navigation-tabs.is-stuck,
    html body.jo-focus-open .fi-page.jo-sec-page > section > .fi-header + div > nav.jo-sec-tabs.jo-sec-tabs.is-stuck {
        box-shadow: 0 0 0 8px var(--ds-focus-veil, rgb(15 17 23 / .12)), 0 0 0 8px var(--ds-bg-app), 0 -8px 0 8px var(--ds-bg-app) !important;
    }
    html body .fi-page.jo-sec-page nav.jo-sec-tabs.is-stuck > .jo-sec-title,
    html body .fi-page nav.fi-page-sub-navigation-tabs.is-stuck > .jo-stuck-title {
        display: block;
        position: absolute;
        top: 12px;
        right: 24px;
        left: 24px;
        overflow: hidden;
        color: var(--ds-side-fg-strong);
        font-size: var(--ds-fs-h3);
        font-weight: 700;
        line-height: 22px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Con il menu fermo in alto, la riga dei titoli della tabella si ferma sotto
   il menu, non sotto la topbar (niente che si copre): altezza vera del menu
   da ui-standard.js (--jo-subnav-h, e html.jo-has-subnav quando il menu
   c'è: non body:has(), che si rivaluta su tutta la pagina), anche se va a
   capo. Le tabelle nei pop-up e nei campi dei form restano coi titoli in
   cima al loro riquadro (data-table.css). */
@media (min-width: 1280px) {
    html.jo-has-subnav body .fi-page .fi-ta:not(.jo-ta-cards, :is(.fi-modal, .fi-fo-component-ctn) *) .fi-ta-content > table.fi-ta-table > thead > tr > th {
        top: calc(var(--jo-topbar-h, 64px) + 8px + var(--jo-subnav-h, 46px));
    }
}

/* Menu a tendina con le immagini della Libreria: miniatura e nome
   (App\Filament\Support\MediaImageOptions). */
.jo-opt-img {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    vertical-align: middle;
}

.jo-opt-img > img,
.jo-opt-img > .jo-opt-img-none {
    order: -1;
    flex: none;
    width: 44px;
    height: 30px;
    border-radius: 5px;
    object-fit: cover;
    background: var(--ds-surface-2, #F3F4F8);
    box-shadow: inset 0 0 0 1px var(--ds-border);
}

.jo-opt-img-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tipologia della camera nel preventivo: il prezzo del motore a destra del nome (owner 29-ott-2026). */
.jo-opt-img:has(.jo-opt-price),
.jo-opt-img:has(.jo-opt-why) {
    width: 100%;
}

.jo-opt-price {
    flex: none;
    margin-inline-start: auto;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ds-text-primary);
}

/* Nelle voci già scelte di un menu multiplo la miniatura è più piccola. */
.choices__list--multiple .jo-opt-img > img,
.choices__list--multiple .jo-opt-img > .jo-opt-img-none {
    width: 28px;
    height: 20px;
}

/* Barra che scorre di lato (telefono): la sfumatura a destra (mask-image,
   form-standard.css) taglia anche la copertura della fessura, quindi la
   barra si attacca alla topbar, senza fessura. */
html body .jo-sec-tabs.jo-sec-tabs:is(.is-overflow, .is-scrolled) {
    top: var(--jo-topbar-h, 64px);
}

/* Blocchi dentro una card (es. Scheda hotel ▸ Integrazioni: Meta Ads,
   Google Ads, Credenziali, Import automatico): più respiro prima di ogni
   titolo, non attaccati al blocco sopra (cliente 28-ott-2026). */
.fi-fo-component-ctn > div:has(> .fi-section.jo-wheel-sub) ~ div:has(> .fi-section.jo-wheel-sub) {
    margin-top: 20px;
}

/* Card stretta (portatile, tablet): anche le griglie dentro i blocchi passano
   a 6 colonne, come quella della card, così date e campi brevi non si
   tagliano (prima solo la griglia diretta della card). */
@container jo-fcard (max-width: 720px) {
    .fi-section-content .fi-fo-component-ctn .grid[style*="--cols-lg: repeat(12"] {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    }

    .fi-section-content .fi-fo-component-ctn .grid[style*="--cols-lg: repeat(12"] > * {
        grid-column: var(--col-span-md, 1 / -1) !important;
    }
}

/* ...e come la griglia della card: molto stretta un terzo torna a metà,
   sul telefono una colonna (owner 30-ott-2026, Emetti voucher › Chi lo riceve). */
@container jo-fcard (max-width: 520px) {
    .fi-section-content .fi-fo-component-ctn .grid[style*="--cols-lg: repeat(12"] > [style*="--col-span-md: span 2"] {
        grid-column: span 3 / span 3 !important;
    }
}

@container jo-fcard (max-width: 380px) {
    .fi-section-content .fi-fo-component-ctn .grid[style*="--cols-lg: repeat(12"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .fi-section-content .fi-fo-component-ctn .grid[style*="--cols-lg: repeat(12"] > * {
        grid-column: 1 / -1 !important;
    }
}

/* Importi (cliente 28-ott-2026: «dati economici in verde e più in
   risalto»; data-jo-money da ui-standard.js). Una logica sola ovunque:
   in grassetto con le cifre in colonna; sopra zero verde acqua, il colore
   dei soldi (owner 10-nov-2026; prima verde come WhatsApp), a zero o non
   entrati (riga fallita, annullata…) grigio, sotto
   zero rosso. I prezzi di listino (data-jo-price sulla colonna) solo in grassetto, solo la cifra. Attributo doppio: deve
   vincere anche sul testo chiaro del tema scuro (sezione 1b). */
html body [data-jo-money]:not([data-jo-money="off"]) {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

html body [data-jo-money][data-jo-money="pos"] {
    color: var(--ds-tone-money-fg) !important;
}

html body [data-jo-money]:is([data-jo-money="zero"], [data-jo-money="void"]) {
    color: var(--ds-text-tertiary) !important;
}

html body [data-jo-money][data-jo-money="neg"] {
    color: var(--ds-err-fg) !important;
}

/* La "i" di KPI e grafici (MetricHelp, ui-standard.js): quella dei campi,
   attaccata al nome; nel titolo di un grafico sulla stessa riga del testo. */
.jo-info--metric {
    flex: none;
    margin-left: 2px;
}

:is(h2, h3, .fi-section-header-heading, .fi-wi-chart-heading) > .jo-info--metric {
    vertical-align: middle;
    margin-top: -3px;
}

/* ── Gerarchia nelle liste (cliente 6-nov-2026) ──────────────────────────
   Il nome è il dato della riga, ID e recapiti sono contesto; lo stato si
   legge dal colore del testo oltre che dal pallino (sempre testo + segno,
   mai solo colore); le categorie hanno la loro icona. */
html .fi-ta-table > tbody td[data-jo-w='main'] .fi-ta-text-item-label {
    font-weight: 600;
    color: var(--ds-text-primary);
}

html .fi-ta-table > tbody td[data-jo-w='main'] .fi-ta-text.jo-cell-2l > p {
    font-size: 12px;
    color: var(--ds-text-tertiary);
}

html .jo-cell-status {
    font-weight: 600;
}

html .jo-cell-status .jo-cell-dot {
    flex-basis: 8px;
    width: 8px;
    height: 8px;
}

html .jo-cell-status.fi-color-success { color: var(--ds-ok-fg); }
html .jo-cell-status.fi-color-warning { color: var(--ds-warn-fg); }
html .jo-cell-status.fi-color-danger  { color: var(--ds-err-fg); }
html .jo-cell-status.fi-color-info    { color: var(--ds-info-fg); }
html .jo-cell-status.fi-color-primary { color: var(--ds-auto-fg); }

/* Categoria dell'ospite (HotelGuestFrequencyTagEnum::chip): VIP con le
   stelline, Gold e Silver con la stella, testo nel colore della tinta. */
html .jo-cell-tag.jo-ctag:is(.jo-cat-vip, .jo-cat-gold, .jo-cat-silver) {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-left: 5px;
    font-weight: 600;
    color: color-mix(in srgb, var(--jo-ctag) 78%, var(--ds-text-primary));
}

html .jo-cell-tag.jo-ctag:is(.jo-cat-vip, .jo-cat-gold, .jo-cat-silver)::before {
    content: '';
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    background: currentColor;
    -webkit-mask: var(--jo-cat-ic) center / contain no-repeat;
    mask: var(--jo-cat-ic) center / contain no-repeat;
}

html .jo-cell-tag.jo-cat-vip {
    --jo-cat-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 4.5a.75.75 0 0 1 .721.544l.813 2.846a3.75 3.75 0 0 0 2.576 2.576l2.846.813a.75.75 0 0 1 0 1.442l-2.846.813a3.75 3.75 0 0 0-2.576 2.576l-.813 2.846a.75.75 0 0 1-1.442 0l-.813-2.846a3.75 3.75 0 0 0-2.576-2.576l-2.846-.813a.75.75 0 0 1 0-1.442l2.846-.813A3.75 3.75 0 0 0 7.466 7.89l.813-2.846A.75.75 0 0 1 9 4.5ZM18 1.5a.75.75 0 0 1 .728.568l.258 1.036c.236.94.97 1.674 1.91 1.91l1.036.258a.75.75 0 0 1 0 1.456l-1.036.258c-.94.236-1.674.97-1.91 1.91l-.258 1.036a.75.75 0 0 1-1.456 0l-.258-1.036a2.625 2.625 0 0 0-1.91-1.91l-1.036-.258a.75.75 0 0 1 0-1.456l1.036-.258a2.625 2.625 0 0 0 1.91-1.91l.258-1.036A.75.75 0 0 1 18 1.5Z'/%3E%3C/svg%3E");
}

html .jo-cell-tag:is(.jo-cat-gold, .jo-cat-silver) {
    --jo-cat-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z'/%3E%3C/svg%3E");
}

/* Titoli delle colonne (da 1280px vanno a capo per stare nello schermo):
   al massimo due righe ben divise, mai «In / carico / a» una parola per riga. */
@media (min-width: 1280px) {
    html .fi-page .fi-ta:not(.jo-ta-cards) .fi-ta-table > thead > tr > th:not(:last-child):not(.fi-ta-selection-cell):not(.jo-crm-col-icon) {
        min-width: 5.5rem !important;
    }

    html .fi-ta-table > thead .fi-ta-header-cell-label {
        text-wrap: balance;
    }
}

/* Indirizzi, chiavi e id lunghi da copiare (URL del webhook, chiavi API,
   id di Meta e WhatsApp): vanno a capo dove serve invece di uscire dalla
   card sul telefono. Filament non ha la classe break-all che usano. */
html .fi-body .break-all {
    word-break: break-all;
}

/* Card senza testata (.jo-card-headless, Link utili, owner 11-nov-2026): le
   parti una sotto l'altra col loro tassello, come una sezione della Scheda
   hotel; la voce accesa del menu dice già di cosa si parla. */
html body .fi-section.fi-section.fi-section.fi-section.jo-fcard.jo-card-headless > .fi-section-header { display: none !important; }
html body .fi-section.fi-section.fi-section.fi-section.jo-fcard.jo-card-headless::before { content: none; }
html body .fi-section.fi-section.fi-section.fi-section.jo-fcard.jo-card-headless { border-color: var(--ds-border) !important; }
html body .fi-section.fi-section.fi-section.fi-section.jo-fcard.jo-card-headless > .fi-section-content-ctn { border-top: 0 !important; }

/* Pulsanti che rispondono al tocco (owner 11-nov-2026, «come iPhone e Mac»):
   premuti si rimpiccioliscono appena e tornano con un piccolo rimbalzo. Non
   quelli spenti; niente movimento per chi lo chiede al sistema. */
html body .fi-btn,
html body .fi-icon-btn,
html body .jo-icon-btn {
    transition: transform .18s cubic-bezier(.2, .9, .3, 1.4), background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
html body .fi-btn:active:not(:disabled),
html body .fi-icon-btn:active:not(:disabled),
html body .jo-icon-btn:active:not(:disabled) {
    transform: scale(.96);
}
@media (prefers-reduced-motion: reduce) {
    html body .fi-btn:active:not(:disabled),
    html body .fi-icon-btn:active:not(:disabled),
    html body .jo-icon-btn:active:not(:disabled) {
        transform: none;
    }
}

/* Righe come Finder (owner 11-nov-2026, «come iPhone e Mac»): al passaggio e
   da selezionate la riga è un nastro con gli estremi arrotondati, senza la
   linea viola a sinistra; la selezionata ha una tinta viola più decisa,
   che lascia leggere testi, stati e icone. */
html .fi-ta-table:not(.jo-ta-cards *) > tbody > tr.fi-ta-row:hover > td:first-child,
html .fi-ta-table:not(.jo-ta-cards *) > tbody > tr.fi-ta-row:has(> td > div > label > .fi-ta-record-checkbox:checked) > td:first-child {
    box-shadow: none;
    border-start-start-radius: 8px;
    border-end-start-radius: 8px;
}
html .fi-ta-table:not(.jo-ta-cards *) > tbody > tr.fi-ta-row:hover > td:last-child,
html .fi-ta-table:not(.jo-ta-cards *) > tbody > tr.fi-ta-row:has(> td > div > label > .fi-ta-record-checkbox:checked) > td:last-child {
    border-start-end-radius: 8px;
    border-end-end-radius: 8px;
}
html .fi-ta-table:not(.jo-ta-cards *) > tbody > tr.fi-ta-row:has(> td > div > label > .fi-ta-record-checkbox:checked) > td {
    background-color: color-mix(in srgb, var(--ds-accent) 16%, var(--ds-surface)) !important;
}

/* Vetro sulle barre ferme (owner 11-nov-2026, «come iPhone e Mac»): la barra
   in alto e il menu fermo quando la pagina scende lasciano intravedere,
   sfocato, il contenuto che ci scorre sotto, come le barre di iOS e macOS.
   La fascia viola ferma resta piena come la testata (owner 11-nov-2026:
   col vetro era «più chiara e slavata»). */
/* Il vetro della barra in alto sta su uno strato dietro (::before): un
   backdrop-filter sulla barra stessa diventa il riferimento dei suoi elementi
   fissi e il menu dell'utente si apriva fuori posto (11-nov-2026). */
@media (min-width: 1024px) {
    html:not(.dark) .fi-topbar > nav,
    html.dark .fi-topbar > nav {
        isolation: isolate;
        background-color: transparent !important;
    }
    html:not(.dark) .fi-topbar > nav::before,
    html.dark .fi-topbar > nav::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background-color: color-mix(in srgb, var(--ds-bg-app) 72%, transparent);
        -webkit-backdrop-filter: saturate(180%) blur(18px);
        backdrop-filter: saturate(180%) blur(18px);
        pointer-events: none;
    }
}

/* Il titolo della barra ferma in alto si vede solo col computer, a barra ferma:
   sul telefono compariva in nero davanti alle tab (owner 12-nov-2026, Traffico e Ads). */
html body .fi-page nav.fi-page-sub-navigation-tabs > .jo-stuck-title { display: none; }

/* Tendine e menu sulla scala unica (owner 11-nov-2026): 10px come i controlli. */
html body .fi-dropdown-panel {
    border-radius: var(--ds-radius-control) !important;
}

/* Fascia con le sue tab: periodo, Widget, Sposta e lo switch Lista ⇄ Analisi
   nell'angolo in basso a destra della fascia (owner 11-nov-2026, «a filo
   all'altezza delle tab»; owner 13-nov-2026, «deve stare sempre allo stesso
   posto», anche a 1440px e col solo switch: prima da 1600px in su e solo col
   periodo). La riga delle tab sale di 20px sotto la testata (margin-bottom:
   -20px qui sopra): gli strumenti scendono di 37px oltre il bordo della
   testata, a filo delle tab, e la riga delle tab tiene libero il loro posto
   (--jo-tools-w). Se le tab non lasciano posto (jo-tools-below) gli
   strumenti vanno su una riga sotto le tab, sempre a destra, e la fascia
   cresce di una riga. Le due classi e la larghezza le mette ui-standard.js
   su <html>, che Livewire non ridisegna. */
@media (min-width: 768px) {
    html.jo-tools-on-tabs body .fi-page .fi-header {
        position: relative;
    }
    html.jo-tools-on-tabs body .fi-page .fi-header > div:last-child {
        position: absolute;
        right: 24px;
        /* 6px sopra il filo delle linguette: a filo sembrava attaccato al basso (owner 13-nov-2026). */
        bottom: -31px;
        /* Sopra la riga delle tab, che è ferma in alto con z-index 15 (owner 12-nov-2026: prima tagliati). */
        z-index: 16;
        margin: 0;
    }
    html.jo-tools-on-tabs:not(.jo-tools-below) body .fi-page .fi-header + div > nav.fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs,
    html.jo-tools-on-tabs:not(.jo-tools-below) body .fi-page nav.jo-band-nav.fi-page-sub-navigation-tabs {
        padding-right: calc(var(--jo-tools-w, 0px) + 40px) !important;
    }
    /* A capo la riga cresce e tiene dentro gli strumenti, 15px sopra il fondo
       come sulla riga delle linguette (prima restava di 46px e gli strumenti
       ne uscivano sotto). */
    html.jo-tools-on-tabs.jo-tools-below body .fi-page .fi-header > div:last-child {
        bottom: -84px;
    }
    html.jo-tools-on-tabs.jo-tools-below body .fi-page .fi-header + div > nav.fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs:not(.is-stuck),
    html.jo-tools-on-tabs.jo-tools-below body .fi-page nav.jo-band-nav.fi-page-sub-navigation-tabs:not(.is-stuck) {
        height: 99px;
        padding-bottom: 61px !important;
    }

    /* Pagina scesa, barra ferma in alto: i pallini della fascia restano in
       vista a destra, a metà della barra (owner 17-nov-2026, «anche i
       cerchietti delle azioni veloci»), e titolo e voci si fermano prima.
       Posto e larghezza da ui-standard.js (jo-acts-stuck, --jo-acts-*).
       Con loro l'anello della configurazione (owner 17-nov-2026, «si deve
       vedere anche il 6/13»): toccato da qui, «Da completare» si apre sotto
       la barra (.is-floating, setup-strip.blade.php). */
    html.jo-acts-stuck.jo-acts-stuck body .fi-page .fi-header > div:last-child,
    html.jo-acts-stuck.jo-acts-stuck body .fi-page header.jo-gd > .jo-gd-head > div:last-child {
        position: fixed;
        top: var(--jo-acts-top, 92px);
        right: var(--jo-acts-right, 48px);
        bottom: auto;
        z-index: 16;
        margin: 0;
        animation: jo-motion-fade var(--ds-motion-fast) var(--ds-ease-out);
    }
    /* Sotto i pallini lo stesso viola della barra, che sfuma a sinistra: le
       voci che non ci stanno (la barra scorre di lato) ci passano sotto. */
    html.jo-acts-stuck.jo-acts-stuck body .fi-page .fi-header > div:last-child::before,
    html.jo-acts-stuck.jo-acts-stuck body .fi-page header.jo-gd > .jo-gd-head > div:last-child::before {
        content: "";
        position: absolute;
        z-index: -1;
        inset: calc(-1 * var(--jo-acts-pad, 0px)) -24px calc(-1 * var(--jo-acts-pad, 0px)) -40px;
        border-radius: 0 16px 16px 0;
        background: linear-gradient(90deg, var(--ds-side-bg-top), var(--ds-side-bg-bottom)) right center / var(--jo-acts-bar-w, 100%) 100% no-repeat;
        -webkit-mask-image: linear-gradient(to right, transparent, #000 32px);
        mask-image: linear-gradient(to right, transparent, #000 32px);
        pointer-events: none;
    }
    html.jo-acts-stuck body .fi-page .jo-setup-strip.is-floating {
        position: fixed;
        top: calc(var(--jo-bar-bottom, 160px) + 8px);
        left: var(--jo-bar-left, 282px);
        right: calc(var(--jo-acts-right, 48px) - 24px);
        z-index: 15;
        animation: jo-motion-pop var(--ds-motion-base) var(--ds-ease-out);
    }
    html.jo-acts-stuck body .fi-page .jo-setup-strip.is-floating .jo-strip.is-inline {
        box-shadow: var(--ds-shadow-raised);
    }
    html.jo-acts-stuck body .fi-page.jo-subnav-joined .fi-header + div > nav.fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs.is-stuck,
    html.jo-acts-stuck body .fi-page.jo-subnav-joined > section > header.jo-gd + div > nav.fi-page-sub-navigation-tabs.fi-page-sub-navigation-tabs.is-stuck,
    html.jo-acts-stuck body .fi-page.jo-band-joined nav.jo-band-nav.fi-page-sub-navigation-tabs.is-stuck,
    html.jo-acts-stuck body .fi-page.jo-sec-page > section > .fi-header + div > nav.jo-sec-tabs.jo-sec-tabs.is-stuck {
        padding-right: calc(var(--jo-acts-w, 0px) + 40px) !important;
    }
    html.jo-acts-stuck body .fi-page.jo-sec-page nav.jo-sec-tabs.is-stuck > .jo-sec-title,
    html.jo-acts-stuck body .fi-page nav.fi-page-sub-navigation-tabs.is-stuck > .jo-stuck-title {
        right: calc(var(--jo-acts-w, 0px) + 40px);
    }

    /* Pagine senza linguette (owner 17-nov-2026, «in tutte le aree della
       piattaforma»): scesa la fascia, la stessa barra ferma su una riga sola,
       col nome della pagina e i pallini (.jo-band-bar da ui-standard.js). */
    html body .jo-band-bar {
        position: fixed;
        top: calc(var(--jo-topbar-real, 64px) + 8px);
        z-index: 15;
        height: 56px;
        border-radius: 16px;
        background: linear-gradient(90deg, var(--ds-side-bg-top), var(--ds-side-bg-bottom));
        /* La cornice del colore della pagina, come la barra delle linguette ferma. */
        box-shadow: 0 0 0 8px var(--ds-bg-app), 0 -8px 0 8px var(--ds-bg-app);
        animation: jo-motion-fade var(--ds-motion-fast) var(--ds-ease-out);
    }
    html body .jo-band-bar > .jo-band-bar-title {
        position: absolute;
        top: 0;
        right: 24px;
        left: 24px;
        overflow: hidden;
        color: var(--ds-side-fg-strong);
        font-size: var(--ds-fs-h3);
        font-weight: 700;
        line-height: 56px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    html.jo-acts-stuck body .jo-band-bar > .jo-band-bar-title {
        right: calc(var(--jo-acts-w, 0px) + 40px);
    }
    /* Ciò che sta fermo sotto la topbar (titoli delle tabelle, anteprime,
       editor) scende sotto la barra: --jo-topbar-h conta anche lei e i suoi
       8px. --jo-topbar-real è la topbar sola (ui-standard.js). */
    html.jo-band-on {
        --jo-topbar-h: calc(var(--jo-topbar-real, 64px) + 64px) !important;
    }
}
