/* Copia identica del foglio di stile della LUMLY Control Room (artifact). Non modificare: le aggiunte del gestionale stanno in gestionale.css */
/* Layout: stile Apple — barra laterale traslucida tipo macOS con l'organico, area centrale con titolo grande e schede arrotondate, chat a destra in stile Messaggi. Font di sistema, accento blu, chiaro e scuro automatici. */
:root{
  --bg:#f5f5f7; --surface:#ffffff; --surface-2:#f5f5f7; --surface-3:#ebebf0;
  --line:#e5e5ea; --line-2:#d2d2d7;
  --fg:#1d1d1f; --muted:#6e6e73; --faint:#aeaeb2;
  --gold:#0071e3; --gold-dim:#0071e314; --gold-glow:#0071e340; --on-accent:#ffffff;
  --ok:#248a3d; --warn:#c93400; --crit:#d70015; --info:#0071e3;
  --bubble-me:#0a84ff; --bubble-me-fg:#ffffff; --bubble-them:#e9e9eb;
  --shadow:0 1px 2px rgba(0,0,0,.04),0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:0 8px 30px rgba(0,0,0,.08);
  --glass:rgba(255,255,255,.72);
  --f-display:-apple-system,BlinkMacSystemFont,"SF Pro Display","Helvetica Neue",Helvetica,Arial,sans-serif;
  --f-body:-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue",Helvetica,Arial,sans-serif;
  --f-mono:ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
  --r:18px; --r-sm:12px;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#000000; --surface:#1c1c1e; --surface-2:#2c2c2e; --surface-3:#3a3a3c;
  --line:#2c2c2e; --line-2:#3a3a3c;
  --fg:#f5f5f7; --muted:#98989d; --faint:#636366;
  --gold:#0a84ff; --gold-dim:#0a84ff1f; --gold-glow:#0a84ff55; --on-accent:#ffffff;
  --ok:#30d158; --warn:#ff9f0a; --crit:#ff453a; --info:#64d2ff;
  --bubble-me:#0a84ff; --bubble-me-fg:#ffffff; --bubble-them:#2c2c2e;
  --shadow:0 1px 2px rgba(0,0,0,.4); --shadow-lg:0 8px 30px rgba(0,0,0,.5);
  --glass:rgba(28,28,30,.72); color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#000000; --surface:#1c1c1e; --surface-2:#2c2c2e; --surface-3:#3a3a3c;
  --line:#2c2c2e; --line-2:#3a3a3c;
  --fg:#f5f5f7; --muted:#98989d; --faint:#636366;
  --gold:#0a84ff; --gold-dim:#0a84ff1f; --gold-glow:#0a84ff55; --on-accent:#ffffff;
  --ok:#30d158; --warn:#ff9f0a; --crit:#ff453a; --info:#64d2ff;
  --bubble-me:#0a84ff; --bubble-me-fg:#ffffff; --bubble-them:#2c2c2e;
  --shadow:0 1px 2px rgba(0,0,0,.4); --shadow-lg:0 8px 30px rgba(0,0,0,.5);
  --glass:rgba(28,28,30,.72); color-scheme:dark}
*{box-sizing:border-box}
html,body{background:var(--bg);color:var(--fg)}
body{font-family:var(--f-body);font-size:15px;line-height:1.47;letter-spacing:-.01em;padding-inline:20px;padding-block:0 48px;-webkit-font-smoothing:antialiased}
h1,h2,h3,h4{margin:0;text-wrap:balance;letter-spacing:-.02em}
button,select,input,textarea{font:inherit;color:inherit;letter-spacing:inherit}
:focus-visible{outline:3px solid var(--gold-glow);outline-offset:2px;border-radius:8px}
a{color:var(--gold);text-decoration:none}a:hover{text-decoration:underline}
.mono{font-family:var(--f-body);font-size:13px;font-variant-numeric:tabular-nums}
.eyebrow{font-size:12px;font-weight:600;color:var(--muted);letter-spacing:0}
.num{font-variant-numeric:tabular-nums}
.muted{color:var(--muted)}

/* Pulsanti */
.btn{border:0;background:var(--surface-3);color:var(--fg);border-radius:980px;padding:7px 16px;cursor:pointer;font-size:14px;font-weight:500;white-space:nowrap;transition:filter .15s,background .15s}
.btn:hover{filter:brightness(.96)}
.btn.gold{background:var(--gold);color:var(--on-accent)}
.btn.gold:hover{filter:brightness(1.08)}
.btn.ghost{background:transparent;color:var(--gold)}
.btn.ghost:hover{background:var(--gold-dim);filter:none}
.btn.sm{padding:4px 12px;font-size:13px}
.btn.danger{color:var(--crit)}
.btn[disabled]{opacity:.4;cursor:not-allowed}

/* Campi */
input[type=text],input[type=number],input[type=date],select,textarea{background:var(--surface-2);border:1px solid transparent;border-radius:10px;padding:8px 11px;min-width:0;width:100%;font-size:14px;transition:border-color .15s,background .15s}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--gold);background:var(--surface)}
textarea{resize:vertical;min-height:80px;line-height:1.5}
select{appearance:auto}
label.f{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:500;color:var(--muted);min-width:0}
input[type=checkbox]{accent-color:var(--gold);width:16px;height:16px;vertical-align:-3px}
input[type=file]{font-size:13px;color:var(--muted)}

/* Etichette */
.pill{display:inline-flex;align-items:center;gap:7px;background:var(--surface-2);border-radius:980px;padding:4px 12px;font-size:13px;font-weight:500;white-space:nowrap}
.dot{width:8px;height:8px;border-radius:50%;background:var(--faint);flex:none}
.on .dot,.dot.on{background:var(--ok)}
.pill.on{color:var(--ok)}
.pill.paused{color:var(--warn)}.pill.paused .dot{background:var(--warn)}
.chip{font-size:12px;font-weight:600;padding:3px 10px;border-radius:980px;background:var(--surface-2);color:var(--muted);white-space:nowrap}
.chip.gold{background:var(--gold-dim);color:var(--gold)}
.chip.ok{color:var(--ok);background:color-mix(in srgb,var(--ok) 12%,transparent)}
.chip.warn{color:var(--warn);background:color-mix(in srgb,var(--warn) 12%,transparent)}
.chip.crit{color:var(--crit);background:color-mix(in srgb,var(--crit) 12%,transparent)}
.chip.info{color:var(--info);background:color-mix(in srgb,var(--info) 12%,transparent)}

/* Barra superiore */
.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:6;background:var(--glass);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);border-bottom:1px solid var(--line);margin-inline:-20px;padding:10px 20px}
.top-in{max-width:1480px;margin:0 auto;display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center;justify-content:space-between}
.brand{display:flex;align-items:baseline;gap:10px}
.brand .mark{font-family:var(--f-display);font-size:21px;font-weight:700;letter-spacing:.02em}
.brand .sub{color:var(--muted);font-size:14px}
.status{display:flex;gap:8px;align-items:center;flex-wrap:wrap}

/* Struttura */
.shell{max-width:1480px;margin:24px auto 0;display:grid;grid-template-columns:240px minmax(0,1fr) 380px;gap:24px;align-items:start}
.staff{display:flex;flex-direction:column;gap:2px;position:sticky;top:calc(env(safe-area-inset-top,0px) + 76px);background:var(--surface);border-radius:var(--r);padding:8px;box-shadow:var(--shadow)}
.person{display:grid;grid-template-columns:36px minmax(0,1fr) auto;gap:11px;align-items:center;padding:8px 10px;border:0;border-radius:11px;background:none;text-align:left;cursor:pointer;width:100%;transition:background .12s}
.person:hover{background:var(--surface-2)}
.person[aria-current="true"]{background:var(--gold)}
.person[aria-current="true"] .n,.person[aria-current="true"] .r{color:var(--on-accent)}
.person[aria-current="true"] .badge{background:var(--on-accent);color:var(--gold)}
.avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;font-family:var(--f-display);font-size:16px;font-weight:600;color:#fff;background:linear-gradient(180deg,#8e8e93,#636366);position:relative;flex:none}
.staff .person:nth-child(1) .avatar,.chat[data-d="direzione"] .avatar{background:linear-gradient(180deg,#5e5ce6,#3634a3)}
.staff .person:nth-child(2) .avatar,.chat[data-d="ricezione"] .avatar{background:linear-gradient(180deg,#64d2ff,#0a84ff)}
.staff .person:nth-child(3) .avatar,.chat[data-d="commerciale"] .avatar{background:linear-gradient(180deg,#30d158,#248a3d)}
.staff .person:nth-child(4) .avatar,.chat[data-d="supply"] .avatar{background:linear-gradient(180deg,#ffb340,#ff9500)}
.staff .person:nth-child(5) .avatar,.chat[data-d="marketing"] .avatar{background:linear-gradient(180deg,#ff6482,#ff2d55)}
.staff .person:nth-child(6) .avatar,.chat[data-d="amministrazione"] .avatar{background:linear-gradient(180deg,#bf5af2,#8944ab)}
.staff .person[data-d="assistenza"] .avatar,.chat[data-d="assistenza"] .avatar{background:linear-gradient(180deg,#66d4cf,#00a39b)}
.avatar .st{position:absolute;right:-1px;bottom:-1px;width:11px;height:11px;border-radius:50%;background:#30d158;border:2px solid var(--surface)}
.person .n{font-weight:600;font-size:14px}
.person .r{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.badge{font-size:12px;font-weight:600;color:#fff;background:var(--crit);border-radius:980px;padding:1px 7px;min-width:20px;text-align:center}
.staff .foot{margin-top:6px;padding:10px;border-top:1px solid var(--line);font-size:12px;color:var(--muted);line-height:1.45}

.main{display:flex;flex-direction:column;gap:28px;min-width:0}
.dhead{display:flex;flex-wrap:wrap;gap:12px;justify-content:space-between;align-items:flex-end}
.dhead .eyebrow{font-size:13px;color:var(--gold)}
.dhead h1{font-family:var(--f-display);font-size:clamp(30px,4vw,44px);line-height:1.08;font-weight:700;letter-spacing:-.03em;margin-top:2px}
.dhead p{margin:8px 0 0;color:var(--muted);max-width:62ch;font-size:16px}
.sec{display:flex;flex-direction:column;gap:12px;min-width:0}
.sec>h2{font-family:var(--f-display);font-size:22px;font-weight:700;display:flex;align-items:center;gap:10px;justify-content:space-between;flex-wrap:wrap}

/* Indicatori */
.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.kpi{background:var(--surface);border-radius:var(--r);padding:18px 20px;box-shadow:var(--shadow);min-width:0}
.kpi .v{font-family:var(--f-display);font-size:32px;font-weight:700;line-height:1.1;letter-spacing:-.03em}
.kpi .l{color:var(--muted);font-size:13px;margin-top:4px}
.bar{height:6px;background:var(--surface-3);border-radius:6px;margin-top:12px;overflow:hidden}.bar>i{display:block;height:100%;background:var(--gold);border-radius:6px}

/* Schede */
.card{border:0;border-radius:var(--r);background:var(--surface);padding:20px;display:flex;flex-direction:column;gap:12px;min-width:0;box-shadow:var(--shadow)}
.card.attn{box-shadow:var(--shadow),inset 0 0 0 1.5px var(--gold-glow)}
.card .head{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between}
.card h3{font-size:17px;font-weight:600}
.meta{display:flex;flex-wrap:wrap;gap:4px 18px;color:var(--muted);font-size:13px}
.meta b{color:var(--fg);font-weight:600}
.actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.actions input[type=text]{flex:1 1 220px}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.empty{background:var(--surface);border-radius:var(--r);padding:28px 24px;text-align:center;color:var(--muted);font-size:14px;box-shadow:var(--shadow)}
.empty b{display:block;color:var(--fg);font-family:var(--f-display);font-size:17px;font-weight:600;margin-bottom:4px}
.note{border-radius:var(--r-sm);padding:12px 16px;font-size:14px;color:var(--fg);background:var(--gold-dim)}
.note.warn{background:color-mix(in srgb,var(--warn) 12%,transparent);color:var(--warn)}

/* Tabelle */
.tbl-wrap{overflow-x:auto;background:var(--surface);border-radius:var(--r);box-shadow:var(--shadow)}
table{border-collapse:collapse;width:100%}
th,td{text-align:left;padding:12px 16px;border-bottom:1px solid var(--line);vertical-align:top;font-size:14px}
th{font-size:12px;font-weight:600;color:var(--muted);background:transparent}
tr:last-child td{border-bottom:0}
tbody tr:hover td{background:var(--surface-2)}
td .s{color:var(--muted);font-size:12.5px}
td select{width:auto;padding:5px 9px}
.mail{border-radius:var(--r-sm);background:var(--surface-2);padding:14px;display:flex;flex-direction:column;gap:8px}
.mail .subj{font-weight:600}
.mail textarea{background:var(--surface)}
.live{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:400;color:var(--muted);font-family:var(--f-body);letter-spacing:0}

/* Pipeline */
.board{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(220px,1fr);gap:12px;overflow-x:auto;padding:2px 2px 10px}
.col{background:var(--surface-3);border-radius:var(--r);padding:12px;display:flex;flex-direction:column;gap:8px;min-height:130px}
.col h4{font-size:13px;font-weight:600;color:var(--muted);display:flex;justify-content:space-between;padding:0 4px}
.qcard{background:var(--surface);border:0;border-radius:12px;padding:12px;cursor:pointer;text-align:left;width:100%;box-shadow:var(--shadow);transition:transform .12s,box-shadow .12s}
.qcard:hover{transform:translateY(-1px);box-shadow:var(--shadow-lg)}
.qcard b{display:block;font-size:14px;font-weight:600}
.qcard .s{font-size:12.5px;color:var(--muted);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.qcard.me{box-shadow:var(--shadow),inset 0 0 0 2px var(--gold)}
.lines td{padding:8px}
.lines td input{padding:6px 8px}
.thumbs{display:flex;gap:10px;flex-wrap:wrap}
.thumbs img{width:132px;height:88px;object-fit:cover;border-radius:12px}

/* Direttive */
.dir{display:flex;gap:10px;align-items:flex-start;padding:10px 0;border-bottom:1px solid var(--line)}
.dir:last-of-type{border-bottom:0}
.dir .t{flex:1;min-width:0;font-size:14px}
.dir .k{font-size:11px;font-weight:700;padding:3px 9px;border-radius:980px;flex:none;border:0!important;background:var(--surface-2)}
.k.fai{color:var(--ok)!important;background:color-mix(in srgb,var(--ok) 12%,transparent)!important}
.k.non_fare{color:var(--crit)!important;background:color-mix(in srgb,var(--crit) 12%,transparent)!important}

/* Chat stile Messaggi */
.chat{position:sticky;top:calc(env(safe-area-inset-top,0px) + 76px);height:calc(100vh - 110px);min-height:480px;display:flex;flex-direction:column;border-radius:var(--r);background:var(--surface);overflow:hidden;box-shadow:var(--shadow)}
.chat .ch{padding:14px 16px;border-bottom:1px solid var(--line);display:flex;gap:11px;align-items:center;background:var(--glass);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}
.chat .ch .n{font-weight:600}
.chat .ch .r{font-size:12px;color:var(--muted)}
.msgs{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:6px}
.msg{max-width:85%;padding:8px 13px;border-radius:18px;font-size:14.5px;line-height:1.4;white-space:pre-wrap;overflow-wrap:anywhere}
.msg.user{align-self:flex-end;background:var(--bubble-me);color:var(--bubble-me-fg);border-bottom-right-radius:6px}
.msg.assistant{align-self:flex-start;background:var(--bubble-them);color:var(--fg);border-bottom-left-radius:6px}
.msg.sys{align-self:center;font-size:12.5px;color:var(--muted);background:none;text-align:center;max-width:90%;padding:6px 10px}
.pend{border-radius:14px;padding:12px;background:var(--gold-dim);display:flex;flex-direction:column;gap:8px;font-size:13.5px;margin-top:6px}
.pend pre{margin:0;max-height:140px;overflow:auto;font-size:11.5px;font-family:var(--f-mono);background:var(--surface);padding:8px;border-radius:8px;white-space:pre-wrap;overflow-wrap:anywhere}
.composer{border-top:1px solid var(--line);padding:12px;display:flex;flex-direction:column;gap:8px}
.composer textarea{min-height:44px;max-height:160px;border-radius:20px;padding:10px 14px}
.sugg{display:flex;gap:6px;flex-wrap:wrap}
.sugg button{font-size:12.5px;border:0;background:var(--surface-2);border-radius:980px;padding:5px 11px;cursor:pointer;color:var(--fg)}
.sugg button:hover{background:var(--surface-3)}
.toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);background:var(--glass);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);color:var(--fg);padding:11px 20px;border-radius:980px;font-size:14px;font-weight:500;z-index:9;max-width:calc(100% - 32px);box-shadow:var(--shadow-lg)}

@media (max-width:1180px){
  .shell{grid-template-columns:220px minmax(0,1fr)}
  .chat{grid-column:1 / -1;position:static;height:580px}
}
@media (max-width:760px){
  body{padding-inline:16px}.top{margin-inline:-16px;padding-inline:16px}
  .shell{grid-template-columns:minmax(0,1fr);gap:18px}
  .staff{position:static;flex-direction:row;overflow-x:auto;gap:4px}
  .person{grid-template-columns:32px auto;min-width:150px}
  .person .badge{display:none}.staff .foot{display:none}
  .kpis,.grid2,.grid3{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:440px){.kpis,.grid2,.grid3{grid-template-columns:minmax(0,1fr)}}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}

/* Segmented control */
.seg{display:inline-flex;background:var(--surface-3);border-radius:10px;padding:2px;gap:2px}
.seg button{border:0;background:none;padding:5px 16px;border-radius:8px;font-size:13.5px;font-weight:500;cursor:pointer;color:var(--fg)}
.seg button[aria-selected="true"]{background:var(--surface);box-shadow:0 1px 3px rgba(0,0,0,.12)}
/* Mappa */
.shell.map{grid-template-columns:minmax(0,1fr) 380px}
.shell.map .staff{display:none}
.hub-head{text-align:center;display:flex;flex-direction:column;gap:6px;align-items:center}
.hub-head h1{font-family:var(--f-display);font-size:clamp(30px,4vw,44px);font-weight:700;letter-spacing:-.03em;line-height:1.08}
.hub-head p{margin:0;color:var(--muted);font-size:16px;max-width:56ch}
.hub{position:relative;width:100%;aspect-ratio:4/3;max-height:calc(100vh - 200px);min-height:600px;margin:0 auto;background:radial-gradient(ellipse at 50% 50%,var(--gold-dim),transparent 62%)}
.hub svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.hub path{fill:none;stroke:var(--line-2);stroke-width:4;vector-effect:non-scaling-stroke;stroke-linecap:round}
.hub path.flow{stroke:var(--gold);stroke-width:3;stroke-dasharray:2 12;opacity:.7}
.hub path.sel{stroke:var(--gold);opacity:1}
.node{position:absolute;transform:translate(-50%,-50%);width:190px;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;background:var(--surface);border:0;border-radius:22px;padding:16px 14px 14px;box-shadow:var(--shadow);cursor:pointer;transition:transform .18s,box-shadow .18s}
.node:hover{transform:translate(-50%,-50%) scale(1.04);box-shadow:var(--shadow-lg)}
.node[aria-pressed="true"]{box-shadow:var(--shadow-lg),inset 0 0 0 2px var(--gold)}
.node .avatar{width:52px;height:52px;font-size:22px}
.node .avatar .st{width:13px;height:13px}
.node .n{font-weight:700;font-size:16px;letter-spacing:-.01em}
.node .r{font-size:12.5px;color:var(--muted);margin-top:-6px}
.node .stats{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}
.node.center{width:230px;padding:22px 16px 18px;border-radius:28px}
.node.center .avatar{width:68px;height:68px;font-size:28px}
.node.center .n{font-size:19px}
.node .ask{font-size:12.5px;color:var(--gold);font-weight:500}
.node[data-k="direzione"] .avatar{background:linear-gradient(180deg,#5e5ce6,#3634a3)}
.node[data-k="ricezione"] .avatar{background:linear-gradient(180deg,#64d2ff,#0a84ff)}
.node[data-k="commerciale"] .avatar{background:linear-gradient(180deg,#30d158,#248a3d)}
.node[data-k="supply"] .avatar{background:linear-gradient(180deg,#ffb340,#ff9500)}
.node[data-k="marketing"] .avatar{background:linear-gradient(180deg,#ff6482,#ff2d55)}
.node[data-k="amministrazione"] .avatar{background:linear-gradient(180deg,#bf5af2,#8944ab)}
.node[data-k="assistenza"] .avatar{background:linear-gradient(180deg,#66d4cf,#00a39b)}
.node:not(.center){width:158px;padding:12px 10px 10px;gap:5px;border-radius:20px}
.node:not(.center) .avatar{width:42px;height:42px;font-size:18px}
.node:not(.center) .n{font-size:15px}
.node:not(.center) .r{font-size:11.5px;margin-top:-4px}
.node:not(.center) .ask{display:none!important}
.hub{margin-top:34px!important}
.node:not(.center) .stats .chip:last-child{display:none}
.node.center{width:206px}
.hub-foot{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}
@media (prefers-reduced-motion:no-preference){.hub path.flow{animation:flow 1.6s linear infinite}@keyframes flow{to{stroke-dashoffset:-32}}}
@media (max-width:1180px){.shell.map{grid-template-columns:minmax(0,1fr)}}
@media (max-width:760px){
 .hub{aspect-ratio:auto;min-height:0;max-height:none;display:flex;flex-direction:column;align-items:center;gap:12px;background:none}
 .hub svg{display:none}
 .node,.node.center{position:static;transform:none;width:100%;max-width:360px;flex-direction:row;text-align:left;padding:12px 14px;border-radius:18px}
 .node:hover{transform:none}
 .node .r{margin-top:0}.node .stats{justify-content:flex-start}
 .node > div{display:flex;flex-direction:column;gap:2px;min-width:0}
 .node.center{border:0;box-shadow:var(--shadow),inset 0 0 0 2px var(--gold-glow)}
}
/* Chat v2 */
.msg p{margin:0}
.msg p+p{margin-top:2px}
.msg .gap{height:8px}
.msg .h{font-weight:700;margin-top:4px}
.msg ul,.msg ol{margin:4px 0;padding-left:20px}
.msg li{margin:2px 0}
.msg strong{font-weight:650}
.msg code{font-family:var(--f-mono);font-size:12.5px;background:var(--surface-3);padding:1px 5px;border-radius:5px}
.msg.user code{background:rgba(255,255,255,.2)}
.msg.user a{color:#fff;text-decoration:underline}
.msg.assistant{white-space:normal}
.msg.user{white-space:pre-wrap}
.msg.sys:empty{display:none}
.atts{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:6px}
.att{display:inline-flex;align-items:center;gap:8px;background:var(--surface);color:var(--fg);border-radius:12px;padding:6px 10px 6px 6px;font-size:13px;max-width:100%;text-decoration:none}
.att:hover{text-decoration:none}
.att .ic,.draft .ic{display:grid;place-items:center;min-width:34px;height:34px;border-radius:8px;background:var(--gold-dim);color:var(--gold);font-size:10.5px;font-weight:700}
.att .nm,.draft .nm{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:190px}
.att.img{padding:0;background:none}.att.img img{width:160px;max-width:100%;border-radius:12px;display:block}
.dots{display:inline-flex;gap:4px;padding:4px 2px}.dots i{width:7px;height:7px;border-radius:50%;background:var(--muted);opacity:.4}
@media (prefers-reduced-motion:no-preference){.dots i{animation:blink 1.2s infinite}.dots i:nth-child(2){animation-delay:.2s}.dots i:nth-child(3){animation-delay:.4s}@keyframes blink{40%{opacity:1}}}
.drafts{display:flex;flex-wrap:wrap;gap:6px}
.draft{display:inline-flex;align-items:center;gap:8px;background:var(--surface-2);border-radius:12px;padding:5px 6px 5px 5px;font-size:13px}
.draft img{width:34px;height:34px;object-fit:cover;border-radius:8px}
.draft button{border:0;background:var(--surface-3);width:22px;height:22px;border-radius:50%;cursor:pointer;line-height:1;font-size:14px;color:var(--muted)}
.inrow{display:flex;align-items:flex-end;gap:8px;background:var(--surface-2);border-radius:22px;padding:5px 5px 5px 8px}
.inrow textarea{flex:1;background:transparent!important;border:0!important;min-height:34px;max-height:160px;padding:7px 4px;resize:none;border-radius:0}
.inrow textarea:focus{outline:none}
.inrow:focus-within{box-shadow:0 0 0 2px var(--gold-glow)}
.clip{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;color:var(--muted);cursor:pointer;flex:none}
.clip:hover{color:var(--gold);background:var(--gold-dim)}
.send{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;border:0;background:var(--gold);color:#fff;cursor:pointer;flex:none}
.send[disabled]{opacity:.35;cursor:not-allowed}
.send.stop{background:var(--fg);color:var(--surface)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.foot2{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:11.5px;color:var(--muted);padding:0 6px}
.chat.drop{box-shadow:0 0 0 3px var(--gold),var(--shadow-lg)}
.chat.drop .msgs{background:var(--gold-dim)}
.composer{gap:10px}
.supgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.card.sup h3{font-size:17px}
@media (max-width:760px){.supgrid{grid-template-columns:minmax(0,1fr)}}

/* Grafici e liste ordinate */
.charts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.card.chart{gap:16px}
.hb{display:flex;flex-direction:column;gap:9px}
.hb-row{display:grid;grid-template-columns:minmax(90px,38%) minmax(0,1fr) auto;gap:10px;align-items:center;font-size:13px}
.hb-l{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hb-t{height:10px;background:var(--surface-2);border-radius:6px;overflow:hidden}.hb-t i{display:block;height:100%;background:var(--gold);border-radius:6px}
.hb-v{font-weight:600;text-align:right;white-space:nowrap}.hb-v small{display:block;font-weight:400;color:var(--muted);font-size:11.5px}
.vb{position:relative;display:flex;align-items:flex-end;gap:6px;height:170px;padding-top:18px}
.vb-col{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;gap:4px;height:100%}
.vb-n{font-size:12px;font-weight:600}
.vb-bar{flex:1;width:100%;max-width:34px;display:flex;align-items:flex-end;background:var(--surface-2);border-radius:6px;overflow:hidden}.vb-bar i{display:block;width:100%;background:var(--gold);border-radius:6px 6px 0 0}
.vb-l{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.vb-goal{position:absolute;left:0;right:0;border-top:1.5px dashed var(--line-2);margin-bottom:38px;pointer-events:none}.vb-goal em{position:absolute;right:0;top:-17px;font-size:11px;color:var(--muted);font-style:normal}
.card.list{padding:6px;gap:0}
.lrow{display:grid;grid-template-columns:minmax(0,1fr) auto 110px;gap:12px;align-items:center;padding:12px 14px;border:0;background:none;text-align:left;cursor:pointer;border-radius:12px;width:100%}
.lrow:hover{background:var(--surface-2)}.lrow .s{display:block;color:var(--muted);font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lrow .num{text-align:right;font-weight:600}
.cats{display:flex;gap:6px;flex-wrap:wrap}
.cats button{border:0;background:var(--surface);box-shadow:var(--shadow);border-radius:980px;padding:8px 14px;font-size:14px;font-weight:500;cursor:pointer;display:inline-flex;gap:8px;align-items:center}
.cats button span{font-size:12px;color:var(--muted);background:var(--surface-2);border-radius:980px;padding:1px 8px}
.cats button[aria-selected="true"]{background:var(--gold);color:var(--on-accent)}.cats button[aria-selected="true"] span{background:rgba(255,255,255,.22);color:var(--on-accent)}
.srow{border-radius:12px}.srow+.srow{border-top:1px solid var(--line)}
.srow summary{list-style:none;display:grid;grid-template-columns:28px minmax(0,1fr) 120px 200px 96px;gap:12px;align-items:center;padding:12px 10px;cursor:pointer;border-radius:12px}
.srow summary::-webkit-details-marker{display:none}.srow summary:hover{background:var(--surface-2)}
.srow .rk{color:var(--muted);font-weight:600;text-align:center}.srow .sn .s{display:block;color:var(--muted);font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.srow summary .chip{justify-self:start}.srow .sc{display:flex;align-items:center;gap:8px;font-weight:600;font-size:13px}
.mini{flex:1;height:6px;background:var(--surface-2);border-radius:6px;overflow:hidden}.mini i{display:block;height:100%;background:var(--gold)}
.sdet{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 18px;padding:4px 10px 16px 50px;font-size:14px}.sdet .actions{grid-column:1/-1}
.more{background:var(--surface);border-radius:var(--r);box-shadow:var(--shadow)}
.more>summary{cursor:pointer;padding:16px 20px;font-weight:600;color:var(--muted);font-size:14px}
.more[open]>summary{border-bottom:1px solid var(--line)}
.more-in{display:flex;flex-direction:column;gap:28px;padding:20px;background:var(--bg);border-radius:0 0 var(--r) var(--r)}
.subh{font-size:17px;font-weight:600;margin-top:6px}
@media (max-width:900px){.charts{grid-template-columns:minmax(0,1fr)}.srow summary{grid-template-columns:24px minmax(0,1fr) auto}.srow .sc,.srow summary .chip:last-child{display:none}.sdet{grid-template-columns:minmax(0,1fr);padding-left:10px}.lrow{grid-template-columns:minmax(0,1fr) auto}.lrow .num{display:none}}

.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px}
.tile{border:0;background:var(--surface);border-radius:var(--r);box-shadow:var(--shadow);padding:16px;display:flex;flex-direction:column;gap:14px;text-align:left;cursor:pointer;transition:transform .12s,box-shadow .12s}
.tile:hover{transform:translateY(-1px);box-shadow:var(--shadow-lg)}
.tile-h{display:grid;grid-template-columns:36px minmax(0,1fr) auto;gap:10px;align-items:center}
.tile .s{display:block;color:var(--muted);font-size:12px;line-height:1.3}
.tile-m{display:grid;grid-template-columns:1fr 1fr;gap:10px}.tile-m b{font-family:var(--f-display);font-size:24px;letter-spacing:-.02em;display:block}
.tile-f{display:flex;justify-content:space-between;align-items:center;gap:8px}
.dot.ok{background:var(--ok)}.dot.warn{background:var(--warn)}.dot.crit{background:var(--crit)}
.avatar[data-k="ricezione"]{background:linear-gradient(180deg,#64d2ff,#0a84ff)}.avatar[data-k="commerciale"]{background:linear-gradient(180deg,#30d158,#248a3d)}.avatar[data-k="supply"]{background:linear-gradient(180deg,#ffb340,#ff9500)}.avatar[data-k="marketing"]{background:linear-gradient(180deg,#ff6482,#ff2d55)}.avatar[data-k="amministrazione"]{background:linear-gradient(180deg,#bf5af2,#8944ab)}.avatar[data-k="assistenza"]{background:linear-gradient(180deg,#66d4cf,#00a39b)}

