/* =====================================================================
   Michael Films · design system (stile Apple / iOS, Montserrat)
   ===================================================================== */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/montserrat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --bg: #F2F2F7;
  --bg-elev: #FFFFFF;
  --bg-fill: rgba(118,118,128,.12);
  --bg-fill-2: rgba(118,118,128,.08);
  --label: #1D1D1F;
  --label-2: rgba(60,60,67,.62);
  --label-3: rgba(60,60,67,.34);
  --sep: rgba(60,60,67,.16);
  --tint: #2A264C;          /* blu Michael Films */
  --tint-soft: rgba(42,38,76,.08);
  --orange: #F08A24;        /* arancione Michael Films */
  --red: #FF3B30;
  --green: #34C759;
  --yellow: #FFCC00;
  --amber: #FF9500;
  --blue: #007AFF;
  --bar: rgba(249,249,251,.78);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 18px rgba(0,0,0,.05);
  --r: 20px;
  --r-sm: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
  --glass: rgba(255,255,255,.72);
  --glass-border: rgba(255,255,255,.6);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --bg-elev: #1C1C1E; --bg-fill: rgba(118,118,128,.24); --bg-fill-2: rgba(118,118,128,.16);
    --label: #F5F5F7; --label-2: rgba(235,235,245,.62); --label-3: rgba(235,235,245,.3); --sep: rgba(84,84,88,.6);
    --tint: #A9A3F0; --tint-soft: rgba(169,163,240,.14); --bar: rgba(22,22,24,.78); --shadow: none;
    --glass: rgba(40,40,44,.7); --glass-border: rgba(255,255,255,.08);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.4; letter-spacing: -.005em; font-weight: 450;
  color: var(--label); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--label-2); }
.small { font-size: 13px; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Struttura ---------- */
.app { min-height: 100vh; }
.main { padding: calc(var(--safe-t) + 56px) 16px calc(118px + var(--safe-b)); max-width: 760px; margin: 0 auto; }

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30; padding-top: var(--safe-t);
  background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--sep); }
.topbar-in { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; max-width: 760px; margin: 0 auto; }
.topbar-title { position: absolute; left: 50%; transform: translateX(-50%); font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.topbar.scrolled .topbar-title { opacity: 1; }
.tb-btn { display: inline-flex; align-items: center; gap: 2px; color: var(--tint); font-size: 17px; padding: 8px; border: 0; background: none; font-family: inherit; cursor: pointer; }
.tb-btn .ic { width: 24px; height: 24px; }
.badge-dot { position: relative; }
.badge-dot[data-n]:not([data-n="0"])::after {
  content: attr(data-n); position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center;
}
.brandmark { display: inline-flex; align-items: center; padding: 8px; color: var(--label); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brandmark span { color: var(--orange); }
.brandmark img { height: 24px; width: auto; display: block; }
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) { .logo-light { display: none !important; } .logo-dark { display: block !important; } }

.large-title { font-size: 31px; line-height: 1.12; font-weight: 700; letter-spacing: -.03em; margin: 8px 4px 4px; }
.subtitle { margin: 0 4px 18px; color: var(--label-2); font-size: 15px; }

/* Tab bar (telefono) */
.tabbar {
  position: fixed; left: 14px; right: 14px; bottom: calc(10px + var(--safe-b)); z-index: 30; display: flex; justify-content: space-around;
  padding: 6px; border-radius: 30px; max-width: 520px; margin: 0 auto;
  background: var(--glass); backdrop-filter: saturate(190%) blur(24px); -webkit-backdrop-filter: saturate(190%) blur(24px);
  border: .5px solid var(--glass-border);
  box-shadow: 0 10px 34px rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.06), inset 0 1px 0 rgba(255,255,255,.5);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; font-weight: 600; color: var(--label-2); padding: 7px 0 6px; border-radius: 24px; letter-spacing: .01em; transition: background .2s, color .2s; }
.tab .ic { width: 24px; height: 24px; stroke-width: 1.8; }
.tab.on { color: var(--tint); background: var(--tint-soft); }

/* Sidebar (computer) */
.sidebar { display: none; }
@media (min-width: 960px) {
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 248px; padding: 20px 12px;
    background: var(--bar); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-right: .5px solid var(--sep); z-index: 31;
  }
  .sidebar .brandmark { font-size: 19px; padding: 4px 12px 22px; }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 9px; font-size: 15px; color: var(--label); }
  .side-link .ic { color: var(--tint); width: 20px; height: 20px; }
  .side-link.on { background: var(--tint-soft); font-weight: 600; }
  .side-link:hover:not(.on) { background: var(--bg-fill-2); }
  .side-foot { margin-top: auto; padding: 12px; font-size: 13px; color: var(--label-2); }
  .topbar, .main { padding-left: 248px; }
  .main { max-width: calc(248px + 880px); padding-left: calc(248px + 40px); padding-right: 40px; }
  .topbar-in { max-width: none; padding: 0 24px; }
  .topbar .brandmark { visibility: hidden; }
}

/* ---------- Liste raggruppate (inset grouped) ---------- */
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 4px 8px; }
.section-h h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.025em; }
.section-h .link { color: var(--tint); font-size: 15px; }
.caption { margin: 24px 16px 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--label-2); }

.group { background: var(--bg-elev); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 50px; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
.row.ind + .row.ind::before { left: 60px; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-size: 16px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 13.5px; color: var(--label-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .chev { color: var(--label-3); width: 16px; height: 16px; stroke-width: 2.2; }
.row .val { color: var(--label-2); font-size: 16px; text-align: right; }
a.row:active { background: var(--bg-fill-2); }
.row-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.row-ic .ic { width: 19px; height: 19px; stroke-width: 2; }

/* ---------- Card ---------- */
.card { background: var(--bg-elev); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.grid2 > .card, .grid4 > .card, .brand-cards > .card { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .grid4 { grid-template-columns: repeat(4, 1fr); } }

/* Contatori */
.stat .k { font-size: 13px; color: var(--label-2); font-weight: 500; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.stat .v small { font-size: 15px; color: var(--label-3); font-weight: 600; }
.meter { height: 6px; border-radius: 3px; background: var(--bg-fill); margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--tint); }
.meter i.ok { background: var(--green); }
.meter i.low { background: var(--amber); }

/* ---------- Chip, pill, avatar ---------- */
.chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #fff; flex: none; }
.brand-swicho { background: #1D1D1F; }
.brand-riflexho { background: var(--orange); }
.brand-vestho { background: #8A7560; }
@media (prefers-color-scheme: dark) { .brand-swicho { background: #48484A; } }

.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 13px; font-weight: 600; background: var(--bg-fill); color: var(--label-2); white-space: nowrap; }
.st-nuovo { background: rgba(0,122,255,.12); color: var(--blue); }
.st-contattato, .st-in_trattativa { background: rgba(255,149,0,.14); color: #C76E00; }
.st-confermato, .st-materiali_ordinati { background: var(--tint-soft); color: var(--tint); }
.st-in_produzione, .st-in_cantiere { background: rgba(88,86,214,.13); color: #5856D6; }
.st-consegnato, .st-completato { background: rgba(52,199,89,.14); color: #1E8E3E; }
.st-rifiutato { background: rgba(255,59,48,.12); color: var(--red); }
.pill.red { background: rgba(255,59,48,.12); color: var(--red); }
.pill.green { background: rgba(52,199,89,.14); color: #1E8E3E; }
.pill.amber { background: rgba(255,149,0,.14); color: #C76E00; }

.avatars { display: flex; }
.av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; border: 2px solid var(--bg-elev); margin-left: -6px; }
.av:first-child { margin-left: 0; }

.overdue { color: var(--red) !important; font-weight: 600; }

/* ---------- Segmented control ---------- */
.seg { display: flex; background: var(--bg-fill); border-radius: 9px; padding: 2px; margin: 0 0 14px; }
.seg a { flex: 1; text-align: center; font-size: 13px; font-weight: 500; padding: 6px 4px; border-radius: 7px; color: var(--label); white-space: nowrap; }
.seg a.on { background: var(--bg-elev); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); font-weight: 600; }
@media (prefers-color-scheme: dark) { .seg a.on { background: #636366; } }

.scroller { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 0 16px; }
.scroller::-webkit-scrollbar { display: none; }
.filter { flex: none; height: 32px; padding: 0 14px; border-radius: 16px; background: var(--bg-elev); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; box-shadow: var(--shadow); }
.filter.on { background: var(--label); color: var(--bg-elev); }
.filter .n { color: var(--label-3); font-weight: 600; }
.filter.on .n { color: inherit; opacity: .6; }

.search { display: flex; align-items: center; gap: 6px; height: 38px; border-radius: 11px; background: var(--bg-fill); padding: 0 10px; margin-bottom: 12px; color: var(--label-2); }
.search .ic { width: 18px; height: 18px; }
.search input { border: 0; background: none; font: inherit; font-size: 17px; color: var(--label); flex: 1; outline: none; }

/* ---------- Programma ---------- */
.days { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 18px; padding: 2px 16px; }
.days::-webkit-scrollbar { display: none; }
.day { flex: none; width: 50px; padding: 8px 0 9px; border-radius: 14px; text-align: center; background: var(--bg-elev); box-shadow: var(--shadow); }
.day .dw { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--label-2); letter-spacing: .03em; }
.day .dn { font-size: 21px; font-weight: 600; margin-top: 2px; }
.day .dots { display: flex; justify-content: center; gap: 3px; height: 5px; margin-top: 4px; }
.day .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--tint); }
.day.today { background: var(--tint); color: #fff; }
.day.today .dw { color: rgba(255,255,255,.75); }
.day.today .dots i { background: #fff; }
.day.empty { opacity: .55; }

.dayhead { display: flex; align-items: baseline; gap: 8px; margin: 22px 4px 10px; }
.dayhead h3 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.025em; }
.dayhead .muted { font-size: 15px; }

.job { display: block; background: var(--bg-elev); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.job + .job { margin-top: 10px; }
.job::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tint); }
.job.k-sede::before { background: var(--orange); }
.job.k-sopralluogo::before { background: var(--blue); }
.job.s-finito { opacity: .62; }
.job.s-finito::before { background: var(--green); }
.job.s-problema::before { background: var(--red); }
.job-in { padding: 14px 16px 14px 18px; }
.job-top { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--label-2); font-weight: 500; }
.job-top .time { color: var(--label); font-weight: 600; font-variant-numeric: tabular-nums; }
.job-top .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.job h4 { margin: 6px 0 2px; font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.job .meta { display: flex; flex-direction: column; gap: 5px; margin-top: 9px; font-size: 15px; color: var(--label-2); }
.job .meta div { display: flex; gap: 8px; align-items: flex-start; }
.job .meta .ic { width: 17px; height: 17px; margin-top: 1px; color: var(--label-3); }
.warn { display: flex; gap: 8px; align-items: center; background: rgba(255,149,0,.12); color: #B35F00; font-size: 14px; font-weight: 500; padding: 8px 18px; }
.warn .ic { width: 17px; height: 17px; }
.warn.red { background: rgba(255,59,48,.1); color: var(--red); }

.empty-state { text-align: center; padding: 34px 20px; color: var(--label-2); font-size: 15px; }
.empty-state .ic { width: 40px; height: 40px; color: var(--label-3); margin-bottom: 6px; }

/* Azioni dal campo: pulsanti grandi, un tocco */
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 6px; }
.act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 84px;
  border-radius: var(--r); border: 0; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--bg-elev); color: var(--label); box-shadow: var(--shadow); transition: transform .12s;
}
.act:active { transform: scale(.96); }
.act .ic { width: 28px; height: 28px; stroke-width: 1.8; }
.act.go { background: var(--tint); color: #fff; }
.act.done { background: var(--green); color: #fff; }
.act.bad { color: var(--red); }
.act[disabled] { opacity: .35; pointer-events: none; }
.actions.two { grid-template-columns: 1fr 1fr; }

.hero-map { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.hero-map .row-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--blue); }

/* ---------- Bottoni e moduli ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 50px; padding: 0 22px; border-radius: 14px;
  border: 0; font: inherit; font-size: 17px; font-weight: 600; cursor: pointer; background: var(--tint); color: #fff; width: 100%;
}
.btn.sec { background: var(--tint-soft); color: var(--tint); }
.btn.sm { height: 34px; font-size: 15px; padding: 0 14px; border-radius: 17px; width: auto; }
.btn.danger { background: rgba(255,59,48,.1); color: var(--red); }
.btn[disabled] { opacity: .4; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.field { display: flex; align-items: center; gap: 10px; padding: 0 16px; min-height: 48px; position: relative; }
.field + .field::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
.field label { width: 110px; flex: none; font-size: 16px; }
.field input, .field select, .field textarea {
  flex: 1; border: 0; background: none; font: inherit; font-size: 17px; color: var(--label); outline: none; padding: 13px 0; min-width: 0;
}
.field select { -webkit-appearance: none; appearance: none; color: var(--label-2); text-align: right; }
.field textarea { resize: vertical; min-height: 84px; }
.field.col { flex-direction: column; align-items: stretch; gap: 0; }
.field.col label { width: auto; padding-top: 12px; font-size: 13px; color: var(--label-2); }
.field.col textarea, .field.col input { padding-top: 6px; }

.toast {
  position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); z-index: 50;
  background: rgba(30,30,32,.92); color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 15px; font-weight: 500;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 8px 30px rgba(0,0,0,.2); max-width: 90vw;
  animation: toast .3s ease-out;
}
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } }
.offline-bar { display: none; align-items: center; justify-content: center; gap: 8px; background: var(--amber); color: #fff; font-size: 13px; font-weight: 600; padding: 5px; }
.offline .offline-bar { display: flex; }
.offline .main { padding-top: calc(var(--safe-t) + 80px); }
.offline-bar .ic { width: 16px; height: 16px; }
.queue-n { display: none; }
.has-queue .queue-n { display: inline; }

/* Requisiti per confermare */
.req { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 15px; position: relative; }
.req + .req::before { content: ""; position: absolute; top: 0; left: 46px; right: 0; height: .5px; background: var(--sep); }
.req .ok, .req .ko { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.req .ok { background: var(--green); color: #fff; }
.req .ko { border: 1.5px solid var(--label-3); }
.req .ok .ic { width: 13px; height: 13px; stroke-width: 3; }

/* Timeline */
.tl { padding: 4px 16px; }
.tl-i { display: flex; gap: 12px; padding: 10px 0; font-size: 15px; }
.tl-i + .tl-i { border-top: .5px solid var(--sep); }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tint); margin-top: 7px; flex: none; }

/* Progress produzione */
.prog { height: 4px; background: var(--bg-fill); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--orange); border-radius: 2px; }

/* Planner settimana */
.planner { display: grid; grid-template-columns: 70px repeat(var(--n), minmax(130px, 1fr)); gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 8px; }
.planner .ph { font-size: 13px; font-weight: 600; color: var(--label-2); padding: 4px 2px; position: sticky; top: 0; }
.planner .pd { font-size: 13px; font-weight: 600; padding: 10px 2px; text-transform: capitalize; }
.planner .cell { background: var(--bg-elev); border-radius: 12px; min-height: 64px; padding: 6px; display: flex; flex-direction: column; gap: 5px; box-shadow: var(--shadow); }
.planner .cell.abs { background: repeating-linear-gradient(135deg, var(--bg-fill-2) 0 6px, transparent 6px 12px); box-shadow: none; }
.pchip { font-size: 12px; line-height: 1.25; padding: 6px 7px; border-radius: 8px; background: var(--tint-soft); color: var(--label); }
.pchip b { display: block; font-weight: 600; }
.pchip.k-sede { background: rgba(240,138,36,.14); }
.pchip.warnc { box-shadow: inset 0 0 0 1.5px var(--amber); }
.planner { display: none; }
@media (min-width: 900px) { .planner { display: grid; } .planner-m { display: none; } }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-box { width: 100%; max-width: 360px; text-align: center; }
.login-logo { width: 84px; height: 84px; border-radius: 22px; border-radius: 18px; margin: 0 auto 18px; background: var(--tint); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 26px; letter-spacing: -.03em; box-shadow: 0 10px 30px rgba(42,38,76,.25); }
.login-logo span { color: var(--orange); }
.login h1 { font-size: 28px; margin: 0 0 4px; letter-spacing: -.025em; }
.login .group { text-align: left; margin: 26px 0 16px; }
.err { color: var(--red); font-size: 15px; margin: 10px 0 0; }

.fab {
  position: fixed; right: 20px; bottom: calc(96px + var(--safe-b)); z-index: 29; width: 56px; height: 56px; border-radius: 50%;
  background: var(--tint); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(42,38,76,.35);
}
.fab .ic { width: 26px; height: 26px; stroke-width: 2.2; }
@media (min-width: 960px) { .fab { bottom: 28px; right: 32px; } }

.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 12px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.thumbs .lbl { font-size: 11px; color: var(--label-2); margin-top: 3px; text-align: center; }
.hide { display: none !important; }

/* ---------- Dashboard: card di apertura ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 20px; color: #fff; margin-bottom: 14px;
  background: radial-gradient(120% 140% at 100% 0%, #4B4390 0%, #2A264C 55%, #1C1935 100%);
  box-shadow: 0 14px 40px rgba(42,38,76,.28);
}
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(240,138,36,.55), rgba(240,138,36,0) 70%); }
.hero .k { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.hero-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.hero-grid a { background: rgba(255,255,255,.1); border: .5px solid rgba(255,255,255,.14); border-radius: 16px; padding: 12px; backdrop-filter: blur(6px); }
.hero-grid b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.hero-grid span { font-size: 12px; opacity: .8; font-weight: 500; }
.hero-grid .alert b { color: #FFB066; }
.brand-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.brand-cards .card { padding: 14px; border-radius: 18px; }
@media (max-width: 420px) { .brand-cards .card .stat .v { font-size: 22px; } }

/* ---------- v0.6: testata pagina, box riepilogo, griglie larghe, elenco + scheda ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.page-head .grow { flex: 1 1 280px; min-width: 0; }
.desk-only { display: none !important; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.sbox { background: var(--bg-elev); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.sbox b { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.sbox .l { font-size: 13px; font-weight: 600; margin-top: 2px; }
.sbox .s { font-size: 12px; color: var(--label-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbox:first-child { color: #fff; background: radial-gradient(120% 140% at 100% 0%, #4B4390 0%, #2A264C 60%, #1C1935 100%); box-shadow: 0 10px 30px rgba(42,38,76,.25); }
.sbox:first-child .s { color: rgba(255,255,255,.75); }
.sbox.alert b { color: var(--red); }
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.dash > section > .section-h:first-child { margin-top: 6px; }
.split-list, .split-empty { display: none; }
.detail-cols { display: block; }
.form-cols { display: block; }
@media (max-width: 420px) { .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } .summary .sbox:first-child { grid-column: span 2; } }

@media (min-width: 960px) {
  .main { max-width: 1680px; padding-left: calc(248px + 40px); padding-right: 40px; margin: 0; }
  .desk-only { display: inline-flex !important; }
  .summary { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .dash.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
  .form-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
  .fab { display: none; }
}
@media (min-width: 1200px) {
  /* elenco a sinistra, scheda a destra (come Mail) */
  .split { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 28px; align-items: start; }
  .split-list { display: block; position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow-y: auto; padding-right: 4px; }
  .split-list .row.sel { background: var(--tint-soft); box-shadow: inset 3px 0 0 var(--tint); }
  .split-empty { display: flex; align-items: center; justify-content: center; min-height: 420px; color: var(--label-2); border: 1.5px dashed var(--sep); border-radius: 20px; }
  .only-narrow { display: none !important; }
}
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 4px 16px; }
.toolbar .btn.sm { height: 38px; border-radius: 12px; }
.btn .ic { width: 18px; height: 18px; }
.savebar { position: sticky; bottom: calc(92px + var(--safe-b)); z-index: 20; display: flex; gap: 10px; margin-top: 22px; padding: 10px; border-radius: 20px; background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 8px 26px rgba(0,0,0,.1); }
.savebar .btn { flex: 1; }
@media (min-width: 960px) { .savebar { bottom: 16px; max-width: 420px; margin-left: auto; } }

/* ---------- v0.7: sidebar grafite + box di riepilogo colorati per stato ---------- */
@media (min-width: 960px) {
  .sidebar { background: #1C1C1E; border-right: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .sidebar .brandmark { color: #FFFFFF; }
  .side-link { color: rgba(235,235,245,.78); font-weight: 500; }
  .side-link .ic { color: rgba(235,235,245,.6); }
  .side-link.on { background: rgba(169,163,240,.18); color: #FFFFFF; font-weight: 600; }
  .side-link.on .ic { color: #A9A3F0; }
  .side-link:hover:not(.on) { background: rgba(255,255,255,.06); }
  .side-foot { color: rgba(235,235,245,.55); }
  .side-foot a { color: rgba(235,235,245,.8); }
}
.sbox, .sbox:first-child { background: var(--sb-bg); color: var(--sb-fg); box-shadow: none; }
.sbox:first-child .s { color: var(--label-2); }
.sbox .ico { width: 34px; height: 34px; border-radius: 10px; background: var(--sb-fg); display: grid; place-items: center; margin-bottom: 8px; }
.sbox .ico .ic { width: 18px; height: 18px; color: #fff; stroke-width: 2; }
.sbox b { color: var(--sb-fg); }
.sbox .l { color: var(--sb-fg); font-weight: 700; }
.sbox .s { color: var(--label-2); }
.sbox .flag { align-self: flex-start; margin-top: 6px; font-size: 12px; font-weight: 700; color: #B3261E; background: #FDE7E5; border-radius: 8px; padding: 2px 8px; }
.sbox.c-blue   { --sb-bg: #E8F1FF; --sb-fg: #0A57C2; }
.sbox.c-orange { --sb-bg: #FFF1E2; --sb-fg: #A85400; }
.sbox.c-indigo { --sb-bg: #EEECF8; --sb-fg: #2A264C; }
.sbox.c-teal   { --sb-bg: #E2F5F6; --sb-fg: #0B6E77; }
.sbox.c-green  { --sb-bg: #E5F5E9; --sb-fg: #1B7A33; }
.sbox.c-red    { --sb-bg: #FDECEB; --sb-fg: #B3261E; }
@media (prefers-color-scheme: dark) {
  .sbox.c-blue   { --sb-bg: rgba(10,132,255,.16);  --sb-fg: #64A8FF; }
  .sbox.c-orange { --sb-bg: rgba(255,159,10,.16);  --sb-fg: #FFB454; }
  .sbox.c-indigo { --sb-bg: rgba(169,163,240,.16); --sb-fg: #B9B4F5; }
  .sbox.c-teal   { --sb-bg: rgba(64,200,224,.16);  --sb-fg: #5DD3E3; }
  .sbox.c-green  { --sb-bg: rgba(48,209,88,.16);   --sb-fg: #5FDB7E; }
  .sbox.c-red    { --sb-bg: rgba(255,69,58,.16);   --sb-fg: #FF7A70; }
  .sbox .flag { background: rgba(255,69,58,.2); color: #FF8A80; }
}
.sbox.alert b { color: var(--sb-fg); }
.hero-row { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 4px 0 16px; }
@media (min-width: 960px) { .hero-row { grid-template-columns: 2fr 1fr; } }
.hero { border-radius: 24px; padding: 22px 24px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #4B4390 0%, #2A264C 55%, #1C1935 100%); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.hero-nums { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-top: 14px; }
@media (min-width: 600px) { .hero-nums { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.hero-nums a { color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; padding: 14px; text-decoration: none; }
.hero-nums b { display: block; font-size: 30px; line-height: 1.1; }
.hero-nums b.hot { color: #FFB066; }
.hero-nums span { font-size: 13px; opacity: .85; }
.nextweek { display: flex; flex-direction: column; gap: 8px; border-radius: 24px; padding: 22px 24px; margin: 0; }
.nextweek .nw-d { font-size: 22px; font-weight: 700; }
/* modifica passo / stato */
.stepedit { margin-top: 14px; border-top: .5px solid var(--sep); padding-top: 10px; }
.stepedit summary { cursor: pointer; color: var(--tint); font-weight: 600; font-size: 15px; list-style: none; }
.stepedit summary::-webkit-details-marker { display: none; }
.stepedit summary::after { content: " ›"; }
.stepedit[open] summary::after { content: " ⌄"; }
.stepform, .statusform { margin-top: 12px; }
.statusform { border-top: .5px solid var(--sep); padding-top: 12px; margin-top: 16px; }
.stepedit input:not([type=radio]):not([type=checkbox]), .stepedit select { width: 100%; height: 44px; border: 0; border-radius: 11px; background: var(--bg-fill); padding: 0 12px; font: inherit; color: var(--label); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt { position: relative; }
.opt > span { color: var(--label); display: inline-block; padding: 8px 12px; border-radius: 999px; background: var(--bg-fill); font-size: 14px; font-weight: 500; cursor: pointer; }
.opt input:checked + span { background: var(--tint); color: #fff; }
.opt input:focus-visible + span { outline: 2px solid var(--tint); outline-offset: 2px; }
.stepform .f-altro, .stepform .f-cal { display: none; margin-top: 10px; }
.stepform .f-date { margin-top: 10px; }
.stepform:has(input[value="__altro"]:checked) .f-altro { display: block; }
.stepform:has(input[value="Metti in calendario"]:checked) .f-cal { display: block; }
.stepform:has(input[value="Metti in calendario"]:checked) .f-date,
.stepform:has(input[value="Completato"]:checked) .f-date { display: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.act.complete { background: var(--green); color: #fff; }
.act.complete:disabled { opacity: .45; }

/* ---------- Calendario mensile ---------- */
.cal-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.cal-nav, .cal-today { height: 34px; min-width: 34px; padding: 0 10px; border-radius: 10px; background: var(--bg-elev); display: grid; place-items: center; font-weight: 600; color: var(--label); text-decoration: none; font-size: 15px; }
.cal-nav { font-size: 20px; padding: 0; }
.cal-month { font-size: 20px; font-weight: 700; min-width: 160px; text-align: center; }
.cal-people { display: flex; gap: 6px; flex-wrap: wrap; }
.cal-who { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--bg-elev); border: .5px solid var(--sep); font-size: 13px; font-weight: 500; color: var(--label); text-decoration: none; }
.cal-who:first-child { padding: 7px 14px; }
.cal-who.on { background: var(--tint); color: #fff; border-color: var(--tint); }
.av { width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 8.5px; font-weight: 700; display: inline-grid; place-items: center; flex: none; letter-spacing: 0; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--bg-elev); border-radius: 18px; overflow: hidden; border: .5px solid var(--sep); }
.cal-h { padding: 10px 8px; font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--label-2); text-transform: uppercase; border-bottom: .5px solid var(--sep); }
.cal-d { min-height: 118px; padding: 6px 6px 8px; border-top: .5px solid var(--sep); border-left: .5px solid var(--sep); display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: pointer; }
.cal-d:nth-child(7n+1) { border-left: 0; }
.cal-d.wk, .cal-d.out { background: var(--bg-fill-2); }
.cal-d.sel { box-shadow: inset 0 0 0 2px var(--tint); }
.cal-n { align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--label); text-decoration: none; min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-d.out .cal-n { color: var(--label-3, #AEAEB2); font-weight: 400; }
.cal-n.today { background: var(--orange); color: #fff; }
.cal-e { display: flex; align-items: center; gap: 4px; border-left: 3px solid var(--c); border-radius: 6px; padding: 3px 5px; font-size: 11.5px; line-height: 1.25; color: var(--label); text-decoration: none; min-width: 0; background: var(--bg-fill-2); }
.cal-e .tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-e .tx b { font-weight: 700; }
.cal-e .avs { display: inline-flex; flex: none; }
.cal-e .av { width: 15px; height: 15px; font-size: 7px; margin-left: -3px; box-shadow: 0 0 0 1.5px var(--bg-elev); }
.cal-e.done { opacity: .55; }
.t-appuntamento { background: #EEF4FF; } .t-sopralluogo { background: #FFF6E9; } .t-cantiere { background: #EEECF8; }
.t-produzione { background: #E2F5F6; } .t-impegno, .t-altro { background: #F2F2F7; } .t-ferie { background: #FDECEB; }
.cal-e.t-appuntamento { background: #EEF4FF; } .cal-e.t-sopralluogo { background: #FFF6E9; } .cal-e.t-cantiere { background: #EEECF8; }
.cal-e.t-produzione { background: #E2F5F6; } .cal-e.t-ferie { background: #FDECEB; }
@media (prefers-color-scheme: dark) {
  .t-appuntamento, .cal-e.t-appuntamento { background: rgba(10,132,255,.16); } .t-sopralluogo, .cal-e.t-sopralluogo { background: rgba(255,159,10,.16); }
  .t-cantiere, .cal-e.t-cantiere { background: rgba(169,163,240,.16); } .t-produzione, .cal-e.t-produzione { background: rgba(64,200,224,.16); }
  .t-impegno, .t-altro { background: rgba(118,118,128,.2); } .t-ferie, .cal-e.t-ferie { background: rgba(255,69,58,.16); }
}
.cal-more { font-size: 11px; color: var(--label-2); padding-left: 4px; text-decoration: none; }
.cal-dots { display: none; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 10px 4px 0; font-size: 12px; color: var(--label-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 12px; height: 12px; border-radius: 3px; border: .5px solid var(--sep); }
.cal-x { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--bg-fill); color: var(--label-2); font-size: 18px; line-height: 1; cursor: pointer; }
.cal-dlg { width: min(420px, calc(100vw - 24px)); max-height: calc(100vh - 40px); border: 0; border-radius: 20px; padding: 20px; background: var(--bg-elev); color: var(--label); box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.cal-dlg::backdrop { background: rgba(0,0,0,.25); }
.cal-dlg-h { display: flex; justify-content: space-between; align-items: flex-start; }
.cal-dlg-h .ttl { font-size: 19px; font-weight: 700; }
.cal-form .lb { display: block; font-size: 12px; color: var(--label-2); font-weight: 500; margin: 12px 0 5px; }
.cal-form input:not([type=radio]):not([type=checkbox]), .cal-form select, .cal-form textarea { width: 100%; box-sizing: border-box; min-height: 42px; border: 0; border-radius: 11px; background: var(--bg-fill); padding: 0 12px; font: inherit; font-size: 15px; color: var(--label); }
.cal-form textarea { padding: 10px 12px; }
.cal-form .opt .av { width: 18px; height: 18px; vertical-align: middle; }
.grid3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.cal-form .f-prod { display: none; }
.cal-form:has(input[value=produzione]:checked) .f-prod { display: block; }
.cal-form:has(input[value=produzione]:checked) .f-proj,
.cal-form:has(input[value=ferie]:checked) .f-proj,
.cal-form:has(input[value=ferie]:checked) .f-time,
.cal-form:has(input[value=ferie]:checked) .f-end,
.cal-form:has(input[value=ferie]:checked) .f-where,
.cal-form:has(input[value=ferie]:checked) .f-days-note { display: none; }
.cal-form .f-days-note { display: block; margin-top: 4px; }
.cal-form .opt input:checked + span .av { box-shadow: 0 0 0 1.5px #fff; }
@media (max-width: 700px) {
  .cal-d { min-height: 56px; padding: 4px 2px; align-items: center; }
  .cal-e, .cal-more { display: none; }
  .cal-dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
  .cal-dots i { width: 6px; height: 6px; border-radius: 50%; }
  .cal-h { padding: 8px 0; text-align: center; font-size: 10px; }
  .cal-people { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .cal-who { flex: none; }
  .cal-month { min-width: 0; flex: 1; font-size: 18px; }
}
.grid3 > div { min-width: 0; }
.cal-form .opt > span { display: inline-flex; align-items: center; gap: 6px; }
.cal-form .opt > span:has(.av) { padding-left: 6px; }

/* ---------- Installazioni (ex Programma) ---------- */
.ins-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 14px; }
.seg { display: flex; background: var(--bg-fill); border-radius: 10px; padding: 2px; }
.seg a { flex: 1; text-align: center; white-space: nowrap; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--label); text-decoration: none; }
.seg a.on { background: var(--bg-elev); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.ins-months { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.ins-m { flex: none; padding: 7px 13px; border-radius: 999px; background: var(--bg-elev); font-size: 13px; font-weight: 600; color: var(--label); text-decoration: none; }
.ins-m.on { background: var(--tint); color: #fff; }
@media (max-width: 700px) { .ins-top .seg { width: 100%; } .ins-months { width: 100%; } .ins-months .cal-nav { display: none; } }
.ins-wrap { display: flex; gap: 20px; align-items: flex-start; }
.ins-main { flex: 1; min-width: 0; }
.ins-side { width: 300px; flex: none; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 70px; }
@media (max-width: 1100px) { .ins-side { display: none !important; } }
.ins-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.ins-stats .sbox { padding: 10px 12px; min-height: 0; }
.ins-stats .sbox b { font-size: 22px; }
.ins-stats .sbox .l { font-size: 12px; }
.ins-day { display: flex; align-items: center; gap: 8px; margin: 20px 4px 8px; scroll-margin-top: 80px; }
.ins-day .lbl { font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--label-2); text-transform: uppercase; }
.ins-day.today .lbl { color: var(--orange); }
.ins-day .ln { flex: 1; height: .5px; background: var(--sep); }
.ins-day .n { font-size: 12px; color: var(--label-2); }
.ins { display: flex; gap: 12px; align-items: flex-start; background: var(--bg-elev); border-radius: 16px; padding: 14px 16px; color: var(--label); text-decoration: none; box-shadow: var(--shadow); }
.ins + .ins { margin-top: 8px; }
.ins.dim { opacity: .62; }
.ins .tm { width: 46px; flex: none; font-weight: 700; font-size: 15px; }
.ins .bd { flex: 1; min-width: 0; }
.ins .tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ins .ti { font-weight: 650; font-size: 16px; margin-top: 5px; }
.ins .ds { font-size: 13px; color: var(--label-2); margin-top: 1px; }
.ins .ft { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; }
.ins .ad { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.ins .ad .ic { width: 14px; height: 14px; color: var(--label-2); flex: none; }
.ins .avs { display: inline-flex; padding-left: 5px; }
.ins .av { width: 22px; height: 22px; font-size: 8.5px; margin-left: -5px; box-shadow: 0 0 0 2px var(--bg-elev); }
.ins .chev { align-self: center; }
.st { font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.st-plan { background: #EEECF8; color: #2A264C; } .st-run { background: #FFF1E2; color: #A85400; } .st-bad { background: #FDE7E5; color: #B3261E; }
.st-done { background: #E5F5E9; color: #1B7A33; } .st-lcd { background: #E2F5F6; color: #0B6E77; }
@media (prefers-color-scheme: dark) {
  .st-plan { background: rgba(169,163,240,.18); color: #B9B4F5; } .st-run { background: rgba(255,159,10,.18); color: #FFB454; } .st-bad { background: rgba(255,69,58,.18); color: #FF8A80; }
  .st-done { background: rgba(48,209,88,.18); color: #5FDB7E; } .st-lcd { background: rgba(64,200,224,.18); color: #5DD3E3; }
}
.ins-next { display: block; text-align: center; margin: 18px 0 8px; font-weight: 600; color: var(--tint); text-decoration: none; }
.row-mini { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 8px 0 0; }
.row-mini b { font-weight: 600; }

/* ---------- Presenze ---------- */
.punch { display: flex; align-items: center; gap: 12px; background: var(--bg-elev); border-radius: 16px; padding: 10px 12px 10px 16px; box-shadow: var(--shadow); margin: 6px 0 14px; }
.punch .dot { width: 10px; height: 10px; border-radius: 50%; background: #8E8E93; flex: none; }
.punch.is-in .dot { background: #34C759; box-shadow: 0 0 0 4px rgba(52,199,89,.2); }
.punch .tx { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.punch .tx b { font-size: 15px; }
.punch .tx small { font-size: 12.5px; color: var(--label-2); }
.punch .btn { width: auto; min-width: 110px; height: 40px; border-radius: 12px; }
.punch:not(.is-in) .btn { background: #1B7A33; }
@media (min-width: 960px) { .punch { max-width: 520px; } }
.seg .badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 0 5px; margin-left: 4px; }
.cal-form .f-ore { display: none; }
.cal-form:has(input[value=permesso]:checked) .f-ore { display: grid; }

/* ---------- v0.11: marchi leggibili, elenco e scheda Lead/Progetti ---------- */
.bchip { display: inline-flex; align-items: center; gap: 6px; border-radius: 7px; padding: 3px 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; flex: none; background: #EDEDF0; color: #1C1C1E; }
.bchip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.bchip.b-swicho { background: #EDEDF0; color: #1C1C1E; } .bchip.b-swicho i { background: #1C1C1E; }
.bchip.b-riflexho { background: #FFF1E2; color: #A85400; } .bchip.b-riflexho i { background: #F08A24; }
.bchip.b-vestho { background: #F3EEE8; color: #6F5D4A; } .bchip.b-vestho i { background: #8A7259; }
@media (prefers-color-scheme: dark) {
  .bchip.b-swicho { background: rgba(235,235,245,.14); color: #F5F5F7; } .bchip.b-swicho i { background: #F5F5F7; }
  .bchip.b-riflexho { background: rgba(240,138,36,.2); color: #FFB466; }
  .bchip.b-vestho { background: rgba(170,145,120,.22); color: #D9C4AE; } .bchip.b-vestho i { background: #C4A98D; }
}
:root { --b-swicho: #1C1C1E; --b-riflexho: #F08A24; --b-vestho: #8A7259; }
@media (prefers-color-scheme: dark) { :root { --b-swicho: #AEAEB2; } }

/* elenco */
.lh { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; }
.lh .grow h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.lh .grow p { margin: 0; font-size: 13px; color: var(--label-2); }
.lh .btn { width: auto; height: 38px; border-radius: 11px; padding: 0 14px; font-size: 13px; }
.lsearch { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.lsearch .search { flex: 1; margin: 0; }
.lsearch .seg { flex: none; }
.fbrand { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.fbrand a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 10px; background: var(--bg-elev); border: .5px solid var(--sep); font-size: 13px; font-weight: 600; color: var(--label); text-decoration: none; white-space: nowrap; }
.fbrand a i { width: 9px; height: 9px; border-radius: 50%; }
.fbrand a span { color: var(--label-2); font-weight: 500; }
.fbrand a.on { background: var(--tint); border-color: var(--tint); color: #fff; }
.fbrand a.on span { color: rgba(255,255,255,.75); }
.fstat { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.fstat a { padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--bg-fill); color: var(--label); text-decoration: none; white-space: nowrap; }
.fstat a.on { background: var(--label); color: var(--bg); font-weight: 600; }
.fstat a.late { color: #C4281C; }
.fstat a.late.on { background: #C4281C; color: #fff; }
.lsort { display: flex; justify-content: space-between; font-size: 12px; color: var(--label-2); padding: 0 4px 8px; }
.lsort a { color: var(--label-2); text-decoration: none; }
.lsort a.on { color: var(--tint); font-weight: 700; }
@media (max-width: 700px) { .fbrand, .fstat { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } }
.lrows { background: var(--bg-elev); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.lrow { display: flex; gap: 12px; padding: 13px 16px 13px 14px; border-bottom: .5px solid var(--sep); color: var(--label); text-decoration: none; }
.lrow:last-child { border-bottom: 0; }
.lrow:hover { background: var(--bg-fill-2); }
.lrow.sel { background: var(--tint-soft); box-shadow: inset 3px 0 0 var(--tint); }
.lrow > i { width: 4px; border-radius: 2px; flex: none; align-self: stretch; background: var(--b-swicho); }
.lrow > i.b-riflexho { background: var(--b-riflexho); } .lrow > i.b-vestho { background: var(--b-vestho); }
.lrow .bd { flex: 1; min-width: 0; }
.lrow .l1 { display: flex; align-items: center; gap: 8px; }
.lrow .nm { flex: 1; min-width: 0; font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow.new .nm { font-weight: 700; }
.lrow .l2 { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--label-2); margin-top: 3px; min-width: 0; }
.lrow .l2 .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .bchip { padding: 2px 7px; font-size: 10.5px; }
.lrow .l3 { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; }
.lrow .stp { font-weight: 600; color: var(--label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lrow .stp.late { color: #C4281C; }
.lrow .stp.wait { color: var(--label-2); font-weight: 500; }
.lrow .amt { margin-left: auto; font-weight: 600; white-space: nowrap; }
.lrow .av { width: 20px; height: 20px; font-size: 8px; }
.lrow .pill { flex: none; }
@media (min-width: 1200px) { .split { grid-template-columns: 450px minmax(0, 1fr); gap: 22px; } }
@media (min-width: 1500px) { .split { grid-template-columns: 490px minmax(0, 1fr); } }

/* scheda */
.dcard { background: var(--bg-elev); border-radius: 22px; padding: 22px 24px; box-shadow: var(--shadow); }
@media (max-width: 700px) { .dcard { padding: 16px; border-radius: 18px; } }
.dh { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.dh .grow { min-width: 240px; }
.dh .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--label-2); }
.dh h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 0; line-height: 1.15; }
.dh .sub { font-size: 14px; color: var(--label-2); }
.dh .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.dh .acts .btn { width: auto; height: 38px; border-radius: 11px; padding: 0 14px; font-size: 13px; }
.stepper { display: flex; gap: 6px; margin-top: 16px; }
.stepper div { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stepper div b { height: 6px; border-radius: 3px; background: var(--bg-fill); }
.stepper div.on b { background: var(--tint); }
.stepper div span { font-size: 12px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper div.on span { color: var(--label); }
.stepper div.cur span { font-weight: 700; }
.stepper.ko div b { background: var(--bg-fill); } .stepper.ko div.on b { background: #C4281C; }
@media (max-width: 700px) { .stepper div:not(.cur) span { visibility: hidden; } }
.dtabs { display: flex; gap: 22px; border-bottom: .5px solid var(--sep); margin-top: 18px; overflow-x: auto; scrollbar-width: none; }
.dtabs button { background: none; border: 0; padding: 10px 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--label-2); cursor: pointer; white-space: nowrap; }
.dtabs button.on { color: var(--tint); box-shadow: inset 0 -2px 0 var(--tint); }
.dtabs button small { font-weight: 500; color: var(--label-2); }
.dpane { display: none; padding-top: 16px; }
.dpane.on { display: block; }
.dgrid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1100px) { .dgrid { grid-template-columns: 1.1fr 1fr; } }
.dgrid > div { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dbox { border: .5px solid var(--sep); border-radius: 16px; padding: 14px 16px; }
.dbox .cap, .nstep .cap { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: var(--label-2); text-transform: uppercase; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: .5px solid var(--sep); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--label-2); flex: none; }
.kv > span:last-child { font-weight: 500; text-align: right; min-width: 0; }
.nstep { border-radius: 16px; padding: 16px; background: var(--tint-soft); }
.nstep.late { background: #FDECEB; } .nstep.late .cap { color: #B3261E; }
@media (prefers-color-scheme: dark) { .nstep.late { background: rgba(255,69,58,.14); } .nstep.late .cap { color: #FF8A80; } }
.nstep .t { font-size: 19px; font-weight: 700; margin-top: 4px; }
.nstep .s { font-size: 13px; color: var(--label-2); }
.qacts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.qacts form { display: contents; }
.qacts button, .qacts a { padding: 7px 11px; border-radius: 999px; background: var(--bg-elev); border: 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--label); cursor: pointer; text-decoration: none; }
.qacts .pri { background: var(--tint); color: #fff; }
.qacts .ko { color: #C4281C; }
.qacts button:disabled { opacity: .45; cursor: not-allowed; }
.cacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.cacts a, .cacts span { height: 56px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 600; text-decoration: none; }
.cacts .ic { width: 18px; height: 18px; }
.cacts .c1 { background: #E5F5E9; color: #1B7A33; } .cacts .c2 { background: #E8F1FF; color: #0A57C2; } .cacts .c3 { background: var(--bg-fill); color: var(--label); }
.cacts .off { opacity: .4; }
.cinfo { font-size: 13px; color: var(--label); margin-top: 10px; line-height: 1.6; word-break: break-word; }
.act-i { display: flex; gap: 10px; margin-top: 10px; font-size: 13px; }
.act-i > i { width: 7px; height: 7px; border-radius: 50%; background: var(--tint); margin-top: 6px; flex: none; }
.act-i b { font-weight: 600; }
.act-i small { display: block; color: var(--label-2); font-size: 12px; }
.qnote { display: flex; gap: 6px; margin-top: 12px; }
.qnote input { flex: 1; height: 38px; border: 0; border-radius: 11px; background: var(--bg-fill); padding: 0 12px; font: inherit; font-size: 14px; color: var(--label); min-width: 0; }
.qnote .btn { width: auto; height: 38px; border-radius: 11px; padding: 0 14px; font-size: 13px; }
.dpane .group { margin: 0; }
.dpane .caption:first-child { margin-top: 0; }
.dbox .req { padding: 9px 0; font-size: 14px; } .dbox .req + .req::before { left: 30px; }
.side-logo { text-decoration: none; }
@media (min-width: 960px) { .sidebar .side-logo { padding: 6px 12px 26px; } .sidebar .side-logo img { height: 34px; width: auto; max-width: 100%; } }
.lh .btn { white-space: nowrap; flex: none; }
.lh .grow { min-width: 0; }
.fbrand { gap: 5px; }
.fbrand a { padding: 6px 10px; font-size: 12.5px; gap: 6px; }
.split-list .lsearch .seg a { padding: 7px 10px; }
.lsearch { flex-wrap: wrap; }
.lsearch .search { flex: 1 1 200px; min-width: 0; }
.stepper div.cur span { overflow: visible; }

/* ---------- Login ---------- */
.lg { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr; background: var(--bg); }
@media (min-width: 900px) { .lg { grid-template-columns: minmax(0, 1.35fr) minmax(400px, 1fr); } }
.lg-photo { position: relative; min-height: 42vh; background: #1C1935 var(--img) center / cover no-repeat; color: #fff; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 22px 22px 28px; }
@media (min-width: 900px) { .lg-photo { min-height: 100vh; padding: 40px 48px; } }
.lg-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,18,40,.45) 0%, rgba(20,18,40,0) 32%, rgba(20,18,40,.15) 55%, rgba(20,18,40,.82) 100%); }
.lg-top, .lg-claim, .lg-credit { position: relative; z-index: 1; }
.lg-top img { height: 30px; width: auto; display: block; }
@media (min-width: 900px) { .lg-top img { height: 38px; } }
.lg-top b { font-size: 20px; } .lg-top b span { color: var(--orange); }
.lg-claim .eyebrow { opacity: .85; margin: 0 0 8px; font-size: 11.5px; }
.lg-claim h2 { font-size: 30px; line-height: 1.08; letter-spacing: -.03em; margin: 0; font-weight: 700; text-shadow: 0 2px 24px rgba(0,0,0,.25); }
@media (min-width: 900px) { .lg-claim h2 { font-size: 52px; } }
.lg-brands { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.lg-brands span { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.lg-brands i { width: 8px; height: 8px; border-radius: 50%; }
.lg-credit { position: absolute; right: 16px; bottom: 10px; font-size: 10.5px; opacity: .6; }
@media (max-width: 899px) { .lg-credit { display: none; } }
.lg-panel { display: flex; align-items: center; justify-content: center; padding: 28px 22px 40px; }
@media (max-width: 899px) { .lg-panel { margin-top: -26px; border-radius: 26px 26px 0 0; background: var(--bg); position: relative; z-index: 2; align-items: flex-start; } }
.lg-form { width: 100%; max-width: 380px; }
.lg-logo img { height: 40px; width: auto; display: block; margin-bottom: 30px; }
@media (max-width: 899px) { .lg-logo { display: none; } }
.lg-form h1 { font-size: 32px; letter-spacing: -.03em; margin: 0 0 4px; }
.lg-form > .muted { margin: 0 0 26px; font-size: 15px; }
.lg-f { display: block; margin-bottom: 14px; }
.lg-f span { display: block; font-size: 13px; font-weight: 600; color: var(--label-2); margin: 0 0 6px 2px; }
.lg-f input { width: 100%; box-sizing: border-box; height: 52px; border-radius: 14px; border: 1px solid var(--sep); background: var(--bg-elev); padding: 0 16px; font: inherit; font-size: 16px; color: var(--label); transition: border-color .15s, box-shadow .15s; }
.lg-f input:focus { outline: 0; border-color: var(--tint); box-shadow: 0 0 0 4px rgba(42,38,76,.12); }
.lg-form .btn { height: 52px; border-radius: 14px; font-size: 16px; margin-top: 8px; box-shadow: 0 10px 24px rgba(42,38,76,.25); }
.lg-form .err { color: var(--red); font-size: 14px; margin: 4px 2px 6px; }
.lg-foot { text-align: center; color: var(--label-3); font-size: 12px; margin-top: 30px; }

.st-accettato { background: rgba(52,199,89,.14); color: #1B7A33; }
@media (prefers-color-scheme: dark) { .st-accettato { color: #5FDB7E; } }

/* ---------- Commerciale: kanban e tabella ---------- */
.kb { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.kb-col { background: var(--bg-fill-2); border-radius: 18px; padding: 10px; min-height: 200px; transition: background .15s, box-shadow .15s; }
.kb-col.over { background: var(--tint-soft); box-shadow: inset 0 0 0 2px var(--tint); }
.kb-col header { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.kb-col header b { font-size: 14px; }
.kb-col header .muted { margin-left: auto; }
.kb-list { display: flex; flex-direction: column; gap: 8px; }
.kb-card { position: relative; display: block; background: var(--bg-elev); border-radius: 14px; padding: 12px 12px 12px 16px; box-shadow: var(--shadow); color: var(--label); text-decoration: none; cursor: grab; overflow: hidden; }
.kb-card.dragging { opacity: .45; }
.kb-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--b-swicho); }
.kb-bar.b-riflexho { background: var(--b-riflexho); } .kb-bar.b-vestho { background: var(--b-vestho); }
.kb-card .nm { font-weight: 650; font-size: 15px; }
.kb-card .ds { font-size: 12.5px; color: var(--label-2); margin-top: 4px; display: flex; gap: 6px; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kb-card .ds .bchip { padding: 2px 6px; font-size: 10px; }
.kb-card .ft { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12.5px; }
.kb-card .ft span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-empty { border: 1.5px dashed var(--sep); border-radius: 14px; padding: 18px; text-align: center; color: var(--label-3); font-size: 13px; }
@media (max-width: 700px) { .kb { grid-template-columns: repeat(4, 80vw); scroll-snap-type: x mandatory; } .kb-col { scroll-snap-align: start; } }
.tblwrap { background: var(--bg-elev); border-radius: 18px; overflow-x: auto; box-shadow: var(--shadow); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--label-2); padding: 12px 14px; border-bottom: .5px solid var(--sep); white-space: nowrap; }
.tbl th a { color: inherit; text-decoration: none; }
.tbl td { padding: 11px 14px; border-bottom: .5px solid var(--sep); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--bg-fill-2); }
.tbl .r { text-align: right; }
.dh .acts form { display: contents; }

.split.solo { display: block; }
.split.solo > .dcard { max-width: 1240px; margin: 0 auto; }
@media (min-width: 1200px) { .split.solo .dgrid { grid-template-columns: 1.2fr 1fr; gap: 20px; } }
.lead-full { max-width: none; }
@media (min-width: 1100px) {
  .lead-full .lrows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
  .lead-full .lrow { border-right: .5px solid var(--sep); }
  .lead-full .lrow:nth-child(2n) { border-right: 0; }
  .lead-full .lrow:last-child { border-bottom: .5px solid var(--sep); }
}

/* ---------- Misure ---------- */
.mis-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.mis-unit label { position: relative; }
.mis-unit input { position: absolute; opacity: 0; }
.mis-unit span { display: block; padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.mis-unit input:checked + span { background: var(--bg-elev); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.mis-head, .mis-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px 76px 50px 64px 30px; gap: 6px; align-items: center; }
.mis-head { font-size: 11.5px; font-weight: 700; color: var(--label-2); text-transform: uppercase; letter-spacing: .04em; padding: 0 2px 6px; }
.mis-row { margin-bottom: 6px; }
.mis-row input { width: 100%; box-sizing: border-box; height: 40px; border: 0; border-radius: 10px; background: var(--bg-fill); padding: 0 10px; font: inherit; font-size: 15px; color: var(--label); min-width: 0; }
.mis-row .w, .mis-row .h, .mis-row .n { text-align: right; }
.mis-row .a { text-align: right; font-size: 14px; }
.mis-tot { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: .5px solid var(--sep); font-size: 14px; }
.mis-hint { background: #FFF6E9; color: #8A4B00; border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
@media (prefers-color-scheme: dark) { .mis-hint { background: rgba(255,159,10,.15); color: #FFB454; } }
@media (max-width: 560px) { .mis-head, .mis-row { grid-template-columns: minmax(0, 1fr) 62px 62px 42px 30px; } .mis-head span:nth-child(5), .mis-row .a { display: none; } }
.mtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.mtable th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--label-2); text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: .5px solid var(--sep); }
.mtable td { padding: 9px 10px; border-bottom: .5px solid var(--sep); }
.mtable .r { text-align: right; }
.mtable tfoot td { font-weight: 700; border-bottom: 0; }

/* ---------- Da fare ---------- */
.side-badge { margin-left: auto; background: #FF453A; color: #fff; font-size: 11px; font-weight: 700; border-radius: 9px; padding: 1px 7px; line-height: 16px; }
.td-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1200px) { .td-wrap.has-detail { grid-template-columns: minmax(0, 1fr) 380px; } }
.td-main { min-width: 0; }
.tq { background: var(--bg-elev); border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow); }
.tq-row { display: flex; align-items: center; gap: 10px; }
.tq-row input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--label); outline: 0; }
.tq-row .btn { width: auto; height: 36px; border-radius: 10px; padding: 0 14px; font-size: 13px; }
.tq-opts { display: none; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 0 2px 32px; }
.tq:focus-within .tq-opts, .tq.open .tq-opts, .tq:not(.compact) .tq-opts { display: flex; }
.tq-opts select, .tq-opts input[type=date], .tq-opts input[type=time] { height: 34px; border: 0; border-radius: 9px; background: var(--bg-fill); padding: 0 10px; font: inherit; font-size: 13px; color: var(--label); }
.tq-opts .opt > span { padding: 7px 10px; font-size: 12.5px; }
.tq-when { display: flex; gap: 6px; flex-wrap: wrap; }
.tq .tq-date, .tq .tq-time { display: none; }
.tq:has(input[value=data]:checked) .tq-date, .tq:has(input[value=data]:checked) .tq-time { display: block; }
.tq:has(input[value=oggi]:checked) .tq-time, .tq:has(input[value=domani]:checked) .tq-time { display: block; }
.tk-c { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #C7C7CC; background: transparent; flex: none; cursor: pointer; padding: 0; display: grid; place-items: center; font-size: 12px; color: #fff; transition: background .15s, border-color .15s; }
.tk-c:hover { border-color: var(--tint); background: var(--tint-soft); }
.tk-c.urg { border-color: #C4281C; }
.tk-c.ghost { border-style: dashed; cursor: default; }
.tk.done .tk-c { background: #1B7A33; border-color: #1B7A33; }
.tg { display: flex; align-items: center; gap: 8px; margin: 18px 4px 8px; }
.tg span { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--label-2); }
.tg small { font-size: 12px; color: var(--label-2); }
.tg i { flex: 1; height: .5px; background: var(--sep); }
.tg.late span { color: #C4281C; } .tg.today span { color: var(--orange); } .tg.week span { color: var(--tint); } .tg.ok span { color: #1B7A33; }
.tk-list { background: var(--bg-elev); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.tk-list.flat { box-shadow: none; border-radius: 0; background: transparent; }
.tk { display: flex; gap: 12px; padding: 12px 16px; border-bottom: .5px solid var(--sep); align-items: flex-start; }
.tk:last-child { border-bottom: 0; }
.tk.sel { background: var(--tint-soft); box-shadow: inset 3px 0 0 var(--tint); }
.tk.done { opacity: .55; }
.tk.done .tk-t { text-decoration: line-through; font-weight: 500; }
.tk form { display: contents; }
.tk-b { flex: 1; min-width: 0; color: var(--label); text-decoration: none; display: flex; flex-direction: column; gap: 5px; }
.tk-t { display: flex; gap: 8px; font-size: 15px; font-weight: 600; line-height: 1.3; }
.tk-t .urg { color: #C4281C; }
.tk-w { margin-left: auto; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--label-2); }
.tk-w.late { color: #C4281C; } .tk-w.today { color: var(--orange); }
.tk-m { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--label-2); }
.tk-m:empty { display: none; }
.tk-p { display: inline-flex; align-items: center; gap: 4px; border-radius: 7px; padding: 2px 8px; font-weight: 600; font-size: 11.5px; background: #EDEDF0; color: #1C1C1E; white-space: nowrap; }
.tk-p.b-riflexho { background: #FFF1E2; color: #A85400; } .tk-p.b-vestho { background: #F3EEE8; color: #6F5D4A; }
@media (prefers-color-scheme: dark) { .tk-p { background: rgba(235,235,245,.14); color: #F5F5F7; } }
.tk .av { width: 20px; height: 20px; font-size: 8px; }
.td-detail { background: var(--bg-elev); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); position: relative; }
@media (min-width: 1200px) { .td-detail { position: sticky; top: 70px; } }
.td-close { position: absolute; right: 14px; top: 12px; font-size: 22px; color: var(--label-2); text-decoration: none; }
.td-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-right: 24px; }
.td-tags .tk-w { margin: 0; }
.td-detail h2 { font-size: 21px; margin: 10px 0 0; line-height: 1.25; }
.td-notes { font-size: 14px; color: var(--label); margin: 6px 0 0; }
.td-acts { display: flex; gap: 8px; margin-top: 14px; }
.td-acts form { display: contents; }
.td-acts .btn { height: 44px; border-radius: 12px; }
.td-acts .btn.ok { flex: 1; background: #1B7A33; }
.td-acts .btn.sec { width: auto; padding: 0 14px; font-size: 14px; }
.td-deleg { margin-top: 10px; border-radius: 12px; background: var(--tint-soft); padding: 10px 12px; font-size: 13px; }
.td-deleg .opts { margin-top: 8px; }
.opt-b { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px 4px 4px; border-radius: 999px; border: 0; background: var(--bg-elev); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--label); cursor: pointer; }
.opt-b:hover { box-shadow: 0 0 0 2px var(--tint); }
.opt-b .av { width: 20px; height: 20px; font-size: 8px; }
.td-deleg p { margin: 8px 0 0; }
.td-detail .cap { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: var(--label-2); text-transform: uppercase; }
.cm { display: flex; gap: 10px; margin-top: 12px; }
.cm .av { width: 28px; height: 28px; font-size: 10px; flex: none; }
.cm small { font-size: 12.5px; color: var(--label-2); }
.cm p { margin: 3px 0 0; font-size: 14px; background: var(--bg-fill); border-radius: 12px; padding: 8px 11px; }
.danger-t { color: #C4281C !important; }
.td-dash { margin: 14px 0; padding: 14px 16px; }
.td-dash-h { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.td-dash-h h2 { font-size: 18px; margin: 0; }
.td-dash-h .link { margin-left: auto; color: var(--tint); font-weight: 600; text-decoration: none; font-size: 14px; }
.td-dash .tk { padding: 10px 2px; }
.td-dash .tq { box-shadow: none; padding: 6px 2px 0; background: transparent; border-top: .5px solid var(--sep); border-radius: 0; margin-top: 4px; }
/* Da ordinare */
.ord-list { display: flex; flex-direction: column; gap: 10px; }
.ord { background: var(--bg-elev); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.ord-h { display: flex; gap: 12px; align-items: flex-start; }
.ord-n { font-weight: 650; font-size: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ord-q { font-size: 22px; font-weight: 700; white-space: nowrap; }
.ord-q small { font-size: 13px; color: var(--label-2); font-weight: 600; }
.ord-items { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ord-items a { font-size: 12.5px; background: var(--bg-fill); border-radius: 8px; padding: 4px 9px; color: var(--label); text-decoration: none; }
.ord-f { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.ord-f input { height: 36px; border: 0; border-radius: 10px; background: var(--bg-fill); padding: 0 10px; font: inherit; font-size: 14px; color: var(--label); }
.ord-f input[name=supplier] { flex: 1 1 160px; min-width: 0; }
.ord-f .btn { width: auto; height: 36px; border-radius: 10px; padding: 0 14px; font-size: 13px; }
.btn.ok { background: #1B7A33; }

/* ---------- + Preventivo ---------- */
.np { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 1100px) { .np { grid-template-columns: minmax(0, 1fr) 320px; } .np-side { position: sticky; top: 70px; } }
.np-sec { background: var(--bg-elev); border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.np-h { display: flex; align-items: center; gap: 10px; }
.np-h span { width: 26px; height: 26px; border-radius: 50%; background: var(--tint); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.np-h b { font-size: 17px; }
.np-h small { margin-left: 6px; font-size: 12.5px; }
.np-g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.np-g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 700px) { .np-g3, .np-g2 { grid-template-columns: 1fr; } }
.np-sug-wrap { position: relative; }
.np-sug { position: absolute; left: 0; top: calc(100% + 4px); width: min(520px, 90vw); background: var(--bg-elev); border-radius: 14px; box-shadow: 0 12px 34px rgba(0,0,0,.18); padding: 6px; z-index: 20; }
.np-sug-h { padding: 6px 10px; font-size: 11px; font-weight: 700; color: var(--label-2); letter-spacing: .05em; text-transform: uppercase; }
.np-sug button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 10px; font: inherit; font-size: 14px; color: var(--label); cursor: pointer; }
.np-sug button:hover { background: var(--tint-soft); }
.np-sug button span { color: var(--label-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.np-sug em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 600; color: var(--label-2); white-space: nowrap; }
.np-sug em.lead { color: #A85400; background: #FFF1E2; border-radius: 6px; padding: 2px 7px; }
.np-note { margin-top: 10px; font-size: 13px; color: #8A4B00; background: #FFF6E9; border-radius: 10px; padding: 8px 12px; }
.np-brands .opt > span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; font-weight: 700; }
.np-brands .opt > span i { width: 9px; height: 9px; border-radius: 50%; }
.np-brands .opt input:checked + span i { box-shadow: 0 0 0 2px #fff; }
.np-sum-n { font-size: 19px; font-weight: 700; margin-top: 6px; }
.np-side .cap { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: var(--label-2); text-transform: uppercase; }

/* ---------- Preventivi in prima vista ---------- */
.side-cta { display: flex; align-items: center; justify-content: center; gap: 8px; margin: -8px 2px 14px; height: 46px; border-radius: 13px; background: var(--orange); color: #1C1C1E; font-weight: 700; font-size: 15px; text-decoration: none; }
.side-cta:hover { filter: brightness(1.05); }
.side-badge.or { background: var(--orange); }
.np-cta { background: var(--orange) !important; color: #1C1C1E !important; font-weight: 700; }
.qk { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.qk .sbox { min-height: 0; padding: 14px 16px; }
@media (max-width: 800px) { .qk { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.qb { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 4px; }
@media (max-width: 800px) { .qb { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; } .qb-col { scroll-snap-align: start; } }
.qb-col { background: var(--bg-fill-2); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.qb-col header { display: flex; align-items: center; gap: 8px; padding: 4px 4px 2px; }
.qb-col header i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.qb-col header b { font-size: 14px; }
.qb-col header small { color: var(--label-2); font-size: 13px; }
.qb-col header span { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--label-2); white-space: nowrap; }
.qc { position: relative; background: var(--bg-elev); border-radius: 14px; padding: 12px 12px 12px 15px; box-shadow: var(--shadow); overflow: hidden; }
.qc-b { display: flex; flex-direction: column; gap: 5px; color: var(--label); text-decoration: none; }
.qc-1 { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.qc-1 b:last-child { white-space: nowrap; }
.qc-2 { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--label-2); }
.qc-2 .bchip { padding: 2px 6px; font-size: 10px; }
.qc-3 { font-size: 12.5px; font-weight: 600; color: var(--label); }
.qc form { display: block; }
.qc-a { display: grid; place-items: center; width: 100%; height: 32px; margin-top: 9px; border-radius: 9px; border: 0; background: var(--bg-fill); font: inherit; font-size: 12.5px; font-weight: 700; color: var(--tint); text-decoration: none; cursor: pointer; }
.qc-a.ok { background: #E5F5E9; color: #1B7A33; }
.qb-more { text-align: center; font-size: 13px; font-weight: 600; color: var(--tint); text-decoration: none; padding: 4px; }
/* dashboard: riga azioni */
.dash-top { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 4px 0 18px; }
@media (min-width: 1000px) { .dash-top { grid-template-columns: 1.25fr 1fr; } }
.np-hero { display: flex; align-items: center; gap: 18px; border-radius: 24px; padding: 22px 24px; color: #fff; text-decoration: none; background: radial-gradient(120% 140% at 100% 0%, #4B4390 0%, #2A264C 55%, #1C1935 100%); }
.np-hero .pl { width: 60px; height: 60px; border-radius: 18px; background: var(--orange); color: #1C1C1E; font-size: 36px; display: grid; place-items: center; flex: none; }
.np-hero b { display: block; font-size: 25px; letter-spacing: -.02em; }
.np-hero small { font-size: 14px; opacity: .8; }
.np-hero .ar { margin-left: auto; font-size: 28px; opacity: .7; }
.dash-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dash-quick a { background: var(--bg-elev); border-radius: 18px; padding: 14px 16px; text-decoration: none; color: var(--label); display: flex; flex-direction: column; justify-content: center; box-shadow: var(--shadow); }
.dash-quick a b { font-size: 15px; }
.dash-quick a small { font-size: 12.5px; color: var(--label-2); }
.dash-sec { display: flex; align-items: baseline; gap: 10px; margin: 6px 4px 12px; }
.dash-sec h2 { font-size: 21px; margin: 0; }
.dash-sec a { margin-left: auto; color: var(--tint); font-weight: 600; font-size: 14px; text-decoration: none; }

/* ---- v0.18 · righe del preventivo ---- */
.qx{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:18px;align-items:start;margin-top:6px}
.qside{position:sticky;top:14px;margin-top:34px}
.qside .card{margin:0}
.qs-r{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:6px;font-size:15px}
.qs-r[hidden]{display:none}
.qs-r input{border:0;border-bottom:1px solid var(--sep);font:inherit;background:none;color:var(--label);text-align:right;width:90px;padding:2px 0}
.qs-r.sep{border-top:.5px solid var(--sep);padding-top:10px;margin-top:10px}
.qs-r.big{font-size:21px;margin-top:10px}
.qs-r.dep{font-size:13.5px;color:var(--label-2);background:var(--fill,rgba(120,120,128,.08));border-radius:10px;padding:8px 10px;margin-top:10px}
.qs-act{display:flex;flex-direction:column;gap:8px;margin-top:14px}
.qs-act .btn{width:100%;text-align:center}
.qlines{background:var(--bg-2,#fff);border-radius:14px;overflow:hidden;box-shadow:0 0 0 .5px var(--sep)}
.qlh,.ql.k-riga{display:grid;grid-template-columns:22px minmax(0,1fr) 64px 52px 88px 54px 96px 30px;gap:8px;align-items:start}
.qlh{padding:9px 12px;font-size:11.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--label-3,#8e8e93);border-bottom:.5px solid var(--sep)}
.qlh .r{text-align:right}
.ql{padding:10px 12px;border-bottom:.5px solid var(--sep);background:var(--bg-2,#fff);position:relative}
.ql:last-child{border-bottom:0}
.ql.k-sezione,.ql.k-nota{display:grid;grid-template-columns:22px minmax(0,1fr) auto 30px;gap:8px;align-items:center}
.ql.k-nota{grid-template-columns:22px minmax(0,1fr) 30px}
.ql.k-sezione{background:var(--fill,rgba(120,120,128,.07));padding-top:12px;padding-bottom:12px}
.ql.k-sezione .desc{font-size:13px!important;font-weight:700!important;letter-spacing:.06em;text-transform:uppercase}
.ql.k-nota .det{font-style:italic}
.ql input:not([type=hidden]),.ql textarea{border:0;border-bottom:1px solid transparent;font:inherit;background:none;color:var(--label);padding:3px 0;width:100%;min-width:0;border-radius:0}
.ql input:focus,.ql textarea:focus{outline:0;border-bottom-color:var(--accent,#0a84ff)}
.ql .num,.ql .tot,.ql .stot{text-align:right}
.ql .q,.ql .u,.ql .p,.ql .d{border-bottom-color:var(--sep)}
.ql .desc{font-size:15.5px;font-weight:600}
.ql .det{font-size:13.5px;color:var(--label-2);resize:none;overflow:hidden;min-height:22px;line-height:1.4;display:block}
.ql .tot,.ql .stot{padding-top:4px;font-size:15px;white-space:nowrap}
.ql .qh{cursor:grab;color:var(--label-3,#aeaeb2);font-size:15px;letter-spacing:-2px;padding-top:4px;user-select:none;touch-action:none}
.ql .qm{border:0;background:none;color:var(--label-2);font-size:18px;line-height:1;padding:3px 4px;border-radius:6px;cursor:pointer}
.ql .qm:hover{background:var(--fill,rgba(120,120,128,.12))}
.ql .txtb{display:none;font-size:11.5px;color:#b26a00;font-weight:600;margin-top:2px}
.ql.txt .txtb{display:inline-block}
.ql.txt .tot{opacity:.3}
.ql.drag{opacity:.45;background:var(--fill,rgba(10,132,255,.08))}
.qlines.locked .ql input,.qlines.locked .ql textarea{border-bottom-color:transparent}
.qadd{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:10px 2px 0}
.qadd .btn{width:auto}
.qsep{width:1px;height:22px;background:var(--sep);margin:0 4px}
.qmenu{position:absolute;z-index:60;background:var(--bg-2,#fff);border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.18),0 0 0 .5px var(--sep);padding:5px;min-width:210px;display:flex;flex-direction:column}
.qmenu[hidden]{display:none}
.qmenu button{border:0;background:none;text-align:left;font:inherit;font-size:14.5px;padding:8px 10px;border-radius:8px;color:var(--label);cursor:pointer}
.qmenu button:hover{background:var(--fill,rgba(120,120,128,.12))}
.qmenu button.red{color:#d70015}
.qmenu button[hidden]{display:none}
.catdlg{border:0;border-radius:16px;padding:16px;width:min(560px,94vw);max-height:80vh;box-shadow:0 20px 60px rgba(0,0,0,.25);background:var(--bg-2,#fff);color:var(--label)}
.catdlg::backdrop{background:rgba(0,0,0,.3)}
.cat-h{display:flex;gap:10px;align-items:center;margin-bottom:10px}
.cat-h input{flex:1;border:0;background:var(--fill,rgba(120,120,128,.12));border-radius:9px;padding:8px 10px;font:inherit;color:var(--label)}
.cat-g{font-size:11.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--label-3,#8e8e93);margin:12px 2px 4px}
.cat-i{display:flex;justify-content:space-between;gap:12px;width:100%;border:0;background:none;text-align:left;font:inherit;padding:9px 10px;border-radius:10px;cursor:pointer;color:var(--label)}
.cat-i:hover{background:var(--fill,rgba(120,120,128,.1))}
.cat-i span{display:flex;flex-direction:column}.cat-i small{color:var(--label-2)}
.cat-i em{font-style:normal;color:var(--label-2);white-space:nowrap;font-size:14px}
.linkbtn{border:0;background:none;color:var(--accent,#0a84ff);font:inherit;font-size:13.5px;cursor:pointer;padding:0}
.ie-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:22px}
.ie{background:var(--bg-2,#fff);border-radius:14px;padding:14px 16px;box-shadow:0 0 0 .5px var(--sep)}
.ie-h{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.ie-h b{font-size:13px;letter-spacing:.05em;text-transform:uppercase}
.ie-h .linkbtn{margin-left:auto}
.ie-i{width:20px;height:20px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;color:#fff}
.ie.ok .ie-i{background:#1e8e3e}.ie.no .ie-i{background:#d70015}
.ie-list label{display:flex;gap:9px;align-items:flex-start;padding:5px 0;font-size:14.5px;cursor:pointer;line-height:1.35}
.ie-list input{margin-top:2px;flex:none;width:17px;height:17px}
.ie.ok .ie-list input{accent-color:#1e8e3e}.ie.no .ie-list input{accent-color:#d70015}
.ie-list input:not(:checked)+span{color:var(--label-3,#aeaeb2);text-decoration:line-through}
.ie-add{display:flex;gap:8px;margin-top:8px}
.ie-add input{flex:1;border:0;border-bottom:1px solid var(--sep);background:none;font:inherit;font-size:14.5px;color:var(--label);padding:4px 0}
.ie-add .btn{width:auto}
@media (max-width:1000px){.qx{grid-template-columns:1fr}.qside{position:static;margin-top:6px}}
@media (max-width:760px){
  .qlh{display:none}
  .ql.k-riga{grid-template-columns:18px 1fr 1fr 1fr 30px;grid-template-areas:"h d d d m" "h q u p m" "h s t t m"}
  .ql.k-riga .qh{grid-area:h}.ql.k-riga .qd{grid-area:d}.ql.k-riga .q{grid-area:q}.ql.k-riga .u{grid-area:u}.ql.k-riga .p{grid-area:p}.ql.k-riga .d{grid-area:s;text-align:left}.ql.k-riga .tot{grid-area:t}.ql.k-riga .qm{grid-area:m}
  .ie-grid{grid-template-columns:1fr}
}
.pitems .pi{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.pitems .pi select{flex:none;width:auto;max-width:130px}
.pitems .pi input{flex:1;min-width:90px}
.qs-r.dep .tnum{white-space:nowrap;font-weight:600}
@media (min-width:1001px){.qx ~ .savebar{display:none}}
.qdel{display:inline-block;position:relative}
.qdel summary{list-style:none;cursor:pointer}.qdel summary::-webkit-details-marker{display:none}
.qdel-box{position:absolute;z-index:50;top:calc(100% + 6px);left:0;width:300px;background:var(--bg-2,#fff);border-radius:14px;padding:14px;box-shadow:0 10px 30px rgba(0,0,0,.18),0 0 0 .5px var(--sep)}

/* ---- v0.23 · rapporto di lavoro ---- */
.rp-top{display:flex;justify-content:space-between;align-items:center;margin:8px 4px 0}
.rp-dots{display:flex;gap:4px}.rp-dots i{width:7px;height:7px;border-radius:4px;background:#c7c7cc}.rp-dots i.on{width:22px;background:#2A264C}
.rp-hint{margin:6px 8px 0}
.rp-seg{display:flex;background:rgba(118,118,128,.12);border-radius:10px;padding:2px;margin:0 2px}
.rp-seg label{flex:1;cursor:pointer}.rp-seg input{position:absolute;opacity:0;pointer-events:none}
.rp-seg span{display:block;text-align:center;padding:8px 4px;border-radius:8px;font-size:14px;font-weight:500;color:var(--label-2)}
.rp-seg input:checked+span{background:var(--bg-2,#fff);box-shadow:0 1px 3px rgba(0,0,0,.12);font-weight:600;color:var(--label)}
.rp-checks .rp-seg input[value=si]:checked+span{background:#1e8e3e;color:#fff}
.rp-checks .rp-seg input[value=no]:checked+span{background:#d70015;color:#fff}
.rp-chips{display:flex;flex-wrap:wrap;gap:6px;margin:0 2px}
.rp-chips input{position:absolute;opacity:0;pointer-events:none}
.rp-chips span{display:inline-block;padding:8px 13px;border-radius:999px;font-size:14px;font-weight:600;background:var(--bg-2,#fff);color:var(--label-2);box-shadow:0 0 0 .5px var(--sep);cursor:pointer}
.rp-chips input:checked+span{background:#2A264C;color:#fff}
.rp-nav{display:flex;gap:10px;margin:22px 2px 0}.rp-nav .btn{flex:1}.rp-nav.col{flex-direction:column}
.btn.green{background:#1e8e3e;color:#fff}
#pieces{background:var(--bg-2,#fff);border-radius:14px;box-shadow:0 0 0 .5px var(--sep);overflow:hidden}
.rp-pc{display:flex;gap:10px;padding:12px 14px;border-bottom:.5px solid var(--sep)}.rp-pc:last-child{border-bottom:0}
.rp-pc .n{width:24px;height:24px;border-radius:7px;background:#1c1c1e;color:#fff;font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;flex:none;margin-top:3px}
.rp-pc .grow{flex:1;min-width:0}
.rp-pc input:not([type=checkbox]):not([type=radio]){border:0;border-bottom:1px solid var(--sep);background:none;font:inherit;color:var(--label);padding:4px 0;min-width:0}
.rp-wh{display:flex;gap:6px;align-items:center;flex-wrap:wrap;font-size:15px;font-weight:600}
.rp-wh input{width:70px;font-weight:600;text-align:center}.rp-wh input.lbl{flex:1;min-width:140px;font-weight:400;font-size:14px;text-align:left}
.rp-ser{display:flex;gap:8px;margin-top:6px}.rp-ser input{flex:1;font-size:13px;color:var(--label-2)}
.rp-tg{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-top:9px}
.rp-tg input{position:absolute;opacity:0;pointer-events:none}
.rp-tg span{display:inline-block;font-size:12.5px;font-weight:700;border-radius:7px;padding:5px 9px;background:var(--fill,rgba(120,120,128,.1));color:var(--label-3,#8e8e93);cursor:pointer}
.rp-tg .ok input:checked+span{background:rgba(52,199,89,.16);color:#1e8e3e}
.rp-tg .ko input:checked+span{background:rgba(255,59,48,.13);color:#d70015}
.rp-tg .rp-del{margin-left:auto;color:var(--label-3,#8e8e93)}
.rp-q{padding:12px 16px;border-bottom:.5px solid var(--sep);font-size:14.5px;line-height:1.35}.rp-q:last-child{border-bottom:0}.rp-q .rp-seg{margin:9px 0 0}
.rp-ph{display:flex;gap:8px;padding:10px 16px;overflow-x:auto}.rp-ph a{position:relative;flex:none}.rp-ph img{width:78px;height:64px;object-fit:cover;border-radius:9px;display:block}
.rp-ph small{position:absolute;left:5px;bottom:4px;color:#fff;font-size:10px;font-weight:700;text-shadow:0 1px 2px rgba(0,0,0,.5)}
.rp-decl{font-size:13px;line-height:1.55;color:var(--label-2);padding:12px 16px;margin:0}
.rp-sig{padding:12px 16px;border-bottom:.5px solid var(--sep)}.rp-sig:last-child{border-bottom:0}
.rp-sig .h{display:flex;justify-content:space-between;font-size:13.5px;color:var(--label-2)}
.rp-sig canvas{display:block;width:100%;height:130px;margin-top:6px;background:#fafafc;border:1px dashed #c7c7cc;border-radius:10px;touch-action:none}
.rp-actions{display:flex;flex-direction:column;gap:10px;margin-top:16px}
input.switch{appearance:none;-webkit-appearance:none;width:46px;height:28px;border-radius:14px;background:#e5e5ea;position:relative;cursor:pointer;flex:none;transition:background .2s}
input.switch::after{content:"";position:absolute;left:2px;top:2px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.2);transition:left .2s}
input.switch:checked{background:#34c759}input.switch:checked::after{left:20px}
body.rp-public{background:#f2f2f7;margin:0}
.rp-pub{max-width:560px;margin:0 auto;padding:28px 16px 40px;font-family:Montserrat,-apple-system,sans-serif;color:#1d1d1f}
.rp-pub h1{font-size:26px;margin:18px 0 4px}
.rp-pub .card{background:#fff;border-radius:14px;padding:14px 16px}
.rp-kv{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:.5px solid #e5e5ea;font-size:14.5px}.rp-kv span{color:#6e6e73}
.rp-lab{display:block;font-size:13px;color:#6e6e73;margin-bottom:10px}.rp-lab input{display:block;width:100%;box-sizing:border-box;border:0;border-bottom:1px solid #e5e5ea;font:inherit;font-size:16px;color:#1d1d1f;padding:6px 0;background:none}
.rp-pub .rp-decl{padding:8px 0}.rp-pub .rp-sig{padding:0;border:0}
.rp-pub .btn{display:block;width:100%;text-align:center;box-sizing:border-box}
.rp-nav.col .btn{flex:none;width:100%}
.rp-wh .rp-del{margin-left:auto;border:0;background:none;color:var(--label-3,#aeaeb2);font-size:15px;cursor:pointer;padding:2px 4px}
.rp-pc input.lbl{display:block;width:100%;font-size:13.5px;color:var(--label-2);margin-top:4px}
.rp-ser input{width:0}
.rp-pb{padding-bottom:90px}

/* ---- v0.24 · telefono e tablet ---- */
/* barra laterale: scorre se lo schermo è basso */
@media (min-width: 960px) { .sidebar { overflow-y: auto; scrollbar-width: thin; } .sidebar .side-foot { padding-bottom: 4px; } }
@media (min-width: 960px) and (max-height: 760px) { .sidebar { padding-top: 12px; } .sidebar .side-logo { padding-bottom: 14px !important; } .side-link { padding: 6px 12px; } .side-cta { height: 40px; margin-bottom: 10px; } }
/* tab "Menu" e foglio con tutte le voci */
.tab { border: 0; background: none; font-family: inherit; cursor: pointer; position: relative; }
.tab-dot { position: absolute; top: 3px; left: 50%; margin-left: 6px; min-width: 16px; height: 16px; border-radius: 8px; background: #FF453A; color: #fff; font-size: 10px; font-style: normal; font-weight: 700; line-height: 16px; padding: 0 4px; box-sizing: border-box; }
.mnav[hidden] { display: none; }
.mnav { position: fixed; inset: 0; z-index: 60; }
.mnav-bg { position: absolute; inset: 0; background: rgba(0,0,0,.32); animation: mnf .18s ease; }
.mnav-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 8px 16px calc(18px + var(--safe-b)); box-shadow: 0 -10px 40px rgba(0,0,0,.18); animation: mns .22s cubic-bezier(.2,.8,.2,1); max-width: 640px; margin: 0 auto; }
.mnav-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--label-3, #c7c7cc); margin: 2px auto 10px; opacity: .6; }
.mnav-head { display: flex; justify-content: space-between; align-items: center; margin: 0 4px 12px; font-size: 15px; }
.mnav-cta { margin: 0 0 12px !important; }
.mnav-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mnav-it { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 6px 12px; border-radius: 16px; background: var(--bg-elev); box-shadow: var(--shadow); color: var(--label); font-size: 12.5px; font-weight: 600; text-align: center; text-decoration: none; line-height: 1.2; }
.mnav-it.on { box-shadow: 0 0 0 2px var(--tint); }
.mnav-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--tint-soft); display: flex; align-items: center; justify-content: center; }
.mnav-ic .ic { width: 22px; height: 22px; color: var(--tint); }
.mnav-it .side-badge { position: absolute; top: 8px; right: 8px; margin: 0; font-style: normal; }
.mnav-out { display: block; text-align: center; margin: 14px 0 0; padding: 12px; border-radius: 13px; background: var(--bg-elev); color: #FF3B30; font-weight: 600; text-decoration: none; }
html.mnav-open { overflow: hidden; }
@keyframes mns { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes mnf { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 960px) { .mnav { display: none !important; } }

@media (max-width: 700px) {
  /* intestazioni delle pagine: titolo sopra, comandi sotto */
  .lh { flex-wrap: wrap; row-gap: 8px; }
  .lh .grow { flex: 1 1 100%; }
  .lh .seg { flex: 1 1 auto; }
  .lh .btn { flex: 0 0 auto; }
  .lh .grow h1 { font-size: 28px; }
  /* elenchi: i riquadri riassuntivi stanno nella dashboard */
  .list-summary .summary { display: none; }
  /* tabella preventivi come schede */
  .tblwrap { overflow: visible; background: none; box-shadow: none; }
  .tbl.qt thead { display: none; }
  .tbl.qt, .tbl.qt tbody { display: block; }
  .tbl.qt tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "cli amt" "code st" "brand date"; gap: 3px 10px; background: var(--bg-elev); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 8px; }
  .tbl.qt td { border: 0; padding: 0; min-width: 0; }
  .tbl.qt td:nth-child(1) { grid-area: code; font-size: 12.5px; }
  .tbl.qt td:nth-child(1) div { display: inline; margin-left: 4px; }
  .tbl.qt td:nth-child(2) { grid-area: cli; font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tbl.qt td:nth-child(3) { grid-area: brand; }
  .tbl.qt td:nth-child(4) { grid-area: date; text-align: right; font-size: 12.5px; color: var(--label-2); }
  .tbl.qt td:nth-child(5) { grid-area: st; text-align: right; }
  .tbl.qt td:nth-child(6) { grid-area: amt; font-weight: 700; }
  .tbl.qt td:nth-child(7) { display: none; }
  .tbl.qt td[colspan] { grid-column: 1 / -1; }
  /* tabelle generiche: scorrono dentro la scheda */
  .tbl:not(.qt) { min-width: 640px; }
  .tblwrap:has(.tbl:not(.qt)) { overflow-x: auto; background: var(--bg-elev); box-shadow: var(--shadow); }
  /* righe dei moduli: etichetta più stretta */
  .field label { width: 38%; max-width: 130px; font-size: 15px; line-height: 1.25; }
  .field { gap: 8px; }
  .large-title { font-size: 27px; }
  .toolbar { gap: 6px; }
}
@media (max-width: 700px) {
  .toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar > * { flex: none; }
  .toolbar .qdel-box { position: fixed; left: 16px; right: 16px; top: auto; bottom: calc(100px + var(--safe-b)); width: auto; }
  .tq-opts { padding-left: 0; }
  .tq-opts select, .tq-opts input, .tq-opts > * { max-width: 100%; }
}
@media (max-width: 700px) {
  .seg { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .seg::-webkit-scrollbar { display: none; }
  .seg > a, .seg > span, .seg > label { white-space: nowrap; }
  html, body { overflow-x: hidden; }
}
.brand-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid2 input, .grid2 select { min-width: 0; max-width: 100%; box-sizing: border-box; }
@media (max-width: 380px) { .brand-cards .card { padding: 11px; } .brand-cards .card .stat .v { font-size: 19px; } }
/* accesso: codice, link e caselle */
.lg-links { text-align: center; font-size: 14px; margin: 14px 0 0; color: var(--label-2); }
.lg-links a, .lg-links .linkbtn { color: var(--tint, #2A264C); font-weight: 600; text-decoration: none; font-size: 14px; }
.lg-links .linkbtn[disabled] { color: var(--label-3, #aeaeb2); cursor: default; }
.lg-chk { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--label-2); margin: 4px 0 14px; cursor: pointer; }
.lg-chk input { width: 18px; height: 18px; }
.lg-code { font-size: 26px !important; letter-spacing: 8px; text-align: center; font-weight: 700; }
.np-origin { height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: 11px; background: rgba(42,38,76,.08); color: #2A264C; font-weight: 600; font-size: 15px; }

/* ---- v0.26 · settimana, tempi, attività ---- */
.wk-head { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.wk-title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 0; }
.wk-head .grow { flex: 1 1 220px; }
.wk-sel { height: 40px; border: 0; border-radius: 11px; background: var(--bg-elev); box-shadow: var(--shadow); padding: 0 12px; font: inherit; font-size: 14px; color: var(--label); }
.wk-nav { display: flex; align-items: center; height: 40px; background: var(--bg-elev); border-radius: 11px; box-shadow: var(--shadow); font-size: 14px; font-weight: 600; }
.wk-nav a { width: 36px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--tint); text-decoration: none; font-size: 20px; }
.wk-nav span { padding: 0 4px; min-width: 120px; text-align: center; }
.wk-seg { margin: 0 !important; height: 40px; box-sizing: border-box; }
.wk-seg a { display: flex; align-items: center; }
.wk-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.wk-k { margin: 0 !important; padding: 16px 18px !important; }
.wk-k .k { font-size: 13px; font-weight: 600; color: var(--label-2); }
.wk-k .v { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; white-space: nowrap; }
.wk-k .v small { font-size: 16px; color: var(--label-3, #8e8e93); font-weight: 600; }
.wk-k .s { font-size: 12.5px; color: var(--label-2); min-height: 32px; }
.wk-k .meter { height: 6px; border-radius: 3px; background: var(--bg-fill); overflow: hidden; margin-top: 8px; }
.wk-k .meter i { display: block; height: 100%; border-radius: 3px; }
.wk-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 12px; margin-top: 12px; }
.wk-grid.b { grid-template-columns: 1.4fr 1fr; }
.wk-grid > .card { margin: 0; padding: 18px 20px; }
.wk-cap { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--label-3, #8e8e93); margin-bottom: 12px; }
.wk-bars { display: flex; gap: 8px; align-items: flex-end; }
.wk-bars.dense { gap: 3px; }
.wk-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.wk-bar b { font-size: 12px; height: 15px; }
.wk-bar .col { width: 100%; max-width: 38px; height: 150px; border-radius: 7px; background: var(--bg-fill); display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.wk-bar .col.field { background: repeating-linear-gradient(135deg, var(--bg-fill) 0 6px, rgba(240,138,36,.18) 6px 12px); }
.wk-bar .col i { display: block; width: 100%; }
.wk-bar span { font-size: 12px; color: var(--label-2); }
.wk-leg { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--label-2); }
.wk-leg span { display: inline-flex; align-items: center; gap: 6px; }
.wk-leg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.wk-leg i.fd { background: repeating-linear-gradient(135deg, #e5e5ea 0 3px, rgba(240,138,36,.4) 3px 6px); }
.wk-kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: .5px solid var(--sep); font-size: 14px; }
.wk-late { display: block; font-size: 13px; font-weight: 600; color: #D70015; text-decoration: none; margin-top: 8px; }
.wk-tbl > div, .wk-tbl > a { display: grid; grid-template-columns: 1.6fr 1fr .9fr .7fr .9fr; gap: 10px; padding: 9px 0; border-bottom: .5px solid var(--sep); font-size: 13.5px; color: var(--label); text-decoration: none; align-items: center; }
.wk-tbl .h { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--label-3, #8e8e93); }
.wk-tbl .r { text-align: right; }
.wk-tbl .cl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.wk-pill { font-style: normal; font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 2px 7px; }
.wk-h { display: grid; grid-template-columns: 46px 56px 56px 1fr 80px; gap: 8px; align-items: center; font-size: 13px; padding: 7px 0; border-bottom: .5px solid var(--sep); }
.wk-h .bar { height: 8px; border-radius: 4px; background: var(--bg-fill); overflow: hidden; }
.wk-h .bar i { display: block; height: 100%; background: #1E8E3E; border-radius: 4px; }
.wk-h b { text-align: right; }
.wk-tg { margin-top: 14px; }
.wk-tg summary { list-style: none; width: auto; display: inline-flex; cursor: pointer; }
.wk-tg summary::-webkit-details-marker { display: none; }
.wk-tg form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.wk-tg label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--label-2); }
.wk-tg input { height: 38px; border: 0; border-radius: 9px; background: var(--bg-fill); padding: 0 10px; font: inherit; font-size: 15px; color: var(--label); }
.wk-tg button { grid-column: 1 / -1; width: auto; justify-self: start; }
@media (max-width: 1100px) { .wk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wk-grid, .wk-grid.b { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .wk-k .v { font-size: 24px; } .wk-tbl > div, .wk-tbl > a { grid-template-columns: 1.4fr .9fr .8fr; } .wk-tbl > * > :nth-child(2), .wk-tbl > * > :nth-child(4) { display: none; } .wk-tg form { grid-template-columns: 1fr; } .wk-nav span { min-width: 0; } }

/* scheda: tempi e contatti con il cliente */
.dbox.tempi.late { box-shadow: inset 0 0 0 1.5px rgba(215,0,21,.35); }
.dbox.tempi.late .cap { color: #D70015; }
.tline { display: flex; gap: 6px; margin-top: 10px; }
.tline > div { flex: 1; position: relative; padding-top: 16px; font-size: 12.5px; color: var(--label-2); }
.tline > div i { position: absolute; top: 0; left: 0; right: 0; height: 5px; border-radius: 3px; background: var(--bg-fill); }
.tline > div.done i { background: #34C759; }
.tline > div.lt i { background: #FF9F0A; }
.tline b { display: block; color: var(--label); font-size: 13px; }
.actlog { margin-top: 10px; }
.actlog summary { list-style: none; display: inline-flex; width: auto; cursor: pointer; }
.actlog summary::-webkit-details-marker { display: none; }
.actlog form { margin-top: 12px; }
.actlog textarea { width: 100%; box-sizing: border-box; margin-top: 10px; border: 0; border-radius: 10px; background: var(--bg-fill); padding: 9px 11px; font: inherit; font-size: 14.5px; color: var(--label); resize: vertical; }
.ak { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ak input { position: absolute; opacity: 0; pointer-events: none; }
.ak span { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px; border-radius: 11px; background: var(--bg-fill); font-size: 12px; font-weight: 600; cursor: pointer; }
.ak span i { font-style: normal; font-size: 17px; }
.ak input:checked + span { background: #2A264C; color: #fff; }
.chip-late { display: inline-block; font-size: 11.5px; font-weight: 700; color: #D70015; background: rgba(215,0,21,.1); border-radius: 6px; padding: 2px 7px; margin-top: 4px; }
.chip-late.warn { color: #B25E00; background: rgba(255,159,10,.16); }
/* intestazioni delle pagine: titolo a sinistra, comandi a destra, tutti alti uguali */
.lh { align-items: center; }
.lh > .grow { flex: 1 1 auto; }
.lh > .seg { height: 44px; box-sizing: border-box; padding: 3px; border-radius: 12px; align-items: stretch; margin: 0; flex: none; }
.lh > .seg > a { display: flex; align-items: center; justify-content: center; padding: 0 20px; font-size: 15px; font-weight: 600; border-radius: 9px; white-space: nowrap; }
.lh > .btn, .lh > a.btn { height: 44px; padding: 0 20px; font-size: 15px; font-weight: 700; border-radius: 12px; display: inline-flex; align-items: center; }
.tbl.qt td:first-child, .tbl.qt td:nth-child(4) { white-space: nowrap; }
@media (max-width: 700px) {
  .lh > .seg { flex: 1 1 auto; }
  .lh > .seg > a { flex: 1; padding: 0 10px; }
  .lh > .btn, .lh > a.btn { padding: 0 14px; font-size: 14px; }
}
@media (max-width: 700px) { .lh > .grow { flex: 1 1 100%; } .lh > .seg + .btn { margin-left: 0; } }
