/* Stile Eidon — Sistema digitale Eidon
   Ricalca il Gestionale Eidon su Softr (eidomat.eidongroup.it):
   barra laterale rossa, contenuto bianco, titoli blu, schede con bordo, tabelle con intestazione rossa.
   Regole di Emanuele: font Calibri; navy #0A1E3E; rosso #C72A40; testi e dati centrati; mai giustificato. */
:root {
  --navy: #0A1E3E;
  --rosso: #C72A40;
  --rosso-chiaro: #D25466;      /* voce attiva della barra laterale (come Softr) */
  --rosso-scuro: #A51F33;
  --testo: #000000;
  --testo-2: #4A5568;
  --grigio-campo: rgba(0, 0, 0, 0.05);
  --grigio-campo-focus: rgba(0, 0, 0, 0.08);
  --scheda: #FBFBFB;
  --linea: #000000;
  --linea-leggera: #E2E5EA;
  --calcolato: #F1F3F6;
  --avviso: #FFF4E5;
  --ok: #1D7A46;
  --r-campo: 12px;
  --r-scheda: 12px;
  --r-tabella: 8px;
  --ombra: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px -1px rgba(0,0,0,.06);
  --font: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
  --barra: 280px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; color: var(--testo); background: #fff; text-align: center; }
a { color: var(--navy); }
p, li, td, th, label, input, select, textarea, button { text-align: center; }

/* ===================================================== impaginazione */
.app { display: grid; grid-template-columns: var(--barra) 1fr; min-height: 100vh; }
.barra { background: var(--rosso); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; text-align: left; }
.barra .logo { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; }
.barra .logo img { height: 30px; background: #fff; border-radius: 4px; padding: 2px 4px; }
.barra .logo small { font-size: 12px; opacity: .85; font-weight: 600; }
.barra nav { padding: 4px 12px; display: flex; flex-direction: column; gap: 2px; }
.barra .gruppo-titolo { font-size: 11.5px; font-weight: 700; opacity: .75; padding: 10px 6px 4px; text-transform: uppercase; letter-spacing: .3px; }
.barra .divisore { border-top: 1px solid rgba(255,255,255,.35); margin: 8px 6px; }
.barra a { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: 13.5px; font-weight: 600;
  text-transform: uppercase; padding: 5px 8px; border-radius: 6px; line-height: 1.25; text-align: left; }
.barra a svg { width: 17px; height: 17px; flex: 0 0 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.barra a:hover { background: rgba(255,255,255,.12); }
.barra a.attivo { background: var(--rosso-chiaro); }
.barra .piano-corrente { margin: 6px 6px 2px; padding: 8px 10px; border-radius: 8px; background: rgba(0,0,0,.12); font-size: 13px; }
.barra .piano-corrente b { display: block; font-size: 15px; }
.barra .utente { margin-top: auto; padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.25); font-size: 13px; }
.barra .utente .tondo { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); display: grid; place-items: center; font-weight: 700; }
.barra .utente a { padding: 2px 6px; font-size: 12px; text-transform: none; margin-left: auto; }

.contenuto { min-width: 0; padding: 22px 28px 60px; }
.contenuto > *:not(dialog) { max-width: 1600px; margin-left: auto !important; margin-right: auto !important; }  /* tutto al centro, su ogni schermo */
.btn.apri-menu { display: none; }

/* ===================================================== titoli */
h1 { font-size: 26px; margin: 4px 0 14px; color: var(--navy); font-weight: 700; text-transform: uppercase; }
h2 { font-size: 19px; margin: 26px 0 10px; color: var(--navy); font-weight: 700; text-transform: uppercase; }
.sottotitolo { margin: -8px 0 16px; color: var(--testo-2); }
.briciole { font-size: 13.5px; margin: 0 0 6px; color: var(--testo-2); }
.briciole a { text-decoration: none; font-weight: 700; }

/* ===================================================== banner (come "Dettaglio cliente") */
.banner { background: var(--navy); color: #fff; border-radius: var(--r-scheda); padding: 18px 22px; box-shadow: var(--ombra); margin: 0 auto 18px; }
.banner .nome { font-size: 20px; font-weight: 700; }
.banner .info { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 26px; margin-top: 8px; font-size: 14px; }
.banner .info span { opacity: .8; }
.banner .info b { opacity: 1; font-weight: 700; }
.banner a { color: #fff; }

/* ===================================================== bottoni (come Softr) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; font-family: var(--font); font-size: 14.5px;
  font-weight: 700; border: 0; cursor: pointer; background: var(--navy); color: #fff; padding: 0 16px; border-radius: var(--r-campo);
  text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.25); }
.btn.rosso { background: var(--rosso); }
.btn.rosso:hover { filter: none; background: var(--rosso-scuro); }
.btn.grigio { background: #EFEFEF; color: #000; }
.btn.grigio:hover { filter: none; background: #E2E2E2; }
.btn.piccolo { height: 34px; font-size: 13.5px; padding: 0 12px; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid #f2a7b2; outline-offset: 2px; }
.azioni { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }

/* barra sopra una tabella: ricerca + bottoni (come in "Erogazione corsi") */
.barra-tabella { display: flex; gap: 8px; align-items: center; margin: 8px 0 10px; flex-wrap: wrap; }
.cerca { flex: 1 1 320px; display: flex; align-items: center; gap: 8px; height: 40px; background: var(--grigio-campo); border-radius: var(--r-campo); padding: 0 12px; }
.cerca svg { width: 16px; height: 16px; stroke: #555; fill: none; stroke-width: 2; }
.cerca input { flex: 1; border: 0; background: transparent; font-family: var(--font); font-size: 14.5px; height: 38px; text-align: left; outline: none; }

/* ===================================================== schede di campi (come "Dettaglio cliente") */
.scheda-campi { background: var(--scheda); border: 1px solid var(--linea); border-radius: var(--r-scheda); padding: 18px 20px 20px;
  box-shadow: var(--ombra); margin: 0 auto 16px; }
.scheda-campi > .titolo-scheda { font-size: 15px; font-weight: 700; color: var(--navy); text-transform: uppercase; margin: 0 0 12px; }
.scheda-campi > .titolo-scheda button { all: unset; cursor: pointer; }
.modulo { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px 24px; align-items: end; }
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* l'etichetta occupa sempre lo spazio di due righe e si appoggia in basso:
   così tutti i campi di una riga stanno alla stessa altezza anche se un'etichetta va a capo */
.campo label { min-height: 2.5em; display: flex; align-items: flex-end; justify-content: center; font-size: 13px; font-weight: 700;
  color: var(--navy); text-transform: uppercase; line-height: 1.25; }
.campo input, .campo select, .campo textarea { font-family: var(--font); font-size: 15px; height: 40px; padding: 0 12px; border: 1px solid transparent;
  border-radius: var(--r-campo); background: var(--grigio-campo); color: var(--testo); text-align: center; width: 100%; }
.campo input:focus, .campo select:focus { background: var(--grigio-campo-focus); border-color: var(--navy); outline: none; }
.campo input.salvato { border-color: var(--ok); box-shadow: 0 0 0 2px #cfe9da; }
.campo input.errore, .campo select.errore { border-color: var(--rosso); box-shadow: 0 0 0 2px #fbe4e8; }
.campo.mancante input { background: var(--avviso); }
.trovato { color: var(--ok); font-weight: 700; margin-left: 4px; }
.nota { font-size: 13.5px; color: var(--testo-2); margin: 4px auto 8px; max-width: 900px; }
.chiudibile[data-chiuso] .modulo, .chiudibile[data-chiuso] > .nota { display: none; }

/* ===================================================== schede elenco (avvisi, piani) */
.elenco { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 340px)); justify-content: center; gap: 16px; margin: 16px 0; }
.scheda { background: #fff; border: 1px solid var(--linea); border-radius: var(--r-scheda); padding: 18px; text-decoration: none; color: var(--testo);
  display: block; box-shadow: var(--ombra); transition: border-color .15s; }
.scheda:hover { border-color: var(--rosso); }
.scheda .etichetta { font-size: 12.5px; font-weight: 700; color: var(--testo-2); text-transform: uppercase; }
.scheda .grande { font-size: 22px; font-weight: 700; color: var(--navy); margin: 2px 0; }
.scheda .meta { font-size: 14px; color: var(--testo-2); margin-top: 3px; }
.tag { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 12px; border: 1px solid var(--linea);
  background: #fff; color: var(--testo); margin: 8px 2px 0; }
.vuoto { background: var(--scheda); border: 1px dashed #999; border-radius: var(--r-scheda); padding: 30px; color: var(--testo-2); }

/* ===================================================== tabelle semplici (scadenze, totali per voce) */
.tabella-semplice { border: 2px solid var(--linea); border-radius: var(--r-tabella); overflow: hidden; margin: 8px auto; }
table.semplice { border-collapse: collapse; width: 100%; background: #fff; }
table.semplice th { background: var(--rosso); color: #fff; padding: 10px 12px; font-size: 13px; font-weight: 700; text-transform: uppercase; border-bottom: 1px solid var(--linea); }
table.semplice td { border-bottom: 1px solid var(--linea); border-right: 1px solid var(--linea); padding: 9px 12px; font-size: 14px; text-align: center; }
table.semplice th { border-right: 1px solid rgba(255,255,255,.3); }
table.semplice td:last-child, table.semplice th:last-child { border-right: 0; }
table.semplice tr:last-child td { border-bottom: 0; }
table.semplice tr.evidenza td { background: #fdf1f3; font-weight: 700; }
table.semplice td.num { font-variant-numeric: tabular-nums; }

/* ===================================================== griglie tipo Excel (Tabulator) con stile Softr */
.blocco-griglia { margin: 6px 0 28px; }
.legenda { font-size: 12.5px; color: var(--testo-2); display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 2px 0 10px; }
.legenda span::before { content: ""; display: inline-block; width: 12px; height: 12px; border: 1px solid #999; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.legenda .l-mod::before { background: #fff; }
.legenda .l-calc::before { background: var(--calcolato); }
.legenda .l-avv::before { background: var(--avviso); }

.tabulator { font-family: var(--font); font-size: 14px; border: 2px solid var(--linea); border-radius: var(--r-tabella); background: #fff; overflow: hidden; }
.tabulator .tabulator-header { background: var(--rosso); color: #fff; border-bottom: 1px solid var(--linea); font-weight: 700; }
.tabulator .tabulator-header .tabulator-col { background: var(--rosso); border-right: 1px solid rgba(255,255,255,.25); }
.tabulator .tabulator-header .tabulator-col .tabulator-col-content { padding: 9px 8px; }
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder { text-align: center; }
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder .tabulator-col-title {
  white-space: normal; overflow: visible; text-overflow: clip; word-break: break-word; text-align: center; font-weight: 700; font-size: 12.5px;
  line-height: 1.2; text-transform: uppercase; }
.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input { border: 0; border-radius: 8px; height: 28px; font-family: var(--font);
  font-size: 13px; text-align: center; background: rgba(255,255,255,.92); }
.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left { border-right: 2px solid rgba(255,255,255,.6); }
.tabulator-row { border-bottom: 1px solid var(--linea); min-height: 44px; }
.tabulator-row.tabulator-row-even { background: #fff; }
.tabulator-row .tabulator-cell { text-align: center; border-right: 1px solid var(--linea); padding: 8px 8px; white-space: normal; word-break: break-word;
  line-height: 1.3; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.tabulator-row .tabulator-cell.calc { background: var(--calcolato); color: #2A3445; }
.tabulator-row .tabulator-cell.tabulator-editing { border: 2px solid var(--navy); background: #fff; }
.tabulator-row .tabulator-cell input, .tabulator-row .tabulator-cell select { font-family: var(--font); font-size: 14px; text-align: center; }
.tabulator-row.tabulator-selectable:hover { background: #fafafa; }
.tabulator-row .tabulator-frozen.tabulator-frozen-left { border-right: 2px solid var(--linea); }
.tabulator-row.con-avvisi .tabulator-cell.avv { background: var(--avviso); }
.tabulator .tabulator-tableholder .tabulator-table { background: #fff; }
.tabulator .tabulator-calcs-holder { background: #F3F4F6 !important; border-top: 2px solid var(--linea); }
.tabulator .tabulator-calcs-holder .tabulator-row { background: #F3F4F6 !important; font-weight: 700; color: var(--navy); border-bottom: 0; }
.tabulator .tabulator-placeholder span { color: var(--testo-2) !important; font-size: 15px; font-weight: 400 !important; }
.tabulator .tabulator-placeholder { position: sticky; left: 0; width: 100% !important; }
.segno-avviso { color: var(--rosso); font-weight: 700; font-size: 14px; cursor: help; }
.segno-ok { color: #9ab2a3; }
.tasto-elimina { background: none; border: 0; color: #9aa6ba; font-size: 16px; cursor: pointer; }
.tasto-elimina:hover { color: var(--rosso); }
.tabulator-edit-list { font-family: var(--font); font-size: 14px; border-radius: 8px; }
.tabulator-edit-list .tabulator-edit-list-item { text-align: center; padding: 6px 8px; }
.tabulator-edit-list .tabulator-edit-list-item.active, .tabulator-edit-list .tabulator-edit-list-item:hover { background: var(--navy); color: #fff; }

/* filtri stile Excel */
.tabulator .tabulator-header .tabulator-col .tabulator-header-filter { margin-top: 6px; }
.filtro-btn { all: unset; cursor: pointer; display: inline-block; font-family: var(--font); font-size: 12px; font-weight: 700;
  color: var(--rosso); background: rgba(255,255,255,.92); border-radius: 8px; padding: 3px 8px; white-space: nowrap; }
.filtro-btn:hover { background: #fff; }
.filtro-btn.attivo { background: var(--navy); color: #fff; }
.filtro-popup { position: absolute; z-index: 10000; width: 280px; background: #fff; border: 1px solid rgba(0,0,0,.15); border-radius: var(--r-scheda);
  box-shadow: 0 10px 10px rgba(0,0,0,.04), 0 20px 25px rgba(0,0,0,.12); padding: 10px; font-family: var(--font); font-size: 14px; text-align: left; }
.filtro-popup .fp-ordina { display: flex; gap: 6px; margin-bottom: 8px; }
.filtro-popup .fp-ordina button { flex: 1; font-family: var(--font); font-size: 13px; font-weight: 700; border: 0; border-radius: 8px; padding: 6px; background: #EFEFEF; cursor: pointer; }
.filtro-popup .fp-ordina button:hover { background: #E2E2E2; }
.filtro-popup .fp-cerca { width: 100%; height: 34px; border: 0; border-radius: 8px; background: var(--grigio-campo); padding: 0 10px; font-family: var(--font); font-size: 14px; text-align: left; }
.filtro-popup label { display: flex; gap: 6px; align-items: center; padding: 3px 4px; cursor: pointer; text-align: left; }
.filtro-popup label small { margin-left: auto; color: var(--testo-2); }
.filtro-popup .fp-tutti { border-bottom: 1px solid var(--linea-leggera); margin-top: 6px; font-weight: 700; }
.filtro-popup .fp-lista { max-height: 240px; overflow-y: auto; margin: 4px 0 8px; }
.filtro-popup .fp-piede { display: flex; justify-content: flex-end; gap: 6px; }
ul.verbale { text-align: left; max-height: 280px; overflow-y: auto; font-size: 13.5px; padding-left: 20px; margin: 4px 0; }
ul.verbale li { margin: 3px 0; }
dialog.largo { max-width: 860px; }
.pwd { cursor: pointer; letter-spacing: 1px; }
.testo-lungo { display: block; font-size: 13px; line-height: 1.3; }

/* ===================================================== riquadri dei totali */
.totali { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 10px 0 16px; }
.totale { background: var(--scheda); border: 1px solid var(--linea); border-radius: var(--r-scheda); padding: 12px 14px; box-shadow: var(--ombra);
  display: flex; flex-direction: column; justify-content: space-between; min-height: 96px; }
.totale .etichetta { font-size: 12.5px; font-weight: 700; color: var(--navy); text-transform: uppercase; min-height: 2.5em; display: flex; align-items: center; justify-content: center; }
.totale .valore { font-size: 21px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.totale .limite { font-size: 12.5px; color: var(--testo-2); min-height: 1.3em; }
.totale.fuori { border-color: var(--rosso); background: #fdf1f3; }
.totale.fuori .valore { color: var(--rosso); }
.messaggi { list-style: none; padding: 0; margin: 8px auto; }
.messaggi li { background: #fdf1f3; border: 1px solid var(--rosso); color: var(--rosso-scuro); padding: 9px 14px; margin: 6px 0; border-radius: var(--r-campo); font-weight: 700; }
.messaggi li.ok { background: #eaf6ef; border-color: var(--ok); color: var(--ok); }

/* ===================================================== finestre (come i moduli Softr) */
dialog { border: 1px solid rgba(0,0,0,.1); border-radius: var(--r-scheda); padding: 0; max-width: 560px; width: 92vw; font-family: var(--font); color: var(--testo);
  box-shadow: 0 10px 10px rgba(0,0,0,.04), 0 20px 25px rgba(0,0,0,.06); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog form { padding: 0; }
dialog h3 { margin: 0; padding: 16px 20px; font-size: 19px; color: #000; border-bottom: 1px solid var(--linea-leggera); }
dialog .corpo { padding: 14px 20px; }
dialog .modulo { grid-template-columns: 1fr 1fr; }
dialog .piede { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--linea-leggera); }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 6px; align-items: center; }
#toast div { background: var(--navy); color: #fff; padding: 10px 18px; border-radius: var(--r-campo); font-weight: 700; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
#toast div.errore { background: var(--rosso); }

/* ===================================================== accesso (come la pagina di login di Softr) */
.pagina-login { min-height: 100vh; display: grid; place-items: start center; background: #fff; }
.login { width: min(560px, 92vw); margin-top: 6vh; background: #fff; border: 1px solid #ddd; border-radius: 28px; padding: 34px 30px 30px;
  box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.login img { height: 40px; }
.login h1 { text-transform: none; color: #000; font-size: 30px; margin: 22px 0 22px; }
.login .campo label { min-height: 0; justify-content: flex-start; text-transform: none; color: #000; font-size: 17px; }
.login .campo input { height: 48px; text-align: left; font-size: 16px; }
.login .btn { width: 100%; height: 48px; font-size: 17px; margin-top: 14px; }
.login .sotto { color: var(--testo-2); font-size: 13.5px; margin-top: 16px; }

/* ===================================================== caricamento lettera */
.caricamento { background: var(--scheda); border: 2px dashed var(--navy); border-radius: var(--r-scheda); padding: 24px; margin: 14px auto; max-width: 720px; }
.caricamento input[type=file] { margin: 12px auto; display: block; }

footer.piede-pagina { font-size: 12px; color: #8a94a6; padding: 22px 0 0; }

/* ===================================================== schermi piccoli */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .barra { position: fixed; left: 0; top: 0; width: var(--barra); z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .app.menu-aperto .barra { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .btn.apri-menu { display: inline-flex; position: sticky; top: 8px; z-index: 40; margin: 0 0 8px; }
  .contenuto { padding: 12px 16px 40px; }
  .modulo { grid-template-columns: 1fr 1fr; gap: 12px 14px; }
  dialog .modulo { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .modulo { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* celle unite come nel file Excel (progettazione: azienda e riferimento su più righe) */
.con-unione .tabulator-row { border-bottom: none; }
.con-unione .tabulator-row .tabulator-cell { border-bottom: 1px solid var(--linea); }
.con-unione .tabulator-row .tabulator-cell.u-continua { border-bottom-color: transparent; }
.con-unione .tabulator-cell.u-nascosta .u-testo { visibility: hidden; }
.con-unione .tabulator-cell.u-prima { overflow: visible; }
.con-unione .u-testo { display: inline-block; position: relative; z-index: 3; }
.con-unione .tabulator-row.tabulator-selectable:hover { background: #fff; }
.tabulator-row .tabulator-cell.apribile { cursor: pointer; }
.tabulator-row .tabulator-cell.apribile:hover { background: #FBEFF1; }
.apribile .da-inserire { color: var(--rosso); font-weight: 600; font-size: 13px; }
dialog.molto-largo { max-width: 1000px; }
.righe-apribili .tabulator-row { cursor: pointer; }
.righe-apribili .tabulator-row:hover .tabulator-cell { background: #FBEFF1; }
.vai { color: var(--rosso); font-weight: 700; }
#datiAvviso { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.campo input.calcolata { background: var(--calcolato); }
.dati-azione { grid-template-columns: repeat(6, 1fr); }
.dati-azione .campo.largo { grid-column: span 3; }
@media (max-width: 1100px) { .dati-azione { grid-template-columns: repeat(2, 1fr); } .dati-azione .campo.largo { grid-column: span 2; } }
dialog.editor-testo { max-width: 720px; }
dialog.editor-testo textarea { width: 100%; box-sizing: border-box; font-family: var(--font); font-size: 15px; padding: 10px; border: 1px solid rgba(0,0,0,.2); border-radius: var(--r-campo); text-align: left; resize: vertical; }
/* editor di scelta da elenco */
.scelta-input { width: 100%; height: 100%; box-sizing: border-box; border: 0; outline: none; font-family: var(--font); font-size: 14px; text-align: center; background: #fff; }
.scelta-lista { position: fixed; z-index: 10001; max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid rgba(0,0,0,.15); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); font-size: 14px; text-align: left; }
.scelta-voce { padding: 7px 12px; cursor: pointer; }
.scelta-voce:hover { background: #F3F4F6; }
.scelta-voce.attiva { background: var(--navy); color: #fff; }
.scelta-vuota { padding: 8px 12px; color: var(--testo-2); font-style: italic; }
h2.titolo-budget { margin-top: 36px; padding-top: 18px; border-top: 2px solid var(--navy); font-size: 22px; }
table.semplice tr.forte td { font-weight: 700; }
/* BUDGET: tabella unica a sezioni (piano finanziario) */
table.budget { width: 100%; max-width: 1100px; margin: 0 auto; border-collapse: separate; border-spacing: 0; border: 2px solid #000; border-radius: 8px; overflow: hidden; font-size: 14px; }
table.budget td { padding: 6px 10px; border-bottom: 1px solid var(--linea); text-align: center; vertical-align: middle; }
table.budget td:first-child { width: 28px; padding: 0 4px; }
table.budget tr.bpiano td { background: var(--navy); color: #fff; font-weight: 700; font-size: 15px; border-bottom: 0; }
table.budget tr.bpiano td:last-child { font-weight: 400; font-size: 12px; opacity: .85; }
table.budget tr.bsez td { background: var(--rosso); color: #fff; font-weight: 700; letter-spacing: .3px; padding: 7px 10px; }
table.budget tr.bint td { background: #FBEFF1; color: var(--rosso-scuro); font-weight: 700; font-size: 12.5px; text-transform: uppercase; }
table.budget tr.btot td { background: #F1F3F6; font-weight: 700; }
table.budget tr.btot.leggera td { font-weight: 500; }
table.budget tr.bfinale td { background: var(--navy); color: #fff; font-size: 15px; }
table.budget tr.bfinale.fuori td { background: var(--rosso); }
table.budget td.calc { background: var(--calcolato); color: #2A3445; }
table.budget tr.bagg td { background: #fff; padding: 2px 10px; text-align: left; }
.badd { all: unset; cursor: pointer; color: var(--rosso); font-weight: 700; font-size: 13px; padding: 4px 6px; }
.badd:hover { text-decoration: underline; }
.bcella { width: 100%; box-sizing: border-box; border: 1px solid transparent; border-radius: 6px; padding: 5px 6px; font-family: var(--font); font-size: 14px; text-align: center; background: #fff; }
.bcella:hover { border-color: rgba(0,0,0,.2); }
.bcella:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 2px rgba(10,30,62,.15); }
.bcella.maiuscolo { text-transform: uppercase; }
.bdel { all: unset; cursor: pointer; color: #999; margin-left: 8px; font-size: 13px; }
.bdel:hover { color: var(--rosso); }
.bavv { color: var(--rosso); font-weight: 700; cursor: help; }
.btag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--navy); background: #e3e8f0; border-radius: 4px; padding: 1px 5px; cursor: help; }
tr.bauto td { background: #f7f9fc; }
.bcella:disabled { background: transparent; color: var(--navy); opacity: 1; cursor: not-allowed; }
table.budget.voci { max-width: 860px; }
table.budget.voci td:first-child { width: auto; padding: 6px 12px; text-align: left; font-weight: 600; }
table.budget.voci td.num { text-align: center; }
table.budget.voci td.vnota { font-size: 12.5px; color: var(--testo-2); }
table.budget.voci tr.btot.fuori td { background: #FBEFF1; }
table.budget.voci tr.bfinale td:first-child { font-weight: 700; }
table.budget.voci tr.bfinale.leggera td { background: #2A3F66; }
table.budget.voci tr.bfinale td.vnota { color: #fff; opacity: .85; }
.testo-rosso { color: var(--rosso); font-weight: 700; }
table.budget.pf { max-width: none; }
table.budget.pf td { padding: 4px 6px; }
table.budget.pf td.calc.forte { font-weight: 700; }
table.budget.pf td.piccolo { font-size: 12px; color: var(--testo-2); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcella.bsel { appearance: auto; background: #fff; cursor: pointer; }
.bcella.sin { text-align: left; }
.bcella.bsel.sin { min-width: 230px; }
/* tabelle a sezioni: scorrimento orizzontale e colonne allargabili */
.scorri { overflow-x: auto; max-width: 100%; padding-bottom: 6px; }
.scorri table.budget { table-layout: fixed; max-width: none; margin: 0; }
.scorri table.budget td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scorri table.budget tr.bsez td, .scorri table.budget tr.bagg td { white-space: normal; }
.scorri table.budget td.piccolo { max-width: none; }
.ridim { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; z-index: 2; }
.ridim:hover { background: rgba(10,30,62,.25); }
.bcella.bsel { max-width: 100%; }
.scorri table.budget tr.bint td { overflow: visible; user-select: none; }
.ridim { right: 0; width: 7px; user-select: none; }

/* righe verticali anche nelle tabelle a sezioni (budget, piano finanziario, voci di spesa) */
table.budget td { border-right: 1px solid var(--linea); }
table.budget td:last-child { border-right: 0; }
table.budget tr.bpiano td, table.budget tr.bsez td, table.budget tr.bfinale td { border-right: 1px solid rgba(255,255,255,.25); }

.tag.avviso { background: var(--avviso); border-color: var(--rosso); color: var(--rosso-scuro); }
.barra-tabella:not(:has(.cerca)) { justify-content: center; }
.tabulator-row .tabulator-cell.collegamento { cursor: pointer; color: var(--navy); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(10,30,62,.35); }
.tabulator-row .tabulator-cell.collegamento:hover { background: #EEF1F6; }
.azioni-form { width: 100%; border-collapse: collapse; margin-top: 10px; }
.azioni-form th { background: #FBEFF1; color: var(--rosso-scuro); font-size: 12px; text-transform: uppercase; padding: 6px 4px; }
.azioni-form td { padding: 3px 4px; }
.azioni-form input, .azioni-form select { width: 100%; box-sizing: border-box; height: 34px; font-size: 13.5px; }
.azioni-form .num { width: 70px; }
dialog.molto-largo form { max-width: 1000px; }
