/* REGIA · 24RIGGING — pelle derivata da SIGILLO «Nova» (barra di vetro, menu con gruppi, schede, contorno laser,
   riquadri di stato con barra laterale), ricolorata col marchio: nero palco e giallo del logo (#ffb81c). */

:root {
  --fs: 16px;
  --sans: -apple-system, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --disp: -apple-system, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, monospace;
  --top: 60px; --radius: 14px;
  /* tema chiaro «Giorno» */
  --bg: #f6f7f9; --bg2: #eef0f4; --card: #ffffff; --card2: #fbfcfd; --line: #e7eaf0; --line2: #d6dce6;
  --ink: #0a1220; --ink2: #3a4556; --muted: #6a7586;
  --accent: #b97800; --accent2: #e8780f; --accent-ink: #111; --accent-fill: #ffb81c; --accent-soft: #fff5dc;
  --ok: #1e7b4f; --ok-soft: #e2f3ea; --warn: #9a6400; --warn-soft: #fdf2d8; --bad: #b3261e; --bad-soft: #fbe7e5;
  --info: #2f6bff; --info-soft: #eef3ff; --violet: #7a4fd0; --violet-soft: #f1ebfd;
  --glass: rgba(255,255,255,.78); --shadow: 0 24px 60px rgba(10,18,32,.16);
  --c1: #b97800; --c2: #2f6bff;
  color-scheme: light;
}
/* tema scuro «Palco»: è il predefinito, come il sito e il logo */
:root:not([data-tema="chiaro"]) {
  --bg: #0a0c10; --bg2: #11141a; --card: #12151b; --card2: #161a21; --line: #222833; --line2: #2e3542;
  --ink: #eef1f6; --ink2: #b9c1cf; --muted: #808a9b;
  --accent: #ffb81c; --accent2: #ff8a1c; --accent-ink: #14100a; --accent-fill: #ffb81c; --accent-soft: rgba(255,184,28,.12);
  --ok: #5cc98f; --ok-soft: rgba(92,201,143,.13); --warn: #e6b34d; --warn-soft: rgba(230,179,77,.14); --bad: #f07a71; --bad-soft: rgba(240,122,113,.14);
  --info: #6bb7ff; --info-soft: rgba(107,183,255,.13); --violet: #c58cf0; --violet-soft: rgba(197,140,240,.14);
  --glass: rgba(12,14,19,.78); --shadow: 0 30px 80px rgba(0,0,0,.55);
  --c1: #b98000; --c2: #3a86d4;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) { :root[data-tema="sistema"] {
  --bg: #f6f7f9; --bg2: #eef0f4; --card: #ffffff; --card2: #fbfcfd; --line: #e7eaf0; --line2: #d6dce6;
  --ink: #0a1220; --ink2: #3a4556; --muted: #6a7586;
  --accent: #b97800; --accent2: #e8780f; --accent-ink: #111; --accent-fill: #ffb81c; --accent-soft: #fff5dc;
  --ok: #1e7b4f; --ok-soft: #e2f3ea; --warn: #9a6400; --warn-soft: #fdf2d8; --bad: #b3261e; --bad-soft: #fbe7e5;
  --info: #2f6bff; --info-soft: #eef3ff; --violet: #7a4fd0; --violet-soft: #f1ebfd;
  --glass: rgba(255,255,255,.78); --shadow: 0 24px 60px rgba(10,18,32,.16); --c1: #b97800; --c2: #2f6bff; color-scheme: light; } }

* { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); letter-spacing: -.003em; line-height: 1.45; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--disp); font-weight: 600; letter-spacing: -.02em; margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.15; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
.mono, .k, th, .grp { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: .84rem; } .tiny { font-size: .74rem; }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--card); border-radius: 10px; min-height: 38px; padding: .4rem .9rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: border-color .15s, background .15s, transform .1s; white-space: nowrap; }
button:hover { border-color: var(--line2); } button:active { transform: translateY(1px); }
button.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); font-weight: 600; }
button.primary:hover { filter: brightness(1.06); }
button.ghost { background: transparent; border-color: transparent; color: var(--ink2); }
button.ghost:hover { background: var(--bg2); }
button.danger { color: var(--bad); }
button.sm { min-height: 30px; padding: .2rem .65rem; font-size: .84rem; border-radius: 8px; }
button[disabled] { opacity: .45; cursor: not-allowed; }
input, select, textarea { width: 100%; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; min-height: 40px; outline: none; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 2px; }
label.f { display: grid; gap: 6px; font-size: .84rem; color: var(--ink2); }
label.f > span { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ------------------------------------------------ barra in alto, di vetro (SIGILLO) */
.top { position: sticky; top: 0; z-index: 50; height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--glass); -webkit-backdrop-filter: saturate(1.8) blur(18px); backdrop-filter: saturate(1.8) blur(18px); border-bottom: 1px solid var(--line); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent2) 30%, var(--accent) 70%, transparent); opacity: .45; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; margin-right: 6px; }
.brand img { height: 30px; width: auto; border-radius: 6px; background: #0a0c10; padding: 2px 4px; }
.brand b { font-family: var(--mono); font-size: .74rem; letter-spacing: .26em; font-weight: 600; }
.brand small { font-family: var(--mono); font-size: .62rem; letter-spacing: .18em; color: var(--muted); display: block; }
.qbtn { min-width: 240px; justify-content: space-between; color: var(--muted); background: var(--bg2); border-color: transparent; }
.qbtn kbd { font-family: var(--mono); font-size: .72rem; border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.top .sp { flex: 1; }
.bell { position: relative; width: 38px; padding: 0; }
.bell i { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: 99px; background: var(--accent-fill); color: var(--accent-ink);
  font-style: normal; font-size: .64rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.me-btn { padding: .25rem .6rem .25rem .3rem; border-radius: 99px; }

/* ------------------------------------------------ struttura */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
nav.side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 16px 12px 30px; border-right: 1px solid var(--line); }
nav.side .grp { font-size: .64rem; letter-spacing: .18em; margin: 20px 10px 6px; color: var(--muted); text-transform: uppercase; }
nav.side .grp:first-child { margin-top: 2px; }
nav.side button { width: 100%; justify-content: flex-start; border: 0; background: transparent; color: var(--ink2); padding: .45rem .7rem; margin: 1px 0; font-size: .93rem; position: relative; }
nav.side button .ic { width: 20px; text-align: center; color: var(--muted); font-size: .95rem; }
nav.side button .n { margin-left: auto; font-size: .72rem; color: var(--muted); font-family: var(--mono); }
nav.side button .n.hot { color: var(--accent-ink); background: var(--accent-fill); border-radius: 99px; padding: 0 6px; font-weight: 700; }
nav.side button:hover { background: var(--bg2); }
nav.side button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px var(--line); }
nav.side button.on .ic { color: var(--accent); }
nav.side button.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: linear-gradient(180deg, var(--accent), var(--accent2)); }
nav.side .foot { margin: 26px 10px 0; font-size: .72rem; color: var(--muted); }
main { padding: 26px clamp(16px, 3vw, 44px) 120px; min-width: 0; }
.wrap-max { max-width: 1280px; }

/* ------------------------------------------------ testata della pagina */
.hero { padding: 2px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 20px; display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.hero .k { font-size: .68rem; letter-spacing: .2em; color: var(--accent); text-transform: uppercase; }
.hero h1 { margin: 6px 0 4px; } .hero h1 .dot { color: var(--accent2); }
.hero p { color: var(--muted); margin: 0; max-width: 820px; font-size: .95rem; }
.hero .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------ superfici */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.main-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; min-width: 0; }
.card.click { cursor: pointer; }
.card h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card h2 .k { font-size: .64rem; letter-spacing: .16em; color: var(--muted); font-weight: 500; text-transform: uppercase; margin-left: auto; }
.card .sub { color: var(--muted); font-size: .86rem; margin: -6px 0 10px; }
.sec { margin: 26px 0 10px; display: flex; align-items: baseline; gap: 10px; }
.sec h2 { font-size: 1.02rem; } .sec .k { font-size: .64rem; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.empty { border: 1px dashed var(--line2); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); background: var(--card2); }
.empty b { color: var(--ink2); display: block; margin-bottom: 4px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* riquadro di stato con barra laterale (SIGILLO «nv-stato») */
.stato { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px 28px; align-items: center; border-radius: 16px; padding: 18px 22px;
  border: 1px solid var(--line); background: var(--card); position: relative; overflow: hidden; margin-bottom: 20px; }
.stato::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--accent), var(--accent2)); }
.stato.ok::before { background: linear-gradient(180deg, #3ddc97, #1e7b4f); }
.stato .k { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stato .t { font-family: var(--disp); font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; margin: 4px 0 2px; }
.stato .s { color: var(--muted); font-size: .9rem; }
.stato ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.stato li { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--ink2); cursor: pointer; }
.stato li::before { content: "✓"; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: .7rem; font-weight: 700; background: var(--ok-soft); color: var(--ok); }
.stato li.no::before { content: "!"; background: var(--warn-soft); color: var(--warn); }
.stato li:hover { color: var(--ink); }

/* prossimo passo (SIGILLO «nv-passo») */
.passo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); margin: 10px 0; }
.passo > span { font-family: var(--mono); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.passo b { flex: 1 1 260px; font-weight: 600; font-size: .92rem; }

/* schede a segmenti (SIGILLO «nv-tabs») */
.tabs { display: flex; align-items: center; gap: 4px; padding: 4px; margin: 0 0 16px; background: var(--bg2); border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: transparent; min-height: 34px; padding: .35rem .9rem; border-radius: 9px; color: var(--ink2); font-size: .9rem; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.tabs .n { font-size: .74rem; color: var(--muted); margin-left: 2px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 10px; }

/* persone */
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .66rem; font-weight: 700; color: #111; flex: none; letter-spacing: 0; }
.av.lg { width: 36px; height: 36px; font-size: .8rem; }
.who { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; }
.avs { display: inline-flex; } .avs .av { margin-left: -6px; box-shadow: 0 0 0 2px var(--card); } .avs .av:first-child { margin-left: 0; }

/* stato delle attività: stessi nomi e colori della checklist di Giorgio */
.st { display: inline-flex; align-items: center; gap: 6px; border: 0; border-left: 3px solid; border-radius: 8px; padding: .2rem .65rem; min-height: 28px; font-size: .84rem; font-weight: 600; cursor: pointer; }
.st.todo { color: var(--bad); background: var(--bad-soft); border-color: var(--bad); }
.st.doing { color: var(--warn); background: var(--warn-soft); border-color: var(--warn); }
.st.done { color: var(--ok); background: var(--ok-soft); border-color: var(--ok); }
.st.tbd { color: var(--muted); background: var(--bg2); border-color: var(--muted); }
.legend { display: flex; gap: 8px; flex-wrap: wrap; }
.legend .st { opacity: .55; } .legend .st.on { opacity: 1; box-shadow: 0 0 0 1px currentColor inset; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; padding: 2px 9px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line); color: var(--ink2); white-space: nowrap; }
.pill.acc { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill.vio { background: var(--violet-soft); color: var(--violet); border-color: transparent; }

/* scheda attività: la struttura della checklist di Giorgio */
.task { display: grid; gap: 8px; }
.task .tt { font-family: var(--disp); font-size: 1.08rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
.task.done .tt { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line2); }
.task .nt { color: var(--muted); font-size: .9rem; }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 12px; font-size: .9rem; margin-top: 4px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.due.late { color: var(--bad); font-weight: 600; } .due.soon { color: var(--warn); font-weight: 600; }
.trow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.trow:last-child { border-bottom: 0; } .trow:hover { background: var(--card2); }
.trow .tt { font-weight: 550; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow.done .tt { color: var(--muted); text-decoration: line-through; }
.chk { width: 22px; height: 22px; min-height: 22px; padding: 0; border-radius: 7px; border: 1.5px solid var(--line2); background: transparent; }
.chk.on { background: var(--ok); border-color: var(--ok); color: #fff; } .chk.on::after { content: "✓"; font-size: .75rem; font-weight: 800; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.daygrp { font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 10px 12px 6px; background: var(--card2); border-bottom: 1px solid var(--line); }
.daygrp.today { color: var(--accent); }

/* aggiunta veloce */
.quick { display: flex; gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px 6px 14px; margin-bottom: 8px; }
.quick:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.quick input { border: 0; background: transparent; box-shadow: none !important; padding: .4rem 0; }
.quick .plus { color: var(--accent); font-weight: 700; font-size: 1.2rem; }
.qprev { display: flex; gap: 6px; flex-wrap: wrap; min-height: 24px; margin: 0 0 14px 4px; font-size: .8rem; color: var(--muted); }

/* barre e misure */
.bar { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; position: relative; }
.bar > i { position: absolute; top: 0; bottom: 0; left: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 99px; }
.vbar { height: 26px; display: flex; border-radius: 9px; overflow: visible; background: var(--bg2); position: relative; border: 1px solid var(--line); }
.vbar > span:first-child { border-radius: 8px 0 0 8px; } .vbar > span:last-of-type { border-radius: 0 8px 8px 0; border-right: 0; }
.vbar > span { display: grid; place-items: center; font-size: .7rem; font-weight: 700; color: #111; border-right: 1px solid rgba(0,0,0,.18); }
.vbar > span.si { background: var(--ok); } .vbar > span.no { background: var(--bad); } .vbar > span.astenuto { background: var(--muted); } .vbar > span.attesa { background: transparent; color: var(--muted); }
.vbar .soglia { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.vbar .soglia::after { content: attr(data-l); position: absolute; top: -18px; left: 4px; font-size: .64rem; font-family: var(--mono); color: var(--muted); white-space: nowrap; }
.big { font-family: var(--disp); font-size: 2rem; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .k { font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* tabelle */
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--card2); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--card2); }
.tbl .r { text-align: right; }
.scroll-x { overflow-x: auto; }

/* matrice dei ruoli */
.matrix td, .matrix th { text-align: center; } .matrix td:first-child, .matrix th:first-child { text-align: left; }
.cell { width: 40px; height: 34px; min-height: 0; padding: 0; border-radius: 9px; font-family: var(--mono); font-weight: 700; font-size: .8rem; }
.cell.c { background: var(--accent-fill); color: var(--accent-ink); border-color: var(--accent-fill); }
.cell.s { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.cell.x { color: var(--line2); background: transparent; }

/* commesse: colonne della pipeline */
.pipe { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--bg2); border-radius: 14px; padding: 10px; min-height: 160px; }
.col h3 { font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 2px 4px 10px; display: flex; gap: 6px; }
.col h3 b { margin-left: auto; color: var(--ink2); }
.col .card { padding: 12px 14px; margin-bottom: 8px; }
.steps { display: flex; gap: 4px; overflow-x: auto; padding: 2px; }
.steps button { flex: 1 0 auto; border-radius: 8px; font-size: .78rem; min-height: 34px; padding: .2rem .7rem; color: var(--muted); }
.steps button.past { color: var(--ink2); background: var(--bg2); border-color: transparent; }
.steps button.cur { background: var(--accent-fill); color: var(--accent-ink); border-color: var(--accent-fill); font-weight: 700; }
.gate { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: .9rem; cursor: pointer; }
.gate .chk { flex: none; margin-top: 1px; }
.donut { width: 168px; height: 168px; flex: none; }
.legend-k { display: grid; gap: 6px; font-size: .88rem; flex: 1; min-width: 200px; }
.legend-k div { display: grid; grid-template-columns: 12px minmax(0,1fr) auto auto; gap: 10px; align-items: center; }
.legend-k i { width: 12px; height: 12px; border-radius: 3px; }
.legend-k input { width: 64px; min-height: 30px; padding: .15rem .4rem; text-align: right; }
.kick { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.kick button { flex-direction: column; min-height: 76px; gap: 4px; font-weight: 600; border-radius: 14px; }
.kick button span { font-size: 1.4rem; }

/* sondaggio date */
.poll td, .poll th { text-align: center; } .poll td:first-child, .poll th:first-child { text-align: left; }
.av3 { display: inline-flex; gap: 3px; }
.av3 button { width: 34px; min-height: 30px; padding: 0; font-size: .85rem; border-radius: 8px; }
.av3 button.on.si { background: var(--ok); color: #fff; border-color: var(--ok); }
.av3 button.on.forse { background: var(--warn); color: #111; border-color: var(--warn); }
.av3 button.on.no { background: var(--bad); color: #fff; border-color: var(--bad); }
.mark { font-weight: 700; } .mark.si { color: var(--ok); } .mark.forse { color: var(--warn); } .mark.no { color: var(--bad); }
tr.best td { background: var(--ok-soft); }

/* documenti: cartelle e pallini «chi lo vede» (SIGILLO) */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; }
.folders button { width: 100%; justify-content: flex-start; border: 0; background: transparent; color: var(--ink2); font-size: .9rem; }
.folders button.on { background: var(--card); box-shadow: 0 0 0 1px var(--line); color: var(--ink); font-weight: 600; }
.folders button .n { margin-left: auto; font-size: .72rem; color: var(--muted); }
.drop { border: 1.5px dashed var(--line2); border-radius: 14px; padding: 16px; text-align: center; color: var(--muted); margin-bottom: 12px; transition: background .15s, border-color .15s; }
.drop.over { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.vis { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.vis.tutti { background: var(--ok); border-color: var(--ok); } .vis.soci { background: var(--info); border-color: var(--info); } .vis.cda { background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); border-color: var(--accent); }
.seal { font-family: var(--mono); font-size: .72rem; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.seal::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: conic-gradient(var(--accent), var(--accent2), var(--accent)); }

/* finestre: al centro sul computer, dal basso sul telefono */
.scrim { position: fixed; inset: 0; background: rgba(4,6,10,.55); z-index: 80; display: grid; place-items: center; padding: 20px; animation: fade .15s ease; }
.sheet { width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 20px 22px; animation: rise .2s cubic-bezier(.2,.8,.2,1); }
.sheet.wide { width: min(920px, 100%); }
.sheet h2 { font-size: 1.2rem; margin-bottom: 4px; } .sheet .sub { color: var(--muted); margin: 0 0 14px; font-size: .9rem; }
.sheet .fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; } .sheet .fgrid .full { grid-column: 1 / -1; }
.sheet .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; } .sheet .acts .left { margin-right: auto; }
.picker { display: flex; flex-wrap: wrap; gap: 6px; }
.picker button { border-radius: 99px; min-height: 32px; padding: .15rem .7rem .15rem .25rem; font-size: .86rem; }
.picker button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.picker button:not(:has(.av)) { padding: .15rem .8rem; }
@keyframes fade { from { opacity: 0; } } @keyframes rise { from { transform: translateY(14px); opacity: 0; } }

/* tavolozza dei comandi */
.pal { align-items: start; padding-top: 12vh; }
.pal .sheet { padding: 0; overflow: hidden; width: min(640px, 100%); }
.pal input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; min-height: 56px; font-size: 1.05rem; padding: 0 18px; box-shadow: none !important; background: transparent; }
.pal ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.pal li { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: .93rem; }
.pal li .k { margin-left: auto; font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.pal li.on { background: var(--accent-soft); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--bg); padding: .65rem 1.1rem; border-radius: 12px; font-size: .9rem; box-shadow: var(--shadow); animation: rise .2s; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); color: #fff; }

/* accesso */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(1200px 500px at 50% -10%, rgba(255,184,28,.16), transparent 60%), var(--bg); }
.login .box { width: min(440px, 100%); text-align: center; }
.login img { width: 240px; max-width: 70%; margin-bottom: 18px; }
.login h1 { font-size: 1.5rem; margin-bottom: 6px; } .login p { color: var(--muted); margin: 0 0 22px; }
.login .discord { width: 100%; min-height: 50px; background: #5865f2; border-color: #5865f2; color: #fff; font-weight: 600; font-size: 1rem; border-radius: 12px; }
.login .devs { display: grid; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line2); }

/* contorno laser al passaggio del mouse (SIGILLO, blocco QLASER) */
@property --la { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.laser { position: fixed; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 70; opacity: 0; padding: 1.5px; border-radius: 10px; transition: opacity .18s ease;
  background: conic-gradient(from var(--la), transparent 0deg, transparent 250deg, rgba(255,138,28,.6) 300deg, #fff1c7 345deg, var(--accent) 352deg, rgba(255,138,28,.6) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  filter: drop-shadow(0 0 4px rgba(255,184,28,.5)); animation: laser 1.8s linear infinite; }
.laser.on { opacity: 1; }
@keyframes laser { to { --la: 360deg; } }
.acceso { box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 4px var(--accent-soft), 0 0 26px rgba(255,184,28,.22) !important; transition: box-shadow .18s ease; }
@media (prefers-reduced-motion: reduce) { .laser { animation: none; background: var(--accent); } .sheet, .scrim, .toast { animation: none; } }
@media (hover: none) { .laser { display: none; } .acceso { box-shadow: none !important; } }

/* barra in basso sul telefono */
.tabbar { display: none; }
.fab { display: none; }

@media (max-width: 1100px) {
  .main-side { grid-template-columns: 1fr; }
  .qbtn { min-width: 0; } .qbtn span, .qbtn kbd { display: none; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  nav.side { display: none; }
  main { padding: 18px 16px 120px; }
  .brand small, .me-btn .nm { display: none; }
  .top .newbtn { display: none; }
  h1 { font-size: 1.45rem; }
  .stato { grid-template-columns: 1fr; padding: 16px 18px; }
  .docs { grid-template-columns: 1fr; }
  .folders { display: flex; overflow-x: auto; gap: 4px; } .folders button { width: auto; flex: none; }
  .kv { grid-template-columns: 104px minmax(0, 1fr); }
  .trow { grid-template-columns: auto minmax(0, 1fr) auto; } .trow .who-c { display: none; }
  .sheet .fgrid { grid-template-columns: 1fr; }
  .scrim { align-items: end; padding: 0; } .pal { align-items: start; padding: 10px; }
  .sheet { border-radius: 20px 20px 0 0; max-height: 92vh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .pal .sheet { border-radius: 16px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--glass);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar button { flex-direction: column; gap: 2px; border: 0; background: transparent; font-size: .66rem; color: var(--muted); min-height: 50px; padding: 2px; }
  .tabbar button .ic { font-size: 1.15rem; } .tabbar button.on { color: var(--accent); }
  .poll th, .poll td { padding: 8px 4px; } .poll .av3 button { width: 30px; } .poll td:first-child b { font-size: .82rem; }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .fab { display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 61; width: 56px; height: 56px; border-radius: 18px;
    background: var(--accent-fill); color: var(--accent-ink); border: 0; font-size: 1.7rem; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.35); }
  .pipe { grid-auto-columns: minmax(78vw, 1fr); scroll-snap-type: x mandatory; } .col { scroll-snap-align: start; }
}
@media print { .top, nav.side, .tabbar, .fab { display: none !important; } .shell { display: block; } body { background: #fff; color: #000; } }

/* ------------------------------------------------ gestionale: calendario del mese */
.cal { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.cal-h, .cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-h div { font-family: var(--mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; background: var(--card2); border-bottom: 1px solid var(--line); }
.cal-d { min-height: 112px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d.out { background: var(--bg2); opacity: .55; }
.cal-d.today .cal-n { background: var(--accent-fill); color: var(--accent-ink); }
.cal-n { font-size: .78rem; font-weight: 600; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal-i { display: block; font-size: .72rem; line-height: 1.25; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--c) 18%, transparent); border-left: 3px solid var(--c); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none !important; }
.cal-list { display: none; }

/* squadre e disponibilità */
.sq th, .sq td { text-align: center; padding: 6px 4px; } .sq th:first-child, .sq td:first-child { text-align: left; padding-left: 10px; white-space: nowrap; }
.sq th.today { color: var(--accent); }
.sqc { width: 30px; height: 28px; min-height: 0; padding: 0; border-radius: 8px; font-size: .8rem; font-weight: 700; display: inline-grid; place-items: center; border: 1px solid var(--line); background: transparent; color: var(--muted); }
.sqc.disponibile { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.sqc.forse { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.sqc.impegnato { background: var(--accent-fill); color: var(--accent-ink); border-color: transparent; }
.sqc.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
#pvTbl input, #pvTbl select { min-height: 34px; padding: .3rem .5rem; }

/* stampe su carta intestata (A4) */
.print-bar { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; justify-content: space-between; padding: 12px 16px; background: var(--glass); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.sheetA4 { width: min(210mm, calc(100vw - 24px)); min-height: 297mm; margin: 20px auto 60px; background: #fff; color: #111; padding: 16mm 16mm 14mm; box-shadow: 0 20px 60px rgba(0,0,0,.35); border-radius: 4px; font-size: 10.5pt; line-height: 1.45; display: flex; flex-direction: column; }
.lh { display: flex; gap: 14px; align-items: center; padding-bottom: 10px; border-bottom: 2px solid #ffb81c; margin-bottom: 18px; }
.lh img { height: 52px; background: #0a0c10; border-radius: 6px; padding: 4px 8px; }
.lh div { display: grid; font-size: 9pt; color: #444; } .lh b { font-size: 12pt; color: #111; letter-spacing: .02em; }
.lh-row { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; font-size: 10pt; }
.lh-k { font-family: var(--mono); font-size: 7.5pt; letter-spacing: .16em; text-transform: uppercase; color: #8a6200; margin-bottom: 3px; }
.lh-t { font-size: 15pt; margin: 0 0 12px; color: #111; letter-spacing: -.01em; }
.lh-s { font-size: 8.5pt; color: #666; }
.lh-tbl { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.lh-tbl th { text-align: left; font-size: 7.5pt; letter-spacing: .12em; text-transform: uppercase; color: #666; border-bottom: 1.5px solid #111; padding: 6px 6px; font-family: var(--mono); font-weight: 500; }
.lh-tbl td { border-bottom: 1px solid #e3e3e3; padding: 7px 6px; vertical-align: top; }
.lh-tbl .r, .lh-tot .r { text-align: right; font-variant-numeric: tabular-nums; }
.lh-tot { margin: 12px 0 0 auto; border-collapse: collapse; min-width: 260px; font-size: 10pt; }
.lh-tot td { padding: 4px 6px; } .lh-tot tr.big td { font-weight: 700; font-size: 12pt; border-top: 1.5px solid #111; padding-top: 8px; }
.lh-cond { margin-top: 22px; font-size: 9pt; color: #333; }
.lh-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; font-size: 9pt; color: #444; }
.lh-sign div { border-top: 1px solid #999; padding-top: 6px; margin-top: 40px; }
.lh-f { margin-top: auto; padding-top: 14px; font-size: 7.5pt; color: #888; border-top: 1px solid #eee; text-align: center; }

@media (max-width: 820px) {
  .cal { display: none; } .cal-list { display: block; }
  .sheetA4 { padding: 18px; min-height: 0; font-size: 10pt; }
}
@media print {
  @page { size: A4; margin: 0; }
  .print-bar, .laser { display: none !important; }
  body { background: #fff !important; }
  .sheetA4 { width: auto; min-height: 0; margin: 0; box-shadow: none; border-radius: 0; padding: 14mm 15mm; }
  .main-side, .grid { display: block; } .card { break-inside: avoid; margin-bottom: 10px; }
}

/* collaboratore esterno: niente economia, niente comandi che non può usare */
body.collab .no-collab, body.collab [data-a="editCommessa"], body.collab [data-a="seqTemplate"] { display: none !important; }
body.collab [data-a="stage"], body.collab [data-a="gate"], body.collab [data-a="teamToggle"] { pointer-events: none; opacity: .55; }

/* ---------------------------------------------------------------- connessioni (06/10/2026) */
.semdot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; background: var(--line2); box-shadow: 0 0 0 2px var(--card); }
.semdot.verde { background: #2fbf71; box-shadow: 0 0 0 2px var(--card), 0 0 10px rgba(47,191,113,.7); }
.semdot.giallo { background: #e6b34d; } .semdot.rosso { background: #e0554b; }
.sembar { min-width: 38px; padding: 0 .55rem; } .guidebtn { min-width: 38px; padding: 0 .55rem; }
.sembtn { flex-direction: column; min-height: 74px; gap: 6px; font-size: .86rem; white-space: normal; text-align: center; }
.sembtn .semdot { width: 18px; height: 18px; } .sembtn.on { border-color: var(--accent); background: var(--accent-soft); }
.presrow { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chat { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.chatlist { height: min(62vh, 640px); overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.bub { display: flex; gap: 8px; align-items: flex-end; max-width: 82%; }
.bub .txt { background: var(--bg2); border: 1px solid var(--line); padding: 8px 12px; border-radius: 14px 14px 14px 4px; font-size: .92rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.bub.mine { align-self: flex-end; flex-direction: row-reverse; } .bub.mine .txt { background: var(--accent-soft); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.bub.mine > div > .tiny { text-align: right; }
.bub.bot .txt { background: var(--card2); }
.chatin { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--card); }
.guide .chatin { border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; }
.glog { max-height: 42vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.glog:empty { display: none; }
.glog .bub { max-width: 92%; } .glog .bub.mine .txt { white-space: normal; }
.gchips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 34vh; overflow-y: auto; }
.gchips details { width: 100%; } .gchips summary { cursor: pointer; list-style: none; }
.glbl { width: 100%; letter-spacing: .16em; margin-top: 6px; }
.chip { min-height: 30px; font-size: .82rem; padding: .25rem .7rem; border-radius: 99px; white-space: normal; text-align: left; margin: 0 4px 4px 0; }
.chip.live { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.gmore { display: flex; flex-wrap: wrap; margin-top: 6px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .clbl { font: 500 11px var(--mono); fill: var(--muted); } .chart .clbl.strong { fill: var(--ink); font-weight: 600; }
.chart .hit:hover circle:last-of-type, .chart .hit:hover rect:first-child { filter: brightness(1.15); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--ink2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sbar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--bg2); }
.sbar i { display: block; height: 100%; border-radius: 4px; }
.sbar i[style*="width:0%"] { display: none; }
.tile.click { cursor: pointer; }
@media (max-width: 720px) { .bub { max-width: 94%; } .chatlist { height: 58vh; } }
@media print { .chatin, .gchips { display: none; } }
