/* ============ TOKENS — light is the base, every token declared here ============ */
:root{
  --ground:#EEF2F3; --surface:#FFFFFF; --surface-2:#F6FAFA; --surface-3:#EAF0F1;
  --border:#D8E1E3; --border-strong:#BAC8CB;
  --ink:#0E1719; --ink-2:#3C4E52; --muted:#6A7F84;
  --brand:#0B5D63; --brand-ink:#FFFFFF; --brand-soft:#DFEDEE; --brand-hover:#0A4F54;
  --accent:#C2622F;
  --ramp1:#0B5D63; --ramp2:#3C878C; --ramp3:#73AEB2; --ramp4:#AFD0D2;
  --ok:#1F8A53; --ok-soft:#E2F2E9;
  --warn:#B97309; --warn-soft:#FAEFDC;
  --danger:#C23B45; --danger-soft:#F9E5E7;
  --info:#2B6CB0; --info-soft:#E3EDF7;
  --shadow-sm:0 1px 2px rgba(14,23,25,.06);
  --shadow-md:0 4px 16px -4px rgba(14,23,25,.12);
  --shadow-lg:0 24px 60px -12px rgba(14,23,25,.28);
  --r-sm:6px; --r-md:10px; --r-lg:14px;
  --rail:252px;
  --f-display:"Archivo",system-ui,-apple-system,"Segoe UI",sans-serif;
  --f-body:"IBM Plex Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  --f-mono:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --ground:#0B1214; --surface:#121C1F; --surface-2:#18252A; --surface-3:#1D2D32;
    --border:#22343A; --border-strong:#33494F;
    --ink:#E7F0F1; --ink-2:#B7C8CB; --muted:#869BA0;
    --brand:#4FC3CC; --brand-ink:#06262A; --brand-soft:#123A3F; --brand-hover:#6FD3DB;
    --accent:#E08A4F;
    --ramp1:#4FC3CC; --ramp2:#3C99A1; --ramp3:#2A7178; --ramp4:#1D4E54;
    --ok:#43BC7E; --ok-soft:#12301F;
    --warn:#E0A13C; --warn-soft:#33260D;
    --danger:#E8697A; --danger-soft:#361A1E;
    --info:#6BA6E8; --info-soft:#12243A;
    --shadow-sm:0 1px 2px rgba(0,0,0,.4);
    --shadow-md:0 4px 16px -4px rgba(0,0,0,.5);
    --shadow-lg:0 24px 60px -12px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"]{
  --ground:#0B1214; --surface:#121C1F; --surface-2:#18252A; --surface-3:#1D2D32;
  --border:#22343A; --border-strong:#33494F;
  --ink:#E7F0F1; --ink-2:#B7C8CB; --muted:#869BA0;
  --brand:#4FC3CC; --brand-ink:#06262A; --brand-soft:#123A3F; --brand-hover:#6FD3DB;
  --accent:#E08A4F;
  --ramp1:#4FC3CC; --ramp2:#3C99A1; --ramp3:#2A7178; --ramp4:#1D4E54;
  --ok:#43BC7E; --ok-soft:#12301F;
  --warn:#E0A13C; --warn-soft:#33260D;
  --danger:#E8697A; --danger-soft:#361A1E;
  --info:#6BA6E8; --info-soft:#12243A;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4);
  --shadow-md:0 4px 16px -4px rgba(0,0,0,.5);
  --shadow-lg:0 24px 60px -12px rgba(0,0,0,.7);
}

*{box-sizing:border-box}
body{background:var(--ground);color:var(--ink);font-family:var(--f-body);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased}
h1,h2,h3,h4{font-family:var(--f-display);margin:0;text-wrap:balance;letter-spacing:-.01em}
button,input,select,textarea{font:inherit;color:inherit}
a{color:var(--brand)}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px;border-radius:4px}
@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition-duration:.01ms!important}}
.mono{font-family:var(--f-mono)}
.num{font-variant-numeric:tabular-nums}

/* ============ APP SHELL ============ */
.app{display:grid;grid-template-columns:var(--rail) 1fr;min-height:100vh}
.app.collapsed{--rail:72px}

.rail{background:var(--surface);border-right:1px solid var(--border);display:flex;flex-direction:column;position:sticky;top:0;height:100vh;overflow:hidden}
.brand{display:flex;align-items:center;gap:10px;padding:18px 16px 14px;border-bottom:1px solid var(--border)}
.brand-mark{width:30px;height:30px;flex:none;border-radius:8px;background:var(--brand);display:grid;place-items:center}
.brand-mark svg{width:17px;height:17px;stroke:var(--brand-ink)}
.brand-txt{min-width:0}
.brand-name{font-family:var(--f-display);font-weight:700;font-size:15px;letter-spacing:.06em;text-transform:uppercase;line-height:1.1}
.brand-sub{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.app.collapsed .brand-txt{display:none}

.nav{flex:1;overflow-y:auto;padding:10px 10px 20px;display:flex;flex-direction:column;gap:2px}
.nav-group{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);padding:14px 8px 6px;font-weight:600}
.app.collapsed .nav-group{text-align:center;font-size:0;padding:10px 0 4px}
.app.collapsed .nav-group::after{content:"";display:block;height:1px;background:var(--border);margin:0 12px}
.nav-item{display:flex;align-items:center;gap:11px;padding:8px 10px;border-radius:var(--r-sm);color:var(--ink-2);cursor:pointer;border:0;background:none;width:100%;text-align:left;position:relative}
.nav-item:hover{background:var(--surface-3);color:var(--ink)}
.nav-item.on{background:var(--brand-soft);color:var(--brand);font-weight:600}
.nav-item.on::before{content:"";position:absolute;left:-10px;top:6px;bottom:6px;width:3px;border-radius:0 3px 3px 0;background:var(--brand)}
.nav-item svg{width:17px;height:17px;flex:none;stroke:currentColor;fill:none;stroke-width:1.7}
.nav-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.app.collapsed .nav-label{display:none}
.nav-badge{margin-left:auto;background:var(--danger);color:#fff;font-size:10px;font-weight:600;min-width:18px;height:18px;border-radius:9px;display:grid;place-items:center;padding:0 5px}
:root[data-theme="dark"] .nav-badge,:root:not([data-theme="light"]) .nav-badge{color:#1a0508}
@media (prefers-color-scheme:light){:root:not([data-theme="dark"]) .nav-badge{color:#fff}}
.app.collapsed .nav-badge{display:none}

/* ============ TOPBAR ============ */
.main{display:flex;flex-direction:column;min-width:0}
.topbar{position:sticky;top:0;z-index:30;background:color-mix(in srgb,var(--surface) 88%,transparent);backdrop-filter:blur(10px);border-bottom:1px solid var(--border);display:flex;align-items:center;gap:12px;padding:11px 20px}
.icon-btn{width:34px;height:34px;border-radius:var(--r-sm);border:1px solid transparent;background:none;display:grid;place-items:center;cursor:pointer;color:var(--ink-2);flex:none}
.icon-btn:hover{background:var(--surface-3);color:var(--ink)}
.icon-btn svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.8}
.search{flex:1;max-width:440px;position:relative}
.search input{width:100%;height:34px;border-radius:var(--r-sm);border:1px solid var(--border);background:var(--surface-2);padding:0 76px 0 34px;color:var(--ink)}
.search input::placeholder{color:var(--muted)}
.search svg{position:absolute;left:10px;top:9px;width:16px;height:16px;stroke:var(--muted);fill:none;stroke-width:1.8}
.kbd{position:absolute;right:8px;top:7px;font-family:var(--f-mono);font-size:10px;color:var(--muted);border:1px solid var(--border);border-radius:4px;padding:2px 6px;background:var(--surface)}
.spacer{flex:1}
.btn{display:inline-flex;align-items:center;gap:7px;height:34px;padding:0 13px;border-radius:var(--r-sm);border:1px solid var(--border);background:var(--surface);color:var(--ink);cursor:pointer;font-weight:500;white-space:nowrap;text-decoration:none}
a.btn:hover{text-decoration:none}
.btn:hover{background:var(--surface-3)}
.btn svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.9}
.btn-primary{background:var(--brand);color:var(--brand-ink);border-color:var(--brand);font-weight:600}
.btn-primary:hover{background:var(--brand-hover);border-color:var(--brand-hover)}
.btn-ghost{border-color:transparent;background:none}
.btn-ghost:hover{background:var(--surface-3)}
.btn-sm{height:28px;padding:0 10px;font-size:12.5px}
.btn-danger{color:var(--danger);border-color:var(--border)}
.btn-danger:hover{background:var(--danger-soft)}
.avatar{width:30px;height:30px;border-radius:50%;background:var(--brand-soft);color:var(--brand);display:grid;place-items:center;font-weight:600;font-size:12px;flex:none;font-family:var(--f-display)}

/* ============ PAGE ============ */
.page{padding:22px 20px 60px;max-width:1560px;width:100%;margin:0 auto;flex:1}
.page-head{display:flex;align-items:flex-end;gap:16px;margin-bottom:18px;flex-wrap:wrap}
.page-title{font-size:24px;font-weight:700}
.page-sub{color:var(--muted);font-size:13px;margin-top:3px}
.page-actions{margin-left:auto;display:flex;gap:8px;flex-wrap:wrap}

.demo-note{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);background:var(--surface-2);border:1px dashed var(--border-strong);border-radius:var(--r-sm);padding:7px 11px;margin-bottom:16px}
.demo-note svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:1.8;flex:none}

.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);box-shadow:var(--shadow-sm)}
.card-head{display:flex;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid var(--border)}
.card-title{font-size:14px;font-weight:600;font-family:var(--f-display)}
.card-sub{font-size:12px;color:var(--muted)}
.card-body{padding:16px}

/* KPI strip — tiles are flat, only the alert tile is lifted */
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(156px,1fr));gap:12px;margin-bottom:16px}
.kpi{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);padding:14px 15px;display:flex;flex-direction:column;gap:6px;min-width:0}
.kpi-l{font-size:11px;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);font-weight:600}
.kpi-v{font-family:var(--f-display);font-size:26px;font-weight:700;line-height:1.05;font-variant-numeric:tabular-nums}
.kpi-f{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:5px}
.trend{font-weight:600}
.trend.up{color:var(--ok)} .trend.down{color:var(--danger)}
.spark{height:26px;width:100%;display:block;margin-top:2px}

.grid-2{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:16px;align-items:start}
.grid-3{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:16px}
@media (max-width:1080px){.grid-2{grid-template-columns:1fr}}

/* ============ TABLE ============ */
.toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px 14px;border-bottom:1px solid var(--border)}
.filter-input{height:32px;border-radius:var(--r-sm);border:1px solid var(--border);background:var(--surface-2);padding:0 10px;min-width:200px}
.chips{display:flex;gap:6px;flex-wrap:wrap}
.chip{height:28px;padding:0 11px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--ink-2);font-size:12.5px;cursor:pointer;display:inline-flex;align-items:center;gap:6px}
.chip:hover{border-color:var(--border-strong)}
.chip.on{background:var(--brand);border-color:var(--brand);color:var(--brand-ink);font-weight:600}
.chip .cnt{opacity:.7;font-variant-numeric:tabular-nums}

.tw{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:13px}
thead th{position:sticky;top:0;background:var(--surface-2);text-align:left;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:600;padding:9px 12px;border-bottom:1px solid var(--border);white-space:nowrap;cursor:pointer;user-select:none}
thead th:hover{color:var(--ink)}
thead th.nosort{cursor:default}
thead th .sort{opacity:.45;font-size:9px;margin-left:3px}
tbody td{padding:10px 12px;border-bottom:1px solid var(--border);vertical-align:middle}
tbody tr:hover{background:var(--surface-2)}
tbody tr.sel{background:var(--brand-soft)}
tbody tr:last-child td{border-bottom:0}
td.right,th.right{text-align:right}
.cell-main{font-weight:600;color:var(--ink)}
.cell-sub{font-size:11.5px;color:var(--muted)}
.row-actions{display:flex;gap:3px;justify-content:flex-end;opacity:0}
tr:hover .row-actions,tr:focus-within .row-actions{opacity:1}
.empty{padding:52px 20px;text-align:center;color:var(--muted)}
.empty svg{width:34px;height:34px;stroke:var(--border-strong);fill:none;stroke-width:1.4;margin-bottom:10px}

.pill{display:inline-flex;align-items:center;gap:5px;height:22px;padding:0 9px;border-radius:999px;font-size:11.5px;font-weight:600;white-space:nowrap;background:var(--surface-3);color:var(--ink-2)}
.pill::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}
.pill.ok{background:var(--ok-soft);color:var(--ok)}
.pill.warn{background:var(--warn-soft);color:var(--warn)}
.pill.danger{background:var(--danger-soft);color:var(--danger)}
.pill.info{background:var(--info-soft);color:var(--info)}
.pill.brand{background:var(--brand-soft);color:var(--brand)}
.pill.flat::before{display:none}

.bar{height:6px;border-radius:3px;background:var(--surface-3);overflow:hidden;min-width:70px}
.bar span{display:block;height:100%;background:var(--brand);border-radius:3px}
.bar.warn span{background:var(--warn)} .bar.ok span{background:var(--ok)} .bar.danger span{background:var(--danger)}

/* severity stripe for attention lists */
.att{display:flex;gap:11px;padding:11px 14px;border-bottom:1px solid var(--border);align-items:flex-start;cursor:pointer}
.att:last-child{border-bottom:0}
.att:hover{background:var(--surface-2)}
.att-stripe{width:3px;border-radius:2px;flex:none;align-self:stretch;background:var(--muted)}
.att-stripe.danger{background:var(--danger)} .att-stripe.warn{background:var(--warn)} .att-stripe.info{background:var(--info)} .att-stripe.ok{background:var(--ok)}
.att-b{min-width:0;flex:1;display:flex;flex-direction:column;gap:1px}
.att-t{font-weight:600;font-size:13px}
.att-s{font-size:12px;color:var(--muted)}
.att-r{font-size:11.5px;font-weight:600;white-space:nowrap;font-variant-numeric:tabular-nums}

/* ============ KANBAN ============ */
.kan{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(252px,1fr);gap:12px;overflow-x:auto;padding-bottom:8px;align-items:start}
.kan-col{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-md);display:flex;flex-direction:column;min-height:120px}
.kan-h{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--border)}
.kan-dot{width:8px;height:8px;border-radius:50%;flex:none}
.kan-n{font-weight:600;font-size:12.5px}
.kan-c{margin-left:auto;font-size:11px;color:var(--muted);background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:1px 7px;font-variant-numeric:tabular-nums}
.kan-b{padding:8px;display:flex;flex-direction:column;gap:8px}
.kcard{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-sm);padding:10px 11px;cursor:pointer;display:flex;flex-direction:column;gap:6px}
.kcard:hover{border-color:var(--brand);box-shadow:var(--shadow-sm)}
.kcard-t{font-weight:600;font-size:13px;line-height:1.3}
.kcard-m{display:flex;align-items:center;gap:8px;font-size:11.5px;color:var(--muted);flex-wrap:wrap}
.kcard-v{font-family:var(--f-mono);font-size:12.5px;font-weight:500;color:var(--ink)}

/* ============ DRAWER (fast entry) ============ */
.scrim{position:fixed;inset:0;background:rgba(10,18,20,.5);z-index:60;opacity:0;pointer-events:none;transition:opacity .18s}
.scrim.on{opacity:1;pointer-events:auto}
.drawer{position:fixed;top:0;right:0;bottom:0;width:min(560px,100%);background:var(--surface);border-left:1px solid var(--border);box-shadow:var(--shadow-lg);z-index:61;display:flex;flex-direction:column;transform:translateX(100%);transition:transform .22s cubic-bezier(.3,.8,.4,1)}
.drawer.on{transform:none}
.drawer.wide{width:min(920px,100%)}
.dr-h{display:flex;align-items:center;gap:12px;padding:15px 18px;border-bottom:1px solid var(--border)}
.dr-t{font-family:var(--f-display);font-weight:700;font-size:16px}
.dr-s{font-size:12px;color:var(--muted)}
.dr-b{flex:1;overflow-y:auto;padding:18px}
.dr-f{display:flex;gap:8px;padding:13px 18px;border-top:1px solid var(--border);background:var(--surface-2)}
.dr-f .spacer{flex:1}
.hint-k{font-size:11px;color:var(--muted);align-self:center;font-family:var(--f-mono)}

/* form fields */
.fgrid{display:grid;grid-template-columns:repeat(12,1fr);gap:13px}
.f{display:flex;flex-direction:column;gap:5px;min-width:0}
.f.c12{grid-column:span 12}.f.c6{grid-column:span 6}.f.c4{grid-column:span 4}.f.c3{grid-column:span 3}.f.c8{grid-column:span 8}
@media (max-width:620px){.f.c6,.f.c4,.f.c3,.f.c8{grid-column:span 12}}
.f label{font-size:11.5px;font-weight:600;color:var(--ink-2);display:flex;align-items:center;gap:5px}
.f .req{color:var(--danger)}
.f input,.f select,.f textarea{height:36px;border:1px solid var(--border);background:var(--surface-2);border-radius:var(--r-sm);padding:0 10px;width:100%;color:var(--ink)}
.f textarea{height:auto;min-height:74px;padding:9px 10px;resize:vertical;line-height:1.5}
.f input:focus,.f select:focus,.f textarea:focus{border-color:var(--brand);background:var(--surface);outline:none;box-shadow:0 0 0 3px var(--brand-soft)}
.f input[readonly]{background:var(--surface-3);color:var(--muted)}
.f .help{font-size:11px;color:var(--muted)}
.f .err{font-size:11px;color:var(--danger);font-weight:500}
.f.bad input,.f.bad select,.f.bad textarea{border-color:var(--danger)}
.f .unit{position:relative}
.f .unit input{padding-right:34px}
.f .unit .u{position:absolute;right:10px;top:9px;font-size:12px;color:var(--muted);font-family:var(--f-mono)}
.sec-t{font-family:var(--f-display);font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);grid-column:span 12;padding-top:6px;border-top:1px solid var(--border);margin-top:4px}
.sec-t:first-child{border-top:0;padding-top:0;margin-top:0}
.calc{background:var(--brand-soft);border:1px solid var(--brand);border-radius:var(--r-sm);padding:11px 13px;grid-column:span 12;display:flex;flex-wrap:wrap;gap:16px}
.calc div{display:flex;flex-direction:column;gap:2px}
.calc .cl{font-size:10.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--brand);font-weight:600}
.calc .cv{font-family:var(--f-display);font-weight:700;font-size:17px;color:var(--ink);font-variant-numeric:tabular-nums}
.sugg{display:flex;gap:5px;flex-wrap:wrap;margin-top:2px}
.sugg button{border:1px dashed var(--border-strong);background:none;border-radius:999px;padding:2px 9px;font-size:11.5px;color:var(--ink-2);cursor:pointer}
.sugg button:hover{border-style:solid;border-color:var(--brand);color:var(--brand)}
.switch{display:flex;align-items:center;gap:9px;height:36px}
.switch input{width:38px;height:21px;appearance:none;background:var(--border-strong);border-radius:999px;position:relative;cursor:pointer;flex:none;transition:background .15s}
.switch input::after{content:"";position:absolute;top:2px;left:2px;width:17px;height:17px;border-radius:50%;background:#fff;transition:transform .15s}
.switch input:checked{background:var(--brand)}
.switch input:checked::after{transform:translateX(17px)}
.switch span{font-size:13px}

/* detail tabs */
.tabs{display:flex;gap:2px;border-bottom:1px solid var(--border);overflow-x:auto;padding:0 18px}
.tab{padding:10px 13px;border:0;background:none;color:var(--muted);cursor:pointer;font-weight:500;font-size:13px;border-bottom:2px solid transparent;white-space:nowrap}
.tab:hover{color:var(--ink)}
.tab.on{color:var(--brand);border-bottom-color:var(--brand);font-weight:600}
.dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:13px}
.dl div{display:flex;flex-direction:column;gap:2px;min-width:0}
.dl dt{font-size:10.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:600}
.dl dd{margin:0;font-weight:500;word-break:break-word}

/* command palette */
.pal{position:fixed;inset:0;z-index:80;display:none;padding-top:11vh;justify-content:center;background:rgba(10,18,20,.45)}
.pal.on{display:flex}
.pal-box{width:min(600px,94vw);background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--r-lg);box-shadow:var(--shadow-lg);overflow:hidden;height:fit-content;max-height:70vh;display:flex;flex-direction:column}
.pal-in{display:flex;align-items:center;gap:10px;padding:13px 15px;border-bottom:1px solid var(--border)}
.pal-in svg{width:17px;height:17px;stroke:var(--muted);fill:none;stroke-width:1.8;flex:none}
.pal-in input{border:0;background:none;flex:1;height:24px;font-size:15px;outline:none}
.pal-l{overflow-y:auto;padding:6px}
.pal-i{display:flex;align-items:center;gap:11px;padding:9px 11px;border-radius:var(--r-sm);cursor:pointer}
.pal-i.on{background:var(--brand-soft)}
.pal-i svg{width:16px;height:16px;stroke:var(--muted);fill:none;stroke-width:1.8;flex:none}
.pal-i.on svg{stroke:var(--brand)}
.pal-i b{font-weight:600;font-size:13px}
.pal-i small{color:var(--muted);margin-left:auto;font-size:11px;font-family:var(--f-mono)}
.pal-g{font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);padding:9px 11px 4px;font-weight:600}

/* toast */
.toasts{position:fixed;bottom:18px;right:18px;z-index:90;display:flex;flex-direction:column;gap:8px}
.toast{background:var(--surface);border:1px solid var(--border);border-left:3px solid var(--ok);border-radius:var(--r-sm);box-shadow:var(--shadow-md);padding:11px 14px;min-width:260px;display:flex;gap:10px;align-items:flex-start;animation:slidein .2s}
.toast.err{border-left-color:var(--danger)}
.toast.info{border-left-color:var(--info)}
@keyframes slidein{from{transform:translateY(8px);opacity:0}}
.toast b{font-size:13px}
.toast p{margin:1px 0 0;font-size:12px;color:var(--muted)}

/* charts */
.chart-wrap{position:relative}
svg.chart{display:block;width:100%;overflow:visible}
.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:var(--ink-2);padding:0 16px 12px}
.legend i{width:9px;height:9px;border-radius:2px;display:inline-block;margin-right:5px}
.tip{position:absolute;pointer-events:none;background:var(--ink);color:var(--ground);border-radius:var(--r-sm);padding:7px 10px;font-size:12px;box-shadow:var(--shadow-md);opacity:0;transition:opacity .12s;white-space:nowrap;z-index:5;font-variant-numeric:tabular-nums}
.tip.on{opacity:1}
.tip b{display:block;font-size:11px;opacity:.75;font-weight:500}

.mini{display:flex;flex-direction:column;gap:9px;padding:4px 0}
.mini-row{display:flex;align-items:center;gap:10px;font-size:12.5px}
.mini-row .ml{width:104px;flex:none;color:var(--ink-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mini-row .mb{flex:1;height:8px;background:var(--surface-3);border-radius:4px;overflow:hidden}
.mini-row .mb span{display:block;height:100%;background:var(--brand);border-radius:4px}
.mini-row .mv{width:78px;text-align:right;font-variant-numeric:tabular-nums;font-weight:600;flex:none}

/* ============ AUTOCOMPLETAMENTO LUOGHI ============ */
.ac-wrap{position:relative}
.ac{position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:20;background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--r-sm);box-shadow:var(--shadow-md);max-height:262px;overflow-y:auto;display:none}
.ac.on{display:block}
.ac-i{display:flex;align-items:center;gap:9px;padding:8px 11px;cursor:pointer;border-bottom:1px solid var(--border)}
.ac-i:last-child{border-bottom:0}
.ac-i:hover,.ac-i.on{background:var(--brand-soft)}
.ac-n{font-weight:600;font-size:13px}
.ac-n b{color:var(--brand);font-weight:700}
.ac-m{margin-left:auto;font-family:var(--f-mono);font-size:11px;color:var(--muted);white-space:nowrap}
.ac-empty{padding:12px;text-align:center;color:var(--muted);font-size:12.5px}
.geo-ok{display:inline-flex;align-items:center;gap:5px;font-size:11px;color:var(--ok);font-weight:600;margin-top:2px}
.geo-ok svg{width:12px;height:12px;stroke:currentColor;fill:none;stroke-width:2.2}

/* ============ MAPPA ============ */
.map-box{position:relative;background:var(--surface-2);border-radius:var(--r-md);overflow:hidden}
svg.map{display:block;width:100%;height:auto}
.map-pin{cursor:pointer}
.map-pin circle.halo{opacity:.18}
.map-pin:hover circle.halo,.map-pin.on circle.halo{opacity:.4}
.map-legend{display:flex;gap:14px;flex-wrap:wrap;font-size:11.5px;color:var(--ink-2);padding:10px 14px 0}
.map-legend i{width:9px;height:9px;border-radius:50%;display:inline-block;margin-right:5px;vertical-align:-1px}
.map-note{font-size:11.5px;color:var(--muted);padding:8px 14px 12px;display:flex;gap:7px;align-items:flex-start}
.map-note svg{width:13px;height:13px;stroke:currentColor;fill:none;stroke-width:1.8;flex:none;margin-top:2px}
.osm-link{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;color:var(--brand);text-decoration:none;white-space:nowrap}
.osm-link:hover{text-decoration:underline}
.osm-link svg{width:13px;height:13px;stroke:currentColor;fill:none;stroke-width:1.9}
.place-row{display:flex;align-items:center;gap:11px;padding:9px 14px;border-bottom:1px solid var(--border);cursor:pointer}
.place-row:last-child{border-bottom:0}
.place-row:hover,.place-row.on{background:var(--surface-2)}
.place-dot{width:9px;height:9px;border-radius:50%;flex:none}
.place-b{flex:1;min-width:0}
.place-t{font-weight:600;font-size:13px}
.place-s{font-size:11.5px;color:var(--muted)}

/* ============ MAPPA A TESSERE (OpenStreetMap, quando raggiungibili) ============ */
/* touch-action:pan-y lascia scorrere la pagina con lo scorrimento verticale;
   la mappa si trascina con il movimento orizzontale o con il mouse. */
.tmap{position:relative;width:100%;height:430px;overflow:hidden;background:var(--surface-3);cursor:grab;touch-action:pan-y;user-select:none}
.tmap.dragging{cursor:grabbing}
.tmap-layer{position:absolute;left:0;top:0;will-change:transform}
.tmap-layer img{position:absolute;width:256px;height:256px;display:block}
.tmap-pin{position:absolute;transform:translate(-50%,-100%);cursor:pointer;z-index:5}
.tmap-pin svg{width:26px;height:34px;display:block;filter:drop-shadow(0 2px 3px rgba(0,0,0,.4))}
.tmap-pin span{position:absolute;top:5px;left:50%;transform:translateX(-50%);font-family:var(--f-mono);font-size:10px;font-weight:700;color:#fff}
.tmap-pin b{position:absolute;top:36px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:10.5px;font-weight:600;background:var(--surface);color:var(--ink);padding:1px 6px;border-radius:3px;border:1px solid var(--border)}
.tmap-ctrl{position:absolute;right:10px;top:10px;z-index:10;display:flex;flex-direction:column;gap:4px}
.tmap-ctrl button{width:32px;height:32px;border-radius:var(--r-sm);border:1px solid var(--border-strong);background:var(--surface);color:var(--ink);font-size:17px;font-weight:600;cursor:pointer;display:grid;place-items:center;line-height:1}
.tmap-ctrl button:hover{background:var(--surface-3)}
.tmap-attr{position:absolute;right:0;bottom:0;z-index:10;font-size:10px;background:color-mix(in srgb,var(--surface) 85%,transparent);padding:2px 6px;color:var(--ink-2)}
.tmap-attr a{color:var(--brand)}

/* ============ RAPPORTINI: foto e firma ============ */
.foto-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px;grid-column:span 12}
.foto-x{position:relative;aspect-ratio:1;border-radius:var(--r-sm);overflow:hidden;border:1px solid var(--border);background:var(--surface-3)}
.foto-x img{width:100%;height:100%;object-fit:cover;display:block}
.foto-x button{position:absolute;top:3px;right:3px;width:22px;height:22px;border-radius:50%;border:0;background:rgba(10,18,20,.72);color:#fff;cursor:pointer;font-size:13px;line-height:1;display:grid;place-items:center}
.foto-add{grid-column:span 12}
.foto-add label{display:inline-flex;align-items:center;gap:7px;height:36px;padding:0 14px;border-radius:var(--r-sm);border:1px dashed var(--border-strong);cursor:pointer;font-weight:500;font-size:13px}
.foto-add label:hover{border-style:solid;border-color:var(--brand);color:var(--brand)}
.foto-add input{display:none}
.foto-add svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.9}
.firma-box{grid-column:span 12}
.firma-tela{width:100%;height:170px;border:1px dashed var(--border-strong);border-radius:var(--r-sm);background:var(--surface);touch-action:none;display:block;cursor:crosshair}
.firma-tela.firmata{border-style:solid;border-color:var(--ok)}
.firma-bar{display:flex;align-items:center;gap:9px;margin-top:6px;flex-wrap:wrap}
.firma-img{max-width:280px;border:1px solid var(--border);border-radius:var(--r-sm);background:#fff;display:block}
.chk-list{grid-column:span 12;display:flex;flex-direction:column;gap:2px}
.chk-row{display:flex;align-items:center;gap:10px;padding:7px 9px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface-2)}
.chk-row input[type=checkbox]{width:19px;height:19px;accent-color:var(--brand);flex:none;cursor:pointer}
.chk-row span{flex:1;font-size:13px}
.chk-row.ok span{color:var(--muted);text-decoration:line-through}
.chk-row button{border:0;background:none;color:var(--muted);cursor:pointer;font-size:15px;padding:0 4px}
.chk-add{display:flex;gap:7px;margin-top:6px}
.chk-add input{flex:1;height:34px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface-2);padding:0 10px}

/* ============ RIGHE D'OFFERTA ============ */
#voci_box{border:1px solid var(--border);border-radius:var(--r-sm);overflow:hidden}
.voci-head,.voci-row{display:grid;grid-template-columns:1fr 72px 88px 70px 96px 30px;gap:8px;align-items:center;padding:7px 10px}
.voci-head{background:var(--surface-3);font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:600}
.voci-row{border-top:1px solid var(--border)}
.voci-row select,.voci-row input{height:32px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface-2);padding:0 8px;width:100%;min-width:0}
.voci-row input{text-align:right;font-variant-numeric:tabular-nums}
.voci-imp{text-align:right;font-weight:600;font-variant-numeric:tabular-nums;font-size:13px}
.voci-row button{border:0;background:none;color:var(--muted);cursor:pointer;font-size:14px}
.voci-row button:hover{color:var(--danger)}
.voci-vuoto{padding:14px;text-align:center;color:var(--muted);font-size:12.5px;border-top:1px solid var(--border)}
.voci-bar{display:flex;align-items:center;gap:10px;padding:9px 10px;border-top:1px solid var(--border);background:var(--surface-2);flex-wrap:wrap}
.voci-tot{margin-left:auto;font-size:13px;color:var(--ink-2)}
.voci-tot b{font-family:var(--f-display);font-size:16px;color:var(--ink);margin-left:6px}
@media (max-width:620px){
  .voci-head{grid-template-columns:repeat(3,1fr) 30px;gap:6px;padding:6px 10px}
  .voci-head span:nth-child(1),.voci-head span:nth-child(5){display:none}
  .voci-row{grid-template-columns:repeat(3,1fr) 30px;gap:6px}
  .voci-row .voci-art{grid-column:1/-1}
  .voci-imp{grid-column:1/4;text-align:left}
}

/* ============ CONDIVISIONE: LINK E QR ============ */
.qr-wrap{display:flex;gap:20px;align-items:flex-start;flex-wrap:wrap}
.qr-box{background:#fff;padding:12px;border-radius:var(--r-md);border:1px solid var(--border);flex:none}
.qr-box svg{display:block;width:172px;height:172px}
.qr-side{flex:1;min-width:220px;display:flex;flex-direction:column;gap:10px}
.link-riga{display:flex;gap:7px}
.link-riga input{flex:1;height:36px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface-2);padding:0 10px;font-family:var(--f-mono);font-size:12px;min-width:0}

/* ============ LANDING CLIENTE (preventivo scenico) ============ */
.of-grid-bg{position:absolute;inset:0;width:100%;height:100%;opacity:.13;pointer-events:none}
.of-ico{width:42px;height:42px;border-radius:12px;background:var(--brand-soft);color:var(--brand);display:grid;place-items:center;margin-bottom:11px}
.of-ico svg{width:21px;height:21px;stroke:currentColor;fill:none;stroke-width:1.8}
.of-metaico{display:inline-grid;place-items:center;width:15px;height:15px;margin-right:6px;vertical-align:-3px;opacity:.75}
.of-metaico svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:1.9}
.of-sw{width:52px;height:52px;border-radius:9px;overflow:hidden;flex:none;border:1px solid var(--border);background:var(--surface-3)}
.of-sw svg{display:block;width:100%;height:100%}
.of-riga{display:flex;gap:13px;align-items:flex-start}
.of-gal{display:grid;grid-template-columns:repeat(auto-fit,minmax(168px,1fr));gap:14px}
.of-gal-x{border:1px solid var(--border);border-radius:var(--r-md);overflow:hidden;background:var(--surface)}
.of-gal-x .im{height:112px;position:relative}
.of-gal-x .im svg{display:block;width:100%;height:100%}
.of-gal-x .tx{padding:11px 13px}
.of-gal-x b{display:block;font-family:var(--f-display);font-size:13.5px;line-height:1.25}
.of-gal-x span{font-size:11.5px;color:var(--muted)}
.of-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1px;background:var(--border);border:1px solid var(--border);border-radius:var(--r-md);overflow:hidden;margin-top:6px}
.of-stat{background:var(--surface);padding:17px 16px;text-align:center}
.of-stat b{display:block;font-family:var(--f-display);font-size:25px;font-weight:700;line-height:1;margin-bottom:4px}
.of-stat span{font-size:11.5px;color:var(--muted);letter-spacing:.03em}
.of-cta-ico{width:54px;height:54px;border-radius:50%;background:var(--brand);color:var(--brand-ink);display:grid;place-items:center;margin:0 auto 13px}
.of-cta-ico svg{width:25px;height:25px;stroke:currentColor;fill:none;stroke-width:1.9}
.of-lead{font-size:15px;color:var(--ink-2);max-width:66ch;margin:-6px 0 16px;line-height:1.55}
/* scelta chiaro/scuro: resta raggiungibile mentre si scorre */
.of-theme{position:fixed;top:14px;right:14px;z-index:40;display:flex;gap:2px;padding:3px;border-radius:999px;background:color-mix(in srgb,var(--surface) 84%,transparent);backdrop-filter:blur(8px);border:1px solid var(--border);box-shadow:var(--shadow-md)}
.of-theme button{border:0;background:none;color:var(--muted);font:inherit;font-size:12px;font-weight:600;padding:6px 11px;border-radius:999px;display:flex;align-items:center;gap:6px;cursor:pointer;line-height:1}
.of-theme button svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:1.9}
.of-theme button.on{background:var(--brand);color:var(--brand-ink)}
/* anteprime degli ambienti: scena SVG sotto, fotografia sopra quando arriva */
.of-rends{display:grid;grid-template-columns:1.6fr 1fr;grid-auto-rows:186px;gap:12px}
.of-rends .big{grid-row:span 2}
.of-rends.due figure{grid-row:span 2}
.of-rends.solo{grid-template-columns:1fr;grid-auto-rows:380px}
.of-rends-more{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));grid-auto-rows:120px;gap:10px;margin-top:12px}
.of-rend{margin:0;position:relative;border-radius:14px;overflow:hidden;background:#e6e2da;box-shadow:var(--shadow-sm)}
.of-rend-im{position:absolute;inset:0}
.of-rend-im svg,.of-rend-im img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.of-rend-im img{opacity:0;transition:opacity .5s}
.of-rend-im img.on{opacity:1}
.of-rend-tag{position:absolute;top:10px;left:10px;font-size:9.5px;letter-spacing:.12em;text-transform:uppercase;font-weight:700;color:#fff;background:rgba(0,0,0,.42);padding:4px 8px;border-radius:999px}
.of-rend figcaption{position:absolute;left:0;right:0;bottom:0;padding:28px 14px 12px;background:linear-gradient(transparent,rgba(0,0,0,.66));color:#fff;display:flex;flex-direction:column;gap:2px}
.of-rend figcaption b{font-family:var(--f-display);font-size:15px;line-height:1.2}
.of-rend figcaption span{font-size:11.5px;opacity:.85}
.of-rends-more .of-rend figcaption{padding:18px 10px 8px}
.of-rends-more .of-rend figcaption b{font-size:12.5px}
.of-rends-more .of-rend figcaption span,.of-rends-more .of-rend-tag{display:none}
.of-amb{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}
.of-chip{font-size:12.5px;border:1px solid var(--border);border-radius:999px;padding:5px 11px;background:var(--surface);color:var(--ink-2)}
.of-chip b{color:var(--ink);font-family:var(--f-display);margin-left:2px}
.of-gal-x em{display:block;font-style:normal;font-size:11px;color:var(--muted);margin-top:6px;padding-top:6px;border-top:1px dashed var(--border);line-height:1.4}
/* fasi del lavoro */
.of-fasi{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;position:relative;margin-top:8px}
.of-fasi::before{content:"";position:absolute;left:10%;right:10%;top:22px;height:2px;background:var(--border-strong)}
.of-fase{position:relative;text-align:center;padding:0 4px}
.of-fase .n{width:46px;height:46px;border-radius:50%;background:var(--surface);border:2px solid var(--brand);color:var(--brand);display:grid;place-items:center;margin:0 auto 10px;position:relative}
.of-fase .n svg{width:21px;height:21px;stroke:currentColor;fill:none;stroke-width:1.9}
.of-fase b{display:block;font-family:var(--f-display);font-size:13.5px;line-height:1.25;margin-bottom:4px}
.of-fase span{font-size:12px;color:var(--muted);line-height:1.45;display:block}
.of-fase .q{display:inline-block;margin-top:8px;font-style:normal;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;font-weight:700;color:var(--brand);background:var(--brand-soft);padding:3px 8px;border-radius:999px}
/* incluso / escluso */
.of-due{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:6px}
.of-lista{border:1px solid var(--border);border-radius:var(--r-md);background:var(--surface);padding:14px 16px}
.of-lista h4{margin:0 0 10px;font-family:var(--f-display);font-size:14px}
.of-lista ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.of-lista li{display:flex;gap:9px;align-items:flex-start;font-size:13.5px;line-height:1.4;color:var(--ink-2)}
.of-lista li i{flex:none;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;margin-top:1px}
.of-lista li i svg{width:12px;height:12px;stroke:currentColor;fill:none;stroke-width:2.4}
.of-lista.si li i{background:var(--ok-soft);color:var(--ok)}
.of-lista.no li i{background:var(--surface-3);color:var(--muted)}
/* pagamento */
.of-pag{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:6px}
.of-pag>div{border:1px solid var(--border);border-radius:var(--r-md);padding:14px 16px;background:var(--surface)}
.of-pag .pc{font-family:var(--f-display);font-size:24px;font-weight:700;color:var(--brand);line-height:1}
.of-pag .qd{font-size:12px;color:var(--muted);margin:6px 0 8px;line-height:1.4}
.of-pag .qd b{color:var(--ink)}
.of-pag .im{font-family:var(--f-display);font-weight:600;font-size:15px}
/* mappa del cantiere */
.of-map-wrap{display:grid;grid-template-columns:1.5fr 1fr;gap:14px;align-items:stretch}
.of-map{border:1px solid var(--border);border-radius:var(--r-md);overflow:hidden;background:var(--surface-2);min-height:280px}
.of-map .map{width:100%;height:auto;display:block}
.of-map-side{border:1px solid var(--border);border-radius:var(--r-md);padding:16px 18px;background:var(--surface);display:flex;flex-direction:column;gap:6px;justify-content:center}
.of-map-side b{font-family:var(--f-display);font-size:15px}
.of-map-side span{font-size:13.5px;color:var(--ink-2);line-height:1.5}
.of-map-side .btn{align-self:flex-start;margin-top:8px}
/* recensioni e referente */
.of-rec{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin-top:6px}
.of-rec>div{border:1px solid var(--border);border-radius:var(--r-md);padding:16px 17px;background:var(--surface)}
.of-rec .st{color:var(--accent);display:flex;gap:2px;margin-bottom:8px}
.of-rec .st svg{width:14px;height:14px;fill:currentColor;stroke:none}
.of-rec p{margin:0 0 10px;font-size:13.5px;line-height:1.5;color:var(--ink-2);font-style:italic}
.of-rec b{font-size:12.5px;font-family:var(--f-display)}
.of-ref{display:flex;align-items:center;gap:16px;border:1px solid var(--border);border-radius:var(--r-lg);padding:16px 20px;background:var(--surface);flex-wrap:wrap}
.of-av{width:54px;height:54px;border-radius:50%;background:var(--brand);color:var(--brand-ink);display:grid;place-items:center;font-family:var(--f-display);font-weight:700;font-size:19px;flex:none}
.of-ref-b{flex:1;min-width:160px}
.of-ref-b b{display:block;font-family:var(--f-display);font-size:16px}
.of-ref-b span{font-size:13px;color:var(--muted)}
.of-ref-ct{display:flex;gap:8px;flex-wrap:wrap}
@media (max-width:860px){
  .of-fasi{grid-template-columns:1fr;gap:14px;padding-left:8px}
  .of-fasi::before{left:30px;right:auto;top:0;bottom:0;width:2px;height:auto}
  .of-fase{display:grid;grid-template-columns:46px 1fr;gap:0 14px;text-align:left;padding:0}
  .of-fase .n{margin:0;grid-row:1/4}
  .of-fase .q{margin-top:6px;justify-self:start}
  .of-map-wrap,.of-due,.of-pag{grid-template-columns:1fr}
}
@media (max-width:640px){
  .of-rends{grid-template-columns:1fr;grid-auto-rows:210px}
  .of-rends .big,.of-rends.due figure{grid-row:auto}
  .of-rends.solo{grid-auto-rows:240px}
  .of-rends-more{grid-template-columns:repeat(2,1fr)}
}
body.vista-cliente .rail,body.vista-cliente .topbar{display:none!important}
body.vista-cliente .app{display:block}
body.vista-cliente .page{max-width:none;padding:0}
.of{max-width:960px;margin:0 auto;padding:0 20px 70px}
.of-hero{background:var(--brand);color:var(--brand-ink);margin:0 -20px 0;padding:54px 40px 46px;position:relative;overflow:hidden}
.of-hero::after{content:"";position:absolute;right:-90px;top:-90px;width:300px;height:300px;border-radius:50%;background:rgba(255,255,255,.07)}
.of-eyebrow{font-size:11px;letter-spacing:.24em;text-transform:uppercase;opacity:.8;font-weight:600}
.of-h1{font-family:var(--f-display);font-size:clamp(28px,5vw,46px);font-weight:700;line-height:1.08;margin:12px 0 10px;max-width:16ch;position:relative}
.of-sub{font-size:16px;opacity:.9;max-width:52ch;position:relative;line-height:1.5}
.of-hero-meta{display:flex;gap:28px;margin-top:30px;flex-wrap:wrap;position:relative}
.of-hero-meta div{display:flex;flex-direction:column;gap:2px}
.of-hero-meta dt{font-size:10px;letter-spacing:.14em;text-transform:uppercase;opacity:.72;font-weight:600}
.of-hero-meta dd{margin:0;font-size:17px;font-weight:600;font-family:var(--f-display)}
.of-sec{margin-top:44px}
.of-tit{font-family:var(--f-display);font-size:13px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);font-weight:700;padding-bottom:8px;border-bottom:2px solid var(--brand);display:inline-block;margin-bottom:18px}
.of-p{font-size:15.5px;line-height:1.62;color:var(--ink-2);max-width:66ch}
.of-incluso{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px;margin-top:6px}
.of-card{border:1px solid var(--border);border-radius:var(--r-md);padding:16px 17px;background:var(--surface)}
.of-card b{font-family:var(--f-display);font-size:14.5px;display:block;margin-bottom:5px}
.of-card span{font-size:13px;color:var(--muted);line-height:1.5}
.of-tab{width:100%;border-collapse:collapse;font-size:14px}
.of-tab th{text-align:left;font-size:10.5px;letter-spacing:.09em;text-transform:uppercase;color:var(--muted);font-weight:600;padding:0 10px 9px;border-bottom:1px solid var(--border)}
.of-tab td{padding:13px 10px;border-bottom:1px solid var(--border);vertical-align:top}
.of-tab .r{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.of-tab .nome{font-weight:600;display:block;line-height:1.3}
.of-tab .desc{font-size:12.5px;color:var(--muted);margin-top:2px;display:block}
.of-tot{margin-top:22px;margin-left:auto;max-width:390px;border:1px solid var(--border);border-radius:var(--r-md);overflow:hidden}
.of-tot div{display:flex;justify-content:space-between;padding:11px 16px;font-size:14px}
.of-tot div+div{border-top:1px solid var(--border)}
.of-tot .grande{background:var(--brand);color:var(--brand-ink);font-family:var(--f-display);font-weight:700;font-size:19px;padding:15px 16px}
.of-firma{margin-top:46px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-lg);padding:26px 28px;text-align:center}
.of-firma b{font-family:var(--f-display);font-size:19px;display:block;margin-bottom:7px}
.of-firma p{color:var(--muted);font-size:14px;max-width:48ch;margin:0 auto 18px}
.of-pie{margin-top:46px;padding-top:20px;border-top:1px solid var(--border);display:flex;gap:26px;flex-wrap:wrap;font-size:12.5px;color:var(--muted)}
.of-pie b{color:var(--ink);display:block;font-size:13.5px;font-family:var(--f-display)}
@media (max-width:640px){
  .of-hero{padding:66px 22px 34px}
  .of-tot{max-width:none}
  .of-stats{grid-template-columns:repeat(2,1fr)}
}

/* ============ STAMPA DEI DOCUMENTI (A4) ============ */
#printArea{display:none}
@media print{
  html,body{background:#fff!important}
  .app,.drawer,.scrim,.toasts,.pal{display:none!important}
  #printArea{display:block!important;color:#111;background:#fff;font-family:var(--f-body)}
  @page{size:A4;margin:13mm 14mm}
  .pr-head{display:flex;align-items:flex-start;gap:16px;border-bottom:2px solid #111;padding-bottom:9px;margin-bottom:14px}
  .pr-az{font-family:var(--f-display);font-size:15pt;font-weight:700;letter-spacing:.02em}
  .pr-sub{font-size:8.5pt;color:#555;margin-top:2px}
  .pr-tit{margin-left:auto;text-align:right}
  .pr-tit b{font-family:var(--f-display);font-size:12.5pt;display:block;letter-spacing:.06em}
  .pr-tit span{font-family:var(--f-mono);font-size:10pt}
  .pr-meta{display:grid;grid-template-columns:repeat(4,1fr);gap:7px 14px;border:1px solid #bbb;padding:9px 11px;margin-bottom:14px}
  .pr-meta dt{font-size:7pt;letter-spacing:.09em;text-transform:uppercase;color:#666;font-weight:700}
  .pr-meta dd{margin:0;font-size:10pt;font-weight:600}
  .pr-meta div{min-width:0}
  .pr-sec{font-family:var(--f-display);font-size:9pt;letter-spacing:.1em;text-transform:uppercase;font-weight:700;border-bottom:1px solid #999;padding-bottom:3px;margin:14px 0 8px;break-after:avoid}
  .pr-chk{list-style:none;padding:0;margin:0;columns:2;column-gap:20px}
  .pr-chk li{font-size:9.5pt;margin-bottom:4px;break-inside:avoid;padding-left:17px;position:relative}
  .pr-chk li::before{content:"\2610";position:absolute;left:0;font-size:11pt;line-height:1}
  .pr-chk li.ok::before{content:"\2611"}
  .pr-txt{font-size:9.5pt;line-height:1.45;white-space:pre-wrap;margin:0 0 4px}
  .pr-vuoto{font-size:9pt;color:#888;font-style:italic}
  .pr-foto{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}
  .pr-foto figure{margin:0;break-inside:avoid}
  .pr-foto img{width:100%;height:52mm;object-fit:cover;border:1px solid #bbb;display:block}
  .pr-foto figcaption{font-size:7.5pt;color:#666;margin-top:2px}
  .pr-firma{display:flex;gap:22px;align-items:flex-end;margin-top:6px;break-inside:avoid}
  .pr-firma .box{flex:1}
  .pr-firma img{max-width:62mm;max-height:26mm;display:block;border-bottom:1px solid #111;padding-bottom:2px}
  .pr-firma .riga{border-bottom:1px solid #111;height:26mm}
  .pr-firma .cap{font-size:8pt;color:#555;margin-top:3px}
  .pr-pie{margin-top:16px;border-top:1px solid #bbb;padding-top:6px;font-size:7.5pt;color:#777;display:flex;justify-content:space-between}
  .pr-blocco{break-inside:avoid}

  /* --- preventivo e fattura --- */
  .doc{color:#111}
  .doc *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .doc-band{background:var(--brand-print,#0B5D63);color:#fff;padding:13mm 12mm 11mm;margin:-13mm -14mm 9mm;display:flex;align-items:flex-start;gap:14px}
  .doc-az{font-family:var(--f-display);font-size:15pt;font-weight:700;letter-spacing:.01em}
  .doc-azd{font-size:7.6pt;line-height:1.5;opacity:.85;margin-top:4px}
  .doc-tipo{margin-left:auto;text-align:right}
  .doc-tipo b{font-family:var(--f-display);font-size:17pt;font-weight:700;letter-spacing:.08em;display:block;line-height:1}
  .doc-tipo span{font-family:var(--f-mono);font-size:10pt;display:block;margin-top:5px}
  .doc-parti{display:grid;grid-template-columns:1fr 1fr;gap:9mm;margin-bottom:8mm}
  .doc-lab{font-size:7pt;letter-spacing:.14em;text-transform:uppercase;color:#777;font-weight:700;margin-bottom:3px}
  .doc-nome{font-family:var(--f-display);font-size:12pt;font-weight:700;line-height:1.2}
  .doc-det{font-size:8.6pt;line-height:1.5;color:#444;margin-top:3px}
  .doc-rif{display:grid;grid-template-columns:repeat(4,1fr);gap:6px 12px;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:6px 0;margin-bottom:8mm}
  .doc-rif dt{font-size:7pt;letter-spacing:.1em;text-transform:uppercase;color:#777;font-weight:700}
  .doc-rif dd{margin:0;font-size:9.5pt;font-weight:600}
  .doc-ogg{margin-bottom:7mm}
  .doc-ogg p{font-size:10pt;line-height:1.5;margin:0}
  .doc-sec{font-family:var(--f-display);font-size:8.5pt;letter-spacing:.14em;text-transform:uppercase;font-weight:700;color:var(--brand-print,#0B5D63);margin:0 0 5px;break-after:avoid}
  .doc-tab{width:100%;border-collapse:collapse;font-size:9.4pt}
  .doc-tab thead th{background:#eef1f2;font-size:7pt;letter-spacing:.09em;text-transform:uppercase;color:#555;font-weight:700;text-align:left;padding:5px 7px;border-bottom:1px solid #aaa}
  .doc-tab td{padding:6px 7px;border-bottom:1px solid #e2e6e7;vertical-align:top}
  .doc-tab .r{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
  .doc-tab .nome{font-weight:600}
  .doc-tab .des{font-size:7.8pt;color:#777}
  .doc-tab tbody tr{break-inside:avoid}
  .doc-tot{margin-left:auto;width:78mm;margin-top:6mm;break-inside:avoid}
  .doc-tot div{display:flex;justify-content:space-between;padding:5px 9px;font-size:9.6pt}
  .doc-tot div+div{border-top:1px solid #ddd}
  .doc-tot .big{background:var(--brand-print,#0B5D63);color:#fff;font-family:var(--f-display);font-weight:700;font-size:12.5pt;padding:8px 9px}
  .doc-note{margin-top:8mm;break-inside:avoid}
  .doc-note p{font-size:8.6pt;line-height:1.5;color:#444;margin:0 0 3px;white-space:pre-wrap}
  .doc-iva{width:100%;border-collapse:collapse;font-size:8.6pt;margin-top:5mm}
  .doc-iva th{background:#eef1f2;font-size:6.8pt;letter-spacing:.08em;text-transform:uppercase;color:#555;padding:4px 6px;text-align:left;border-bottom:1px solid #aaa}
  .doc-iva td{padding:4px 6px;border-bottom:1px solid #e2e6e7}
  .doc-firme{display:grid;grid-template-columns:1fr 1fr;gap:16mm;margin-top:12mm;break-inside:avoid}
  .doc-firme .riga{border-bottom:1px solid #111;height:20mm}
  .doc-firme .cap{font-size:7.8pt;color:#555;margin-top:3px}
  .doc-rends{display:grid;grid-template-columns:repeat(3,1fr);gap:4mm;margin:0 0 7mm;break-inside:avoid}
  .doc-rends .of-rend{height:44mm;border-radius:3mm;box-shadow:none;border:1px solid #d5d1c7}
  .doc-rends .of-rend figcaption{padding:8mm 3mm 2.5mm}
  .doc-rends .of-rend figcaption b{font-size:9.5pt}
  .doc-rends .of-rend figcaption span{font-size:7.5pt}
  .doc-rends .of-rend-tag{font-size:6pt;top:2mm;left:2mm}
  .doc-amb{grid-column:1/-1}
  .doc-pie{margin-top:10mm;border-top:1px solid #ccc;padding-top:5px;font-size:7.2pt;color:#777;display:flex;justify-content:space-between;gap:12px}
}

/* ============ GRAFICI AGGIUNTIVI ============ */
.ring-wrap{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.ring{flex:none}
.ring-legend{display:flex;flex-direction:column;gap:7px;font-size:12.5px;min-width:130px;flex:1}
.ring-legend div{display:flex;align-items:center;gap:8px}
.ring-legend i{width:10px;height:10px;border-radius:3px;flex:none}
.ring-legend .v{margin-left:auto;font-variant-numeric:tabular-nums;font-weight:600}
/* sei tessere: le colonne dividono sempre sei, così non restano righe spaiate */
.kpi-grid-6{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-bottom:12px}
@media (max-width:1320px){.kpi-grid-6{grid-template-columns:repeat(3,minmax(0,1fr))}}
.stat-split{display:grid;grid-template-columns:repeat(auto-fit,minmax(290px,1fr));gap:16px}

/* ============ RESPONSIVE ============ */
@media (max-width:1100px){
  .grid-2{grid-template-columns:1fr}
}
@media (max-width:860px){
  /* la barra laterale esce dal flusso: senza griglia il contenuto occupa tutta la larghezza */
  .app{display:block}
  .rail{position:fixed;top:0;left:0;z-index:70;width:270px;transform:translateX(-100%);transition:transform .22s cubic-bezier(.3,.8,.4,1)}
  .app.mobile-open .rail{transform:none}
  .app.mobile-open::after{content:"";position:fixed;inset:0;background:rgba(10,18,20,.45);z-index:69}
  .search{max-width:none}
  .page{padding:15px 12px 60px}
  .page-title{font-size:20px}
  .page-actions{width:100%}
  .page-actions .btn{flex:1;justify-content:center}
  .kbd{display:none}
  .search input{padding-right:12px}
}
@media (max-width:720px){
  /* le tabelle diventano schede: niente scorrimento orizzontale */
  .tw{overflow-x:visible}
  .tw table,.tw tbody,.tw tr,.tw td{display:block;width:100%}
  .tw thead{display:none}
  .tw tbody tr{border:1px solid var(--border);border-radius:var(--r-md);margin-bottom:10px;background:var(--surface);overflow:hidden}
  .tw tbody tr:hover{background:var(--surface)}
  .tw td{border:0;border-bottom:1px solid var(--border);padding:8px 12px;display:block;text-align:left}
  .tw td:last-child{border-bottom:0}
  .tw td::before{content:attr(data-l);display:block;font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:600;margin-bottom:2px}
  .tw td.right,.tw td .right{text-align:left}
  .tw td:empty{display:none}
  .row-actions{opacity:1;justify-content:flex-start}
  .icon-btn{width:38px;height:38px}
  .kpis,.kpi-grid-6{grid-template-columns:repeat(2,minmax(0,1fr))}
  .kpi-v{font-size:21px}
  .drawer,.drawer.wide{width:100%}
  .dr-b{padding:14px}
  .dr-f{padding:11px 14px;flex-wrap:wrap}
  .dr-f .btn{flex:1;justify-content:center}
  .hint-k{display:none}
  .toolbar{padding:11px}
  .filter-input{min-width:0;width:100%}
  .chips{width:100%;overflow-x:auto;padding-bottom:2px}
  .chip{flex:none;height:32px}
  .kan{grid-auto-columns:minmax(230px,80%);scroll-snap-type:x mandatory}
  .kan-col{scroll-snap-align:start}
  .tabs{padding:0 12px}
  .toasts{left:12px;right:12px;bottom:12px}
  .toast{min-width:0}
  .mini-row .ml{width:84px}
  .mini-row .mv{width:66px}
  .ring-wrap{justify-content:center}
}
@media (max-width:420px){
  .kpi-v{font-size:19px}
  .page-title{font-size:19px}
}


/* ═══════════════════ GESTIONALE IN ESERCIZIO ═══════════════════ */
[hidden]{display:none!important}
.help svg{width:14px;height:14px;vertical-align:-2px;stroke:currentColor;fill:none;margin-right:3px}
.qr-side .help{display:flex;align-items:center;gap:4px}
body.avvio .app{visibility:hidden}
body.avvio::after{content:"";position:fixed;left:50%;top:45%;width:34px;height:34px;margin:-17px;border-radius:50%;border:3px solid var(--border);border-top-color:var(--brand);animation:gira .8s linear infinite}
@keyframes gira{to{transform:rotate(360deg)}}
body.fuori .app{filter:blur(2px);pointer-events:none}
.btn.attesa{opacity:.6;pointer-events:none}
.link{border:0;background:none;padding:0;color:var(--brand);font:inherit;font-weight:600;cursor:pointer;text-decoration:underline;text-underline-offset:2px}

/* accesso e cambio password */
.accesso[hidden]{display:none}
.accesso{position:fixed;inset:0;z-index:120;display:grid;place-items:center;padding:20px;background:color-mix(in srgb,var(--ground) 92%,transparent);overflow:auto}
.acc-box{width:min(400px,100%);background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);box-shadow:var(--shadow-lg);padding:26px 26px 20px;display:flex;flex-direction:column;gap:12px}
.acc-box .f{display:flex;flex-direction:column;gap:5px}
.acc-box input{height:40px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface-2);padding:0 12px;font:inherit;color:var(--ink)}
.acc-box input:focus{outline:2px solid var(--brand);outline-offset:1px;border-color:var(--brand)}
.acc-marchio{display:flex;align-items:center;gap:11px;margin-bottom:4px}
.acc-marchio b{display:block;font-family:var(--f-display);font-size:16px}
.acc-marchio span{font-size:12.5px;color:var(--muted)}
.acc-t{font-family:var(--f-display);font-size:22px;margin:4px 0 2px}
.acc-msg{font-size:13px;color:var(--ink-2);background:var(--brand-soft);border-radius:var(--r-sm);padding:9px 11px}
.acc-err{font-size:13px;color:var(--danger);background:var(--danger-soft);border-radius:var(--r-sm);padding:9px 11px}
.acc-btn{height:42px;justify-content:center;font-size:14.5px}
.acc-nota{font-size:12px;color:var(--muted);margin:2px 0 0;text-align:center}
.brand-mark img{width:100%;height:100%;object-fit:contain;display:block}

/* menu dell'utente */
.utente-wrap{position:relative}
.avatar{border:0;cursor:pointer;font:inherit;font-weight:600}
.avatar:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.menu-utente{position:absolute;right:0;top:calc(100% + 8px);z-index:60;width:240px;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);box-shadow:var(--shadow-lg);padding:6px;display:flex;flex-direction:column}
.menu-utente[hidden]{display:none}
.mu-h{display:flex;flex-direction:column;padding:8px 10px 10px;border-bottom:1px solid var(--border);margin-bottom:4px}
.mu-h b{font-size:13.5px}.mu-h span{font-size:12px;color:var(--muted)}
.menu-utente button{display:flex;align-items:center;gap:9px;border:0;background:none;padding:9px 10px;border-radius:var(--r-sm);font:inherit;color:var(--ink);cursor:pointer;text-align:left}
.menu-utente button:hover{background:var(--surface-2)}
.menu-utente svg{width:16px;height:16px;stroke:currentColor;fill:none}

/* finestra modale */
.modale-box{max-width:520px;max-height:84vh;display:flex;flex-direction:column}
.modale-box.larga{max-width:760px}
.modale-box>form{display:flex;flex-direction:column;min-height:0}
.mod-h{display:flex;align-items:flex-start;gap:12px;padding:14px 16px;border-bottom:1px solid var(--border)}
.mod-h>div{flex:1;min-width:0;display:flex;flex-direction:column}
.mod-h b{font-family:var(--f-display);font-size:15.5px}.mod-h span{font-size:12.5px;color:var(--muted)}
.mod-b{padding:16px;overflow:auto;display:flex;flex-direction:column;gap:12px}
.mod-f{display:flex;gap:8px;align-items:center;padding:12px 16px;border-top:1px solid var(--border);background:var(--surface-2);flex-wrap:wrap}
.mod-f .spacer,.dr-f .spacer{flex:1}
.mod-b .fgrid{margin:0}
.scelte{display:flex;gap:8px;flex-wrap:wrap}
.passi{margin:0;padding-left:20px;font-size:13px;color:var(--ink-2);display:flex;flex-direction:column;gap:4px}
.share-canali{display:flex;gap:6px;flex-wrap:wrap}
.share-canali .btn{text-decoration:none}

/* fattura elettronica */
.sdi-esito{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border-radius:var(--r-md);border:1px solid}
.sdi-esito svg{width:22px;height:22px;flex:none;stroke:currentColor;fill:none;stroke-width:2}
.sdi-esito b{display:block;font-family:var(--f-display);font-size:14.5px}
.sdi-esito span{font-size:12.5px;color:var(--ink-2)}
.sdi-esito.ok{border-color:var(--ok);background:var(--ok-soft);color:var(--ok)}
.sdi-esito.ko{border-color:var(--danger);background:var(--danger-soft);color:var(--danger)}
.sdi-l{display:flex;flex-direction:column;gap:6px}
.sdi-l>b{font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.sdi-r{display:flex;gap:10px;font-size:13px;line-height:1.45;padding:8px 10px;border-radius:var(--r-sm);background:var(--surface-2)}
.sdi-r .mono{flex:none;font-size:11.5px;color:var(--muted);min-width:44px}
.sdi-r.err{background:var(--danger-soft)}
.sdi-r.err .mono{color:var(--danger)}
.sdi-stato{font-size:13px;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.doc-nota-sdi{font-size:7.8pt;color:#666;margin-top:6mm}

/* drawer: note, sola consultazione, storico */
.fset{border:0;margin:0;padding:0;min-width:0}
.fset:disabled input,.fset:disabled select,.fset:disabled textarea{opacity:.85}
.nota-blocco{display:flex;gap:9px;align-items:flex-start;font-size:12.5px;color:var(--ink-2);background:var(--warn-soft);border-radius:var(--r-sm);padding:9px 11px;margin-bottom:12px}
.nota-blocco.ok{background:var(--ok-soft)}
.nota-blocco svg{width:16px;height:16px;flex:none;stroke:currentColor;fill:none;margin-top:1px}
.f[hidden]{display:none!important}
.storico{margin-top:18px;border:1px solid var(--border);border-radius:var(--r-md);background:var(--surface-2)}
.storico summary{cursor:pointer;padding:10px 12px;font-size:13px;font-weight:600;display:flex;align-items:center;gap:8px;list-style:none}
.storico summary::-webkit-details-marker{display:none}
.storico summary svg{width:15px;height:15px;stroke:currentColor;fill:none}
.storico-l{padding:0 12px 10px;display:flex;flex-direction:column;gap:2px;max-height:320px;overflow:auto}
.st-r{display:flex;flex-direction:column;padding:7px 0;border-top:1px solid var(--border);font-size:12.5px}
.st-t{color:var(--muted);font-size:11.5px}
.st-prima{text-decoration:line-through;color:var(--muted)}
.st-dopo{color:var(--ink);font-weight:600}

/* righe di documento, costi, listini */
.voci-art{display:flex;flex-direction:column;gap:4px;min-width:0}
.voci-art input{text-align:left!important}
.voci-mk{font-size:11px;color:var(--muted)}
.voci-mk.neg{color:var(--danger);font-weight:600}
.costi-head,.costi-row{display:grid;grid-template-columns:150px 1fr 132px 100px 30px;gap:8px;align-items:center;padding:7px 10px}
.costi-head.lis,.costi-row.lis{grid-template-columns:1fr 150px 120px 30px}
.costi-head{background:var(--surface-3);font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:600}
.costi-row{border-top:1px solid var(--border)}
.costi-row select,.costi-row input{height:32px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface-2);padding:0 8px;width:100%;min-width:0;font:inherit;color:var(--ink)}
.costi-row input[type=number]{text-align:right}
.costi-row button{border:0;background:none;color:var(--muted);cursor:pointer;font-size:14px}
.costi-row button:hover{color:var(--danger)}
.voci{border:1px solid var(--border);border-radius:var(--r-md);overflow:hidden;background:var(--surface)}

/* avvisi del cruscotto */
.avvisi-riga{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.avviso{display:flex;gap:9px;align-items:center;text-align:left;border:1px solid var(--border);border-left:3px solid var(--danger);background:var(--surface);border-radius:var(--r-sm);padding:9px 12px;font:inherit;font-size:13px;color:var(--ink);cursor:pointer}
.avviso svg{width:16px;height:16px;flex:none;stroke:var(--danger);fill:none}
.avviso:hover{background:var(--surface-2)}

/* pagina del tecnico */
.lavori{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px;align-items:start}
.lavori section{display:flex;flex-direction:column;gap:10px}
.sez-t{font-size:11.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);font-weight:700}
.lavoro{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);padding:13px 14px;display:flex;flex-direction:column;gap:5px;box-shadow:var(--shadow-sm)}
.lavoro.tardi{border-left:3px solid var(--danger)}
.lv-h{display:flex;justify-content:space-between;align-items:center}
.lavoro>b{font-family:var(--f-display);font-size:14.5px;line-height:1.3}
.lv-s{font-size:12.5px;color:var(--muted)}
.lv-a{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.lv-a .btn{text-decoration:none}

/* impostazioni */
.set-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(420px,1fr));gap:16px;align-items:start}
.set-largo{grid-column:1/-1}
.logo-riga{display:flex;gap:14px;align-items:center;margin-top:14px}
.logo-anteprima{width:64px;height:64px;border-radius:var(--r-md);border:1px solid var(--border);display:grid;place-items:center;background:var(--surface-2);overflow:hidden;padding:6px;color:var(--brand)}
.logo-anteprima img{max-width:100%;max-height:100%;object-fit:contain}
.logo-anteprima svg{width:32px;height:32px;stroke:currentColor;fill:none}
[data-set-f].bad input,[data-set-f].bad select{border-color:var(--danger)}
.imp-t{font-size:13px;font-weight:600;margin-top:4px}
.imp-tab select{height:32px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface-2);padding:0 6px;font:inherit;color:var(--ink);min-width:180px}

/* offerta scaduta e documento con logo */
.of-scaduta{display:flex;gap:9px;align-items:center;margin-top:16px;padding:11px 14px;border-radius:var(--r-md);background:var(--warn-soft);color:var(--ink);font-size:13.5px}
.of-scaduta svg{width:18px;height:18px;flex:none;stroke:var(--warn);fill:none}
body.pubblico .rail,body.pubblico .topbar{display:none!important}

@media (max-width:860px){
  .set-grid{grid-template-columns:1fr}
  .costi-head{display:none}
  .costi-row,.costi-row.lis{grid-template-columns:1fr 1fr 30px}
  .costi-row>*:nth-child(2){grid-column:1/3}
  .lavori{grid-template-columns:1fr}
}
@media print{
  .doc-logo{height:13mm;max-width:40mm;object-fit:contain;background:#fff;border-radius:2mm;padding:1.5mm;margin-right:4mm}
}
