:root{--p:#c2410c;--p2:#9a3412;--pl:#fff7ed;--b:#e5e7eb;--t:#1f2937;--m:#6b7280;--ok:#059669;--err:#dc2626;--warn:#d97706;--r:12px;--hh:30px}
*{box-sizing:border-box}html{-webkit-text-size-adjust:100%}
body{margin:0;font:15px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;color:var(--t);background:#f8fafc;padding-bottom:calc(70px + env(safe-area-inset-bottom))}
a{color:var(--p)}h1{font-size:1.35rem;margin:.2rem 0 1rem}h2{font-size:1.1rem;margin:1.2rem 0 .6rem}
.top{position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:10px;padding:10px 14px;padding-top:calc(10px + env(safe-area-inset-top));background:#fff;border-bottom:1px solid var(--b)}
.brand{display:flex;align-items:center;gap:8px;text-decoration:none;color:var(--t);font-size:1.05rem}.brand img{width:30px;height:30px}.brand b{color:var(--p)}
.az{color:var(--m);font-size:.85rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:34vw}
.tr{margin-left:auto;display:flex;align-items:center;gap:10px}
.lang{display:flex;gap:2px}.lang a{text-decoration:none;font-size:1.15rem;opacity:.4;padding:2px}.lang a.on{opacity:1}
.bell{position:relative;text-decoration:none;font-size:1.25rem}.badge{position:absolute;top:-6px;right:-9px;background:var(--err);color:#fff;border-radius:10px;font-size:.7rem;padding:1px 5px;font-weight:700}.hide{display:none}
.esci{text-decoration:none;font-size:1.3rem;color:var(--m)}
.menu{position:fixed;bottom:0;left:0;right:0;z-index:30;display:flex;background:#fff;border-top:1px solid var(--b);padding-bottom:env(safe-area-inset-bottom)}
.menu a{flex:1;display:flex;flex-direction:column;align-items:center;padding:7px 2px;text-decoration:none;color:var(--m);font-size:.72rem}.menu a .i{font-size:1.25rem}.menu a.on{color:var(--p);font-weight:600}
@media(min-width:900px){body{padding-bottom:0}.menu{position:sticky;top:57px;bottom:auto;border-top:0;border-bottom:1px solid var(--b);justify-content:center;gap:6px}.menu a{flex:0 0 auto;flex-direction:row;gap:6px;font-size:.92rem;padding:10px 16px}.menu a .i{font-size:1rem}}
.wrap{max-width:1180px;margin:0 auto;padding:14px}
.trial{background:#fef3c7;color:#92400e;text-align:center;padding:7px;font-size:.88rem}
.foot{text-align:center;color:var(--m);font-size:.8rem;padding:24px 10px}
.card{background:#fff;border:1px solid var(--b);border-radius:var(--r);padding:16px;margin-bottom:14px}.narrow{max-width:460px;margin:20px auto}
.flash{padding:10px 12px;border-radius:10px;margin-bottom:12px;background:#ecfdf5;color:#065f46;border:1px solid #a7f3d0}.flash.err{background:#fef2f2;color:#991b1b;border-color:#fecaca}.flash.warn{background:#fffbeb;color:#92400e;border-color:#fde68a}
.muted{color:var(--m)}.small{font-size:.85rem}.right{text-align:right}.nowrap{white-space:nowrap}
label{display:block;font-weight:600;font-size:.88rem;margin:10px 0 4px}
input,select,textarea{width:100%;font:inherit;padding:10px 11px;border:1px solid #d1d5db;border-radius:10px;background:#fff;color:var(--t)}
input[type=checkbox],input[type=radio]{width:auto;margin-right:6px}input[type=color]{padding:3px;height:42px}
textarea{min-height:80px}input:focus,select:focus,textarea:focus{outline:2px solid #fdba74;border-color:var(--p)}
.chk{display:flex;align-items:center;font-weight:500}
.grid{display:grid;gap:10px;grid-template-columns:1fr}@media(min-width:640px){.g2{grid-template-columns:1fr 1fr}.g3{grid-template-columns:1fr 1fr 1fr}.g4{grid-template-columns:repeat(4,1fr)}}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:0;border-radius:10px;padding:10px 16px;font:inherit;font-weight:600;cursor:pointer;text-decoration:none;background:var(--p);color:#fff}
.btn:hover{background:var(--p2)}.btn.sec{background:#ffedd5;color:var(--p2)}.btn.red{background:#fee2e2;color:var(--err)}.btn.grn{background:var(--ok)}.btn.sm{padding:6px 10px;font-size:.85rem}.btn.full{width:100%}
.bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:12px}.bar .sp{flex:1}
table.t{width:100%;border-collapse:collapse;background:#fff}table.t th,table.t td{padding:9px 8px;border-bottom:1px solid var(--b);text-align:left;vertical-align:top}table.t th{font-size:.8rem;color:var(--m);font-weight:600}
.tw{overflow-x:auto;border:1px solid var(--b);border-radius:var(--r)}
.pill{display:inline-block;padding:2px 8px;border-radius:20px;font-size:.75rem;font-weight:600;background:#eef2ff;color:#3730a3}
.st-confermato{background:#dcfce7;color:#166534}.st-attesa{background:#fef3c7;color:#92400e}.st-completato{background:#e0e7ff;color:#3730a3}.st-assente{background:#fee2e2;color:#991b1b}.st-annullato{background:#f3f4f6;color:#6b7280;text-decoration:line-through}
.dot{display:inline-block;width:11px;height:11px;border-radius:50%;vertical-align:middle;margin-right:6px}
.list{list-style:none;margin:0;padding:0}.list li{display:flex;gap:10px;align-items:center;padding:11px 4px;border-bottom:1px solid var(--b)}.list li:last-child{border:0}.list .g{flex:1;min-width:0}
.list a.g{text-decoration:none;color:inherit}
.kpi{display:grid;gap:10px;grid-template-columns:repeat(2,1fr);margin-bottom:14px}@media(min-width:800px){.kpi{grid-template-columns:repeat(4,1fr)}}
.kpi div{background:#fff;border:1px solid var(--b);border-radius:var(--r);padding:12px}.kpi b{display:block;font-size:1.3rem}.kpi span{color:var(--m);font-size:.8rem}
/* agenda */
.days{display:flex;gap:6px;overflow-x:auto;padding-bottom:4px;margin-bottom:10px;scrollbar-width:none}
.days a{flex:0 0 auto;min-width:48px;text-align:center;padding:6px 4px;border-radius:10px;background:#fff;border:1px solid var(--b);text-decoration:none;color:var(--t);font-size:.78rem}
.days a b{display:block;font-size:1.05rem}.days a.on{background:var(--p);color:#fff;border-color:var(--p)}.days a.today:not(.on){border-color:var(--p);color:var(--p)}
.days a .n{display:block;height:6px}.days a .n i{display:inline-block;width:5px;height:5px;border-radius:50%;background:currentColor;opacity:.6}
.cal{display:flex;border:1px solid var(--b);border-radius:var(--r);background:#fff;overflow:auto;max-height:calc(100vh - 230px);position:relative}
.cal .hrs{flex:0 0 46px;position:sticky;left:0;background:#fff;z-index:3;border-right:1px solid var(--b)}
.cal .col{flex:1 0 150px;border-right:1px solid var(--b);position:relative}.cal .col:last-child{border-right:0}
.price-old{text-decoration:line-through;color:var(--m);margin-right:6px}
.fab{position:fixed;right:16px;bottom:calc(80px + env(safe-area-inset-bottom));width:56px;height:56px;border-radius:50%;background:var(--p);color:#fff;font-size:30px;display:flex;align-items:center;justify-content:center;text-decoration:none;box-shadow:0 6px 16px rgba(194,65,12,.35);z-index:25}
@media(min-width:900px){.fab{bottom:24px}}
.menu a .i{position:relative}.dotn{position:absolute;top:-4px;right:-10px;background:var(--err);color:#fff;border-radius:9px;font-size:.62rem;font-style:normal;padding:0 4px;font-weight:700}
.st-richiesta{background:#fef3c7;color:#92400e}.st-preventivo{background:#f3f4f6;color:#374151}.st-prenotato{background:#e0f2fe;color:#075985}.st-in_corso{background:#dcfce7;color:#166534}
.st-rientrato{background:#ffedd5;color:#9a3412}.st-chiuso{background:#e5e7eb;color:#374151}.st-annullato{background:#f3f4f6;color:#6b7280;text-decoration:line-through}
.st-disponibile{background:#dcfce7;color:#166534}.st-manutenzione{background:#fef3c7;color:#92400e}.st-guasto{background:#fee2e2;color:#991b1b}.st-dismesso{background:#f3f4f6;color:#6b7280}
.late{color:var(--err);font-weight:600}
.tabs{display:flex;gap:6px;overflow-x:auto;margin-bottom:12px;scrollbar-width:none}.tabs a{flex:0 0 auto;padding:7px 12px;border-radius:20px;background:#fff;border:1px solid var(--b);text-decoration:none;color:var(--t);font-size:.85rem}.tabs a.on{background:var(--p);border-color:var(--p);color:#fff}
.tabs a b{font-weight:700;margin-left:4px}
/* disponibilità (planning) */
.gantt{overflow:auto;border:1px solid var(--b);border-radius:var(--r);background:#fff;max-height:calc(100vh - 220px)}
.gantt table{border-collapse:separate;border-spacing:0;font-size:.78rem}
.gantt th,.gantt td{border-bottom:1px solid #f1f5f9;border-right:1px solid #f1f5f9;padding:0;height:34px;min-width:30px;text-align:center}
.gantt thead th{position:sticky;top:0;background:#fff;z-index:2;font-weight:600;color:var(--m);height:38px}
.gantt thead th.we{background:#f8fafc}.gantt thead th.today{color:var(--p)}
.gantt .nm{position:sticky;left:0;background:#fff;z-index:1;text-align:left;padding:4px 8px;min-width:170px;max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gantt thead .nm{z-index:3}
.gantt td.we{background:#fafafa}.gantt td a{display:block;height:100%;line-height:34px;text-decoration:none;color:#fff;font-weight:600}
.gantt td.busy a{background:#0284c7}.gantt td.busy.in_corso a{background:#16a34a}.gantt td.busy.late a{background:#dc2626}.gantt td.part a{background:#38bdf8}
.gantt td.free a{color:transparent}.gantt td.free a:hover{background:var(--pl);color:var(--p)}.gantt td.off{background:repeating-linear-gradient(45deg,#fafafa,#fafafa 5px,#f1f5f9 5px,#f1f5f9 10px)}
.legend{display:flex;flex-wrap:wrap;gap:12px;font-size:.8rem;color:var(--m);margin:8px 0}.legend i{display:inline-block;width:12px;height:12px;border-radius:3px;vertical-align:-2px;margin-right:4px}
/* righe noleggio */
.rg{display:grid;grid-template-columns:1fr;gap:8px}.rg .r{border:1px solid var(--b);border-radius:10px;padding:10px;display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.rg .r .g{flex:1 1 220px;min-width:0}.rg .r .v{font-weight:700;white-space:nowrap}
.tot{max-width:360px;margin-left:auto}.tot div{display:flex;justify-content:space-between;padding:4px 0}.tot .big{font-size:1.15rem;font-weight:700;border-top:1px solid var(--b);margin-top:4px;padding-top:8px}
/* firma */
.firma{border:2px dashed #cbd5e1;border-radius:10px;background:#fff;touch-action:none;width:100%;height:190px;display:block}
.thumb{width:56px;height:56px;border-radius:8px;object-fit:cover;background:#f1f5f9;flex:0 0 56px}
.ph{width:100%;max-width:420px;border-radius:10px;border:1px solid var(--b)}
/* pubblico */
.pub{max-width:760px;margin:0 auto;padding:16px}.cat{display:grid;gap:10px;grid-template-columns:1fr}@media(min-width:620px){.cat{grid-template-columns:1fr 1fr}}
.cat .it{display:flex;gap:10px;align-items:flex-start;background:#fff;border:1px solid var(--b);border-radius:var(--r);padding:10px}.cat .it .g{flex:1}
.cat input[type=number]{width:80px}
@media print{.top,.menu,.foot,.fab,.noprint{display:none!important}body{background:#fff}.card{border:0}}
