:root {
  --bg: #0B0B0C; --card: #161618; --card-2: #1E1E21; --line: #2A2A2E;
  --ink: #F5F3EF; --ink-2: #B9B4AC; --ink-3: #7D786F;
  --gold: #F2A61B; --gold-2: #FFC24D; --gold-soft: rgba(242,166,27,.14);
  --ok: #4CC38A; --ok-soft: rgba(76,195,138,.14);
  --bad: #F06A5E; --bad-soft: rgba(240,106,94,.14);
  --blue: #6EA8FF; --blue-soft: rgba(110,168,255,.14);
  --r: 18px; --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--gold); }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); } .small { font-size: 13px; }
.hidden { display: none !important; }
.gold { color: var(--gold); } .okc { color: var(--ok); } .badc { color: var(--bad); }

.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.shell { max-width: 620px; margin: 0 auto; padding: calc(var(--safe-t) + 14px) 16px calc(var(--nav-h) + var(--safe-b) + 28px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 2px 16px; }
.topbar h1 { font-size: 27px; margin: 0; letter-spacing: -.02em; font-weight: 760; }
.topbar .sub { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.brandbar { display: flex; align-items: center; gap: 10px; }
.brandbar img { height: 30px; }
.brandbar .t { font-weight: 800; letter-spacing: .14em; font-size: 14px; }
.brandbar .t span { color: var(--gold); }
.goldline { height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .7; margin: 0 0 16px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--card); color: var(--ink); border: 1px solid var(--line); flex: none; }
.iconbtn:disabled { opacity: .35; }
.syncdot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.syncdot i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.syncdot.wait i { background: var(--gold); } .syncdot.off i { background: var(--ink-3); } .syncdot.err i { background: var(--bad); }

.card { background: var(--card); border-radius: var(--r); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pad { padding: 16px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 24px 4px 10px; }
.section-title h2 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin: 0; font-weight: 700; }
.section-title .link { font-size: 14px; color: var(--gold); font-weight: 650; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { padding: 14px 16px; text-align: left; width: 100%; }
.kpi .k { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.kpi .v { font-size: 26px; font-weight: 780; margin-top: 4px; letter-spacing: -.02em; }
.kpi .h { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kpi.wide { grid-column: 1 / -1; }
.kpi.wide .v { font-size: 34px; }

.actions3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 12px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 650; line-height: 1.2; text-align: center; }
.act:active { transform: scale(.97); }
.act .ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--gold); color: #111; }
.act.alt .ic { background: var(--card-2); color: var(--gold); border: 1px solid var(--line); }

.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 13px 14px; }
.row + .row { border-top: 1px solid var(--line); }
.row .ic { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--card-2); color: var(--gold); border: 1px solid var(--line); font-weight: 750; font-size: 14px; }
.row .body { flex: 1; min-width: 0; }
.row .t { display: block; font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .d { display: block; font-size: 13px; color: var(--ink-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .v { flex: none; text-align: right; font-weight: 750; font-size: 15.5px; }
.row .v small { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.pill.gold { background: var(--gold-soft); color: var(--gold); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.neutral { background: var(--card-2); color: var(--ink-2); border: 1px solid var(--line); }
.slot { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 7px; border-radius: 7px; letter-spacing: .02em; }
.slot.mattina { background: var(--gold-soft); color: var(--gold-2); }
.slot.pomeriggio { background: var(--blue-soft); color: var(--blue); }
.slot.giornata { background: var(--ok-soft); color: var(--ok); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; margin-bottom: 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chip.on { background: var(--gold); color: #111; border-color: var(--gold); }
.search { width: 100%; height: 44px; border-radius: 13px; border: 1px solid var(--line); background: var(--card); padding: 0 14px; margin-bottom: 10px; outline: none; }
.search:focus { border-color: var(--gold); }

.empty { text-align: center; padding: 30px 22px; }
.empty .ic { width: 60px; height: 60px; border-radius: 18px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; margin: 0 auto 12px; }
.empty h3 { margin: 0 0 6px; font-size: 17px; }
.empty p { margin: 0 0 14px; color: var(--ink-2); font-size: 14.5px; }

.day { margin-top: 14px; }
.day-h { display: flex; justify-content: space-between; align-items: baseline; margin: 0 6px 6px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); text-transform: capitalize; }
.day-h.today { color: var(--gold); }
.day-empty { font-size: 13px; color: var(--ink-3); padding: 0 6px 4px; }

.money { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.money > div { padding: 12px 6px; }
.money > div + div { border-left: 1px solid var(--line); }
.money .k { font-size: 11.5px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.money .v { font-size: 19px; font-weight: 780; margin-top: 3px; }
.split { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.split div { display: flex; justify-content: space-between; }
.split .tot { font-weight: 750; border-top: 1px dashed var(--line); padding-top: 6px; }

.field { margin-bottom: 15px; }
.field > label, .lbl { display: block; font-size: 13px; font-weight: 650; color: var(--ink-2); margin: 0 2px 7px; }
.input { width: 100%; height: 50px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card-2); outline: none; font-size: 16px; -webkit-appearance: none; appearance: none; color: var(--ink); }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 15px) 22px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.input:focus { border-color: var(--gold); }
textarea.input { height: 80px; padding: 12px 14px; resize: none; }
.euro { position: relative; }
.euro .input { padding-left: 34px; font-weight: 700; }
.euro::before { content: "€"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 700; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 12.5px; color: var(--ink-3); margin: 6px 2px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 22px; border-radius: 15px; font-weight: 750; font-size: 16px; }
.btn:active { transform: scale(.98); }
.btn.block { width: 100%; }
.btn.primary { background: var(--gold); color: #111; }
.btn.ghost { background: var(--card-2); color: var(--ink); border: 1.5px solid var(--line); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.sm { height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn:disabled { opacity: .4; pointer-events: none; }
.btnrow { display: flex; gap: 10px; } .btnrow > * { flex: 1; }
.linkbtn { color: var(--gold); font-weight: 650; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--card-2); border: 1.5px solid var(--line); border-radius: 14px; padding: 3px; gap: 3px; }
.seg button { min-height: 40px; border-radius: 11px; font-size: 14px; font-weight: 650; color: var(--ink-2); padding: 4px; }
.seg button.on { background: var(--gold); color: #111; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick button { padding: 9px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card-2); font-weight: 650; font-size: 14.5px; }
.pick button.on { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-2); }
.preview { border-radius: 14px; padding: 12px 14px; background: var(--card-2); border: 1.5px dashed var(--line); margin-bottom: 15px; font-size: 14.5px; }
.preview b { color: var(--gold); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

/* sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; opacity: 0; transition: opacity .2s; }
.sheet-bg.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--card); border-top: 1px solid var(--line); border-radius: 24px 24px 0 0; padding: 8px 18px calc(var(--safe-b) + 20px); transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1); max-width: 620px; margin: 0 auto; }
.sheet.show { transform: translateY(0); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-h h3 { margin: 0; font-size: 20px; }
.close { width: 34px; height: 34px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; color: var(--ink-2); }

/* pagina di dettaglio */
.page-h { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
.page-h h1 { font-size: 22px; margin: 0; flex: 1; min-width: 0; line-height: 1.2; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-2); } .kv .v { font-weight: 650; text-align: right; }
.contact { display: flex; gap: 8px; margin-top: 10px; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(14,14,15,.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.nav-in { max-width: 620px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--nav-h); }
.nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 650; color: var(--ink-3); }
.nav button.on { color: var(--gold); }

.auth { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; max-width: 420px; margin: 0 auto; padding: calc(var(--safe-t) + 24px) 22px calc(var(--safe-b) + 24px); }
.brand-big { text-align: center; margin-bottom: 26px; }
.brand-big img { width: 230px; max-width: 80%; }
.brand-big .imp { color: var(--gold); letter-spacing: .5em; font-size: 13px; font-weight: 700; margin-top: 12px; padding-left: .5em; }
.err-msg { background: var(--bad-soft); color: var(--bad); padding: 11px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 14px; font-weight: 600; }
.banner { font-size: 13px; font-weight: 600; text-align: center; padding: 8px 10px; border-radius: 12px; margin-bottom: 12px; background: var(--gold-soft); color: var(--gold-2); }
.banner.err { background: var(--bad-soft); color: var(--bad); }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: right; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 11px 6px 7px; }
.table td { text-align: right; padding: 10px 6px; border-top: 1px solid var(--line); }
.table th:first-child, .table td:first-child { text-align: left; padding-left: 14px; }
.table th:last-child, .table td:last-child { padding-right: 14px; }
.table tr.total td { font-weight: 750; border-top: 2px solid var(--line); }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); transform: translate(-50%, 20px); background: var(--ink); color: #111; padding: 11px 18px; border-radius: 14px; font-size: 14.5px; font-weight: 650; opacity: 0; pointer-events: none; transition: all .25s; z-index: 60; max-width: calc(100% - 40px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--bad); color: #fff; }

/* pagina operaio */
.op-call { padding: 14px 16px; }
.op-call + .op-call { border-top: 1px solid var(--line); }
.op-call .t { font-weight: 700; font-size: 16px; margin-top: 6px; }
.op-call .a { font-size: 14.5px; color: var(--ink-2); margin-top: 2px; }
.op-call .n { font-size: 14px; margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--card-2); color: var(--ink-2); }
a.btn { text-decoration: none; color: var(--ink); }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos .ph { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--card-2); border: 1px solid var(--line); display: grid; place-items: center; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }

.op-reply { margin-top: 10px; font-size: 14px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 10px; }
.op-reply.ok { background: var(--ok-soft); color: var(--ok); }
.op-reply.no { background: var(--bad-soft); color: var(--bad); }
.rp { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 6px; margin-left: 6px; vertical-align: 1px; }
.rp.si { background: var(--ok-soft); color: var(--ok); } .rp.no { background: var(--bad-soft); color: var(--bad); } .rp.wait { background: var(--card-2); color: var(--ink-3); border: 1px solid var(--line); }

/* ---------- fluidità ---------- */
@keyframes inFwd { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes inBack { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes inFade { from { opacity: 0; } to { opacity: 1; } }
.shell.enter-fwd { animation: inFwd .2s ease-out; }
.shell.enter-back { animation: inBack .2s ease-out; }
.shell.enter-fade { animation: inFade .15s ease-out; }
@media (prefers-reduced-motion: reduce) { .shell { animation: none !important; } }
button:active, .row:active, .act:active, label:active { opacity: .85; }
.row { transition: background .15s; }
.row:active { background: var(--card-2); }
.actions4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.actions4 .act { padding: 12px 4px 10px; font-size: 12.5px; }
.actions4 .act .ic { width: 40px; height: 40px; }
.quickbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.quickbar > * { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--gold); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.quickbar span { color: var(--ink); }
.chip .cnt { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: rgba(255,255,255,.08); font-size: 12px; margin-left: 2px; }
.chip.on .cnt { background: rgba(0,0,0,.15); }
.tip { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 13px 14px; font-size: 14.5px; }
.tip .sp { flex: 1; } .tip .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; flex: none; }
.seg.rep button[data-rp="si"].on { background: var(--ok); color: #0b0b0c; }
.seg.rep button[data-rp="no"].on { background: var(--bad); color: #fff; }

/* ---------- agenda: lavoro del giorno ---------- */
.jb { margin-bottom: 8px; overflow: hidden; }
.jb-h { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; color: var(--ink); }
.jb-h .body { flex: 1; min-width: 0; }
.jb-h .t { display: block; font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jb-h .d { display: block; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jb-h > svg { color: var(--ink-3); flex: none; }
.todo-n { flex: none; font-size: 11.5px; font-weight: 700; color: var(--ink-2); background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; }
.jb-note { margin: -4px 14px 8px; font-size: 13.5px; color: var(--ink-2); padding: 7px 10px; border-radius: 10px; background: var(--card-2); }
.jb-ws { border-top: 1px solid var(--line); }
.jb-w { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 14px; font-size: 14.5px; font-weight: 600; text-align: left; color: var(--ink); }
.jb-w + .jb-w { border-top: 1px solid var(--line); }
.jb-w svg { color: var(--ink-3); flex: none; }
.jb-w .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jb-w .rp { margin-left: 0; }
.jb-f { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px 10px; border-top: 1px solid var(--line); background: rgba(255,255,255,.015); }
.jb-f .linkbtn { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- calendario ---------- */
.cal { padding: 10px 10px 8px; }
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-h .iconbtn { width: 36px; height: 36px; }
.cal-t { font-weight: 780; font-size: 17px; padding: 6px 12px; border-radius: 10px; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-3); padding: 4px 0; }
.cd { position: relative; height: 44px; border-radius: 12px; font-size: 15px; font-weight: 650; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink); }
.cd.past { color: var(--ink-3); }
.cd.sun { color: var(--ink-3); }
.cd.today { box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--gold); }
.cd.sel { background: var(--gold); color: #111; }
.dots { display: flex; gap: 3px; height: 5px; }
.dots i, .cal-leg i { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.dots i.g, .cal-leg i.g { background: var(--gold); }
.dots i.w, .cal-leg i.w { background: var(--ink-2); }
.dots i.r, .cal-leg i.r { background: var(--bad); }
.cd.sel .dots i { background: #111; }
.cal-leg { display: flex; justify-content: center; gap: 14px; font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.cal-leg span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- scheda lavoro ---------- */
.jt { font-weight: 700; font-size: 16px; margin-bottom: 2px; }
.addr { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); text-decoration: none; margin-top: 2px; }
.tasks { overflow: hidden; }
.prog { height: 4px; background: var(--card-2); }
.prog i { display: block; height: 100%; background: var(--ok); border-radius: 0 2px 2px 0; transition: width .3s; }
.task { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.tk-chk { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--ink-3); display: grid; place-items: center; color: transparent; margin-top: -2px; }
.task.done .tk-chk { background: var(--ok); border-color: var(--ok); color: #0b0b0c; }
.tk-t { flex: 1; text-align: left; font-size: 15px; line-height: 1.35; color: var(--ink); }
.tk-t small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.task.done .tk-t { color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.25); }
.task.done .tk-t small { text-decoration: none; }
.task-add { display: flex; gap: 8px; padding: 10px 12px; }
.task-add .input { height: 44px; }
.task-add .btn { height: 44px; width: 48px; padding: 0; flex: none; }
.tasks-h { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 10px 14px 4px; border-top: 1px solid var(--line); }
details.past { margin-top: 8px; }
details.past summary { cursor: pointer; color: var(--ink-3); font-size: 13.5px; font-weight: 600; margin: 0 6px 8px; }
.photos .ph { position: relative; }
.ph-tag { position: absolute; left: 6px; top: 6px; font-size: 10.5px; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.65); color: var(--gold-2); letter-spacing: .02em; }
.ph-tag.r { color: var(--blue); }
.ph-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; font-size: 11px; font-weight: 600; text-align: left; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-add { display: flex; gap: 8px; margin-top: 10px; }
.ph-add .btn { flex: 1; }
.spinner.sm { width: 18px; height: 18px; border-width: 2px; }
.btn .spinner.sm { border-color: rgba(0,0,0,.2); border-top-color: currentColor; }

/* ---------- visore foto ---------- */
.viewer { position: fixed; inset: 0; z-index: 70; background: #000; display: flex; flex-direction: column; opacity: 0; transition: opacity .18s; padding-top: var(--safe-t); }
.viewer.show { opacity: 1; }
.vw-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
.vw-n { font-size: 14px; font-weight: 650; color: var(--ink-2); }
.vw-img { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.vw-img img { max-width: 100%; max-height: 100%; object-fit: contain; transition: opacity .15s; }
.vw-arr { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(30,30,33,.7); color: #fff; display: grid; place-items: center; }
.vw-arr.l { left: 10px; } .vw-arr.r { right: 10px; }
.vw-bot { padding: 12px 16px calc(var(--safe-b) + 16px); background: var(--card); border-top: 1px solid var(--line); max-width: 620px; width: 100%; margin: 0 auto; border-radius: 20px 20px 0 0; }
.vw-cap { font-size: 14.5px; margin-bottom: 10px; }

/* ---------- preventivo ---------- */
.help summary { cursor: pointer; font-weight: 700; color: var(--gold); display: flex; align-items: center; gap: 6px; list-style: none; }
.help summary::-webkit-details-marker { display: none; }
.help ol { margin: 10px 0 0; padding-left: 20px; font-size: 14px; color: var(--ink-2); }
.help li + li { margin-top: 4px; }
.qitems { overflow: hidden; }
.qi { padding: 12px 12px 10px; border-bottom: 1px solid var(--line); }
.qi-top { display: flex; gap: 8px; align-items: center; }
.qi-n { flex: none; width: 22px; text-align: center; font-size: 12px; font-weight: 800; color: var(--ink-3); }
.qi-d { height: 46px; min-height: 46px; padding: 12px 12px; line-height: 1.35; overflow: hidden; }
.qi-x { width: 36px; height: 36px; background: transparent; border: 0; color: var(--ink-3); }
.qi-bot { display: flex; align-items: flex-end; gap: 6px; margin: 8px 0 0 30px; }
.qi-bot label { display: block; font-size: 11px; font-weight: 700; color: var(--ink-3); position: relative; }
.qi-bot label:first-child { width: 64px; }
.qi-bot label.euro { flex: 1; max-width: 130px; }
.qi-bot label.euro::before { top: auto; bottom: 12px; transform: none; }
.qi-bot .input { height: 42px; margin-top: 3px; padding: 0 10px; }
.qi-bot .euro .input { padding-left: 28px; }
.qi-bot .x { color: var(--ink-3); padding-bottom: 11px; }
.qi-a { margin-left: auto; padding-bottom: 11px; font-size: 15px; }
.qi-add { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 14px; color: var(--gold); font-weight: 700; }
.qtot { border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); padding: 10px 14px; font-size: 14.5px; }
.qtot div { display: flex; justify-content: space-between; padding: 3px 0; }
.qtot .big { font-weight: 800; font-size: 18px; border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 8px; }
.qbar { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); display: flex; gap: 10px; margin-top: 18px; padding: 10px; border-radius: 18px; background: rgba(22,22,24,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); z-index: 5; }
.qbar .btn { flex: 1; height: 48px; padding: 0 10px; }

/* ================= riprogettazione: lavori ben visibili, un solo tasto «Aggiungi» ================= */
.kstrip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.kstrip .card { padding: 10px 12px; text-align: left; }
.kstrip small { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kstrip b { display: block; font-size: 19px; font-weight: 800; margin-top: 2px; white-space: nowrap; }

/* card lavoro */
.jc { margin-bottom: 10px; overflow: hidden; }
.jc-main { display: block; width: 100%; text-align: left; padding: 14px 16px 12px; color: var(--ink); }
.jc-top { display: flex; align-items: center; gap: 8px; }
.jc-top .t { flex: 1; min-width: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jc .d { font-size: 14px; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jc-meta { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.jc-meta .m { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.jc-meta .m.gold { color: var(--gold); }
.jc-meta .m.r { margin-left: auto; }
.jc-meta .m.r b { font-size: 15px; margin-left: 3px; }
.jc .prog { margin-top: 10px; border-radius: 3px; overflow: hidden; }
.jc-acts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.jc-acts button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 10px; font-size: 12px; font-weight: 650; color: var(--ink-2); }
.jc-acts button + button { border-left: 1px solid var(--line); }
.jc-acts button svg { color: var(--gold); }
.jc-acts button:active { background: var(--card-2); }
details.grp > summary { list-style: none; cursor: pointer; }
details.grp > summary::-webkit-details-marker { display: none; }
details.grp[open] > summary .faint { display: none; }

/* tasto Aggiungi sempre a portata di pollice */
.fab { position: fixed; z-index: 30; right: max(16px, calc(50% - 294px)); bottom: calc(var(--nav-h) + var(--safe-b) + 16px); display: inline-flex; align-items: center; gap: 8px; height: 54px; padding: 0 20px 0 16px; border-radius: 27px; background: var(--gold); color: #111; font-weight: 800; font-size: 16px; box-shadow: 0 10px 28px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.2); }
.fab:active { transform: scale(.97); }
.shell { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 96px); }

/* menu Aggiungi */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); text-align: left; color: var(--ink); }
.tile .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); margin-bottom: 6px; }
.tile b { font-size: 15.5px; }
.tile small { font-size: 12.5px; color: var(--ink-3); }
.tile.gold { border-color: var(--gold); }
.tile:active { transform: scale(.98); }

/* scelta del lavoro */
.pj-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow: auto; }
.pj { display: block; text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); color: var(--ink); }
.pj .t { display: block; font-weight: 750; font-size: 16px; }
.pj .d { display: block; font-size: 13px; color: var(--ink-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj .m { display: block; margin-top: 6px; }
.jobchip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 14px; background: var(--card-2); border: 1.5px solid var(--line); text-align: left; color: var(--ink); }
.jobchip > svg { color: var(--gold); flex: none; }
.jobchip .b { flex: 1; min-width: 0; }
.jobchip b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jobchip small { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jobchip .ch { font-size: 13px; font-weight: 700; color: var(--gold); flex: none; }

/* importi grandi, date veloci */
.euro.big::before { font-size: 22px; left: 16px; }
.input.big { height: 62px; font-size: 28px; font-weight: 800; padding-left: 42px !important; }
.dchips { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-other { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 5px; }
.dc-other input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; }
.pick.big button { padding: 12px 16px; font-size: 15.5px; }
.seg.sm button { min-height: 34px; font-size: 13px; }
.btn2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.btn2 .btn, .btn3 .btn { padding: 0 8px; }
.nt-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.nt-row .b { flex: 1; min-width: 0; }
.nt-row b { display: block; }
.nt-row small { color: var(--ink-3); font-size: 12.5px; }

/* scheda lavoro */
.hero { padding: 14px 16px; }
.moneybar { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); }
.moneybar > div { padding: 10px 6px; text-align: center; }
.moneybar > div + div { border-left: 1px solid var(--line); }
.moneybar small { display: block; font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.moneybar b { display: block; font-size: 18px; font-weight: 800; margin-top: 2px; }
.jtabs { position: sticky; top: 0; z-index: 6; display: flex; gap: 4px; margin: 14px -16px 12px; padding: calc(var(--safe-t) + 6px) 16px 8px; background: rgba(11,11,12,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); overflow-x: auto; scrollbar-width: none; }
.jtabs::-webkit-scrollbar { display: none; }
.jtabs button { flex: 1 0 auto; justify-content: center; display: inline-flex; align-items: center; gap: 4px; padding: 9px 9px; border-radius: 999px; font-size: 14.5px; font-weight: 700; color: var(--ink-2); background: var(--card); border: 1px solid var(--line); }
.jtabs button.on { background: var(--gold); color: #111; border-color: var(--gold); }
.jtabs i { font-style: normal; font-size: 11px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; display: inline-grid; place-items: center; background: rgba(255,255,255,.1); }
.jtabs button.on i { background: rgba(0,0,0,.15); }
.jtab-body .split { border-top: 0; }

/* ricevuta */
.rc-amt { display: flex; align-items: center; gap: 12px; }
.rc-amt > div { flex: 1; }
.rc-amt small { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.rc-amt b { display: block; font-size: 26px; font-weight: 800; color: var(--ok); }

/* anteprima PDF */
.viewer.pv { background: #2a2a2d; }
.pv-pages { flex: 1; min-height: 0; overflow: auto; padding: 8px 12px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; -webkit-overflow-scrolling: touch; }
.pv-page { width: 100%; max-width: 760px; height: auto; background: #fff; border-radius: 4px; box-shadow: 0 6px 24px rgba(0,0,0,.45); }
.viewer.pv .vw-bot { border-radius: 0; max-width: none; }
.viewer.pv .vw-n { flex: 1; text-align: center; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.jtabs button { font-size: 13.5px; }
#toast { bottom: calc(var(--nav-h) + var(--safe-b) + 84px); }

/* schede del lavoro: icona + nome, tutte visibili */
.jtabs { gap: 4px; overflow: visible; }
.jtabs button { position: relative; flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px; padding: 8px 2px 7px; border-radius: 14px; font-size: 11.5px; font-weight: 700; }
.jtabs button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jtabs i { position: absolute; top: 4px; right: calc(50% - 22px); background: var(--gold); color: #111; }
.jtabs button.on i { background: #111; color: var(--gold); }

/* ================= app degli operai (EDD Operai) ================= */
.op-shell { padding-bottom: calc(var(--safe-b) + 40px) !important; }
.op-shell .op-call { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; }
.op-shell .op-call + .op-call { border-top: 1px solid var(--line); }
.op-call.past { opacity: .6; }
.op-h { display: flex; align-items: center; gap: 8px; }
.op-sl { font-size: 13px; font-weight: 700; color: var(--ink-2); flex: 1; }
.op-call .a { display: block; text-decoration: none; }
.op-ans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.op-ans .btn { height: 50px; font-size: 16px; }
.op-tools { display: flex; gap: 16px; margin-top: 10px; }
.op-tabs { margin-bottom: 6px; }
.op-inst { margin-bottom: 12px; border-color: var(--gold); }
.op-sheet { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.op-sheet[hidden] { display: none; }
.op-sheet-in { width: 100%; max-width: 620px; background: var(--card); border-radius: 22px 22px 0 0; padding: 20px 18px calc(var(--safe-b) + 18px); border-top: 1px solid var(--line); }
.iconbtn.spin { animation: spin .8s linear infinite; }

/* ================= semplificazione: una strada per ogni cosa ================= */
.jc { display: block; width: 100%; text-align: left; padding: 14px 16px 12px; color: var(--ink); }
.jc-top > svg { color: var(--ink-3); flex: none; }
.addbtn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 11px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-size: 13.5px; font-weight: 750; }
.addbtns { display: inline-flex; gap: 6px; }
.emptyrow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 16px; text-align: left; color: var(--ink-2); font-weight: 600; font-size: 14.5px; border-style: dashed; }
.emptyrow svg { color: var(--gold); flex: none; }
.dayrow .d { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; white-space: normal; }
.wchip { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); color: var(--ink-2); }
.wchip.ok { color: var(--ok); border-color: rgba(52,199,89,.35); }
.wchip.no { color: var(--bad); border-color: rgba(255,90,90,.4); }
.wchip.wait { color: var(--gold); }
.mvsum { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.mvsum b { color: var(--ink); margin-left: 4px; }
.row.more .t { color: var(--gold); text-align: center; }
details.tasks-done > summary { list-style: none; cursor: pointer; }
details.tasks-done > summary::-webkit-details-marker { display: none; }
details.tasks-done > summary::after { content: ' ›'; }
details.tasks-done[open] > summary::after { content: ' ⌄'; }
.cli-sel { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--card-2); border: 1.5px solid var(--gold); }
.cli-sel[hidden] { display: none; }
.cli-sel svg { color: var(--gold); }
.cli-sel b { flex: 1; font-size: 16px; }
.cli-sug { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.cli-sug:empty { display: none; }
.cli-opt { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); text-align: left; font-weight: 650; color: var(--ink); }
.cli-opt svg { color: var(--gold); }
.cli-opt small { margin-left: auto; color: var(--ink-3); font-weight: 600; }
.cli-new { display: flex; align-items: center; gap: 6px; padding: 8px 4px 0; font-size: 13.5px; color: var(--ink-2); }
.cli-new svg { color: var(--gold); }
.jobchip.static { border-style: solid; }
[hidden] { display: none !important; }

.nav-in { grid-template-columns: repeat(5, 1fr) !important; }

/* stato del preventivo */
.qstate { padding: 14px 16px; margin-top: 12px; display: block; width: 100%; text-align: left; color: var(--ink); }
.qstate .qs-h { display: flex; align-items: center; gap: 8px; }
.qstate .qs-h b { flex: 1; font-size: 15.5px; }
.qstate .qs-h .num { font-weight: 800; }
.qstate p { margin: 6px 0 10px; }
.qstate .qs-act { display: flex; flex-wrap: wrap; gap: 8px; }
.qstate .qs-act .btn { flex: 1; min-width: 96px; }
.qstate.wait { border-color: rgba(90,160,255,.45); }
.qstate.no { border-color: rgba(255,90,90,.35); }
.qstate.ok { border-color: rgba(52,199,89,.4); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
fieldset.qlock { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.qlock[disabled] .card { opacity: .72; }
.qstate .qs-act .btn { white-space: nowrap; padding: 0 8px; font-size: 14px; flex-direction: row; gap: 4px; }

/* lavori per cliente, preventivi, storico */
.kstrip > div.card { padding: 10px 12px; }
.row.iv { align-items: flex-start; }
.row.iv .body .t { white-space: normal; }
.iv-tasks { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.35; white-space: normal; }
.row.iv .v { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.row.iv .v b { font-size: 15px; }
.histlink { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; font-weight: 650; text-align: left; }
.histlink svg:first-child { color: var(--gold); }
.histlink b { margin-left: auto; color: var(--ink); }
.jc-meta { flex-wrap: wrap; row-gap: 6px; }

/* guadagni del cliente / condominio */
.gain { padding: 14px 16px; margin-top: 10px; }
.gain-h small { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.gain-h > b { display: block; font-size: 32px; font-weight: 850; line-height: 1.15; margin: 2px 0 2px; letter-spacing: -.01em; }
.gain-bar { display: flex; gap: 2px; height: 10px; border-radius: 99px; overflow: hidden; margin-top: 12px; background: var(--card-2); }
.gain-bar i { display: block; height: 100%; }
.gain-bar i.c { background: var(--ink-3); border-radius: 99px 2px 2px 99px; }
.gain-bar i.p { flex: 1; background: var(--ok); border-radius: 2px 99px 99px 2px; }
.gain-leg { display: flex; gap: 14px; margin-top: 6px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.gain-leg i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.gain-leg i.c { background: var(--ink-3); } .gain-leg i.p { background: var(--ok); }
.gain-row { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.gain-row > div + div { border-left: 1px solid var(--line); padding-left: 10px; }
.gain-row small { display: block; font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.gain-row b { display: block; font-size: 17px; font-weight: 800; margin-top: 2px; }
.row .d .cn { color: var(--ink); font-weight: 650; }

/* cliente / condominio: tre schede */
.ttabs { margin: 14px 0 12px; }
.ttabs button { font-size: 13.5px; padding: 0 4px; }
.ttabs .cnt { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: rgba(255,255,255,.08); font-size: 11.5px; margin-left: 2px; }
.ttabs button.on .cnt { background: rgba(0,0,0,.15); }
.addline { margin-bottom: 10px; border-style: dashed; }
.totline { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.totline > div { padding: 10px 8px; text-align: center; }
.totline > div + div { border-left: 1px solid var(--line); }
.totline small { display: block; font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.totline b { display: block; font-size: 17px; font-weight: 800; margin-top: 2px; }
.kstrip .card.sel { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.row .chev { flex: none; color: var(--ink-3); display: grid; }
