:root {
    --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

    --brand: #0d1d5a;

    --bg: #eef0f5;
    --surface: #ffffff;
    --surface-2: #f3f4f8;
    --surface-hover: #e9ecf3;
    --border: #e6e8f0;
    --border-strong: #d5d9e4;

    --text: #172038;
    --text-muted: #5f6b85;
    --text-faint: #94a0b8;

    --accent: #0e9488;
    --accent-hover: color-mix(in srgb, var(--accent) 82%, #000);
    --accent-soft: color-mix(in srgb, var(--accent) 12%, #fff);
    --accent-softer: color-mix(in srgb, var(--accent) 6%, #fff);
    --accent-soft-text: color-mix(in srgb, var(--accent) 72%, #000);
    --accent-contrast: #ffffff;
    --ring: color-mix(in srgb, var(--accent) 26%, transparent);

    --ok-bg: #e7f6ee; --ok-text: #0f7a48; --ok-border: #c1e6d0;
    --warn-bg: #fdf3da; --warn-text: #8a5a06; --warn-border: #f0dca0;
    --danger-bg: #fdeceb; --danger-text: #c0362c; --danger-border: #f4c6c1;
    --neutral-bg: var(--surface-2); --neutral-text: var(--text-muted);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --shadow-sm: 0px 1px 2px rgba(23, 32, 56, .05), 0px 2px 6px rgba(23, 32, 56, .04);
    --shadow-md: 0px 10px 30px rgba(23, 32, 56, .10);
    --shadow-lg: 0px 20px 60px rgba(23, 32, 56, .16);

    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
}


.anno-mese { display: flex; flex-direction: column; gap: 8px; }
.am-riga { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.am-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); width: 44px; flex: 0 0 auto; }
.am-chip {
    font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
    text-decoration: none; transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .08s ease;
}
.am-chip:hover { background: var(--surface-2); color: var(--text); }
.am-chip:active { transform: scale(.96); }
.am-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

@keyframes reprint-rivela { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.content-inner > h1 { animation: reprint-rivela .38s cubic-bezier(.16, 1, .3, 1) both; }
.content-inner .card,
.content-inner > table,
.content-inner .mag-conteggio,
.content-inner .empty-state,
.content-inner .et {
    animation: reprint-rivela .42s cubic-bezier(.16, 1, .3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
    .content-inner > h1, .content-inner .card, .content-inner > table,
    .content-inner .mag-conteggio, .content-inner .empty-state, .content-inner .et {
        animation: none;
    }
}

.pagina-testa { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.pagina-testa h3 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.025em; color: var(--text); }
.pagina-sotto { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }
.pagina-azioni { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }

.pagina-testa-divisa { display: grid; grid-template-columns: minmax(340px, 420px) 1fr; gap: var(--sp-3) var(--sp-4); align-items: end; }
.pagina-testa-divisa .pagina-azioni { flex-wrap: wrap; justify-content: flex-start; min-width: 0; }
.pagina-testa-divisa .ca-cerca { flex: 1 1 200px; width: auto; }
@media (max-width: 900px) {
    .pagina-testa-divisa { grid-template-columns: 1fr; }
}

.chat { display: flex; flex-direction: column; gap: var(--sp-3); }
.msg { max-width: 78%; padding: 10px 14px; border-radius: var(--radius-md); font-size: 14px; line-height: 1.5; }
.msg .chi { display: block; font-size: 11px; font-weight: 700; opacity: .65; margin-bottom: 3px; }
.msg .testo { white-space: pre-wrap; word-break: break-word; }
.conv-barra { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.conv-barra h1 { margin: 0; font-size: 21px; }
.et-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.et-chip form { display: inline; margin: 0; }
.et-x { background: none; border: none; padding: 0 0 0 2px; margin: 0; color: inherit; font-weight: 700; cursor: pointer; opacity: .6; font-size: 14px; line-height: 1; box-shadow: none; min-height: auto; }
.et-x:hover { opacity: 1; background: none; }

.chat-app { display: grid; grid-template-columns: minmax(340px, 420px) 1fr; gap: var(--sp-4); height: calc(100dvh - 165px); min-height: 480px; }
.ca-lato { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.ca-viste { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 3px; }
.ca-vista { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; padding: 6px 14px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 700; color: var(--text-muted); text-decoration: none; transition: background-color .15s ease, color .15s ease; }
.ca-vista:hover { color: var(--text); }
.ca-vista.on { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.ca-cerca { display: flex; align-items: center; gap: 9px; margin: 0; padding: 0 14px; width: min(270px, 100%); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-pill); color: var(--text-muted); transition: border-color .15s ease, box-shadow .15s ease; }
.ca-cerca:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.ca-cerca input { flex: 1; min-width: 0; border: none; background: none; padding: 8px 0; font-size: 13px; min-height: auto; outline: none; color: var(--text); }
.ca-cerca input::placeholder { color: var(--text-faint); }
.ca-cerca-x { color: var(--text-muted); text-decoration: none; font-size: 16px; font-weight: 700; line-height: 1; }
.ca-filtri { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.ca-filtro-icona { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 15px; line-height: 1; text-decoration: none; background: var(--surface-2); border: 1px solid transparent; transition: border-color .15s ease, background-color .15s ease, transform .08s ease; }
.ca-filtro-icona:hover { background: var(--surface-hover); }
.ca-filtro-icona:active { transform: scale(.94); }
.ca-filtro-icona.on { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.ca-filtro-icona .ca-dot { width: 11px; height: 11px; }
.ca-filtro-nome { font-size: 12px; font-weight: 700; color: var(--text); padding-left: 2px; }
.ca-filtro { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border: 1px solid transparent; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; flex: 0 0 auto; background: var(--surface-2); color: var(--text-muted); }
.ca-filtro:hover { color: var(--text); }
.ca-filtro.on { background: var(--surface); border-color: var(--accent); color: var(--text); }
.ca-filtro.tutte.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ca-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.ca-scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.ca-nessuna { padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--text-muted); font-size: 13.5px; }
.ca-item { display: flex; align-items: center; gap: 13px; padding: 15px 18px; cursor: pointer; border-bottom: 1px solid var(--border); position: relative; transition: background-color .12s ease; }
.ca-item:last-child { border-bottom: none; }
.ca-item:hover { background: var(--surface-2); }
.ca-item.selezionata { background: var(--accent-softer); box-shadow: inset 3px 0 0 var(--accent); }
.ca-avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13.5px; flex: 0 0 auto; user-select: none; background: var(--accent-softer); color: var(--accent-soft-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent); }
.ca-corpo { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ca-riga1 { display: flex; align-items: center; gap: 6px; }
.ca-pin { color: var(--accent); flex: 0 0 auto; }
.ca-nome { flex: 1; font-weight: 700; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-ora { flex: 0 0 auto; font-size: 11px; color: var(--text-muted); }
.ca-item.non-letti .ca-ora { color: var(--accent); font-weight: 700; }
.ca-riga2 { display: flex; align-items: center; gap: 6px; }
.ca-anteprima { flex: 1; font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-item.non-letti .ca-anteprima { color: var(--text); font-weight: 600; }
.ca-badge { flex: 0 0 auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; border-radius: var(--radius-pill); min-width: 19px; height: 19px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.ca-punto { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.ca-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 1px; }
.ca-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 10.5px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--text-muted); }
.ca-tag .ca-dot { width: 6px; height: 6px; }
.ca-tag form { display: inline; margin: 0; line-height: 1; }
.ca-tag-operatore { background: var(--warn-bg); color: var(--warn-text); }
.ca-tag .et-x { font-size: 12px; padding-left: 1px; }
.ca-azioni { position: absolute; right: 8px; bottom: 7px; display: none; gap: 3px; padding-left: 14px; background: linear-gradient(90deg, transparent, var(--surface-2) 14px); }
.ca-item:hover .ca-azioni { display: flex; }
.ca-azioni form { display: inline; margin: 0; }
.ca-pane { position: relative; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.ca-pane iframe { width: 100%; height: 100%; border: 0; display: block; }
.ca-vuoto { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2); height: 100%; color: var(--text-muted); font-size: 13.5px; line-height: 1.6; text-align: center; padding: var(--sp-5); }
.ca-vuoto-icona { width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent-softer); color: var(--accent-soft-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent); margin-bottom: var(--sp-3); }
.ca-vuoto-titolo { font-size: 15px; font-weight: 700; color: var(--text); }
.ca-conta { flex: 0 0 auto; font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: var(--radius-pill); background: color-mix(in srgb, currentColor 12%, transparent); }
@media (max-width: 900px) {
    .chat-app { grid-template-columns: 1fr; }
    .ca-pane { display: none; }
    .ca-azioni { display: flex; position: static; background: none; padding-left: 0; }
    .ca-item { flex-wrap: wrap; }
}

.chat-shell { display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.chat-testa { display: flex; align-items: center; gap: 12px; padding: 12px 16px 8px; background: var(--surface); flex: 0 0 auto; }
.chat-testa .ca-avatar { width: 38px; height: 38px; }
.chat-testa-info { flex: 1 1 auto; min-width: 0; }
.chat-testa-nome { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; color: var(--text); white-space: nowrap; overflow: hidden; }
.chat-testa-sotto { font-size: 11.5px; color: var(--text-muted); }
.chat-testa-azioni { margin: 0; flex: 0 0 auto; }
.chat-etichette { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 4px 16px 10px; background: var(--surface); border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.et-aggiungi { position: relative; }
.et-piu { width: 22px; height: 22px; border-radius: 50%; border: 1px dashed var(--border-strong); background: var(--surface); color: var(--text-muted); font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; min-height: auto; box-shadow: none; }
.et-piu:hover { color: var(--accent); border-color: var(--accent); }
.et-pop { position: absolute; top: 26px; left: 0; z-index: 40; display: none; flex-direction: column; min-width: 190px; max-height: 240px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 4px; }
.et-pop.aperto { display: flex; }
.et-pop form { margin: 0; }
.et-pop-voce { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 10px; border: none; background: none; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer; min-height: auto; box-shadow: none; }
.et-pop-voce:hover { background: var(--surface-2); }
.et-pallino { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.chat-corpo { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding: var(--sp-5) var(--sp-6); display: flex; flex-direction: column; background-image: radial-gradient(color-mix(in srgb, var(--border-strong) 40%, transparent) 1px, transparent 1px); background-size: 22px 22px; }
.chat-vuoto-msg { margin: auto; color: var(--text-muted); font-size: 13.5px; }
.chat-giorno { align-self: center; margin: 16px 0 10px; }
.chat-giorno:first-child { margin-top: 0; }
.chat-giorno span { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 3px 12px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; color: var(--text-muted); box-shadow: var(--shadow-sm); }
.bolla { position: relative; max-width: min(68%, 62ch); padding: 8px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; margin-top: 3px; box-shadow: 0 1px 1px rgba(35, 45, 66, .06); }
.bolla-inizio { margin-top: 14px; }
.chat-giorno + .bolla { margin-top: 0; }
.bolla-user { align-self: flex-start; background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.bolla-user.bolla-inizio { border-top-left-radius: 2px; }
.bolla-user.bolla-inizio::before { content: ""; position: absolute; top: -1px; left: -7px; border-top: 9px solid var(--surface); border-left: 8px solid transparent; }
.bolla-assistant { align-self: flex-end; background: var(--accent-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent); }
.bolla-assistant.bolla-inizio { border-top-right-radius: 2px; }
.bolla-assistant.bolla-inizio::after { content: ""; position: absolute; top: 0; right: -7px; border-top: 9px solid var(--accent-soft); border-right: 8px solid transparent; }
.bolla-operatore { align-self: flex-end; background: var(--accent); color: #fff; }
.bolla-operatore.bolla-inizio { border-top-right-radius: 2px; }
.bolla-operatore.bolla-inizio::after { content: ""; position: absolute; top: 0; right: -7px; border-top: 9px solid var(--accent); border-right: 8px solid transparent; }
.bolla-chi { display: block; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; opacity: .55; margin: 1px 0 3px; }
.bolla-operatore .bolla-chi { opacity: .75; }
.bolla-testo { white-space: pre-wrap; word-break: break-word; }
.bolla-media { display: block; max-width: min(280px, 100%); max-height: 320px; border-radius: 8px; margin: 2px 0 3px; }
.bolla-audio { display: block; max-width: 250px; margin: 2px 0 3px; }
.bolla-file { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; margin: 2px 0 3px; border-radius: 8px; background: rgba(35, 45, 66, .06); color: inherit; font-weight: 700; font-size: 12.5px; text-decoration: none; }
.bolla-operatore .bolla-file { background: rgba(255, 255, 255, .18); color: #fff; }
.bolla-ora { float: right; font-size: 10px; font-variant-numeric: tabular-nums; opacity: .5; margin: 10px -2px 0 12px; }
.chat-errore { flex: 0 0 auto; padding: 7px 14px; background: var(--danger-bg); color: var(--danger-text); font-size: 12.5px; font-weight: 600; border-top: 1px solid var(--danger-border); }
.chat-composer { flex: 0 0 auto; display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--border); position: relative; }
.chat-riga-invio { flex: 1 1 auto; min-width: 0; display: flex; align-items: flex-end; gap: 8px; margin: 0; }
.chat-riga-invio textarea { flex: 1 1 auto; resize: none; border: 1px solid var(--border-strong); border-radius: 19px; padding: 8px 15px; font-size: 13.5px; line-height: 1.5; max-height: 120px; min-height: 38px; background: var(--surface); color: var(--text); }
.chat-riga-invio textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.btn-tondo { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border: none; cursor: pointer; padding: 0; min-height: auto; box-shadow: none; }
.btn-invia { background: var(--accent); color: #fff; }
.btn-invia:hover { background: var(--accent-hover); color: #fff; }
.btn-invia:disabled { opacity: .55; cursor: default; }
.btn-rr { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border-strong); }
.btn-rr:hover { color: var(--accent); border-color: var(--accent); background: var(--surface-2); }
.rr-box { position: static; }
.rr-pop { position: absolute; bottom: 62px; left: 10px; z-index: 40; width: min(360px, calc(100% - 20px)); max-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); display: none; }
.rr-pop.aperto { display: block; }
.rr-titolo { padding: 10px 13px 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.rr-voce { display: flex; align-items: center; gap: 4px; padding: 0 8px; }
.rr-voce form { margin: 0; }
.rr-usa { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; text-align: left; border: none; background: none; padding: 7px 6px; border-radius: var(--radius-sm); cursor: pointer; min-height: auto; box-shadow: none; }
.rr-usa:hover { background: var(--surface-2); }
.rr-nome { font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-anteprima { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rr-x { flex: 0 0 auto; border: none; background: none; color: var(--text-muted); font-size: 15px; font-weight: 700; cursor: pointer; padding: 4px 6px; min-height: auto; box-shadow: none; }
.rr-x:hover { color: var(--danger-text); background: none; }
.rr-vuoto { padding: 10px 13px; font-size: 12.5px; color: var(--text-muted); }
.rr-nuova { display: flex; flex-direction: column; gap: 6px; padding: 10px 13px 12px; border-top: 1px solid var(--border); margin: 6px 0 0; }
.rr-nuova input, .rr-nuova textarea { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 6px 9px; font-size: 12.5px; min-height: auto; resize: vertical; background: var(--surface); color: var(--text); }
.chat-toast { position: absolute; bottom: 64px; right: 12px; z-index: 50; background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-border); border-radius: var(--radius-md); padding: 8px 13px; font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: opacity .2s ease; max-width: min(420px, calc(100% - 24px)); }
.chat-toast.aperto { opacity: 1; }

.cor-tabella { display: flex; flex-direction: column; }
.cor-intestazioni { display: grid; grid-template-columns: 150px 110px 1fr 76px; gap: var(--sp-2); padding: 0 var(--sp-2) var(--sp-2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }
.cor-riga { display: grid; grid-template-columns: 150px 110px 1fr 76px; gap: var(--sp-2); align-items: center; padding: var(--sp-2); border-top: 1px solid var(--border); }
.cor-riga input { min-height: auto; padding: 7px 10px; font-size: 13px; }
.cor-riga .mono, .cor-aiuto code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.cor-aiuto { font-size: 12.5px; color: var(--text-muted); margin: var(--sp-2) 0 var(--sp-3); }
.cor-aiuto code { background: var(--surface-2); color: var(--text); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.cor-azioni { display: flex; gap: 4px; justify-content: flex-end; }
.cor-riga .btn-az { width: 31px; height: 31px; }
@media (max-width: 767px) {
    .cor-intestazioni { display: none; }
    .cor-riga { grid-template-columns: 1fr 1fr; }
    .cor-riga input[name="cor_url"] { grid-column: 1 / -1; }
    .cor-azioni { grid-column: 1 / -1; }
}

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3) var(--sp-4); }
.info-grid dt { font-size: 11px; font-weight: 700; color: var(--text-faint); margin-bottom: 2px; }
.info-grid dd { margin: 0; font-size: 14px; color: var(--text); }
.canali { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.canali label { display: flex; align-items: center; gap: 7px; font-weight: 500; color: var(--text); cursor: pointer; font-size: 14px; }
.canali input { width: 17px; height: 17px; min-height: auto; accent-color: var(--accent); }
.tk-detail-azioni { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.tk-detail-azioni form { margin: 0; }

.griglia-strumenti { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.griglia-strumenti .grid-tools { margin-top: 0; }
.griglia-cerca { margin-left: auto; width: min(340px, 100%); }
.grid-tools { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; margin-top: var(--sp-3); }
.col-chooser { position: relative; }
.grid-btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font-size: 13px; font-weight: 700; cursor: pointer;
}
.grid-btn:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); }
.grid-btn i { color: var(--text-faint); }
.col-chooser-menu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 230px; max-height: 320px; overflow: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: 0 10px 28px rgba(20,20,25,.12); padding: 8px;
}
.col-chooser-menu[hidden] { display: none; }
.cc-titolo { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); padding: 4px 8px 6px; }
.cc-voce { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 13.5px; color: var(--text); cursor: pointer; }
.cc-voce:hover { background: var(--surface-2); }
.cc-voce input { width: 16px; height: 16px; min-height: auto; accent-color: var(--accent); flex: 0 0 auto; }
.cc-azioni { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; text-align: right; }
.cc-link { background: none; border: none; color: var(--accent-hover); font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 4px 8px; box-shadow: none; min-height: auto; }
.cc-link:hover { background: var(--accent-soft); border-radius: var(--radius-sm); }

.grid-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.grid-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.grid-switch-track { position: relative; width: 38px; height: 22px; border-radius: var(--radius-pill); background: var(--border-strong); transition: background-color .15s ease; flex: 0 0 auto; }
.grid-switch-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s ease; }
.grid-switch input:checked + .grid-switch-track { background: var(--accent); }
.grid-switch input:checked + .grid-switch-track .grid-switch-knob { transform: translateX(16px); }
.grid-switch input:focus-visible + .grid-switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.grid-switch-lbl { font-size: 13px; font-weight: 600; color: var(--text-muted); }

tr.riga-attiva > td { background: var(--accent-soft) !important; }

.slideover-backdrop { position: fixed; inset: 0; background: rgba(20,20,25,.28); z-index: 1040; opacity: 0; transition: opacity .2s ease; }
.slideover-backdrop.aperto { opacity: 1; }
.slideover-backdrop[hidden] { display: none; }
.slideover {
    position: fixed; top: 0; right: 0; height: 100vh; width: min(560px, 94vw); z-index: 1041;
    background: var(--surface); border-left: 1px solid var(--border); box-shadow: -12px 0 32px rgba(20,20,25,.14);
    display: flex; flex-direction: column; transform: translateX(100%); transition: transform .2s ease;
}
.slideover.aperto { transform: translateX(0); }
.slideover[hidden] { display: none; }
.slideover-testa { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.slideover-testa strong { font-size: 15px; }
.slideover-azioni { display: flex; align-items: center; gap: 4px; }
.slideover-azioni a, .slideover-azioni button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: none; background: none; color: var(--text-muted); border-radius: var(--radius-sm); cursor: pointer; font-size: 15px; box-shadow: none; min-height: auto; }
.slideover-azioni a:hover, .slideover-azioni button:hover { background: var(--surface); color: var(--accent-hover); }
.slideover iframe { flex: 1 1 auto; width: 100%; border: none; background: var(--bg); }

.embed-wrap { padding: var(--sp-4); }
.embed-wrap .card { border: none; box-shadow: none; }
.embed-wrap .card-header { padding-top: 0; }

.iq-banner:not(.hide) + .content-inner { margin-top: 1.5rem !important; }
.sidebar-base .nav-item .nav-link { text-transform: none; }
.sidebar-base .nav-item.static-item .default-icon { text-transform: none; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: var(--sp-2) var(--sp-3); z-index: 1000; }
.skip-link:focus { left: var(--sp-3); top: var(--sp-3); }

.sidebar { display: flex; flex-direction: column; }
.sidebar .sidebar-header,
.sidebar .sidebar-footer { flex: 0 0 auto; }
.sidebar .sidebar-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
.sidebar .sidebar-body::-webkit-scrollbar { width: 8px; }
.sidebar .sidebar-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.sidebar .sidebar-body::-webkit-scrollbar-track { background: transparent; }

.sidebar { transition: transform .2s ease; }
.sidebar-nascosta .sidebar { transform: translateX(-100%); }
@media (min-width: 1200px) {
    .sidebar-nascosta .sidebar + .main-content { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar { transition: none; }
}

#toggle-sidebar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: static;
    height: 34px;
    width: 34px;
    margin-right: var(--sp-2);
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
}
#toggle-sidebar:hover,
#toggle-sidebar:focus-visible {
    background: var(--surface-hover);
    color: var(--accent);
}

.sidebar .sidebar-header { padding-top: var(--sp-3); padding-bottom: var(--sp-2); }
.sidebar-base .nav-item .nav-link {
    padding: .3rem .8rem;
    font-size: .82rem;
    line-height: 1.3;
}
.sidebar-base .nav-item .nav-link .icon svg,
.sidebar-base .nav-item .nav-link .icon img { width: 18px; height: 18px; }
.sidebar-base .nav-item.static-item .nav-link {
    padding: .5rem .8rem .1rem;
    font-size: .68rem;
    letter-spacing: .03em;
    color: var(--text-faint);
}
.sidebar-base .iq-main-menu > .nav-item { margin-bottom: 0; }
.sidebar-base .nav-item .nav-link .badge { font-size: .62rem; padding: .2em .45em; }

.content-inner table,
.content-inner .table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: transparent;
    --bs-table-accent-bg: transparent;
    width: 100%;
    border-collapse: collapse;
    color: var(--text);
    margin-bottom: 0;
}
.content-inner table > :not(caption) > * > *,
.content-inner .table > :not(caption) > * > * { background-color: transparent; box-shadow: none; }
.content-inner th,
.content-inner td {
    padding: 12px 14px;
    text-align: left;
    font-size: 13.5px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    border-top: 0;
}
.content-inner table thead tr th,
.content-inner .table thead tr th {
    background: var(--surface-2);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}
.content-inner .table thead tr { background-color: var(--surface-2); }
.content-inner tbody tr { transition: background-color .12s ease; }
.content-inner tbody tr:hover { background: var(--surface-2); }
.content-inner tbody tr:last-child td { border-bottom: 0; }
.content-inner .card > .table-responsive > table,
.content-inner .card > .table-responsive > .table { border-radius: 0; }
.content-inner .table-responsive { border-radius: var(--radius-md); }

.content-inner .nav-pills { display: inline-flex; width: auto; max-width: 100%; }

.content-inner table thead tr th a,
.content-inner .table thead tr th a { color: var(--text-muted); text-decoration: none; }
.content-inner table thead tr th a:hover,
.content-inner .table thead tr th a:hover { color: var(--accent-hover); }

.navbar-brand .logo-mark { height: 34px; width: auto; display: block; }
.pallino-stato { display: inline-block; width: 9px; height: 9px; min-width: 9px; flex: 0 0 9px; border-radius: 50%; vertical-align: middle; }

.footer-ia {
    padding: var(--sp-5) var(--sp-4) var(--sp-6);
    text-align: center;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-faint);
}
