@font-face { font-family: 'Schibsted Grotesk'; src: url(../demo/fonts/schibsted-grotesk-latin-wght-normal.woff2) format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url(../demo/fonts/instrument-serif-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }

:root {
    --bg: #efeee9;
    --card: #fbfbf8;
    --step: #e4e2da;
    --step2: #d4d1c6;
    --ink: #1d211f;
    --ink2: #505751;
    --muted: #7c827c;
    --green: #22473c;
    --green2: #2d5a4c;
    --greenbg: #dfe9e2;
    --amber: #9a5d12;
    --amberbg: #f6e8cf;
    --red: #9b3520;
    --redbg: #f5dfd7;
    --blue: #2a5a8c;
    --bluebg: #dde7f1;
    --sans: 'Schibsted Grotesk', system-ui, sans-serif;
    --serif: 'Instrument Serif', serif;
    --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
.tab { font-variant-numeric: lining-nums; }

.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: #c9ccc6; padding: 20px 14px; display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: #f0efe9; text-decoration: none; padding: 0 8px; }
.brand b { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1; display: block; }
.brand small { font-size: 12px; color: #8f948e; display: block; }
.snav { display: grid; gap: 2px; }
.snav button { display: flex; align-items: center; gap: 12px; border: 0; background: none; color: #c9ccc6; padding: 10px 10px; border-radius: 8px; text-align: left; font-weight: 500; }
.snav button:hover { background: #2a2f2c; }
.snav button[aria-current="page"] { background: #f0efe9; color: var(--ink); }
.snav i { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; background: #3a403c; color: #f0efe9; border-radius: 999px; padding: 1px 8px; }
.snav i:empty { display: none; }
.snav i.warn { background: #6b4a1c; color: #ffe2b8; }
.snav button[aria-current="page"] i { background: var(--ink); color: #fff; }
.side-foot { margin-top: auto; display: grid; gap: 16px; }
.side-foot > a { font-size: 13px; color: #a8ada6; padding: 0 10px; }
.me { display: flex; gap: 10px; align-items: center; padding: 10px; background: #2a2f2c; border-radius: 10px; }
.av { width: 32px; height: 32px; border-radius: 50%; background: #c9d3a8; color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.me b { display: block; color: #f0efe9; font-weight: 600; font-size: 13px; }
.me small { color: #8f948e; font-size: 12px; }

.main { padding: 26px 32px 64px; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.head h1 { font-size: 26px; }
.head p { color: var(--ink2); margin-top: 2px; }
.head .acts { display: flex; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: var(--green); color: #f3f2ec; padding: 9px 14px; border-radius: 8px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--green2); }
.btn.sec { background: var(--step); color: var(--ink); }
.btn.sec:hover { background: var(--step2); }
.btn.lg { padding: 12px 18px; font-size: 15px; }
.btn[disabled] { background: var(--step); color: var(--muted); cursor: not-allowed; }
.btn.done { background: var(--greenbg); color: var(--green); cursor: default; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border-radius: 12px; padding: 16px 18px; }
.kpi span { color: var(--ink2); font-size: 13px; }
.kpi b { display: block; font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin: 2px 0; }
.kpi small { font-size: 12px; color: var(--muted); }
.kpi small.up { color: var(--green); }
.kpi small.warn { color: var(--amber); }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; margin-top: 16px; }
.box { background: var(--card); border-radius: 12px; padding: 18px; }
.box + .box { margin-top: 16px; }
.box-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.box-h h2 { font-size: 16px; }
.box-h p { color: var(--ink2); font-size: 13px; }
.seg { display: inline-flex; background: var(--step); border-radius: 8px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); }

.otable { width: 100%; border-collapse: collapse; }
.otable th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 10px; }
.otable td { padding: 11px 10px; vertical-align: middle; background: var(--bg); }
.otable tr td:first-child { border-radius: 8px 0 0 8px; }
.otable tr td:last-child { border-radius: 0 8px 8px 0; text-align: right; }
.otable { border-spacing: 0 6px; border-collapse: separate; margin-top: -6px; }
.otable tr.fresh td { background: #e5eee8; }
.otable .id { font-weight: 600; white-space: nowrap; }
.otable td.items { min-width: 220px; }
.otable .who b { display: block; }
.otable small { color: var(--ink2); font-size: 12px; }
.otable .items { color: var(--ink2); max-width: 260px; }
.otable .amt { font-weight: 600; text-align: right; }
.ship-i { display: inline-flex; align-items: center; gap: 6px; color: var(--ink2); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.awaiting { background: var(--amberbg); color: var(--amber); }
.pill.topack { background: var(--bluebg); color: var(--blue); }
.pill.labelled { background: #ece4f1; color: #5f3d7a; }
.pill.shipped, .pill.collected { background: var(--greenbg); color: var(--green); }
.pill.collect { background: #efe9d8; color: #6a5a1c; }
.newtag { font-size: 11px; font-weight: 700; background: var(--green); color: #fff; padding: 1px 6px; border-radius: 4px; margin-left: 6px; }

.alerts { display: grid; gap: 8px; }
.alert { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--bg); padding: 10px; border-radius: 10px; }
.alert .sw { width: 40px; height: 40px; border-radius: 8px; position: relative; overflow: hidden; }
.alert b { display: block; font-weight: 600; }
.alert small { color: var(--ink2); font-size: 12px; }
.alert .n { font-weight: 700; font-size: 13px; }
.alert .n.zero { color: var(--red); }
.alert .n.low { color: var(--amber); }
.alert .btn { padding: 6px 10px; font-size: 12px; }

.chart { position: relative; }
.chart svg { width: 100%; height: 220px; display: block; overflow: visible; }
.chart .bar { fill: #9fb5a8; transition: fill .15s; }
.chart .bar.wk { fill: #6f8f7f; }
.chart .bar.today { fill: var(--green); }
.chart .bar:hover, .chart .bar.hl { fill: var(--ink); }
.chart .grid { stroke: var(--step); stroke-width: 1; }
.chart text { font-size: 11px; fill: var(--muted); font-family: var(--sans); }
.chart .note { fill: var(--ink2); font-weight: 600; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: #f3f2ec; font-size: 12px; padding: 6px 9px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -100%); opacity: 0; transition: opacity .12s; }
.tip b { display: block; font-size: 13px; }
.chart-sum { display: flex; gap: 24px; margin-bottom: 10px; }
.chart-sum b { display: block; font-size: 20px; font-weight: 600; }
.chart-sum span { color: var(--ink2); font-size: 12px; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 0; background: var(--card); padding: 7px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--ink2); }
.tabs button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.tabs button i { font-style: normal; opacity: .7; margin-left: 4px; }

.stable { width: 100%; border-collapse: separate; border-spacing: 0 6px; margin-top: -6px; }
.stable th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 10px; }
.stable td { background: var(--bg); padding: 9px 10px; }
.stable tr td:first-child { border-radius: 8px 0 0 8px; }
.stable tr td:last-child { border-radius: 0 8px 8px 0; }
.glz { display: inline-flex; align-items: center; gap: 8px; }
.glz i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.stepper { display: inline-flex; align-items: center; background: var(--card); border-radius: 8px; }
.stepper button { border: 0; background: none; width: 30px; height: 30px; font-size: 16px; }
.stepper span { min-width: 28px; text-align: center; font-weight: 700; }
.lvl { height: 6px; background: var(--step); border-radius: 3px; overflow: hidden; width: 120px; }
.lvl i { display: block; height: 100%; background: var(--green); }
.lvl.low i { background: #c27a2c; }
.lvl.zero i { background: var(--red); }

/* panel */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(18, 20, 18, .35); opacity: 0; transition: opacity .25s; }
.scrim.on { opacity: 1; }
.panel { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--bg); transform: translateX(100%); transition: transform .35s var(--ease); display: flex; flex-direction: column; }
.panel.on { transform: none; }
.p-head { padding: 18px 22px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; background: var(--card); }
.p-head h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.p-head p { color: var(--ink2); margin-top: 2px; }
.x { width: 34px; height: 34px; border: 0; border-radius: 8px; background: var(--step); display: grid; place-items: center; flex: none; }
.p-body { flex: 1; overflow-y: auto; padding: 18px 22px 28px; display: grid; gap: 14px; align-content: start; }
.p-sec { background: var(--card); border-radius: 12px; padding: 14px 16px; }
.p-sec h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.addr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.addr b { display: block; }
.addr span { color: var(--ink2); }
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.flow > li { background: var(--card); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.flow .n { width: 28px; height: 28px; border-radius: 50%; background: var(--step); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.flow li.done .n { background: var(--green); color: #fff; }
.flow li.cur .n { background: var(--ink); color: #fff; }
.flow li.lock { opacity: .55; }
.flow h4 { margin: 3px 0 8px; font-size: 15px; }
.flow p { color: var(--ink2); font-size: 13px; margin-bottom: 10px; }
.pick { display: grid; gap: 6px; }
.pick label { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; background: var(--bg); padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.pick input { width: 18px; height: 18px; accent-color: var(--green); margin: 0; }
.pick label:has(input:checked) span { text-decoration: line-through; color: var(--muted); }
.pick small { color: var(--ink2); }
.trk { margin-top: 8px; font-size: 13px; background: var(--greenbg); color: var(--green); padding: 8px 10px; border-radius: 8px; font-weight: 600; }

/* label modal */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(18, 20, 18, .55); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal-in { background: var(--card); border-radius: 14px; padding: 20px; width: min(460px, 100%); }
.modal-in h3 { font-size: 17px; margin-bottom: 4px; }
.modal-in > p { color: var(--ink2); margin-bottom: 14px; }
.label { background: #fff; color: #000; border: 2px solid #000; aspect-ratio: 100 / 150; max-height: 62vh; margin: 0 auto; display: grid; grid-template-rows: auto auto 1fr auto auto; font-family: Arial, Helvetica, sans-serif; font-size: 11px; }
.label > div { padding: 8px 10px; border-bottom: 2px solid #000; }
.label > div:last-child { border-bottom: 0; }
.lb-top { display: flex; justify-content: space-between; align-items: center; }
.lb-top b { font-size: 22px; font-weight: 900; letter-spacing: -.02em; }
.lb-top span { font-size: 26px; font-weight: 900; border: 2px solid #000; padding: 0 8px; }
.lb-from { font-size: 10px; line-height: 1.3; }
.lb-to { font-size: 14px; line-height: 1.35; }
.lb-to small { font-size: 10px; display: block; margin-bottom: 4px; }
.lb-to b { font-size: 16px; }
.lb-to .pc { font-size: 22px; font-weight: 900; margin-top: 4px; display: block; }
.lb-bar { text-align: center; }
.lb-bar svg { width: 100%; height: 64px; display: block; }
.lb-bar b { font-size: 13px; letter-spacing: .12em; display: block; margin-top: 4px; }
.lb-meta { display: flex; justify-content: space-between; font-size: 10px; }
.modal-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; align-items: center; }
.modal-acts .st { margin-right: auto; font-size: 13px; color: var(--ink2); display: flex; gap: 8px; align-items: center; }
.spin { width: 16px; height: 16px; border: 2px solid var(--step2); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; z-index: 70; left: 50%; bottom: 22px; transform: translate(-50%, calc(100% + 40px)); visibility: hidden; background: var(--ink); color: #f3f2ec; padding: 11px 16px; border-radius: 10px; font-size: 13px; transition: transform .3s var(--ease), visibility .3s; max-width: calc(100% - 32px); display: flex; gap: 8px; align-items: center; }
.toast.on { transform: translate(-50%, 0); visibility: visible; }
.ribbon { position: fixed; z-index: 35; right: 12px; bottom: 12px; background: rgba(29, 33, 31, .86); color: #eceae3; font-size: 11px; font-weight: 600; padding: 5px 9px; border-radius: 4px; text-decoration: none; }

.fade { animation: fd .35s var(--ease) both; }
@keyframes fd { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 1180px) {
    .cols { grid-template-columns: 1fr; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: sticky; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 8px; }
    .brand small, .side-foot { display: none; }
    .brand b { font-size: 24px; }
    .snav { display: flex; margin-left: auto; gap: 2px; }
    .snav button { padding: 8px; }
    .snav button span { display: none; }
    .snav i { margin-left: 0; }
    .main { padding: 18px 14px 64px; }
    .head { flex-direction: column; align-items: flex-start; }
    .kpi b { font-size: 22px; }
    .otable thead { display: none; }
    .otable, .otable tbody, .otable tr, .otable td { display: block; width: 100%; }
    .otable tr { display: grid; grid-template-columns: 1fr auto; background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; gap: 4px 10px; }
    .otable td { background: none !important; padding: 0; border-radius: 0 !important; text-align: left !important; }
    .otable td.items { grid-column: 1 / -1; max-width: none; }
    .otable td:last-child { grid-column: 1 / -1; }
    .otable td:last-child .btn { width: 100%; margin-top: 6px; }
    .stable thead { display: none; }
    .stable, .stable tbody, .stable tr, .stable td { display: block; }
    .stable tr { display: grid; grid-template-columns: 1fr auto; background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; gap: 6px; }
    .stable td { background: none; padding: 0; }
    .stable td.hide-m { display: none; }
    .addr { grid-template-columns: 1fr; }
    .chart svg { height: 180px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
