/* Order Hub - one stylesheet. Colors and sizes are tokens at the top: change them here and every page follows. */
:root {
  --bg: #F3F5F7;
  --card: #FFFFFF;
  --ink: #16202E;
  --ink-2: #3C4656;
  --muted: #5B6778;
  --line: #E3E8EE;
  --line-2: #D5DCE4;
  --primary: #0E7C66;
  --primary-dark: #095B4A;
  --primary-soft: #E5F3EF;
  --warn-bg: #FFF1C9; --warn-ink: #7A5200;
  --bad-bg: #FBE4E4;  --bad-ink: #8A2A2A;
  --radius: 14px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(22,32,46,.06), 0 8px 24px rgba(22,32,46,.06);
  --font: 'Plus Jakarta Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
h1, h2, h3, p { margin: 0; }
code { background: #EEF1F4; padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; display: block; }
/* the menu is a drawer on every screen: closed = the page gets the whole width */
.side { position: fixed; z-index: 90; left: 0; top: 0; bottom: 0; width: 286px; max-width: 86vw; background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; transform: translateX(-102%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; box-shadow: none; overflow-y: auto; }
.side.open { transform: none; visibility: visible; transition: transform .22s ease; box-shadow: 0 0 40px rgba(16,24,40,.22); }
.scrim { position: fixed; inset: 0; z-index: 85; background: rgba(16,24,40,.38); }
.nav-close { margin-left: auto; }
.nav-toggle { position: relative; width: 42px; height: 42px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--card); border-radius: 12px; color: var(--ink); cursor: pointer; }
.nav-toggle:hover { border-color: var(--line-2); }
.nav-dot { position: absolute; top: 7px; right: 7px; width: 10px; height: 10px; border-radius: 50%; background: #D14343; border: 2px solid var(--card); }
.bar-title { font-weight: 700; font-size: 15px; letter-spacing: -.01em; margin: 0 4px 0 12px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-center { justify-content: center; margin-bottom: 18px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { padding: 11px 12px; border-radius: var(--radius-s); color: var(--ink-2); font-weight: 500; text-decoration: none; }
.nav-item:hover { background: #F3F5F7; color: var(--ink); }
.nav-item.on { background: var(--primary-soft); color: var(--ink); font-weight: 600; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 8px; }
.me { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.link-quiet { color: var(--muted); font-size: 13px; }
.main { flex: 1 1 0; min-width: 0; padding: 26px 30px 70px; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { margin-top: 4px; max-width: 640px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 16px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: #fff; color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #F8FAFB; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { color: var(--bad-ink); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn-small { min-height: 34px; padding: 4px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
input[type=text], input[type=search], input[type=tel], input[type=number], input[type=password], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: #fff;
}
textarea { resize: vertical; }
.field { display: block; margin-bottom: 14px; }
.field > span, .label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.alert { background: var(--bad-bg); color: var(--bad-ink); padding: 10px 12px; border-radius: var(--radius-s); margin-bottom: 14px; font-weight: 500; }

/* ---------- login ---------- */
.oh-bare { display: block; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 28px 24px; }
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 18px; text-align: center; }

/* ---------- tabs / toolbar ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; min-height: 38px; }
.tab .count { margin-left: 6px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab.on .count { color: #C9D1DA; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.toolbar .search { flex: 1 1 260px; min-width: 200px; }
.toolbar select { width: auto; min-width: 150px; }
.toolbar .extra { display: contents; }
.filters-toggle { display: none; }
.toolbar .date { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
.toolbar .date input { width: 150px; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--primary-soft); border: 1px solid #BFE0D7; border-radius: var(--radius-s); padding: 10px 14px; font-weight: 600; }
.more { display: flex; justify-content: center; }

/* ---------- order cards ---------- */
.list { display: flex; flex-direction: column; gap: 12px; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); background: var(--card); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.order { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; transition: opacity .25s, transform .25s; }
.order.repeat { background: #FFFBEF; border-color: #F1DFA6; }
.order.blacklisted { background: #FFF4F4; border-color: #F0BDBD; }
.order.leaving { opacity: 0; transform: translateX(14px); }
.order.saving { opacity: .75; }
.o-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.o-head .status { width: auto; min-width: 190px; font-weight: 600; border-radius: 999px; padding: 6px 12px; min-height: 38px; border: 0; cursor: pointer; }
.o-id { font-weight: 700; font-variant-numeric: tabular-nums; }
.o-meta { color: var(--muted); font-size: 12.5px; }
.o-spacer { flex: 1 1 auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #EEF1F4; color: var(--ink-2); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip-warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip-bad { background: var(--bad-bg); color: var(--bad-ink); }
.chip-ok { background: #DDF3E8; color: #0B6B45; }
.chip-source { background: #E1ECFB; color: #1F4E8C; }
.o-head select.assign { width: auto; min-width: 150px; min-height: 34px; padding: 4px 10px; font-size: 13px; }
.icon-btn { border: 1px solid var(--line-2); background: #fff; border-radius: 8px; min-height: 34px; padding: 4px 10px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.icon-btn:hover { background: #F8FAFB; }
/* compact order row: one shared column template for the header labels and every card */
.list { --cols: 150px minmax(140px, 1.3fr) 190px minmax(190px, 1.4fr) 52px 84px; --gap: 10px; }
.cols { display: grid; grid-template-columns: var(--cols); gap: var(--gap); padding: 0 17px 2px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cols .r { text-align: right; }
.fields { display: grid; grid-template-columns: var(--cols); gap: var(--gap); align-items: start; }
.fields input, .fields .btn-small { min-height: 34px; height: 34px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.fields > * { min-width: 0; }
.label-m { display: none; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
.o-name { font-weight: 700; font-size: 13.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-phone { display: flex; align-items: center; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.o-phone .num { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; }
.o-phone .num.bad { color: var(--bad-ink); }
.wa { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; background: #25D366; color: #fff !important; font-weight: 700; font-size: 11px; text-decoration: none; }
.wa:hover { background: #1DB954; }
.f-city .raw { font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-city .raw strong { color: var(--ink); }
.f-city .row2 { display: flex; gap: 6px; align-items: center; }
.f-city .row2 input { flex: 1 1 0; width: auto; min-width: 0; }
.f-city .row2 .btn { flex: none; }
.items { grid-column: 4 / 7; display: grid; grid-template-columns: 1fr 52px 84px; gap: 8px var(--gap); align-items: start; }
.items .prod { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; align-items: center; min-height: 34px; }
.items .prod .pn { font-weight: 600; font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.items .qty { text-align: center; padding: 4px 2px; }
.items .price { text-align: right; font-weight: 700; padding: 4px 8px; }
.o-note { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 8px; }
.o-note > input[data-f=note] { flex: 1 1 160px; max-width: 280px; min-height: 28px; height: 28px; padding: 3px 10px; font-size: 12.5px; border-radius: 8px; }
.o-note > input.team-note { flex: 1 1 160px; max-width: 280px; min-height: 28px; height: 28px; padding: 3px 10px; font-size: 12.5px; border-radius: 8px; background: #FFFBEA; border-color: #EBDDA0; }
.sv-tn input.team-note { width: 100%; min-height: 30px; height: 30px; padding: 3px 9px; font-size: 12.5px; border-radius: 8px; background: #FFFBEA; border-color: #EBDDA0; }
.cbk { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cbk input { width: auto; min-height: 30px; height: 30px; padding: 3px 8px; font-size: 12.5px; border-radius: 8px; }
.cust-note { flex: 1 1 220px; font-size: 12px; color: var(--ink-2); background: #F8FAFB; border-radius: 6px; padding: 5px 9px; }

/* city picker (one floating list, shared by every city field) */
.city-pop { position: fixed; z-index: 120; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 12px 32px rgba(22,32,46,.18); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 4px; }
.cp-item { padding: 9px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.cp-item.hi, .cp-item:hover { background: var(--primary-soft); }
.cp-empty { padding: 10px; color: var(--muted); font-size: 13px; }

/* ---------- panels, rows, switches ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-size: 16px; font-weight: 600; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-head > div { flex: 1 1 320px; min-width: 0; }
.panel-head > .btn { flex: none; }
.rows { display: flex; flex-direction: column; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 0; border-bottom: 1px solid #EEF1F4; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1 1 200px; min-width: 0; }
.row .title { font-weight: 600; }
.person { display: flex; align-items: center; gap: 12px; }
.person .avatar { width: 38px; height: 38px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #C9D1DA; transition: background .15s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { left: 21px; }
.switch input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 2px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; }
.inline-form input { flex: 1 1 200px; width: auto; }
.inline-form select { max-width: 360px; }
.save-row { display: flex; justify-content: flex-end; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(22,32,46,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(22,32,46,.3); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 18px 22px; overflow: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: #EEF1F4; gap: 4px; }
.seg button { min-height: 36px; padding: 6px 16px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-weight: 500; cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(22,32,46,.12); }
.prow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.3fr) 60px 90px 34px; gap: 8px; margin-bottom: 8px; align-items: center; }
.opt-box { background: #F8FAFB; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.checks label { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.checks input { width: 18px; height: 18px; accent-color: var(--primary); }
.log { list-style: none; margin: 0; padding: 0; }
.log li { padding: 10px 0; border-bottom: 1px solid #EEF1F4; }
.log li:last-child { border-bottom: 0; }
.log .when { color: var(--muted); font-size: 12px; }


/* ---------- products ---------- */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 8px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11.5px; font-weight: 700; }
.toolbar .seg { flex: none; }
.prod-list { --pcols: minmax(200px, 1fr) 72px 84px 64px 64px 112px 170px; }
.pr-cols { grid-template-columns: var(--pcols); padding: 0 17px 2px; }
.prod-row { display: grid; grid-template-columns: var(--pcols); gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(22,32,46,.06); padding: 10px 16px; }
.prod-row.is-new { border-color: #BFE0D7; background: #FAFEFC; }
.pr-name { font-weight: 700; font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.pr-vars { margin-top: 2px; }
.prod-row .st { font-variant-numeric: tabular-nums; }
.prod-row .st b { font-size: 14px; }
.prod-row .st .lbl { display: none; font-size: 11px; font-weight: 700; color: var(--muted); }
.pr-act { display: flex; gap: 6px; justify-content: flex-end; }
.vchips { display: flex; flex-wrap: wrap; gap: 6px; }
.vchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; background: #EEF1F4; font-size: 13px; font-weight: 600; }
.vchip button { border: 0; background: transparent; cursor: pointer; color: var(--muted); width: 22px; height: 22px; border-radius: 50%; }
.vchip button:hover { background: #dfe4ea; }

/* ---------- phone sheet for pickers ---------- */
.no-scroll { overflow: hidden; }
.sheet { position: fixed; inset: 0; z-index: 200; background: #fff; }
.sheet-box { display: flex; flex-direction: column; width: 100%; height: 100%; background: #fff; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.sheet .sheet-q { margin: 10px 14px; width: calc(100% - 28px); font-size: 16px; min-height: 46px; }
.sheet-list { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 8px 20px; }
.sheet .cp-item { padding: 14px 12px; font-size: 16px; border-bottom: 1px solid #F0F3F6; border-radius: 0; }
.sheet .cp-special { font-weight: 600; color: var(--primary-dark); }


/* ---------- Ozon page (same column order as the old sheet) ---------- */
.oz-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.oz-meta a.chip { text-decoration: none; }
.ship-list { --scols: 84px minmax(90px, 1fr) 100px minmax(110px, 1.3fr) 56px 100px minmax(80px, 1fr) minmax(110px, 1.2fr) 128px 100px; }
.ship-cols { grid-template-columns: var(--scols); padding: 0 17px 2px; }
.ship-row { display: grid; grid-template-columns: var(--scols); gap: 10px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(22,32,46,.06); padding: 10px 16px; font-size: 12.5px; line-height: 1.35; }
.ship-row.is-bad { background: #FFF8F8; border-color: #F0BDBD; }
.ship-row.is-ok { background: #F6FCF9; border-color: #BFE0D7; }
.ship-row .sc { min-width: 0; overflow-wrap: anywhere; }
.ship-row .sc-code { display: flex; flex-direction: column; }
.ship-row .num { font-variant-numeric: tabular-nums; }
.ship-row .r, .ship-cols .r { text-align: right; }
.ship-row .miss { color: var(--bad-ink); font-weight: 600; }
.ship-row .act { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.ship-row .act .btn { min-height: 30px; height: 30px; padding: 2px 10px; font-size: 12px; }
.ship-row .chip { font-size: 11.5px; white-space: normal; }
.progress { height: 8px; background: #EEF1F4; border-radius: 999px; overflow: hidden; margin: 10px 0 14px; }
.progress span { display: block; height: 100%; background: var(--primary); transition: width .25s; }

/* ---------- Suivi page ---------- */
.suivi-list { --vcols: 170px 100px minmax(140px, 1.1fr) 62px minmax(170px, 1.2fr) 104px minmax(150px, 1fr) minmax(190px, 1fr); }
.sv-cols { grid-template-columns: var(--vcols); padding: 0 17px 2px; }
.sv-cols .r, .suivi-row .r { text-align: right; }
.suivi-row { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(22,32,46,.06); padding: 10px 16px; font-size: 13px; }
.suivi-row .o-head { margin-bottom: 8px; }
.sv-fields { display: grid; grid-template-columns: var(--vcols); gap: 10px; align-items: start; }
.sv-fields > * { min-width: 0; overflow-wrap: anywhere; }
.sv-prod { font-weight: 600; line-height: 1.3; }
.sv-comment { margin-top: 4px; color: var(--ink-2); }
.sv-follow select, .sv-follow input { min-height: 34px; height: 34px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.sv-follow select { border: 0; font-weight: 600; border-radius: 999px; }
.sv-follow input { margin-top: 6px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 80; width: calc(100% - 32px); max-width: 380px; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 500; }
.toast.err { background: #B42323; }

/* ---------- phone ---------- */
@media (max-width: 1320px) {
  .ship-cols, .sv-cols { display: none; }
  .ship-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ship-row .label-m { display: block; }
  .ship-row .sc-code, .ship-row .act { grid-column: 1 / -1; }
  .ship-row .act { flex-direction: row; }
  .ship-row .r { text-align: left; }
  .sv-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sv-fields .label-m { display: block; }
  .sv-fields .f-cust, .sv-fields .sv-follow, .sv-fields .sv-tn { grid-column: 1 / -1; }
  .suivi-row .r { text-align: left; }
}
@media (max-width: 1120px) {
  .pr-cols { display: none; }
  .prod-row { grid-template-columns: repeat(5, 1fr); gap: 10px 8px; }
  .prod-row .pr-main, .prod-row .pr-act { grid-column: 1 / -1; }
  .prod-row .st .lbl { display: block; }
  .pr-act { justify-content: flex-start; }
  .cols { display: none; }
  .fields { grid-template-columns: 1fr 1fr; gap: 10px; }
  .f-cust, .f-addr, .items { grid-column: 1 / -1; }
  .f-cust { grid-column: auto; } .f-addr { grid-column: auto; }
  .label-m { display: block; }
  .items { grid-template-columns: 1fr 1fr; }
  .items .prod { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .items .prod .label-m { grid-column: 1 / -1; margin-bottom: 0; }
  .items .f-price:empty { display: none; }
}
@media (max-width: 820px) {
  input, select, textarea, .fields input, .o-note > input[data-f=note], .o-note > input.team-note, .sv-tn input, .cbk input { font-size: 16px; }
  .prod-row { grid-template-columns: 1fr 1fr 1fr; }
  .ship-row, .sv-fields { grid-template-columns: 1fr 1fr; }
  .ship-row .sc:nth-child(2), .ship-row .sc:nth-child(4), .ship-row .sc:nth-child(8), .ship-row .sc:nth-child(9) { grid-column: 1 / -1; }
  .sv-fields > :nth-child(3), .sv-fields > :nth-child(5) { grid-column: 1 / -1; }
  .sv-follow select, .sv-follow input { font-size: 16px; }
  .main { padding: 14px 14px 40px; }
  .page-head h1 { font-size: 22px; }
  .filters-toggle { display: inline-flex; }
  .toolbar .search { flex: 1 1 0; min-width: 0; }
  .toolbar .extra { display: none; width: 100%; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
  .toolbar.open .extra { display: flex; }
  .toolbar .extra select { width: 100%; }
  .toolbar .date { flex: 1 1 140px; }
  .toolbar .date input { width: 100%; }
  .f-cust, .f-addr, .f-city { grid-column: 1 / -1; }
  .o-note > input[data-f=note], .o-note > input.team-note { max-width: none; flex-basis: 100%; }
  .o-head .status { width: 100%; }
  .grid2 { grid-template-columns: 1fr; }
  .prow { grid-template-columns: 1fr 1fr 60px 80px 34px; }
}
@media (max-width: 520px) {
  .prow { grid-template-columns: 1fr 1fr; }
  .modal-back { align-items: flex-end; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------------- Retours (returned parcels) ---------------- */
.nav-badge-red { background: #D14343; }
.rt-scan { gap: 14px; }
.rt-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rt-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.rt-manual { display: flex; gap: 8px; flex: 1 1 280px; }
.rt-manual input, #rt-note { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: #fff; font-size: 16px; }
#rt-note { width: 100%; }
.rt-cam { position: relative; border-radius: var(--radius); overflow: hidden; background: #0B1118; max-width: 520px; width: 100%; aspect-ratio: 4 / 3; }
.rt-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rt-frame { position: absolute; inset: 18% 22%; border: 3px solid rgba(255,255,255,.9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.28); pointer-events: none; }
.rt-cam-stop { position: absolute; right: 10px; bottom: 10px; background: rgba(255,255,255,.92); }
.rt-result { border-radius: var(--radius); padding: 14px 16px; border: 2px solid transparent; }
.rt-result.ok { background: #DDF3E8; border-color: #3FB37F; color: #0B4F35; }
.rt-result.warn { background: var(--warn-bg); border-color: #E3B341; color: var(--warn-ink); }
.rt-result.bad { background: var(--bad-bg); border-color: #D96B6B; color: var(--bad-ink); }
.rt-result .rt-big { font-size: 18px; font-weight: 700; }
.rt-result .rt-line { margin-top: 4px; font-size: 14px; }
.rt-list { display: flex; flex-direction: column; gap: 8px; }
.rt-row { display: grid; grid-template-columns: 150px minmax(0, 1.6fr) 130px 160px auto; gap: 8px 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.rt-row.is-late { border-color: #E0A0A0; background: #FFF8F8; }
.rt-row .rt-ref { font-weight: 700; }
.rt-row .rt-trk { color: var(--muted); font-size: 12px; word-break: break-all; }
.rt-row .rt-prod { font-size: 13.5px; }
.rt-row .rt-days { font-weight: 600; font-variant-numeric: tabular-nums; }
.rt-row .rt-days.late { color: #B42318; }
.rt-chips { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .rt-row { grid-template-columns: 1fr auto; }
  .rt-row > :nth-child(2) { grid-column: 1 / -1; }
  .rt-cam { max-width: none; }
  .rt-actions .btn-primary { flex: 1 1 100%; min-height: 48px; justify-content: center; }
}

/* ---------------- Remboursements ---------------- */
.rf-list { display: flex; flex-direction: column; gap: 8px; }
.rf-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) 120px minmax(0, 1.2fr) auto; gap: 8px 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.rf-row .rf-ref { font-weight: 700; }
.rf-row .rf-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.rf-row .rf-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 820px) {
  .rf-row { grid-template-columns: 1fr auto; }
  .rf-row > :nth-child(2), .rf-row > :nth-child(4), .rf-row > :nth-child(5) { grid-column: 1 / -1; }
  .rf-row .rf-act { justify-content: flex-start; }
}

/* ---------------- Commissions ---------------- */
.cm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.cm-card { text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.cm-card.on { border-color: var(--primary); box-shadow: var(--shadow); }
.cm-card .cm-who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.cm-card .cm-due { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.cm-card .cm-due small { font-size: 14px; font-weight: 600; color: var(--muted); }
.cm-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cm-table { width: 100%; border-collapse: collapse; }
.cm-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.cm-table td { padding: 9px 8px; border-bottom: 1px solid #EEF1F4; vertical-align: top; }
.cm-table td.r, .cm-table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.cm-pos { color: #0B6B45; font-weight: 600; } .cm-neg { color: #B42318; font-weight: 600; }
.cm-rates { overflow: auto; max-height: 56vh; border: 1px solid var(--line); border-radius: var(--radius-s); }
.cm-rates table { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.cm-rates th { position: sticky; top: 0; background: #F7F9FB; z-index: 1; }
.cm-rates td:first-child, .cm-rates th:first-child { position: sticky; left: 0; background: #fff; min-width: 160px; }
.cm-rates th:first-child { background: #F7F9FB; z-index: 2; }
.cm-rates input { width: 78px; min-height: 38px; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 16px; text-align: right; }
@media (max-width: 820px) { .cm-card .cm-due { font-size: 24px; } .cm-table td, .cm-table th { padding: 8px 4px; } }


/* ============ store bar: which store am I working in ============ */
body.oh-app::before { content: ""; position: fixed; left: 0; right: 0; top: 0; height: 3px; background: var(--store, var(--primary)); z-index: 60; }
.store-bar { position: relative; display: flex; align-items: center; margin: 0 0 6px; }
.store-bar .store-btn { margin-left: auto; }
.store-btn { display: inline-flex; align-items: center; gap: 9px; padding: 7px 12px 7px 10px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.store-btn:disabled { cursor: default; }
.store-btn:not(:disabled):hover { border-color: var(--sc, var(--line)); }
.store-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sc, var(--primary)); flex: none; }
.store-caret { color: var(--ink-3, #8693A1); }
.store-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 70; min-width: 230px; max-width: 86vw; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 34px rgba(16, 24, 40, .16); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.store-menu[hidden] { display: none; }
.store-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none; border-radius: 10px; font: inherit; font-weight: 500; font-size: 14px; color: var(--ink); text-align: left; cursor: pointer; text-decoration: none; }
.store-item:hover { background: #F3F5F7; }
.store-item.on { background: var(--primary-soft); font-weight: 600; }
.store-manage { color: var(--ink-2); border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; font-size: 13px; }

/* ---------- stores page ---------- */
.store-card { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--sc, var(--primary)); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.store-card.off { opacity: .6; }
.sc-main { flex: 1 1 240px; min-width: 0; }
.sc-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sc-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.color-row { display: flex; flex-wrap: wrap; gap: 8px; }
.color-row label { cursor: pointer; }
.color-row input { position: absolute; opacity: 0; pointer-events: none; }
.color-row span { display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-2); }
.color-row input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.copy-box { display: flex; gap: 8px; align-items: center; }
.copy-box input { flex: 1; font-family: ui-monospace, monospace; font-size: 12.5px; }

/* ---------- stock page ---------- */
.sk-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.sk-kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.sk-kpi .lbl { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.sk-kpi b { font-size: 22px; font-variant-numeric: tabular-nums; }
.sk-kpi.bad b { color: var(--bad-ink); }
.sk-kpi.warn b { color: var(--warn-ink); }
.sk-prod { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.sk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; cursor: pointer; }
.sk-head .nm { font-weight: 700; flex: 1 1 160px; min-width: 0; }
.sk-big { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sk-sub { font-size: 12px; color: var(--muted); }
.sk-vars { border-top: 1px solid var(--line); }
.sk-var { display: grid; grid-template-columns: minmax(100px, 1.4fr) repeat(4, minmax(48px, .7fr)); gap: 8px; padding: 9px 16px; align-items: center; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.sk-var:last-child { border-bottom: 0; }
.sk-var.hd { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; background: #F8FAFB; }
.sk-var .num { text-align: right; }
.sk-var .av-bad { color: var(--bad-ink); font-weight: 700; }
.sk-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); background: #F8FAFB; }
.sk-line { display: grid; grid-template-columns: 1fr 1fr 90px 34px; gap: 8px; margin-bottom: 8px; }
.sk-start-row { display: grid; grid-template-columns: 1fr 90px; gap: 8px; align-items: center; margin-bottom: 6px; }
.sk-start-row .lbl2 { font-size: 13px; }
.sk-move { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); align-items: baseline; }
.sk-move .d { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 44px; }
.sk-move .d.pos { color: #0B6B45; } .sk-move .d.neg { color: var(--bad-ink); }
.av-chip { margin-left: 6px; }
@media (max-width: 820px) {
  .sk-var { grid-template-columns: 1.3fr repeat(4, 1fr); padding: 9px 12px; font-size: 13px; }
  .sk-line { grid-template-columns: 1fr 1fr; }
  .sk-line .q { grid-column: 1; } .sk-line .x { grid-column: 2; justify-self: end; }
}

/* ---------- dashboard ---------- */
.db { display: flex; flex-direction: column; gap: 16px; --ok: #0E7C66; --ok-soft: #CFE8E1; --blue: #2A78D6; --amber: #D99A1E; --red: #D14343; --grey: #B4BDC8; }
.db-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.db-card h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.db-card .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.db-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.db-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.db-kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.db-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--k, var(--ok)); }
.db-kpi .lbl { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.db-kpi .val { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; line-height: 1.1; }
.db-kpi .val small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.db-kpi .foot { margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 18px; }
.delta { font-weight: 700; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; }
.delta.up { background: #DDF3E8; color: #0B6B45; } .delta.down { background: var(--bad-bg); color: var(--bad-ink); }
.att-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.att-row:last-child { border-bottom: 0; }
.att-row:hover { background: #F8FAFB; }
.att-n { min-width: 34px; height: 28px; padding: 0 9px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.att-n.bad { background: var(--bad-bg); color: var(--bad-ink); } .att-n.warn { background: var(--warn-bg); color: var(--warn-ink); } .att-n.info { background: #E1ECFB; color: #1F4E8C; }
.att-l { flex: 1; min-width: 0; font-weight: 500; }
.att-go { color: var(--muted); flex: none; }
.att-ok { display: flex; align-items: center; gap: 10px; color: #0B6B45; font-weight: 600; padding: 4px 0; }
.att-setup { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.att-setup a { text-decoration: none; }
.db-chart { margin-top: 10px; width: 100%; }
.db-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.db-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.db-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.stack { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: #EEF1F4; margin: 14px 0 12px; }
.stack span { display: block; min-width: 0; }
.leg-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13.5px; }
.leg-row i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.leg-row b { margin-left: auto; font-variant-numeric: tabular-nums; }
.leg-row .pc { color: var(--muted); font-size: 12px; min-width: 40px; text-align: right; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 1.1fr) 3fr 36px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13.5px; }
.bar-row .tr { height: 10px; border-radius: 999px; background: #EEF1F4; overflow: hidden; }
.bar-row .tr span { display: block; height: 100%; border-radius: 999px; background: var(--c, var(--ok)); }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }
.db-conf { display: grid; grid-template-columns: minmax(130px, 1.6fr) repeat(3, minmax(60px, .7fr)) minmax(120px, 1.3fr); gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.db-conf:last-child { border-bottom: 0; }
.db-conf.hd { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding-top: 12px; }
.db-conf .num { text-align: right; }
.db-conf .who { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.db-conf .who span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duty { width: 8px; height: 8px; border-radius: 50%; background: #3DBA7E; flex: none; } .duty.off { background: var(--grey); }
.rate { display: flex; align-items: center; gap: 8px; }
.rate .tr { flex: 1; height: 8px; border-radius: 999px; background: #EEF1F4; overflow: hidden; }
.rate .tr span { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.rate b { min-width: 44px; text-align: right; }
.db-empty { text-align: center; color: var(--muted); padding: 22px 8px; }
@media (max-width: 900px) { .db-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .db-kpi { padding: 12px 13px; } .db-kpi .val { font-size: 23px; }
  .db-conf.hd { display: none; }
  .db-conf { grid-template-columns: 1fr 1fr 1fr; gap: 8px 10px; }
  .db-conf .who { grid-column: 1 / -1; }
  .db-conf .num { text-align: left; }
  .db-conf .num::before { content: attr(data-l); display: block; font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
  .db-conf .rate { grid-column: 1 / -1; }
  .bar-row { grid-template-columns: 1fr 36px; } .bar-row .tr { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 820px) { .toolbar .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .toolbar .seg button { white-space: nowrap; flex: none; } }

/* desktop: the open menu takes its own space, the page narrows (no overlay) */
.main { transition: margin-left .22s ease; }
@media (min-width: 821px) {
  .side { width: 232px; }
  .side.open { box-shadow: none; }
  .scrim, .nav-close { display: none !important; }
  body.nav-pinned .main { margin-left: 232px; }
}

/* ---------- profit ---------- */
.pf-hero { display: flex; flex-wrap: wrap; gap: 14px 30px; align-items: flex-end; justify-content: space-between; background: linear-gradient(135deg, #0B5F4E 0%, #0E7C66 100%); color: #fff; border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.pf-hero.neg { background: linear-gradient(135deg, #8A2A2A 0%, #C23B3B 100%); }
.pf-hero .lbl { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.pf-hero .big { font-size: 44px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; margin-top: 4px; }
.pf-hero .big small { font-size: 18px; font-weight: 600; opacity: .8; margin-left: 4px; }
.pf-hero .meta { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13.5px; }
.pf-hero .meta b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.pf-hero .meta span { opacity: .8; font-size: 12px; }
.pf-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13.5px; }
.pf-note a, .pf-note button { color: inherit; font-weight: 700; text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 700; }
.pf-note.info { background: #E1ECFB; color: #1F4E8C; }
.wf-row { display: grid; grid-template-columns: minmax(130px, 1.1fr) 3fr minmax(80px, .7fr); gap: 12px; align-items: center; padding: 7px 0; font-size: 13.5px; }
.wf-row .tr { height: 12px; background: #EEF1F4; border-radius: 999px; overflow: hidden; }
.wf-row .tr span { display: block; height: 100%; border-radius: 999px; background: var(--c); }
.wf-row b { text-align: right; font-variant-numeric: tabular-nums; }
.wf-row.sub { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 11px; font-weight: 700; }
.wf-row.sub .tr span { background: var(--ink); }
.wf-row.tot { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 12px; font-weight: 700; font-size: 15px; }
.pf-prod { display: grid; grid-template-columns: minmax(130px, 1.5fr) repeat(5, minmax(70px, .8fr)) minmax(150px, 1.3fr); gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; font-size: 13.5px; }
.pf-prod:last-child { border-bottom: 0; }
.pf-prod.hd { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.pf-prod .num { text-align: right; }
.pf-prod .nm { font-weight: 700; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pos { color: #0B6B45; } .neg { color: var(--bad-ink); }
.ex-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.ex-row:last-child { border-bottom: 0; }
.ex-main { flex: 1 1 200px; min-width: 0; }
.ex-amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.ex-amt small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.fee-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.fee-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.fee-row:last-child { border-bottom: 0; }
.fee-row input { width: 84px; min-height: 34px; text-align: right; }
.fee-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) {
  .pf-hero { padding: 18px 16px; } .pf-hero .big { font-size: 34px; }
  .wf-row { grid-template-columns: 1fr auto; } .wf-row .tr { grid-column: 1 / -1; grid-row: 2; }
  .pf-prod.hd { display: none; }
  .pf-prod { grid-template-columns: repeat(3, 1fr); gap: 8px 10px; }
  .pf-prod .nm, .pf-prod .cap { grid-column: 1 / -1; }
  .pf-prod .num { text-align: left; }
  .pf-prod .num::before { content: attr(data-l); display: block; font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
}

/* ---------- "⋯" menu: inline buttons on a computer, a small menu on a phone ---------- */
.o-more-wrap, .o-menu { display: contents; }
.o-more { display: none; }

/* ---------- phone: smaller order cards (Orders + Suivi) ---------- */
@media (max-width: 820px) {
  .o-more-wrap { display: inline-block; position: relative; }
  .o-more { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; font-size: 18px; line-height: 1; letter-spacing: 1px; }
  .o-menu { display: none; position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; flex-direction: column; gap: 4px; min-width: 160px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(16, 24, 40, .18); padding: 6px; }
  .o-more-wrap.open .o-menu { display: flex; }
  .o-menu .icon-btn { width: 100%; justify-content: flex-start; text-align: left; min-height: 40px; }

  .order { padding: 10px 12px; }
  .order .o-head { gap: 6px 8px; margin-bottom: 8px; }
  .order .o-head .status { width: auto; min-width: 0; flex: 0 1 122px; min-height: 34px; padding: 3px 10px; }
  .order .o-calls.zero { display: none; }
  .order .o-head .o-spacer, .suivi-row .o-head .o-spacer { display: none; }
  .o-head .o-more-wrap { margin-left: auto; }
  .order .o-head select.assign { min-width: 110px; min-height: 32px; }
  .order .fields { grid-template-columns: 1fr; gap: 6px; }
  .order .fields .label-m { display: none; }
  .order .f-cust { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
  .order .f-cust .o-phone { margin-top: 0; }
  .order .fields input { min-height: 38px; height: 38px; padding: 4px 10px; }
  .order .f-city .raw { margin-top: 2px; }
  .order .items { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
  .order .items .prod { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 8px; min-height: 0; }
  .order .items .f-qty, .order .items .f-price { display: flex; align-items: center; gap: 8px; }
  .order .items .f-qty .label-m, .order .items .f-price .label-m { display: block; margin: 0; flex: none; font-size: 12px; }
  .order .items .f-qty input, .order .items .f-price input { flex: 1; min-width: 0; }
  .order .items .f-price:empty { display: none; }
  .order .o-note { margin-top: 6px; }
  .order .o-note > input[data-f=note], .order .o-note > input.team-note { min-height: 34px; height: 34px; }

  .suivi-row { padding: 9px 12px; }
  .suivi-row .o-head { gap: 5px 8px; margin-bottom: 6px; }
  .sv-fields { gap: 6px 10px; }
  .sv-fields .label-m { font-size: 10px; margin-bottom: 0; }
  /* Customer / City + Price / Product / Ozon status + Livreur / Follow-up */
  .suivi-row .sv-fields > :nth-child(1) { order: 1; grid-column: 1 / -1; }
  .suivi-row .sv-fields > :nth-child(2) { order: 2; grid-column: auto; }
  .suivi-row .sv-fields > :nth-child(4) { order: 3; grid-column: auto; }
  .suivi-row .sv-fields > :nth-child(3) { order: 4; grid-column: 1 / -1; }
  .suivi-row .sv-fields > :nth-child(5) { order: 5; grid-column: auto; }
  .suivi-row .sv-fields > :nth-child(6) { order: 6; grid-column: auto; }
  .suivi-row .sv-fields > :nth-child(7) { order: 7; grid-column: 1 / -1; }
  .suivi-row .sv-fields > :nth-child(8) { order: 8; grid-column: 1 / -1; }
  .sv-tn input { min-height: 36px; height: 36px; }
}

/* ---- who is online (admin) ---- */
.pres-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border: 1px solid var(--line, #e3e6ea); border-radius: 999px; background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: #4b5563; cursor: pointer; margin-right: 8px; white-space: nowrap; }
.pres-btn.on { color: #0f7a5a; border-color: #b6e2d2; background: #f0faf6; }
.pres-btn + .pres-menu + .store-btn { margin-left: 0; }
.pres-dot { width: 9px; height: 9px; border-radius: 50%; background: #c3c9d1; flex: none; }
.pres-dot.on, .pres-btn.on .pres-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.22); }
.pres-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 250px; max-width: 92vw; background: #fff; border: 1px solid #e3e6ea; border-radius: 14px; box-shadow: 0 12px 32px rgba(15,23,42,.14); padding: 6px; }
.pres-menu[hidden] { display: none; }
.pres-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; }
.pres-name { font-weight: 600; font-size: 14px; }
.pres-sub { margin-left: auto; font-size: 12px; color: #6b7280; text-align: right; }
.pres-empty { padding: 12px; font-size: 13px; color: #6b7280; }
@media (max-width: 820px) { .pres-btn .pres-n { font-size: 12px; } .pres-btn { padding: 0 10px; margin-right: 6px; } }
.store-btn .store-name { white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

/* ---- loading icon (centre of the screen) ---- */
.spin { width: 34px; height: 34px; border-radius: 50%; border: 3.5px solid rgba(15,122,90,.18); border-top-color: #0F7A5A; display: block; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader { position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center; pointer-events: none; }
.loader.on { display: flex; }
.loader .spin { width: 42px; height: 42px; padding: 0; background: #fff; box-shadow: 0 6px 24px rgba(15,23,42,.18); border-width: 4px; box-sizing: border-box; }
body.is-leaving .main { opacity: .5; transition: opacity .2s ease .1s; pointer-events: none; }
.spin-wrap { display: flex; justify-content: center; padding: 70px 0; }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } }
