/* soniafattura.it — vista DENSA e TABELLARE (fondatore, 19/09/2026: «serve una UI densa per contabilità,
   non da CFO come la nostra nativa, ma densa e tabellare»). Si applica solo con body.sf: stesso prodotto,
   stesse pagine, meno aria. Tema sempre chiaro. Nessun colore letterale fuori dai token qui sotto. */
:root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
  --bg:#ffffff; --surface:#ffffff; --card:#ffffff; --line:#d6d0cc; --ink:#1e1e22; --smoke:#5a5660;
  --cipria-soft:#f4efec; --accent:#C2867F; --accent-deep:#A85E56; --srv-primaria:#A85E56;
  --ent-shadow:none; --serif:Inter,system-ui,sans-serif; --sf-zebra:#faf8f6; --sf-head:#f1ecea; --sf-sel:#fbeeea;
  color-scheme:light;
}
body.sf{background:var(--bg);color:var(--ink);font-family:Inter,system-ui,sans-serif;font-size:13px;line-height:1.35}
body.sf h1,body.sf h2,body.sf h3,body.sf h4{font-family:Inter,system-ui,sans-serif;letter-spacing:0}
body.sf h1{font-size:18px;margin:6px 0 8px}body.sf h2{font-size:15px;margin:6px 0 6px}body.sf h3{font-size:13.5px;margin:4px 0}
body.sf p{margin:4px 0}
body.sf small,body.sf .muted,body.sf .smoke{font-size:12px}

/* schede: contenitori piatti, bordo 1px, nessun raggio, nessuna ombra */
body.sf .card,body.sf .ent-card,body.sf .sa-card,body.sf .stz-card,body.sf .lnd-card,body.sf .asd-card,body.sf .bk-card,body.sf .kb-col,body.sf .pipe-col{
  border-radius:0!important;box-shadow:none!important;padding:8px 10px!important;border:1px solid var(--line)!important;border-top:2px solid var(--accent-deep)!important;margin-bottom:8px}
body.sf .ha{border-radius:0;box-shadow:none;padding:6px 9px;gap:1px}
body.sf .ha b{font-size:13px}body.sf .ha small{font-size:11.5px}

/* tabelle: la casa della contabilità */
body.sf table{border-collapse:collapse;width:100%;font-size:12.5px;font-variant-numeric:tabular-nums}
body.sf th{background:var(--sf-head);color:var(--smoke);font-size:11px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;text-align:left;padding:5px 7px;border:1px solid var(--line);white-space:nowrap;position:sticky;top:0;z-index:1}
body.sf td{padding:4px 7px;border:1px solid var(--line);vertical-align:middle;line-height:1.3}
body.sf tbody tr:nth-child(even) td{background:var(--sf-zebra)}
body.sf tbody tr:hover td{background:var(--sf-sel)}
body.sf td.n,body.sf th.n,body.sf td[data-num],body.sf td[style*="text-align:right"]{text-align:right}
body.sf td a{text-decoration:none;color:var(--accent-deep);font-weight:600}
body.sf .erp-row{padding:5px 0;font-size:13px;border-top:1px solid var(--line)}
body.sf .erp-row:first-child{border-top:0}

/* moduli: campi bassi, angoli squadrati, etichette piccole */
body.sf .kinp,body.sf input:not([type=checkbox]):not([type=radio]):not([type=file]),body.sf select,body.sf textarea{
  border-radius:2px!important;padding:4px 7px!important;font-size:13px!important;min-height:0!important;line-height:1.3!important;border:1px solid var(--line)!important;background:#fff!important;color:var(--ink)!important}
body.sf textarea{padding:6px 7px!important}
body.sf .klbl,body.sf label{font-size:11px;font-weight:700;color:var(--smoke);margin:0 0 2px;text-transform:uppercase;letter-spacing:.03em}
body.sf button,body.sf .btn,body.sf .asd-btn,body.sf .sp-btn,body.sf .bk-btn,body.sf a.btn{border-radius:2px!important;padding:5px 10px!important;font-size:12.5px!important;font-weight:600!important;min-height:0!important;line-height:1.3!important}
body.sf .tabs{gap:0;margin:0 0 6px}
body.sf .tab{border-radius:0;padding:5px 10px;font-size:12.5px;border:1px solid transparent;border-bottom:0}
body.sf .tab.on,body.sf .tab[aria-current]{border-color:var(--line);background:var(--sf-head)}

/* KPI: numeri grandi ridotti a riga di sintesi */
body.sf .ent-kpi,body.sf .kpi-btn,body.sf .asd-kpi{border-radius:0!important;padding:6px 10px!important;box-shadow:none!important}
body.sf .ent-kpi b,body.sf .kpi-btn b,body.sf .asd-kpi b{font-size:18px!important}
body.sf .dk-tit{font-size:10.5px;margin-bottom:5px}
body.sf .dk-sez{margin-top:8px;padding-top:6px}

/* colonna di navigazione compatta */
body.sf nav a,body.sf .navc a,body.sf .nav-voce{padding:3px 10px!important;font-size:12.5px!important;border-radius:0!important;line-height:1.5!important}
body.sf .navc-n{font-size:10px}
body.sf .nav-gruppo,body.sf .navc-grp{margin:4px 0 2px!important;font-size:10.5px!important}

/* fumetto SonIA: resta, ma piccolo */
body.sf #soniaFab{padding:8px 12px;font-size:12.5px;border-radius:4px;box-shadow:none;border:1px solid var(--accent-deep)}
body.sf #soniaPanel{border-radius:4px}

/* la firma della scheda nella vista densa e' gia' il bordo alto: niente doppio bordo */
body.sf .card.kb-card{border-top:1px solid var(--line)!important}
@media print{body.sf th{position:static}}

/* 19/09 (dal primo sguardo del fondatore): KPI e azioni rapide diventano righe compatte, la tabella sale */
body.sf .ent-kpi-row{display:flex;flex-wrap:wrap;gap:4px;margin:4px 0 6px}
body.sf .ent-kpi{flex:1 1 170px;flex-direction:row!important;align-items:baseline!important;justify-content:flex-start!important;gap:6px;padding:3px 8px!important;text-align:left!important;border-top:1px solid var(--line)!important}
body.sf .ent-kpi .k-val{font-size:13.5px!important;font-family:Inter,system-ui,sans-serif}
body.sf .ent-kpi .k-lbl{font-size:10.5px;margin:0;white-space:nowrap}
body.sf .ent-kpi .k-delta{display:none!important}
body.sf .ent-kpi .k-arr{font-size:9px;color:var(--smoke)}
body.sf .hero-actions{display:flex;flex-wrap:wrap;gap:4px;margin:4px 0 2px}
body.sf .ha{flex-direction:row;align-items:center;gap:6px;padding:3px 9px!important;border-top:1px solid var(--line)!important}
body.sf .ha small{display:none}
body.sf .ha .hic svg{width:13px;height:13px}
body.sf .ent-shell{padding-top:0}
body.sf .tabs{border-bottom:1px solid var(--line)}
body.sf .tabs .tab{letter-spacing:0!important;text-transform:none!important;font-size:12.5px!important;padding:4px 9px!important}
body.sf .ent-table-wrap{border-radius:0;box-shadow:none;border:0}
body.sf .ent-table th,body.sf .ent-table td{padding:3px 7px!important}
body.sf .kpi-dd{border-radius:0;padding:6px 8px}
body.sf .ent-eyebrow,body.sf .eyebrow{font-size:10px!important;margin:0!important}
body.sf .k-val,body.sf .num{font-variant-numeric:tabular-nums}

/* 19/09 v3: testata a sinistra e bassa, KPI su una riga senza a capo, tab di area in minuscolo */
body.sf .ask-wrap{padding:6px 0 0!important;text-align:left!important;max-width:none!important}
body.sf .eyebrow{font-size:10px!important;letter-spacing:.06em}
body.sf .ask-title{font-size:16px!important;margin:2px 0 0!important;font-family:Inter,system-ui,sans-serif!important}
body.sf .ask-sub{font-size:12px!important;margin:0 0 6px!important;max-width:none!important}
body.sf .ent-kpi{flex:0 1 auto}
body.sf .ent-kpi .k-val{white-space:nowrap}
body.sf .tabs{gap:2px}
body.sf .tabs a,body.sf .tabs .tab{text-transform:none!important;letter-spacing:0!important;font-size:12.5px!important;padding:4px 9px!important;border-radius:0!important}
body.sf .ent-shell .card[role=status]{padding:5px 8px!important;margin-bottom:6px!important;font-size:12.5px}
body.sf details summary{font-size:12.5px;padding:3px 0}

/* 19/09 passo 2: la barra alta senza la piazza (ricerca persone, messaggi, tema); resta «Chiedi a SonIA» */
body.sf form.search{display:none!important}
body.sf a.topnav-bell[href="/messaggi"],body.sf .theme-toggle{display:none!important}
body.sf .toolrail a[href="/feed"],body.sf .toolrail a[href="/chat"],body.sf .toolrail a[href="/messaggi"]{display:none!important}

/* 19/09: il tasto del ritorno, sempre in alto */
body.sf .sf-home{display:inline-flex;align-items:center;gap:6px;margin-left:10px;padding:5px 10px!important;border:1px solid var(--accent-deep);border-radius:2px;color:var(--accent-deep);font-weight:700;font-size:12.5px;text-decoration:none;white-space:nowrap}
body.sf .sf-home:hover,body.sf .sf-home.on{background:var(--accent-deep);color:#fff}

/* 19/09 (regola del fondatore): gli elenchi lunghi scorrono nella loro finestra, le colonne restano ordinabili */
body.sf .sf-scad-in .ent-table-wrap{max-height:420px;overflow:auto;border:1px solid var(--line)}
body.sf .sf-scad-in .ent-table-wrap table{min-width:0}
body.sf .sf-scad-in th{position:sticky;top:0;z-index:2;background:var(--sf-head)}
body.sf .sf-scad-in th.srt{cursor:pointer}
body.sf .sf-scad-in th[data-dir="asc"]::after{content:" ▲";font-size:9px}body.sf .sf-scad-in th[data-dir="desc"]::after{content:" ▼";font-size:9px}
body.sf .cr-due>div{max-height:360px;overflow:auto}
/* nella vista soniafattura il Cantiere (proponi/modifica funzione) non si mostra: restano «Chiedi a SonIA» e l import */
body.sf #cantiereFab,body.sf #cantiereBox{display:none!important}

/* 19/09: la colonna di soniafattura, pulita, gruppi chiusi che si aprono al clic */
body.sf .toolrail{width:236px}
body.sf .sfc{padding:6px 0 30px;font-size:13.5px}
body.sf .sfc-v{display:flex;align-items:center;gap:10px;padding:9px 14px!important;color:var(--ink);text-decoration:none;cursor:pointer;list-style:none;border-radius:0!important;font-size:13.5px!important;line-height:1.3!important;position:relative}
body.sf .sfc-v::-webkit-details-marker{display:none}
body.sf .sfc-v svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;color:var(--smoke);flex:none}
body.sf .sfc-v:hover{background:var(--sf-zebra)}
body.sf a.sfc-v.on{background:var(--accent-deep);color:#fff}body.sf a.sfc-v.on svg{color:#fff}
body.sf .sfc-fr{margin-left:auto;width:7px;height:7px;border-right:1.5px solid var(--smoke);border-bottom:1.5px solid var(--smoke);transform:rotate(-45deg);transition:transform .15s}
body.sf details[open]>.sfc-v .sfc-fr{transform:rotate(45deg)}
body.sf details[open]>.sfc-v{font-weight:700}
body.sf .sfc-f{display:flex;flex-direction:column;padding:2px 0 6px}
body.sf .sfc-f a{padding:6px 14px 6px 41px!important;color:var(--ink);text-decoration:none;font-size:13px!important;border-radius:0!important;line-height:1.3!important}
body.sf .sfc-f a:hover{background:var(--sf-zebra)}
body.sf .sfc-f a.on{color:var(--accent-deep);font-weight:700;background:var(--sf-sel)}
body.sf .toolrail>*:not(.sfc):not(.tr-pin):not(.tr-open){display:none!important}

body.sf .sfc{padding-top:8px}

/* 19/09 (fondatore: «manca il tasto esci»): Esci in fondo alla colonna e in alto accanto all avatar */
body.sf .sfc-esci{margin-top:14px;border-top:1px solid var(--line);color:var(--smoke)}
body.sf .sfc-esci:hover{color:var(--accent-deep)}
body.sf .sf-esci-top{display:inline-flex;align-items:center;gap:6px;margin-left:6px;padding:5px 10px!important;border:1px solid var(--line);border-radius:2px;color:var(--smoke);font-weight:600;font-size:12.5px;text-decoration:none;white-space:nowrap}
body.sf .sf-esci-top:hover{border-color:var(--accent-deep);color:var(--accent-deep)}

/* 19/09 (fondatore: «ordina tasti e funzioni in alto»): stessa altezza, stessa forma, stesso carattere per tutta la barra */
body.sf .sf-home,body.sf .sf-esci-top,body.sf .ask-cta,body.sf .topnav-link.tools-btn{height:34px!important;display:inline-flex!important;align-items:center!important;gap:7px!important;padding:0 13px!important;border-radius:3px!important;font:600 13px Inter,system-ui,sans-serif!important;line-height:1!important;box-shadow:none!important;margin:0!important;white-space:nowrap}
body.sf .ask-cta{background:var(--accent-deep)!important;color:#fff!important;border:1px solid var(--accent-deep)!important;margin-left:6px!important}
body.sf .ask-cta svg{width:15px;height:15px}
body.sf .sf-home{border:1px solid var(--accent-deep)!important;color:var(--accent-deep)!important;background:#fff!important;margin-left:10px!important}
body.sf .sf-home.on,body.sf .sf-home:hover{background:var(--accent-deep)!important;color:#fff!important}
body.sf .topnav-link.tools-btn{border:1px solid var(--line)!important;color:var(--ink)!important;background:#fff!important;margin-left:6px!important}
body.sf .topnav-link.tools-btn:hover,body.sf .topnav-link.tools-btn.on{border-color:var(--accent-deep)!important;color:var(--accent-deep)!important}
body.sf .sf-esci-top{border:1px solid var(--line)!important;color:var(--smoke)!important;background:#fff!important;margin-right:6px!important}
body.sf .sf-esci-top:hover{border-color:var(--accent-deep)!important;color:var(--accent-deep)!important}
body.sf .topnav-bell{width:34px;height:34px;border-radius:3px}
body.sf .topnav-right{gap:4px}

/* 19/09 (fondatore: «sistema queste colonne, lo spazio c e»): celle su una riga, colonne larghe quanto il contenuto,
   la colonna dei tasti a destra compatta; se non ci sta, scorre in orizzontale il riquadro, non la pagina */
body.sf .ent-table-wrap{overflow-x:auto}
body.sf table.ent-table{min-width:0;width:100%;table-layout:auto}
body.sf .ent-table th,body.sf .ent-table td{white-space:nowrap;vertical-align:middle}
body.sf .ent-table td.doc{font-size:12.5px}
body.sf .ent-table td .ent-badge,body.sf .ent-table td .badge{white-space:nowrap}
body.sf .ent-table td.ent-azioni,body.sf .ent-table th.ent-azioni{text-align:right;width:1%}
body.sf .ent-table td.ent-azioni .btn,body.sf .ent-table td.ent-azioni a.btn,body.sf .ent-table td.ent-azioni button{display:inline-flex;align-items:center;height:26px;padding:0 9px!important;margin:0 0 0 4px;font-size:12px!important;vertical-align:middle}
body.sf .ent-table td a{border-bottom:0}
body.sf .ent-table td:first-child{font-variant-numeric:tabular-nums}
/* colonne testuali lunghe (descrizioni, note) restano leggibili: a capo con un tetto */
body.sf .ent-table td.desc,body.sf .ent-table td.descr,body.sf .ent-table td.note,body.sf .ent-table td.pobz-cont{white-space:normal;max-width:38ch}

/* 19/09 (fondatore, da iPhone: «scorre fuori dallo schermo»): Safari ingrandisce la pagina sui campi sotto i 16 px e non torna
   indietro. Sul telefono i campi sono 16 px e la pagina non scorre in orizzontale. */
@media(max-width:768px){
  body.sf{overflow-x:hidden;max-width:100vw}
  body.sf input:not([type=checkbox]):not([type=radio]):not([type=file]),body.sf select,body.sf textarea,body.sf .kinp{font-size:16px!important}
  body.sf .ent-table-wrap,body.sf .sf-scad-in .ent-table-wrap,body.sf .cr-due>div{max-width:100vw;overflow-x:auto}
}

/* 19/09 (fondatore, da iPhone: nomi lunghi sopra la colonna accanto): ogni cella ha un tetto e i puntini, mai sovrapposizioni */
body.sf .ent-table td{max-width:36ch;overflow:hidden;text-overflow:ellipsis}
body.sf .ent-table td.ent-ell,body.sf .ent-table td.strong{max-width:30ch}
body.sf .ent-table td.num,body.sf .ent-table td.mono,body.sf .ent-table td.ent-azioni{max-width:none;overflow:visible}
@media(max-width:768px){body.sf .ent-table td{max-width:24ch}body.sf .ent-table td.ent-ell,body.sf .ent-table td.strong{max-width:22ch}}

/* 19/09 (fondatore, da iPhone: «migliora la barra on-top»): una riga sola, icone al posto delle parole, Esci sta nel menu */
@media(max-width:768px){
  body.sf .sf-esci-top,body.sf .topnav-bell.navk-open{display:none!important}
  body.sf .sf-home,body.sf .ask-cta{font-size:0!important;width:38px!important;height:38px!important;padding:0!important;justify-content:center!important;gap:0!important;margin:0 0 0 6px!important;border-radius:3px!important}
  body.sf .sf-home svg,body.sf .ask-cta svg{width:18px!important;height:18px!important;margin:0!important}
  body.sf .topnav-bell{width:38px;height:38px}
  body.sf .topbar,body.sf .topnav-right{gap:4px!important}
  body.sf .topbar .ask-cta{flex:0 0 auto!important;order:0!important}
  body.sf .logo{margin-right:auto}
}

/* 19/09: il menu del telefono e la colonna di soniafattura */
body.sf .mnav-body .sfc{padding:4px 0 12px}
body.sf .mnav-body .sfc-v{padding:11px 10px!important;font-size:15px!important}
body.sf .mnav-body .sfc-f a{padding:9px 10px 9px 40px!important;font-size:14.5px!important}
body.sf .mnav-foot .mnav-theme{display:none}

/* 19/09 (fondatore, consiglio di Fabio Sartini: spunti da NetSuite): stessa densita', pelle piu' moderna.
   Barra alta scura con icone chiare; pagina grigio caldo; pannelli bianchi con raggio 6 e ombra leggera;
   titoli di sezione sottili con puntino; tabelle a righe fine; bottoni piatti. */
body.sf{background:#F1EEEC!important}
body.sf .topbar{background:#23222a!important;border-bottom:0!important;box-shadow:0 1px 0 rgba(255,255,255,.06),0 6px 20px rgba(30,30,34,.18)!important;height:56px!important}
body.sf .topbar .row{height:56px!important;padding:0 18px!important}
body.sf .topbar .logo,body.sf .topbar .logo-txt{color:#fff!important;font-size:22px!important}
body.sf .topbar .logo-txt span{color:var(--accent)!important}
body.sf .topbar .logo-official{filter:brightness(0) invert(1);opacity:.95}
body.sf .sf-home{border-color:rgba(255,255,255,.25)!important;color:#fff!important;background:rgba(255,255,255,.06)!important}
body.sf .sf-home.on,body.sf .sf-home:hover{background:var(--accent-deep)!important;border-color:var(--accent-deep)!important}
body.sf .ask-cta{background:var(--accent-deep)!important;border-color:var(--accent-deep)!important}
body.sf .topnav-link.tools-btn{background:transparent!important;border-color:rgba(255,255,255,.18)!important;color:#e9e4e1!important}
body.sf .topnav-link.tools-btn:hover,body.sf .topnav-link.tools-btn.on{border-color:var(--accent)!important;color:#fff!important}
body.sf .sf-esci-top{background:transparent!important;border-color:rgba(255,255,255,.18)!important;color:#c9c2bd!important}
body.sf .sf-esci-top:hover{color:#fff!important;border-color:var(--accent)!important}
body.sf .topnav-bell,body.sf .topnav-bell svg{color:#e9e4e1!important}
body.sf .topnav-bell:hover{background:rgba(255,255,255,.08)}
body.sf .topbar .avatar{border-radius:6px!important;box-shadow:0 0 0 2px rgba(255,255,255,.15)}
body.sf .topbar .search input{background:rgba(255,255,255,.08);color:#fff;border-color:transparent}
body.sf .mnav-burger{color:#fff}
body.sf .toolrail{top:56px!important;padding-top:10px!important;background:#fff!important;border-right:1px solid #e3ddd9!important}
body.sf .ent-shell,body.sf .cr,body.sf main.container{padding-top:10px}
/* pannelli */
body.sf .card,body.sf .ent-card,body.sf .sa-card,body.sf .stz-card,body.sf .asd-card,body.sf .bk-card,body.sf .cr-sez,body.sf .ent-kpi,body.sf .ha,body.sf .ent-toolbar,body.sf .kpi-dd{
  border-radius:6px!important;border:1px solid #e3ddd9!important;border-top:1px solid #e3ddd9!important;box-shadow:0 1px 2px rgba(30,30,34,.05),0 6px 18px rgba(30,30,34,.05)!important;background:#fff}
body.sf .cr-sez>h2{background:#fff;border-bottom:1px solid #ECE6E2;color:var(--ink);letter-spacing:.02em;font-size:12.5px;text-transform:none;padding:9px 12px;border-radius:6px 6px 0 0}
body.sf .cr-sez>h2::before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--accent-deep);margin-right:9px;vertical-align:1px}
body.sf .cr-sez>h2 a{color:var(--accent-deep)}
body.sf .cr-kpi a{border-color:#ECE6E2}
body.sf .cr-kpi .v{letter-spacing:-.01em}
body.sf .sec-title,body.sf .t-title{font-size:13px!important;letter-spacing:.01em}
/* tabelle: intestazione chiara, righe fine, hover morbido */
body.sf th,body.sf .ent-table th{background:#FAF8F7!important;color:#6E6A70!important;border-color:#ECE6E2!important;font-size:10.5px!important;letter-spacing:.05em}
body.sf td,body.sf .ent-table td{border-color:#EFEAE7!important;border-left:0!important;border-right:0!important}
body.sf tbody tr:nth-child(even) td{background:#FCFBFA}
body.sf tbody tr:hover td{background:#FBF1EE}
body.sf .ent-table-wrap{border:1px solid #ECE6E2;border-radius:6px;overflow:hidden}
/* bottoni piatti, un solo accento */
body.sf .btn,body.sf button.btn,body.sf .asd-btn,body.sf .bk-btn{border-radius:4px!important;border:1px solid #d9d4d0!important;background:#fff!important;color:var(--ink)!important;box-shadow:none!important}
body.sf .btn.btn-primary,body.sf .btn-primary,body.sf .asd-btn.p,body.sf .sf-btn.p{background:var(--accent-deep)!important;border-color:var(--accent-deep)!important;color:#fff!important}
body.sf .btn:hover,body.sf .asd-btn:hover{border-color:var(--accent-deep)!important}
/* colonna */
body.sf .sfc-v{border-radius:4px!important;margin:1px 8px}
body.sf a.sfc-v.on{background:#FBF1EE!important;color:var(--accent-deep)!important;font-weight:700}
body.sf a.sfc-v.on svg{color:var(--accent-deep)!important}
body.sf details[open]>.sfc-v{background:#FAF8F7}
body.sf .sfc-f a.on{border-left:3px solid var(--accent-deep);padding-left:38px!important}
@media(max-width:768px){body.sf .topbar,body.sf .topbar .row{height:auto!important;min-height:52px}body.sf .toolrail{top:0!important}}

body.sf .cr-sez>h2{justify-content:flex-start}body.sf .cr-sez>h2 a{margin-left:auto}
