/* Haulix Go — phone-first field app */
:root{--bg:#F4F6F8;--surface:#fff;--surface2:#EEF2F5;--text:#0F172A;--text2:#475569;--muted:#8A97AA;--border:#E3E8EE;--accent:#0E7C86;--accent-h:#0A5F67;--tint:#E6F4F5;
  --ok:#16A34A;--ok-t:#DCFCE7;--warn:#D97706;--warn-t:#FEF3C7;--bad:#DC2626;--bad-t:#FEE2E2;--info:#2563EB;--info-t:#DBEAFE;--map:#EEF2F5;--road:#DDE4EA;
  --r:14px;--shadow:0 1px 2px rgba(15,23,42,.06),0 4px 14px rgba(15,23,42,.05)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0}
body{background:#DCE3E9;color:var(--text);font:15px/1.45 Inter,system-ui,-apple-system,sans-serif;-webkit-font-smoothing:antialiased}
a{color:var(--accent);text-decoration:none}
h1,h2,h3,p{margin:0}
.mono{font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.9em}
.muted{color:var(--muted)}.small{font-size:12.5px}.center{text-align:center}.block{display:block}.grow{flex:1}
.okc{color:var(--ok)}.badc{color:var(--bad)}.warnc{color:var(--warn)!important;background:var(--warn-t)!important}
svg.lucide{flex:none}
#app{max-width:430px;margin:0 auto;min-height:100vh;min-height:100dvh;background:var(--bg);display:flex;flex-direction:column;position:relative}
@media (min-width:600px){#app{box-shadow:0 0 0 1px #cfd8df,0 20px 60px rgba(15,23,42,.18)}}
main#view{flex:1;padding:0 16px 24px;display:flex;flex-direction:column;gap:12px}
/* header */
.hd{display:flex;align-items:center;gap:10px;padding:18px 0 4px}
.hd h1{font-size:21px;font-weight:700;letter-spacing:-.01em}
.hd p{font-size:13px;color:var(--text2);margin-top:2px}
.hd .back{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;background:var(--surface);box-shadow:var(--shadow);color:var(--text)}
.hd .icon-btn{margin-left:auto}
.sec{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin:6px 2px -4px}
/* cards & lists */
.card{background:var(--surface);border-radius:var(--r);box-shadow:var(--shadow)}
.pad{padding:14px}
.list{list-style:none;margin:0;padding:4px 14px}
.list li,.list>label{display:flex;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid var(--border)}
.list li:last-child,.list>label:last-child{border-bottom:0}
.list li>div{flex:1;min-width:0}
.list li b,.list li small{display:block;overflow:hidden;text-overflow:ellipsis}
.list li small{color:var(--text2);font-size:12.5px;white-space:nowrap}
.list li.col{flex-direction:column;align-items:stretch}
.list li.col .row{display:flex;align-items:center;gap:10px}
.list li.cur{background:var(--tint);margin:0 -14px;padding-left:14px;padding-right:14px}
.tap{cursor:pointer}
.ico{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:var(--tint);color:var(--accent);flex:none}
.ico.grey{background:var(--surface2);color:var(--text2)}
.num{width:26px;height:26px;border-radius:99px;background:var(--surface2);color:var(--text2);display:grid;place-items:center;font-size:12px;font-weight:700;flex:none}
.num.big{width:40px;height:40px;font-size:17px;background:var(--accent);color:#fff}
.row{display:flex;align-items:center;gap:10px}
.kv{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;font-size:13.5px;margin-top:12px}.kv span{color:var(--muted)}
.hero .stats,.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:14px 0 4px;text-align:center}
.stats b{display:block;font-size:20px}.stats span{font-size:11.5px;color:var(--muted)}
.center .stats{grid-template-columns:1fr 1fr}
.hero{padding:16px;background:linear-gradient(135deg,#0E7C86,#0B5E78);color:#fff}
.hero .muted,.hero .stats span{color:rgba(255,255,255,.75)}
.hero .tag{background:rgba(255,255,255,.18);color:#fff}
.hero .btn.primary{background:#fff;color:var(--accent);margin-top:10px}
.hero .ok-line{margin-top:10px;display:flex;gap:8px;align-items:center}
.tag{font-size:12px;font-weight:700;padding:3px 10px;border-radius:99px;background:var(--tint);color:var(--accent)}
.hero .row{justify-content:space-between}
.prep.done b{color:var(--ok)}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.stat{padding:12px;display:flex;flex-direction:column;gap:2px}.stat b{font-size:22px}.stat span:last-child{font-size:12px;color:var(--text2)}
.stat.warn .ico{background:var(--warn-t);color:var(--warn)}.stat.bad .ico{background:var(--bad-t);color:var(--bad)}
/* pills, chips, bars */
.pill{display:inline-flex;align-items:center;padding:3px 9px;border-radius:99px;font-size:11.5px;font-weight:700;white-space:nowrap;background:var(--surface2);color:var(--text2)}
.pill.ok{background:var(--ok-t);color:var(--ok)}.pill.warn{background:var(--warn-t);color:var(--warn)}.pill.bad{background:var(--bad-t);color:var(--bad)}.pill.info{background:var(--info-t);color:var(--info)}
.chips{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
.chips:first-child{margin-top:0}
.chip{border:1px solid var(--border);background:var(--surface);border-radius:99px;padding:5px 11px;font:600 12.5px Inter,sans-serif;color:var(--text2)}
.chip.on{background:var(--tint);border-color:var(--accent);color:var(--accent)}
.chip.warn{background:var(--warn-t);border-color:transparent;color:var(--warn)}
.bar{height:6px;border-radius:9px;background:var(--surface2);overflow:hidden;margin-top:6px}
.bar>i{display:block;height:100%;background:var(--accent);border-radius:9px;transition:width .2s}
main>.bar{margin-top:0}
/* buttons & inputs */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:0 16px;border-radius:12px;border:1px solid var(--border);background:var(--surface);color:var(--text);font:600 15px Inter,sans-serif;cursor:pointer}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn.primary:active{background:var(--accent-h)}
.btn.ghost{background:var(--surface)}
.btn.danger{background:var(--bad);border-color:var(--bad);color:#fff}
.btn.danger-t{color:var(--bad)}
.btn.sm{min-height:34px;padding:0 12px;font-size:13px;border-radius:10px}
.btn.big{min-height:58px;font-size:16.5px}
.btn.block{display:flex;width:100%}
.btn:disabled{opacity:.45;cursor:not-allowed}
.icon-btn{width:40px;height:40px;border-radius:10px;border:1px solid var(--border);background:var(--surface);display:grid;place-items:center;color:var(--text2);cursor:pointer}
.link{background:none;border:0;color:var(--accent);font:600 13.5px Inter,sans-serif;cursor:pointer;padding:6px 0}
.link:disabled{color:var(--muted);cursor:not-allowed}
.inp{width:100%;min-height:46px;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);padding:0 12px;font:16px Inter,sans-serif}
.inp.sm{width:auto;min-height:38px;font-size:14px}
textarea.inp{min-height:84px;padding:10px 12px;resize:vertical}
.inp:focus{outline:2px solid color-mix(in srgb,var(--accent) 35%,transparent);border-color:var(--accent)}
.form{display:flex;flex-direction:column;gap:12px}
.form>label,label.f{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600;color:var(--text2)}
.check{display:flex;align-items:center;gap:10px;font-size:14.5px;font-weight:500;color:var(--text)}
.check input,.seg input{width:20px;height:20px;accent-color:var(--accent);flex:none}
.seg{display:flex;gap:8px}
.seg.wrap{flex-wrap:wrap}
.seg>label,.seg>button{flex:1;display:flex;align-items:center;gap:8px;justify-content:center;min-height:46px;padding:0 12px;border-radius:12px;border:1px solid var(--border);background:var(--surface);font:600 14px Inter,sans-serif;color:var(--text);cursor:pointer}
.seg.wrap>label,.seg.wrap>button{flex:1 1 40%}
.seg>label:has(input:checked),.seg>button.on{border-color:var(--accent);background:var(--tint);color:var(--accent)}
.seg.two,.seg.three{background:var(--surface2);padding:4px;border-radius:12px}
.seg.two>button,.seg.three>button{border:0;background:none;min-height:38px;font-size:13px}
.seg.two>button.on,.seg.three>button.on{background:var(--surface);box-shadow:var(--shadow)}
.err{color:var(--bad);font-size:13px;font-weight:600}
.err:empty{display:none}
.actions{display:flex;gap:10px}.actions>.btn{flex:1}
.pw{position:relative;display:block}.pw .icon-btn{position:absolute;right:4px;top:3px;border:0}
.search{display:flex;align-items:center;gap:8px;background:var(--surface);border-radius:12px;padding:0 12px;box-shadow:var(--shadow)}
.search .inp{border:0;min-height:44px;padding:0}.search .inp:focus{outline:0}
.scanrow{display:flex;gap:8px;margin-top:10px}.scanrow .btn{flex:none}
/* results */
.result{margin-top:10px;padding:12px;border-radius:12px;font-weight:600;font-size:14px;background:var(--surface2)}
.r-loaded,.r-ok{background:var(--ok-t);color:#14532D}.r-dup,.r-warn{background:var(--warn-t);color:#78350F}.r-foreign,.r-bad,.r-anomaly{background:var(--bad-t);color:#7F1D1D}
section.result{display:flex;flex-direction:column;gap:10px}
section.result p{font-weight:500}
.viewfinder{height:120px;border-radius:12px;background:#0F172A;position:relative;overflow:hidden;margin-bottom:10px}
.viewfinder::before{content:"";position:absolute;inset:22px 40px;border:2px solid rgba(255,255,255,.55);border-radius:10px}
.viewfinder span{position:absolute;left:44px;right:44px;height:2px;background:#22D3EE;box-shadow:0 0 12px #22D3EE;animation:scanl 2s ease-in-out infinite}
@keyframes scanl{0%,100%{top:28px}50%{top:90px}}
.warnbox{display:flex;gap:10px;align-items:flex-start;background:var(--warn-t);color:#78350F;border-radius:12px;padding:12px;font-size:14px}
.note{display:flex;gap:8px;align-items:flex-start;margin-top:10px;background:var(--surface2);border-radius:10px;padding:8px 10px;font-size:13px;color:var(--text2)}
.quick{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:12px 0 10px}.quick .btn{min-height:42px;font-size:13px;padding:0 6px}
.amount{font-size:34px;font-weight:800;letter-spacing:-.02em}
.lead{font-size:17px;font-weight:600}
.big2{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.choice{min-height:120px;flex-direction:column;font-size:15px}
.recap li span{color:var(--muted);font-size:13px;flex:none;width:110px}.recap li b{flex:1;text-align:right;font-size:14px}
.dot{width:10px;height:10px;border-radius:99px;background:var(--ok);flex:none}.dot.damage{background:var(--warn)}.dot.anomaly{background:var(--bad)}
.hday{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:6px 2px 0}
.map{overflow:hidden;line-height:0}.map svg{width:100%;height:auto}
/* photo widget */
.ph{margin-top:8px}
.ph-row{display:flex;gap:8px;flex-wrap:wrap}
.ph-add{width:84px;height:84px;border-radius:12px;border:1.5px dashed #B8C4CF;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:var(--text2);font-size:11px;font-weight:600;cursor:pointer;text-align:center;padding:4px}
.ph-thumb{position:relative;width:84px;height:84px}
.ph-thumb img{width:100%;height:100%;object-fit:cover;border-radius:12px}
.ph-thumb button{position:absolute;top:-6px;right:-6px;width:24px;height:24px;border-radius:99px;border:0;background:var(--text);color:#fff;font-size:15px;line-height:1;cursor:pointer}
/* signature */
.sig{width:100%;height:200px;background:#fff;border:1.5px dashed #B8C4CF;border-radius:14px;touch-action:none;display:block}
/* chat */
.chat{display:flex;flex-direction:column;gap:8px;min-height:200px}
.msg{max-width:82%;background:var(--surface);border-radius:14px 14px 14px 4px;padding:9px 12px;box-shadow:var(--shadow);font-size:14.5px}
.msg small{display:block;font-size:11px;color:var(--muted);margin-top:2px}
.msg.me{align-self:flex-end;background:var(--accent);color:#fff;border-radius:14px 14px 4px 14px}.msg.me small{color:rgba(255,255,255,.75)}
.composer{display:flex;gap:8px;position:sticky;bottom:70px}.composer .btn{flex:none;width:50px;padding:0}
/* av */
.av{width:44px;height:44px;border-radius:99px;background:linear-gradient(135deg,#0E7C86,#4F46E5);color:#fff;display:grid;place-items:center;font-weight:700;flex:none}
.av.big{width:72px;height:72px;font-size:24px;margin:0 auto 8px}
/* nav + banner */
#nav{position:sticky;bottom:0;display:flex;background:rgba(255,255,255,.96);backdrop-filter:blur(8px);border-top:1px solid var(--border);padding:6px 4px calc(6px + env(safe-area-inset-bottom));z-index:20}
#nav:empty{display:none}
#nav a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:11px;font-weight:600;color:var(--muted);position:relative;padding:4px 0}
#nav a.on{color:var(--accent)}
#nav em{position:absolute;top:0;left:calc(50% + 6px);background:var(--bad);color:#fff;font-style:normal;font-size:10px;border-radius:99px;padding:0 5px;min-width:16px;text-align:center}
#nav em:empty{display:none}
#net{position:sticky;top:0;z-index:30;display:flex;align-items:center;justify-content:center;gap:6px;font-size:13px;font-weight:700;padding:7px 12px;color:#fff}
#net[data-state=online]{display:none}#net[data-state=offline]{background:#334155}#net[data-state=synced]{background:var(--ok)}
/* sheet + toast */
dialog.sheet{border:0;padding:0;width:100%;max-width:430px;margin:auto auto 0;border-radius:20px 20px 0 0;background:var(--bg);color:var(--text);max-height:90vh;box-shadow:0 -10px 40px rgba(15,23,42,.25)}
dialog.sheet::backdrop{background:rgba(15,23,42,.45)}
.sheet form{padding:18px 16px calc(16px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:12px}
.sheet h2{font-size:18px}
.sheet .sb{display:flex;flex-direction:column;gap:12px}
.sf{display:flex;gap:10px}.sf .btn{flex:1}
.toast{position:fixed;left:50%;bottom:90px;transform:translate(-50%,20px);opacity:0;background:var(--text);color:#fff;padding:10px 16px;border-radius:12px;font-weight:600;font-size:14px;transition:.2s;pointer-events:none;z-index:100;max-width:calc(100vw - 32px)}
.toast.show{opacity:1;transform:translate(-50%,0)}.toast.ok{background:var(--ok)}
/* login */
.login{display:flex;flex-direction:column;gap:14px;padding-top:6vh}
.login .brand{text-align:center;margin-bottom:6px}
.login .logo{width:72px;height:72px;border-radius:20px;background:linear-gradient(135deg,#0E7C86,#0B5E78);color:#fff;display:inline-grid;place-items:center;margin-bottom:10px;box-shadow:0 10px 24px rgba(14,124,134,.35)}
.login h1{font-size:26px}.login .brand p{color:var(--text2);font-size:14px}
.login .list li{padding:8px 0}
/* customer pages */
#app.cust{max-width:480px}
.cust-hd{display:flex;align-items:center;gap:8px;padding:16px 0 2px}.cust-hd .muted{margin-left:auto}
.logo.sm{width:28px;height:28px;border-radius:8px;background:var(--accent);color:#fff;display:inline-grid;place-items:center}
.cust-title{font-size:21px;margin:4px 0 12px;letter-spacing:-.01em}
.steps{list-style:none;margin:0 0 12px;padding:0;display:grid;grid-template-columns:repeat(5,1fr);gap:4px;font-size:10.5px;font-weight:600;color:var(--muted);text-align:center}
.steps .st span{display:block;height:5px;border-radius:9px;background:var(--surface2);margin-bottom:6px}
.steps .st.done span,.steps .st.on span{background:var(--accent)}.steps .st.on{color:var(--accent)}.steps .st.done{color:var(--text2)}
.steps .st.fail span{background:var(--bad)}.steps .st.fail{color:var(--bad)}
.eta{display:grid;grid-template-columns:1fr 1fr;gap:10px;background:var(--tint);border-radius:12px;padding:12px;margin:6px 0 10px}
.eta b{display:block;font-size:18px}
.days{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;margin:12px 0}
.day{border:1px solid var(--border);background:var(--surface);border-radius:10px;padding:6px 0;font:inherit;cursor:pointer;display:flex;flex-direction:column;align-items:center}
.day small{font-size:10.5px;color:var(--muted);text-transform:capitalize}.day b{font-size:16px}
.day.on{background:var(--accent);border-color:var(--accent);color:#fff}.day.on small{color:rgba(255,255,255,.8)}
.day:disabled{opacity:.35;cursor:not-allowed}
.stars{display:flex;gap:6px;margin:10px 0}.stars button{font-size:32px;line-height:1;background:none;border:0;color:#CBD5E1;cursor:pointer;padding:0 2px}.stars button.on{color:#F59E0B}
#qr{width:210px;height:210px;margin:12px auto;display:block;border-radius:12px;box-shadow:var(--shadow)}
.foot{margin:6px 0 10px}
.cust .composer{position:static;margin-top:10px}
#trkErr,#dateApp,#payApp{display:flex;flex-direction:column;gap:10px}
#dateApp,#payApp{align-items:stretch}#payApp{align-items:center}#payApp .btn{width:100%}
.form>label.check{flex-direction:row;align-items:center;color:var(--text);font-size:14.5px;font-weight:500}
.warnbox{display:block}.warnbox svg{vertical-align:-3px;margin-right:6px}
.cust .chat{min-height:0;margin-top:8px}
