/* ==== Design token Maybe: unica fonte di colori, font, raggi e ombre (stile maybesrl.com) ==== */
@font-face{font-family:'Montserrat';src:url("fonts/montserrat-var.c154477b9aff.woff2") format('woff2');font-weight:100 900;font-display:swap}
@font-face{font-family:'Open Sans';src:url("fonts/open-sans-var.23145c714161.woff2") format('woff2');font-weight:300 800;font-stretch:75% 100%;font-display:swap}
@font-face{font-family:'Inter';src:url("fonts/inter-var.65850a373e25.woff2") format('woff2');font-weight:100 900;font-display:swap}
:root{
  /* Brand */
  --maybe-red:#E4041C;--maybe-red-hover:#C20318;--maybe-black:#000000;--maybe-ink:#090614;--maybe-dark:#232323;
  --maybe-grey:#54595F;--maybe-muted:#7A7A7A;--maybe-white:#FFFFFF;--surface-alt:#F5F5F7;--border:#E6E6E9;
  /* Neutri derivati */
  --border-strong:#CFCFD4;--soft:#EFEFF2;--head:#F7F7F9;--row-hover:#FAFAFB;
  --focus-ring:0 0 0 3px rgba(228,4,28,.25);--shadow:0 1px 3px rgba(0,0,0,.08);--shadow-pop:0 6px 24px rgba(0,0,0,.18);
  --radius:9px;--radius-card:12px;--overlay:rgba(9,6,20,.55);
  --font-title:'Montserrat',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-ui:'Open Sans',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-text:'Inter','Open Sans',system-ui,-apple-system,'Segoe UI',sans-serif;
  /* Colori di stato (invariati: hanno un significato, non sono il brand) */
  --ok-bg:#dcf4e4;--ok-fg:#165d2f;--warn-bg:#fff1c9;--warn-fg:#765400;--info-bg:#dcebfb;--info-fg:#1c4f8a;
  --wait-bg:#ece8fb;--wait-fg:#3d2f8f;--alert-bg:#ffe3cc;--alert-fg:#8a3b00;--bad-bg:#fbe0e0;--bad-fg:#8a1c1c;
  --issue-bg:#ffe8dd;--issue-fg:#8b3510;--late-bg:#fde2e1;--late-fg:#8a1c14;--late-line:#cf222e;
  --client-bg:#fff4cc;--client-fg:#7a5b00;--client-line:#bf8700;
  --attention-bg:var(--attention-bg);--attention-line:var(--attention-line);--note-bg:#fff3c4;--note-line:#e3c04f;
  /* Nomi usati nel resto del foglio, ora legati ai token */
  --brand:var(--maybe-ink);--brand-2:var(--maybe-red);--bg:var(--surface-alt);--surface:var(--maybe-white);
  --text:var(--maybe-dark);--muted:var(--maybe-grey);--line:var(--border);--line-2:var(--soft);--link:var(--maybe-ink);
  --data:var(--maybe-dark);
  font-family:var(--font-text);color:var(--text);background:var(--bg)
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg)}
a{color:var(--link)}

/* Struttura: header bianco (logo, utente, azione principale) + menu laterale scuro */
body{font-family:var(--font-text);font-size:15px;line-height:1.5}
a{color:var(--link);text-underline-offset:2px}
a:hover{text-decoration-color:var(--maybe-red)}
.topbar{background:var(--maybe-white);color:var(--maybe-ink);height:60px;padding:0 1.2rem;display:flex;align-items:center;gap:1rem;
  position:sticky;top:0;z-index:10;border-bottom:1px solid var(--border);box-shadow:var(--shadow)}
.topbar .brand{display:inline-flex;align-items:center;gap:.6rem;font-family:var(--font-title);font-weight:700;font-size:1.2rem;
  color:var(--maybe-ink);text-decoration:none;white-space:nowrap;letter-spacing:-.01em}
.topbar .brand img{width:34px;height:34px;border-radius:8px;display:block}
.topbar .spacer{flex:1}
.topbar .who{font-family:var(--font-ui);font-size:.88rem;font-weight:600;color:var(--maybe-grey);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar form.inline button{background:transparent;color:var(--maybe-dark);border:1px solid var(--border)}
.topbar form.inline button:hover{border-color:var(--maybe-dark);background:transparent}
.menu-toggle{display:none;color:var(--maybe-ink);font-size:1.4rem;cursor:pointer;line-height:1}
#menu-state{display:none}
.layout{display:flex;min-height:calc(100vh - 60px)}
/* Menu laterale scuro con icone outline bianche e indicatore rosso (richiama il logo) */
.sidebar{width:248px;flex:0 0 248px;background:var(--maybe-dark);color:var(--maybe-white);padding:.8rem 0}
/* desktop: il menu resta fermo accanto alla pagina e scorre per conto suo (niente menu lungo quanto la pagina) */
@media(min-width:801px){.sidebar{position:sticky;top:60px;align-self:flex-start;height:calc(100vh - 60px);overflow-y:auto;overscroll-behavior:contain}}
.sidebar .group{margin:0 .55rem .2rem;border-radius:var(--radius)}
.sidebar .group-title{display:flex;align-items:center;gap:.65rem;padding:.5rem .6rem;border-radius:var(--radius);cursor:pointer;list-style:none;
  font-family:var(--font-ui);font-size:.78rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:rgba(255,255,255,.82);user-select:none}
.sidebar .group-title::-webkit-details-marker{display:none}
.sidebar .group-title:hover{background:rgba(255,255,255,.07);color:var(--maybe-white)}
.sidebar .group-title:focus-visible{outline:none;box-shadow:var(--focus-ring)}
.mod-icon{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;flex:0 0 30px;border-radius:8px;
  border:1.5px solid rgba(255,255,255,.35);color:var(--maybe-white);background:transparent}
.sidebar .group[data-active] .mod-icon{border-color:var(--maybe-red)}
.sidebar .group[data-active] .group-title{color:var(--maybe-white)}
.mod-label{flex:1}
.chev{width:7px;height:7px;border-right:2px solid rgba(255,255,255,.5);border-bottom:2px solid rgba(255,255,255,.5);transform:rotate(-45deg);
  transition:transform .2s ease-out;margin-right:.3rem}
.sidebar .group-title[aria-expanded="true"] .chev{transform:rotate(45deg)}
.group-items{padding:.1rem 0 .45rem 1.45rem}
.sidebar a{display:block;padding:.38rem .7rem;margin:1px 0;color:rgba(255,255,255,.78);text-decoration:none;border-left:3px solid transparent;
  border-radius:0 6px 6px 0;font-family:var(--font-ui);font-size:.9rem}
.sidebar a:hover{background:rgba(255,255,255,.06);color:var(--maybe-white)}
.sidebar a.active{border-left-color:var(--maybe-red);background:rgba(255,255,255,.08);color:var(--maybe-white);font-weight:600}
@media(prefers-reduced-motion:reduce){.chev{transition:none}}
main{flex:1;min-width:0;max-width:1200px;margin:0 auto;padding:1.6rem 1.4rem 3rem}
main.full{max-width:none}
.site-foot{border-top:1px solid var(--border);color:var(--maybe-muted);font-size:.82rem;padding:1rem 1.4rem;text-align:center;background:var(--maybe-white)}
.site-foot a{color:var(--maybe-grey)}

/* Tipografia: titoli Montserrat, interfaccia Open Sans, testo Inter */
h1,h2,h3,.card-title,.kpi-value,.hub-kpi strong{font-family:var(--font-title);color:var(--maybe-ink);letter-spacing:-.01em}
h1{margin:.2rem 0 1.3rem;font-size:1.85rem;font-weight:700;line-height:1.2}
h2{margin-top:2rem;font-weight:700}
h3{font-weight:600}

/* Componenti */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-card);padding:1.15rem;margin:1rem 0;box-shadow:var(--shadow)}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:1rem}
.muted{color:var(--muted)}
.badge{display:inline-block;border-radius:20px;padding:.2rem .6rem;background:var(--soft);font-size:.85rem}
.done{background:var(--ok-bg);color:var(--ok-fg)}
.issue{background:var(--issue-bg);color:var(--issue-fg)}
.pending{background:var(--warn-bg);color:var(--warn-fg)}
/* Tabelle: testo a 14px, righe compatte, intestazioni piccole e sobrie, numeri allineati */
table{width:100%;border-collapse:collapse;background:var(--surface);font-size:.875rem;line-height:1.4}
td,th{padding:.5rem .7rem;text-align:left;border-bottom:1px solid var(--line-2);vertical-align:top}
th{background:var(--head);font-family:var(--font-ui);font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;
  color:var(--muted);padding-top:.45rem;padding-bottom:.45rem;white-space:nowrap;vertical-align:bottom}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover td{background:var(--row-hover)}
td small{font-size:.78rem;color:var(--muted)}
td .badge{font-size:.72rem;padding:.12rem .5rem;white-space:nowrap}
td a{text-decoration:none}
td a:hover{text-decoration:underline}
td strong{font-weight:600}
td,th{font-variant-numeric:tabular-nums}
.card.table-wrap{padding:0;overflow-x:auto}
.card.table-wrap > .card-title{padding:.9rem 1rem 0}
.card.table-wrap td:first-child,.card.table-wrap th:first-child{padding-left:1rem}
.card.table-wrap td:last-child,.card.table-wrap th:last-child{padding-right:1rem}
table.formset td{vertical-align:middle;padding:.35rem .45rem}
table.formset input:not([type=checkbox]),table.formset select,table.formset textarea{padding:.3rem .45rem;font-size:.85rem}
input,select,textarea,button{font:inherit;padding:.55rem .7rem;border:1px solid var(--border);border-radius:var(--radius)}
input,select,textarea{background:var(--maybe-white);color:var(--maybe-dark);max-width:100%}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--maybe-red);box-shadow:var(--focus-ring)}
button,a.button{font-family:var(--font-ui);font-weight:700;min-height:2.4rem;line-height:1.2}
button{background:var(--maybe-red);color:var(--maybe-white);cursor:pointer;border:1px solid transparent}
button:not([class]):hover,button.primary:hover{background:var(--maybe-red-hover)}
button:focus-visible,a.button:focus-visible{outline:none;box-shadow:var(--focus-ring)}
label{display:block;margin:.8rem 0 .3rem;font-weight:600}
textarea{width:100%;min-height:90px}
form.inline{display:inline}
.toolbar{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap;margin:1rem 0}
.page-actions{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}
/* Ticket del cliente: ricerca per numero o oggetto ampia (si allarga fino a 40rem, su telefono tutta la riga) */
.client-search input[type=search]{flex:1 1 18rem;max-width:40rem;min-width:0}
/* Ticket del team: filtro per utente (con la x per toglierlo) e tabella ordinabile */
.client-search .person-filter{flex:0 1 16rem;min-width:12rem}
.person-filter .person-input{width:100%;padding-right:1.8rem}
.person-clear{position:absolute;right:.55rem;top:50%;transform:translateY(-50%);text-decoration:none;color:var(--muted);font-size:1.15rem;line-height:1}
.client-search label.check{margin:0;white-space:nowrap}
table.team-tickets th a{color:inherit;text-decoration:none;white-space:nowrap}
table.team-tickets tr.attention td:first-child{box-shadow:inset 4px 0 0 #e08a3c}
.toolbar label{margin:0}
.message{background:var(--ok-bg);color:var(--ok-fg);padding:.8rem 1rem;border-radius:var(--radius)}
.message.error{background:var(--issue-bg);color:var(--issue-fg)}
small{color:var(--muted)}

/* Pagine anagrafiche e form */
.page-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.page-head h1{margin-bottom:.6rem}
a.button{display:inline-flex;align-items:center;justify-content:center;background:var(--maybe-red);color:var(--maybe-white);text-decoration:none;
  padding:.55rem 1rem;border-radius:var(--radius);border:1px solid transparent}
a.button:hover{background:var(--maybe-red-hover)}
.table-wrap{overflow-x:auto}
.card-title{margin:0 0 .8rem;font-size:1.1rem}
.facts{display:grid;grid-template-columns:max-content 1fr;gap:.35rem 1rem;margin:0}
.facts dt{color:var(--muted)}
.facts dd{margin:0;word-break:break-word}
.badge.domain{background:var(--info-bg);color:var(--info-fg);font-family:ui-monospace,Menlo,monospace}
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:0 1rem}
.field input,.field select,.field textarea,table.formset input:not([type=checkbox]),table.formset select{width:100%}
button.secondary,a.button.secondary{background:var(--maybe-white);color:var(--maybe-dark);border:1px solid var(--border)}
button.secondary:hover,a.button.secondary:hover{background:var(--surface-alt);border-color:var(--border-strong)}
.field small{display:block;margin-top:.2rem}
.field-error{color:var(--issue-fg);font-size:.88rem;margin-top:.2rem}
.has-error input,.has-error select,.has-error textarea{border-color:#c0582a}
.checks{display:flex;gap:1.2rem;flex-wrap:wrap}
label.check{display:flex;align-items:center;gap:.4rem;font-weight:400;margin:.3rem 0}
label.check input{width:auto}
fieldset.subform{border:1px solid var(--line);border-radius:8px;padding:.4rem 1rem .8rem;margin:0 0 1rem}
code{background:var(--head);padding:.05rem .3rem;border-radius:3px}

table.matrix td:not(:first-child),table.matrix th:not(:first-child){text-align:center}
table.matrix td:last-child{text-align:left}
h3{margin:1.2rem 0 .5rem;font-size:1rem}
button.danger{background:var(--maybe-white);color:var(--maybe-red);border:1px solid var(--maybe-red)}
button.danger:hover{background:var(--late-bg)}
.total{font-weight:600;margin:.4rem 0}

/* Schede e lista da fare */
.tabs{display:flex;gap:.2rem;border-bottom:1px solid var(--line);margin:0 0 .6rem;flex-wrap:wrap}
.tabs a{padding:.55rem 1rem;text-decoration:none;color:var(--muted);border-bottom:3px solid transparent;margin-bottom:-1px}
.tabs a{font-family:var(--font-ui);font-weight:600;font-size:.88rem;text-transform:uppercase;letter-spacing:.04em}
.tabs a.active{color:var(--maybe-ink);border-bottom-color:var(--maybe-red)}
.period{min-width:12rem;text-align:center}
tr.row-done td{color:var(--muted)}
.toolbar .push{margin-left:auto}
/* Lista ticket operatore: filtri su una riga (ricerca elastica, select larghe quanto il contenuto, Filtra a destra) */
.ticket-filters .tf-search{flex:1 1 16rem;min-width:16rem}
.ticket-filters select{flex:0 0 auto;width:auto}
.ticket-filters .tf-collab{flex:0 1 10rem;min-width:8rem}
.ticket-filters button{flex:0 0 auto;margin-left:auto}
@media(min-width:1280px){.ticket-filters{flex-wrap:nowrap}}
@media(max-width:700px){.ticket-filters .tf-search,.ticket-filters .tf-collab,.ticket-filters select{flex:1 1 100%;min-width:0;width:100%}}
label.off-hours{margin-top:.8rem}
.time-slot{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin:.3rem 0 .6rem}
.time-slot[hidden]{display:none}
.time-slot label{margin:0}
.badge.off{background:var(--wait-bg);color:var(--wait-fg)}
.tabs a.button.tab-action{margin:0 0 .4rem auto;align-self:center;border-bottom:0;color:var(--maybe-white);padding:.5rem .9rem}
.field.narrow{max-width:16rem}
.contact-cell{min-width:14rem}
.contact-filter{width:100%;margin-bottom:.3rem;padding:.35rem .5rem;font-size:.9rem}
.checks.clients{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:.2rem 1rem}
section.missed{border-color:#f3c6bb}
section.missed .card-title{color:var(--issue-fg)}
tr.row-missed td{background:#fdf0ec}
.show-sm{display:none}

/* Dashboard Extranet */
.hub-kpis{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:.8rem}
.hub-kpi{display:flex;flex-direction:column;gap:.2rem;padding:.8rem 1rem;border:1px solid var(--line);border-radius:8px;text-decoration:none;color:var(--text);background:var(--bg)}
a.hub-kpi:hover{border-color:var(--brand-2)}
.hub-kpi.attention{background:var(--attention-bg);border-color:var(--attention-line)}
.hub-links{display:flex;flex-wrap:wrap;gap:.4rem 1.4rem;margin:.9rem 0 0}

/* Ticket */
td.nowrap{white-space:nowrap}
label.attach{display:block;font-weight:400;font-size:.88rem;color:var(--muted);margin:.4rem 0 0}
label.attach input{margin-left:.4rem;font-size:.85rem}
form.resolve{display:flex;align-items:center;gap:.8rem;flex-wrap:wrap;margin-top:.6rem}
.kpis.client-kpis{grid-template-columns:repeat(3,1fr)}
.client-kpis a.kpi{text-decoration:none;color:var(--text)}
.kpi.attention{border-color:var(--attention-line);background:var(--attention-bg)}
.kpis.ticket-kpis{grid-template-columns:repeat(4,1fr);margin-bottom:1rem}
.ticket-kpis a.kpi{text-decoration:none;color:var(--text)}
.ticket-kpis a.kpi:hover,.ticket-kpis a.kpi.current{border-color:var(--brand-2)}
.kpi-note{color:var(--muted);font-size:.8rem}
.client-tickets{display:flex;flex-direction:column;gap:.6rem}
a.client-ticket{display:flex;justify-content:space-between;gap:1rem;text-decoration:none;color:var(--text);margin:0}
a.client-ticket:hover{border-color:var(--brand-2)}
a.client-ticket.attention{border-left:4px solid #e08a3c}
a.client-ticket .right{text-align:right;white-space:nowrap}
.badge.st-nuovo{background:var(--warn-bg);color:var(--warn-fg)}
.badge.st-in_lavorazione{background:var(--info-bg);color:var(--info-fg)}
.badge.st-in_attesa{background:var(--wait-bg);color:var(--wait-fg)}
.badge.st-in_attesa_assistenza{background:var(--alert-bg);color:var(--alert-fg)}
.badge.st-chiuso{background:var(--soft);color:var(--maybe-grey)}
.ticket-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:1rem;align-items:start}
.chat{background:var(--surface-alt);border:1px solid var(--line);border-radius:var(--radius-card);padding:1rem;max-height:70vh;overflow-y:auto;display:flex;flex-direction:column;gap:.35rem}
.chat-day{text-align:center;margin:.6rem 0}
.chat-day span{background:var(--maybe-white);color:var(--muted);font-size:.78rem;padding:.2rem .7rem;border-radius:8px;box-shadow:0 1px 1px rgba(0,0,0,.07)}
.chat-event{align-self:center;background:var(--soft);color:var(--maybe-grey);font-size:.8rem;padding:.25rem .7rem;border-radius:8px;max-width:85%;text-align:center}
.bubble-row{display:flex}
.bubble-row.right{justify-content:flex-end}
.bubble-row.nota{justify-content:center}
.bubble{position:relative;max-width:min(78%,640px);background:var(--maybe-white);border-radius:var(--radius-card);padding:.45rem .7rem .3rem;box-shadow:0 1px 1px rgba(0,0,0,.12);word-break:break-word}
.bubble-row.left .bubble{border-top-left-radius:2px}
.bubble-row.right .bubble{background:var(--soft);border-top-right-radius:2px}
.bubble.note{background:var(--note-bg);border:1px solid var(--note-line)}
.bubble.failed{background:#ffe3dc}
.bubble-head{font-size:.8rem;font-family:var(--font-ui);color:var(--maybe-ink);margin-bottom:.15rem}
.bubble-row.right .bubble-head{color:var(--maybe-grey)}
.bubble-head .via{color:var(--muted);font-weight:400}
.bubble-body{font-size:.95rem;line-height:1.35}
.bubble-files{display:flex;flex-direction:column;gap:.2rem;margin-top:.35rem;font-size:.88rem}
.bubble-full{margin-top:.3rem;font-size:.82rem;color:var(--muted)}
.bubble-full summary{cursor:pointer;color:var(--link)}
.bubble-full div{margin-top:.3rem;border-left:3px solid var(--border-strong);padding-left:.5rem}
.bubble-meta{text-align:right;font-size:.72rem;color:var(--maybe-grey);margin-top:.1rem}
.tick{color:#53bdeb;font-weight:700}
.tick.err{color:#b3401a;font-weight:600}
.composer{margin-top:.6rem}
.composer-tabs{display:flex;gap:.3rem;margin-bottom:.5rem}
.composer-tabs .tab{background:var(--soft);color:var(--text)}
.composer-tabs .tab.active{background:var(--brand-2);color:var(--maybe-white)}
.composer textarea{width:100%;border-radius:18px;padding:.7rem 1rem;resize:vertical}
.composer-foot{display:flex;align-items:center;gap:.8rem;flex-wrap:wrap;margin-top:.4rem}
.composer-foot .send{margin-left:auto;border-radius:20px;padding:.55rem 1.2rem;background:#00a884}
.msg header{display:flex;gap:.5rem;align-items:baseline;flex-wrap:wrap;margin-bottom:.5rem}
.msg-body{white-space:normal;word-break:break-word;font-size:.95rem}
.msg-nota{background:#fffbea;border-color:#f1e2a6}
.msg-evento{background:var(--bg);box-shadow:none;padding:.6rem 1rem;font-size:.9rem}
.msg-evento .msg-body{color:var(--muted)}
.attachments a{margin-right:.6rem}
.ticket-side{position:sticky;top:70px}
.thread textarea{width:100%}
@media(max-width:800px){.ticket-layout{grid-template-columns:minmax(0,1fr)}.ticket-side{position:static}}

/* Grafici */
.legend{display:flex;flex-wrap:wrap;gap:.4rem 1.2rem;list-style:none;padding:0;margin:.6rem 0 1rem}
.legend li{display:flex;align-items:center;gap:.4rem;font-size:.92rem}
.swatch{display:inline-block;width:12px;height:12px;border-radius:3px;margin-right:.35rem;vertical-align:-1px}
.donuts{display:grid;grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:.8rem}
a.donut-card{padding:.8rem .6rem;font-size:.9rem;display:flex;flex-direction:column;align-items:center;text-align:center;text-decoration:none;color:var(--text);margin:0}
a.donut-card:hover{border-color:var(--brand-2)}
a.donut-card small{color:var(--muted)}
svg.donut{width:84px;height:84px;margin-bottom:.3rem}
svg.donut circle{cursor:pointer}
.donut-value{font-size:21px;font-weight:700;fill:var(--text)}
.donut-sub{font-size:14px;fill:var(--muted)}
.bar-row{display:grid;grid-template-columns:minmax(0,22rem) 1fr 4rem;gap:.8rem;align-items:center;padding:.3rem 0}
.bar-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text);text-decoration:none;font-size:.92rem}
.bar-label:hover{color:var(--link)}
.bar{display:flex;height:14px;gap:2px}
.bar span{display:block;height:100%}
.bar span:first-child{border-radius:4px 0 0 4px}
.bar span:last-child{border-radius:0 4px 4px 0}
.bar span:only-child{border-radius:4px}
.bar-value{text-align:right;font-variant-numeric:tabular-nums;color:var(--muted);font-size:.9rem}
.kpis{display:grid;grid-template-columns:2fr repeat(3,1fr);gap:1rem}
.kpi{display:flex;flex-direction:column;gap:.2rem;margin:0}
.kpi-value{font-size:1.6rem;font-weight:700;font-variant-numeric:tabular-nums}
.kpi.hero .kpi-value{font-size:3rem;line-height:1.1}
.kpi-label{color:var(--muted);font-size:.9rem}
.columns{display:flex;gap:.5rem;height:240px}
.axis{display:flex;flex-direction:column;justify-content:space-between;font-size:.75rem;color:var(--muted);text-align:right;min-width:3.6rem;padding-bottom:1.2rem}
.plot{position:relative;flex:1;display:flex;gap:2px;align-items:stretch}
.grid-line{position:absolute;left:0;right:0;border-top:1px solid var(--line-2)}
.grid-line.base{border-top-color:var(--border-strong)}
.col{flex:1;display:flex;flex-direction:column;justify-content:flex-end;min-width:0;cursor:default}
.col.weekend{background:var(--surface-alt)}
.stack{flex:1;display:flex;flex-direction:column-reverse;gap:2px}
.stack span{display:block;width:100%}
.stack span:last-child{border-radius:4px 4px 0 0}
.col small{height:1.2rem;text-align:center;font-size:.72rem;line-height:1.2rem}
.chart-tip{position:fixed;z-index:50;background:var(--maybe-ink);color:var(--maybe-white);padding:.4rem .6rem;border-radius:6px;font-size:.85rem;pointer-events:none;max-width:320px;box-shadow:0 4px 12px rgba(0,0,0,.2)}
details.card summary{cursor:pointer;font-weight:600}
@media(max-width:800px){
  .hide-sm{display:none}
  .show-sm{display:inline}
  .bar-row{grid-template-columns:1fr 3.5rem}
  .bar-row .bar{grid-column:1 / -1;grid-row:2}
  .kpis,.kpis.client-kpis,.kpis.ticket-kpis{grid-template-columns:1fr 1fr}
  a.client-ticket{flex-direction:column}
  a.client-ticket .right{text-align:left}
  .kpi.hero{grid-column:1 / -1}
  .columns{height:180px}
}

/* Pagina di accesso */
.auth{max-width:420px;margin:2.5rem auto 4rem}
.auth-logo{display:block;width:160px;height:160px;margin:0 auto 1.2rem;border-radius:28px;box-shadow:var(--shadow-pop)}
.auth .card{margin-top:0}
.auth input{width:100%}
.auth .code-input{font-size:1.4rem;letter-spacing:.4rem}
.auth-note{margin-top:1rem}
a.button.auth-ms{width:100%}

@media(max-width:800px){
  .menu-toggle{display:block}
  .topbar .who{display:none}
  .sidebar{display:none;position:fixed;top:60px;left:0;bottom:0;z-index:9;box-shadow:4px 0 16px rgba(0,0,0,.13);overflow:auto}
  #menu-state:checked ~ .layout .sidebar{display:block}
  main{padding:1rem 16px 2rem}
  table{font-size:.84rem}
  td,th{padding:.4rem .5rem}
}
/* Acquisti */
.badge.pst-bozza{background:var(--soft);color:var(--maybe-grey)}
.badge.pst-da_validare_it{background:var(--warn-bg);color:var(--warn-fg)}
.badge.pst-in_attesa_autorizzazione{background:var(--alert-bg);color:var(--alert-fg)}
.badge.pst-approvata,.badge.pst-ticket_aperto{background:var(--info-bg);color:var(--info-fg)}
.badge.pst-completata{background:var(--ok-bg);color:var(--ok-fg)}
.badge.pst-rifiutata{background:var(--bad-bg);color:var(--bad-fg)}
.badge.pst-annullata{background:var(--soft);color:var(--maybe-grey);text-decoration:line-through}
.badge.bill-da_fatturare{background:var(--warn-bg);color:var(--warn-fg)}
.badge.bill-fatturata{background:var(--ok-bg);color:var(--ok-fg)}
.badge.bill-non_fatturabile{background:var(--soft);color:var(--maybe-grey)}
.badge.mv-carico{background:var(--ok-bg);color:var(--ok-fg)}
.badge.mv-scarico{background:var(--bad-bg);color:var(--bad-fg)}
.badge.mv-impegno{background:var(--info-bg);color:var(--info-fg)}
.badge.mv-rilascio_impegno{background:var(--wait-bg);color:var(--wait-fg)}
.badge.mv-rettifica{background:var(--warn-bg);color:var(--warn-fg)}
.item-row .form-grid{margin-top:.4rem}
.timeline{list-style:none;padding:0;margin:0}
.timeline li{padding:.35rem 0;border-bottom:1px solid var(--line)}
.timeline li:last-child{border-bottom:0}
td.num,th.num{text-align:right}
tr.row-attention td{background:var(--attention-bg)}
tr.group-start td{border-top:2px solid var(--line)}
button.small{padding:.2rem .5rem;font-size:.85rem}
.checks.clients.managers{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
/* Selettore utenti per iniziale */
.user-picker{display:flex;flex-direction:column;gap:.5rem}
.picker-bar{display:flex;flex-wrap:wrap;gap:.25rem;align-items:center}
.picker-letters{display:contents}
.picker-key{background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:5px;padding:.25rem .5rem;
  font-size:.85rem;min-width:2rem;line-height:1.2}
.picker-key.letter{padding:.25rem 0}
.picker-key:hover:not(:disabled){border-color:var(--brand-2);color:var(--brand-2)}
.picker-key.active{background:var(--brand-2);border-color:var(--brand-2);color:var(--maybe-white)}
.picker-key:disabled{opacity:.35;cursor:default}
.picker-search{max-width:22rem}
.site-managers{margin-top:.6rem;border-top:1px solid var(--line-2);padding-top:.5rem}
.site-managers summary{cursor:pointer;font-weight:600;margin-bottom:.4rem}
/* Preventivi e prezzi */
.quote-items input,.quote-items select{width:100%;min-width:0}
.quote-items td.num input{max-width:7rem;text-align:right}
.quote-items select{max-width:16rem}
.price-mode{flex-direction:column;gap:.3rem;margin-bottom:.6rem}
input.computed{background:var(--bg);color:var(--muted)}
/* Interruttore "Accettato" dei preventivi */
.switch-form{display:inline-flex;align-items:center;gap:.5rem}
.switch{position:relative;width:42px;height:24px;border-radius:12px;background:var(--border-strong);padding:0;border:0;cursor:pointer;flex:0 0 42px;transition:background .15s}
.switch .knob{position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:var(--maybe-white);box-shadow:0 1px 2px rgba(0,0,0,.2);transition:left .15s}
.switch.on{background:#1f8a4c}
.switch.on .knob{left:21px}
.switch:focus-visible{outline:2px solid var(--brand-2);outline-offset:2px}
.switch:disabled{opacity:.55;cursor:not-allowed}
.switch-label{font-size:.9rem}
.quote-status{display:flex;align-items:center;gap:1rem;flex-wrap:wrap}
.quote-status .spacer{flex:1}
.badge.qbill-da_fatturare{background:var(--warn-bg);color:var(--warn-fg)}
.badge.qbill-fatturato{background:var(--ok-bg);color:var(--ok-fg)}
@media(prefers-reduced-motion:reduce){.switch,.switch .knob{transition:none}}
.code-preview{display:inline-block;font-family:ui-monospace,Menlo,monospace;font-size:1rem;font-weight:700;padding:.45rem .6rem;
  border:1px dashed var(--line);border-radius:5px;background:var(--bg);min-width:9rem}
a.button.small{padding:.25rem .55rem;font-size:.85rem}
/* Preventivo: invio al cliente e pagina pubblica */
.badge.cr-confermato{background:var(--ok-bg);color:var(--ok-fg)}
.badge.cr-non_confermato{background:var(--bad-bg);color:var(--bad-fg)}
.customer-send details summary{cursor:pointer;font-weight:600;margin:.4rem 0}
body.public-quote{background:var(--bg)}
.pq{max-width:860px;margin:0 auto;padding:24px 16px 48px}
.pq-head{display:flex;justify-content:space-between;align-items:flex-end;gap:1rem;flex-wrap:wrap;margin-bottom:1rem}
.pq-head img{height:auto;max-width:170px}
.pq-meta{text-align:right;color:var(--muted);font-size:.92rem}
.pq-subject{margin:.6rem 0 .8rem;font-size:1.25rem}
.pq-total{font-size:1.1rem}
.pq-answer h2{margin-top:0}
.pq-buttons{display:flex;gap:.8rem;flex-wrap:wrap}
.pq-buttons button{padding:.8rem 1.3rem;font-size:1rem}
button.pq-yes{background:#1f7a44}
.pq-result h1{font-size:1.3rem;margin:.2rem 0 .5rem}
.pq-result.ok{border-left:5px solid #1f7a44}
.pq-result.no{border-left:5px solid #a33b3b}
.pq-foot{text-align:center;margin-top:1.5rem;font-size:.85rem}
/* Elenco preventivi su una riga */
/* Larghezze fisse per le colonne brevi, Cliente e Oggetto si dividono il resto: niente scroll orizzontale */
.quote-table{table-layout:fixed;width:100%}
.quote-table td,.quote-table th{white-space:nowrap;vertical-align:middle;overflow:hidden}
.quote-table td.ellipsis{text-overflow:ellipsis}
.quote-table col.c-code{width:8.6rem}
.quote-table col.c-date{width:5.4rem}
.quote-table col.c-total{width:11rem}
.quote-table col.c-icon{width:3.9rem}
.quote-table col.c-accept{width:20rem}
@media(max-width:800px){
  /* Su schermo piccolo: niente Data e Oggetto, larghezze automatiche */
  .quote-table{table-layout:auto}
  .quote-table col{width:auto!important}
  .quote-table col.c-date,.quote-table col.c-subject,.quote-table .c-date,.quote-table .c-subject{display:none}
  .quote-table td.ellipsis{max-width:9rem}
  .quote-table .badge.small{display:none}
}
.quote-table .switch-label{display:none}
th.center,td.center{text-align:center}
.badge.small{font-size:.75rem;padding:.1rem .45rem}
.icon-button{display:inline-flex;align-items:center;justify-content:center;width:34px;height:30px;padding:0;border-radius:6px;
  background:var(--brand-2);color:var(--maybe-white)}
.icon-button:hover{filter:brightness(1.1)}
.icon-state{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:26px;border-radius:6px;font-size:.8rem;font-weight:700}
.icon-state{border:0;padding:0;height:30px;cursor:default;text-decoration:none}
a.icon-state,button.icon-state{cursor:pointer}
.icon-state.todo{background:var(--warn-bg);color:#8a5a00}
.icon-state.ok{background:var(--ok-bg);color:var(--ok-fg)}
a.icon-state:hover,button.icon-state:hover{filter:brightness(.95);outline:1px solid currentColor}
.icon-state.off{opacity:.55}
button.with-icon{display:inline-flex;align-items:center;gap:.45rem}
/* Firma del cliente */
.sig-wrap{position:relative}
.sig-pad{display:block;width:100%;height:180px;border:2px dashed var(--border-strong);border-radius:8px;background:var(--maybe-white);touch-action:none;cursor:crosshair}
.sig-hint{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--border-strong);font-size:1.2rem;pointer-events:none}
.sig-tools{display:flex;gap:.8rem;align-items:center;margin:.4rem 0 0}
.sig-image{max-width:320px;max-height:110px;border:1px solid var(--line);border-radius:6px;background:var(--maybe-white);padding:4px}
@media(max-width:600px){.sig-pad{height:160px}}

/* Task da fare: sotto-tab dell'ambito (Contratti / Da fare), stati, proposta delle subtask */
.scope-tabs{display:inline-flex;gap:.25rem;background:var(--soft);border-radius:10px;padding:.25rem;margin:0 0 .8rem}
.scope-tabs a{padding:.45rem 1rem;border-radius:8px;text-decoration:none;color:var(--muted);font-weight:600}
.scope-tabs a.active{background:var(--surface);color:var(--brand-2);box-shadow:var(--shadow)}
.tabs .count{display:inline-block;min-width:1.4em;padding:0 .35em;border-radius:10px;background:var(--info-bg);color:var(--info-fg);font-size:.8rem;text-align:center}
.badge.js-bozza{background:var(--soft);color:var(--maybe-grey)}
.badge.js-questionario{background:var(--warn-bg);color:var(--warn-fg)}
.badge.js-compilato{background:var(--alert-bg);color:var(--alert-fg)}
.badge.js-in_lavorazione{background:var(--info-bg);color:var(--info-fg)}
.badge.js-completato{background:var(--ok-bg);color:var(--ok-fg)}
.badge.js-annullato{background:#f1e4e4;color:#7a2d2d}
.card.step{border-left:4px solid var(--brand-2)}
ul.proposal{list-style:none;padding:0;margin:.4rem 0 1rem}
ul.proposal li{padding:.35rem 0;border-bottom:1px solid var(--line);display:flex;gap:.8rem;align-items:baseline;flex-wrap:wrap}
ul.proposal li.off strong{color:var(--muted);font-weight:400}
dl.answers{display:grid;grid-template-columns:minmax(10rem,max-content) 1fr;gap:.35rem 1rem;margin:0}
dl.answers dt{color:var(--muted)}
dl.answers dd{margin:0}
dl.answers.compact{grid-template-columns:1fr;gap:0}
dl.answers.compact dd{margin:0 0 .5rem}
ul.events{list-style:none;padding:0;margin:0;font-size:.9rem}
ul.events li{padding:.25rem 0;border-bottom:1px solid var(--line)}
form.task-update{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}
form.task-update input[type=text]{min-width:8rem;flex:1}
input.num{width:5.5rem}
.checks.column{flex-direction:column;gap:.3rem}
.autonomy-note{display:block;margin-top:.3rem;color:var(--warn-fg)}
.questionnaire .checks{gap:.4rem 1.2rem}
@media (max-width:640px){dl.answers{grid-template-columns:1fr}dl.answers dd{margin-bottom:.5rem}}
#template-form table.formset input[name$="-label"],#template-form table.formset input[name$="-title"]{min-width:15rem}
#template-form table.formset input[name$="-key"],#template-form table.formset input[name$="-condition_value"]{min-width:8rem}
#template-form table.formset textarea{min-width:10rem}
#template-form td.show-if{white-space:nowrap}
#template-form td.show-if select,#template-form td.show-if input{width:auto;max-width:11rem;display:inline-block}
#template-form table.formset{min-width:1150px}
#template-form table.formset input.num{width:4.2rem;min-width:4.2rem}
#template-form table.formset select[name$="-kind"],#template-form table.formset select[name$="-condition_op"]{min-width:9rem}

/* Progetti e diario */
.badge.js-pianificazione{background:var(--wait-bg);color:var(--wait-fg)}
.badge.js-in_pausa{background:#f0ece4;color:#6b5a2e}
.small{font-size:.86rem}
.num-col{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
button.link{background:none;border:0;color:var(--link);padding:0 .2rem;cursor:pointer;font:inherit}
.form-grid.tight{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.week-strip{display:flex;gap:.3rem;align-items:stretch;flex-wrap:wrap;margin:.6rem 0 1rem}
.week-strip .day{display:flex;flex-direction:column;align-items:center;min-width:4.6rem;padding:.35rem .5rem;border:1px solid var(--line);
  border-radius:8px;background:var(--surface);text-decoration:none;color:var(--text);font-size:.85rem}
.week-strip .day strong{font-size:1rem;font-variant-numeric:tabular-nums}
.week-strip .day.off{background:transparent;color:var(--muted)}
.week-strip .day.today{border-color:var(--brand-2)}
.week-strip .day.active{background:var(--brand-2);border-color:var(--brand-2);color:var(--maybe-white)}
.week-strip .week-total{margin-left:auto;align-self:center;color:var(--muted)}
.diary-layout{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,6fr);gap:0 1rem;align-items:start}
.diary-layout .card{margin-top:0}
ul.diary-list{list-style:none;padding:0;margin:0}
ul.diary-list li{display:grid;grid-template-columns:3.6rem 1fr auto;gap:.6rem;padding:.55rem 0;border-bottom:1px solid var(--line)}
ul.diary-list .time{font-weight:700;font-variant-numeric:tabular-nums;color:var(--maybe-ink)}
ul.diary-list li.from-contract .time{color:var(--muted)}
ul.diary-list .actions{display:flex;gap:.3rem;align-items:start}
ul.diary-list .actions a{text-decoration:none}
form.log-quick{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:.5rem;margin:0 0 1rem}
form.log-quick textarea{grid-column:1/-1}
form.log-quick button{justify-self:start}
table.team-diary td.off{background:var(--bg);color:var(--muted)}
table.team-diary td.empty a{color:var(--issue-fg)}
table.team-diary td a{text-decoration:none;display:block}
.where{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:1rem}
.where-head{display:flex;justify-content:space-between;gap:.5rem}
.where .bar{height:6px;background:var(--line-2);border-radius:3px;margin:.35rem 0 .5rem;overflow:hidden}
.where .bar span{display:block;height:100%;background:var(--data)}
.where ul{list-style:none;padding:0;margin:0;font-size:.9rem}
.where li{display:flex;justify-content:space-between;gap:.5rem;padding:.15rem 0;border-bottom:1px dashed var(--line-2)}
.where li span:last-child{font-variant-numeric:tabular-nums;color:var(--muted)}
.phase-head{display:flex;justify-content:space-between;align-items:start;gap:.5rem}
.phase-tools summary{cursor:pointer;list-style:none;padding:0 .4rem;font-weight:700;color:var(--muted)}
.phase-tools[open]{flex-basis:100%}
ul.project-tasks{list-style:none;padding:0;margin:0 0 .6rem}
ul.project-tasks li{padding:.5rem 0;border-bottom:1px solid var(--line);display:flex;flex-wrap:wrap;gap:.4rem 1rem;justify-content:space-between}
ul.project-tasks li.done strong{color:var(--muted);text-decoration:line-through;font-weight:400}
.pt-main{display:flex;gap:.6rem;align-items:baseline;flex:1 1 16rem}
.pt-state{width:1.2rem;text-align:center;color:var(--muted)}
.pt-state.st-fatto{color:var(--ok-fg)}
ul.project-tasks form.task-update select,ul.project-tasks form.task-update input{width:auto}
form.add-inline input[name=title]{flex:1;min-width:12rem}
@media (max-width:860px){.diary-layout{grid-template-columns:1fr}}
ul.project-tasks li.blocked .pt-state{color:var(--issue-fg)}
/* Visione unit */
.unit-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(420px,1fr));gap:1rem;align-items:start}
.unit-grid .card{margin:0}
.unit-card.has-blocked{border-top:4px solid #c2410c}
.unit-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem;margin:.2rem 0 .6rem}
.unit-kpis div{background:var(--bg);border-radius:8px;padding:.45rem .6rem;display:flex;flex-direction:column}
.unit-kpis strong{font-size:1.15rem;font-variant-numeric:tabular-nums}
.unit-kpis span{font-size:.75rem;color:var(--muted)}
.unit-kpis .alert{background:var(--issue-bg)}.unit-kpis .alert strong{color:var(--issue-fg)}
.unit-kpis .warn{background:var(--warn-bg)}
ul.blocked-list{list-style:none;padding:0;margin:.3rem 0 .6rem;font-size:.88rem}
ul.blocked-list li{padding:.35rem 0;border-bottom:1px solid var(--line-2)}
@media (max-width:640px){.unit-grid{grid-template-columns:1fr}.unit-kpis{grid-template-columns:repeat(2,1fr)}}

/* Home: Il mio diario (orologio delle 8 ore + tempo per lavoro) */
.home-diary{border-top:4px solid var(--brand-2)}
.home-diary .hd-head{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;flex-wrap:wrap}
.hd-missing{margin:-.3rem 0 .8rem;font-size:.85rem;color:var(--issue-fg)}
.hd-grid{display:grid;grid-template-columns:220px minmax(0,1fr);gap:1.5rem;align-items:start}
.hd-clock{display:flex;flex-direction:column;align-items:center}
.hd-clock svg{width:170px;height:170px}
.hd-clock circle{fill:none;stroke-width:12}
.hd-clock .track{stroke:var(--line-2)}
.hd-clock .done{stroke:var(--data);stroke-linecap:round}
.hd-clock .extra{stroke:#b45309;stroke-linecap:round;stroke-width:6}
.hd-clock text{text-anchor:middle;fill:var(--text);font-variant-numeric:tabular-nums}
.hd-clock text.big{font-size:26px;font-weight:700}
.hd-clock text.small{font-size:12px;fill:var(--muted)}
.hd-left{margin:.2rem 0 .8rem;font-size:.88rem;color:var(--muted)}
.hd-left strong{color:var(--text)}
.hd-week{display:flex;gap:.3rem;align-items:flex-end}
.hd-week a{display:flex;flex-direction:column;align-items:center;gap:.15rem;text-decoration:none;color:var(--muted);width:1.3rem}
.hd-week .bar{display:flex;align-items:flex-end;width:.55rem;height:36px;background:var(--line-2);border-radius:3px;overflow:hidden}
.hd-week .bar span{display:block;width:100%;background:var(--data);border-radius:3px 3px 0 0}
.hd-week a.off .bar{background:transparent;border:1px dashed var(--line)}
.hd-week a.today small{color:var(--brand-2);font-weight:700}
.hd-week small{font-size:.7rem;text-transform:uppercase}
.hd-week-total{margin-left:.5rem;display:flex;flex-direction:column;font-weight:700;font-variant-numeric:tabular-nums;font-size:.95rem}
.hd-week-total small{font-weight:400;color:var(--muted);font-size:.7rem}
.hd-groups ul{list-style:none;padding:0;margin:0}
.hd-groups li{padding:.45rem 0;border-bottom:1px solid var(--line-2)}
.hd-groups li:last-child{border-bottom:0}
.hd-row{display:flex;justify-content:space-between;gap:1rem;align-items:baseline}
.hd-label{min-width:0;font-weight:600;font-size:.92rem}
.hd-label a{text-decoration:none;color:var(--text)}
.hd-label a:hover{color:var(--link);text-decoration:underline}
.hd-label small{display:block;font-weight:400;color:var(--muted);font-size:.78rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hd-time{font-variant-numeric:tabular-nums;font-size:1rem}
.hd-bar{display:block;height:4px;background:var(--line-2);border-radius:2px;margin-top:.3rem;overflow:hidden}
.hd-bar span{display:block;height:100%;background:var(--data);border-radius:2px}
.hd-add{display:flex;gap:.5rem;flex-wrap:wrap;margin-top:1rem;padding-top:1rem;border-top:1px solid var(--line-2)}
.hd-add input,.hd-add select{padding:.4rem .5rem;font-size:.88rem}
.hd-add input.num{width:4.5rem}
.hd-add select{max-width:18rem}
.hd-add input.wide{flex:1;min-width:12rem}
.hd-add input.ticket{width:8rem}
@media (max-width:760px){.hd-grid{grid-template-columns:minmax(0,1fr)}.hd-add select{max-width:100%;min-width:0;flex:1 1 100%}}
.day-summary{margin:0 0 .6rem}
.day-summary + h3{margin-top:.4rem;font-size:.85rem;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
form.complete-job{margin:1rem 0 .6rem;padding-top:.8rem;border-top:1px solid var(--line-2);display:flex;flex-direction:column;gap:.4rem}
form.complete-job .check{margin:0;font-weight:400;font-size:.88rem}
form.complete-job button{align-self:flex-start}
.week-strip .print-links{align-self:center;font-size:.85rem;color:var(--muted);white-space:nowrap}
ul.quote-docs{list-style:none;padding:0;margin:0 0 .6rem}
ul.quote-docs li{display:flex;gap:.6rem;align-items:baseline;flex-wrap:wrap;padding:.35rem 0;border-bottom:1px solid var(--line-2)}
ul.quote-docs li a{text-decoration:none}
.quote-docs-add input[type=file]{padding:.3rem;font-size:.85rem}
.quote-docs-add .check{margin:0;font-weight:400;font-size:.88rem}
.pq-docs ul{margin:.3rem 0 0;padding-left:1.1rem}
.quote-time{border-left:4px solid var(--brand-2)}
.quote-time .field{margin:0}
.quote-time input.num{width:7rem}
/* Referente del preventivo */
.contact-picker{position:relative}
.cp-row{display:flex;gap:.4rem;align-items:stretch}
.cp-row input{flex:1;min-width:0}
.cp-row .cp-add{white-space:nowrap;padding:0 .8rem}
.cp-results{position:absolute;z-index:20;left:0;right:0;margin:.2rem 0 0;padding:.2rem;list-style:none;background:var(--surface);
  border:1px solid var(--line);border-radius:6px;box-shadow:0 6px 18px rgba(0,0,0,.13);max-height:18rem;overflow:auto}
.cp-results button{display:block;width:100%;text-align:left;background:none;color:var(--text);padding:.45rem .55rem;border-radius:4px}
.cp-results button:hover,.cp-results button:focus{background:var(--bg)}
.cp-results button.same strong::after{content:' · stessa azienda';font-weight:400;color:var(--ok-fg);font-size:.8rem}
.cp-results small{color:var(--muted)}
.cp-empty{padding:.5rem .6rem;color:var(--muted);font-size:.9rem}
.cp-selected{display:flex;align-items:center;gap:.5rem;padding:.4rem .5rem .4rem .7rem;border:1px solid var(--line);border-radius:6px;background:var(--bg);min-height:2.45rem}
.cp-selected .cp-email{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cp-selected .cp-name{font-weight:600}
.cp-new{margin-top:.5rem;padding:.6rem;border:1px dashed var(--line);border-radius:6px}
.cp-new-grid{display:grid;grid-template-columns:1fr 1fr 1.4fr;gap:.4rem}
.cp-new-actions{margin:.5rem 0 .2rem}
@media(max-width:600px){.cp-new-grid{grid-template-columns:1fr}}

/* Testata del preventivo: Cliente | Oggetto, poi Referente (largo) | Data | Valido fino al */
.quote-head{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.2rem 1rem;align-items:start}
.quote-head .qh-company,.quote-head .qh-subject,.quote-head .qh-contact{grid-column:span 2}
.quote-head .field{margin-bottom:.4rem}
@media(max-width:800px){.quote-head{grid-template-columns:1fr}.quote-head>*{grid-column:auto!important}}
/* Un elemento nascosto resta nascosto anche se lo stile gli dà display:flex/grid */
[hidden]{display:none!important}
/* Diario: correzione del tempo delle attività di contratto */
.exec-edit summary.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.exec-edit[open]{margin-top:.5rem;padding:.5rem .6rem;border:1px dashed var(--line);border-radius:6px;background:var(--surface)}
.exec-table td{padding:.2rem .5rem .2rem 0;border:0}
.exec-table input.exec-min,.exec-all-value{width:4.5rem;text-align:right}
.exec-actions{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap;margin:.4rem 0 .2rem}
.meeting-field .checks{margin:.3rem 0}
button.secondary.attention{border:1px solid var(--attention-line);background:var(--attention-bg);color:var(--alert-fg)}
.neg{color:#a33b3b}
.pos{color:#1f7a44}

/* Scelta esplicita dell'esito del preventivo. */
.decision-options{display:inline-flex;border:1px solid var(--border-strong);border-radius:7px;overflow:hidden;max-width:100%}
.decision-options .decision{border:0;border-radius:0;background:#f4f7f9;color:var(--maybe-grey);padding:.45rem .55rem;font-size:.78rem;white-space:nowrap;min-height:34px}
.decision-options .decision+.decision{border-left:1px solid var(--border-strong)}
.decision-options .decision.selected{font-weight:700;box-shadow:inset 0 -3px currentColor}
.decision-options .pending.selected{background:var(--warn-bg);color:var(--warn-fg)}
.decision-options .accepted.selected{background:var(--ok-bg);color:var(--ok-fg)}
.decision-options .rejected.selected{background:#fce1e1;color:#942828}
.decision-options .decision:focus-visible{outline:2px solid #166589;outline-offset:-3px}
.decision-options .decision:disabled{cursor:default;opacity:.7}
@media(max-width:700px){.quote-table .decision-options{flex-direction:column}.quote-table .decision+.decision{border-left:0;border-top:1px solid var(--border-strong)}}

/* Diario: ogni riepilogo apre le registrazioni e le azioni relative. */
.diary-editor{scroll-margin-top:1.5rem}
.diary-group{border-bottom:1px solid var(--line)}
.diary-group:last-child{border-bottom:0}
.diary-group>summary{display:grid;grid-template-columns:minmax(0,1fr) auto 1rem;align-items:center;gap:.3rem .7rem;cursor:pointer;padding:.85rem 0;list-style:none}
.diary-group>summary::-webkit-details-marker{display:none}
.diary-group>summary:focus-visible{outline:2px solid var(--brand-2);outline-offset:3px;border-radius:4px}
.diary-group>summary:hover .diary-group-label strong{color:var(--brand-2);text-decoration:underline}
.diary-group-label small{display:block;margin-top:.15rem}
.diary-group>summary .hd-bar{grid-column:1/-1;width:100%}
.diary-group[open] .diary-chevron{transform:rotate(180deg)}
.diary-group-detail{padding:.25rem .65rem .75rem;background:var(--surface-alt);border-radius:6px;margin-bottom:.65rem}
.diary-group-detail .diary-list{margin:0}
.diary-group-detail .actions a{font-size:.85rem;font-weight:600}
@media(max-width:600px){.diary-group-detail .diary-list>li{grid-template-columns:3rem minmax(0,1fr)}.diary-group-detail .actions{grid-column:2;justify-self:start}}
/* Ticket: attività registrate */
.ticket-time{list-style:none;padding:0;margin:0 0 .6rem;max-height:18rem;overflow:auto;font-size:.88rem}
.ticket-time li{display:grid;grid-template-columns:1fr auto;gap:0 .5rem;padding:.3rem 0;border-bottom:1px solid var(--line-2)}
.ticket-time li small{grid-column:1 / -1}
.ticket-time-totals{width:100%;font-size:.88rem;margin-bottom:.8rem}
.ticket-time-totals td,.ticket-time-totals th{padding:.2rem 0}
.dep-choice{display:flex;gap:.6rem;align-items:flex-start;margin:.4rem 0 .8rem}
button.danger-solid{background:#a33b3b}
/* Stato sistema */
.ss-kpis{grid-template-columns:repeat(4,1fr)}
.ss-bar{display:block;height:6px;background:var(--line-2);border-radius:3px;margin-top:.35rem;overflow:hidden}
.ss-bar span{display:block;height:100%;background:var(--brand-2)}
.row-attention .ss-bar span,.kpi.attention .ss-bar span{background:#c25e00}
.ss-checks{list-style:none;padding:0;margin:0}
.ss-checks li{display:grid;grid-template-columns:auto 1fr;gap:0 .5rem;padding:.35rem 0;border-bottom:1px solid var(--line-2)}
.ss-checks li small{grid-column:2}
.ss-dot{width:.7rem;height:.7rem;border-radius:50%;margin-top:.35rem}
.ss-checks li.ok .ss-dot{background:#1f7a44}
.ss-checks li.ko .ss-dot{background:#a33b3b}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
/* Validità delle licenze */
.validity{color:var(--info-fg)}
.validity-row{display:flex;align-items:center;gap:.3rem;margin-top:.3rem;flex-wrap:wrap}
.validity-row input{max-width:9.5rem}
.validity-row[data-empty="1"]{display:none}
.quote-row:focus-within .validity-row[data-empty="1"]{display:flex}
.space-card{border-left:4px solid var(--space,#1F6FEB)}
.space-dot{display:inline-block;width:.7rem;height:.7rem;border-radius:50%;background:var(--space,#1F6FEB);margin-right:.4rem}
/* Ticket: anteprime delle immagini e visualizzatore */
.bubble-files .img-thumb{display:inline-block;padding:0;margin:.2rem .3rem .2rem 0;border:1px solid var(--line);border-radius:6px;
  background:var(--maybe-white);cursor:zoom-in;overflow:hidden;line-height:0}
.bubble-files .img-thumb img{display:block;max-width:220px;max-height:140px;object-fit:cover}
.bubble-files .img-thumb:hover{border-color:var(--brand-2);box-shadow:0 0 0 2px rgba(228,4,28,.2)}
dialog.img-viewer{padding:0;border:0;border-radius:10px;width:min(96vw,1400px);max-height:94vh;background:var(--maybe-ink);color:var(--maybe-white)}
dialog.img-viewer::backdrop{background:rgba(9,6,20,.8)}
.iv-bar{display:flex;align-items:center;gap:.7rem;padding:.5rem .8rem;background:var(--maybe-ink)}
.iv-name{font-weight:600;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.iv-count{color:var(--border-strong);font-size:.85rem}
.iv-bar .button,.iv-bar button{padding:.3rem .7rem;font-size:.85rem}
.iv-stage{position:relative;display:flex;align-items:center;justify-content:center;height:calc(94vh - 3rem);padding:.6rem}
.iv-stage img{max-width:100%;max-height:100%;object-fit:contain;background:var(--maybe-white)}
.iv-nav{position:absolute;top:50%;transform:translateY(-50%);background:rgba(255,255,255,.15);color:var(--maybe-white);border:0;border-radius:50%;
  width:2.6rem;height:2.6rem;font-size:1.6rem;line-height:1;cursor:pointer}
.iv-nav:hover{background:rgba(255,255,255,.3)}
.iv-prev{left:.6rem}.iv-next{right:.6rem}
.bubble-files .img-row{display:flex;flex-wrap:wrap;gap:.4rem}
.bubble-files .img-row:empty{display:none}
.bubble-files .img-row .img-thumb{margin:0}
.bubble-files .img-row .img-thumb img{max-width:160px;max-height:110px}
.wf-state{background:color-mix(in srgb,var(--wf,#8A94A6) 18%,var(--maybe-white));color:color-mix(in srgb,var(--wf,#8A94A6) 70%,var(--maybe-black))}
.wf-blocked{background:var(--late-bg);color:var(--late-fg)}
.space-badge{background:color-mix(in srgb,var(--space,#1F6FEB) 15%,var(--maybe-white));color:color-mix(in srgb,var(--space,#1F6FEB) 75%,var(--maybe-black))}
.badge.prio-urgente{background:var(--late-bg);color:var(--late-fg)}.badge.prio-alta{background:var(--alert-bg);color:var(--alert-fg)}
.inline-form{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}
button.link{background:none;border:0;color:var(--late-fg);padding:0 .2rem;cursor:pointer}
/* Lavoro: lista, Kanban, avanzamento */
.badge.wf-client{background:var(--client-bg);color:var(--client-fg)}.badge.wf-late{background:var(--late-bg);color:var(--late-fg)}
.work-table tr.row-late td:first-child{box-shadow:inset 3px 0 0 var(--late-line)}.work-table tr.row-client td:first-child{box-shadow:inset 3px 0 0 var(--client-line)}
.work-table td.actions{white-space:nowrap}
.filters{margin:.4rem 0 .8rem}.filters select{max-width:13rem}
.kanban{display:flex;gap:.7rem;overflow-x:auto;padding-bottom:.6rem;align-items:flex-start}
.kanban-col{flex:0 0 15rem;background:var(--surface-alt);border-radius:8px;padding:.5rem}
.kanban-col h3{font-size:.95rem;margin:.1rem 0 .5rem}
.kanban-card{background:var(--maybe-white);border:1px solid var(--line);border-radius:6px;padding:.45rem .55rem;margin-bottom:.45rem}
.kanban-card.late{border-left:3px solid var(--late-line)}.kanban-card.client{border-left:3px solid var(--client-line)}
.kanban-card select{width:100%;margin-top:.3rem;font-size:.8rem}
.progress{height:.45rem;background:var(--soft);border-radius:4px;overflow:hidden;margin:.3rem 0}
.progress span{display:block;height:100%;background:#2da44e}
/* Lavoro: pagina progetto */
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(10rem,1fr));gap:.6rem;margin:.6rem 0 1rem}
.kpi{background:var(--maybe-white);border:1px solid var(--line);border-radius:8px;padding:.55rem .7rem}
.kpi span{display:block;font-size:.8rem;color:var(--muted)}.kpi strong{font-size:1.15rem}
.kpi.warn{border-color:var(--late-line)}.kpi.warn strong{color:#a40e26}
.phase-head{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}.phase-head .card-title{margin:0}
.phase-card details{margin-top:.4rem}
input.pct{width:4.2rem}
/* Lavoro: pagina progetto, step 1 — testata sticky, indicatori compatti, vista Fasi a spina verticale */
.project-head{position:sticky;top:60px;z-index:5;background:var(--bg);padding:.8rem 0 .7rem;margin:0 0 .9rem;border-bottom:1px solid var(--line)}
.project-head-row{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;flex-wrap:wrap}
.project-head-main{min-width:0}
.project-head-main h1{margin:.1rem 0 .35rem}
.project-head-main .crumb{margin:0 0 .2rem}
.project-head-actions{display:flex;gap:.4rem;align-items:flex-start;flex:0 0 auto;flex-wrap:wrap}
.project-edit{position:relative}
.project-edit > summary{list-style:none;cursor:pointer}
.project-edit > summary::-webkit-details-marker{display:none}
.project-edit[open] .project-edit-form{position:absolute;right:0;top:100%;margin-top:.3rem;width:min(32rem,90vw);
  background:var(--maybe-white);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow-pop);padding:1rem;z-index:6}
.project-indicators{display:flex;flex-wrap:wrap;align-items:center;gap:1rem;margin-top:.6rem}
.pi-phases{display:flex;align-items:center;gap:.6rem;flex:1 1 16rem;min-width:12rem}
.phase-segbar{flex:1;display:flex;height:.6rem;border-radius:4px;overflow:hidden;background:var(--soft);gap:2px}
.phase-segbar .seg{position:relative;display:block;background:var(--soft)}
.phase-segbar .seg i{display:block;height:100%;background:#1F6FEB}
.phase-segbar .seg.done i{background:#1A7F37}
.pi-total{font-size:1.1rem;white-space:nowrap}
.pi-stats{display:flex;flex-wrap:wrap;gap:.6rem}
.pi-stat{background:var(--maybe-white);border:1px solid var(--line);border-radius:8px;padding:.4rem .65rem;font-size:.85rem}
.pi-stat span{display:block;font-size:.72rem;color:var(--muted)}
.pi-stat strong{font-size:1rem}
.pi-stat.warn{border-color:var(--late-line)}.pi-stat.warn strong{color:#a40e26}
.phase-toolbar{margin:0 0 .5rem}
.phase-spine{position:relative;display:flex;flex-direction:column;gap:.6rem;padding-left:1.6rem}
.phase-spine::before{content:"";position:absolute;left:.95rem;top:.8rem;bottom:.8rem;width:2px;background:var(--line)}
.parallel-note{margin:-.3rem 0 -.1rem 1.6rem}
.phase-row{position:relative;background:var(--maybe-white);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow)}
.phase-row[open]{box-shadow:var(--shadow-pop)}
.phase-row.related{border-color:var(--maybe-red);box-shadow:0 0 0 1px var(--maybe-red)}
.phase-summary{list-style:none;cursor:pointer;display:flex;align-items:flex-start;gap:.7rem;padding:.7rem .9rem}
.phase-summary::-webkit-details-marker{display:none}
.phase-node{position:absolute;left:-1.6rem;top:.85rem;width:1.5rem;height:1.5rem;border-radius:50%;display:flex;align-items:center;
  justify-content:center;font-size:.78rem;font-weight:700;color:var(--maybe-white);background:var(--maybe-muted);border:2px solid var(--bg)}
.phase-node.node-done{background:#1A7F37}
.phase-node.node-doing{background:#1F6FEB}
.phase-node.node-late{background:var(--late-line)}
.phase-summary-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:.15rem}
.phase-summary-line{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}
.phase-title{font-size:1rem}
.dep-chips{display:flex;flex-wrap:wrap;gap:.3rem;margin-top:.1rem}
.dep-chip{font-size:.74rem;padding:.1rem .5rem;border-radius:12px;text-decoration:none;color:var(--text);background:var(--surface-alt)}
.dep-chip.dep-in{border:1px dashed var(--border-strong)}
.dep-chip.dep-out{border:1px solid var(--border-strong)}
.dep-chip small{color:var(--muted)}
.last-comment{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.phase-progress{flex:0 0 7rem;text-align:right}
.phase-progress .progress{width:7rem}
/* Fase: menu ⋯ (Modifica / Elimina), conferma di eliminazione, toast «Annulla», storico delle fasi eliminate */
.phase-menu{position:relative;flex:0 0 auto}
.phase-menu>summary{list-style:none;cursor:pointer;padding:0 .45rem;border-radius:var(--radius);font-weight:700;line-height:1.6}
.phase-menu>summary::-webkit-details-marker{display:none}
.phase-menu>summary:hover,.phase-menu[open]>summary{background:var(--soft)}
.phase-menu-list{position:absolute;right:0;top:100%;z-index:20;min-width:11rem;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius);box-shadow:var(--shadow-pop);padding:.3rem;display:flex;flex-direction:column}
.phase-menu-list button{background:none;border:0;color:var(--text);text-align:left;padding:.45rem .6rem;border-radius:var(--radius);cursor:pointer;font:inherit;min-height:auto}
.phase-menu-list button:hover{background:var(--soft)}
.phase-menu-list .danger-text{color:var(--late-line)}
.phase-edit-delete{margin-left:.8rem}
.phase-delete-panel{grid-column:1/-1;border:1px solid var(--late-line);border-radius:var(--radius);padding:.6rem .9rem;background:var(--surface)}
.phase-delete-panel label.check{display:inline-flex;margin:.2rem .6rem .2rem 0}
.phase-delete-panel select{max-width:100%}
.undo-toast{position:fixed;left:50%;bottom:1.2rem;transform:translateX(-50%);z-index:50;background:var(--maybe-ink);color:#fff;
  padding:.65rem 1.1rem;border-radius:var(--radius);box-shadow:var(--shadow-pop);max-width:calc(100vw - 32px)}
.undo-toast button.link{color:#fff;text-decoration:underline;font-weight:700}
.phase-history li{margin:.3rem 0}
/* display:grid su un figlio di <details> vince sulla regola nativa che lo nasconde da chiuso: va riaffermata a mano */
.phase-row:not([open]) .phase-body{display:none}
.phase-row[open] .phase-body{padding:0 .9rem .9rem 2.4rem;display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:1rem}
.phase-activities{min-width:0;overflow-x:auto}
.phase-activities details{margin-top:.4rem}
.phase-updates{border-left:1px solid var(--line);padding-left:1rem;min-width:0}
.phase-update-list{display:flex;flex-direction:column;gap:.5rem;max-height:26rem;overflow-y:auto}
.phase-add{margin-top:.6rem;border:1px dashed var(--border-strong);border-radius:10px;padding:.8rem}
.phase-add > summary{cursor:pointer;font-weight:600}
@media(max-width:800px){
  .project-head{position:static}
  .project-indicators{flex-direction:column;align-items:stretch}
  .pi-stats{display:grid;grid-template-columns:1fr 1fr}
  .project-edit[open] .project-edit-form{position:static;width:auto;box-shadow:none;margin-top:.5rem}
  .phase-spine{padding-left:1.3rem}
  .phase-node{left:-1.3rem}
  .phase-row[open] .phase-body{grid-template-columns:minmax(0,1fr);padding-left:.9rem}
  .phase-updates{border-left:0;padding-left:0;border-top:1px solid var(--line);padding-top:.6rem;margin-top:.4rem}
}
/* Lavoro: Gantt (SVG dal server) e aggiornamenti */
.gantt{display:grid;grid-template-columns:minmax(11rem,20rem) 1fr;border:1px solid var(--line);border-radius:8px;background:var(--maybe-white);overflow:hidden}
.gantt-left{border-right:1px solid var(--line);background:var(--maybe-white);position:sticky;left:0;z-index:1}
.gantt-head-left,.gantt-label{display:grid;grid-template-columns:1fr 2.2rem 4rem 2.6rem;gap:.3rem;align-items:center;padding:0 .5rem}
.gantt-head-left{height:var(--head);font-size:.78rem;color:var(--muted);border-bottom:1px solid var(--line)}
.gantt-label{height:var(--row);font-size:.84rem;text-decoration:none;color:inherit;border-bottom:1px solid var(--soft)}
.gantt-label .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gantt-label.level-0{font-weight:600;background:var(--surface-alt)}.gantt-label.level-1 .name{padding-left:.9rem}
.gantt-label.late .name{color:#a40e26}
.gantt-right{overflow-x:auto}.gantt-right svg{display:block}
.g-weekend{fill:var(--surface-alt)}.g-month{font-size:11px;fill:var(--maybe-grey);font-weight:600}.g-day{font-size:10px;fill:var(--maybe-muted)}.g-day.strong{fill:var(--maybe-grey)}
.g-rule{stroke:var(--border-strong)}.g-row{stroke:var(--soft)}.g-today{stroke:var(--late-line);stroke-width:1.5}.g-today-label{font-size:10px;fill:var(--late-line)}
.g-bar{fill:#cfe3fb;stroke:#1f6feb}.g-bar.phase{fill:#dfe3e8;stroke:var(--maybe-grey)}.g-bar.summary{fill:var(--maybe-grey);stroke:none}
.g-bar.late{stroke:var(--late-line);stroke-width:2}.g-bar.cancelled{fill:#eee;stroke:#bbb;stroke-dasharray:3 2}
.g-fill{fill:#1f6feb;opacity:.75}.g-fill.summary{fill:var(--maybe-dark);opacity:.9}
.g-dep{fill:none;stroke:var(--maybe-grey);stroke-width:1.2}.g-dep.conflict{stroke:var(--late-line)}
.g-ext circle{fill:var(--client-bg);stroke:var(--client-line)}.g-ext text{font-size:9px;fill:var(--client-fg)}
.g-finish path{fill:var(--maybe-dark)}.g-finish line{stroke:var(--maybe-dark);stroke-dasharray:4 3}
.gantt-legend .lg{display:inline-block;width:1.2rem;height:.6rem;border-radius:2px;vertical-align:middle}
.lg.bar{background:#cfe3fb;border:1px solid #1f6feb}.lg.summary{background:var(--maybe-grey)}.lg.late{border:2px solid var(--late-line)}.lg.today{width:2px;height:.9rem;background:var(--late-line)}
.comment.update .actions{margin-left:.4rem}
@media (max-width:640px){.gantt{grid-template-columns:9rem 1fr}.gantt-head-left,.gantt-label{grid-template-columns:1fr 2rem}.gantt-head-left span:nth-child(n+3),.gantt-label span:nth-child(n+3){display:none}}
/* Lavoro: pianificazione */
.shift-banner{border-left:4px solid var(--client-line);background:#fffbea}
.g-bar.preview{fill:#ffe8a3;stroke:var(--client-line)}.g-ghost{fill:none;stroke:var(--maybe-grey);stroke-dasharray:4 3}
.load{display:inline-block;min-width:3.2rem;text-align:center;border-radius:4px;padding:.1rem .3rem;font-size:.85rem}
.load-ok{background:var(--ok-bg);color:var(--ok-fg)}.load-full{background:var(--warn-bg);color:var(--warn-fg)}.load-over{background:var(--late-bg);color:var(--late-fg);font-weight:600}
.text-warn{color:#a40e26}
.absence-wrap{overflow-x:auto}.absence-grid th,.absence-grid td{padding:.2rem;min-width:1.4rem;text-align:center;font-size:.8rem}
.absence-grid td.who{text-align:left;white-space:nowrap}.absence-grid .we{background:var(--surface-alt)}
.absence-grid td.abs{background:#f8b4b0}.absence-grid td.abs.part{background:#ffd8a8}
.absence-grid tr.overlap td.one{background:var(--warn-bg)}.absence-grid tr.overlap td.many{background:#f8b4b0;font-weight:600}
a.g-drag rect.g-bar{cursor:grab}a.g-drag rect.g-bar:active{cursor:grabbing}
.workload td{text-align:center;padding:.25rem}.workload td.who{text-align:left;white-space:nowrap}
.workload a.load{text-decoration:none}.workload a.load.selected{outline:2px solid var(--maybe-dark)}
.deadline-cal td{vertical-align:top;width:14%;min-width:7rem;height:5.5rem;padding:.25rem}
.deadline-cal td.out{background:var(--surface-alt);color:#aaa}.deadline-cal td.we{background:var(--surface-alt)}.deadline-cal td.today{outline:2px solid #1f6feb}
.deadline-cal .day{font-size:.75rem;color:var(--muted)}
.deadline-cal a.dl{display:block;font-size:.78rem;margin:.1rem 0;padding:.05rem .3rem;border-radius:3px;background:#e6f0fb;color:#0b4a7a;text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.deadline-cal a.dl.late{background:var(--late-bg);color:var(--late-fg)}.deadline-cal a.dl.client{background:var(--client-bg);color:var(--client-fg)}.deadline-cal a.dl.closed{text-decoration:line-through;opacity:.6}
dialog.close-dialog{border:1px solid var(--line);border-radius:10px;padding:1rem 1.2rem;max-width:22rem}
dialog.close-dialog::backdrop{background:var(--overlay)}dialog.close-dialog input[type=number]{width:7rem;font-size:1.1rem}
/* Ticket fermi */
.stale-box{border-left:4px solid var(--client-line);background:#fffbea}.stale-box table{margin:0}
.badge.stale{background:var(--warn-bg);color:var(--warn-fg)}
tr.row-stale td:first-child{box-shadow:inset 3px 0 0 var(--client-line)}
/* Ticket: pulsanti della risposta (stessa forma, Invia celeste, Invia e chiudi verde) */
.composer-actions{display:flex;justify-content:flex-end;gap:.5rem;flex-wrap:wrap;margin-top:.5rem}
button.pill{border-radius:20px;padding:.55rem 1.2rem;font-size:.95rem;line-height:1.2;border:0;color:var(--maybe-white);cursor:pointer}
button.pill-blue{background:#1e9bd7}button.pill-blue:hover{background:#1688bf}
button.pill-green{background:#00a884}button.pill-green:hover{background:#00916f}
button.pill:disabled{opacity:.6;cursor:wait}
button.pill-yellow{background:#e8b500;color:#2b2100}button.pill-yellow:hover{background:#d4a400}
/* Chiudi senza notifica: l'eccezione, a sinistra; rosso chiarissimo (stessa misura: il bordo è un'ombra interna) */
button.pill-exception{background:#fdeeee;color:#9b1c1c;box-shadow:inset 0 0 0 1px #f3caca;min-height:2.4rem;white-space:nowrap}
button.pill-exception:hover{background:#fbe1e1}
/* Ticket: riga dei pulsanti (Chiudi senza notifica a sinistra, le tre azioni a destra; se non stanno vanno a capo) */
.composer-actions{justify-content:space-between;align-items:center}
.composer-actions .pill-exception{flex:0 0 auto}
.composer-buttons{display:flex;gap:.5rem;flex:0 1 auto;margin-left:auto;flex-wrap:wrap;justify-content:flex-end}
.composer-buttons .pill{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;min-height:2.4rem;white-space:nowrap}
.pill-plane .plane{transition:transform .2s ease-out}
.pill-plane:hover:not(:disabled) .plane{transform:translate(3px,-3px)}
.pill-plane.takeoff .plane{animation:plane-takeoff .4s ease-in forwards}
button.pill-plane.takeoff:disabled{opacity:1;cursor:default}
@keyframes plane-takeoff{0%{transform:translate(0,0);opacity:1}100%{transform:translate(48px,-22px) rotate(-8deg);opacity:0}}
@media (prefers-reduced-motion:reduce){.pill-plane .plane,.pill-plane:hover .plane{transition:none;transform:none}.pill-plane.takeoff .plane{animation:none}}
@media (max-width:520px){.composer-buttons{width:100%;justify-content:flex-end}.composer-buttons .pill{padding:.5rem .85rem;font-size:.9rem}}

/* Home: benvenuto e card-modulo (icona in riquadro con bordo rosso, titolo, contatore, link) — 4 / 2 / 1 colonne */
h1.welcome{font-size:2.3rem;margin-bottom:.2rem}
.welcome-sub{margin:0 0 1.4rem}
.module-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;margin:1rem 0 1.5rem}
.module-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-card);padding:1.1rem 1.15rem;box-shadow:var(--shadow);
  display:flex;flex-direction:column;gap:.6rem}
.module-card-head{display:flex;align-items:center;gap:.7rem}
.module-card-head .card-title{margin:0;font-size:1.05rem}
.module-card-icon{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;flex:0 0 42px;border-radius:10px;
  border:2px solid var(--maybe-red);color:var(--maybe-ink);background:var(--maybe-white)}
.module-card-icon .mod-svg{width:22px;height:22px}
.module-counter{display:flex;align-items:baseline;gap:.45rem;text-decoration:none;color:var(--maybe-grey)}
.module-counter strong{font-family:var(--font-title);font-size:1.9rem;font-weight:700;color:var(--maybe-ink);line-height:1}
.module-counter span{font-size:.85rem}
ul.module-links{list-style:none;padding:0;margin:0;border-top:1px solid var(--soft)}
ul.module-links li{border-bottom:1px solid var(--soft)}
ul.module-links a{display:block;padding:.4rem 0;font-family:var(--font-ui);font-size:.9rem;font-weight:600;text-decoration:none;color:var(--maybe-dark)}
ul.module-links a:hover{color:var(--maybe-ink);text-decoration:underline;text-decoration-color:var(--maybe-red)}
/* Home: intestazione con logo, azioni rapide, dashboard ticket */
.home-head{display:flex;align-items:center;gap:1.1rem;margin:0 0 1.4rem}
.home-head .home-logo{width:96px;height:96px;border-radius:22px;flex:0 0 96px;box-shadow:var(--shadow)}
.home-head h1.welcome{margin:0}
.home-head .welcome-sub{margin:.25rem 0 0}
.quick-actions{display:grid;grid-template-columns:repeat(var(--n,4),minmax(0,1fr));gap:.8rem;margin:0 0 1.4rem}
.quick-action{display:flex;align-items:center;gap:.8rem;min-height:88px;padding:.9rem 1rem;border-radius:var(--radius-card);
  background:var(--maybe-white);border:1px solid var(--border);box-shadow:var(--shadow);color:var(--maybe-ink);text-decoration:none;
  font-family:var(--font-ui);font-weight:700;font-size:.98rem;line-height:1.25;transition:border-color .15s,box-shadow .15s,transform .15s}
.quick-action:hover{border-color:var(--maybe-ink);box-shadow:var(--shadow-pop);transform:translateY(-1px)}
.quick-action:focus-visible{outline:none;box-shadow:var(--focus-ring)}
.qa-icon{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;flex:0 0 44px;border-radius:11px;
  background:var(--surface-alt);color:var(--maybe-ink)}
.qa-icon .act-svg{width:24px;height:24px}
.quick-action.primary{background:var(--maybe-red);border-color:var(--maybe-red);color:var(--maybe-white)}
.quick-action.primary:hover{background:var(--maybe-red-hover);border-color:var(--maybe-red-hover)}
.quick-action.primary .qa-icon{background:rgba(255,255,255,.18);color:var(--maybe-white)}
.qa-purchase .qa-icon{background:#FFF1E6;color:#C2410C}
.qa-diary .qa-icon{background:#EEF2FF;color:#4338CA}
.qa-intake .qa-icon{background:#ECFDF5;color:#047857}
.qa-quote .qa-icon{background:#F5F3FF;color:#6D28D9}
.kpi-cubes{display:grid;grid-template-columns:repeat(var(--n,4),minmax(0,1fr));gap:1rem;margin:0 0 1rem}
.kpi-cube{--cube:var(--maybe-red);--cube-soft:#FDE6E9;position:relative;display:flex;flex-direction:column;gap:.25rem;padding:1.2rem 1.15rem 1rem;
  background:var(--maybe-white);border:1px solid var(--border);border-radius:var(--radius-card);box-shadow:var(--shadow);overflow:hidden;
  color:var(--maybe-ink);text-decoration:none;transition:box-shadow .15s,transform .15s}
.kpi-cube::before{content:"";position:absolute;inset:0 0 auto 0;height:4px;background:var(--cube)}
.kpi-cube:hover{box-shadow:var(--shadow-pop);transform:translateY(-2px)}
.kpi-cube:focus-visible{outline:none;box-shadow:var(--focus-ring)}
.cube-icon{position:absolute;top:1rem;right:1rem;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;
  border-radius:11px;background:var(--cube-soft);color:var(--cube)}
.cube-icon .act-svg{width:22px;height:22px}
.cube-value{font-family:var(--font-title);font-weight:700;font-size:2.5rem;line-height:1.05;color:var(--maybe-ink);font-variant-numeric:tabular-nums;margin-top:.2rem}
.cube-label{font-family:var(--font-ui);font-weight:600;font-size:.92rem;color:var(--maybe-dark);padding-right:2.6rem}
.cube-note{font-size:.8rem;color:var(--maybe-grey)}
.cube-trend{margin-top:.35rem;font-size:.8rem;font-weight:700}
.cube-trend .muted{font-weight:400}
.cube-trend.tone-good{color:#15803D}.cube-trend.tone-bad{color:#B91C1C}.cube-trend.tone-flat{color:var(--maybe-grey)}
.cube-open,.cube-total{--cube:#E4041C;--cube-soft:#FDE6E9}
.cube-time{--cube:#7C3AED;--cube-soft:#F1EAFE}
.cube-closed{--cube:#16A34A;--cube-soft:#E7F6EC}
.cube-waiting{--cube:#0EA5E9;--cube-soft:#E2F4FC}
.week-card{margin:0 0 1.5rem}
.week-head{display:flex;align-items:center;flex-wrap:wrap;gap:.6rem 1.2rem;margin-bottom:.6rem}
.week-head .card-title{margin:0;font-size:1.1rem}
.week-range{font-family:var(--font-ui);font-size:.85rem;font-weight:400;margin-left:.3rem}
.week-legend{display:flex;gap:1rem;font-size:.88rem;color:var(--maybe-dark)}
.week-legend .lg{display:inline-flex;align-items:center;gap:.4rem}
.week-legend i{display:inline-block;width:12px;height:12px;border-radius:3px}
.lg-created i{background:#232323}.lg-closed i{background:#E4041C}
.week-nav{margin-left:auto;display:flex;gap:.4rem}
.week-nav button{min-height:2.1rem;width:2.4rem;padding:0;font-size:1.2rem;line-height:1}
.week-nav button:disabled{opacity:.4;cursor:default}
.week-chart{position:relative;height:260px}
.module-grid.compact{gap:.8rem}
.module-grid.compact .module-card{padding:.85rem .95rem;gap:.45rem}
.module-grid.compact .module-card-icon{width:34px;height:34px;flex-basis:34px;border-radius:9px}
.module-grid.compact .module-card-icon .mod-svg{width:18px;height:18px}
.module-grid.compact .module-card-head .card-title{font-size:.98rem}
.module-grid.compact .module-counter{margin-left:auto}
.module-grid.compact .module-counter strong{font-size:1.35rem}
.module-grid.compact ul.module-links a{padding:.3rem 0;font-size:.85rem}
.filter-chip{margin:.2rem 0 .8rem}
@media(max-width:1100px){.kpi-cubes{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){.quick-actions{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:640px){.home-head{flex-direction:column;align-items:flex-start;gap:.7rem}
  .home-head .home-logo{width:64px;height:64px;flex-basis:64px;border-radius:15px}
  .quick-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.quick-action{min-height:76px;padding:.75rem;font-size:.9rem;gap:.6rem}
  .qa-icon{width:38px;height:38px;flex-basis:38px}.kpi-cubes{grid-template-columns:minmax(0,1fr)}.week-chart{height:220px}}
@media(prefers-reduced-motion:reduce){.quick-action,.kpi-cube{transition:none}.quick-action:hover,.kpi-cube:hover{transform:none}}
@media(max-width:1100px){.module-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.module-grid{grid-template-columns:1fr}h1.welcome{font-size:1.8rem}}
@media(max-width:640px){.topbar .brand{font-size:1.05rem}}
@media(max-width:520px){.topbar{gap:.5rem;padding:0 .75rem}.topbar .spacer{margin-left:-.5rem}.topbar .brand{gap:.45rem;font-size:1rem}
  .topbar .brand img{width:30px;height:30px}.topbar form.inline button{padding:.4rem .6rem}}
/* Notifiche (campanella) */
.topbar .bell{position:relative;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:999px;
  color:var(--maybe-dark);text-decoration:none}
.topbar .bell:hover{background:var(--surface-alt)}
.topbar .bell-count{position:absolute;top:2px;right:0;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--maybe-red);
  color:var(--maybe-white);font-family:var(--font-ui);font-size:.68rem;font-weight:700;line-height:18px;text-align:center}
ul.notification-list{list-style:none;margin:0;padding:0}
ul.notification-list li{display:flex;flex-direction:column;gap:.15rem;padding:.6rem 0;border-bottom:1px solid var(--soft)}
ul.notification-list li:last-child{border-bottom:0}
ul.notification-list li.unread a{font-weight:700}
/* Ticket: collaboratori, menzioni, mittente non collaboratore */
.collab-chips{list-style:none;margin:0 0 .6rem;padding:0;display:flex;flex-direction:column;gap:.45rem}
.collab-chip{position:relative;display:flex;flex-direction:column;gap:.1rem;padding:.5rem 2rem .5rem .65rem;border:1px solid var(--border);
  border-radius:var(--radius);background:var(--surface-alt)}
.collab-chip .collab-name{font-weight:600}
.collab-chip small{overflow-wrap:anywhere}
.collab-origin{align-self:flex-start;font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;padding:.05rem .4rem;
  border-radius:999px;background:var(--soft);color:var(--maybe-grey)}
.collab-origin.o-cc_email{background:var(--info-bg);color:var(--info-fg)}
.collab-origin.o-menzione{background:var(--wait-bg);color:var(--wait-fg)}
.collab-actions{display:flex;flex-wrap:wrap;gap:.2rem .7rem;align-items:center}
.collab-x{position:absolute;top:.3rem;right:.3rem;min-height:0;width:1.6rem;height:1.6rem;padding:0;border-radius:999px;
  background:transparent;color:var(--maybe-grey);border:0;font-size:1.1rem;line-height:1}
.collab-x:hover{background:var(--late-bg);color:var(--maybe-red)}
.collab-add{display:flex;gap:.4rem;align-items:flex-start;margin:0 0 1rem}
.collab-add .mention-wrap{flex:1;min-width:0}
.collab-add input{width:100%}
.collab-count{font-size:.78rem;color:var(--maybe-grey);white-space:nowrap}
.badge.collab-badge{background:var(--info-bg);color:var(--info-fg)}
.mention-wrap{position:relative}
.mention-wrap textarea{width:100%}
.mention-pop{position:absolute;left:0;right:0;top:100%;z-index:40;max-height:260px;overflow:auto;margin-top:2px;background:var(--maybe-white);
  border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-pop)}
.mention-group{padding:.35rem .7rem .15rem;font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--maybe-muted)}
.mention-item{padding:.4rem .7rem;cursor:pointer;display:flex;flex-wrap:wrap;gap:.2rem;align-items:baseline}
.mention-item small{color:var(--maybe-grey)}
.mention-item.active,.mention-item:hover{background:var(--surface-alt)}
.bubble.unknown{outline:2px dashed var(--warn-line,#E0B000);outline-offset:2px}
.bubble-flag{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin:-.1rem 0 .35rem;font-size:.78rem;font-weight:700;color:var(--warn-fg,#8a5a00)}
/* Home: calendario a fogli e orologio flip (segnapunti a cartellini) */
.home-head{flex-wrap:wrap}
.home-greet{flex:1 1 auto;min-width:0}
.flip-widgets{display:flex;align-items:stretch;gap:1em;margin-left:auto;font-size:16px}
.flip-cal,.flip-clock{position:relative;display:flex;gap:.25em;padding:.75em .55em .55em;background:var(--maybe-white);
  border:1px solid var(--border);border-radius:var(--radius-card);box-shadow:var(--shadow)}
.flip-clock{flex-direction:column;justify-content:center}
.flip-rings{position:absolute;top:-.4em;left:0;right:0;display:flex;justify-content:space-around;padding:0 18%;pointer-events:none;z-index:6}
.flip-rings i{display:block;width:.42em;height:.95em;border-radius:.25em;background:linear-gradient(90deg,#8a8a92,#e6e6ea 45%,#9a9aa2);
  box-shadow:0 1px 1px rgba(0,0,0,.35)}
.fc{position:relative;display:block;flex:0 0 auto;width:var(--w);height:var(--h);perspective:18em;color:var(--maybe-white)}
.fc-half{position:absolute;left:0;right:0;height:50%;overflow:hidden;background:var(--maybe-ink);
  -webkit-backface-visibility:hidden;backface-visibility:hidden}
.fc-up{top:0;border-radius:10px 10px 0 0;transform-origin:50% 100%}
.fc-down{bottom:0;border-radius:0 0 10px 10px;transform-origin:50% 0;background:#14101F}
.fc-half>span{position:absolute;left:0;right:0;height:200%;display:flex;align-items:center;justify-content:center;line-height:1;white-space:nowrap}
.fc-up>span{top:0}.fc-down>span{bottom:0}
.fc::after{content:"";position:absolute;left:0;right:0;top:50%;height:2px;margin-top:-1px;background:#000;box-shadow:0 1px 0 rgba(255,255,255,.08);z-index:4}
.fc-text::after{height:1px;margin-top:0;background:rgba(0,0,0,.55);box-shadow:none}
.fc-leaf{z-index:3}
.fc-leaf-top{animation:fc-fold .3s ease-in forwards}
.fc-leaf-bottom{transform:rotateX(90deg);animation:fc-unfold .3s ease-out .3s forwards}
@keyframes fc-fold{to{transform:rotateX(-90deg)}}
@keyframes fc-unfold{to{transform:rotateX(0)}}
.fc-day{--w:3.3em;--h:3.7em}
.fc-day .fc-half>span{font:800 2.55em/1 var(--font-title);letter-spacing:-.02em}
.flip-cal-side{display:flex;flex-direction:column;gap:.2em}
.fc-text{--w:7.4em}
.fc-month{--h:2em}
.fc-month .fc-half>span{font:700 .95em/1 var(--font-ui);letter-spacing:.08em}
.fc-month::before{content:"";position:absolute;top:0;left:0;right:0;height:.3em;background:var(--maybe-red);border-radius:10px 10px 0 0;z-index:5}
.fc-weekday{--h:1.5em}
.fc-weekday .fc-half>span{font:700 .7em/1 var(--font-ui);letter-spacing:.1em;color:rgba(255,255,255,.85)}
.fc-weekday .fc-up,.fc-month .fc-up{border-radius:8px 8px 0 0}.fc-weekday .fc-down,.fc-month .fc-down{border-radius:0 0 8px 8px}
.flip-digits{display:flex;align-items:center;gap:.22em}
.fc-digit{--w:1.6em;--h:2.4em}
.fc-digit .fc-half>span{font:800 1.85em/1 var(--font-title);font-variant-numeric:tabular-nums}
.flip-colon{display:flex;flex-direction:column;gap:.5em;padding:0 .12em}
.flip-colon i{display:block;width:.34em;height:.34em;border-radius:50%;background:var(--maybe-red);animation:flip-colon 1s ease-in-out infinite}
@keyframes flip-colon{0%,100%{opacity:1}50%{opacity:.2}}
.flip-seconds{display:block;height:3px;margin-top:.5em;border-radius:2px;background:var(--soft);overflow:hidden}
.flip-seconds i{display:block;height:100%;background:var(--maybe-red);transform-origin:0 50%;transition:transform 1s linear}
@media(max-width:1100px){.flip-widgets{flex-basis:100%;margin-left:0}}
@media(max-width:640px){.flip-widgets{font-size:12px;gap:.8em}.home-head .flip-widgets{align-self:stretch}}
@media(prefers-reduced-motion:reduce){.fc-leaf{display:none;animation:none}.flip-colon i{animation:none}.flip-seconds i{transition:none}}
/* Assistenti Nexa e Flip: menù, pulsante rapido, pannello, chat, anteprime */
.mod-avatar{display:block;width:24px;height:24px;border-radius:50%}
.sidebar .group-items a .menu-avatar{width:20px;height:20px;border-radius:50%;vertical-align:-5px;margin-right:.45rem}
.menu-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;margin-left:.4rem;
  border-radius:999px;background:var(--maybe-red);color:var(--maybe-white);font:700 .68rem/1 var(--font-ui)}
.assistant-fab{position:fixed;right:20px;bottom:20px;z-index:60;width:64px;height:64px;min-height:0;padding:4px;border-radius:50%;
  background:var(--maybe-ink);border:2px solid var(--maybe-red);box-shadow:var(--shadow-pop);cursor:pointer}
.assistant-fab img{display:block;width:100%;height:100%;border-radius:50%}
.assistant-fab:hover{transform:translateY(-2px)}
.assistant-fab .menu-badge{position:absolute;top:-4px;right:-4px;margin:0}
.assistant-panel{position:fixed;right:20px;bottom:96px;z-index:61;width:min(420px,calc(100vw - 32px));height:min(640px,calc(100vh - 130px));
  display:flex;flex-direction:column;background:var(--maybe-white);border:1px solid var(--border);border-radius:var(--radius-card);
  box-shadow:var(--shadow-pop);overflow:hidden}
.assistant-panel[hidden]{display:none}
.assistant-panel-bar{display:flex;align-items:center;gap:.6rem;padding:.5rem .7rem;background:var(--maybe-ink);color:var(--maybe-white)}
.assistant-panel-bar a{color:var(--maybe-white);margin-left:auto}
.assistant-panel-bar button{min-height:0;padding:.2rem .5rem}
.assistant-panel iframe{flex:1;border:0;width:100%}
.assistant-panel-body{margin:0;background:var(--maybe-white)}
.assistant-chat{display:flex;flex-direction:column;gap:.8rem}
.assistant-chat.in-panel{height:100vh;padding:.6rem .7rem;box-sizing:border-box;gap:.5rem}
.assistant-head{display:flex;align-items:center;gap:.8rem}
.assistant-avatar{width:56px;height:56px;border-radius:50%;background:var(--maybe-ink);border:2px solid var(--maybe-red)}
.in-panel .assistant-avatar{width:40px;height:40px}
.assistant-id h1{margin:0;font-size:1.6rem}
.in-panel .assistant-id h1{font-size:1.15rem}
.assistant-id p{margin:.1rem 0 0}
.assistant-tools{margin-left:auto;display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.assistant-typing{font:600 .8rem var(--font-ui);color:var(--maybe-red);margin-left:.4rem}
.assistant-typing i{font-style:normal;animation:a-dot 1.2s infinite}
.assistant-typing i:nth-child(2){animation-delay:.2s}.assistant-typing i:nth-child(3){animation-delay:.4s}
@keyframes a-dot{0%,80%,100%{opacity:.2}40%{opacity:1}}
.assistant-body{display:grid;grid-template-columns:240px minmax(0,1fr);gap:1rem;align-items:start}
.in-panel .assistant-body{display:flex;flex:1;min-height:0}
.assistant-history{background:var(--maybe-white);border:1px solid var(--border);border-radius:var(--radius-card);padding:.8rem;
  display:flex;flex-direction:column;gap:.15rem;max-height:70vh;overflow:auto}
.assistant-history a{display:flex;flex-direction:column;padding:.4rem .5rem;border-radius:8px;text-decoration:none;color:var(--maybe-dark);font-size:.88rem}
.assistant-history a.active,.assistant-history a:hover{background:var(--surface-alt)}
.assistant-main{display:flex;flex-direction:column;min-width:0;background:var(--maybe-white);border:1px solid var(--border);
  border-radius:var(--radius-card);box-shadow:var(--shadow);overflow:hidden;flex:1;min-height:0}
.assistant-thread{height:min(62vh,640px);overflow:auto;padding:1rem;display:flex;flex-direction:column;gap:.6rem;background:var(--surface-alt)}
.in-panel .assistant-thread{height:auto;flex:1}
.assistant-welcome{display:flex;flex-direction:column;align-items:center;gap:.8rem}
.assistant-banner{background:var(--maybe-ink);border-radius:var(--radius-card);padding:.6rem;max-width:320px}
.assistant-banner img{display:block;width:100%;height:auto;border-radius:8px}
.in-panel .assistant-banner{max-width:220px}
.assistant-welcome .a-bubble-row{align-self:stretch}
.a-bubble-row{display:flex;align-items:flex-end;gap:.5rem;max-width:88%}
.a-bubble-row.user{align-self:flex-end;flex-direction:row-reverse}
.a-avatar{width:32px;height:32px;border-radius:50%;flex:0 0 32px;background:var(--maybe-ink)}
.a-bubble{padding:.6rem .8rem;border-radius:14px;background:var(--maybe-white);border:1px solid var(--border);white-space:pre-wrap;
  overflow-wrap:anywhere;line-height:1.45}
.a-bubble-row.user .a-bubble{background:var(--maybe-ink);color:var(--maybe-white);border-color:var(--maybe-ink)}
.a-bubble-row.error .a-bubble{background:var(--late-bg);border-color:var(--late-line);color:var(--late-fg)}
.a-quick{display:flex;flex-wrap:wrap;gap:.4rem;padding-left:2.5rem}
.a-quick button{min-height:2rem;padding:.3rem .8rem;border-radius:999px;font-size:.88rem}
.assistant-composer{display:flex;flex-direction:column;gap:.4rem;padding:.7rem;border-top:1px solid var(--border)}
.assistant-composer textarea{width:100%;resize:vertical;box-sizing:border-box}
.assistant-composer-bar{display:flex;align-items:center;gap:.6rem}
.assistant-composer-bar button{margin-left:auto}
.a-draft{align-self:stretch;background:var(--maybe-white);border:1px solid var(--border);border-left:4px solid var(--maybe-red);
  border-radius:var(--radius-card);padding:.8rem .9rem;box-shadow:var(--shadow)}
.a-draft.s-confermata{border-left-color:#16A34A}.a-draft.s-annullata{border-left-color:var(--border-strong);opacity:.75}
.a-draft-head{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}
.a-draft-head .badge{margin-left:auto}
.a-draft-op{font:700 .7rem var(--font-ui);text-transform:uppercase;letter-spacing:.06em;color:var(--maybe-white);background:var(--maybe-ink);
  padding:.15rem .45rem;border-radius:6px}
.a-draft-form label{display:flex;flex-direction:column;gap:.2rem;font-size:.85rem;font-weight:600;margin-bottom:.5rem}
.a-draft-form label.check{flex-direction:row;align-items:center;font-weight:400}
.a-draft-form input:not([type=checkbox]),.a-draft-form select,.a-draft-form textarea{width:100%;box-sizing:border-box;font-weight:400}
.a-draft-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:0 .6rem}
.a-subtasks{display:flex;flex-direction:column;gap:.35rem;margin-bottom:.3rem}
.a-subtask{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1.3fr) 9.5rem auto auto;gap:.35rem;align-items:center}
.a-draft h4{margin:.6rem 0 .3rem;font-size:.9rem}
.a-draft-actions{display:flex;justify-content:flex-end;gap:.5rem;flex-wrap:wrap}
.a-draft-result{margin:0;padding-left:1rem}
.a-draft-answers dl{display:grid;grid-template-columns:auto 1fr;gap:.2rem .8rem;font-size:.85rem;margin:.4rem 0}
.a-draft-answers dt{color:var(--maybe-grey)}
.badge.muted-badge{background:var(--soft);color:var(--maybe-grey)}
.log-msg{padding:.5rem 0;border-bottom:1px solid var(--soft)}.log-msg.user div{font-weight:600}
.log-draft{padding:.6rem;margin:.4rem 0;background:var(--surface-alt);border-radius:var(--radius)}
.log-tool pre,.log-draft pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;overflow:auto}
@media(max-width:900px){.assistant-body{grid-template-columns:1fr}.assistant-history{max-height:none;flex-direction:row;overflow-x:auto}
  .assistant-history h2{display:none}.assistant-history a{flex:0 0 auto;max-width:220px}}
@media(max-width:640px){.a-subtask{grid-template-columns:1fr 1fr}.a-subtask input[name=sub_title]{grid-column:1/-1}
  .assistant-fab{right:12px;bottom:12px;width:56px;height:56px}.assistant-panel{right:8px;left:8px;width:auto;bottom:76px}}
@media(prefers-reduced-motion:reduce){.assistant-typing i{animation:none}.assistant-fab:hover{transform:none}}
.a-sources{list-style:none;margin:0 0 0 2.5rem;padding:0;display:flex;flex-direction:column;gap:.4rem;max-width:88%}
.a-sources li{background:var(--maybe-white);border:1px solid var(--border);border-left:3px solid var(--maybe-red);border-radius:10px;
  padding:.5rem .7rem;display:flex;flex-direction:column;gap:.15rem}
.a-source-text{font-size:.85rem;color:var(--maybe-grey);white-space:pre-wrap}
.a-feedback{display:flex;gap:.1rem;align-self:flex-end}
.a-feedback button{min-height:0;padding:.1rem .25rem;font-size:.9rem;opacity:.45;background:none;border:0}
.a-feedback button.on,.a-feedback button:hover{opacity:1}
.kb-body{line-height:1.6}
/* Pagine pubbliche (admin) */
.copy-link{width:22rem;max-width:100%;font-size:.8rem}
.badge.site-online{background:#dcf4e4;color:#165d2f}.badge.site-lenta{background:#fff1c9;color:#765400}
.badge.site-giu{background:#fde2e1;color:#8a1c14}.badge.site-sconosciuto{background:var(--soft);color:var(--maybe-grey)}
fieldset.rotation{border:1px solid var(--border);border-radius:var(--radius);padding:.6rem .9rem;margin:0 0 1rem}
fieldset.rotation .check{display:flex;align-items:center;gap:.5rem;margin:.3rem 0}
fieldset.rotation input.num{width:4.5rem}

/* Utenti: barra alfabetica (iniziale del cognome) e paginazione lato server */
.alpha-bar{display:flex;flex-wrap:wrap;gap:.25rem;margin:0 0 1rem;font-family:var(--font-ui);font-size:.85rem}
.alpha-bar a,.alpha-bar span{display:inline-flex;align-items:center;justify-content:center;min-width:2rem;height:2rem;padding:0 .45rem;
  border-radius:6px;border:1px solid var(--border);background:var(--surface);color:var(--text);text-decoration:none;font-weight:600}
.alpha-bar a:hover{border-color:var(--maybe-red);color:var(--maybe-red)}
.alpha-bar a:focus-visible,.pager a:focus-visible{outline:none;box-shadow:var(--focus-ring)}
.alpha-bar a.current{background:var(--maybe-red);border-color:var(--maybe-red);color:var(--maybe-white)}
.alpha-bar .off{color:var(--border-strong);background:var(--surface-alt);cursor:default}
.pager{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;margin:.9rem 0;font-family:var(--font-ui);font-size:.9rem}
.pager-count{color:var(--muted)}
.pager-links{display:flex;gap:.25rem;align-items:center;flex-wrap:wrap}
.pager-links a,.pager-links span.off,.pager-links span.current,.pager-links span.gap,.pager-links .narrow{display:inline-flex;align-items:center;
  min-width:2.2rem;height:2.2rem;padding:0 .6rem;gap:.3rem;justify-content:center;border-radius:6px;border:1px solid var(--border);background:var(--surface);
  color:var(--text);text-decoration:none;font-weight:600}
.pager-links a:hover{border-color:var(--maybe-red);color:var(--maybe-red)}
.pager-links span.current{background:var(--maybe-red);border-color:var(--maybe-red);color:var(--maybe-white)}
.pager-links span.off{color:var(--border-strong);background:var(--surface-alt)}
.pager-links span.gap{border-color:transparent;background:none}
.pager-links .narrow{display:none}
@media(max-width:640px){
  .alpha-bar{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;padding-bottom:.3rem}
  .alpha-bar a,.alpha-bar span{flex:0 0 auto}
  .pager-links .wide,.pager-links span.wide,.pager-links a.wide{display:none}
  .pager-links .narrow{display:inline-flex;border-color:transparent;background:none}
}

/* ==== Diario a blocchi: Ticket / Contratti / Lavoro ==== */
:root{--d-ticket:#3b6fd8;--d-contratto:#0f9f8f;--d-lavoro:#8b5cf6}
.dot-ticket,.dot-contratto,.dot-lavoro{display:inline-block;width:.6rem;height:.6rem;border-radius:50%;margin-right:.45rem;vertical-align:.05rem}
.dot-ticket{background:var(--d-ticket)}.dot-contratto{background:var(--d-contratto)}.dot-lavoro{background:var(--d-lavoro)}
.d-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-bottom:.6rem}
.d-head h1{margin:0}
.d-nav{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}
.d-modes{display:inline-flex;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;background:var(--surface)}
.d-modes a{padding:.5rem .85rem;text-decoration:none;color:var(--text);font-family:var(--font-ui);font-weight:600;font-size:.9rem}
.d-modes a+a{border-left:1px solid var(--border)}
.d-modes a.active{background:var(--maybe-ink);color:var(--maybe-white)}
.d-arrow{min-width:2.4rem;padding:0 .6rem;font-size:1.2rem}
.d-new{margin-left:.4rem}
.d-period{padding:1rem 1.2rem;margin-bottom:1rem}
.d-period-top{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;flex-wrap:wrap}
.d-period-label{font-family:var(--font-title);font-weight:700;font-size:1.05rem}
.d-period-total{margin-top:.2rem}
.d-period-total strong{font-family:var(--font-title);font-size:1.5rem}
.d-bar{display:flex;height:.8rem;border-radius:1rem;overflow:hidden;background:var(--soft);margin:.8rem 0 .5rem}
.d-bar .seg-ticket{background:var(--d-ticket)}.d-bar .seg-contratto{background:var(--d-contratto)}.d-bar .seg-lavoro{background:var(--d-lavoro)}
.d-legend{display:flex;gap:1.2rem;flex-wrap:wrap;list-style:none;margin:0;padding:0;font-size:.9rem;color:var(--muted)}
.d-legend strong{color:var(--text);margin-left:.25rem}
.d-blocks{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}
.d-block{display:flex;flex-direction:column;gap:.7rem;text-align:left;cursor:pointer;font:inherit;color:inherit;border:1px solid var(--border);
  border-top:4px solid var(--c,var(--border));background:var(--surface);min-height:15rem;padding:1rem 1.1rem;transition:box-shadow .15s,transform .15s}
.d-block:hover{box-shadow:var(--shadow-pop);transform:translateY(-1px)}
.d-block:focus-visible{outline:none;box-shadow:var(--focus-ring)}
.d-block-ticket{--c:var(--d-ticket)}.d-block-contratto{--c:var(--d-contratto)}.d-block-lavoro{--c:var(--d-lavoro)}
.d-block-head{display:flex;justify-content:space-between;align-items:baseline}
.d-block-title{font-family:var(--font-title);font-weight:700;font-size:1.05rem}
.d-block-time{font-family:var(--font-title);font-weight:800;font-size:1.6rem}
.d-block-kpi{font-size:.9rem;color:var(--muted)}
.d-block-kpi strong{color:var(--text)}
.d-split{display:flex;flex-direction:column;gap:.3rem}
.d-split-row{display:grid;grid-template-columns:minmax(0,1fr) 30% 3.2rem;gap:.5rem;align-items:center;font-size:.85rem}
.d-split-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.d-split-bar{height:.4rem;border-radius:1rem;background:var(--soft);overflow:hidden}
.d-split-bar i{display:block;height:100%;background:var(--c)}
.d-split-val{text-align:right;font-variant-numeric:tabular-nums}
.d-latest{display:flex;flex-direction:column;gap:.2rem;font-size:.85rem;color:var(--muted);border-top:1px solid var(--line-2);padding-top:.5rem;margin-top:auto}
.d-latest span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.d-empty{color:var(--muted);margin:auto 0}
body.d-modal-open{overflow:hidden}
.d-modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:50;background:var(--overlay);display:flex;align-items:flex-start;justify-content:center;padding:4vh 1rem;overflow-y:auto}
.d-modal[hidden]{display:none}
.d-dialog{background:var(--surface);border-radius:var(--radius-card);box-shadow:var(--shadow-pop);width:100%;max-width:760px;display:flex;flex-direction:column;max-height:92vh}
.d-dialog-head{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;padding:1rem 1.2rem .6rem;border-bottom:1px solid var(--line-2)}
.d-dialog-head h2{margin:0;font-size:1.2rem}
.d-dialog-head p{margin:.2rem 0 0}
.d-close{background:none;color:var(--muted);border:0;font-size:1.6rem;line-height:1;min-height:auto;padding:.1rem .4rem;cursor:pointer}
.d-close:hover{color:var(--text);background:none}
.d-chips{display:flex;flex-wrap:wrap;gap:.35rem;padding:.7rem 1.2rem 0}
.chip{border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:2rem;padding:.3rem .75rem;font-size:.85rem;min-height:2rem;font-weight:600;cursor:pointer}
.chip:hover{border-color:var(--maybe-red);background:var(--surface)}
.chip.active{background:var(--maybe-ink);border-color:var(--maybe-ink);color:var(--maybe-white)}
.chip small{opacity:.7;margin-left:.2rem}
.d-dialog-body{padding:.8rem 1.2rem 1rem;overflow-y:auto}
.d-dialog-foot{display:flex;justify-content:flex-end;gap:.5rem;padding:.8rem 1.2rem;border-top:1px solid var(--line-2)}
.d-day h3{font-size:.95rem;margin:.9rem 0 .3rem;display:flex;justify-content:space-between}
.d-day:first-child h3{margin-top:0}
.d-list{list-style:none;margin:0;padding:0}
.d-entry{display:grid;grid-template-columns:3.6rem minmax(0,1fr);gap:.8rem;padding:.65rem 0;border-bottom:1px solid var(--line-2)}
.d-entry[hidden],.d-day[hidden]{display:none}
.d-dur{font-family:var(--font-title);font-weight:700;font-variant-numeric:tabular-nums}
.d-ref{font-size:.85rem;color:var(--muted)}
.d-title{font-weight:600;margin:.1rem 0}
.d-text{font-size:.9rem;color:var(--text);margin-top:.2rem}
.d-people{font-size:.85rem;color:var(--muted);margin-top:.2rem}
.d-people .declined{text-decoration:line-through}
.d-author{background:var(--wait-bg);color:var(--wait-fg)}
.d-actions{display:flex;gap:.8rem;flex-wrap:wrap;margin-top:.35rem;font-size:.85rem}
button.link{background:none;border:0;color:var(--link);text-decoration:underline;padding:0;min-height:auto;font-weight:600;cursor:pointer;font-size:inherit}
button.link:hover{background:none;color:var(--maybe-red)}
button.link.danger{color:var(--late-line)}
.d-sections{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.6rem}
.d-sections button{display:flex;flex-direction:column;align-items:flex-start;gap:.25rem;text-align:left;background:var(--surface);color:var(--text);
  border:1.5px solid var(--border);border-radius:var(--radius);padding:.7rem .8rem;font-weight:400;min-height:5.2rem;cursor:pointer}
.d-sections button strong{font-family:var(--font-title)}
.d-sections button span{font-size:.82rem;color:var(--muted)}
.d-sections button:hover{border-color:var(--border-strong);background:var(--surface)}
.d-sections button.active{border-color:var(--maybe-red);box-shadow:var(--focus-ring)}
.d-sections button:disabled{opacity:.45;cursor:default}
.d-form fieldset{border:0;padding:0;margin:.9rem 0 0}
.d-form fieldset[hidden],.d-form [hidden]{display:none}
.d-note{font-size:.85rem;color:var(--muted);background:var(--surface-alt);border-radius:6px;padding:.45rem .65rem;margin:.4rem 0 0}
.d-when{grid-template-columns:repeat(3,minmax(0,1fr))}
.d-quick{display:flex;gap:.35rem;flex-wrap:wrap;margin:-.2rem 0 .7rem}
.d-search{position:relative}
.d-results{position:absolute;left:0;right:0;top:100%;z-index:5;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  box-shadow:var(--shadow-pop);max-height:16rem;overflow-y:auto;padding:.25rem}
.d-results button{display:flex;flex-direction:column;align-items:flex-start;width:100%;text-align:left;background:none;color:var(--text);border:0;
  padding:.45rem .6rem;border-radius:6px;font-weight:600;min-height:auto}
.d-results button small{font-weight:400;color:var(--muted)}
.d-results button:hover,.d-results button:focus{background:var(--surface-alt);outline:none}
.d-results p{margin:.4rem .6rem}
.d-people-list{display:flex;flex-wrap:wrap;gap:.3rem .9rem;max-height:9rem;overflow-y:auto;border:1px solid var(--border);border-radius:var(--radius);padding:.5rem .6rem;margin-top:.35rem}
.d-people-list .check{margin:0}
.d-people-list .check[hidden]{display:none}
.d-offhours,.d-complete{align-self:end;margin-bottom:.6rem}
@media(max-width:900px){.d-blocks{grid-template-columns:minmax(0,1fr)}.d-block{min-height:0}}
@media(max-width:640px){
  .d-sections{grid-template-columns:minmax(0,1fr)}.d-sections button{min-height:0}
  .d-when{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .d-modal{padding:0}.d-dialog{max-height:100vh;border-radius:0;min-height:100vh}
  .d-nav{width:100%}.d-new{margin-left:auto}
}
.d-fix{display:inline-flex;align-items:center;gap:.4rem}
.d-fix input{width:4.2rem;min-height:1.9rem;padding:.15rem .4rem}

/* Segnalazione collegata (ticket, attività, richieste d'acquisto) */
.linked-report{display:inline-block;background:#fff3a0;color:#2b2420;border-radius:2px 2px 10px 2px;padding:.3rem .7rem;margin:.2rem 0 .6rem;box-shadow:0 3px 8px -4px rgba(0,0,0,.35);font-size:.9rem}
.linked-report a{color:inherit;font-weight:700}

/* Aiuto contestuale: icona del professore accanto al titolo, fumetto, pannello da destra */
.aiuto{position:relative;display:inline-flex;vertical-align:middle;margin-left:.5rem}
.aiuto-btn{background:none;border:0;padding:0;min-height:auto;width:44px;height:44px;display:inline-flex;align-items:center;
  justify-content:center;cursor:pointer;border-radius:50%;transition:transform .18s ease}
.aiuto-btn:hover,.aiuto-btn:focus-visible{background:none;transform:rotate(-10deg) scale(1.06)}
.aiuto-btn:focus-visible{outline:2px solid #E4041C;outline-offset:2px}
.aiuto-btn svg{width:42px;height:42px;display:block}
.aiuto-fumetto{position:absolute;left:calc(100% + 8px);top:50%;transform:translateY(-50%);white-space:nowrap;background:#1d1830;
  color:#fff;font:600 .82rem var(--font-ui);padding:.4rem .7rem;border-radius:10px;opacity:0;pointer-events:none;
  transition:opacity .15s;z-index:30;letter-spacing:0;text-transform:none}
.aiuto-fumetto::before{content:'';position:absolute;right:100%;top:50%;margin-top:-6px;border:6px solid transparent;border-right-color:#1d1830}
.aiuto-fumetto b{color:#ff8a96}
.aiuto:hover .aiuto-fumetto,.aiuto-btn:focus-visible+.aiuto-fumetto,.aiuto.mostra .aiuto-fumetto{opacity:1}
.aiuto-velo{position:fixed;inset:0;z-index:70;background:rgba(9,6,20,0);transition:background .18s}
.aiuto-velo.on{background:rgba(9,6,20,.45)}
.aiuto-velo[hidden]{display:none}
.aiuto-pannello{position:absolute;top:0;right:0;bottom:0;width:380px;max-width:100%;background:#fff;color:#1d1830;overflow-y:auto;
  padding:1.4rem 1.4rem 2rem;box-shadow:-12px 0 32px rgba(0,0,0,.2);transform:translateX(100%);transition:transform .18s ease}
.aiuto-velo.on .aiuto-pannello{transform:none}
.aiuto-pannello:focus{outline:none}
.aiuto-chiudi{position:absolute;top:.6rem;right:.7rem;background:none;color:#7A7A7A;border:0;font-size:1.7rem;line-height:1;min-height:auto;padding:.1rem .4rem}
.aiuto-chiudi:hover{background:none;color:#1d1830}
.aiuto-testa{display:flex;align-items:center;gap:.8rem;margin:0 2rem 1rem 0}
.aiuto-testa svg{width:56px;height:56px;flex:none}
.aiuto-testa small{color:#E4041C;font:700 .75rem var(--font-ui);text-transform:uppercase;letter-spacing:.06em}
.aiuto-testa h2{margin:.1rem 0 0;font-size:1.25rem;color:#1d1830}
.aiuto-pannello h3{color:#E4041C;font-size:.95rem;margin:1.2rem 0 .4rem}
.aiuto-pannello ul{padding-left:1.1rem;margin:0;display:grid;gap:.35rem}
.aiuto-testo p{margin:.4rem 0}
.aiuto-ticket{background:#E4041C;color:#fff;border-color:#E4041C}
body.aiuto-aperto{overflow:hidden}
@media (max-width:640px){.aiuto-pannello{width:100%}.aiuto-fumetto{display:none}}
@media (prefers-reduced-motion:reduce){.aiuto-btn,.aiuto-pannello,.aiuto-velo{transition:none}.aiuto-btn:hover{transform:none}}

/* Modalità super admin: pulsante nella testata e fascia rossa finché è accesa */
.super-admin-toggle button{min-height:2rem;padding:.25rem .7rem;border-radius:2rem;font-size:.8rem}
.super-admin-toggle .sa-off{background:var(--maybe-white);color:var(--maybe-dark);border:1px solid var(--border)}
.super-admin-toggle .sa-off:hover{border-color:var(--maybe-red);color:var(--maybe-red)}
.super-admin-banner{background:var(--maybe-red);color:#fff;font-weight:700;border-radius:var(--radius);padding:.5rem .8rem;margin:0 0 1rem}
@media (max-width:640px){.super-admin-toggle button{font-size:.72rem;padding:.2rem .5rem}}

/* Prenota: calendario a mezz'ore (colonne = risorse o giorni) */
.cal-wrap{overflow-x:auto}
table.cal{table-layout:fixed;min-width:640px}
table.cal th,table.cal td{border:1px solid var(--line-2);padding:0;height:1.9rem;font-size:.78rem;vertical-align:top}
table.cal thead th{padding:.4rem;font-size:.85rem;text-align:left}
table.cal .cal-time{width:4rem;text-align:right;padding:.2rem .4rem;color:var(--muted);font-weight:400}
table.cal td a{display:block;height:100%;min-height:1.9rem;color:inherit;text-decoration:none;padding:.15rem .3rem}
.cal-libera{background:#fff}.cal-libera a:hover,.cal-libera a:focus{background:var(--ok-bg);outline:none}
.cal-chiusa{background:var(--surface-alt)}
.cal-mia{background:#dcebfb;color:#1c4f8a}.cal-occupata{background:#f1e8fb;color:#4b2a8a;padding:.15rem .3rem!important}
.cal-attesa{background:repeating-linear-gradient(45deg,#fff1c9,#fff1c9 6px,#fffaf0 6px,#fffaf0 12px);color:#765400;padding:.15rem .3rem!important}
.cal-ferma{background:repeating-linear-gradient(45deg,#e5e5e9,#e5e5e9 6px,#f3f3f5 6px,#f3f3f5 12px);color:var(--muted);padding:.15rem .3rem!important}
.cal-legend{display:flex;gap:.5rem;flex-wrap:wrap;font-size:.8rem}
.cal-legend span{padding:.1rem .5rem;border-radius:4px;border:1px solid var(--line-2)}
.booking-row{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;border-bottom:1px solid var(--line-2);padding:.5rem 0}
.booking-actions{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}
.badge.bst-confermata{background:var(--ok-bg);color:var(--ok-fg)}.badge.bst-in_attesa{background:var(--warn-bg);color:var(--warn-fg)}
.badge.bst-rifiutata,.badge.bst-annullata{background:var(--soft);color:var(--maybe-grey)}
.downtime{border-bottom:1px solid var(--line-2);padding:.4rem 0}
.cal-problem{text-decoration:none;color:var(--muted);margin-left:.2rem}.cal-problem:hover{color:var(--maybe-red)}
.usage-bar{display:inline-block;width:5rem;height:.5rem;background:var(--soft);border-radius:1rem;overflow:hidden;vertical-align:middle}.usage-bar i{display:block;height:100%;background:var(--maybe-red)}
.menu-heading{display:block;padding:.6rem .9rem .15rem;font-size:.68rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;opacity:.55}

/* Scheda persona (Anagrafiche › Persone): testata, quattro card numerate, sedi a card, barra di salvataggio */
.crumb{color:var(--muted);font-size:.85rem;margin:0 0 .8rem}.crumb a{color:inherit}
.person-head{background:#fff;border:1px solid #e6e3ee;border-radius:14px;padding:1.2rem 1.4rem;display:flex;gap:1.1rem;align-items:center;flex-wrap:wrap}
.person-head h1{margin:0;font-size:1.5rem}
.person-avatar{width:64px;height:64px;border-radius:50%;background:#fde4e7;color:#E4041C;display:grid;place-items:center;font:800 1.4rem var(--font-title);flex:none}
.person-meta{color:var(--muted);margin-top:.3rem;display:flex;gap:.8rem;flex-wrap:wrap;align-items:center;font-size:.9rem}
.person-sp{flex:1}
.pbadge{display:inline-flex;align-items:center;gap:.3rem;font-size:.75rem;font-weight:700;padding:.15rem .55rem;border-radius:1rem;background:#eef0ff;color:#3b3f9e}
.pbadge.ok{background:#e5f8ec;color:#137a3a}.pbadge.ms{background:#e8f1fb;color:#1a5fa8}.pbadge.cli{background:#fff3d6;color:#8a5a00}
.pbadge.off{background:var(--soft);color:var(--maybe-grey)}.pbadge.sa{background:#fde4e7;color:#b0031a}
.person-tabs{margin:1.2rem 0 1rem}
.pgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
.pcard{background:#fff;border:1px solid #e6e3ee;border-radius:14px;padding:1.2rem 1.35rem;min-width:0}
.pcard.full{grid-column:1/-1}
.pcard h2{font-size:1rem;display:flex;align-items:center;gap:.5rem;margin:0 0 .25rem}
.pcard h2 .aiuto{margin-left:auto}.pcard h2 .aiuto-btn{width:32px;height:32px}.pcard h2 .aiuto-btn svg{width:30px;height:30px}
.pcard h2 .aiuto-fumetto{left:auto;right:calc(100% + 8px)}.pcard h2 .aiuto-fumetto::before{right:auto;left:100%;border-right-color:transparent;border-left-color:#1d1830}
.pn{width:24px;height:24px;border-radius:50%;background:#1d1830;color:#fff;font-size:.75rem;display:grid;place-items:center;flex:none}
.pdesc{color:var(--muted);font-size:.85rem;margin:0 0 .9rem}
.pro{display:grid;grid-template-columns:8rem 1fr;row-gap:.6rem;column-gap:.8rem;align-items:center;margin:0}
.pro dt{color:var(--muted)}.pro dd{margin:0;font-weight:600;display:flex;align-items:center;gap:.5rem;overflow-wrap:anywhere}
.lock{font-size:.7rem;font-weight:600;color:#1a5fa8;background:#e8f1fb;border-radius:4px;padding:.05rem .4rem;white-space:nowrap}
.pf{display:block;font-weight:600;margin:.8rem 0 .35rem}
.pcard select{width:100%}
.pnote{font-size:.78rem;color:var(--muted);margin-top:.35rem;display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}
.plink{color:#E4041C;background:none;border:0;font:inherit;font-size:.78rem;cursor:pointer;padding:0;text-decoration:underline;min-height:auto}
.plink:hover{background:none}
.psedi{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5rem}
.psede{border:1px solid #e6e3ee;border-radius:10px;padding:.6rem .75rem;display:flex;align-items:center;gap:.6rem;cursor:pointer;user-select:none;margin:0;font-weight:400}
.psede input{accent-color:#E4041C;width:16px;height:16px}
.psede .nome{flex:1;font-weight:600}.psede .tipo{display:block;font-size:.7rem;color:var(--muted);font-weight:400}
.psede.sel{border-color:#E4041C;background:#fff6f7}
.psede .star{border:0;background:none;font-size:1.15rem;cursor:pointer;color:#cfcbd9;padding:0 .1rem;min-height:auto;visibility:hidden}
.psede.sel .star{visibility:visible}.psede .star.on{color:#f5b800}.psede .star:hover{background:none}
.pleg{font-size:.8rem;color:var(--muted);margin-top:.6rem}
.ptwo{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1.2rem}
.pchips{display:flex;flex-wrap:wrap;gap:.35rem}
.pchip{border:1px solid #e6e3ee;border-radius:2rem;padding:.3rem .65rem;font-size:.82rem;background:#fff;display:inline-flex;gap:.35rem;align-items:center;margin:0;font-weight:400;text-decoration:none;color:inherit}
.pchip.on,.pchip-check:has(input:checked){background:#1d1830;color:#fff;border-color:#1d1830}
.pchip-check input{accent-color:#E4041C;margin:0}
.priep{background:#faf9fc;border:1px solid #e6e3ee;border-radius:10px;padding:.8rem 1rem;align-self:start}
.priep ul{margin:.4rem 0 0;padding-left:1.1rem;line-height:1.6;font-size:.88rem}.priep li.no{color:var(--muted);text-decoration:line-through}
.psave{position:fixed;left:0;right:0;bottom:0;z-index:40;background:#fff;border-top:1px solid #e6e3ee;padding:.75rem 2rem;display:flex;align-items:center;gap:.75rem;
  transform:translateY(100%);transition:transform .2s;box-shadow:0 -6px 20px rgba(0,0,0,.06)}
.psave.show{transform:none}.psave .dot{width:8px;height:8px;border-radius:50%;background:#f5b800}
#person-form{padding-bottom:4.5rem}
@media (max-width:900px){.pgrid,.ptwo{grid-template-columns:minmax(0,1fr)}.psedi{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:520px){.psedi{grid-template-columns:minmax(0,1fr)}.pro{grid-template-columns:minmax(0,1fr)}.psave{padding:.6rem 1rem}}
@media (prefers-reduced-motion:reduce){.psave{transition:none}}

/* Barra in alto: Segnalazioni (Einstein) e Super admin (corona: grigia spenta, dorata accesa) */
.top-reports{display:inline-flex;align-items:center;gap:.35rem;text-decoration:none;color:var(--maybe-dark);font:600 .85rem var(--font-ui);
  border:1px solid var(--border);border-radius:2rem;padding:.2rem .7rem .2rem .35rem;position:relative;min-height:2rem}
.top-reports:hover,.top-reports[aria-current]{border-color:var(--maybe-red)}
.top-reports .einstein{width:24px;height:24px;flex:none}
.top-reports .bell-count{position:absolute;top:-6px;right:-6px}
.super-admin-toggle button{display:inline-flex;align-items:center;gap:.35rem}
.corona{fill:none;stroke:currentColor;stroke-width:1.8;flex:none}
.super-admin-toggle .sa-off .corona{color:#9a96a8}
.super-admin-toggle .sa-on{background:#1d1830;color:#fff}
.super-admin-toggle .sa-on .corona{fill:#f5b800;stroke:#f5b800}
.time-fix{display:inline-flex;gap:.3rem;align-items:center;margin-left:.4rem}.time-fix input{width:4rem;padding:.1rem .3rem}
@media (max-width:760px){.top-label{display:none}.top-reports{padding:.2rem .35rem}}

/* Ticket aziendali e riga Collaboratori del nuovo ticket */
.badge.company-badge{background:#fff3d6;color:#8a5a00}
.client-collab{margin-top:1rem}
.new-collab{position:relative}
.chip-input{display:flex;flex-wrap:wrap;gap:.3rem;align-items:center;border:1px solid var(--border);border-radius:var(--radius);padding:.3rem .4rem;background:#fff}
.chip-input input{border:0;flex:1 1 12rem;min-width:8rem;padding:.25rem;outline:none}
.chip-input .chips{display:contents}
.chip-item{display:inline-flex;align-items:center;gap:.25rem;background:var(--soft);border-radius:2rem;padding:.15rem .3rem .15rem .6rem;font-size:.85rem}
.chip-item button{background:none;color:var(--muted);border:0;min-height:auto;padding:0 .3rem;font-size:1rem}
.company-wide{margin-top:.6rem}
.notify-company{display:flex;flex-direction:column;gap:.35rem;margin-top:.6rem}

/* Acquisti: chi deve agire, stato per riga, richieste, «Chiedi acquisto» */
.ball{display:flex;flex-wrap:wrap;gap:.3rem .8rem;align-items:baseline;border-radius:var(--radius);padding:.8rem 1rem;margin:0 0 1rem;font-size:1.02rem}
.ball-manager{background:var(--warn-bg);color:var(--warn-fg)}
.ball-maybe{background:var(--info-bg);color:var(--info-fg)}
.ball-done{background:var(--ok-bg);color:var(--ok-fg)}
.ball-no{background:var(--bad-bg);color:var(--bad-fg)}
.ball-off{background:var(--soft);color:var(--muted)}
.lstate{display:inline-block;font-size:.85rem;font-weight:600;border-radius:2rem;padding:.1rem .6rem}
.lstate-manager{background:var(--warn-bg);color:var(--warn-fg)}
.lstate-maybe{background:var(--info-bg);color:var(--info-fg)}
.lstate-done{background:var(--ok-bg);color:var(--ok-fg)}
.lstate-no{background:var(--bad-bg);color:var(--bad-fg)}
.lstate-off{background:var(--soft);color:var(--muted)}
.req-list{display:flex;flex-direction:column;gap:.6rem}
.req-card{display:block;text-decoration:none;color:var(--text)}
.req-card:hover{border-color:var(--maybe-ink)}
.req-head{display:flex;flex-wrap:wrap;gap:.4rem .7rem;align-items:center}
.req-lines{list-style:none;margin:.5rem 0 0;padding:0;display:flex;flex-direction:column;gap:.3rem}
.req-lines li{display:flex;flex-wrap:wrap;gap:.4rem .8rem;align-items:center;justify-content:space-between}
.req-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:1rem;align-items:start}
.req-line-head{display:flex;flex-wrap:wrap;gap:.5rem 1rem;align-items:center;justify-content:space-between}
.req-line-head .card-title{margin:0}
.req-actions{display:flex;flex-direction:column;gap:.4rem;border-top:1px solid var(--border);padding-top:.6rem;margin-top:.6rem}
.req-act summary{cursor:pointer;font-weight:600}
.req-act form{display:flex;flex-direction:column;gap:.4rem;padding:.5rem 0}
.req-act form.grid-3{display:grid}
.req-act label.short input{max-width:9rem}
.proposal-new{display:none}
.proposal:has(input[name=nuovo]:checked) .proposal-new{display:grid}
.timeline{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.45rem;font-size:.88rem}
.timeline time{color:var(--muted);font-size:.8rem;margin-right:.3rem}
.timeline li.internal{color:var(--muted)}
.buy-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:1rem;align-items:start}
.buy-layout aside{position:sticky;top:1rem}
.buy-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:.6rem}
.buy-item{display:flex;flex-direction:column;gap:.25rem;border:1px solid var(--border);border-radius:var(--radius);padding:.6rem .7rem;background:var(--surface,#fff)}
.buy-item.stock{border-color:var(--ok-fg);background:var(--ok-bg)}
.buy-item.stock.maybe{border-style:dashed}
.buy-item button{align-self:flex-start;margin-top:auto}
.buy-item[hidden]{display:none}
.cart-lines{list-style:none;margin:0 0 .6rem;padding:0;display:flex;flex-direction:column;gap:.6rem}
.cart-line{border:1px solid var(--border);border-radius:var(--radius);padding:.5rem .6rem;display:flex;flex-direction:column;gap:.3rem}
.cart-name{font-weight:600}
.cart-fields{display:grid;grid-template-columns:70px 1fr 1fr;gap:.4rem}
.cart-line label{font-size:.82rem;margin:0}
.cart-line .c-del{align-self:flex-end;font-size:.82rem}
.badge.piece-disponibile{background:var(--ok-bg);color:var(--ok-fg)}
.badge.piece-impegnato{background:var(--info-bg);color:var(--info-fg)}
.badge.piece-assegnato{background:var(--soft);color:var(--text)}
.badge.piece-guasto{background:var(--alert-bg);color:var(--alert-fg)}
.person-equipment ul{margin:.3rem 0;padding-left:1.1rem}
@media (max-width:900px){.req-layout,.buy-layout{grid-template-columns:minmax(0,1fr)}.buy-layout aside{position:static}
  .cart-fields{grid-template-columns:70px 1fr}}
.buy-section label,.req-act form label:not(.check),.buy-cart label{display:flex;flex-direction:column;gap:.2rem;font-weight:600;font-size:.9rem;margin:0}
.buy-section label input,.req-act form label:not(.check) input,.req-act form label:not(.check) select,.req-act form label:not(.check) textarea{width:100%}
.req-act form .short{max-width:10rem}
.req-act form button[type=submit]:not(.danger){align-self:flex-start}

/* Lista ticket: aggiornamento automatico */
.live-refresh{display:inline-flex;align-items:center;gap:.4rem;margin-right:.4rem}
.live-timer{display:inline-flex;align-items:center;gap:.45rem;background:none;border:1px solid var(--border);border-radius:var(--radius);
  padding:.25rem .6rem;color:var(--text);font:inherit;cursor:pointer;min-height:auto;text-align:left}
.live-timer:hover{border-color:var(--maybe-ink)}
.live-text{display:flex;flex-direction:column;line-height:1.15}
.live-text #live-label{font-size:.86rem;font-weight:600;font-variant-numeric:tabular-nums}
.live-text small{font-size:.72rem;color:var(--muted)}
.live-ring{transform:rotate(-90deg);flex:none}
.live-ring-bg{fill:none;stroke:var(--soft);stroke-width:3}
.live-ring-fg{fill:none;stroke:var(--maybe-red);stroke-width:3;stroke-linecap:round;transition:stroke-dashoffset .9s linear}
.live-arrow{fill:none;stroke:var(--muted);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transform:rotate(90deg);transform-origin:18px 18px}
.live-refresh.is-paused .live-timer,.live-refresh.is-waiting .live-timer{color:var(--muted)}
.live-refresh.is-paused .live-ring-fg,.live-refresh.is-waiting .live-ring-fg{stroke:var(--muted)}
.live-refresh.is-error #live-label{color:var(--alert-fg)}
.live-pause{min-height:auto}
.live-news{position:sticky;top:.5rem;z-index:5;display:block;margin:0 auto .5rem;background:var(--maybe-ink);color:var(--maybe-white);
  border:0;border-radius:2rem;padding:.35rem .9rem;font-size:.85rem;cursor:pointer;box-shadow:0 4px 12px rgba(0,0,0,.2)}
.live-news[hidden]{display:none}
#ticket-table tr.row-fresh td{animation:row-fresh 6s ease-out}
@keyframes row-fresh{0%,40%{background:var(--warn-bg)}100%{background:transparent}}
@media (prefers-reduced-motion:reduce){.live-ring-fg{transition:none}#ticket-table tr.row-fresh td{animation:none;background:var(--warn-bg)}}
@media (max-width:640px){.live-text small{display:none}}

/* Progetti (elenco): una barra azioni, contatori-filtro, segnali di ritardo / da chiudere, card su telefono */
.pl-filters .pl-search{flex:1 1 12rem;min-width:12rem}
.pl-filters select{width:auto}
.pl-filters .pl-closed{white-space:nowrap}
.pl-filters .pl-calendar{margin-left:auto;white-space:nowrap}
.pl-counters{display:flex;gap:.5rem;flex-wrap:wrap;margin:0 0 .8rem}
.pl-counter{display:inline-flex;gap:.4rem;align-items:baseline;padding:.35rem .8rem;border:1px solid var(--line);border-radius:999px;
  background:var(--surface);text-decoration:none;color:var(--text);font-size:.9rem}
.pl-counter strong{font-family:var(--font-title);font-size:1.05rem}
.pl-counter:hover,.pl-counter.active{border-color:var(--maybe-red)}
.pl-counter.active{background:var(--soft)}
.pl-counter.attention{border-color:var(--alert-fg);color:var(--alert-fg)}
.pl-row[data-href]{cursor:pointer}
.pl-row:hover td{background:var(--row-hover)}
.pl-late .pl-due{color:var(--alert-fg);font-weight:700}
.pl-late td{background:var(--alert-bg)}
.pill{display:inline-block;border-radius:999px;padding:.05rem .55rem;font-size:.72rem;font-weight:700;white-space:nowrap}
.pl-pill-late{background:var(--alert-bg);color:var(--alert-fg);border:1px solid var(--alert-fg)}
.pl-pill-close{background:var(--ok-bg);color:var(--ok-fg)}
.pl-progress{min-width:9rem}
.pl-table th a{color:inherit;text-decoration:none}
.pl-table th a:hover{text-decoration:underline}
@media(max-width:700px){
  .pl-filters .pl-search,.pl-filters select{flex:1 1 100%;width:100%;min-width:0}
  .pl-filters .pl-calendar{margin-left:0}
  .pl-table thead{display:none}
  .pl-table table,.pl-table tbody{display:block}
  .pl-table tr{display:block;border-bottom:1px solid var(--line);padding:.6rem 0}
  .pl-table td{display:flex;gap:.6rem;border:0;padding:.15rem .2rem;background:none!important}
  .pl-table td[data-label]::before{content:attr(data-label);flex:0 0 6.5rem;color:var(--muted);font-size:.8rem}
  .pl-table td[data-label="Progetto"]{display:block}
  .pl-table td[data-label="Progetto"]::before,.pl-table td[data-label="Responsabile"]{display:none}
  .pl-late{border-left:3px solid var(--alert-fg)}
  .pl-table td.pl-progress{flex-wrap:wrap;align-items:center}
  .pl-table td.pl-progress .progress{flex:1 1 8rem;min-width:6rem}
}


/* Wizard «Nuovo progetto» */
.wz-steps ol{display:flex;gap:.3rem;list-style:none;margin:.5rem 0 1rem;padding:0;overflow-x:auto;scrollbar-width:thin}
.wz-steps li{flex:1 0 auto}
.wz-step{display:flex;align-items:center;gap:.4rem;width:100%;background:var(--surface);color:var(--muted);border:1px solid var(--border);border-radius:8px;padding:.35rem .6rem;font-weight:600;font-size:.82rem;min-height:2.2rem}
.wz-step .n{display:inline-grid;place-items:center;width:1.4rem;height:1.4rem;border-radius:50%;background:var(--soft);font-size:.75rem}
.wz-step.active{border-color:var(--maybe-red);color:var(--text)}.wz-step.active .n{background:var(--maybe-red);color:#fff}
.wz-step.is-done .n{background:var(--ok-bg);color:var(--ok-fg)}
.wz-step:hover{background:var(--row-hover)}
.wz-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:.8rem}
.wz-choice{display:flex;flex-direction:column;gap:.3rem;text-align:left;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:10px;padding:1rem;font-weight:400}
.wz-choice strong{font-size:1rem}.wz-choice span{color:var(--muted);font-size:.85rem}
.wz-choice.active{border-color:var(--maybe-red);box-shadow:var(--focus-ring)}
.wz-choice.disabled{opacity:.6}
.wz-wide{grid-column:1/-1}
.wz-similar{margin-top:.3rem;background:var(--info-bg);color:var(--info-fg);border-radius:6px;padding:.35rem .6rem}
.wz-checks{display:flex;flex-wrap:wrap;gap:.2rem 1rem}
.wz-tags{display:flex;flex-wrap:wrap;gap:.3rem;margin-bottom:.35rem}
.wz-grid input,.wz-grid select{width:100%;min-width:6rem}
.wz-plan{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:1rem;align-items:start}
.wz-pane,.wz-phase,.wz-act,.wz-phase-head{min-width:0}
.wz-phase{border:1px solid var(--border);border-radius:10px;padding:.6rem;margin-bottom:.7rem;background:var(--surface)}
.wz-phase-head,.wz-act{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem}
.wz-phase-head .wz-phase-title{flex:1 1 12rem;font-weight:700}
.wz-num{display:inline-grid;place-items:center;min-width:1.6rem;height:1.6rem;border-radius:6px;background:var(--soft);font-weight:700;font-size:.8rem}
.wz-tools{margin-left:auto;white-space:nowrap;display:inline-flex;gap:.5rem}
.wz-phase-deps{display:flex;flex-wrap:wrap;gap:.3rem 1rem;align-items:center;margin:.35rem 0}
.wz-acts{list-style:none;margin:.3rem 0;padding:0}
.wz-act{padding:.3rem 0;border-top:1px solid var(--line-2)}
.wz-act .wz-act-title{flex:1 1 12rem}
.wz-act.is-done .wz-act-title{text-decoration:line-through;color:var(--muted)}
.wz-days{width:4.2rem}
.wz-deps summary{cursor:pointer}
.wz-deps summary span{color:var(--muted)}
.wz-deps-list{display:flex;flex-direction:column;max-height:14rem;overflow:auto;padding:.3rem .5rem;border:1px solid var(--line-2);border-radius:6px;background:var(--head)}
.wz-quick{width:100%;margin-top:.3rem}
.wz-paste textarea{width:100%}
.wz-plan-gantt{position:sticky;top:5rem;border:1px solid var(--border);border-radius:10px;padding:.6rem;background:var(--head)}
.wz-g-row{display:grid;grid-template-columns:minmax(0,9rem) 1fr;gap:.4rem;align-items:center;font-size:.78rem;padding:.1rem 0}
.wz-g-row.level-0{font-weight:700}.wz-g-row.level-1 .wz-g-name{padding-left:.6rem}
.wz-g-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wz-g-track{position:relative;height:.8rem;background:var(--soft);border-radius:4px}
.wz-g-track i{position:absolute;top:0;bottom:0;border-radius:4px;background:var(--maybe-ink)}
.wz-g-row.level-0 .wz-g-track i{background:var(--maybe-red)}
.wz-g-row.is-done .wz-g-track i{background:var(--ok-fg);opacity:.6}
.wz-decision,.wz-table{border:1px solid var(--border);border-radius:10px;padding:.7rem;margin-bottom:.7rem}
.wz-sum{border-top:1px solid var(--line-2);padding:.4rem 0}
.wz-sum h3{display:flex;align-items:baseline;gap:.6rem;font-size:1rem;margin:.4rem 0}
.wz-counts{margin-bottom:.8rem}
.wz-md h3,.wz-md h4,.wz-md h5{margin:.7rem 0 .3rem}
.wz-nav{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:flex-end;position:sticky;bottom:0;background:var(--bg);padding:.6rem 0;border-top:1px solid var(--border)}
.wz-nav #wz-prev{margin-right:auto}
.wz-discard{text-align:right;margin-top:.5rem}
@media (max-width:860px){.wz-plan{grid-template-columns:minmax(0,1fr)}.wz-plan-gantt{position:static}}
@media (max-width:640px){
  .wz-step .l{display:none}.wz-step.active .l{display:inline}
  .wz-act select,.wz-phase-head select{flex:1 1 100%;min-width:0}
  .wz-act input,.wz-phase-head input{min-width:0;max-width:100%}
  .wz-act input[type=date]{flex:1 1 8rem}
  .wz-grid thead{display:none}.wz-grid tr{display:block;border-bottom:1px solid var(--line-2);padding:.3rem 0}.wz-grid td{display:block;border:0;padding:.15rem 0}
  .wz-grid td[data-label]::before{content:attr(data-label);display:block;font-size:.72rem;color:var(--muted)}
  .wz-nav button{flex:1 1 40%}
}

/* Scheda del progetto */
.project-objective{color:var(--muted);margin:.2rem 0 .4rem;max-width:60rem}
.scheda-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:0 1rem}
.scheda-section h2 .small{font-weight:400}
.scheda-empty{color:var(--muted);font-size:.875rem}
.scheda-tags{display:flex;flex-wrap:wrap;gap:.3rem}
.comp-status{font-size:.78rem}
.comp-status.st-in_uso,.comp-status.st-pronto{background:var(--ok-bg);color:var(--ok-fg)}
.comp-status.st-da_verificare{background:var(--warn-bg);color:var(--warn-fg)}
.drafts-banner{display:flex;flex-wrap:wrap;gap:.4rem 1rem;align-items:center}
.message.info{background:var(--info-bg);color:var(--info-fg)}

/* Pill generiche */
.pill{display:inline-flex;align-items:center;gap:.25rem;border-radius:999px;padding:.12rem .6rem;font-size:.78rem;font-weight:600;background:var(--soft);color:var(--maybe-dark);line-height:1.4;vertical-align:middle}
.pill button.link{min-height:0;text-decoration:none;font-size:.9rem}
.pill.st-in_lavorazione{background:var(--info-bg);color:var(--info-fg)}
.pill.st-in_pausa{background:var(--warn-bg);color:var(--warn-fg)}
.pill.st-completato{background:var(--ok-bg);color:var(--ok-fg)}
.pill.prio-alta,.pill.prio-urgente,.pill.late,.pill.wf-late{background:var(--alert-bg);color:var(--alert-fg)}

/* Testata compatta del progetto */
.ph-compact{display:block;margin-bottom:.4rem}
.ph-row1{display:flex;justify-content:space-between;align-items:center;gap:.5rem;min-height:2.2rem}
.ph-row1 .crumb{margin:0}
.ph-actions{display:flex;gap:.4rem;align-items:center}
.ph-menu,.pc-menu{position:relative}
.ph-menu > summary,.pc-menu > summary{list-style:none;cursor:pointer}
.ph-menu > summary::-webkit-details-marker,.pc-menu > summary::-webkit-details-marker{display:none}
.ph-menu-list,.pc-menu-list{position:absolute;right:0;top:calc(100% + .3rem);z-index:20;min-width:13rem;background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:var(--shadow-pop);padding:.3rem;display:flex;flex-direction:column}
.ph-menu-list a,.ph-menu-list button,.pc-menu-list a,.pc-menu-list button{display:block;width:100%;text-align:left;background:none;border:0;color:var(--text);font-weight:500;font-size:.88rem;padding:.45rem .6rem;border-radius:6px;min-height:0;text-decoration:none}
.ph-menu-list a:hover,.ph-menu-list button:hover,.pc-menu-list a:hover,.pc-menu-list button:hover{background:var(--row-hover)}
.ph-menu-list form,.pc-menu-list form{margin:0}
.ph-title{font-size:1.6rem;margin:.2rem 0 .3rem;display:flex;flex-wrap:wrap;align-items:baseline;gap:.3rem .6rem}
.ph-title small{font-size:.85rem;font-weight:500}
.project-objective{color:var(--muted);margin:.1rem 0 .5rem;max-width:60rem}
.ph-line{display:flex;flex-wrap:wrap;align-items:center;gap:.3rem 1.4rem;color:var(--muted);margin:.2rem 0 .8rem}
.ph-line strong{color:var(--text)}
.ph-line .ph-late strong{color:#b35900}
.ph-progress{display:inline-flex;align-items:center;gap:.5rem}
.ph-progress .phase-segbar{flex:none;width:10rem;height:.45rem}
.ph-tabs{display:flex;align-items:flex-end;justify-content:space-between;gap:.5rem 1rem;flex-wrap:wrap;border-bottom:1px solid var(--line);margin:0 0 1rem}
.ph-tabs .tabs{border-bottom:0;margin:0}
.ph-tabs .tabs a{text-transform:none;letter-spacing:0;font-size:.92rem}
.ph-views{color:var(--muted);padding-bottom:.55rem}
.ph-views a.active{font-weight:700;color:var(--text)}

/* Fasi a fisarmonica */
.fasi{max-width:1100px}
.fasi-top{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;margin-bottom:.8rem}
.fasi-toggle{white-space:nowrap;padding-top:.45rem}
.decisions-bar{background:#fff7ed;border:1px solid #fed7aa;border-radius:10px;padding:.45rem .8rem;font-size:.9rem;color:#9a3412}
.decisions-bar > summary{cursor:pointer;list-style:none}
.decisions-bar > summary::-webkit-details-marker{display:none}
.decisions-bar .dot{display:inline-block;width:.5rem;height:.5rem;border-radius:50%;background:#c2410c;vertical-align:middle}
.decisions-bar .db-more{font-weight:600;margin-left:.3rem}
.decisions-bar[open] .db-more{display:none}
.decisions-bar ul{margin:.5rem 0 .2rem 1rem;color:var(--text)}
.fcard{background:var(--surface);border:1px solid var(--border);border-radius:12px;margin:0 0 1.1rem;box-shadow:var(--shadow);transition:box-shadow .15s}
.fcard[open]{box-shadow:var(--shadow-pop)}
.fcard-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto auto;gap:.2rem 1rem;align-items:start;padding:1rem 1.1rem;cursor:pointer;list-style:none;border-radius:12px}
.fcard-head::-webkit-details-marker{display:none}
.fcard-head:focus-visible{outline:none;box-shadow:var(--focus-ring)}
.pc-node{display:grid;place-items:center;width:2.1rem;height:2.1rem;border-radius:50%;font-weight:700;font-size:.95rem;border:2px solid var(--border-strong);color:var(--muted);background:var(--surface)}
.node-doing .pc-node{background:#1F6FEB;border-color:#1F6FEB;color:#fff}
.node-done .pc-node{background:#1A7F37;border-color:#1A7F37;color:#fff}
.node-late .pc-node{background:#d97706;border-color:#d97706;color:#fff}
.pc-main{display:flex;flex-direction:column;gap:.25rem;min-width:0}
.pc-line1{display:flex;flex-wrap:wrap;align-items:baseline;gap:.2rem .7rem}
.pc-title{font-size:1.05rem}
.pc-seq{color:var(--muted);font-size:.85rem}
.pc-desc{color:var(--muted);font-size:.9rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pc-line3{display:flex;flex-direction:column;gap:.35rem;font-size:.88rem;margin-top:.15rem}
.pc-doing{color:#1F6FEB;font-weight:600}
.pc-sub{display:flex;justify-content:space-between;align-items:center;gap:.5rem 1rem;flex-wrap:wrap}
.pc-people{display:inline-flex;align-items:center;gap:.5rem}
.pc-period{color:var(--muted);white-space:nowrap}
.pc-period.late{color:#b35900;font-weight:600}
.pc-stats{display:inline-flex;align-items:center;gap:.6rem;font-size:.9rem;white-space:nowrap;padding-top:.3rem}
.pc-count{color:var(--muted)}
.pc-bar{display:inline-block;width:6rem;height:.35rem;border-radius:3px;background:var(--soft);overflow:hidden}
.pc-bar i{display:block;height:100%;background:#1F6FEB}
.node-done .pc-bar i{background:#1A7F37}
.pc-menu{padding-top:.2rem;opacity:0;transition:opacity .1s}
.fcard-head:hover .pc-menu,.pc-menu[open],.pc-menu:focus-within{opacity:1}
.pc-menu > summary{padding:0 .4rem;border-radius:6px;font-weight:700;color:var(--muted)}
.pc-chev{width:.55rem;height:.55rem;margin-top:.7rem;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(-45deg);transition:transform .15s}
.fcard[open] .pc-chev{transform:rotate(45deg)}
.node-done:not([open]){background:var(--head);box-shadow:none}
.node-done:not([open]) .pc-title,.node-done:not([open]) .pc-desc{color:var(--muted)}
.fcard-body{border-top:1px solid var(--line-2);padding:.4rem 1.1rem .8rem 4.2rem;animation:pc-open .15s ease-out}
@keyframes pc-open{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.fcard-body{animation:none}}
.acts{list-style:none;margin:0;padding:0}
.act{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:.6rem;align-items:center;padding:.4rem .2rem .4rem .5rem;border-bottom:1px solid var(--line-2);border-left:3px solid transparent;cursor:pointer}
.act:hover{background:var(--row-hover)}
.act.is-doing{border-left-color:#1F6FEB}.act.is-doing .act-title{font-weight:700}
.act.is-closed .act-title{color:var(--muted);text-decoration:line-through}
.act-check{display:grid;place-items:center;min-width:1.6rem;min-height:1.6rem;margin:0;cursor:pointer}
.act-check input{width:1.05rem;height:1.05rem;margin:0}
.act-title{background:none;border:0;padding:0;min-height:0;text-align:left;color:var(--text);font-weight:500;font-size:.92rem;cursor:pointer}
.act-title:hover{text-decoration:underline}
.act-num{color:var(--muted);font-size:.8rem;font-weight:500;margin-right:.2rem}
.act-meta{display:grid;grid-template-columns:9rem 8.5rem 4.5rem 3.5rem;gap:.6rem;align-items:center;font-size:.85rem;color:var(--muted)}
.act-hours{text-align:right}
.act-due.late{color:#b35900;font-weight:600}
.act-wait{color:#b35900}
.act-edit{background:none;border:0;padding:.1rem .2rem;min-height:0;font:inherit;color:var(--text);border-radius:4px;cursor:pointer;text-align:left;font-weight:500}
.act-edit:hover{background:var(--soft)}
.act-input{font-size:.85rem;padding:.15rem .3rem;max-width:100%}
.acts-done > summary{cursor:pointer;color:var(--muted);padding:.4rem .2rem}
.act-leaf{padding:.5rem 0;color:var(--muted)}
.act-add input{width:100%;border:0;border-bottom:1px dashed var(--border-strong);border-radius:0;background:transparent;padding:.5rem .2rem;margin-top:.3rem;font-size:.9rem}
.act-add input:focus{outline:none;border-bottom-color:#1F6FEB}
.fase-add input{width:100%;max-width:24rem;border:1px dashed var(--border-strong);border-radius:10px;background:transparent;padding:.6rem .8rem}
/* avatar */
.avatars{display:inline-flex}
.av{display:inline-grid;place-items:center;width:1.65rem;height:1.65rem;border-radius:50%;font-size:.7rem;font-weight:700;color:#fff;border:2px solid var(--surface);margin-left:-.35rem;background:#54595F}
.av:first-child{margin-left:0}
.av-0{background:#1F2937}.av-1{background:#7C3AED}.av-2{background:#0E7490}.av-3{background:#B45309}.av-4{background:#BE185D}.av-5{background:#15803D}.av-6{background:#1D4ED8}.av-7{background:#9F1239}
.av-more{background:var(--soft);color:var(--maybe-dark)}
/* pannello laterale */
.side-panel{position:fixed;top:0;right:0;bottom:0;z-index:40;width:min(440px,100vw);background:var(--surface);border-left:1px solid var(--border);box-shadow:var(--shadow-pop);overflow-y:auto}
.side-panel[hidden]{display:none}
.sp-inner{position:relative;padding:1.2rem 1.3rem 2rem}
.sp-close{position:absolute;top:.8rem;right:.8rem;width:2.2rem;height:2.2rem;min-height:0;border-radius:8px;background:var(--soft);color:var(--text);font-size:1.3rem;line-height:1;padding:0}
.sp-body:focus{outline:none}
.sp-crumb{margin:0 2.5rem .2rem 0}
.sp-title{font-size:1.15rem;margin:0 2.5rem .9rem 0}
.tp-grid{display:grid;grid-template-columns:1fr 1fr;gap:.7rem 1rem;margin:0 0 1rem}
.tp-grid dt{font-size:.78rem;color:var(--muted)}.tp-grid dd{margin:0;font-weight:600}
.tp-grid dd.late{color:#b35900}
.tp-deps ul{margin:.2rem 0 .8rem 1rem}
.tp-desc{font-size:.92rem;margin:0 0 1rem}
.tp-state{margin:0 0 1rem}
.tp-h{font-size:.95rem;margin:1rem 0 .4rem}
.tp-update{background:var(--head);border-radius:8px;padding:.5rem .7rem;margin-bottom:.5rem}
.tp-update p{margin:.1rem 0}
.tp-form{border-top:1px solid var(--line-2);margin-top:1rem;padding-top:.8rem}
.tp-form-row{display:grid;grid-template-columns:1fr 7rem;gap:.6rem}
.tp-form textarea{width:100%}
.tp-actions{display:flex;justify-content:space-between;align-items:center}
.tp-error{color:var(--late-fg)}
@media (max-width:860px){.act-meta{grid-template-columns:auto auto auto auto;justify-content:start}}
@media (max-width:600px){
  .fcard-head{grid-template-columns:auto minmax(0,1fr) auto;padding:.85rem .8rem}
  .pc-stats{grid-column:2 / -1;padding-top:0}
  .pc-menu{opacity:1;grid-row:1;grid-column:3}
  .pc-chev{display:none}
  .pc-sub{flex-direction:column;align-items:flex-start}
  .fcard-body{padding:.3rem .6rem .7rem}
  .act{grid-template-columns:auto minmax(0,1fr);padding-left:.2rem}
  .act-check{min-width:44px;min-height:44px}
  .act-meta{grid-column:2;display:flex;flex-wrap:wrap;gap:.2rem .7rem;font-size:.8rem}
  .act-meta > span:empty{display:none}
  .fasi-top{flex-direction:column}
  .ph-progress .phase-segbar{width:6rem}
  .side-panel{width:100vw;border-left:0}
}
.fase-add{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem 1rem}
.fase-add form{flex:1 1 18rem;max-width:24rem}
.ph-menu > summary.button{display:inline-flex;align-items:center;justify-content:center;min-height:2rem;padding:.2rem .7rem;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text);font-weight:700}
.pc-pill{background:var(--alert-bg);color:var(--alert-fg)}

/* Gantt interattivo (tab Gantt) */
.gx-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;margin-bottom:.6rem}
.gx-scale{display:inline-flex}
.gx-scale button{border-radius:0;min-height:2rem}
.gx-scale button:first-child{border-radius:8px 0 0 8px}.gx-scale button:last-child{border-radius:0 8px 8px 0;margin-left:-1px}
.gx-scale button.active{background:var(--maybe-ink);color:#fff;border-color:var(--maybe-ink)}
.gx-hint{flex:1 1 16rem}
.gx-legend{display:flex;flex-wrap:wrap;gap:.2rem .8rem;color:var(--muted)}
.gx-legend span{display:inline-flex;align-items:center;gap:.3rem}
.gx-legend i{display:inline-block;width:1.4rem;height:.6rem;border-radius:3px}
.lg-done{background:#1A7F37}.lg-doing{background:#cfe3ff;border:1px solid #1F6FEB}.lg-todo{background:#cfd3da}
.lg-waiting{background:repeating-linear-gradient(45deg,#fde2c4 0 4px,#fff 4px 7px);border:1px dashed #d97706}
.lg-base{height:2px!important;background:#8c939d}.lg-today{width:2px!important;height:.9rem!important;background:#e4041c}
.gx-banner{background:#fff7ed;border:1px solid #fed7aa;border-radius:10px;padding:.7rem .9rem;margin-bottom:.7rem;display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;position:sticky;top:4.2rem;z-index:6}
.gx-banner[hidden]{display:none}
.gx-banner p{margin:0}
.gx-banner p:first-child{flex:1 1 20rem}
.gx-frame{border:1px solid var(--border);border-radius:12px;background:var(--surface);overflow:hidden}
.gx-scroll{overflow:auto;max-height:75vh}
.gx-canvas{position:relative}
.gx-row{display:flex;height:var(--row);border-bottom:1px solid var(--line-2)}
.gx-head{height:var(--head);position:sticky;top:0;z-index:4;background:var(--head)}
.gx-label{position:sticky;left:0;z-index:3;flex:none;width:var(--left);display:flex;align-items:center;gap:.4rem;padding:0 .6rem;background:var(--surface);border-right:1px solid var(--border);font-size:.85rem;min-width:0}
.gx-head .gx-label{background:var(--head);font-weight:600;color:var(--muted);z-index:5}
.gx-track{position:relative;flex:1}
.gx-month{position:absolute;top:4px;font-size:.75rem;font-weight:700;color:var(--muted);white-space:nowrap;text-transform:capitalize;padding-left:3px}
.gx-day{position:absolute;bottom:4px;font-size:.7rem;color:var(--muted);text-align:center}
.gx-day.off{color:#b0b5bd}.gx-day.monday{font-weight:700;color:var(--text)}
.gx-bg{position:absolute;top:0;left:var(--left);right:0;pointer-events:none;z-index:1}
.gx-off{position:absolute;top:0;bottom:0;background:rgba(84,89,95,.07)}
.gx-today{position:absolute;top:0;bottom:0;width:2px;background:#e4041c;z-index:2}
.gx-due{position:absolute;top:0;bottom:0;border-left:2px dashed #8c939d}
.gx-arrows{position:absolute;top:0;left:var(--left);pointer-events:none;z-index:2;overflow:visible}
.gx-arrows path{fill:none;stroke:#57606a;stroke-width:1.3}
.gx-arrows path.conflict{stroke:#d97706}
.gx-arrows marker path{fill:#57606a;stroke:none}
.gx-phase .gx-label{font-weight:600}
.gx-phase{background:var(--head)}
.gx-phase .gx-label{background:var(--head)}
.gx-tog,.gx-tog-empty{flex:none;width:1.4rem;height:1.4rem;min-height:0;padding:0;border:0;background:none;color:var(--muted);font-size:.9rem;cursor:pointer}
.gx-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:none;border:0;padding:0;min-height:0;text-align:left;font:inherit;color:inherit;cursor:pointer}
button.gx-name:hover{text-decoration:underline}
.gx-pct{color:var(--muted);font-weight:500}
.gx-code-l{flex:none;color:var(--muted);font-size:.78rem;min-width:2rem;padding-left:1.2rem}
.gx-act.is-done .gx-name{color:var(--muted)}
.gx-label .av{flex:none;margin-left:0;width:1.45rem;height:1.45rem;font-size:.62rem}
.gx-bar{position:absolute;top:8px;height:18px;border-radius:5px;background:#cfd3da;z-index:3;overflow:hidden;cursor:pointer;display:flex;align-items:center}
.gx-bar.can-drag{cursor:grab}.gx-bar.can-drag:active{cursor:grabbing}
.gx-bar:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(31,111,235,.45)}
.gx-bar.is-selected{box-shadow:0 0 0 2px var(--maybe-ink)}
.gx-bar.st-done{background:#1A7F37;color:#fff}
.gx-bar.st-doing{background:#dbeafe;border:1px solid #1F6FEB}
.gx-bar.st-waiting{background:repeating-linear-gradient(45deg,#fde2c4 0 5px,#fff7ed 5px 9px);border:1px dashed #d97706}
.gx-bar.st-cancelled{background:var(--soft);opacity:.6}
.gx-bar.unplanned{opacity:.7;border-style:dashed}
.gx-bar.is-late:not(.st-done){box-shadow:inset 0 0 0 1px #d97706}
.gx-bar.is-preview{outline:2px solid #d97706;outline-offset:1px}
.gx-fill{position:absolute;left:0;top:0;bottom:0;background:#93c5fd}
.gx-code{position:relative;font-size:.7rem;font-weight:700;padding:0 .35rem;white-space:nowrap;pointer-events:none}
.gx-h{position:absolute;top:0;bottom:0;width:8px;cursor:ew-resize;z-index:2}
.gx-h-l{left:0}.gx-h-r{right:0}
.gx-bar.can-drag:hover .gx-h-r{background:rgba(31,111,235,.35)}
.gx-ghost{position:absolute;top:8px;height:18px;border:1px dashed #8c939d;border-radius:5px;z-index:2}
.gx-base{position:absolute;top:28px;height:2px;background:#8c939d;border-radius:1px;z-index:2}
.gx-side{position:absolute;top:9px;white-space:nowrap;color:var(--muted);z-index:2;font-size:.75rem}
.gx-sum{position:absolute;top:13px;height:8px;border-radius:4px;background:#54595F;z-index:3;overflow:hidden}
.gx-sum.closed{top:9px;height:16px;background:#cfd3da}
.gx-sum.closed i{display:block;height:100%;background:#1F6FEB}
.gx-sum.closed.st-done i{background:#1A7F37}
.gx-undated{position:absolute;top:9px;left:.5rem}
.gx-add input{width:100%;border:0;background:transparent;padding:.3rem 0 .3rem 1.2rem;font-size:.85rem;color:var(--text)}
.gx-add input:focus{outline:none;border-bottom:1px dashed #1F6FEB}
.gx-add .gx-label form{width:100%}
.gx-tip{position:absolute;z-index:8;background:var(--maybe-ink);color:#fff;font-size:.75rem;padding:.2rem .5rem;border-radius:6px;white-space:nowrap;pointer-events:none}
@media (max-width:600px){.gx-hint{display:none}.gx-code-l{padding-left:0}.gx-side{display:none}}
.ph-decisions{color:var(--muted);text-decoration:none}
.ph-decisions.urgent{color:#b35900;font-weight:600}.ph-decisions.urgent strong{color:#b35900}
.decisions-list{list-style:none;margin:.5rem 0 .2rem;padding:0}
.decisions-list li{padding:.4rem 0;border-top:1px solid #fed7aa}
.decisions-list .decide summary{cursor:pointer;color:var(--text);font-weight:600;margin-top:.2rem}
.decisions-list textarea{width:100%;margin-top:.3rem}
.decisions-bar.taken{background:var(--head);border-color:var(--border);color:var(--muted)}
.decisions-bar.taken .decisions-list li{border-top-color:var(--border)}
.sch-edit > summary{cursor:pointer;color:var(--link);font-weight:600;list-style:none;display:inline-block}
.sch-edit > summary::-webkit-details-marker{display:none}
.card-title .sch-inline{float:right;font-size:.85rem;font-weight:400}
.card-title .sch-inline[open]{float:none;display:block;margin-top:.5rem}
.sch-edit form,.sch-form{margin-top:.5rem}
.sch-edit textarea,.sch-form textarea,.sch-form input:not([type=checkbox]),.sch-form select,.sch-edit input:not([type=checkbox]){width:100%}
.sch-form{display:grid;gap:.5rem}
.sch-form label{display:flex;flex-direction:column;gap:.2rem;font-size:.85rem;font-weight:600}
.sch-form label.check{flex-direction:row;font-weight:400}
.sch-blocks{border:1px solid var(--line-2);border-radius:8px;padding:.4rem .6rem;max-height:14rem;overflow:auto}
.sch-pad{padding:0 1rem 1rem}
.sch-h{margin:1rem 0 .3rem;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.sch-files{margin:0 0 .5rem;padding-left:1.1rem}
.sch-upload{margin-top:.4rem}
.wz-templates{margin-top:1rem}
.wz-tpl-list{display:grid;gap:.7rem}
.wz-tpl{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;border:1px solid var(--border);border-radius:10px;padding:.7rem .9rem}
.wz-tpl ol{margin:.3rem 0 0 1rem;padding:0}
@media (max-width:640px){.wz-tpl{flex-direction:column}}
.wz-tpl > button{white-space:nowrap;flex:none}
.wz-text{margin-top:1rem}
.wz-text textarea{width:100%;font-family:ui-monospace,Menlo,monospace;font-size:.85rem}
.wz-text-report{border:1px solid var(--border);border-radius:10px;padding:.6rem .9rem;background:var(--head)}
.gx-dot{position:absolute;top:13px;width:9px;height:9px;border-radius:50%;background:#fff;border:2px solid #1F6FEB;z-index:4;cursor:crosshair;opacity:0;transition:opacity .1s}
.gx-row:hover .gx-dot,.gx-dot:focus{opacity:1}
.gx-arrows path.gx-hit{stroke:transparent;stroke-width:10;pointer-events:stroke;cursor:pointer;marker-end:none}
.gx-arrows path.gx-hit:hover{stroke:rgba(217,119,6,.25)}
.gx-linking{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:7;overflow:visible}
.gx-linking line{stroke:#1F6FEB;stroke-width:2;stroke-dasharray:4 3}
.gx-draw{position:absolute;height:18px;border:2px dashed #1F6FEB;border-radius:5px;background:rgba(31,111,235,.12);z-index:6;pointer-events:none}
.gx-row[data-draw] .gx-track{cursor:copy}

/* Lista e Kanban del progetto */
.pv{max-width:1100px}
.pv-filters{display:flex;flex-wrap:wrap;gap:.5rem .8rem;align-items:center;margin-bottom:.8rem}
.pv-filters input[type=search]{flex:1 1 14rem}
.pv-table th button.link{font:inherit;color:inherit;text-decoration:none;text-transform:inherit;letter-spacing:inherit}
.pv-table th[aria-sort=ascending] button::after{content:' ↑'}.pv-table th[aria-sort=descending] button::after{content:' ↓'}
.pv-row{cursor:pointer}
.pv-row.is-doing td:first-child{box-shadow:inset 3px 0 0 #1F6FEB}
.pv-row.is-closed .pv-title{color:var(--muted);text-decoration:line-through}
.pv-title{background:none;border:0;padding:0;min-height:0;font:inherit;font-weight:600;color:var(--text);text-align:left;cursor:pointer}
.pv-title:hover{text-decoration:underline}
.pv-late{color:#b35900;font-weight:600}
.pv-board{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(15rem,1fr);gap:.8rem;overflow-x:auto;padding-bottom:.5rem;align-items:start}
.pv-col{background:var(--head);border:1px solid var(--border);border-radius:12px;padding:.6rem;min-height:8rem}
.pv-col.closed{opacity:.85}
.pv-col.over{border-color:#1F6FEB;background:#eff6ff}
.pv-col h3{font-size:.85rem;margin:.1rem .2rem .6rem;display:flex;justify-content:space-between}
.pv-cards{display:flex;flex-direction:column;gap:.5rem;min-height:3rem}
.pv-card{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:.55rem .7rem;cursor:pointer;box-shadow:var(--shadow)}
.pv-card[draggable=true]{cursor:grab}
.pv-card.dragging{opacity:.4}
.pv-card:focus-visible{outline:none;box-shadow:var(--focus-ring)}
.pv-card.is-waiting{border-style:dashed;border-color:#d97706}
.pv-card.is-late{border-left:3px solid #d97706}
.pv-card p{margin:.1rem 0}
.pv-card-title{font-weight:600;font-size:.9rem}
.pv-card-meta{display:flex;flex-wrap:wrap;gap:.2rem .7rem;color:var(--muted)}
@media (max-width:600px){.pv-board{grid-auto-columns:85%}}

/* Diario con Nexa */
dialog.nexa-write{border:0;border-radius:14px;padding:1.2rem 1.4rem;width:min(38rem,calc(100vw - 2rem));box-shadow:var(--shadow-pop)}
dialog.nexa-write::backdrop{background:var(--overlay)}
dialog.nexa-write h2{margin-top:0}
dialog.nexa-write textarea{width:100%}
dialog.nexa-write .arc-dialog-actions,.nx-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;margin:1rem 0 0}
.nx-status{display:flex;align-items:center;gap:.6rem}
.nx-spinner{width:1rem;height:1rem;border:2px solid var(--border);border-top-color:#1F6FEB;border-radius:50%;animation:nx-spin 1s linear infinite}
@keyframes nx-spin{to{transform:rotate(360deg)}}
.nx-original{background:var(--head);border-radius:8px;padding:.6rem .8rem;white-space:pre-wrap;font-size:.9rem}
.nx-day{margin:1.2rem 0 .4rem;font-size:1rem}
.nx-row{border:1px solid var(--border);border-radius:10px;padding:.7rem .9rem;margin-bottom:.6rem;background:var(--surface)}
.nx-row.is-confermata{background:var(--ok-bg);border-color:transparent}
.nx-row.is-esclusa{opacity:.6}
.nx-row.is-errore{border-color:var(--late-line)}
.nx-row-head{display:flex;flex-wrap:wrap;gap:.4rem .8rem;align-items:baseline;justify-content:space-between}
.nx-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(10rem,1fr));gap:.5rem .8rem;margin:.5rem 0}
.nx-grid label{display:flex;flex-direction:column;font-size:.8rem;font-weight:600;gap:.15rem}
.nx-grid input,.nx-grid select,.nx-row textarea{width:100%}
.nx-conf{font-size:.75rem}.nx-conf.alta{background:var(--ok-bg);color:var(--ok-fg)}.nx-conf.media{background:var(--warn-bg);color:var(--warn-fg)}.nx-conf.bassa{background:var(--late-bg);color:var(--late-fg)}
.nx-flags{margin:.3rem 0;padding-left:1.1rem;color:#9a3412;font-size:.85rem}
.nx-alt{display:flex;flex-wrap:wrap;gap:.3rem;margin:.2rem 0}
.nx-alt button{font-size:.75rem;min-height:0;padding:.15rem .5rem}

/* Comando radio del monitor nella barra in alto (solo super admin), tra la campanella e Segnalazioni */
.radio-remote{position:relative;display:inline-flex}
.topbar .rr-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;padding:0;border-radius:999px;
  background:transparent;color:var(--maybe-ink);border:0;cursor:pointer}
.topbar .rr-btn:hover,.topbar .rr-btn[aria-expanded="true"]{background:var(--surface-alt)}
.rr-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:#a3a0b5;flex:0 0 auto}
.rr-btn .rr-dot{position:absolute;top:5px;right:5px;box-shadow:0 0 0 2px var(--maybe-white)}
.rr-dot.on{background:#22c55e}.rr-dot.ko{background:var(--maybe-red)}
.rr-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:60;width:330px;max-width:calc(100vw - 24px);padding:.9rem 1rem;
  background:var(--maybe-white);color:var(--maybe-ink);border:1px solid var(--border);border-radius:12px;box-shadow:0 12px 30px rgba(9,6,20,.18)}
.rr-menu[hidden]{display:none}
.rr-head{font-size:.95rem;margin-bottom:.35rem}
.rr-stato{font-size:.85rem;margin:0 0 .7rem;min-height:2.4em}
.rr-power{width:100%;margin-bottom:.6rem}
.rr-label{font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--maybe-grey);margin:.5rem 0 .3rem}
.rr-stazioni{display:flex;flex-direction:column}
.rr-stazione{display:flex;align-items:center;justify-content:flex-start;width:100%;min-height:40px;margin-bottom:.3rem;padding:0 .7rem;
  background:var(--maybe-white);color:var(--maybe-ink);border:1px solid var(--border);text-align:left}
.rr-stazione .rr-dot{margin-right:.55rem}
.rr-stazione.scelta{border-color:var(--maybe-dark);font-weight:700}
.rr-volume{display:flex;align-items:center}
.rr-volume>*+*{margin-left:.4rem}
.rr-volume input[type=range]{flex:1 1 auto;min-width:0}
.rr-volume button{min-width:38px}
.rr-link{display:block;margin-top:.8rem;font-size:.85rem}
@media (max-width:520px){.rr-menu{position:fixed;left:12px;right:12px;top:64px;width:auto}}
/* bollino persona (foto Microsoft 365 o iniziali): {% avatar user 30 %} */
.pav{display:inline-grid;place-items:center;width:var(--pav,30px);height:var(--pav,30px);border-radius:50%;flex:none;
  font:700 calc(var(--pav,30px) * .38)/1 var(--font-ui);color:#fff;letter-spacing:.02em;vertical-align:middle;user-select:none}
.pav-wrap{position:relative;display:inline-block;width:var(--pav,30px);height:var(--pav,30px);vertical-align:middle}
.pav-wrap .pav{position:absolute;top:0;left:0}
.pav-img{object-fit:cover;background:var(--surface)}
.pav-empty{border:1.5px dashed var(--border-strong);color:var(--muted);background:transparent;font-weight:600;font-size:calc(var(--pav,30px) * .5)}
/* stato a colori (Ticket.STATUS_COLORS) */
.st-dot{display:inline-block;width:11px;height:11px;border-radius:50%;background:var(--st,#9aa0a6);vertical-align:middle;flex:none}
.st-legend{display:flex;flex-wrap:wrap;list-style:none;margin:.2rem 0 .6rem;padding:0;font-size:12px;color:var(--muted)}
.st-legend li{display:inline-flex;align-items:center;margin:0 1.1rem .2rem 0}
.st-legend .st-dot{margin-right:.4rem}
/* lista ticket operatore */
main.wide{max-width:1500px}
.tl-wrap{overflow-x:auto;max-width:100%}
table.ticket-list td,table.ticket-list th{padding:12px 14px;white-space:nowrap;vertical-align:middle;border-bottom:1px solid var(--line-2)}
table.ticket-list tbody tr:last-child td{border-bottom:0}
table.ticket-list tbody tr[data-href]{cursor:pointer}
table.ticket-list tbody tr:hover td{background:var(--row-hover)}
table.ticket-list .tl-subj{white-space:normal;width:100%;min-width:16rem;font-size:14px;font-weight:600}
table.ticket-list .tl-subj a{color:inherit}
table.ticket-list .tl-num a{font:400 11.5px ui-monospace,Menlo,Consolas,monospace;color:var(--muted)}
table.ticket-list .tl-st,table.ticket-list .tl-as{width:60px;text-align:center}
table.ticket-list .tl-company{display:inline-block;font-size:11.5px;font-weight:600;line-height:1.3;padding:.15rem .5rem;border-radius:999px;background:var(--soft);color:var(--maybe-dark)}
table.ticket-list .tl-req{font-size:14.5px;font-weight:500;color:var(--text)}
table.ticket-list .tl-sec{font-size:12px;color:var(--muted)}
/* ticket fermi (criterio di tickets/stale.py): riga rosso chiaro, sirena, giorni sotto il numero */
table.ticket-list tr.tl-stale td{background:#fdeeee}
table.ticket-list tr.tl-stale:hover td{background:#fbe2e2}
table.ticket-list .tl-siren{display:inline-block;color:#c62828;vertical-align:top;margin:0 .35rem 0 -.1rem;line-height:0}
table.ticket-list .tl-num-txt{display:inline-block;vertical-align:top;line-height:1.25}
table.ticket-list tr.tl-stale .tl-num a{color:#c62828;font-weight:600}
table.ticket-list .tl-stale-days{display:block;font-size:10.5px;color:#c62828}
/* riepilogo della lista ticket: aperti, «Assegnati a me», barra per stato e riquadri-filtro */
.tsum{border:1px solid var(--border);border-radius:12px;padding:14px 16px;margin:0 0 1rem;background:var(--surface)}
.tsum-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;margin-bottom:.7rem}
.tsum-head>*{margin:.2rem 0}
.tsum-total{display:flex;flex-wrap:wrap;align-items:baseline}
.tsum-n{font:800 28px/1 var(--font-title);color:var(--maybe-ink);margin-right:.45rem}
.tsum-label{font-size:15px;font-weight:700;margin-right:.7rem}
.tsum-hint{font-size:12px;color:var(--muted)}
.tsum-mine{display:inline-flex;align-items:center;padding:3px 12px 3px 3px;border:1px solid var(--border);border-radius:999px;
  text-decoration:none;color:var(--text);font-size:13px;font-weight:600;background:var(--surface)}
.tsum-mine>*+*{margin-left:.45rem}
.tsum-mine b{font-weight:800}
.tsum-mine:hover{border-color:var(--border-strong);text-decoration:none}
.tsum-mine.on{background:var(--maybe-ink);border-color:var(--maybe-ink);color:#fff}
.tsum-bar{display:flex;height:8px;border-radius:999px;overflow:hidden;background:var(--soft);margin-bottom:.8rem}
.tsum-bar span{display:block;height:100%}
.tsum-tiles{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.tsum-tile{display:flex;flex-direction:column;padding:10px 12px;border:1px solid var(--border);border-radius:10px;text-decoration:none;
  color:var(--text);background:var(--surface);min-width:0}
.tsum-tile:hover{border-color:var(--border-strong);text-decoration:none}
.tsum-tile-top{display:flex;align-items:center}
.tsum-tile-top strong{font:700 22px/1.1 var(--font-title);color:var(--maybe-ink);margin-left:.45rem}
.tsum-tile-label{font-size:12px;font-weight:600;margin-top:.2rem}
.tsum-tile small{font-size:11px;color:var(--muted)}
.tsum-tile.on{border-color:var(--st);box-shadow:inset 0 0 0 1px var(--st);background:color-mix(in srgb,var(--st) 8%,var(--surface))}
.tsum-tile.stale{--st:#c62828;background:#fdeeee;border-color:#f6caca}
.tsum-tile.stale .tsum-tile-top strong{color:#c62828}
.tsum-tile.stale.on{border-color:#c62828;box-shadow:inset 0 0 0 1px #c62828;background:#fbe2e2}
.tsum-siren{color:#c62828;line-height:0}
@media(max-width:800px){.tsum-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}}
.badge.override{background:#fff4d6;color:#8a5a00;font-size:.7rem}
/* contratti: scheda azienda */
.contract-assignments .override-edit{display:inline-block;margin-right:.4rem}
.contract-assignments .override-edit[open]{display:block;background:var(--head);border-radius:8px;padding:.5rem .7rem;margin:.3rem 0;white-space:normal;min-width:18rem}
.contract-assignments .override-edit form.form label{display:block;font-size:.8rem;margin:.3rem 0}
.contract-assignments form.inline{display:inline}
.contract-companies .num,.contract-assignments .num{text-align:right}
.contract-history summary{cursor:pointer;color:var(--muted)}
.contract-companies strong.late{color:#a40e26}
/* contratti: matrice attività × aziende (prima riga e prima colonna fisse) */
.mx-wrap{padding:0;overflow:auto;max-height:calc(100vh - 220px)}
table.mx{border-collapse:separate;border-spacing:0;font-size:.82rem;width:auto;min-width:100%}
table.mx th,table.mx td{border-bottom:1px solid var(--line-2);border-right:1px solid var(--line-2);padding:.35rem .5rem;white-space:nowrap;vertical-align:middle}
table.mx thead th{position:sticky;top:0;z-index:2;background:var(--head);text-align:center}
table.mx tbody th{position:sticky;left:0;z-index:1;background:var(--surface);font-weight:400;max-width:22rem;overflow:hidden;text-overflow:ellipsis;text-align:left}
table.mx thead th.mx-corner{left:0;z-index:3;text-align:left}
table.mx td.mx-cell{text-align:center;min-width:6.5rem}
table.mx td.mx-cell.on{background:#eef7f1}
table.mx td.mx-cell.off{background:var(--soft)}
.mx-mark{color:#8a5a00;font-weight:700}
.mx-pop{position:relative}
.mx-pop>summary{cursor:pointer;list-style:none}
.mx-pop>summary::-webkit-details-marker{display:none}
.mx-pop[open]>summary{outline:2px solid var(--brand-2,#1F6FEB);outline-offset:2px;border-radius:4px}
.mx-panel{position:absolute;z-index:5;top:1.6rem;left:50%;transform:translateX(-50%);background:var(--surface);border:1px solid var(--border);
  border-radius:10px;box-shadow:var(--shadow-pop);padding:.6rem .7rem;text-align:left;white-space:normal;min-width:15rem}
.mx-panel label{display:block;font-size:.78rem;margin:.3rem 0}
.mx-panel form{margin:.3rem 0}
table.mx tbody th{text-transform:none;letter-spacing:normal;font-size:.82rem;font-family:inherit;color:var(--text)}
.mx-panel.floating{position:fixed;transform:none;top:auto;left:auto}
/* macro aree */
.ma-list tr[draggable]{cursor:grab}
.ma-handle{white-space:nowrap;color:var(--muted)}
.ma-handle button{padding:0 .35rem;min-height:0;margin-left:.15rem}
.catalog-group th.cg-head{background:var(--soft);text-transform:none;letter-spacing:normal;font-size:.85rem;color:var(--text)}
.cg-head .muted{font-weight:400}
.ma-tag{display:inline-block;font-size:.7rem;font-weight:600;padding:.05rem .45rem;border-radius:999px;background:var(--soft);color:var(--maybe-dark);border-left:3px solid var(--st,#9aa0a6)}
table.mx tr.mx-ghead th{position:sticky;left:0;background:var(--soft);text-transform:none;letter-spacing:normal;font-size:.82rem;font-weight:700;text-align:left;color:var(--text)}
.mx-group.collapsed tr:not(.mx-ghead),.ca-group.collapsed tr:not(.ca-ghead){display:none}
.mx-toggle,.ca-toggle{background:none;border:0;padding:0 .3rem;min-height:0;color:var(--text);font-size:.9rem;cursor:pointer}
.contract-assignments tr.ca-ghead th{background:var(--soft);text-transform:none;letter-spacing:normal;font-size:.85rem;color:var(--text)}
nav.chips{margin:.4rem 0 .6rem}
nav.chips a{display:inline-block;padding:.15rem .65rem;border:1px solid var(--border);border-radius:999px;margin:0 .25rem .3rem 0;text-decoration:none;color:var(--text);background:var(--surface)}
nav.chips a.active{background:var(--maybe-ink);border-color:var(--maybe-ink);color:#fff}
/* Nuovo ticket: reparto in testata, cliente da anagrafica, azienda automatica, piede del form */
.nt-title{margin-bottom:.2rem}
.nt-dept{margin:0 0 1rem;color:var(--muted)}
.nt-dept .badge{color:var(--text);font-weight:600}
.new-ticket .contact-picker .cp-box input{width:100%}
.new-ticket .cp-results .badge.nt-co{font-size:.72rem;padding:.08rem .45rem;margin-left:.2rem;color:var(--muted)}
.new-ticket .cp-results button.is-active{background:var(--bg)}
.new-ticket .cp-results li.cp-create{border-top:1px solid var(--line);margin-top:.2rem;padding-top:.2rem}
.new-ticket .cp-results li.cp-create button{color:var(--link);font-weight:600}
.new-ticket .cp-new .cp-company{width:100%;margin-top:.4rem}
.nt-company-fixed{display:flex;align-items:center;min-height:2.45rem;padding:.4rem .7rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--bg);font-weight:600}
.nt-notice{align-self:end}
.nt-notice label.check{margin-top:.8rem}
.new-ticket input[name=company_wide]:disabled+strong{color:var(--muted)}
.form-foot{display:flex;justify-content:flex-end;gap:.6rem;flex-wrap:wrap;margin:1rem 0}
/* Allegati: trascina e rilascia (core/file-drop.js) */
.file-drop{border:1px dashed var(--border-strong,var(--border));border-radius:var(--radius);padding:.8rem 1rem;background:var(--bg)}
.file-drop.is-enhanced{cursor:pointer}
.file-drop.is-enhanced input[type=file]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.file-drop.is-over{border-color:var(--maybe-red);background:var(--surface-alt)}
.file-drop-hint{margin:0;text-align:center;color:var(--muted)}
.file-drop:not(.is-enhanced) .file-drop-hint{display:none}
.file-drop-pick{color:var(--link);text-decoration:underline}
.file-drop.is-full .file-drop-hint::after{content:' · raggiunto il massimo di file'}
.file-drop-list{list-style:none;margin:.6rem 0 0;padding:0;cursor:default}
.file-drop-list li{display:flex;gap:.6rem;align-items:baseline;padding:.3rem 0;border-top:1px solid var(--line)}
.file-drop-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-drop-list li.too-big small{color:var(--issue-fg)}
/* Pulsante «Nuovo ticket» con più reparti */
details.new-menu{position:relative}
details.new-menu>summary{list-style:none;cursor:pointer}
details.new-menu>summary::-webkit-details-marker{display:none}
.new-menu-list{position:absolute;right:0;z-index:30;margin-top:.3rem;min-width:12rem;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:0 6px 20px rgba(0,0,0,.12);padding:.3rem}
.new-menu-list a{display:block;padding:.45rem .6rem;border-radius:4px;color:var(--text);text-decoration:none}
.new-menu-list a:hover,.new-menu-list a:focus{background:var(--bg)}
.nt-company-fixed .muted{font-weight:400}
