/* SP Logistics WMS prototype. Colours only from tokens.css (design/tokens.json). */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font-body); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--surface);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1 { font-size: 24px; line-height: 32px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; line-height: 24px; font-weight: 650; margin: 0; }
.muted { color: var(--ink-muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* loading bar */
.bar { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--brand); z-index: 90; transition: width .35s ease, opacity .3s; }
.bar.go { width: 70%; } .bar.done { width: 100%; opacity: 0; }

/* shell */
.side { position: fixed; inset: 0 auto 0 0; width: 232px; background: var(--shell); color: var(--shell-ink);
  display: flex; flex-direction: column; padding: 22px 14px; z-index: 40; transition: transform .25s; }
.mark { font-size: 19px; font-weight: 700; letter-spacing: -.01em; padding: 0 10px 26px; display: flex; align-items: center; gap: 8px; }
.mark-sp { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); font-size: 14px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--shell-muted); font-weight: 500; }
.side nav a i { font-size: 18px; }
.side nav a:hover { color: var(--shell-ink); background: rgba(255,255,255,.05); }
.side nav a.on { color: var(--shell-ink); background: rgba(255,255,255,.09); }
.side nav a.on i { color: var(--brand); }
.side-foot { margin-top: auto; padding: 0 6px; }
.who { display: flex; gap: 10px; align-items: center; }
.who b { display: block; font-size: 13px; } .who small { color: var(--shell-muted); font-size: 12px; }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); font-size: 12px; font-weight: 700; flex: none; }

.main { margin-left: 232px; min-height: 100%; transition: margin-right .3s; }
body.docked .main { margin-right: 400px; }
.top { position: sticky; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 32px;
  background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.live { display: flex; align-items: center; gap: 8px; color: var(--ink-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0 var(--brand); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.top-r { margin-left: auto; display: flex; gap: 10px; }
.page { padding: 28px 32px 120px; max-width: 1480px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); font-weight: 600; white-space: nowrap; transition: transform .1s, background .2s; }
.btn:active { transform: scale(.97); }
.btn i { font-size: 17px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost:hover { background: var(--surface); }
.btn.block { width: 100%; justify-content: center; height: 48px; font-size: 15px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.busy { pointer-events: none; opacity: .8; }
.btn.busy i { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; display: inline-grid; place-items: center; color: var(--ink-muted); }
.icon-btn:hover { background: var(--surface); color: var(--ink); }
.icon-btn i { font-size: 18px; }
.only-phone { display: none; }

/* page head */
.head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.head .btn { margin-left: auto; }
.chip-date { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; font-size: 13px; background: var(--surface-2); }

/* cards */
.card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 20px; min-width: 0; }
.card-h { display: flex; align-items: center; gap: 6px 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h .r { margin-left: auto; }
.grid { display: grid; gap: 20px; }
.g-map { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mt { margin-top: 20px; }

/* flow strip */
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px; margin-bottom: 20px; }
.step { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; transition: all .35s; }
.step:not(:last-child)::after { content: "\ea6c"; font-family: remixicon; position: absolute; right: -24px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); font-size: 18px; }
.step .lbl { display: flex; gap: 8px; align-items: center; color: var(--ink-muted); font-weight: 600; font-size: 13px; }
.step .lbl i { font-size: 16px; }
.step .fig { font-size: 30px; line-height: 38px; font-weight: 650; margin-top: 6px; letter-spacing: -.02em; }
.step .sub { color: var(--ink-muted); font-size: 12.5px; }
.step.hot { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); transform: translateY(-3px); box-shadow: 0 10px 24px -12px var(--brand); }
.step.hot .lbl, .step.hot .sub { color: inherit; opacity: .9; }
.bump { animation: bump .6s; }
@keyframes bump { 40% { transform: scale(1.12); } }

/* HQ grid */
.hq { margin-bottom: 26px; }
.hq-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 4px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.hq-sum small { display: block; color: var(--ink-muted); font-weight: 600; font-size: 12.5px; }
.hq-sum b { font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.wts { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.wt { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s, transform .2s, box-shadow .3s; min-width: 0; }
.wt:hover { border-color: var(--ink-muted); transform: translateY(-2px); }
.wt.live { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.wt-h { display: flex; flex-direction: column; gap: 2px; }
.wt-h b { font-size: 15px; white-space: nowrap; }
.wt-st { font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; color: var(--ink-muted); white-space: nowrap; }
.wt-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.wt-st.recv { color: var(--brand); } .wt-st.recv::before { background: var(--brand); }
.wt-st.check { color: var(--pending); } .wt-st.check::before { background: var(--pending); }
.wt-port { color: var(--ink-muted); font-size: 12px; }
.wt-fig { font-size: 20px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; }
.wt-fig small { font-size: 12px; color: var(--ink-muted); font-weight: 500; letter-spacing: 0; }
.wt .track { height: 7px; }
.wt-io { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--ink-muted); margin-top: 4px; }
.wt-io b { color: var(--ink); font-weight: 600; }
.wt-io i { font-size: 13px; vertical-align: -2px; margin-right: 2px; }
.sec { margin: 0 0 12px; }
@media (max-width: 1360px) { .wts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) { .wts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hq-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* map */
.map-wrap { position: relative; border-radius: 10px; overflow: hidden; background: var(--surface); }
.map { display: block; width: 100%; height: auto; }
.map .water { fill: var(--info-tint); }
.map .land { fill: var(--surface-2); }
.map .road { fill: none; stroke: var(--line); stroke-width: 5; stroke-linecap: round; }
.map .route { fill: none; stroke: var(--brand); stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; opacity: .55; }
.map .port rect { fill: var(--shell); }
.map .port text { fill: var(--shell-ink); font-size: 11px; font-weight: 700; }
.map .wh rect { fill: var(--surface-2); stroke: var(--ink); stroke-width: 1.4; }
.map .wh text { fill: var(--ink); font-size: 11px; font-weight: 600; }
.map .wh.on rect { fill: var(--brand); stroke: var(--brand); }
.map .wh.on text { fill: var(--brand-ink); }
.map .lorry circle.dot { fill: var(--ink); }
.map .lorry circle.ring { fill: none; stroke: var(--ink); opacity: .25; }
.map .lorry text { font-size: 10.5px; font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: var(--surface-2); stroke-width: 3px; }
.map .lorry.me circle.dot { fill: var(--brand); }
.map .lorry.me circle.ring { stroke: var(--brand); opacity: .5; animation: ring 1.6s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ring { from { transform: scale(.6); opacity: .7; } to { transform: scale(1.8); opacity: 0; } }
.map-legend { position: absolute; left: 14px; bottom: 12px; display: flex; gap: 14px; font-size: 12px; color: var(--ink-muted); font-weight: 500; }
.eta { position: absolute; right: 12px; top: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-width: 190px; box-shadow: 0 8px 20px -14px var(--ink); }
.eta b { display: block; font-size: 15px; } .eta .muted { font-size: 12.5px; }

/* lists */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row a.go { color: var(--ink-muted); }
.dotl { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dotl.alert { background: var(--alert); } .dotl.pending { background: var(--pending); } .dotl.ok { background: var(--brand); }
.thumb { width: 52px; height: 36px; border-radius: 6px; object-fit: cover; flex: none; background: var(--surface); }
.t { color: var(--ink-muted); font-size: 12.5px; width: 40px; flex: none; }
.new-row { animation: newrow 1.6s ease; }
@keyframes newrow { from { background: var(--brand-tint); } to { background: transparent; } }

/* capacity bars */
.cap { display: grid; grid-template-columns: 74px minmax(0, 1fr) 128px; gap: 12px; align-items: center; padding: 8px 0; }
.cap b { font-weight: 600; }
.track { height: 10px; border-radius: 99px; background: var(--surface); display: flex; overflow: hidden; }
.track span { height: 100%; transition: width .8s ease; }
.cap .num { text-align: right; color: var(--ink-muted); font-size: 12.5px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.open { background: var(--surface); color: var(--ink-muted); border: 1px solid var(--line); }
.chip.recv { background: var(--brand-tint); color: var(--brand); }
.chip.check { background: var(--pending-tint); color: var(--pending); }
.chip.done { background: var(--brand); color: var(--brand-ink); }
.chip.alert { background: var(--alert-tint); color: var(--alert); }
.com { display: inline-flex; align-items: center; gap: 6px; }
.com::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }

/* table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.tbl th:first-child { border-radius: 8px 0 0 8px; } .tbl th:last-child { border-radius: 0 8px 8px 0; }
.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--surface); }
.tbl .r { text-align: right; }
.tbl .sub { color: var(--ink-muted); font-size: 12.5px; }
.prog { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.prog .track { flex: 1; height: 6px; } .prog .track span { background: var(--brand); }
.tools { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search { flex: 1; min-width: 200px; position: relative; }
.search input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px 0 38px; font: inherit; background: var(--surface-2); color: var(--ink); }
.search i { position: absolute; left: 12px; top: 11px; color: var(--ink-muted); }
.tools .select2-container { min-width: 180px; }
.foot { display: flex; justify-content: space-between; padding-top: 14px; color: var(--ink-muted); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.stat .lbl { color: var(--ink-muted); font-weight: 600; font-size: 13px; }
.stat .fig { font-size: 26px; font-weight: 650; margin-top: 4px; letter-spacing: -.02em; }

/* weighbridge */
.g-bridge { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); align-items: start; }
.cam { position: relative; border-radius: 14px; overflow: hidden; background: var(--shell); aspect-ratio: 1672 / 941; }
.cam img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam .hud { position: absolute; inset: 0; pointer-events: none; color: #fff; font-family: "JetBrains Mono", monospace; font-size: 12px; }
.cam .hud .tl { position: absolute; left: 14px; top: 12px; display: flex; gap: 10px; align-items: center; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.cam .hud .tr { position: absolute; right: 14px; top: 12px; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.rec { display: inline-flex; align-items: center; gap: 6px; } .rec::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--alert); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.anpr { position: absolute; border: 2px solid var(--brand); border-radius: 4px; opacity: 0; transform: scale(1.6); transition: all .45s cubic-bezier(.2,.9,.3,1.2); box-shadow: 0 0 0 9999px rgba(0,0,0,0); }
.anpr.on { opacity: 1; transform: scale(1); box-shadow: 0 0 0 9999px rgba(5,15,25,.28); }
.anpr .tag { position: absolute; right: -2px; bottom: calc(100% + 6px); background: var(--brand); color: var(--brand-ink); padding: 4px 8px; border-radius: 6px; font-weight: 600; white-space: nowrap; font-size: 13px; }
.scan { position: absolute; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--brand), transparent); top: 0; opacity: 0; }
.scan.on { opacity: .9; animation: scan 1.1s ease-in-out 2; }
@keyframes scan { from { top: 30%; } to { top: 90%; } }
.cam-strip { display: flex; gap: 10px; margin-top: 12px; }
.cam-strip .mini { flex: 1; position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 16/9; background: var(--shell); }
.cam-strip .mini img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.cam-strip .mini span { position: absolute; left: 8px; bottom: 6px; color: #fff; font-size: 11px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.cam-strip .mini.off { display: grid; place-items: center; color: var(--shell-muted); font-size: 12px; padding: 0 10px; text-align: center; }

.scale { background: var(--shell); color: var(--shell-ink); border-radius: 14px; padding: 18px 20px; }
.scale .lbl { display: flex; justify-content: space-between; color: var(--shell-muted); font-size: 12.5px; font-weight: 600; }
.scale .kg { font-family: "JetBrains Mono", monospace; font-size: 52px; line-height: 60px; font-weight: 600; letter-spacing: -.02em; margin: 6px 0 2px; }
.scale .kg small { font-size: 20px; color: var(--shell-muted); margin-left: 6px; }
.scale .state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--shell-muted); }
.scale .state.ok { color: var(--brand); }
.scale .split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.scale .split div small { display: block; color: var(--shell-muted); font-size: 11.5px; }
.scale .split div b { font-family: "JetBrains Mono", monospace; font-size: 15px; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--ink-muted); } .kv dd { margin: 0; font-weight: 600; }
.match { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.plate { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; background: #111; color: #fff; border-radius: 5px; font-family: "JetBrains Mono", monospace; font-weight: 600; letter-spacing: .06em; font-size: 14px; }
.plate.sm { height: 22px; padding: 0 7px; font-size: 11.5px; }
.typing::after { content: "▍"; animation: blink .8s infinite; margin-left: 1px; }
.bay-pick { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; background: var(--brand-tint); margin-bottom: 14px; }
.bay-pick .big { font-size: 28px; font-weight: 700; color: var(--brand); letter-spacing: -.02em; }
.bay-pick .why { font-size: 12.5px; color: var(--ink-muted); }
.stack > * + * { margin-top: 16px; }

/* warehouse floor */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 8px; font-weight: 600; color: var(--ink-muted); font-size: 13px; }
.seg button.on { background: var(--surface-2); color: var(--ink); box-shadow: 0 1px 3px rgba(15,29,43,.12); }
.g-floor { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); align-items: start; }
.floor { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.floor .aisle { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; color: var(--ink-muted); font-size: 12px; font-weight: 600; padding: 2px 4px; }
.floor .aisle::after { content: ""; flex: 1; border-top: 2px dashed var(--line); }
.bay { position: relative; height: 104px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; text-align: left; padding: 0; }
.bay .fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--c); opacity: .85; transition: height 1.2s cubic-bezier(.3,.8,.3,1); }
.bay .in { position: relative; padding: 9px 10px; display: flex; flex-direction: column; height: 100%; }
.bay .id { font-weight: 700; font-size: 14px; }
.bay .tn { margin-top: auto; font-size: 12px; font-weight: 600; background: var(--surface-2); align-self: flex-start; padding: 1px 6px; border-radius: 5px; }
.bay.sel { outline: 2px solid var(--ink); outline-offset: 2px; }
.bay.incoming { border-color: var(--brand); }
.bay.incoming::before { content: ""; position: absolute; inset: 0; border: 2px solid var(--brand); border-radius: 10px; animation: blink 1.1s infinite; z-index: 2; }
.bay .flag { position: absolute; right: 8px; top: 8px; z-index: 3; }
.doors { display: flex; gap: 10px; margin-top: 12px; }
.doors span { flex: 1; text-align: center; border: 1px dashed var(--line); border-radius: 8px; padding: 6px; color: var(--ink-muted); font-size: 12px; font-weight: 600; }
.doors span.on { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); border-style: solid; }
.sens { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sens div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.sens small { display: block; color: var(--ink-muted); font-size: 12px; }
.sens b { font-size: 17px; }
.sens .warn { border-color: var(--pending); background: var(--pending-tint); }
.photo { width: 100%; border-radius: 10px; display: block; aspect-ratio: 4/3; object-fit: cover; }

/* drawer + modal */
.scrim { position: fixed; inset: 0; background: rgba(8,18,28,.42); z-index: 60; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface-2); z-index: 61; transform: translateX(105%);
  transition: transform .3s cubic-bezier(.2,.8,.2,1); overflow-y: auto; padding: 24px; box-shadow: -20px 0 40px -20px rgba(0,0,0,.3); }
.drawer.open { transform: none; }
.drawer .dh { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.drawer .dh .icon-btn { margin-left: auto; }
.ring-wrap { display: flex; align-items: center; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; }
.modal { position: fixed; inset: 0; z-index: 62; background: rgba(8,18,28,.32); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal .box { width: min(520px, 100%); background: var(--surface-2); border-radius: 16px; padding: 24px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.35); animation: pop .25s cubic-bezier(.2,.9,.3,1.2); max-height: calc(100vh - 32px); overflow-y: auto; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal .mh { display: flex; align-items: center; margin-bottom: 18px; } .modal .mh .icon-btn { margin-left: auto; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field .hint { margin-top: 6px; font-size: 12.5px; color: var(--ink-muted); }
.field select { width: 100%; }
.modal .acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.view-img { width: 100%; border-radius: 12px; display: block; }

/* select2 in tokens */
.select2-container--default .select2-selection--single, .select2-container--default .select2-selection--multiple { min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 38px; padding-left: 12px; color: var(--ink); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice { background: var(--brand-tint); border: 0; border-radius: 6px; color: var(--brand); font-weight: 600; margin-top: 7px; }
.select2-dropdown { border-color: var(--line); border-radius: 10px; overflow: hidden; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--brand); }
.select2-container--open { z-index: 80; }

/* phone dock */
.dock { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; background: var(--shell); z-index: 50; transform: translateX(100%);
  transition: transform .35s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 14px; }
body.docked .dock { transform: none; }
.dock .seg { background: rgba(255,255,255,.07); border-color: transparent; }
.dock .seg button { color: var(--shell-muted); }
.dock .seg button.on { background: var(--surface-2); color: var(--ink); }
.dock-x { position: absolute; top: 12px; right: 12px; color: var(--shell-muted); }
.dock-x:hover { background: rgba(255,255,255,.08); color: var(--shell-ink); }
.phone { position: relative; width: 340px; height: min(700px, calc(100vh - 90px)); border-radius: 46px; background: var(--surface); border: 10px solid #05090d;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08); overflow: hidden; display: flex; flex-direction: column; }
.notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 96px; height: 26px; background: #05090d; border-radius: 20px; z-index: 5; }
.status { height: 40px; flex: none; display: flex; justify-content: space-between; align-items: center; padding: 6px 26px 0; font-size: 13px; font-weight: 600; }
.screen { flex: 1; overflow-y: auto; position: relative; }
.toast-in { position: absolute; left: 10px; right: 10px; top: 44px; background: color-mix(in srgb, var(--surface-2) 94%, transparent); backdrop-filter: blur(12px); border-radius: 18px; padding: 10px 12px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); transform: translateY(-140%); transition: transform .45s cubic-bezier(.2,.9,.3,1.1); z-index: 6; display: flex; gap: 10px; font-size: 12.5px; }
.toast-in.on { transform: none; }
.toast-in .ic { width: 34px; height: 34px; border-radius: 9px; background: #25d366; color: #fff; display: grid; place-items: center; flex: none; font-size: 18px; }
.toast-in .ic.app { background: var(--brand); }
.toast-in b { display: block; font-size: 12.5px; }

/* phone apps */
.app-h { padding: 10px 18px 14px; }
.app-h small { color: var(--ink-muted); font-weight: 600; font-size: 12px; }
.app-h h3 { margin: 2px 0 0; font-size: 22px; letter-spacing: -.01em; }
.app-b { padding: 0 14px 20px; }
.pcard { background: var(--surface-2); border-radius: 18px; padding: 14px; border: 1px solid var(--line); margin-bottom: 12px; }
.pcard.hero { background: var(--shell); color: var(--shell-ink); border: 0; position: relative; overflow: hidden; }
.pcard.hero .muted { color: var(--shell-muted); }
.pcard.hero img { width: 100%; border-radius: 12px; display: block; margin: 10px 0; aspect-ratio: 16/9; object-fit: cover; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: 11.5px; font-weight: 700; }
.pill.amber { background: var(--pending); color: #fff; }
.big-t { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.pgrid div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; }
.pgrid b { display: block; font-size: 20px; } .pgrid small { color: var(--ink-muted); font-size: 11.5px; font-weight: 600; }
.shot { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 3/4; background: #000; margin-bottom: 12px; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.shot .flash.on { animation: flash .5s; }
@keyframes flash { 10% { opacity: .95; } }
.shot .lbl { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 11.5px; padding: 3px 8px; border-radius: 6px; font-weight: 600; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-muted); }
.empty i { font-size: 34px; display: block; margin-bottom: 8px; color: var(--line); }
.field-p { margin-bottom: 12px; } .field-p label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }

/* WhatsApp look (third-party UI, its own colours) */
.wa { min-height: 100%; background: #efeae2; display: flex; flex-direction: column; }
.wa-h { background: #075e54; color: #fff; padding: 10px 14px; display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 2; }
.wa-h .av { background: rgba(255,255,255,.2); width: 34px; height: 34px; }
.wa-h small { display: block; opacity: .8; font-size: 11.5px; }
.wa-b { padding: 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 86%; background: #fff; color: #111b21; border-radius: 10px; padding: 6px 8px 4px; font-size: 13px; box-shadow: 0 1px 1px rgba(0,0,0,.08); animation: msgin .35s cubic-bezier(.2,.9,.3,1.2); }
.msg img { width: 100%; border-radius: 7px; display: block; margin-bottom: 4px; }
.msg .tm { display: block; text-align: right; font-size: 10.5px; color: #667781; }
.msg b { font-weight: 600; }
.msg .from { color: #075e54; font-weight: 600; font-size: 12px; }
@keyframes msgin { from { transform: translateY(10px) scale(.96); opacity: 0; } }
.day { align-self: center; background: #fff; border-radius: 7px; padding: 3px 10px; font-size: 11.5px; color: #54656f; }

/* demo caption */
.demo { position: fixed; left: calc(232px + (100vw - 232px) / 2); transform: translateX(-50%); bottom: 22px; z-index: 55; background: var(--shell); color: var(--shell-ink);
  border-radius: 99px; padding: 8px 8px 8px 18px; display: flex; align-items: center; gap: 14px; box-shadow: 0 16px 40px -14px rgba(0,0,0,.6); max-width: calc(100vw - 280px); }
body.docked .demo { left: calc(232px + (100vw - 632px) / 2); max-width: calc(100vw - 680px); }
.demo[hidden] { display: none; }
.demo-n { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.demo-t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-dots { display: flex; gap: 5px; } .demo-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--shell-muted); opacity: .4; }
.demo-dots i.on { background: var(--brand); opacity: 1; }
.demo .icon-btn { color: var(--shell-muted); } .demo .icon-btn:hover { background: rgba(255,255,255,.1); color: var(--shell-ink); }

/* skeleton */
.sk { background: linear-gradient(90deg, var(--surface) 25%, var(--line) 50%, var(--surface) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* responsive */
@media (max-width: 1280px) {
  body.docked .main { margin-right: 0; }
  .g-map, .g-bridge, .g-floor { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) { .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); } .step:nth-child(3)::after { display: none; } .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .side { transform: translateX(-100%); } body.menu .side { transform: none; }
  .main { margin-left: 0; } .only-phone { display: inline-grid; }
  .top { padding: 0 16px; } .page { padding: 20px 16px 120px; }
  .g-2 { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .step::after { display: none; }
  .step .fig { font-size: 24px; }
  .demo { left: 50%; max-width: calc(100vw - 24px); bottom: 12px; } body.docked .demo { left: 50%; max-width: calc(100vw - 24px); }
  .dock { width: 100%; } .phone { width: min(340px, 100%); }
  .hide-sm { display: none; }
  .tbl.cards thead { display: none; }
  .tbl.cards tr { display: block; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 6px 4px; }
  .tbl.cards td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 6px 10px; }
  .tbl.cards td::before { content: attr(data-l); color: var(--ink-muted); font-size: 12.5px; }
  .tbl.cards td.r { text-align: right; }
  .tbl.cards td:first-child { display: block; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  .tbl.cards td:first-child::before { display: none; }
  .tools .select2-container { width: 100% !important; }
  .stat .fig { font-size: 22px; }
  .tbl.cards .prog .track { display: none; }
  .tbl.cards .prog { min-width: 0; }
  .floor { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cap { grid-template-columns: 62px minmax(0, 1fr); } .cap .num { grid-column: 2; text-align: left; }
  .scale .kg { font-size: 40px; }
  .map-legend { display: none; } .eta { position: static; margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 1760px) { body.docked .wts { grid-template-columns: repeat(4, minmax(0, 1fr)); } body.docked .flow { gap: 20px; } body.docked .step:not(:last-child)::after { right: -19px; } }
.swal2-popup { font-family: var(--font-body) !important; border-radius: 16px !important; }
.swal2-popup:not(.swal2-toast) .swal2-title { font-size: 22px !important; color: var(--ink) !important; }
.swal2-toast .swal2-title { font-size: 14px !important; font-weight: 600 !important; }
