/* MARAS Master — design system (single stylesheet for every app page).
 *
 * Operations UI with a clear product identity: a navy app shell, a white
 * page-title band, neutral work surfaces with visible elevation, MARAS orange
 * as a controlled accent and one operational status palette.
 * No inline styles are needed in templates; RTL-safe (logical properties).
 */

/* ---------- tokens ---------- */
:root {
  --navy: #14327A;
  --navy-700: #22325A;
  --navy-800: #1B2A4D;
  --navy-900: #152040;
  --navy-950: #0F1830;
  --navy-50: #EEF2F9;
  --navy-100: #DCE4F2;
  --navy-200: #B9C7E2;
  --orange: #F47B20;
  --orange-600: #D97A08;
  --orange-text: #9A4D00;
  --orange-50: #FFF4E6;

  --bg: #EEF1F6;
  --surface: #FFFFFF;
  --surface-2: #F7F9FC;
  --surface-3: #EDF1F6;
  --border: #DFE5EE;
  --border-soft: #EBEFF5;
  --border-strong: #C9D2DF;

  --text: #0E1629;
  --text-2: #334155;
  --text-3: #56657A;
  --text-4: #616E82; /* Quality N2: >= 4.5:1 on white and every light surface (was #6B788C, 4.48:1 on white) */

  --success: #067647; --success-bg: #ECFDF3; --success-bd: #ABEFC6;
  --warning: #93370D; --warning-bg: #FFFAEB; --warning-bd: #FEDF89;
  --danger: #B42318;  --danger-bg: #FEF3F2;  --danger-bd: #FECDCA;
  --info: #1D4ED8;    --info-bg: #EFF4FF;    --info-bd: #C7D7FE;

  --focus: 0 0 0 3px rgba(20, 50, 122, 0.25);
  --shadow-1: 0 1px 2px rgba(14, 22, 41, 0.05), 0 1px 3px rgba(14, 22, 41, 0.05);
  --shadow-2: 0 2px 4px rgba(14, 22, 41, 0.06), 0 4px 12px rgba(14, 22, 41, 0.06);
  --shadow-pop: 0 16px 40px rgba(14, 22, 41, 0.20), 0 3px 8px rgba(14, 22, 41, 0.08);

  --r-sm: 4px;
  --r: 6px;
  --r-lg: 8px;
  --r-xl: 12px;

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  /* Design-system scale (consistency plan PR 1). Spacing: one 4/8 grid. */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  /* Control heights: three sizes only (sm rows / md default / touch on phones). */
  --ctl-sm: 32px; --ctl-md: 40px; --ctl-touch: 44px;
  /* Badges and chips: one pill shape. */
  --badge-h: 24px; --r-pill: 999px;
  /* One label colour for form labels and View <dt>. */
  --label: var(--text-2);
  --stage-1: #98A2B3;
  --stage-2: #6F83B0;
  --stage-3: var(--navy);
  --stage-4: var(--navy-800);
  --stage-5: var(--orange);
  --stage-done: var(--success);
  --stage-cancel: #667085;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", sans-serif;
  --font-ar: "Noto Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --header-h: 58px;
  --content-max: none;
  --gutter: 28px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
html:has(.form-actions) { scroll-padding-bottom: 96px; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; width: 100%; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy-900); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; color: var(--text); font-weight: 700; letter-spacing: -0.015em; }
p { margin: 0; }
img, svg { display: inline-block; vertical-align: middle; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.page-title .mono { font-size: 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; inset-inline-start: 12px; top: -48px; z-index: 100; }
.skip-link:focus { top: 8px; }
.muted { color: var(--text-4); }
.icon { flex-shrink: 0; width: 16px; height: 16px; }
.time, .eta__date, .chip__count, .result-count b, .data td.num { font-variant-numeric: tabular-nums; }

/* Bilingual labels: English leads, Arabic follows quieter. */
.ar {
  font-family: var(--font-ar); font-weight: 500; color: var(--text-3);
  font-size: max(13px, 1em); line-height: 1.6; margin-inline-start: 0.35em;
  direction: rtl; unicode-bidi: isolate;
  letter-spacing: normal; text-transform: none;
}
.btn .ar, .nav-link .ar, .tabs a .ar, .chip .ar { color: inherit; opacity: 0.72; }
/* h1 Arabic companion on the type scale (consistency plan PR 12): 20px under a 24px title, 16px under a 20px one. */
h1 .ar { font-weight: 600; font-size: var(--fs-xl); color: var(--text-4); }

/* ---------- app shell: navy header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--navy); color: #fff;
  border-bottom: 3px solid var(--orange);
  box-shadow: 0 2px 8px rgba(14, 22, 41, 0.18);
}
.app-header__inner {
  max-width: var(--content-max); margin: 0 auto; height: var(--header-h);
  padding: 0 var(--gutter); display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; color: #fff; }
.brand:hover { text-decoration: none; color: #fff; }
.brand img { height: 22px; width: auto; }
.brand__product {
  padding-inline-start: 10px; border-inline-start: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 13px; font-weight: 600; letter-spacing: .02em; color: rgba(255, 255, 255, 0.82);
}
.nav-toggle-btn { display: none; }
.main-nav { display: flex; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.nav-link {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px;
  padding: 0 12px; border-radius: var(--r); color: rgba(255, 255, 255, 0.74);
  font-weight: 500; white-space: nowrap; transition: background-color .12s ease, color .12s ease;
}
.nav-link:hover { color: #fff; text-decoration: none; background: rgba(255, 255, 255, 0.07); }
.nav-link[aria-current="page"] { color: #fff; font-weight: 600; background: rgba(255, 255, 255, 0.11); }
.nav-link[aria-current="page"]::after {
  content: ""; position: absolute; inset-inline: 12px; bottom: calc((36px - var(--header-h)) / 2); height: 3px;
  background: var(--orange); border-radius: 3px 3px 0 0;
}
.nav-link .count {
  min-width: 20px; padding: 0 6px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700;
  line-height: 18px; text-align: center; background: var(--orange); color: var(--navy-950);
}
.nav-mobile-only { display: none; }
/* app.js turns the hamburger <label> into a <button> (aria-expanded): no browser button chrome. */
button.nav-toggle-btn { padding: 0; border: 0; background: none; font: inherit; }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.app-header .btn--new { height: var(--ctl-md); }

/* Header menus (<details>): notifications, user. */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r); color: rgba(255, 255, 255, 0.82);
  border: 1px solid transparent; background: transparent;
}
.icon-btn:hover, .menu[open] > .icon-btn { background: rgba(255, 255, 255, 0.09); color: #fff; }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn__badge {
  position: absolute; top: 2px; inset-inline-end: 1px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--orange); color: var(--navy-950);
  border: 2px solid var(--navy-900);
  font-size: 12px; font-weight: 700; line-height: 13px; text-align: center;
}
.user-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 4px;
  border-radius: var(--r); border: 1px solid transparent; color: rgba(255, 255, 255, 0.9);
}
.user-btn:hover, .menu[open] > .user-btn { background: rgba(255, 255, 255, 0.09); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--orange); color: var(--navy-950); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
}
.user-btn__name { font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn .icon { color: rgba(255, 255, 255, 0.6); }
.menu__panel {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 60;
  width: 340px; max-width: calc(100vw - 24px); color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop); overflow: hidden;
}
.menu__head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700;
}
.menu__list { list-style: none; margin: 0; padding: 4px 0; max-height: 380px; overflow: auto; }
.menu__list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 16px; }
.menu__list li:hover { background: var(--surface-2); }
.menu__list li + li { border-top: 1px solid var(--border-soft); }
.menu__list a { flex: 1; color: var(--text); font-size: 13px; font-weight: 500; }
.menu__foot { padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.menu__empty { padding: 24px 16px; color: var(--text-3); font-size: 13px; text-align: center; }
/* Web Push toggle at the foot of the bell (31/10/2026). */
.menu__push {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px;
  padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13px;
}
.menu__push[hidden] { display: none; }
.menu__push-state { color: var(--text-3); }
.menu__user { padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); display: grid; gap: 4px; }
.menu__user strong { display: block; font-size: var(--fs-md); }
.menu__user span { color: var(--text-3); font-size: var(--fs-sm); word-break: break-all; }
.menu__user div { margin-top: 4px; }
.menu__item {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 11px 16px;
  border: 0; background: none; font: inherit; color: var(--text-2); cursor: pointer; text-align: start;
}
.menu__item:hover { background: var(--surface-2); color: var(--navy); text-decoration: none; }
.menu__item .icon { color: var(--text-4); }

/* ---------- page layout ---------- */
.page { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gutter) 48px; }
.page--narrow { max-width: 1040px; }
/* Quality 16/11 PR #282 P3-4: on the forced first-change password page only, hide the menu, New order (+)
   and the bell. Logout stays on the form. From 1280px the sidebar column is released too. */
body.page--password-forced .nav-toggle-btn,
body.page--password-forced .nav-toggle,
body.page--password-forced .sidebar,
body.page--password-forced .nav-backdrop,
body.page--password-forced .btn--new,
body.page--password-forced .header-actions > details.menu {
  display: none !important;
}
@media (min-width: 1280px) {
  body.page--password-forced:has(> .app-header) {
    padding-inline-start: 0 !important;
    background: var(--bg) !important;
  }
  /* Design 16/11 PR #282 re-check P3-1: at 1440 the mark lived in the sidebar, now hidden, so the white
     top bar was empty except EN | TR. Keep the navy header and show the wordmark, as at 390. */
  body.page--password-forced .app-header {
    background: var(--navy);
    color: #fff;
    border-bottom: 3px solid var(--orange);
    box-shadow: 0 2px 8px rgba(14, 22, 41, 0.18);
  }
  body.page--password-forced .app-header .brand--bar { display: inline-flex; }
  body.page--password-forced .app-header :focus-visible { outline-color: #fff; }
  body.page--password-forced .app-header .lang-switch__btn { color: rgba(255, 255, 255, 0.66); }
  body.page--password-forced .app-header .lang-switch__btn:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
  body.page--password-forced .app-header .lang-switch__btn[aria-current="true"] { color: #fff; }
  body.page--password-forced .app-header .lang-switch__sep { color: rgba(255, 255, 255, 0.34); }
}
/* Design 16/11 PR #282 re-check @ dc23786f: at 390, without the hint the forced form shrinks (258px)
   while the error alert stays 320px. Stretch the form, its fields and the actions to the alert's width.
   1440 and the voluntary Change password page are unchanged. */
@media (max-width: 640px) {
  body.page--password-forced .panel-center form,
  body.page--password-forced .panel-center .field,
  body.page--password-forced .panel-center .page-actions { width: 100%; }
}
/* Page-title band: white, full-bleed, separated from the grey work area. */
.page-header {
  position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 12px 24px; margin-bottom: 24px; padding: 22px 0 20px;
  background: var(--surface);
  box-shadow: 0 0 0 100vmax var(--surface), 0 1px 0 100vmax var(--border);
  clip-path: inset(0 -100vmax -1px -100vmax);
}
/* Order pages with the "⋯" actions menu: the dropdown must be able to hang
   below the band, so the header itself is not clipped. The full-bleed white
   band (and its bottom rule) is painted by ::before instead, which keeps the
   same 1px-bottom clip — the 100vmax shadow can never spread over the page
   content underneath (QA 00110 P0: a 400px white band hid the top of the order). */
.page-header:has(.order-actions) { z-index: 30; background: transparent; box-shadow: none; clip-path: none; }
.page-header:has(.order-actions)::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--surface);
  box-shadow: 0 0 0 100vmax var(--surface), 0 1px 0 100vmax var(--border);
  clip-path: inset(0 -100vmax -1px -100vmax);
}
.page-header__eyebrow {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px;
  color: var(--orange-text); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.page-header__eyebrow a { color: var(--text-3); letter-spacing: normal; text-transform: none; font-size: var(--fs-sm); font-weight: 600; }
.page-header__eyebrow a:hover { color: var(--navy); }
.page-title { font-size: var(--fs-2xl); line-height: 1.2; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.page-sub { margin-top: 6px; color: var(--text-3); font-size: var(--fs-md); max-width: 84ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-header > .tabs { flex-basis: 100%; margin: 4px 0 -20px; border-bottom: 0; }
.stack { display: grid; gap: 16px; }
.section-title { font-size: var(--fs-lg); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.footer {
  flex-shrink: 0; padding: 14px var(--gutter); text-align: center;
  color: var(--text-4); font-size: 12px; border-top: 1px solid var(--border); background: var(--surface);
}

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card__header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border);
}
.card__title { font-size: var(--fs-lg); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card__title > .icon { color: var(--navy); }
.card__desc { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.card__body { padding: var(--s-4); }
.card__footer { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card + .card { margin-top: 16px; }
/* Grid containers already space their children: no doubled gaps. */
.stack > .card, .form-main > .card, .form-aside > .card { margin-top: 0; }

/* Dashboard pipeline: one linked count per operational stage. */
.pipeline {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden;
}
.stage {
  --tone: #667085;
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-width: 0;
  padding: 13px 16px 12px; color: var(--text); border-top: 3px solid var(--tone);
  transition: background-color .12s ease;
}
.stage + .stage { border-inline-start: 1px solid var(--border-soft); }
.stage + .stage::before {
  content: ""; position: absolute; inset-inline-start: -6px; top: 50%; width: 10px; height: 10px; z-index: 1;
  background: var(--surface); border-top: 1px solid var(--border); border-right: 1px solid var(--border);
  transform: translateY(-50%) rotate(45deg);
}
[dir="rtl"] .stage + .stage::before { transform: translateY(-50%) rotate(-135deg); }
.stage:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.stage__label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); min-width: 0; }
.stage__label .ar { display: block; margin: 1px 0 0; text-transform: none; letter-spacing: normal; font-size: var(--fs-sm); text-align: left; unicode-bidi: isolate; }
.stage__count { font-size: var(--fs-2xl); font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--tone); font-variant-numeric: tabular-nums; }
.stage__name { display: flex; align-items: center; gap: 8px; }
.stage__step, .stage-step {
  display: inline-grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px;
  border-radius: 50%; background: var(--tone); color: #fff; font-size: var(--fs-xs); font-weight: 700;
}
.stage--waiting, .stage-step--waiting { --tone: var(--stage-1); }
.stage--confirmed, .stage-step--confirmed { --tone: var(--stage-2); }
.stage--sea, .stage-step--sea { --tone: var(--stage-3); }
.stage--port, .stage-step--port { --tone: var(--stage-4); }
.stage--land, .stage-step--land { --tone: var(--stage-5); }
.stage-step--completed { --tone: var(--stage-done); }
.stage-step--cancelled { --tone: var(--stage-cancel); }
.stage.is-selected { background: var(--navy-50); box-shadow: inset 0 -3px 0 var(--tone); }

/* ---------- operations dashboard ---------- */
.dash-section { margin-bottom: 20px; }
.card.dash-section + .dash-section { margin-top: 0; }
.dash-kpis { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.dash-kpi {
  display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 8px;
  min-width: 180px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface-2); color: var(--text-3); font-size: var(--fs-sm);
}
.dash-kpi:hover { border-color: var(--navy-200); background: var(--navy-50); text-decoration: none; }
.dash-kpi b { grid-row: 1 / span 2; color: var(--text); font-size: var(--fs-2xl); line-height: 1; }
.dash-kpi .ar { margin: 0; }
.dash-kpi--attention { border-color: #FBD19B; background: var(--orange-50); }
.dash-kpi--attention b { color: var(--orange-text); }
.dash-total {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--navy-50); border: 1px solid var(--navy-100); color: var(--navy-900); font-size: var(--fs-sm); font-weight: 600;
}
.dash-total b { font-variant-numeric: tabular-nums; }
.dash-total:hover, .dash-total.is-selected { background: var(--navy); border-color: var(--navy); color: #fff; text-decoration: none; }
.is-zero { color: var(--text-4); }
.stage { justify-content: flex-start; }
a.stage__count, .stage__count.is-zero { display: inline-flex; align-items: center; align-self: flex-start; min-width: 44px; min-height: 40px; }
a.stage__count:hover { text-decoration: none; opacity: .8; }
.stage__count.is-zero { color: var(--tone); font-weight: 600; }
/* Low-contrast stage tones (#98A2B3 / #F47B20) stay on the bar and step
   circle; the count text (incl. zero) uses a darker shade that passes 4.5:1. */
.stage--waiting .stage__count { color: var(--stage-cancel); }
.stage--land .stage__count { color: var(--orange-text); }
.stage--confirmed .stage__count { color: #4F6390; } /* 5.97:1 on white, 5.31:1 on selected #EEF2F9 */
.buckets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bucket { --tone: var(--text-2); display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 18px 20px 20px; }
.bucket + .bucket { border-inline-start: 1px solid var(--border-soft); }
.bucket.is-selected { background: var(--navy-50); }
.bucket--eta_passed { --tone: var(--danger); }
.bucket--stuck { --tone: var(--orange-text); }
.bucket__head { display: flex; align-items: center; gap: 12px; }
.bucket__count {
  display: inline-flex; align-items: center; min-width: 44px; min-height: 44px;
  font-size: var(--fs-2xl); font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--tone); font-variant-numeric: tabular-nums;
}
a.bucket__count:hover { text-decoration: none; opacity: .8; }
.bucket__count.is-zero { color: var(--border-strong); font-weight: 500; }
.bucket__label { font-size: 14px; font-weight: 700; }
.bucket__rule { margin-top: -6px; color: var(--text-4); font-size: 12px; }
.bucket__list { display: grid; margin: 0; padding: 0; list-style: none; }
.bucket__list li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 48px; padding: 7px 0; border-top: 1px solid var(--border-soft);
}
.bucket__item { display: grid; min-width: 0; }
.bucket__company, .bucket__reason { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bucket__company { font-size: 13px; font-weight: 600; }
.bucket__reason { color: var(--text-3); font-size: 12px; }
.bucket__more { display: inline-flex; align-items: center; gap: 2px; align-self: flex-start; min-height: 32px; font-size: var(--fs-sm); font-weight: 600; }
.bucket__clear { display: flex; align-items: center; gap: 6px; color: var(--success); font-size: 13px; }
.tag {
  padding: 0 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2);
  font-size: var(--fs-xs); font-weight: 700; line-height: 20px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.tag--eta_passed { background: var(--danger-bg); color: var(--danger); }
.tag--stuck { background: var(--orange-50); color: var(--warning); }
.dash-empty { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 18px; color: var(--success); font-weight: 600; text-align: center; }
.dash-empty .icon { width: 20px; height: 20px; }
.dash-empty--quiet { color: var(--text-3); font-weight: 500; }
.dash-empty--quiet .icon { color: var(--text-4); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.dash-grid > .card { margin-top: 0; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 18px 18px 12px; list-style: none; }
.day {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 10px 2px 6px;
  border: 1px solid var(--border-soft); border-radius: var(--r); background: var(--surface-2);
}
.day--today { border-color: var(--orange); background: var(--orange-50); }
.day.is-selected { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.day__name { color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.day__num { color: var(--text-4); font-weight: 500; }
.day__count {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 40px;
  font-size: var(--fs-2xl); font-weight: 700; line-height: 1; color: var(--navy-900); font-variant-numeric: tabular-nums;
}
a.day__count:hover { text-decoration: none; color: var(--navy); }
.day__count.is-zero { color: var(--border-strong); font-weight: 500; }
.card__note { padding: 0 18px 16px; color: var(--text-4); font-size: 12px; }
.toolbar.toolbar--flat { border-radius: 0; }
.dash-alert { margin: 14px 18px 0; }
/* A filter value the list ignored (Quality P3-1), as typed: never wider than the card. */
.filter-ignored { padding: 0 4px; border-radius: 4px; background: rgba(15, 23, 42, .06); overflow-wrap: anywhere; }
.pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px 0 12px; border-radius: 999px;
  background: var(--navy); color: #fff; font-size: var(--fs-sm); font-weight: 600;
}
.pill:hover { background: var(--navy-900); color: #fff; text-decoration: none; }
.pill .icon { width: 14px; height: 14px; opacity: .8; }
.pill .ar { color: inherit; opacity: .75; }
.pill__k { font-weight: 500; opacity: .72; }
.pills__clear { font-size: var(--fs-sm); }
.chip--toggle .icon { width: 14px; height: 14px; }
.days-in { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.days-in--stuck { color: var(--warning); }
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .dash-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-kpi { min-width: 0; }
  .dash-section, .dash-grid { margin-bottom: 16px; }
  .dash-grid { gap: 16px; }
  .buckets { grid-template-columns: minmax(0, 1fr); }
  .bucket { padding: 14px 14px 16px; }
  .bucket + .bucket { border-inline-start: 0; border-top: 1px solid var(--border); }
  .days { gap: 4px; padding: 12px 10px 10px; }
  .day { padding: 8px 0 4px; }
  .day__name { font-size: var(--fs-xs); }
  .day__count { min-height: 44px; font-size: var(--fs-2xl); }
  .card__note { padding-inline: 14px; }
  a.stage__count, .stage__count.is-zero { min-height: 44px; }
  .bucket__more, .pill, .chip, .pills__clear, .dash-total { min-height: 44px; display: inline-flex; align-items: center; }
  .day--today .day__num { display: none; }
  .dash-alert { margin-inline: 14px; }
}

/* Transport + vendor presentation (tables). */
.transport { display: grid; gap: 3px; justify-items: start; }
.transport__equip { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; }
.transport__qty { font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
/* Long types (REFRIGERATOR TRUCK) wrap inside their cell instead of running into the next column. */
.equip {
  display: inline-block; max-width: 100%; white-space: normal; overflow-wrap: anywhere;
  padding: 1px 7px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface-2);
  font-size: 12px; font-weight: 700; color: var(--navy-900); letter-spacing: .01em;
}
.transport__bl { display: block; max-width: 100%; font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-3); white-space: normal; overflow-wrap: anywhere; }
.transport__bl .k { font-family: var(--font); font-weight: 700; font-size: var(--fs-xs); letter-spacing: .04em; color: var(--text-4); }
.vcat { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; line-height: 20px; white-space: nowrap; border: 1px solid transparent; }
.vcat::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
/* Vendor categories on the brand scale (PR 12): navy tints for sea / customs, orange #9A4A00 for land / air (AA; --orange-text is 4.39:1 on orange-50). */
.vcat--sea { background: var(--navy-50); color: var(--stage-3); border-color: var(--navy-100); }
.vcat--agency { background: var(--surface); color: var(--navy-700); border-color: var(--navy-200); }
.vcat--land { background: var(--orange-50); color: #9A4A00; border-color: #FBD19B; }
.vcat--air { background: var(--surface); color: #9A4A00; border-color: #FBD19B; }
.vcat--customs_port { background: var(--navy-100); color: var(--stage-4); border-color: var(--navy-200); }
.vcat--customs_border { background: var(--navy-200); color: var(--navy-800); border-color: #8FA3CC; }
.vcat--goods_supplier { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.vcat--port { background: var(--surface-2); color: var(--navy-900); border-color: var(--navy-200); }
.vcat--other { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
/* Quality N1: the Arabic sub-label takes the chip colour (was --text-3 #56657A: 3.48:1 on the Border Customs Broker chip #B9C7E2). */
.vcat .ar { color: inherit; }
.data .row--cancelled .cell-main { color: var(--text-3); }

/* ---------- buttons ---------- */
/* Control scale (consistency plan PR 2): --ctl-sm 32 rows / --ctl-md 40 default / --ctl-touch 44 on phones. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--ctl-md); padding: 0 14px; border-radius: var(--r); border: 1px solid transparent;
  font: inherit; font-size: var(--fs-md); font-weight: 600; line-height: 1; white-space: nowrap;
  cursor: pointer; text-decoration: none; user-select: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
}
.btn:hover { text-decoration: none; }
.btn:active:not([disabled]) { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn--primary { background: var(--navy); color: #fff; box-shadow: 0 1px 2px rgba(14, 22, 41, .18), inset 0 1px 0 rgba(255, 255, 255, .08); }
.btn--primary:hover { background: var(--navy-800); color: #fff; }
.btn--accent { background: var(--orange); color: var(--navy-950); box-shadow: 0 1px 2px rgba(14, 22, 41, .18); }
.btn--accent:hover { background: #FFA333; color: var(--navy-950); }
.btn--secondary { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); box-shadow: var(--shadow-1); }
.btn--secondary:hover { background: var(--surface-2); color: var(--navy); border-color: var(--navy-200); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-3); color: var(--navy); }
.btn--danger { background: var(--danger); color: #fff; box-shadow: 0 1px 2px rgba(180, 35, 24, .25); }
.btn--danger:hover { background: #912018; color: #fff; }
.btn--danger-ghost { background: var(--surface); color: var(--danger); border-color: var(--danger-bd); }
.btn--danger-ghost:hover { background: var(--danger-bg); color: #912018; border-color: #FDA29B; }
.btn--sm { height: var(--ctl-sm); padding: 0 var(--s-3); font-size: var(--fs-sm); }
.btn--block { width: 100%; white-space: normal; height: auto; min-height: var(--ctl-md); padding-block: 9px; line-height: 1.3; }
.btn--icon { width: 40px; padding: 0; }
.btn .icon { width: 15px; height: 15px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: none; padding: 0; font: inherit; font-size: var(--fs-sm); font-weight: 600;
  color: var(--navy); cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.inline-form { display: inline; margin: 0; }

/* ---------- badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  height: var(--badge-h); padding: 0 10px; border-radius: var(--r-pill); border: 1px solid transparent;
  font-size: var(--fs-xs); font-weight: 600; line-height: 1; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
/* One badge shape (consistency plan PR 3): 24px pill, never wraps; the step
   circle / dot sits close to the start edge. */
.badge:has(> .badge__step) { padding-inline-start: 3px; }
.badge:has(> .badge__dot) { padding-inline-start: 8px; }
.badge .ar { font-size: var(--fs-sm); font-weight: 500; line-height: 1.4; color: inherit; opacity: .9; }
.badge__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge__step {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  color: #fff; font-size: var(--fs-xs); font-weight: 700; line-height: 1;
}
.badge--waiting .badge__step { background: var(--stage-1); }
.badge--confirmed .badge__step { background: var(--stage-2); }
.badge--sea .badge__step { background: var(--stage-3); }
.badge--port .badge__step { background: var(--stage-4); }
.badge--land .badge__step { background: var(--stage-5); color: var(--navy-900); }
.badge--completed .badge__step { background: var(--stage-done); }
.badge--waiting   { background: #F2F4F7; color: #475467; border-color: #D9DEE6; }
.badge--confirmed { background: var(--navy-50); color: var(--stage-2); border-color: var(--navy-100); }
.badge--sea       { background: var(--navy-50); color: var(--stage-3); border-color: var(--navy-100); }
.badge--port      { background: var(--navy-100); color: var(--stage-4); border-color: var(--navy-200); }
.badge--land      { background: var(--orange-50); color: var(--orange-text); border-color: #FBD19B; }
.badge--completed { background: var(--success-bg); color: var(--success); border-color: var(--success-bd); }
.badge--cancelled { background: #F2F4F7; color: #555E70; border-color: #D9DEE6; text-decoration: line-through; text-decoration-color: rgba(102,112,133,.45); }
.badge--danger    { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bd); }
.badge--ok        { background: var(--success-bg); color: var(--success); border-color: var(--success-bd); }
.badge--success   { background: var(--success-bg); color: var(--success); border-color: var(--success-bd); }
.badge--muted     { background: var(--surface-3); color: var(--text-3); border-color: var(--border); }
.badge--count { padding: 0 8px; min-width: 24px; justify-content: center; }
.badge--role-admin   { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.badge--role-ops     { background: var(--navy-50); color: var(--navy); border-color: var(--navy-100); }
.badge--role-sales   { background: var(--orange-50); color: #9A4A00; border-color: #FBD19B; }
.badge--role-finance { background: #F2F4F7; color: #475467; border-color: #D9DEE6; }
.badge[class*="badge--role-"] { text-transform: capitalize; }
.menu__user .badge[class*="badge--role-"] { text-transform: none; }  /* the role's own label ("Finance supervisor") */
.state {
  display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px 1px 8px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 600; line-height: 20px;
  background: var(--success-bg); color: var(--success); border: 1px solid var(--success-bd);
}
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state--off { background: var(--surface-3); color: var(--text-3); border-color: var(--border); }
.lifecycle {
  display: inline-flex; align-items: center; gap: 6px; height: var(--badge-h); padding: 0 10px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0; text-transform: none; line-height: 1; white-space: nowrap;
}
.lifecycle--active { background: var(--navy); color: #fff; }
.lifecycle--archived { background: var(--surface-3); color: var(--text-3); border: 1px solid var(--border); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
  transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}
.chip:hover { border-color: var(--navy-200); background: var(--navy-50); color: var(--navy); text-decoration: none; }
.chip[aria-current="true"] { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 1px 2px rgba(14, 22, 41, .2); }
.chip__count {
  min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--surface-3);
  font-size: var(--fs-xs); font-weight: 700; line-height: 18px; text-align: center; color: var(--text-2);
}
.chip[aria-current="true"] .chip__count { background: rgba(255, 255, 255, 0.18); color: #fff; }
.chip .badge__dot { opacity: .95; }
.chip--waiting .badge__dot { color: #667085; }
.chip--confirmed .badge__dot { color: var(--stage-2); }
.chip--sea .badge__dot { color: var(--stage-3); }
.chip--port .badge__dot { color: var(--stage-4); }
.chip--land .badge__dot { color: var(--orange-text); }
.chip--completed .badge__dot { color: var(--success); }
.chip--cancelled .badge__dot { color: #98A2B3; }
.chip[aria-current="true"] .badge__dot { color: #fff; }

/* ---------- alerts ---------- */
.alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; margin-bottom: 16px;
  border-radius: var(--r); border: 1px solid var(--info-bd); border-inline-start-width: 4px; background: var(--info-bg);
  color: #1E3A8A; font-size: var(--fs-md);
}
.alert .icon { margin-top: 2px; }
.alert strong { font-weight: 700; }
.alert--success { border-color: var(--success-bd); border-inline-start-color: var(--success); background: var(--success-bg); color: #05603A; }
.alert--warning { border-color: var(--warning-bd); border-inline-start-color: var(--orange); background: var(--warning-bg); color: var(--warning); }
.alert--danger  { border-color: var(--danger-bd); border-inline-start-color: var(--danger); background: var(--danger-bg); color: #912018; }
/* Open items 16/11/2026 item 24: a message in paragraphs (the 409 form's "What you sent" on its own). */
.alert__p { margin: 0; }
.alert__p + .alert__p { margin-top: 8px; }
.alert--neutral { border-color: var(--border); border-inline-start-color: var(--navy); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-1); }
.alert ul { margin: 4px 0 0; padding-inline-start: 18px; }
.alert a { color: inherit; text-decoration: underline; }
.alert[data-flash] { scroll-margin-top: calc(var(--header-h) + 12px); }

/* ---------- toolbar / filters ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); padding: var(--s-4);
  border-bottom: 1px solid var(--border-soft); background: var(--surface-2);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.toolbar__search { flex: 2 1 320px; min-width: 0; }
.toolbar__field { flex: 1 1 160px; min-width: 0; }
.toolbar__actions { flex: 0 0 auto; display: flex; gap: var(--s-2); align-items: center; margin: 0; }
.toolbar .field { margin: 0; }
.toolbar .btn { height: var(--ctl-md); padding-inline: var(--s-4); }
.toolbar input[type], .toolbar select { height: var(--ctl-md); }
.toolbar__row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.result-count { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; white-space: nowrap; }
.result-count b { color: var(--text); font-weight: 700; }
.input-icon { position: relative; }
.card__header > .input-icon { flex: 0 1 300px; min-width: 200px; }
.input-icon .icon { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--text-4); pointer-events: none; }
.input-icon input[type] { padding-inline-start: 36px; }

/* ---------- forms ---------- */
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="date"], input[type="number"], input[type="tel"], select, textarea {
  width: 100%; height: var(--ctl-md); padding: 0 11px; border-radius: var(--r);
  border: 1px solid var(--border-strong); background-color: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; box-shadow: inset 0 1px 1px rgba(14, 22, 41, 0.04);
  transition: border-color .12s ease, box-shadow .12s ease, background-color .12s ease;
}
textarea { height: auto; min-height: 80px; padding: 9px 11px; }
select { appearance: none; -webkit-appearance: none; padding-inline-end: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2356657A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 14px;
}
[dir="rtl"] select { background-position: left 11px center; }
input::placeholder, textarea::placeholder { color: var(--text-4); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--text-4); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: var(--focus); }
input[readonly] { background-color: var(--surface-2); color: var(--text-2); border-style: dashed; }
input[readonly]:hover { border-color: var(--border-strong); }
/* Server-set, read-only values (Entry date, Quantity summary): not form controls. */
.field__static { display: grid; align-content: center; gap: 2px; min-height: var(--ctl-md); padding: 7px 11px; border: 1px dashed var(--border-strong); border-radius: var(--r); background-color: var(--surface-2); color: var(--text-2); font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.field__static-ar { font-family: var(--font-ar); font-size: var(--fs-xs); color: var(--text-3); line-height: 1.5; }
.field__static-ar[hidden] { display: none; }
.app-header .btn--new[aria-current="page"] { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55); }
/* Locked for this role: hatched surface, clearly not editable. */
input[disabled], textarea[disabled] {
  color: var(--text-3); border-color: var(--border); box-shadow: none; cursor: not-allowed;
  background-color: var(--surface-3);
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(14, 22, 41, 0.04) 6px 12px);
}
select[disabled] {
  color: var(--text-3); border-color: var(--border); box-shadow: none; cursor: not-allowed;
  background-color: var(--surface-3); background-image: none;
}
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--navy); cursor: pointer; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); background-color: #FFFBFA; }
input[aria-invalid="true"]:focus, select[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .18); }
/* ISO date field (order form ETA): text input always shows YYYY-MM-DD; the
   calendar button opens a hidden, unnamed native date input (see app.js). */
.date-field { position: relative; display: block; }
.date-field .date-field__input { padding-inline-end: 40px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.date-field__btn {
  position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-3); cursor: pointer;
}
.date-field__btn:hover { background: var(--navy-50); color: var(--navy); }
.date-field__btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.date-field__btn .icon { width: 16px; height: 16px; }
.date-field .date-field__native {
  position: absolute; inset-inline-end: 0; bottom: 0; width: 1px; height: 1px; min-height: 0;
  opacity: 0; pointer-events: none; border: 0; padding: 0; box-shadow: none;
}
html:not(.js) [data-date-picker], html:not(.js) [data-date-native] { display: none !important; }
html:not(.js) .date-field .date-field__input { padding-inline-end: 11px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-weight: 400; }
.field__label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--label); }
/* Red required asterisk, every page (HANDOFF v3 16:41): some stars fell outside the scoped rules and read black. */
abbr.req{color:var(--danger);font-weight:700;text-decoration:none;border:0}
.field__label .req { color: var(--danger); font-weight: 700; text-decoration: none; border: 0; }
.field__label .icon { width: 13px; height: 13px; color: var(--text-4); align-self: center; }
/* ISO date field: explicit <label for> around .field__label (the wrapper is a <div>). */
.field__label-for { display: block; margin: 0; padding: 0; }
.field__hint { display: grid; gap: 1px; font-size: var(--fs-xs); color: var(--text-4); }
.field__hint .ar { margin-inline-start: 0; }
.field__hint a[lang="ar"] { font-size: var(--fs-sm); }
/* Keep a " · " separator attached to the item before it (never alone on a line). */
.hint-sep { white-space: nowrap; }
.badge--owner { font-size: var(--fs-sm); }
.field__error { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-sm); font-weight: 600; color: var(--danger); }
.field__error .icon { width: 14px; height: 14px; margin-top: 2px; }
.field__error-format { white-space: nowrap; }
.field--error .field__label { color: var(--danger); }
.field--span-2 { grid-column: span 2; }
.field--stage .field__label { color: var(--navy); }
.field--stage input:not([disabled]):not([aria-invalid="true"]),
.field--stage select:not([disabled]):not([aria-invalid="true"]) { border-color: var(--navy-200); background-color: #FBFCFF; }
.stage-req { color: var(--danger); font-weight: 700; }
/* Missing for the chosen status (client pre-submit check / server re-render). */
.field--missing .field__label { color: var(--danger); }
.field--missing > input:not([disabled]), .field--missing > select:not([disabled]),
.field--missing > .date-field > input.date-field__input:not([disabled]),
.transport-builder.field--missing input[name^="sea_bl_"],
.transport-builder.field--error input[name^="sea_bl_"] { border-color: var(--danger); background-color: #FFFBFA; }
.stage-blocked { margin: 4px 0 0; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 18px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Order form */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.form-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; min-width: 0; }
.order-form--sticky-actions { padding-bottom: 72px; }
.form-section--wide, .form-main > .form-actions { grid-column: 1 / -1; }
.form-section { position: relative; align-self: stretch; }
/* Transport: the section that matches the order's equipment mode gets a 3px navy edge (no generated text), and its carrier fields stand out. */
.form-section[data-mode="Sea"]:has(#sec-4)::before, .form-section[data-mode="Land"]:has(#sec-5)::before,
.form-section[data-mode="Air"]:has(#sec-6)::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px;
  background: var(--navy); z-index: 1; pointer-events: none;
}
.form-section[data-mode="Sea"] .field:has(#f-shipping_line, #f-bl_number) .field__label,
.form-section[data-mode="Land"] .field:has(#f-land_company) .field__label,
.form-section[data-mode="Air"] .field:has(#f-air_freight) .field__label { color: var(--navy); }
.form-section[data-mode="Sea"] .field:has(#f-shipping_line, #f-bl_number) :is(input, select):not([disabled]),
.form-section[data-mode="Land"] .field:has(#f-land_company) select:not([disabled]),
.form-section[data-mode="Air"] .field:has(#f-air_freight) select:not([disabled]) { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-50); }
.equipment__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.equipment__row:has(> input[hidden]) { grid-template-columns: minmax(0, 1fr); }
textarea { resize: vertical; }
.form-aside { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 16px; min-width: 0; }
.form-section { overflow: hidden; }
.form-section > summary { list-style: none; cursor: pointer; }
.form-section > summary::-webkit-details-marker { display: none; }
.form-section__head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; align-items: center;
  column-gap: var(--s-2); row-gap: var(--s-1);
  padding: var(--s-3) var(--s-4); background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.form-section__title { font-size: var(--fs-lg); font-weight: 700; display: flex; align-items: center; gap: 10px; min-width: 0; }
.form-section__num {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: var(--fs-xs); font-weight: 700;
  box-shadow: 0 0 0 3px var(--navy-50);
}
.form-section__desc { display: grid; gap: 1px; padding: var(--s-2) var(--s-4) 0 50px; color: var(--text-3); font-size: var(--fs-sm); background: var(--surface-2); }
.form-section__desc .ar { margin-inline-start: 0; }
.section-requirement { justify-self: end; }
.badge--orange { background: var(--orange-50); color: var(--orange-text); border-color: #FBD19B; }
.form-section__chev { transition: transform .15s ease; color: var(--text-3); }
.form-section[open] .form-section__chev { transform: rotate(180deg); }
.form-section .card__body { padding: var(--s-4); }
.form-actions {
  position: sticky; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  margin: 4px calc(-1 * var(--gutter)) -72px; padding: 12px var(--gutter);
  background: rgba(255, 255, 255, .97); backdrop-filter: blur(8px);
  border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(14,22,41,.06);
  width: calc(100% + 320px + (2 * var(--gutter)));
}
.form-actions .btn--primary { height: var(--ctl-md); padding-inline: var(--s-5); }
.form-actions .btn--ghost { height: var(--ctl-md); }
.form-actions__note { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--fs-sm); }
/* Read-only order page (GET /orders/{ng}): a detail list, not a form.
   Values are shown in full (they wrap); on phones the Stage guide comes
   first, collapsed, as on the order form, and Edit is a full-width button. */
.view-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.view-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; min-width: 0; }
.view-main > .card { margin-top: 0; }
.view-section--wide, .view-back { grid-column: 1 / -1; }
.view-aside { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 16px; min-width: 0; }
.view-aside > .card { margin-top: 0; }
.detail-grid { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 24px; }
.detail { display: grid; gap: 3px; align-content: start; min-width: 0; }
.detail--wide { grid-column: 1 / -1; }
.detail dt { color: var(--label); font-size: var(--fs-sm); font-weight: 600; }
.detail dt .ar { font-size: var(--fs-sm); }
.detail dd { margin: 0; color: var(--text); font-size: var(--fs-md); font-weight: 600; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.detail dd .muted { font-family: var(--font); font-weight: 400; }
/* A section whose fields are all empty: one muted "—" at the size of a value. */
.view-empty { margin: 0; font-size: var(--fs-md, 14px); line-height: 1.4; }
.view-empty .muted { font-family: var(--font); font-weight: 400; }
.detail__ar { display: block; font-family: var(--font-ar); font-weight: 500; color: var(--text-3); font-size: var(--fs-sm); }
.detail-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.detail-rows li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.detail .equip { max-width: none; }  /* wraps like the table badge; no cell to fit here */
.view-back { margin: 0; }
@media (max-width: 1180px) {
  .view-layout { grid-template-columns: minmax(0, 1fr); }
  .view-aside { position: static; }
}
@media (max-width: 760px) {
  .view-main { grid-template-columns: minmax(0, 1fr); }
  .view-aside { order: -1; }
  .page-actions--view { flex: 1 1 100%; }
  .page-actions--view .btn { flex: 1 1 100%; height: var(--ctl-touch); }
}
.summary-list { margin: 0; display: grid; gap: 10px; }
.summary-list div { display: grid; gap: 2px; }
.summary-list dt { color: var(--text-3); font-size: var(--fs-xs); font-weight: 500; }
.summary-list dd { margin: 0; font-weight: 600; word-break: break-word; }
/* Stage guide card: a <details> — open on desktop, collapsed on phones (app.js). */
.stage-guide > summary { list-style: none; cursor: pointer; }
.stage-guide > summary::-webkit-details-marker { display: none; }
.stage-guide:not([open]) > .card__header { border-bottom: 0; }
.stage-guide__chev { margin-inline-start: auto; color: var(--text-3); transition: transform .15s ease; }
.stage-guide[open] .stage-guide__chev { transform: rotate(180deg); }
/* Stage guide: a vertical stepper. */
.stage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; font-size: var(--fs-sm); }
.stage-list > li {
  position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 3px 8px; padding: 8px;
  border-radius: var(--r); border: 1px solid transparent;
}
.stage-list > li.is-current { background: var(--navy-50); border-color: var(--navy-100); }
.stage-list .stage-step { grid-row: 1 / span 3; margin-top: 1px; background: var(--tone); }
.stage-list .req-list { grid-column: 2; color: var(--text-3); }
.stage-list .req-list.ar { display: block; text-align: left; }
.stage-list > li.is-current .req-list { color: var(--text); font-weight: 600; }
/* Stage guide: the numbered step circle carries the stage colour; the stage
   name is a plain bold line (EN, AR below), not a wrapping pill. */
.stage-list .badge {
  grid-column: 2; justify-self: start; display: block; height: auto; max-width: none; padding: 0;
  border: 0; border-radius: 0; background: none; color: var(--text);
  font-size: var(--fs-sm); font-weight: 700; line-height: 1.4; white-space: normal; text-decoration: none;
}
.stage-list .badge .badge__dot { display: none; }
/* Noto Sans Arabic's content area (~2.15em) is taller than the 1.5 line box, so the
   Arabic stage name spilled 3px below the stage-name block (scrollHeight 43 vs 40).
   Clip the vertical overflow: no glyph ink is lost and the row keeps its height. */
.stage-list .badge .ar { display: block; margin: 2px 0 0; text-align: left; font-weight: 500; line-height: 1.5; color: var(--text-3); opacity: 1; overflow-y: clip; }
/* ---------- tables ---------- */
.table-card { overflow: hidden; }
.table-scroll { overflow: auto; max-width: 100%; }
.table-scroll--tall { max-height: calc(100vh - 230px); min-height: 280px; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-md); }
.data th, .data td { padding: 10px var(--s-3); text-align: start; vertical-align: middle; border-bottom: 1px solid var(--border-soft); }
.data thead th {
  position: sticky; top: 0; z-index: 2; background: #F3F6FA; color: var(--text-3);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  border-bottom: 1px solid var(--border); padding-block: 10px; vertical-align: bottom;
}
/* One header style for every table (consistency plan PR 4): EN uppercase, the AR companion on its own line under it, left-aligned (LTR app). */
.data thead th .ar { display: block; margin: 2px 0 0; text-align: left; font-size: var(--fs-sm); opacity: .85; letter-spacing: normal; text-transform: none; font-weight: 500; }
.data thead th.num .ar { text-align: right; }
.data tbody tr { transition: background-color .1s ease; }
.data tbody tr:hover > td { background: #F5F8FD; }
.data tbody tr:last-child > td { border-bottom: 0; }
.data td.num, .data th.num { text-align: end; }
.data td.nowrap { white-space: nowrap; }
.data .col-ng { white-space: nowrap; width: 1%; }
.data .col-company { min-width: 210px; }
.data .col-commodity { min-width: 120px; max-width: 200px; }
/* Active orders table fits its box from 1280px up without horizontal scroll
   (QA 00120 P1, cleanup 2026-09-29): tighter padding; headers use the shared
   table header style (English over Arabic, left-aligned); status badges show the short stage label (never wrap); names (customer,
   commodity, vendors, owners) wrap instead of being cut with an
   ellipsis; Owners and the View / Edit buttons always stay visible. The
   Archive table shares these rules (data--orders data--archive). */
/* Names and the commodity line are never cut in these tables (QA 00122 P2-1..3). */
.data--orders .clamp { display: block; -webkit-line-clamp: unset; overflow: visible; }
@media (min-width: 901px) {
  .data--orders th, .data--orders td { padding-inline: var(--s-2); }
  .data--orders th:first-child, .data--orders td:first-child { padding-inline-start: var(--s-3); }
  .data--orders td.actions { padding-inline-end: var(--s-3); width: 1%; }
  .data--orders td.actions .row-actions--order { flex-direction: column; align-items: stretch; gap: 6px; }
  .data--orders thead th { white-space: normal; }
  .data--orders thead th .en { display: block; white-space: nowrap; }
  .data--orders td { vertical-align: top; }
  .data--orders .col-company { min-width: 140px; }
  .data--orders .col-company .clamp { max-width: 230px; }
  .data--orders td.col-service { white-space: nowrap; font-size: var(--fs-sm); color: var(--text-2); }
  .data--orders th.col-service .en { white-space: normal; }
  .data--orders .col-transport { min-width: 128px; }
  .data--orders .col-commodity { min-width: 110px; width: auto; max-width: 170px; }
  .data--orders .col-commodity .clamp { max-width: none; }
  .data--orders .col-vendors { min-width: 150px; }
  .data--orders .vendors { max-width: 230px; gap: 3px; line-height: 1.35; }
  .data--orders .vendors span, .data--orders .owners > span { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
  .data--orders .owners { min-width: 110px; max-width: 150px; white-space: normal; }
  /* Owners (M2): key | value grid from 1381px up (see the 901–1380.98px rule below).
     Vendors keep the inline key + value flow at every width (Design: in the grid they
     made rows much taller and pushed "BL + number" to wrap in Transport). */
  .data--orders .owners { row-gap: 2px; }
  .data--orders .owners > span { display: grid; grid-template-columns: 42px minmax(min-content, 1fr); column-gap: 6px; align-items: baseline; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; }
  .data--orders .owners .k { white-space: nowrap; }
  .data--orders .transport { max-width: 160px; }
}
/* Quality P2-3: the shared 10/12 cell padding from 1536px, where the full Orders table still fits (Design: at 1440, and 1423 with a scrollbar, BL numbers wrap); below that the dense 8px stays. */
@media (min-width: 1536px) {
  .data--orders th, .data--orders td { padding-inline: var(--s-3); }
}
@media (min-width: 901px) and (max-width: 1279.98px) {
  .data--orders .col-vendors { display: none; }
}
/* Below 1381px (1366 + a 15px classic scrollbar: a 1366 window with a visible scrollbar
   lays out at 1351px and BL numbers would wrap) the Active table has no room for the
   owners grid, so owners keep the inline key + value flow there. Active and Archive
   share the rule. */
@media (min-width: 901px) and (max-width: 1380.98px) {
  .data--orders .owners > span { display: block; }
}
@media (max-width: 900px) {
  .data--cards.data--orders .clamp { max-width: none; }
  .data--cards.data--orders .owners { white-space: normal; }
  .data--cards.data--orders .vendors span, .data--cards.data--orders .owners > span { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
}
.ng-link {
  display: inline-block; padding: 2px 7px; border-radius: var(--r-sm);
  background: var(--navy-50); border: 1px solid var(--navy-100);
  font-family: var(--mono); font-weight: 700; font-size: var(--fs-sm); color: var(--navy-900); letter-spacing: -0.01em;
}
a.ng-link:hover { background: var(--navy); border-color: var(--navy); color: #fff; text-decoration: none; }
.cell-main { color: var(--text); font-weight: 600; }
.cell-sub { display: block; color: var(--text-3); font-size: 12px; margin-top: 1px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 300px; word-break: break-word; }
.owners { display: grid; gap: 1px; font-size: var(--fs-sm); line-height: 1.4; white-space: nowrap; color: var(--text-2); }
.owners .k { color: var(--text-4); font-weight: 700; font-size: var(--fs-xs); letter-spacing: .04em; text-transform: uppercase; display: inline-block; min-width: 38px; }
.vendors { display: grid; gap: 1px; font-size: var(--fs-sm); line-height: 1.4; color: var(--text-2); max-width: 240px; }
.vendors span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vendors .k { color: var(--text-4); font-weight: 700; font-size: var(--fs-xs); letter-spacing: .04em; text-transform: uppercase; }
.row--overdue > td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.row--warn > td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
.row--inactive > td { color: var(--text-3); background: var(--surface-2); }
.row--inactive .cell-main { color: var(--text-3); }
.row--unread > td { background: #F7F9FF; }
.row--unread > td:first-child { box-shadow: inset 3px 0 0 var(--navy); }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; align-items: center; }
.row-actions form { margin: 0; }
.data td.actions { text-align: end; white-space: nowrap; width: 1%; }
.data td.actions .row-actions { flex-wrap: nowrap; }
.row-menu { position: relative; }
.row-menu > summary { list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu__panel {
  position: absolute; z-index: 20; inset-inline-end: 0; top: calc(100% + 4px); width: 190px;
  padding: 4px; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-pop);
}
#vendors-table tr:nth-last-child(-n + 3) .row-menu__panel { top: auto; bottom: calc(100% + 4px); }
.row-menu__panel .menu__item { border-radius: var(--r); }
.row-menu__edit { display: none; }
.menu__item--danger { color: var(--danger); }
.menu__item--danger:hover { color: var(--danger); background: var(--danger-bg); }
/* Quality N3: the Delete icon uses the same red as its label (the base `.menu__item .icon` is --text-4).
   The Arabic label also takes the red (colour only). */
.menu__item--danger .icon { color: inherit; }
.menu__item--danger .ar { color: inherit; }
/* Row menus (consistency plan PR 11): app.js opens the panel upward when it would be cut
   off at the bottom of the table box, or floats it over the page when neither side fits. */
.row-menu--up .row-menu__panel { top: auto; bottom: calc(100% + 4px); }
.row-menu--float .row-menu__panel { position: fixed; inset-inline-end: auto; bottom: auto; }
.badge--protected { cursor: help; }
/* Protected rows: badge before Edit, and an empty slot as wide as ••• so Edit lines up with other rows. */
.row-actions--protected .badge--protected { order: -1; }
.row-menu-slot { flex: none; width: 40px; }
.list-result {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px;
  padding: 12px 16px; border-top: 1px solid var(--border); color: var(--text-3); font-size: var(--fs-sm);
}
.data td.actions > .btn--secondary { color: var(--navy); }
.data tbody tr:hover td.actions > .btn--secondary { border-color: var(--navy); background: var(--navy); color: #fff; }
.eta { display: inline-flex; flex-direction: column; line-height: 1.3; white-space: nowrap; }
.eta__date { font-weight: 500; }
.eta__rel { font-size: var(--fs-xs); color: var(--text-3); }
.eta--overdue { display: inline-grid; grid-template-columns: auto auto; justify-content: start; align-items: center; column-gap: 4px; color: var(--danger); font-weight: 600; }
.eta--overdue .icon { width: 14px; height: 14px; }
.eta--overdue .eta__rel {
  grid-column: 1 / -1; justify-self: start; margin-top: 3px; padding: 0 7px; border-radius: 999px; line-height: 1;
  display: inline-flex; align-items: center; height: var(--badge-h); box-sizing: border-box;
  background: var(--danger-bg); border: 1px solid var(--danger-bd); color: var(--danger); font-weight: 700;
}
.edit-row { display: none; }
.edit-row:target, .edit-row.is-open { display: table-row; }
.edit-row > td { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--navy); }
.row-actions--start { justify-content: flex-start; }
.inline-editor { display: grid; gap: 12px; padding: 6px 0; }
.inline-editor .form-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* ---------- empty / error states ---------- */
.empty { display: grid; justify-items: center; gap: 6px; padding: 48px 16px; text-align: center; }
.empty__icon {
  display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--navy-50); color: var(--navy); margin-bottom: 6px;
  box-shadow: 0 0 0 8px rgba(238, 242, 249, 0.55);
}
.empty__icon .icon { width: 22px; height: 22px; }
.empty__title { font-weight: 700; font-size: var(--fs-lg); color: var(--text); }
.empty__text { color: var(--text-3); font-size: 13px; max-width: 48ch; }
.empty .btn { margin-top: 10px; }
.empty .ar { font-family: "Noto Sans Arabic", Inter, system-ui, sans-serif; }
.empty__title--ar { margin-top: -4px; font-size: 14px; color: var(--text-2, var(--text)); }
.empty .btn .ar { margin-inline-start: 6px; opacity: .85; }
.panel-center .ar { font-family: "Noto Sans Arabic", Inter, system-ui, sans-serif; }
.error-code { font-size: var(--fs-2xl); font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--navy); font-variant-numeric: tabular-nums; }
.error-brand { height: 26px; width: auto; }
.data td.empty-cell { padding: 0; }
.panel-center { max-width: 480px; margin: 56px auto; text-align: center; border-top: 4px solid var(--navy); }
.panel-center .card__body { display: grid; gap: 12px; justify-items: center; padding: 36px 32px 32px; }
.panel-center h1 { font-size: 20px; }
.panel-center h1 .ar { font-size: var(--fs-lg); }
.panel-center p { color: var(--text-3); }
.panel-center .page-actions { justify-content: center; margin-top: 6px; }

/* ---------- tabs (settings) ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px 12px;
  color: var(--text-3); font-weight: 600; white-space: nowrap;
}
.tabs a .icon { color: var(--text-4); }
.tabs a:hover { color: var(--navy); text-decoration: none; }
.tabs a:hover .icon { color: var(--navy); }
.tabs a[aria-current="page"] { color: var(--navy-900); }
.tabs a[aria-current="page"] .icon { color: var(--orange-text); }
.tabs a[aria-current="page"]::after {
  content: ""; position: absolute; inset-inline: 10px; bottom: 0; height: 3px; background: var(--orange); border-radius: 3px 3px 0 0;
}

/* ---------- disclosure (<details>) used for add / edit panels ---------- */
.disclosure > summary { list-style: none; cursor: pointer; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary .icon--chev { transition: transform .15s ease; color: var(--text-4); }
.disclosure[open] > summary .icon--chev { transform: rotate(180deg); }
.disclosure__body { padding: 18px; border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card.disclosure > summary { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: var(--r-lg); }
.card.disclosure[open] > summary { border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--surface-2); }
.card.disclosure > summary:hover { background: var(--surface-2); }
.card.disclosure > summary .card__title > .icon { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--navy); color: #fff; }

/* Notification list */
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: start; padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
.notice:last-child { border-bottom: 0; }
.notice__dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; background: transparent; border: 2px solid var(--border-strong); }
.notice--unread { background: #F7F9FF; box-shadow: inset 3px 0 0 var(--navy); }
.notice--unread .notice__dot { background: var(--orange); border-color: var(--orange); }
.notice__title { font-weight: 600; }
.notice--unread .notice__title { font-weight: 700; }
.notice__body { color: var(--text-3); font-size: 13px; }
.notice__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; color: var(--text-4); font-size: 12px; }
.notice__meta a { font-family: var(--mono); font-weight: 700; padding: 0 6px; border-radius: var(--r-sm); background: var(--navy-50); color: var(--navy-900); }
.notice__actions { align-self: center; }

/* Activity */
.action-pill { display: inline-flex; padding: 1px 9px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); text-transform: capitalize; }
.action-pill--created, .action-pill--reactivated { background: var(--success-bg); color: var(--success); border-color: var(--success-bd); }
.action-pill--updated { background: var(--info-bg); color: var(--info); border-color: var(--info-bd); }
.action-pill--deleted { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bd); }
.action-pill--notify_none { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-bd); text-transform: none; }
.time { white-space: nowrap; }
.unit { margin-inline-start: 1px; color: var(--text-3); font-size: var(--fs-xs); }
.time .cell-sub { font-size: var(--fs-xs); }

/* Role reference */
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.role-card { padding: 14px 16px; border: 1px solid var(--border); border-top: 3px solid var(--border-strong); border-radius: var(--r); background: var(--surface-2); }
.role-card:nth-child(1) { border-top-color: var(--navy-900); }
.role-card:nth-child(2) { border-top-color: #1D4ED8; }
.role-card:nth-child(3) { border-top-color: var(--orange); }
.role-card p { margin-top: 8px; color: var(--text-3); font-size: var(--fs-sm); }

/* ---------- confirmation dialog (app.js) ---------- */
.dialog {
  border: 0; border-top: 4px solid var(--navy); padding: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-pop);
  width: min(460px, calc(100vw - 32px)); color: var(--text); overflow: hidden;
  background: var(--surface); opacity: 1; z-index: 1000;
}
.dialog--danger { border-top-color: var(--danger); }
.dialog[open] { animation: dialog-in .14s ease-out; }
@keyframes dialog-in { from { transform: translateY(6px) scale(.98); } to { transform: none; } }
.dialog::backdrop { position: fixed; inset: 0; background: rgba(15, 24, 48, 0.6); }
.dialog__body { background: var(--surface); padding: 22px 24px 18px; display: grid; gap: 8px; }
.dialog__title { font-size: var(--fs-lg); font-weight: 700; }
.dialog--danger .dialog__title { color: var(--danger); }
.dialog__text { color: var(--text-2); white-space: pre-line; font-size: var(--fs-md); }
.dialog__confirm { margin-top: 8px; }
.dialog__list { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; max-height: 45vh; overflow-y: auto; color: var(--text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 24px; background: var(--surface-2); border-top: 1px solid var(--border); }
/* Audit 03/11/2026: a long label ("Sonraki aşama: Sınır Gümrüklemesi") wraps inside the dialog at 390, never out of it. */
.dialog__actions .btn { height: auto; min-height: var(--ctl-md); max-width: 100%; padding-block: 8px; line-height: 1.25; white-space: normal; text-align: center; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bg); }
.auth__brand {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: 44px 52px; background-color: var(--navy-900); color: #fff; overflow: hidden;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(900px 480px at 100% 110%, rgba(244, 123, 32, 0.20), transparent 60%);
  background-size: 44px 44px, 44px 44px, auto;
}
.auth__brand::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 4px; background: var(--orange); }
.auth__brand img { height: 30px; width: auto; align-self: flex-start; }
.auth__brand h1 { color: #fff; font-size: var(--fs-2xl); line-height: 1.25; max-width: 20ch; letter-spacing: -0.01em; }
.auth__brand h1 .alt { display: block; margin-top: 12px; color: rgba(255, 255, 255, .72); font-size: var(--fs-lg); font-weight: 500; font-family: var(--font-ar); letter-spacing: normal; }
.auth__product {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, .9); font-family: var(--font); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.auth__product::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.auth__brand p { color: rgba(255, 255, 255, .66); max-width: 46ch; font-size: var(--fs-md); }
.auth__brand .auth__description-ar { color: rgba(255, 255, 255, .82); text-align: start; }
.auth__brand small { color: rgba(255, 255, 255, .45); }
.auth__main { display: grid; align-content: center; justify-items: center; gap: 16px; padding: 32px 24px; }
.auth__card { width: min(420px, 100%); box-shadow: var(--shadow-2); border-top: 4px solid var(--navy); }
.auth__card .card__body { padding: 32px; display: grid; gap: 20px; }
.auth__title { font-size: var(--fs-xl); }
.auth__title .alt { display: block; margin-top: 4px; color: var(--text-3); font-size: 14px; font-weight: 500; font-family: var(--font); }
.auth [lang="ar"], .auth h1, .auth h2 { font-family: var(--font-ar); }
.auth .alt { text-align: right; }
.auth__card input[type] { height: var(--ctl-md); }
.auth__card .btn { height: var(--ctl-touch); font-size: var(--fs-md); }
.auth__foot { color: var(--text-4); font-size: 12px; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .data .hide-xl { display: none; }
}
@media (max-width: 1180px) {
  .form-layout { grid-template-columns: minmax(0, 1fr); }
  .form-actions { width: calc(100% + (2 * var(--gutter))); }
  .form-aside { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .user-btn__name { display: none; }
}
@media (max-width: 1100px) {
  .pipeline { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .stage { padding: 12px 12px 10px; }
  .stage__count { font-size: var(--fs-2xl); }
  .data .hide-lg { display: none; }
  .data .col-company { min-width: 150px; }
}
/* The menu checkbox leaves only where the drawer does not exist (from 1280px since 31/10/2026: the 1101–1279px
   top-bar nav became the drawer). */
@media (min-width: 1280px) {
  .nav-toggle { display: none; }
}
@media (max-width: 1100px) {
  :root { --gutter: 18px; --header-h: 56px; }
  .app-header__inner { gap: 10px; }
  .nav-toggle-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
    border-radius: var(--r); color: #fff; cursor: pointer; order: -1; margin-inline-start: -6px;
  }
  .nav-toggle-btn:hover { background: rgba(255, 255, 255, 0.09); }
  .nav-toggle:focus-visible + .nav-toggle-btn { box-shadow: 0 0 0 3px rgba(244, 123, 32, .5); }
  .nav-toggle:checked + .nav-toggle-btn { background: rgba(255, 255, 255, 0.12); }
  /* Mobile drawer: navy sheet under the header. */
  .main-nav {
    display: none; position: fixed; top: var(--header-h); inset-inline: 0; bottom: 0; z-index: 50;
    flex-direction: column; align-items: stretch; height: auto; gap: 2px; padding: 12px 14px 28px;
    background: var(--navy-950); border-top: 1px solid rgba(255, 255, 255, 0.08); overflow-y: auto;
  }
  .nav-toggle:checked ~ .main-nav { display: flex; animation: drawer-in .16s ease-out; }
  .nav-link { height: 50px; flex-shrink: 0; padding: 0 14px; font-size: var(--fs-lg); color: rgba(255, 255, 255, 0.8); }
  .nav-link .ar { margin-inline-start: auto; }
  .nav-link .count { margin-inline-start: 8px; }
  .nav-link[aria-current="page"] { background: rgba(255, 255, 255, 0.09); }
  .nav-link[aria-current="page"]::after { inset-inline: auto; inset-inline-start: 0; top: 12px; bottom: 12px; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .nav-mobile-only { display: flex; }
  .nav-divider { height: 1px; background: rgba(255, 255, 255, 0.1); margin: 10px 4px; }
  .btn--new .btn__label { display: none; }
  .btn--new { width: var(--ctl-md); padding: 0; }
  .brand__product { display: none; }
  .data .hide-md { display: none; }
  .page-title { font-size: var(--fs-xl); }
  .page-title .ar { font-size: var(--fs-lg); }
}
@keyframes drawer-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
  /* Brand link touch target >= 44px (WCAG 2.5.5 / Design); fits inside the 56px
     header and stays centred, so nothing moves visually. */
  .brand { display: inline-flex; align-items: center; min-height: 44px; padding-block: 0; }
  /* Tables become a list of separate cards on tablets and phones. */
  .data--cards thead { display: none; }
  .data--cards { display: block; }
  .data--cards tbody { display: grid; gap: var(--s-3); padding: var(--s-3); background: var(--surface-2); }
  .data--cards tbody tr {
    position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s-3) var(--s-4);
    padding: var(--s-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    box-shadow: var(--shadow-1); overflow: hidden;
  }
  .data--cards tbody tr.row--completed { --tone: var(--stage-done); border-inline-start: 4px solid var(--tone); }
  .data--cards tbody tr.row--cancelled { --tone: var(--stage-cancel); border-inline-start: 4px solid var(--tone); }
  .data--cards .row--completed > td:first-child { box-shadow: none; }
  .data--cards tbody tr:hover > td { background: none; }
  .data--cards tbody td { display: block; padding: 0; border: 0; min-width: 0; }
  .data--cards tbody td[data-label]::before {
    content: attr(data-label); display: block; color: var(--text-4); font-size: var(--fs-xs); font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px;
  }
  .data--cards tbody td { order: 5; }
  .data--cards tbody td.col-ng { order: 0; width: auto; }
  .data--cards tbody td.col-status { order: 1; grid-column: -2 / -1; justify-self: end; }
  .data--cards tbody td.col-company { order: 2; grid-column: 1 / -1; font-size: var(--fs-lg); padding-bottom: var(--s-3); border-bottom: 1px solid var(--border-soft); }
  .data--cards tbody td.actions { order: 9; }
  .data--cards tbody td.card-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .data--cards tbody td.card-wide { grid-column: 1 / -1; }
  .data--cards tbody td.actions { grid-column: 1 / -1; width: auto; text-align: start; padding-top: var(--s-3); border-top: 1px solid var(--border-soft); }
  .data--cards tbody td.actions .row-actions { justify-content: flex-start; }
  .data--cards tbody td.actions .btn { flex: 1; height: var(--ctl-touch); }
  .data--cards tbody td.actions > .btn { width: 100%; }
  /* NG link: 32px chip with a 44px tap area (consistency plan PR 6, M1). */
  .data--cards .ng-link { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; }
  .data--cards a.ng-link { position: relative; }
  .data--cards a.ng-link::after { content: ""; position: absolute; inset: -6px; }
  .data--cards .hide-md, .data--cards .hide-lg, .data--cards .hide-xl { display: block; }
  .data--cards td.hide-sm { display: none; }
  .data--cards .row--overdue { box-shadow: var(--shadow-1), inset 4px 0 0 var(--danger); }
  .data--cards .row--warn { box-shadow: var(--shadow-1), inset 4px 0 0 var(--orange); }
  .data--cards .row--overdue > td:first-child, .data--cards .row--warn > td:first-child { box-shadow: none; }
  .data--cards td.empty-cell { grid-column: 1 / -1; }
  .data--cards .row--inactive { background: var(--surface-2); }
  .data--cards .row--inactive > td { background: none; }
  .data--cards .clamp, .data--cards .vendors { max-width: none; }
  /* Long bilingual category badges wrap inside their half-width card cell. */
  .data--cards .vcat { white-space: normal; flex-wrap: wrap; column-gap: 6px; row-gap: 0; max-width: 100%; border-radius: 10px; }
  .data--cards tr.edit-row { display: none; }
  .data--cards tr.edit-row:target, .data--cards tr.edit-row.is-open { display: block; }
  .data--cards tr.edit-row > td { box-shadow: none; background: none; }
  #vendors-table tbody { gap: 0; padding: 0; background: var(--surface); }
  #vendors-table tbody tr[data-vendor-row] {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; min-height: 64px;
    padding: 10px 12px; border: 0; border-bottom: 1px solid var(--border-soft); border-radius: 0; box-shadow: none;
  }
  #vendors-table tbody tr[data-vendor-row] .col-company {
    grid-column: 1; grid-row: 1; order: 0; padding: 0; border: 0; font-size: var(--fs-md);
  }
  #vendors-table tbody tr[data-vendor-row] .col-company .cell-sub { display: none; }
  #vendors-table tbody tr[data-vendor-row] td.col-category { grid-column: 1; grid-row: 2; order: 1; }
  #vendors-table tbody tr[data-vendor-row] td.col-state { grid-column: 2; grid-row: 1; order: 2; justify-self: end; }
  #vendors-table tbody tr[data-vendor-row] td.col-location,
  #vendors-table tbody tr[data-vendor-row] td.col-created { display: none; }
  #vendors-table tbody tr[data-vendor-row] td.actions {
    grid-column: 2; grid-row: 2; order: 3; padding: 0; border: 0; align-self: end;
  }
  #vendors-table tbody tr[data-vendor-row] td[data-label]::before { display: none; }
  #vendors-table .row-actions .btn--secondary { display: none; }
  /* The category pill keeps its background/border on phones so every category stays distinct. */
  #vendors-table .vcat { padding: 1px 8px; font-size: var(--fs-xs); }
  #vendors-table .state { padding: 0; border: 0; background: transparent; }
  #vendors-table .row-menu__panel { position: fixed; inset-inline: 12px; top: auto; bottom: 12px; width: auto; }
  /* Beats the more specific desktop pre-flip for the last rows, so the bottom sheet stays on screen. */
  #vendors-table tr:nth-last-child(-n + 3) .row-menu__panel { top: auto; bottom: 12px; }
  #vendors-table .row-menu__edit { display: flex; }
  /* Users / Companies cards: Edit + ••• stay side by side; the menu opens as the same bottom sheet as Vendors. */
  .data--cards td.actions .row-menu > summary { width: var(--ctl-touch); }
  /* Protected rows: badge on its own line; Edit + an empty slot line up with Edit + ••• on other cards. */
  .data--cards tbody td.actions .row-actions--protected { display: grid; grid-template-columns: minmax(0, 1fr) var(--ctl-touch); gap: 6px; }
  .data--cards tbody td.actions .row-actions--protected .badge--protected { grid-column: 1 / -1; justify-self: start; }
  .data--cards .row-menu-slot { width: auto; }
  .data--cards .row-menu__panel { position: fixed; inset-inline: 12px; top: auto; bottom: 12px; width: auto; }
  .table-scroll--tall { max-height: none; min-height: 0; }
}
@media (max-width: 760px) {
  :root { --gutter: 14px; }
  .page-header { padding: 16px 0 14px; margin-bottom: 16px; }
  .page-header > .tabs { margin-bottom: -14px; }
  .page-title { font-size: 20px; }
  .page-sub { font-size: 13px; }
  .toolbar { padding: 14px; gap: 10px; }
  .toolbar__search, .toolbar__field { flex: 1 1 100%; }
  .toolbar__actions { flex: 1 1 100%; }
  .toolbar__actions .btn { flex: 1; }
  .toolbar__row { flex-direction: column; align-items: stretch; padding: 10px 14px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -14px; padding-inline: 14px; }
  .chips::-webkit-scrollbar { display: none; }
  .form-grid, .form-grid--2 { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  /* iOS Safari zooms the page in when a field under 16px gets focus, and the
     zoom sticks after submitting — the result message then sits off-screen. */
  input[type="text"], input[type="email"], input[type="password"], input[type="search"],
  input[type="date"], input[type="number"], input[type="tel"], select, textarea { font-size: 16px; }
  input[type="text"], input[type="email"], input[type="password"], input[type="search"],
  input[type="date"], input[type="number"], input[type="tel"], select, textarea { min-height: var(--ctl-touch); }
  .date-field .date-field__input { padding-inline-end: 48px; }
  .date-field__btn { inset-inline-end: 0; width: var(--ctl-touch); height: var(--ctl-touch); }
  .date-field .date-field__native { min-height: 0; }
  .btn, .btn--sm, .icon-btn, .user-btn, .nav-toggle-btn, .link-btn, .page-header__eyebrow a,
  .chip, .pager__num, .pager__step { min-height: var(--ctl-touch); }
  .icon-btn, .nav-toggle-btn, .btn--icon { min-width: var(--ctl-touch); width: var(--ctl-touch); }
  .row-menu__panel .menu__item { min-height: var(--ctl-touch); }
  .form-main { grid-template-columns: minmax(0, 1fr); }
  .form-layout { display: flex; flex-direction: column; }
  .form-main { order: 2; width: 100%; }
  .form-aside { order: 1; width: 100%; }
  .form-aside > .card:first-child { width: 100%; }
  .equipment__row { grid-template-columns: minmax(0, 1fr); }
  /* Phones: stages wrap 3 + 2 (six-column grid) so every stage stays fully visible. */
  .pipeline { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .stage { grid-column: span 2; padding: 11px 12px 10px; }
  .stage:nth-child(n+4) { grid-column: span 3; }
  .stage + .stage::before { display: none; }
  .stage:nth-child(3n+1) { border-inline-start: 0; }
  .stage:nth-child(5) { border-inline-start: 1px solid var(--border-soft); }
  /* Step circle above the label so each English word fits whole — never
     "CONFIRM/ED" (QA 00110). Words may wrap between each other, not inside. */
  .stage__name { flex-direction: column; align-items: flex-start; gap: 6px; }
  .stage__label { overflow-wrap: normal; word-break: normal; font-size: var(--fs-xs); }
  .stage__count { font-size: var(--fs-2xl); }
  .field--span-2 { grid-column: auto; }
  .form-section__head { padding: 12px var(--s-4); grid-template-columns: minmax(0, 1fr) 20px; grid-template-areas: "t c" "b c"; }
  .form-section__head > .form-section__title { grid-area: t; }
  .form-section__head > .section-requirement { grid-area: b; justify-self: start; margin-inline-start: 34px; }
  .form-section__head > .form-section__chev { grid-area: c; }
  .form-section__desc { padding: 8px var(--s-4) 0; }
  .form-section__title .ar { display: block; margin-inline-start: 0; }
  .form-section .card__body { padding: var(--s-4); }
  .form-actions {
    flex-wrap: nowrap; gap: var(--s-2);
    bottom: 0; padding: var(--s-2) var(--s-3) calc(var(--s-2) + env(safe-area-inset-bottom)); border-radius: 0;
    margin-inline: calc(-1 * var(--gutter)); border-inline: 0; border-bottom: 0;
    box-shadow: 0 -6px 18px rgba(14, 22, 41, 0.10);
  }
  .form-actions .btn { height: var(--ctl-touch); }
  .form-actions .btn--primary { flex: 1 1 auto; min-width: 0; }
  .form-actions .btn--ghost { flex: 0 0 auto; }
  /* No primary button (read-only): the Back link is first and fills the bar. */
  .form-actions .btn--ghost:first-child { flex: 1 1 auto; }
  .form-actions__note { display: none; }
  .card__header, .card__body { padding-inline: var(--s-4); }
  .card__header > .input-icon { flex-basis: 100%; }
  /* Settings tabs: all four visible as a 2 × 2 grid of ≥44px targets (five with Ports: a third row). */
  .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; overflow: visible; }
  .page-header > .tabs { border-bottom: 0; }
  .tabs a { min-height: 44px; padding: 8px 10px; justify-content: center; white-space: normal; text-align: center;
            border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
  .tabs a[aria-current="page"] { border-color: var(--navy-200); background: var(--navy-50); }
  .tabs a[aria-current="page"]::after { inset-inline: 12px; }
  .menu__panel { position: fixed; top: calc(var(--header-h) + 6px); inset-inline: 10px; width: auto; }
  /* The user menu in the drawer opens from its button: fixed, its bottom: calc(100% + 4px) is above the screen. */
  #app-sidebar .sidebar__foot .menu__panel { position: absolute; }
  .notice { padding: 12px 14px; grid-template-columns: auto minmax(0, 1fr); }
  .notice__actions { grid-column: 2; justify-self: start; }
  .panel-center { margin: 32px auto; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__brand { padding: 26px 22px 24px; gap: 14px; }
  .auth__brand h1 { font-size: var(--fs-xl); }
  .auth__brand h1 .alt { font-size: 14px; margin-top: 6px; }
  .auth__product { margin-bottom: 10px; }
  .auth__brand p, .auth__brand small { display: none; }
  .auth__main { align-content: start; padding: 22px 14px 32px; }
  .auth__card .card__body { padding: 24px 20px; }
}
@media (max-width: 420px) {
  .page-actions .btn { flex: 1; }
  .header-actions { gap: 4px; }
  .user-btn { padding-inline-end: 4px; }
  .user-btn > .icon { display: none; }
}
@media (max-width: 359.98px) {
  /* Narrowest phones: the primary label may wrap to two lines inside the 44px button (still one row). */
  .form-actions .btn--primary { flex-wrap: wrap; row-gap: 0; white-space: normal; line-height: 1.2; padding-inline: var(--s-3); }
}
@media (max-width: 340px) {
  .brand img { height: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .app-header, .footer, .form-actions, .toolbar, .page-actions { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
  .page-header { box-shadow: none; clip-path: none; }
  .table-scroll, .table-scroll--tall { max-height: none; overflow: visible; }
  .main-nav, .nav-toggle-btn { display: none !important; }
}


/* V2.2 — repeatable transport/service rows */
.transport-builder { gap: 10px; min-width: 0; }
/* The unit-row builders always take the full width of their section (QA 00118
   P1-L1): next to the Shipping line + Shipping Agency pickers a span-2 builder
   landed in the last grid columns and its rows (and ✕) were clipped. */
.form-grid > .transport-builder { grid-column: 1 / -1; }
.repeat-list { display: grid; gap: 10px; }
.repeat-row {
  display: grid;
  grid-template-columns: minmax(72px,.45fr) minmax(140px,1fr) minmax(140px,1fr) 40px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
/* Fluid columns so the ✕ button always fits inside a half-width card (QA 00110 P1-3). */
.repeat-row .repeat-remove { height: var(--ctl-md); }
.repeat-row > label { min-width: 0; }
.repeat-row input, .repeat-row select { width: 100%; }
@media (max-width: 760px) {
  .repeat-row { grid-template-columns: 1fr; }
  .repeat-row .repeat-remove { justify-self: start; }
}
/* LCL packages (design v6.4 L1, Quality P3-11): the quantity and the type side by
   side in one row, then ✕ — on a phone too, like the weight / CBM fields above. */
.repeat-row.repeat-row--package { grid-template-columns: minmax(80px, .5fr) minmax(0, 1fr) 40px; }
.repeat-row.repeat-row--package .repeat-remove { justify-self: end; }

/* ---------- Port & other services (.svc-*; design spec port-services-final) ----------
   Card 8 of the order form spans the full width. Grid shared by the header row
   and every row: Service · Provider · Description · ×. The Service <select> is
   always what is submitted; app.js adds a select-only combobox on desktop
   (.svc-builder.is-enhanced) and the Other name input (.svc-other). Logical
   properties only (RTL-safe); Arabic spans are spaced with gap, not margins. */
.svc-section {
  --svc-col-service: 240px; --svc-col-provider: 260px; --svc-col-remove: 40px;
  --svc-gap: 12px; --svc-h: 40px; --svc-r: var(--r, 6px);
  --svc-navy: var(--navy, #14327A); --svc-border: var(--border, #DFE5EE);
  --svc-danger: var(--danger, #B42318);
}
.svc-builder { gap: 0; }
.svc-builder > .field__error { margin-bottom: 12px; }
.svc-builder > .field__label { margin-bottom: 8px; }
.svc-grid {
  display: grid; align-items: center; column-gap: var(--svc-gap);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) var(--svc-col-remove); /* Design 21/10: no Description column */
}
.svc-head { padding-bottom: 6px; }
.svc-head__cell {
  display: flex; align-items: baseline; gap: 6px; white-space: nowrap;
  font: 700 12px/1.3 var(--font); color: var(--text-3, #56657A); text-transform: uppercase; letter-spacing: .04em;
}
.svc-section .svc-head__cell .ar, .svc-section .svc-row__label .ar, .svc-section .svc-add .ar,
.svc-view__th .ar, .svc-view__k .ar { margin-inline-start: 0; font-size: 12px; }
.svc-req { color: var(--svc-danger); }
.svc-list { list-style: none; margin: 0; padding: 0; display: grid; row-gap: var(--svc-gap); }
.svc-row { position: relative; }
.svc-field { min-width: 0; }
.svc-field--service { display: grid; row-gap: 6px; }
.svc-row__label { display: none; } /* per-field labels are shown on mobile only */

/* Controls: native <select>/<input> and the combobox share one look. */
.svc-section .svc-ctl {
  position: relative; height: var(--svc-h); width: 100%; min-width: 0;
  border: 1px solid var(--svc-border); border-radius: var(--svc-r); background-color: #fff;
  padding: 0 12px; font: 400 14px/1 var(--font); color: var(--text, #0E1629); box-shadow: none;
}
.svc-section select.svc-ctl { padding-inline-end: 32px; font-weight: 600; }
.svc-section select.svc-ctl option { color: var(--text, #0E1629); font-weight: 500; }
.svc-section .svc-ctl.is-placeholder, .svc-section .svc-ctl.is-na { color: var(--text-3, #56657A); font-weight: 500; }
.svc-section .svc-ctl:hover { border-color: #C5CFDE; }
.svc-section .svc-ctl:focus, .svc-section .svc-ctl:focus-within, .svc-section .svc-ctl.is-open {
  border-color: var(--svc-navy); box-shadow: 0 0 0 3px rgba(20, 50, 122, .15); outline: none;
}
.svc-section .svc-ctl.is-error { border-color: var(--svc-danger); box-shadow: 0 0 0 3px rgba(180, 35, 24, .12); }
.svc-section .svc-ctl[disabled] { color: var(--text-3); background-color: var(--surface-3); cursor: not-allowed; }
.svc-error {
  grid-column: 1 / -1; margin-top: 6px; display: flex; gap: 6px; align-items: center;
  font-size: 12px; font-weight: 600; color: var(--svc-danger);
}

/* Combobox (desktop, JS): the native select stays in the DOM, out of view. */
.svc-combo { display: none; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.svc-builder.is-enhanced .svc-combo { display: flex; }
.svc-builder.is-enhanced .svc-field--service > select.svc-ctl.has-combo { display: none; }
.svc-ctl__val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.svc-combo.is-placeholder .svc-ctl__val { font-weight: 500; }
.svc-chev {
  flex: none; width: 8px; height: 8px; border-inline-end: 2px solid #8A96A8; border-bottom: 2px solid #8A96A8;
  transform: translateY(-2px) rotate(45deg);
}
.svc-combo.is-open .svc-chev { transform: translateY(2px) rotate(225deg); border-color: var(--svc-navy); }

/* "Other…" mode: chip + typed name (shown uppercase, stored as typed) + back to list. */
.svc-section .svc-other { display: flex; align-items: center; gap: 8px; padding-inline-start: 6px; padding-inline-end: 4px; }
.svc-builder.svc-js .svc-row.is-other .svc-field--service > select.svc-ctl,
.svc-builder.svc-js .svc-row.is-other .svc-combo { display: none; }
.svc-chip {
  flex: none; height: 22px; display: inline-flex; align-items: center; padding: 0 7px; border-radius: 999px;
  background: var(--orange-50, #FFF4E6); border: 1px solid #FBD3A0; color: var(--orange-text, #9A4D00);
  font: 700 var(--fs-xs)/1 var(--font); letter-spacing: .02em;
}
.svc-section input.svc-other__input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent;
  box-shadow: none; font-weight: 600; text-transform: uppercase; font-size: inherit; text-overflow: ellipsis;
}
.svc-section input.svc-other__input:focus { box-shadow: none; }
.svc-back {
  flex: none; width: var(--ctl-sm); height: var(--ctl-sm); padding: 0; border: 0; border-radius: 4px; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--text-3, #56657A);
}
.svc-back:hover { background: var(--navy-50, #EEF2F9); color: var(--svc-navy); }
/* The Other name keeps the Service column's width at rest and while typing
   (a long name scrolls inside the input and shows an ellipsis at rest). */

/* Without JS (app.js adds html.js) the Add / remove / Other-back buttons would
   do nothing: hide them. The rendered rows still submit, and the Other name
   input is shown under the Service select so "Other…" works in one submit
   (the name is ignored unless the service is Other). */
html:not(.js) [data-repeat-add], html:not(.js) [data-repeat-remove],
html:not(.js) [data-svc-empty-add], html:not(.js) [data-svc-back] { display: none !important; }
html:not(.js) .svc-section .svc-row .svc-other[hidden] { display: flex !important; }
html:not(.js) .svc-section .svc-row .svc-other input[hidden] { display: block !important; }

/* Listbox: appended to <body> and positioned by app.js (position: fixed), so
   it is never clipped by the card and flips upward when there is no room. */
.svc-listbox {
  position: fixed; z-index: 60; min-width: 240px; max-height: 320px; overflow: auto; margin: 0; padding: 6px;
  list-style: none; background: #fff; border: 1px solid var(--border, #DFE5EE); border-radius: var(--r-lg, 8px);
  box-shadow: 0 12px 28px rgba(14, 22, 41, .16); font: 500 14px/1 var(--font); color: var(--text, #0E1629);
}
.svc-opt {
  height: 36px; padding: 0 10px; border-radius: 5px; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; cursor: pointer;
}
.svc-opt.is-active { background: var(--surface-2, #F7F9FC); }
.svc-opt[aria-selected="true"] { background: var(--navy-50, #EEF2F9); color: var(--navy, #14327A); font-weight: 700; }
.svc-opt[aria-selected="true"]::after { content: "✓"; font-weight: 700; }
.svc-opt--other { color: var(--text-3, #56657A); }
.svc-sep { height: 1px; margin: 4px 0; background: var(--border-soft, #EBEFF5); }

/* Remove × */
.svc-remove {
  width: var(--svc-col-remove); height: var(--svc-h); padding: 0; display: grid; place-items: center;
  border: 1px solid var(--danger-bd, #FECDCA); border-radius: var(--svc-r); background: #fff;
  color: var(--svc-danger); cursor: pointer;
}
.svc-remove:hover { background: var(--danger-bg, #FEF3F2); }
.svc-remove:focus-visible, .svc-add:focus-visible, .svc-back:focus-visible { outline: 2px solid var(--svc-navy); outline-offset: 2px; }
.svc-remove .icon, .svc-back .icon { width: 16px; height: 16px; }

/* Footer: + Add service, right-aligned under the rows. */
.svc-foot { margin-top: 16px; display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; }
.svc-add {
  height: var(--svc-h); padding: 0 16px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  border: 1px dashed var(--svc-navy); border-radius: var(--svc-r); background: var(--navy-50, #EEF2F9);
  color: var(--svc-navy); font: 700 14px/1 var(--font); cursor: pointer;
}
.svc-section .svc-add .ar { color: inherit; font-size: 13px; }
.svc-add--primary { border: 1px solid var(--svc-navy); background: var(--svc-navy); color: #fff; }
.svc-section .svc-add--primary .ar { color: var(--navy-100, #DCE4F2); }
.svc-hint { font-size: 12px; color: var(--text-3, #56657A); line-height: 1.5; }
.svc-intro { margin: 0 0 16px; }

/* Empty state (no rows). */
.svc-empty {
  border: 1px dashed #C5CFDE; border-radius: var(--r-lg, 8px); background: var(--surface-2, #F7F9FC);
  padding: 28px 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
}
.svc-empty__icon {
  width: 40px; height: 40px; margin-bottom: 4px; border-radius: 50%; background: #fff;
  border: 1px solid var(--svc-border); display: grid; place-items: center; color: var(--text-3, #56657A);
}
.svc-empty__t { font-weight: 600; color: var(--text-2, #334155); font-size: 14px; }
.svc-empty .svc-add { margin-top: 10px; }

/* Audit R-27: large phones / small tablets (641–760px) get the phone's 44px controls at 16px too (no iOS zoom on
   focus); the grid layout itself is unchanged. */
@media (max-width: 760px) {
  .svc-section { --svc-h: 44px; }
  .svc-section .svc-ctl { font-size: 16px; }
}
/* Mobile (≤ 640px): stacked mini-cards, 44px controls at 16px (no iOS zoom). */
@media (max-width: 640px) {
  .svc-section { --svc-h: 44px; }
  .svc-head { display: none; }
  .svc-list { row-gap: 12px; }
  .svc-row.svc-grid {
    grid-template-columns: 1fr; row-gap: 12px; padding: 12px; padding-top: 8px;
    border: 1px solid var(--svc-border); border-radius: var(--r-lg, 8px); background: var(--surface-2, #F7F9FC);
  }
  .svc-field { display: grid; row-gap: 6px; }
  .svc-row__label {
    display: flex; align-items: center; gap: 6px; font: 600 13px/1.3 var(--font); color: var(--text-2, #334155);
  }
  .svc-field--service .svc-row__label { min-height: 36px; padding-inline-end: 48px; } /* room for × */
  .svc-section .svc-ctl { font-size: 16px; }
  .svc-remove {
    position: absolute; top: 4px; inset-inline-end: 4px; width: 44px; height: 44px;
    border-color: transparent; background: transparent;
  }
  .svc-remove .icon { width: 18px; height: 18px; }
  .svc-foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .svc-add { width: 100%; justify-content: center; height: 44px; font-size: var(--fs-lg); }
  .svc-back { width: var(--ctl-touch); height: var(--ctl-touch); }
  .svc-empty { padding: 24px 16px; }
}

/* View page (read-only): table on desktop, stacked list on phones. */
.svc-view { width: 100%; }
.svc-view__table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.svc-view__table col.c-svc { width: 28%; }
.svc-view__table col.c-prov { width: 32%; }
.svc-view__table th {
  text-align: start; vertical-align: bottom; padding: 10px var(--s-3); white-space: nowrap; background: #F3F6FA;
  font: 700 var(--fs-xs)/1.3 var(--font); color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--border);
}
/* Quality P2: same header look as `.data thead th` (EN uppercase, AR on its own line under it). */
.svc-view__th { display: block; }
.svc-view__table .svc-view__th .ar { display: block; margin: 2px 0 0; text-align: left; font-size: var(--fs-sm); opacity: .85; letter-spacing: normal; text-transform: none; font-weight: 500; line-height: 1.2; }
.svc-view__table td {
  padding: 10px var(--s-3); vertical-align: top; overflow-wrap: anywhere;
  font: 700 14px/1.4 var(--font); text-transform: uppercase; color: var(--text, #0E1629);
  border-bottom: 1px solid var(--border-soft, #EBEFF5);
}
.svc-view__table tr:last-child td { border-bottom: 0; }
.svc-view .is-empty { color: var(--text-3, #56657A); font-weight: 500; }
.svc-view__none { margin: 0; font: 400 var(--fs-md, 14px)/1.4 var(--font); color: var(--text-4); }
.svc-view__list { list-style: none; margin: 0; padding: 0; display: none; }
.svc-view__item { padding: 12px 0; border-bottom: 1px solid var(--border-soft, #EBEFF5); display: grid; row-gap: 8px; }
.svc-view__item:first-child { padding-top: 0; }
.svc-view__item:last-child { border-bottom: 0; padding-bottom: 0; }
.svc-view__kv { display: grid; row-gap: 2px; }
.svc-view__k { font: 600 12px/1.3 var(--font); color: var(--text-2, #334155); display: flex; gap: 4px; align-items: baseline; }
.svc-view__svc, .svc-view__v { font: 700 14px/1.4 var(--font); text-transform: uppercase; color: var(--text, #0E1629); overflow-wrap: anywhere; }
/* "(not in list)" is a note, not a value: keep its case in the uppercase cells. */
.svc-view .svc-unlisted { text-transform: none; }
/* Design 24/10 r2 P2-5: the Other services table reads like the other view sections — header and values in
   their own case, not uppercase. */
.svc-view__table th { letter-spacing: normal; text-transform: none; font-size: 12px; }
.svc-view__table td, .svc-view__svc, .svc-view__v { text-transform: none; }
@media (max-width: 640px) {
  .svc-view__table { display: none; }
  .svc-view__list { display: block; }
}

/* ---------- Pager (paginated order lists) ---------- */
.pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 16px; border-top: 1px solid var(--border);
}
.pager__nums { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager__num, .pager__step {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 36px; min-height: 36px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.pager a:hover { border-color: var(--navy-200); background: var(--navy-50); color: var(--navy); text-decoration: none; }
.pager__num.is-current { background: var(--navy); border-color: var(--navy); color: #fff; }
/* Disabled: a muted colour that stays readable (gap D9: --text-4 on --surface-2
   is about 4.3:1, >= 3:1), not a low opacity (was .45: about 2:1). */
.pager__step.is-disabled { color: var(--text-4); background: var(--surface-2); border-color: var(--border-soft); cursor: default; }
.pager__step .ar { font-weight: 500; }
.pager__gap { padding: 0 4px; color: var(--text-3); }
.pager__of { display: none; color: var(--text-3); font-size: 13px; }
@media (max-width: 760px) {
  /* Phones: previous · "Page X of Y" · next, each a comfortable tap target. */
  .pager { justify-content: space-between; }
  .pager__nums { display: none; }
  .pager__of { display: inline; text-align: center; }
  .pager__of .ar { display: block; }
  .pager__step { min-height: 44px; }
}

/* ---------- Settings → Companies: add / edit company form ----------
   MARAS Design spec 2026-09-29: one card ≤ 720px; sections Company / Contact /
   Address; 2 columns (24px × 16px gaps), one column under 640px with 44px /
   16px controls; one EN + AR label line per field at the same height in both
   columns; Arabic hints right-aligned (dir=rtl) under their field. */
.company-card { max-width: 720px; width: 100%; }
.company-card__title { font-size: var(--fs-xl); font-weight: 700; line-height: 1.3; }
.card.disclosure > summary .company-card__title { font-size: var(--fs-xl); }
.company-card__title .ar { font-size: 0.8em; font-weight: 600; }
.company-card--edit { margin: 4px 0; }
.company-card__head { padding: 16px 20px 14px; border-bottom: 1px solid var(--border-soft); }
.company-card__sub { margin-top: 2px; color: var(--text-3); font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; }
.company-card__body, .company-card .disclosure__body { padding: 20px; }
.cf-section + .cf-section { margin-top: 24px; }
.cf-section__title {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft); color: var(--text-3);
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.cf-section__title .ar { margin: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--text-3); }
.cf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; align-items: start; }
.cf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cf-field--wide { grid-column: 1 / -1; }
.cf-label {
  display: flex; align-items: baseline; gap: 6px; min-height: 21px; white-space: nowrap;
  font-size: var(--fs-sm); font-weight: 600; line-height: 21px; color: var(--label);
}
.cf-label .ar { margin: 0; font-size: var(--fs-sm); font-weight: 500; line-height: 21px; color: var(--text-3); }
.cf-label .req { color: var(--danger); font-weight: 700; text-decoration: none; border: 0; }
.cf-optional { display: inline-flex; gap: 4px; margin-inline-start: auto; font-size: var(--fs-xs); font-weight: 500; color: var(--text-4); }
.cf-optional .ar { font-size: var(--fs-xs); color: var(--text-4); }
.cf-hint { display: grid; gap: 1px; margin: 0; font-size: var(--fs-xs); line-height: 1.5; color: var(--text-4); }
.cf-hint > span[data-city-hint] { display: grid; gap: 1px; }
.cf-hint > span[hidden] { display: none; }
.cf-hint .ar { margin: 0; text-align: right; font-size: var(--fs-xs); color: var(--text-4); }
.cf-error { display: flex; gap: 6px; align-items: flex-start; margin: 0; font-size: var(--fs-xs); font-weight: 600; color: var(--danger); }
.cf-error > span { display: grid; gap: 1px; flex: 1; }
.cf-error .ar { margin: 0; text-align: right; font-size: var(--fs-xs); color: var(--danger); }
.cf-error .icon { width: 14px; height: 14px; margin-top: 1px; }
.field--error .cf-label, .field--error .cf-label .ar { color: var(--danger); }
.company-form input[type="text"], .company-form input[type="tel"], .company-form input[type="email"],
.company-form select, .company-form textarea {
  height: var(--ctl-md); min-height: var(--ctl-md); padding: 0 12px; border-color: var(--border); border-radius: var(--r);
}
.company-form select { padding-inline-end: 32px; }
.company-form textarea { height: auto; min-height: 88px; padding: 9px 12px; line-height: 1.5; }
.company-form :is(input, select, textarea):hover { border-color: var(--border-strong); }
.company-form :is(input, select, textarea):focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(20, 50, 122, .15); }
.company-form :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--danger); background-color: #FFFBFA; }
.company-form :is(input, select, textarea)[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .15); }
.company-form input[dir="ltr"] { text-align: left; }
.company-form .cf-country-search[hidden], .company-form select[hidden] { display: none; }
/* Vendor form: a Port's default port cost mode is hidden for the other categories and switched by
   app.js; without JavaScript it stays visible (the server ignores it for a vendor that is not a port). */
/* Vendor form: Also provides — the further services of a multi-service vendor (migration 0065), one box each. */
.cf-services { display: flex; flex-wrap: wrap; gap: 4px 20px; min-width: 0; margin: 0; padding: 0; border: 0; }
.cf-services legend { float: left; width: 100%; padding: 0; margin-bottom: 2px; }
.cf-services label { display: inline-flex; align-items: center; gap: 8px; min-height: var(--ctl-sm); font-size: var(--fs-sm); color: var(--text); cursor: pointer; }
@media (max-width: 639.98px) {
  .cf-services label { min-height: var(--ctl-touch); }
}
/* Settings → Ports: the mode select of a row. */
#ports-table td select { width: 100%; min-width: 180px; max-width: 340px; }
.cf-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}
.cf-actions .btn { height: var(--ctl-md); padding: 0 var(--s-4); }
.company-form .inline-editor { display: block; padding: 0; }
.cell-sub--place { color: var(--text-4); }
@media (max-width: 639.98px) {
  .company-card { max-width: none; }
  .company-card__head { padding: 14px 16px 12px; }
  .company-card__body, .company-card .disclosure__body { padding: 16px; }
  .cf-grid { grid-template-columns: minmax(0, 1fr); }
  .cf-label { white-space: normal; flex-wrap: wrap; }
  .company-form input[type="text"], .company-form input[type="tel"], .company-form input[type="email"],
  .company-form select { height: var(--ctl-touch); min-height: var(--ctl-touch); font-size: 16px; }
  .company-form textarea { font-size: 16px; }
  .cf-actions { flex-direction: column-reverse; align-items: stretch; }
  .cf-actions .btn { width: 100%; height: var(--ctl-touch); font-size: 16px; }
}
.field--error .cf-optional, .field--error .cf-optional .ar { color: var(--text-4); }

/* =====================================================================
   UI/UX proposal v1 — Phase 2a (docs/uiux-proposal-v1/CHANGES.md,
   items 2, 5, 6, 7, 19, 1, 8, 3, 4, 11). Additive only: every pinned rule
   above stays word for word; these later / more specific rules win.
   Arabic is restyled (size, colour, placement), never hidden.
   ===================================================================== */

/* ---------- 2. Bilingual typography: Arabic as one quiet secondary layer ---------- */
/* Table headers: English 12px caps, Arabic a 13px second line (v2: Arabic never under 13px). */
.data thead th { background: var(--surface-2); font-size: 12px; letter-spacing: .06em; }
.data thead th .ar { font-size: 13px; font-weight: 500; color: var(--text-4); opacity: 1; }
/* Field labels: English 13/600, Arabic 13px after a CSS-drawn dot (decoration only). */
.field__label .ar {
  position: relative; margin: 0 0 0 2px; padding-left: 9px;
  font-size: 13px; font-weight: 500; color: var(--text-4);
}
.field__label .ar::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 3px; margin-top: -1px;
  border-radius: 50%; background: var(--border-strong);
}
/* Card titles: Arabic inline, smaller and quieter. */
.card__title .ar { font-size: 14px; font-weight: 500; color: var(--text-4); }
/* Hints and section descriptions: English and Arabic side by side when they fit. */
.field__hint { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 8px; }
.field__hint .ar { font-size: 13px; color: var(--text-4); }
.form-section__desc { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 10px; font-size: var(--fs-xs); }
.form-section__desc .ar { font-size: 13px; color: var(--text-4); }

/* ---------- 5 / 6. Navigation icons (CSS masks keyed by href; nav markup unchanged) ---------- */
.nav-link[href="/"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8 12 3 3 8v8l9 5 9-5z'/%3E%3Cpath d='m3 8 9 5 9-5M12 13v8'/%3E%3C/svg%3E"); }
.nav-link[href="/orders"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2M15 18H9M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.62l-3.48-4.35A1 1 0 0 0 17.52 8H14'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3C/svg%3E"); }
.nav-link[href="/archived"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='3' width='20' height='5' rx='1'/%3E%3Cpath d='M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8M10 12h4'/%3E%3C/svg%3E"); }
.nav-link[href="/accounts"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12V7H5a2 2 0 0 1 0-4h14v4'/%3E%3Cpath d='M3 5v14a2 2 0 0 0 2 2h16v-5'/%3E%3Cpath d='M18 12a2 2 0 0 0 0 4h4v-4Z'/%3E%3C/svg%3E"); }
.nav-link[href="/settings"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.nav-link[href="/notifications"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/%3E%3Cpath d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/%3E%3C/svg%3E"); }
.nav-link[href="/tracking"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E"); } /* Tracking, 01/11/2026 */
.nav-link:is([href="/"], [href="/orders"], [href="/tracking"], [href="/archived"], [href="/accounts"], [href="/settings"], [href="/notifications"])::before {
  content: ""; flex: 0 0 auto; width: 16px; height: 16px; background: currentColor; opacity: .9;
  -webkit-mask: var(--nav-icon) center / contain no-repeat; mask: var(--nav-icon) center / contain no-repeat;
}

/* ---------- 5. Desktop header: underline-only active item, product tag, 40px right cluster ---------- */
@media (min-width: 1101px) {
  .main-nav { gap: 2px; }
  .nav-link { gap: 8px; }
  .nav-link:hover { background: rgba(255, 255, 255, 0.06); }
  .nav-link[aria-current="page"] { background: transparent; }
  .brand__product {
    padding: 1px 7px; border: 1px solid rgba(255, 255, 255, 0.34); border-radius: var(--r-sm);
    font-size: 12px; font-weight: 700; line-height: 16px; letter-spacing: .09em; text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
  }
  .header-actions { gap: 8px; }
  .app-header .icon-btn { width: 40px; height: 40px; }
  .app-header .user-btn { height: 40px; padding: 0 10px 0 5px; }
  .icon-btn__badge { top: 3px; inset-inline-end: 3px; }
}

/* ---------- 6. Phone / tablet header and navigation drawer ---------- */
@media (max-width: 1100px) {
  .app-header .nav-toggle-btn { width: 44px; height: 44px; margin-inline-start: -8px; }
  .header-actions { gap: 4px; }
  .app-header .icon-btn { width: 44px; height: 44px; }
  .app-header .user-btn { height: 44px; padding-inline: 4px; }
  .icon-btn__badge { top: 5px; inset-inline-end: 5px; }
  /* "+" keeps orange but is an inset 34px button inside a 44px target. */
  .app-header .btn--new, .app-header .btn--new:hover {
    width: 44px; height: 44px; padding: 5px; border-radius: var(--r-lg); background-clip: content-box; box-shadow: none;
  }
  .app-header .btn--new .icon { width: 18px; height: 18px; }
  /* Drawer: a sheet only as tall as its content, over a dimmed backdrop
     (the backdrop is the text-free <label class="nav-backdrop"> in base.html: a tap closes the drawer). */
  .main-nav {
    top: calc(var(--header-h) + 3px); bottom: auto; max-height: calc(100vh - var(--header-h) - 24px);
    padding: 8px 10px 10px; gap: 2px; background: var(--navy-900); border-top: 0;
    border-radius: 0 0 var(--r-lg) var(--r-lg); box-shadow: 0 18px 40px rgba(8, 14, 30, 0.45);
  }
  .nav-toggle:checked ~ .nav-backdrop {
    display: block; position: fixed; inset: calc(var(--header-h) + 3px) 0 0; z-index: 45;
    background: rgba(8, 14, 30, 0.5); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .main-nav .nav-link { height: 48px; gap: 12px; padding: 0 14px; border-radius: var(--r-lg); font-size: 14px; }
  .main-nav .nav-link::before { width: 18px; height: 18px; }
  .main-nav .nav-link[aria-current="page"] { background: rgba(255, 255, 255, 0.08); color: #fff; }
  .main-nav .nav-link .count { margin-inline-start: auto; }
  .main-nav .nav-divider { margin: 6px 6px; }
  /* The page behind the open drawer does not scroll (the drawer itself still does). */
  html:has(.nav-toggle:checked) { overflow: hidden; }
}

/* ---------- 7. One page-header pattern ---------- */
.page-header { align-items: center; }
.page-header__eyebrow { color: var(--text-3); font-weight: 600; letter-spacing: .1em; }
.page-sub { max-width: 72ch; }
.page-actions .btn--sm { height: var(--ctl-md); padding-inline: var(--s-4); font-size: var(--fs-md); }
@media (max-width: 760px) {
  .page-actions { flex: 1 1 100%; }
}

/* ---------- 19. Quiet tables and a lighter state badge ---------- */
.data thead th { border-bottom: 1px solid var(--border); }
.state { padding: 1px 0; background: transparent; border-color: transparent; color: var(--success); }
.state--off { background: transparent; border-color: transparent; color: var(--text-3); }

/* ---------- 1 / 8. Dashboard: work first; KPIs and pipeline as one band ---------- */
.page--dash .dash-section { margin-bottom: 24px; }
.page--dash .dash-grid { gap: 24px; margin: 24px 0 0; }
/* Header: title left; date + KPI tiles right, one row. */
.page-header--dash { row-gap: 16px; }
.dash-stats { gap: 12px 16px; justify-content: flex-end; }
.dash-date { color: var(--text-3); }
.page-header--dash .dash-kpis { margin-top: 0; flex-wrap: nowrap; gap: 10px; }
.page-header--dash .dash-kpi {
  display: flex; flex-wrap: wrap; align-items: baseline; align-content: flex-start; column-gap: 6px; row-gap: 2px;
  min-width: 136px; padding: 11px 14px 12px; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-1);
  color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; line-height: 1.3;
}
.page-header--dash .dash-kpi b {
  flex: 0 0 100%; margin-bottom: 5px; font-size: var(--fs-2xl); font-weight: 700; line-height: 1; letter-spacing: -0.03em;
  color: var(--navy-900); font-variant-numeric: tabular-nums;
}
.page-header--dash .dash-kpi .ar { font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--text-4); }
.page-header--dash .dash-kpi:hover { border-color: var(--navy-200); background: var(--navy-50); text-decoration: none; }
.page-header--dash .dash-kpi--attention { padding-top: 9px; border-color: #FBD19B; border-top: 3px solid var(--orange); background: var(--orange-50); }
.page-header--dash .dash-kpi--attention b { color: var(--orange-text); }
.page-header--dash .dash-kpi.is-zero { background: var(--surface-2); box-shadow: none; color: var(--text-3); }
.page-header--dash .dash-kpi.is-zero b { color: var(--text-4); font-weight: 600; }
.page-header--dash .dash-kpi--attention.is-zero { border-color: var(--border); border-top-color: var(--border-strong); }

/* One source-owned stage path per active service. */
.stage-board { display: grid; gap: 12px; }
.stage-group { min-width: 0; }
.stage-group__title {
  display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px; color: var(--navy-100);
  font-size: var(--fs-sm); font-weight: 700; line-height: 1.4;
}
.stage-group__title .ar { color: var(--navy-200); font-size: 13px; font-weight: 500; }
.stage-board__empty { margin: 0; padding: 4px 0 2px; color: var(--navy-100); font-size: var(--fs-sm); font-weight: 600; }
.stage-board__empty .ar { margin-inline-start: 6px; color: var(--navy-200); font-size: 13px; font-weight: 500; }
.pipeline .stage {
  --pad: 16px;
  gap: 8px; padding: var(--pad); border-top: 0; background: var(--surface);
}
.pipeline .stage + .stage { border-inline-start: 0; }
.pipeline .stage + .stage::before { content: none; }
.pipeline .stage:hover { background-color: var(--surface-2); }
.pipeline .stage.is-selected { background-color: var(--navy-50); }
.pipeline .stage::after {
  content: ""; position: absolute; z-index: 0; top: calc(var(--pad) + 3px); inset-inline: 0; height: 2px;
  background: var(--border);
}
.pipeline .stage:first-child::after { inset-inline-start: calc(var(--pad) + 4px); }
.pipeline .stage:last-child::after { inset-inline-end: calc(100% - var(--pad) - 4px); }
.pipeline .stage__name { flex-direction: column; align-items: flex-start; gap: 10px; }
.pipeline .stage__step { position: relative; z-index: 1; width: 8px; height: 8px; background: var(--border-strong); box-shadow: 0 0 0 4px var(--surface); }
.pipeline .stage:hover .stage__step { box-shadow: 0 0 0 4px var(--surface-2); }
.pipeline .stage.is-selected .stage__step { box-shadow: 0 0 0 4px var(--navy-50); }
.pipeline .stage__label { letter-spacing: .06em; }
.pipeline .stage__label .ar { font-size: 13px; color: var(--text-4); }
.pipeline .stage__count { font-size: var(--fs-2xl); }
.pipeline .stage__count.is-zero { color: var(--text-4); font-weight: 600; }

/* Needs action today: one small card per bucket, coloured top edge, natural height. */
.dash-action .buckets {
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); align-items: start; gap: 12px;
  padding: 14px 16px 16px; background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.bucket--eta_passed { --bucket-edge: var(--danger); }
.bucket--stuck { --bucket-edge: var(--orange); }
.dash-action .bucket, .dash-action .bucket + .bucket {
  gap: 8px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border);
  border-top: 3px solid var(--bucket-edge, #98A2B3); border-radius: var(--r-lg);
}
.dash-action .bucket.is-selected { background: var(--navy-50); border-color: var(--navy-200); border-top-color: var(--bucket-edge, #98A2B3); }
.dash-action .bucket__list li { min-height: 44px; padding: 6px 0; }
/* Zero-order dashboard: "Nothing needs action today" is a green success strip. */
.dash-action .dash-empty {
  justify-content: flex-start; margin: 14px 16px 16px; padding: 12px 14px; text-align: start;
  background: var(--success-bg); border: 1px solid var(--success-bd); border-inline-start: 3px solid var(--success); border-radius: var(--r);
}

/* Orders: the main section, with a navy-50 header band. */
.page--dash #orders > .card__header {
  padding-block: 14px; background: var(--navy-50); border-bottom-color: var(--navy-100);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.page--dash #orders > .card__header .card__title { font-size: 16px; color: var(--navy-900); }
.page--dash #orders > .card__header .card__title > .icon { width: 18px; height: 18px; }
/* Active filters (incl. empty search results): strong chips next to Clear all. */
.page--dash .toolbar__row .pill { padding: 0 10px 0 14px; box-shadow: 0 1px 2px rgba(14, 22, 41, .18); }
@media (min-width: 761px) {
  /* Desktop only: phones keep the 44px pill (pinned 760px rule). */
  .page--dash .toolbar__row .pill { min-height: 36px; }
}
.page--dash .pills__clear { padding-inline: 6px; }

/* ---------- 4. Filter bar: the extra filters fold on phones ---------- */
.toolbar__more { flex: 4 1 560px; min-width: 0; }
.toolbar__more > summary { list-style: none; cursor: pointer; }
.toolbar__more > summary::-webkit-details-marker { display: none; }
.toolbar__more-body { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); }
/* Active-filter count on the "More filters" summary (a number only; absent when 0). */
.toolbar__more-count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--navy); color: #fff; font-size: var(--fs-xs); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
@media (min-width: 761px) {
  /* v2: the wrapper and its body add no box, so Company / Vendor / Owner / Stage are
     toolbar items again and the PR 10 row lays out exactly as on main. */
  .toolbar__more, .toolbar__more-body { display: contents; }
  .toolbar__more > summary { display: none; }
}
@media (min-width: 761px) {
  /* Browsers that expose the <details> content slot: flatten it too (own rule, so older browsers skip only this). */
  .toolbar__more::details-content { display: contents; }
}

/* ---------- 3. Compact order tables (Active + Archive), desktop ---------- */
.table-scroll--tall { max-height: none; min-height: 0; }
@media (min-width: 901px) {
  .data--orders td { vertical-align: middle; }
  /* One line per vendor role where it fits; long names wrap (v2: no cell text is cut). */
  .data--orders .vendors { grid-template-columns: minmax(0, 1fr); }
  .data--orders .row--overdue > td { background-color: #FFFAF9; }
  .data--orders .row--warn > td { background-color: #FFFCF7; }
}
@media (min-width: 1440px) {
  /* Room for View + Edit side by side. */
  .data--orders td.actions .row-actions--order { flex-direction: row; align-items: center; }
}
@media (min-width: 901px) {
  /* v2 (5b): the table fits its box at every desktop width, so the box clips
     (overflow: clip is not a scroll container): the page scrolls and the header
     sticks under the app bar (or the slim top bar next to the sidebar) from 901px up.
     To fit, no column keeps a fixed minimum width: names, headers and vendor lines
     wrap instead (no column and no text is hidden by this block). */
  .table-card:has(> .table-scroll > .data--orders), .table-scroll:has(> .data--orders) { overflow: clip; }
  .table-scroll--tall:has(> .data--orders) { max-height: none; min-height: 0; }
  .data--orders thead th { top: calc(var(--header-h) + 3px); }
  .data--orders thead th .en { white-space: normal; }
  .data.data--orders .col-company, .data.data--orders .col-transport, .data.data--orders .col-commodity,
  .data.data--orders .col-vendors, .data.data--orders .owners { min-width: 0; }
  .data.data--orders .col-commodity, .data.data--orders .owners, .data.data--orders .vendors,
  .data.data--orders .transport { max-width: none; }
  .data.data--orders td.col-service { white-space: normal; }
  .data.data--orders .vendors span { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
}
@media (min-width: 901px) and (max-width: 1279.98px) {
  /* Tighter cells where the table is narrowest. */
  .data.data--orders th, .data.data--orders td { padding-inline: 6px; }
  .data.data--orders th:first-child, .data.data--orders td:first-child { padding-inline-start: 10px; }
  .data.data--orders td.actions { padding-inline-end: 10px; }
  .data.data--orders .col-company .clamp { max-width: none; }
}

/* ---------- 3. Phone order cards (same table markup; after the pinned 900px block) ---------- */
@media (max-width: 900px) {
  .data--cards.data--orders tbody tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; }
  .data--cards.data--orders tbody td.col-ng { display: flex; align-items: center; gap: 8px; }
  .data--cards.data--orders td.col-ng .cell-sub { margin: 0; color: var(--text-4); font-size: var(--fs-xs); }
  .data--cards.data--orders tbody td.col-status { align-self: center; }
  .data--cards.data--orders tbody td.col-company { padding-bottom: 12px; }
  .data--cards.data--orders td.col-company .cell-main { font-size: 16px; font-weight: 700; line-height: 1.35; }
  /* Facts: ETA first, then Transport; Service / Commodity; then Vendors and Owners full width. */
  .data--cards.data--orders tbody td[data-label="ETA"] { order: 3; }
  .data--cards.data--orders tbody td.col-transport { order: 4; }
  .data--cards.data--orders tbody td.col-service { order: 5; }
  .data--cards.data--orders tbody td.col-commodity { order: 6; }
  .data--cards.data--orders tbody td.col-vendors { order: 7; grid-column: 1 / -1; }
  .data--cards.data--orders tbody td.col-owners { order: 8; grid-column: 1 / -1; }
  .data--cards.data--orders tbody td[data-label]::before { margin-bottom: 3px; font-size: 13px; letter-spacing: .04em; }
  .data--cards.data--orders td[data-label="ETA"] .eta__date { font-size: 16px; font-weight: 700; }
  /* An empty cell (only the muted "—", no English/Arabic text) collapses. */
  .data--cards.data--orders tbody td:has(> .muted:only-child:not([title])) { display: none; }
  .data--cards.data--orders .vendors { gap: 2px; }
  .data--cards.data--orders .owners { display: flex; flex-wrap: wrap; gap: 2px 18px; }
  .data--cards.data--orders tbody td.actions { padding-top: 12px; }
}

/* ---------- 4 / 8. Phone dashboard ---------- */
@media (max-width: 760px) {
  .page--dash .dash-section { margin-bottom: 16px; }
  .page--dash .dash-grid { gap: 16px; margin-top: 16px; }
  .page-header--dash .dash-stats { justify-content: flex-start; }
  .page-header--dash .dash-kpis { flex: 1 1 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .page-header--dash .dash-kpi { min-width: 0; padding: 10px 12px 11px; }
  .page-header--dash .dash-kpi--attention { padding-top: 8px; }
  .page-header--dash .dash-kpi b { font-size: var(--fs-2xl); }
  /* Pipeline (v2): the pinned 3 + 2 grid, so all five stages are on screen at 390px
     with their labels; the connector ends at stage 3 and restarts at stage 4. */
  .pipeline .stage { --pad: 12px; }
  .pipeline .stage:nth-child(3)::after { inset-inline-end: calc(100% - var(--pad) - 12px); }
  .pipeline .stage:nth-child(4)::after { inset-inline-start: calc(var(--pad) + 12px); }
  .pipeline .stage:nth-child(n+4) { border-top: 1px solid var(--border-soft); }
  .pipeline .stage:nth-child(5) { border-inline-start: 1px solid var(--border-soft); }
  .pipeline .stage__label { overflow-wrap: normal; word-break: normal; }
  /* Filters: Search and Apply stay; Company / Vendor / Owner / Stage fold behind "More filters". */
  .toolbar__more { flex: 1 1 100%; }
  .toolbar__more-toggle {
    display: flex; align-items: center; gap: 8px; min-height: var(--ctl-touch); padding: 0 12px;
    border: 1px dashed var(--border-strong); border-radius: var(--r); background: var(--surface);
    color: var(--navy); font-size: var(--fs-md); font-weight: 600;
  }
  .toolbar__more-toggle .icon { transition: transform .15s ease; }
  .toolbar__more[open] > .toolbar__more-toggle { margin-bottom: 10px; }
  .toolbar__more[open] > .toolbar__more-toggle .icon { transform: rotate(180deg); }
  .toolbar__more-body { gap: 10px; }
}

/* ---------- 11. Empty states ---------- */
.empty { gap: 6px; padding: 48px 16px; }
.empty__icon {
  width: 56px; height: 56px; margin-bottom: 12px; background: var(--navy-50); color: var(--navy);
  box-shadow: 0 0 0 6px var(--surface), 0 0 0 7px var(--navy-200);
}
.empty__icon .icon { width: 24px; height: 24px; }
.empty__title { font-size: var(--fs-lg); }
.empty__title--ar { font-size: 14px; color: var(--text-3); }
/* The CTA keeps the navy primary style (v2: the header New order is the only orange button). */
.empty .btn, .empty .btn--sm { height: var(--ctl-md); margin-top: 14px; padding-inline: var(--s-4); font-size: var(--fs-md); }
@media (max-width: 760px) {
  .empty .btn, .empty .btn--sm { height: var(--ctl-touch); }
}

/* =====================================================================
   UI/UX proposal v1 — Phase 2b (CHANGES.md items 9 and 10): order View and
   New / Edit order form. CSS only; the section markup, ids, classes and
   order are unchanged. Arabic is restyled, never hidden.
   ===================================================================== */

/* ---------- 9 / 10. Stage guide as a progress stepper (View and form) ---------- */
/* Done (before the current step): filled navy dot and connector. Current: an
   orange ring on an orange-50 row. Upcoming: an outlined, muted dot. The
   Cancelled branch never marks the earlier steps as done. */
.stage-guide .stage-list > li { padding-block: 7px; }
.stage-guide .stage-list > li > .stage-step { position: relative; z-index: 1; }
.stage-guide .stage-list > li:not(:last-child)::before {
  content: ""; position: absolute; z-index: 0; inset-inline-start: 19px; top: 33px; bottom: -8px;
  width: 2px; border-radius: 1px; background: var(--border); pointer-events: none;
}
.stage-guide .stage-list > li[data-stage="completed"]::before { display: none; }
.stage-guide .stage-list:not(:has(> li.is-current[data-stage="cancelled"])) > li:has(~ li.is-current) > .stage-step { background: var(--navy); color: #fff; }
.stage-guide .stage-list:not(:has(> li.is-current[data-stage="cancelled"])) > li:has(~ li.is-current)::before { background: var(--navy); }
.stage-guide .stage-list > li.is-current { background: var(--orange-50); border-color: #FBD19B; }
.stage-guide .stage-list > li.is-current > .stage-step { box-shadow: 0 0 0 2px var(--orange-50), 0 0 0 4px var(--orange); }
.stage-guide .stage-list > li.is-current .badge { color: var(--navy-900); }
.stage-guide .stage-list > li.is-current ~ li > .stage-step {
  background: var(--surface); color: var(--text-4); box-shadow: inset 0 0 0 1.5px var(--border-strong);
}
.stage-guide .stage-list > li.is-current ~ li .badge { color: var(--text-2); }

/* Sticky asides (desktop): the guide scrolls inside the column when taller than the window. */
@media (min-width: 1181px) {
  .view-aside, .form-aside {
    max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto; overscroll-behavior: contain;
    margin: -3px; padding: 3px; scrollbar-width: thin;
  }
}

/* ---------- 9. Order View ---------- */
/* Section 1 (Shipment) reads as the order summary: navy-50 header, 16px values, four columns. */
.view-section:has(#sec-1) { border-color: var(--navy-100); box-shadow: var(--shadow-2); }
.view-section:has(#sec-1) > .card__header {
  background: var(--navy-50); border-bottom-color: var(--navy-100); border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.view-section:has(#sec-1) > .card__header .card__title { color: var(--navy-900); }
.view-section:has(#sec-1) .detail-grid { gap: 18px 28px; }
.view-section:has(#sec-1) .detail dd { font-size: var(--fs-lg); line-height: 1.4; }
.view-section:has(#sec-1) .detail dd.mono { font-size: 16px; color: var(--navy-900); }
@media (min-width: 761px) {
  .view-section:has(#sec-1) .detail-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .view-section:has(#sec-1) .detail[data-field="qty"] { grid-column: span 2; }
}
@media (max-width: 760px) {
  .view-section:has(#sec-1) .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
  .view-section:has(#sec-1) .detail[data-field="qty"] { grid-column: 1 / -1; }
}
/* Empty sections: one 48px row — number dot, title and the muted "—" on one line. */
.view-section:has(.view-empty) {
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 4px; min-height: 48px;
  background: var(--surface-2); box-shadow: none;
}
.view-section:has(.view-empty) > .card__header { flex: 0 1 auto; padding-block: 8px; border-bottom: 0; }
.view-section:has(.view-empty) > .card__body { flex: 1 1 auto; padding: 0 var(--s-4) 0 0; }
.view-section:has(.view-empty) .card__title { font-size: 14px; color: var(--text-2); }
.view-section:has(.view-empty) .form-section__num { background: var(--text-4); box-shadow: 0 0 0 3px var(--surface-3); }
/* Edit: the page's main action, navy primary (v2: orange is only the header New order), with a pencil. */
.page-actions--view .btn--primary { min-width: 108px; padding-inline: var(--s-5); }
.page-actions--view .btn--primary::before, .view-back .btn::before {
  content: ""; flex: 0 0 auto; width: 15px; height: 15px; background: currentColor;
  -webkit-mask: var(--btn-icon) center / contain no-repeat; mask: var(--btn-icon) center / contain no-repeat;
}
.page-actions--view .btn--primary { --btn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E"); }
/* Back: a secondary-style button aligned with the cards. */
.view-back { margin-top: 4px; }
.view-back .btn {
  --btn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 19-7-7 7-7M19 12H5'/%3E%3C/svg%3E");
  padding-inline: var(--s-4); background: var(--surface); color: var(--text-2);
  border-color: var(--border-strong); box-shadow: var(--shadow-1);
}
.view-back .btn:hover { background: var(--surface-2); color: var(--navy); border-color: var(--navy-200); }
@media (max-width: 760px) {
  .view-back .btn { width: 100%; height: var(--ctl-touch); }
}

/* ---------- 10. New / Edit order form ---------- */
.order-form-header {
  position: sticky; top: var(--header-h); z-index: 20;
  margin-inline: calc(var(--s-4) * -1); padding-inline: var(--s-4);
  background: var(--bg); box-shadow: 0 1px 0 var(--border);
}
.form-header-ng {
  display: inline-flex; align-items: baseline; gap: 6px; margin-inline-start: 10px;
  font-size: .72em; color: var(--navy); white-space: nowrap;
}
.form-header-ng .ar { font-family: var(--font-ar); font-size: 13px; font-weight: 500; }
@media (max-width: 640px) {
  .order-form-header { top: var(--header-h); margin-inline: -12px; padding-inline: 12px; }
  .form-header-ng { display: flex; margin: 4px 0 0; }
}
/* Section header: Required / Optional is a small text tag, not a pill. */
.form-section__head .section-requirement {
  height: auto; padding: 0; gap: 6px; border: 0; border-radius: 0; background: none;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-4);
  min-width: 0; flex-wrap: wrap;
}
.form-section__head, .form-section__title { min-width: 0; }
.form-section__title { overflow-wrap: anywhere; }
.section-fields, .load-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.form-section__head .section-requirement .ar { margin: 0; font-size: 13px; font-weight: 500; letter-spacing: normal; opacity: 1; color: inherit; }
/* Required: navy text and dot (v2: no orange here). */
.form-section__head .section-requirement.badge--orange { color: var(--navy); }
.form-section__head .section-requirement.badge--orange::before {
  content: ""; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--navy);
}
/* Sections that already hold data get the 3px navy start edge (as the transport mode does). */
.form-section:is(:has(select option:checked:not([value=""])), :has(input:not([type="hidden"])[value]:not([value=""])))::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px;
  background: var(--navy); z-index: 1; pointer-events: none;
}
/* Primary action (Create order / Save changes) keeps the navy primary style (v2). */
@media (min-width: 761px) {
  /* Fields fill the card: as many 240px+ columns as fit; vendor + unit-row sections use two halves. */
  .form-section .form-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .form-section .form-grid:has(> .transport-builder) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* The tag sits right after the title. */
  .form-section__head { grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto 20px; column-gap: var(--s-3); }
  .form-section__head .form-section__title { flex-wrap: wrap; row-gap: 0; }
  .form-section__head .section-requirement { justify-self: start; }
  .form-section__head [data-main-component-badge] { min-width: 0; max-width: 100%; white-space: normal; }
  /* Sticky action bar: limited to the form column, floating card with a shadow. */
  .order-form .form-actions {
    width: auto; margin-top: 8px; margin-inline: 0; bottom: 12px; padding: 10px 12px 10px 16px;
    border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); backdrop-filter: none;
    box-shadow: 0 10px 28px rgba(14, 22, 41, .14), 0 1px 3px rgba(14, 22, 41, .08);
  }
  .order-form .form-actions .btn--primary { min-width: 180px; }
}
@media (max-width: 760px) {
  /* Phone bar: also clear the side safe areas (bottom inset is already in the pinned rule). */
  .order-form .form-actions {
    padding-inline: max(var(--s-3), env(safe-area-inset-left)) max(var(--s-3), env(safe-area-inset-right));
  }
}

/* =====================================================================
   UI/UX proposal v1 — Phase 2c (CHANGES.md items 12–18 and the rest of 11):
   Settings, Activity log, Notifications, Archive, Login and the error page.
   Additive only. Arabic is restyled, never hidden.
   ===================================================================== */

/* ---------- 12. Settings tabs ---------- */
/* Desktop: underline tabs sitting on the header band's bottom edge. */
.page-header > .tabs { gap: 2px; margin-top: 10px; }
.page-header > .tabs a { padding: 10px 14px 14px; border-radius: var(--r-lg) var(--r-lg) 0 0; font-size: var(--fs-md); }
.page-header > .tabs a:hover { background: var(--surface-2); }
.page-header > .tabs a .icon { width: 16px; height: 16px; }
.page-header > .tabs a .ar { font-size: 13px; font-weight: 500; color: var(--text-3); opacity: 1; }
.page-header > .tabs a[aria-current="page"] .ar { color: var(--text-2); }
.page-header > .tabs a[aria-current="page"] { font-weight: 700; }
@media (max-width: 760px) {
  /* Phones: the pinned 2 × 2 grid (44px cells) becomes one segmented control. */
  .page-header > .tabs { margin: 8px 0 0; padding: 4px; gap: 4px; background: var(--surface-3); border-radius: var(--r-lg); }
  .page-header > .tabs a {
    padding: 6px 8px; gap: 6px; border-color: transparent; border-radius: var(--r); background: transparent; font-size: 13px;
  }
  .page-header > .tabs a:hover { background: rgba(255, 255, 255, 0.6); }
  .page-header > .tabs a[aria-current="page"] { border-color: var(--border); background: var(--surface); box-shadow: var(--shadow-1); }
  .page-header > .tabs a[aria-current="page"]::after { inset-inline: 38%; bottom: 3px; height: 2px; border-radius: 2px; }
}

/* ---------- 12. "Add …" panels: a slim dashed row when closed, a card when open ---------- */
.stack > .card.disclosure > summary { min-height: 52px; padding: 12px 16px; }
.stack > .card.disclosure > summary .card__title { font-size: var(--fs-lg); }
.stack > .card.disclosure > summary .card__title > .icon {
  width: 24px; height: 24px; padding: 4px; background: var(--navy); color: #fff;
  box-shadow: 0 0 0 3px var(--navy-50);
}
.stack > .card.disclosure:not([open]) { border: 1px dashed var(--border-strong); background: transparent; box-shadow: none; }
.stack > .card.disclosure:not([open]):hover { border-color: var(--navy-200); background: var(--surface); }
.stack > .card.disclosure:not([open]) > summary:hover { background: transparent; }
.stack > .card.disclosure[open] { box-shadow: var(--shadow-2); }
@media (min-width: 761px) {
  /* Open: the form in two columns, never wider than 880px. */
  .disclosure__body > form > .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; max-width: 880px; }
}

/* ---------- 12. Companies: list left, sticky add form right (≥1280px, list not empty) ---------- */
@media (min-width: 1280px) {
  .stack:has(#companies-table) { grid-template-columns: minmax(0, 1fr) 420px; align-items: start; gap: 24px; }
  .stack:has(#companies-table) > .table-card { grid-column: 1; grid-row: 1; }
  .stack:has(#companies-table) > #add-company {
    grid-column: 2; grid-row: 1; max-width: none; position: sticky; top: calc(var(--header-h) + 19px);
    max-height: calc(100vh - var(--header-h) - 38px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  }
  .stack:has(#companies-table) > #add-company .cf-grid { grid-template-columns: minmax(0, 1fr); }
  .stack:has(#companies-table) > #add-company .cf-actions { position: sticky; bottom: 0; z-index: 1; background: var(--surface); }
}

/* ---------- 12. Vendors: category chips on one scrollable row ---------- */
.table-card[aria-labelledby="vendors-h"] > .toolbar__row > .chips {
  flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin;
}

/* ---------- 12. Users: quiet Created column, compact role cards ---------- */
.data td.col-created .time { color: var(--text-4); font-size: var(--fs-xs); }
.role-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.role-card { padding: 12px 14px 14px; background: var(--surface); }
.role-card p { margin-top: 8px; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }
.role-card p.ar { margin-top: 6px; color: var(--text-4); font-size: 13px; line-height: 1.6; }
@media (max-width: 1100px) {
  .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .role-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 13. Activity log ---------- */
.table-card.table-card--activity .toolbar__search { flex: 1 1 360px; max-width: 560px; }
.table-card.table-card--activity .toolbar__field { flex: 0 1 260px; }
@media (min-width: 901px) {
  /* v2 density: main's scroll box comes back for this long list (page no taller than
     main), and the rows are tighter than v1. */
  .table-card.table-card--activity .table-scroll--tall { max-height: calc(100vh - 250px); min-height: 280px; }
  .table-card.table-card--activity .data tbody td { padding-block: 6px; line-height: 1.35; }
  .table-card.table-card--activity .data thead th { padding-block: 8px; }
  .table-card.table-card--activity .data td.col-ng .time { color: var(--text-3); font-size: var(--fs-sm); }
  .table-card.table-card--activity .data td.col-user { font-weight: 500; }
  .table-card.table-card--activity .data td.card-wide { color: var(--text-2); font-size: var(--fs-sm); }
  .table-card.table-card--activity .data td.card-wide .clamp { max-width: 640px; }
}
@media (max-width: 900px) {
  /* Phones: a compact 3-line entry — time · action · NG, then user, then details.
     The data-label captions (with their Arabic) stay, as small inline prefixes. */
  .table-card.table-card--activity .data--cards tbody { gap: 0; padding: 0; background: var(--surface); }
  .table-card.table-card--activity .data--cards tbody tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 16px;
    border: 0; border-bottom: 1px solid var(--border-soft); border-radius: 0; box-shadow: none;
  }
  .table-card.table-card--activity .data--cards tbody tr:last-child { border-bottom: 0; }
  .table-card.table-card--activity .data--cards tbody td { flex: 0 0 auto; width: auto; max-width: 100%; }
  .table-card.table-card--activity .data--cards tbody td.col-ng { order: 0; }
  .table-card.table-card--activity .data--cards tbody td.col-status { order: 1; }
  .table-card.table-card--activity .data--cards tbody td[data-label="NG"] { order: 2; margin-inline-start: auto; }
  .table-card.table-card--activity .data--cards tbody td.col-user { order: 3; flex: 1 1 100%; font-weight: 600; font-size: 13px; }
  .table-card.table-card--activity .data--cards tbody td.card-wide { order: 4; flex: 1 1 100%; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.45; }
  .table-card.table-card--activity .data--cards tbody td[data-label]::before {
    display: inline; margin: 0 6px 0 0; font-size: 13px; letter-spacing: .03em;
  }
  .table-card.table-card--activity .data--cards td .clamp { display: inline; max-width: none; overflow: visible; -webkit-line-clamp: unset; }
  .table-card.table-card--activity .data--cards td.col-ng .time { color: var(--text-3); font-size: 13px; font-weight: 600; }
}

/* ---------- 14. Notifications inbox ---------- */
.card.card--notifications { overflow: hidden; }
/* Title row: dot · title · Mark read; body and meta run under the title. */
.notice-list .notice {
  grid-template-columns: 10px minmax(0, 1fr) auto; column-gap: 14px; row-gap: 3px; align-items: center; padding: 14px 20px;
}
.notice-list .notice > div:not([class]) { display: contents; }
.notice-list .notice__dot { grid-column: 1; grid-row: 1; align-self: center; margin-top: 0; }
.notice-list .notice__title { grid-column: 2; grid-row: 1; color: var(--text-2); font-weight: 500; line-height: 1.4; }
.notice-list .notice__body, .notice-list .notice__meta { grid-column: 2 / -1; }
.notice-list .notice__actions { grid-column: 3; grid-row: 1; align-self: center; justify-self: end; }
.notice-list .notice--unread { background: var(--navy-50); }
.notice-list .notice--unread .notice__title { color: var(--text); font-weight: 700; }
.notice-list .notice--unread .notice__dot { box-shadow: 0 0 0 3px rgba(244, 123, 32, 0.22); }
.notice-list .notice__meta { gap: 4px 10px; margin-top: 4px; }
.notice-list .notice__meta a {
  display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border: 1px solid var(--navy-100); font-size: var(--fs-xs);
}
.notice-list .notice__meta a:hover { background: var(--navy); border-color: var(--navy); color: #fff; text-decoration: none; }
.notice-list .notice__actions .btn {
  height: 36px; padding-inline: 12px; background: var(--surface); border-color: var(--border-strong); color: var(--navy); box-shadow: var(--shadow-1);
}
.notice-list .notice__actions .btn:hover { background: var(--navy-50); border-color: var(--navy-200); }
@media (max-width: 760px) {
  .notice-list .notice { column-gap: 10px; padding: 12px 14px; }
  .notice-list .notice__actions .btn { padding-inline: 10px; }
}

/* ---------- 14. Header actions line up with the title (Notifications, the dashboard date) ---------- */
@media (min-width: 761px) {
  .page-header > .page-actions:is(:has(> .result-count), :has(form[action="/notifications/read-all"])) {
    align-self: flex-start; margin-top: 18px;
  }
}

/* ---------- 15. A count pill in the header actions (the dashboard date restyles it) ---------- */
.page-actions > .result-count {
  height: var(--ctl-md); padding: 0 16px; gap: 8px; border: 1px solid var(--navy-100); border-radius: var(--r-pill);
  background: var(--navy-50); color: var(--navy-900); font-size: var(--fs-md); font-weight: 600;
}

/* ---------- 16. Archive: capped search, status chips as a segmented control ---------- */
@media (min-width: 1280px) {
  .table-card[aria-label="Archived orders"] .toolbar__search { flex: 0 1 640px; }
}
.chips.chips--status {
  gap: 2px; padding: 3px; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.chips.chips--status .chip { border-color: transparent; border-radius: var(--r); background: transparent; }
.chips.chips--status .chip:hover { border-color: var(--border); background: var(--surface); }
.chips.chips--status .chip[aria-current="true"] { border-color: var(--navy); background: var(--navy); }
.chips.chips--status .chip:not([aria-current]) .chip__count { background: var(--surface); }
.chips.chips--status .pill { border-radius: var(--r); }
@media (min-width: 761px) {
  /* Desktop only: phones keep the 44px pill (pinned 760px rule). */
  .chips.chips--status .pill { min-height: 32px; }
}
@media (max-width: 760px) {
  .chips.chips--status { margin-inline: 0; padding-inline: 3px; }
}

/* ---------- 11. Empty states on Archive, Notifications, Companies ---------- */
:is(.table-card[aria-label="Archived orders"],
    .card.card--notifications, .table-card[aria-labelledby="companies-h"]) > .empty {
  margin: 16px; padding-block: 44px; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface-2);
}
@media (max-width: 760px) {
  :is(.table-card[aria-label="Archived orders"],
      .card.card--notifications, .table-card[aria-labelledby="companies-h"]) > .empty {
    margin: 12px; padding: 36px 14px;
  }
}

/* ---------- 17. Login ---------- */
/* Brand panel: one vertically centred group; the orange line is a 4px edge beside the form. */
.auth__brand { justify-content: center; gap: 0; padding: 56px clamp(40px, 6vw, 96px); }
.auth__brand::after { inset-inline: auto 0; top: 0; bottom: 0; width: 4px; height: auto; }
.auth__brand > img { margin-bottom: 48px; }
.auth__brand > div { max-width: 480px; }
.auth__brand .auth__product { margin-bottom: 20px; }
.auth__brand h1 { max-width: 16ch; font-size: var(--fs-2xl); line-height: 1.25; letter-spacing: -0.02em; }
.auth__brand h1 > span[lang="en"], .auth__title > span[lang="en"] { font-family: var(--font); }
.auth__brand h1 .alt { margin: 10px 0 0; color: rgba(255, 255, 255, .78); font-size: var(--fs-xl); font-weight: 500; line-height: 1.5; text-align: left; }
.auth__brand > p { max-width: 440px; margin-top: 28px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, .72); font-size: 16px; line-height: 1.6; }
.auth__brand > p.auth__description-ar { margin: 10px 0 0; padding: 0; border: 0; color: rgba(255, 255, 255, .82); font-size: 16px; }
/* Sign-in card: title and its Arabic on one baseline, orange top edge. */
.auth__card { width: min(400px, 100%); border-top-color: var(--navy); }
.auth__card .card__body { padding: 36px 32px 32px; gap: 22px; }
.auth__title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; font-size: 24px; }
.auth__title .alt { display: inline; margin: 0; color: var(--text-4); font-family: var(--font-ar); font-size: 16px; }
@media (max-width: 760px) {
  /* Phones: a short navy band (logo + headline), the form, then both descriptions. */
  .auth { align-content: start; }
  .auth::before {
    content: ""; grid-column: 1; grid-row: 1 / 3; border-bottom: 3px solid var(--orange);
    background-color: var(--navy-900);
    background-image: radial-gradient(420px 220px at 100% 120%, rgba(244, 123, 32, 0.22), transparent 60%);
  }
  .auth__brand { display: contents; }
  .auth__brand::after { content: none; }
  .auth__brand > img { grid-column: 1; grid-row: 1; position: relative; z-index: 1; height: 26px; margin: 18px 20px 0; justify-self: start; }
  .auth__brand > div { grid-column: 1; grid-row: 2; position: relative; z-index: 1; max-width: none; padding: 12px 20px 18px; }
  .auth__brand .auth__product { margin-bottom: 8px; }
  .auth__brand h1 { max-width: none; font-size: var(--fs-xl); }
  .auth__brand h1 .alt { margin-top: 2px; font-size: 16px; }
  .auth__main { grid-column: 1; grid-row: 3; padding: 20px 14px 8px; }
  .auth__card .card__body { padding: 24px 20px; }
  .auth__brand > p {
    display: block; grid-column: 1; justify-self: center; width: calc(100% - 28px); max-width: 420px;
    margin: 12px 0 0; padding: 14px 0 0; border-top: 1px solid var(--border); color: var(--text-3); font-size: var(--fs-sm); text-align: center;
  }
  .auth__brand > p:not(.auth__description-ar) { grid-row: 4; }
  .auth__brand > p.auth__description-ar { grid-row: 5; margin: 6px 0 32px; padding: 0; border: 0; color: var(--text-3); font-size: var(--fs-sm); text-align: center; }
}

/* ---------- 18. Error / 404 page: a centred 560px card ---------- */
main:has(> .page > .panel-center) { display: flex; }
main:has(> .page > .panel-center) > .page { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; min-height: 60vh; }
.panel-center { width: 100%; max-width: 560px; margin: 40px auto; box-shadow: var(--shadow-2); }
.panel-center .card__body { gap: 14px; padding: 44px 40px 40px; }
.panel-center .error-code { display: block; color: var(--navy); font-size: var(--fs-2xl); letter-spacing: -0.02em; }
.panel-center .error-code::after { content: ""; display: block; width: 40px; height: 4px; margin: 12px auto 2px; border-radius: 2px; background: var(--navy-200); }
.panel-center h1 { font-size: 20px; line-height: 1.35; }
.panel-center p { max-width: 46ch; }
.panel-center .page-actions { gap: 10px; margin-top: 12px; }
.panel-center .page-actions .btn { min-width: 140px; }
@media (max-width: 760px) {
  .panel-center { margin: 24px auto; }
  .panel-center .card__body { padding: 32px 20px 24px; }
  .panel-center .page-actions { flex-direction: column; justify-self: stretch; }
  .panel-center .page-actions .btn { flex: none; width: 100%; height: var(--ctl-touch); }
}

/* =====================================================================
   UI/UX proposal v1 — Phase 3 (visual QA polish of items 1, 2, 9, 12, 14,
   15, 17 and 19). Additive only; no pinned rule is edited or moved.
   Arabic is restyled (size, colour, placement), never hidden.
   ===================================================================== */

/* ---------- 19. English-only column headers sit on the English line, not the Arabic one ---------- */
.data thead th:not(:has(.ar)) { vertical-align: top; }

/* ---------- 1 / 8. Dashboard header: title left, date + KPIs right, one row ---------- */
.page-actions > .result-count.dash-date {
  height: 32px; padding: 0 12px; gap: 6px; border-color: var(--border); background: var(--surface-2);
  color: var(--text-3); font-size: var(--fs-sm); font-weight: 500;
}
.page-actions > .result-count.dash-date b { color: var(--text-2); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.page-actions > .result-count.dash-date .icon { width: 14px; height: 14px; }
@media (min-width: 761px) {
  .page-header--dash .dash-kpi { min-width: 124px; padding-inline: 12px; }
  .page-header--dash .dash-kpis { gap: 8px; }
}
/* v2 (5b): from 1280px the sidebar takes 240px, so the one-row header starts at 1520px
   (the same content width as 1280px without the sidebar). */
@media (min-width: 1520px) {
  .page-header--dash { flex-wrap: nowrap; }
  .page-header--dash > .page-header__main { flex: 0 0 auto; }
  .page-header--dash > .dash-stats { flex: 0 1 auto; flex-wrap: nowrap; min-width: 0; gap: 12px; }
  .page-header--dash .dash-kpis { min-width: 0; }
  .page-header--dash .dash-kpi { flex: 0 1 auto; min-width: 0; }
  .page-header--dash .dash-date { flex: 0 0 auto; }
}
@media (min-width: 761px) and (max-width: 1519.98px) {
  /* The KPI row drops under the title: it fills the band's width evenly. */
  .page-header--dash > .dash-stats { flex: 1 1 100%; flex-wrap: nowrap; justify-content: flex-start; }
  .page-header--dash .dash-kpis { flex: 1 1 auto; min-width: 0; }
  .page-header--dash .dash-kpi { flex: 1 1 0; min-width: 0; }
}
/* Pipeline: counts line up at the bottom even when a label wraps to two lines. */
.pipeline .stage__count { margin-top: auto; }

/* ---------- 9. Order view: the Arabic quantity sits under its English value ---------- */
.detail dd .detail__ar { text-align: left; }

/* ---------- 12. Settings: company-form hints read English · Arabic, like the other forms ---------- */
.cf-hint, .cf-hint > span[data-city-hint]:not([hidden]) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 8px; }
.cf-hint .ar { text-align: left; font-size: 13px; }
/* Vendors: all category chips stay visible on desktop (two tidy rows at most);
   phones keep the one horizontally scrollable row. */
@media (min-width: 901px) {
  .table-card[aria-labelledby="vendors-h"] > .toolbar__row > .chips { flex-wrap: wrap; overflow-x: visible; gap: 6px; padding-bottom: 0; }
}

/* ---------- 14. Notifications (phones): "Mark all as read" is a full-width 44px button ---------- */
@media (max-width: 760px) {
  .page-actions > form[action="/notifications/read-all"] { flex: 1 1 100%; }
  .page-actions > form[action="/notifications/read-all"] .btn { width: 100%; height: var(--ctl-touch); }
}

/* ---------- 17. Login: the headline reads in two lines, not three ---------- */
@media (min-width: 761px) {
  .auth__brand h1 { max-width: 460px; }
}

/* =====================================================================
   UI/UX proposal v1 — Phase 4 (phone visual QA of items 1, 3, 4, 9, 12,
   13 and 16). Additive only; no pinned rule is edited or moved.
   Arabic is restyled (size, colour, placement), never hidden.
   ===================================================================== */

/* ---------- 1. Needs-action buckets: the count sits right next to its label ---------- */
.dash-action .bucket__head { gap: 10px; }
.dash-action .bucket__count { position: relative; min-width: 0; }
/* The tap area stays at least 44px wide without pushing the label away. */
.dash-action a.bucket__count::after { content: ""; position: absolute; inset: 0 -15px; }

@media (max-width: 760px) {
  /* ---------- 1. Card headers: the "8 orders" / "1 arriving" pill stays on the title row ---------- */
  .page--dash .card__header:has(> .dash-total) { flex-wrap: nowrap; align-items: flex-start; }
  .page--dash .card__header:has(> .dash-total) > .card__title { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; row-gap: 0; }
  .page--dash .card__header > .dash-total {
    position: relative; flex: 0 0 auto; min-height: 30px; margin-block: -2px; padding: 0 10px; font-size: 13px;
  }
  .page--dash .card__header > .dash-total::after { content: ""; position: absolute; inset: -7px -4px; }
  /* Needs action: one inset instead of two, so company names get more room. */
  .dash-action .buckets { gap: 10px; padding: 10px; }
  .dash-action .bucket, .dash-action .bucket + .bucket { padding: 10px 12px 12px; }

  /* ---------- 9. Order view: short sections use two columns ---------- */
  .view-section:is(:has(#sec-2), :has(#sec-3)) .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
  .view-section:has(#sec-2) .detail[data-field="status"] { grid-column: 1 / -1; }

  /* ---------- 10. Order edit: the "•••" menu stays beside the title ---------- */
  .page-header:has(> .archive-actions:not(:has(> a))) > div:first-child { flex: 1 1 0; min-width: 0; }
  .page-header > .page-actions.archive-actions:not(:has(> a)) { flex: 0 0 auto; align-self: center; }

  /* ---------- 13. Activity log: the Action filter is as wide as Search ---------- */
  .table-card.table-card--activity .toolbar__search,
  .table-card.table-card--activity .toolbar__field { flex: 1 1 100%; max-width: none; }

  /* ---------- 16. Archive: the status control is as wide as its chips, and scrolls inside the card ---------- */
  .chips.chips--status { align-self: flex-start; max-width: 100%; min-width: 0; }
}

@media (max-width: 900px) {
  /* ---------- 3. Phone order cards ---------- */
  /* Owners: "Sales YUSUF · Ops OMAR" with the same gap after each key. */
  .data--cards.data--orders .owners .k { min-width: 0; margin-inline-end: 4px; }
  /* The divider under the company also shows on the last card. */
  .data--cards.data--orders tbody tr:last-child td.col-company { border-bottom: 1px solid var(--border-soft); }
  /* ---------- 12. Vendors: the "•••" menu lines up under the status, at the row's end ---------- */
  #vendors-table tbody tr[data-vendor-row] td.actions { justify-self: end; margin-inline-end: -10px; }
}

/* =====================================================================
   UI/UX proposal v2 — Phase 5a (Design review of v1: blockers, small fixes,
   decisions). Additive only; no pinned rule is edited or moved.
   Arabic: every rendered Arabic text is at least 13px and is quietened by
   colour only (never by size or opacity), at >= 4.5:1.
   ===================================================================== */

/* ---------- 2. Arabic: colour instead of opacity (buttons, nav, tabs, chips, pills, badges) ---------- */
.btn .ar, .nav-link .ar, .tabs a .ar, .chip .ar, .pill .ar, .badge .ar { opacity: 1; }
.empty .btn .ar { opacity: 1; }
.btn--primary .ar { color: var(--navy-100); }                 /* 8:1 on navy */
.btn--secondary .ar, .btn--ghost .ar { color: var(--text-3); } /* >= 5:1 on white / grey */
.data tbody tr:hover td.actions > .btn--secondary .ar { color: inherit; }
.nav-link .ar { color: var(--navy-200); }                     /* >= 6:1 on the navy bar and drawer */
.chip .ar { color: var(--text-3); }
.chip[aria-current="true"] .ar, .pill .ar { color: var(--navy-100); }
.svc-view__table .svc-view__th .ar { opacity: 1; color: var(--text-4); }

/* ---------- 2. Arabic: never under 13px ---------- */
.field__static-ar { font-size: 13px; }                        /* order form quantity (Arabic line) */
.cf-optional .ar, .cf-error .ar, .cf-hint .ar { font-size: 13px; }
.svc-section .svc-head__cell .ar, .svc-section .svc-row__label .ar, .svc-section .svc-add .ar,
.svc-view__th .ar, .svc-view__k .ar { font-size: 13px; }
.company-card__title .ar { font-size: max(13px, 0.8em); }
@media (max-width: 900px) {
  /* Phone card captions carry Arabic in their data-label text (Users, Companies, Vendors). */
  .data--cards tbody td[data-label]::before { font-size: 13px; letter-spacing: .04em; }
}

/* ---------- 5. Header: a white focus ring on navy ---------- */
.app-header :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.app-header .menu__panel :focus-visible { outline-color: var(--navy); }
.nav-toggle:focus-visible + .nav-toggle-btn { box-shadow: none; outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- 6. Phone drawer backdrop (a text-free label for #nav-toggle; shown only while the drawer is open) ---------- */
.nav-backdrop { display: none; }

/* ---------- Radii: 8px max for cards, bars and tracks ---------- */
.repeat-row { border-radius: var(--r-lg); }

/* ---------- 19. Stage-5 / Sales text at >= 4.5:1 on orange-50 ---------- */
.badge--land { color: #9A4A00; }

/* =====================================================================
   UI/UX proposal v2 — Phase 5b (measured follow-ups F1–F6, left sidebar
   #20, whole-row click #22). Additive only; no pinned rule is edited or
   moved, and no template changed. Arabic stays >= 13px and >= 4.5:1.
   ===================================================================== */

/* ---------- F2. Screen-reader-only header text (e.g. "Actions الإجراءات") at 13px ---------- */
th .sr-only { font-size: 13px; }

/* ---------- F3. Contrast ---------- */
/* User menu role badge: its own colours again (`.menu__user span` made it --text-3 on navy, 2.7:1). */
.menu__user .badge--role-admin { color: var(--navy-100); }     /* 12:1 on navy-900 */
.menu__user .badge--role-ops { color: var(--navy); }
.menu__user .badge--role-sales { color: #9A4A00; }
.menu__user .badge--role-finance { color: #475467; }
/* Zero counts: --text-4 (>= 4.5:1), still quieter than the bold, coloured non-zero counts. */
.bucket__count.is-zero, .day__count.is-zero { color: var(--text-4); font-weight: 400; }
/* Stage step numerals >= 4.5:1: navy-900 on the light fills (waiting, on land), a darker Confirmed fill. */
.stage--waiting .stage__step, .stage-step--waiting,
.stage--land .stage__step, .stage-step--land,
.badge--waiting .badge__step { color: var(--navy-900); }        /* 6.2:1 / 7.1:1 */
.stage--confirmed .stage__step, .stage-step--confirmed, .stage-list .stage-step--confirmed,
.badge--confirmed .badge__step { background: #4F6390; }         /* white 5.97:1 */
.badge--confirmed { color: #4F6390; }                           /* 5.31:1 on navy-50 (was 3.37:1) */
/* Disabled primary (company / user / vendor Save): the solid navy primary, so the
   label and its Arabic keep >= 4.5:1; not-allowed cursor and the disabled attribute remain. */
.btn--primary[disabled], .btn--primary[aria-disabled="true"] { opacity: 1; background: var(--navy); color: #fff; }
@media (max-width: 760px) {
  /* Login (phones): the descriptions sit on the light page, under the navy band; their own
     background makes that explicit (5.4:1), the brand aside has no box here (display: contents). */
  .auth__brand > p { background-color: var(--bg); }
}

/* ---------- F4. Avatar: a light disc with navy initials (orange stays for accents only) ---------- */
.avatar { background: var(--navy-50); color: var(--navy-900); }

/* ---------- F6. Phone "8 orders" / "1 arriving": a 44px tap box, the pill still looks 30px ---------- */
@media (max-width: 760px) {
  .page--dash .card__header > .dash-total {
    z-index: 0; min-height: 44px; margin-block: -9px; background: transparent; border-color: transparent;
  }
  .page--dash .card__header > .dash-total::before {
    content: ""; position: absolute; z-index: -1; inset: 7px 0;
    border: 1px solid var(--navy-100); border-radius: var(--r-pill); background: var(--navy-50);
  }
  .page--dash .card__header > .dash-total::after { content: none; }
  .page--dash .card__header > .dash-total:is(:hover, .is-selected) { background: transparent; border-color: transparent; }
  .page--dash .card__header > .dash-total:is(:hover, .is-selected)::before { background: var(--navy); border-color: var(--navy); }
}

/* ---------- 22. Whole-row click: the NG link is stretched over its row (pure CSS) ---------- */
/* Active + Archive order tables (table rows from 901px, cards below). View / Edit sit
   above the stretched link and keep their own targets. No JS, no new markup. */
.data.data--orders tbody tr { position: relative; }
.data.data--orders a.ng-link { position: static; }
.data.data--orders a.ng-link::after { content: ""; position: absolute; inset: 0; }
.data.data--orders td.actions .btn { position: relative; z-index: 1; }
.data.data--orders a.ng-link:focus-visible { outline: none; }
.data.data--orders a.ng-link:focus-visible::after { outline: 2px solid var(--navy); outline-offset: -2px; }
@media (max-width: 900px) {
  .data--cards.data--orders a.ng-link::after { inset: 0; border-radius: var(--r-lg); }
  .data--cards.data--orders tbody tr:hover { border-color: var(--navy-200); }
}

/* ---------- 20. Left sidebar (navy), from 1280px ---------- */
/* CSS only, on the existing header markup: the brand, the primary nav (with the existing
   Notifications link) and the user menu become a fixed 240px navy sidebar; the header
   becomes a slim top bar with New order and the bell. Below 1280px nothing changes. */
@media (min-width: 1280px) {
  body:has(> .app-header) { padding-inline-start: 240px; }
  .app-header__inner::before {
    content: ""; position: fixed; inset-block: 0; inset-inline-start: 0; width: 240px;
    background: var(--navy-900); box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
  }
  .brand {
    position: fixed; top: 0; inset-inline-start: 0; width: 240px; height: calc(var(--header-h) + 3px);
    padding: 0 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .main-nav {
    position: fixed; top: calc(var(--header-h) + 3px); bottom: 73px; inset-inline-start: 0; width: 240px; height: auto;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 16px 12px; overflow-y: auto; scrollbar-width: thin;
  }
  .main-nav .nav-link { flex-shrink: 0; height: 40px; gap: 10px; padding: 0 12px; }
  .main-nav .nav-link .ar { margin-inline-start: auto; }
  .main-nav .nav-link .count { margin-inline-start: 8px; }
  .main-nav .nav-link:hover { background: rgba(255, 255, 255, 0.07); }
  .main-nav .nav-link[aria-current="page"] { background: rgba(255, 255, 255, 0.09); color: #fff; }
  /* The active item's orange marker is a left bar. */
  .main-nav .nav-link[aria-current="page"]::after {
    inset-inline: 0 auto; top: 8px; bottom: 8px; width: 3px; height: auto; border-radius: 0 3px 3px 0;
  }
  .main-nav > .nav-divider { display: block; height: 1px; margin: 10px 12px; background: rgba(255, 255, 255, 0.1); }
  .main-nav > a.nav-mobile-only { display: flex; }
  /* User card at the bottom of the sidebar; its menu opens upward. */
  .header-actions > .menu:has(> .user-btn) {
    position: fixed; bottom: 0; inset-inline-start: 0; width: 240px; padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08); background: var(--navy-900);
  }
  .app-header .header-actions .user-btn { display: flex; width: 100%; height: 48px; gap: 10px; padding: 0 10px 0 6px; }
  .header-actions .user-btn .avatar { width: 32px; height: 32px; }
  .header-actions .user-btn__name { max-width: none; }
  .header-actions .user-btn > .icon { margin-inline-start: auto; transform: rotate(180deg); }
  .header-actions > .menu:has(> .user-btn) > .menu__panel { top: auto; bottom: calc(100% + 4px); inset-inline: 12px auto; width: 300px; }
  /* The filter row stays one row in the narrower content area (four equal fields). */
  .toolbar--flat .toolbar__search { flex-basis: 240px; }
  .toolbar--flat .toolbar__field { flex-basis: 120px; }
}

/* =====================================================================
   UI/UX proposal v2 — Phase 5c ("visibly new app") and the measured
   follow-ups F7 (filter row) and F8 (row height). Additive only; no pinned
   rule is edited or moved. Template changes: index.html (operations band)
   and order_view.html (summary header). Arabic stays >= 13px, is quietened
   by colour only and keeps >= 4.5:1; orange stays an accent, never a button.
   ===================================================================== */

/* ---------- 5. App background: a light navy-25, so white cards read as surfaces ---------- */
:root {
  --navy-25: #F3F5FA;
  --bg: var(--navy-25);            /* --text-4 on it: 4.75:1 */
  /* One card elevation for every surface. */
  --shadow-card: 0 1px 2px rgba(14, 22, 41, 0.06), 0 1px 3px rgba(14, 22, 41, 0.08);
}
@media (min-width: 1101px) {
  :root { --gutter: 24px; }        /* 24px page padding on desktop */
}

/* ---------- 4. One card system: white, 1px border, 8px radius, one shadow, navy-50 header strip ---------- */
.card { border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.view-section:has(#sec-1), .stack > .card.disclosure[open], .panel-center, .auth__card { box-shadow: var(--shadow-card); }
.card > .card__header {
  background: var(--navy-50); border-bottom-color: var(--navy-100);
}
.card > .card__header:first-child { border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0; }
.stage-guide:not([open]) > .card__header { border-radius: calc(var(--r-lg) - 1px); }
.card__title { color: var(--navy-900); }
.page--dash #orders > .card__header .card__title { font-size: var(--fs-lg); }
/* Pills that sit on a header strip keep a white face (phones draw the pill with ::before). */
@media (min-width: 761px) {
  .card__header > .dash-total:not(:hover):not(.is-selected) { background: var(--surface); }
}
@media (max-width: 760px) {
  .page--dash .card__header > .dash-total:not(:hover):not(.is-selected)::before { background: var(--surface); }
}
/* Open "Add …" panels: the same strip. */
.card.disclosure[open] > summary { background: var(--navy-50); }
.card.disclosure[open] > .disclosure__body { border-top-color: var(--navy-100); }
/* Order form sections: the head and its description form one strip. */
.form-section__head, .form-section__desc { background: var(--navy-50); }
.form-section__head { border-bottom-color: var(--navy-100); }
.form-section__title { color: var(--navy-900); }
.form-section[open]:has(> .form-section__desc) > .form-section__head { border-bottom: 0; }
.form-section__desc { padding-bottom: var(--s-3); border-bottom: 1px solid var(--navy-100); }
/* Empty View sections stay one compact white row (no strip). */
.view-section:has(.view-empty) { background: var(--surface); box-shadow: var(--shadow-card); }
.view-section:has(.view-empty) > .card__header { background: transparent; border-radius: 0; }
/* Table cards: filters and chips belong to the header strip. */
.table-card > .toolbar, .table-card > .toolbar__row { background: var(--navy-50); border-bottom-color: var(--navy-100); }
/* Phone order cards use the card elevation. */
@media (max-width: 900px) {
  .data--cards tbody tr { box-shadow: var(--shadow-card); }
}
/* 24px between sections and cards (16px on phones). */
.card + .card { margin-top: 24px; }
.stack > .card + .card, .dash-grid > .card + .card, .view-main > .card + .card, .view-aside > .card + .card,
.form-main > .card + .card, .form-aside > .card + .card { margin-top: 0; }
@media (min-width: 761px) {
  .stack { gap: 24px; }
  .view-layout, .form-layout, .view-main, .form-main, .view-aside, .form-aside { gap: 24px; }
}
@media (max-width: 760px) {
  .card + .card { margin-top: 16px; }
}

/* ---------- 1. Dashboard: one navy operations band (KPIs + pipeline) ---------- */
.ops-band {
  display: grid; gap: 16px; padding: 20px 24px 12px;
  background: var(--navy-900); color: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-card);
}
.ops-band a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* KPIs: white 24px numbers, light navy labels (navy-100 12:1, Arabic navy-200 8:1). */
.ops-band .dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.ops-band .dash-kpi {
  display: flex; flex-wrap: wrap; align-items: baseline; align-content: flex-start; column-gap: 6px; row-gap: 2px; min-width: 0;
  padding: 12px 16px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.04); color: var(--navy-100); font-size: var(--fs-sm); font-weight: 600; line-height: 1.35;
}
.ops-band .dash-kpi b {
  flex: 0 0 100%; margin-bottom: 4px; color: #fff; font-size: var(--fs-2xl); font-weight: 700; line-height: 1;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.ops-band .dash-kpi .ar { margin: 0; color: var(--navy-200); font-size: 13px; font-weight: 500; line-height: 1.4; }
.ops-band .dash-kpi:hover { border-color: rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.09); color: #fff; text-decoration: none; }
/* Needs action: an orange start edge and number (orange on navy-900 7:1), not a button. */
.ops-band .dash-kpi--attention { border-color: rgba(244, 123, 32, 0.4); box-shadow: inset 3px 0 0 var(--orange); }
.ops-band .dash-kpi--attention b { color: var(--orange); }
/* Zero: the number is quieter (#8FA3CC on navy-900 6.3:1), the label unchanged. */
.ops-band .dash-kpi.is-zero { color: var(--navy-100); }
.ops-band .dash-kpi.is-zero b { color: #8FA3CC; font-weight: 500; }
/* Pipeline: a connected horizontal stepper on the band. */
.ops-band .stage-board { padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.ops-band .pipeline {
  padding-top: 0; background: transparent; border: 0;
  border-radius: 0; box-shadow: none; overflow: visible;
}
.ops-band .pipeline .stage {
  --ring: var(--navy-900);
  color: #fff; border-color: rgba(255, 255, 255, 0.1); border-radius: var(--r-lg);
  background: transparent;
}
.ops-band .pipeline .stage:hover { --ring: var(--navy-800); background-color: var(--navy-800); }
.ops-band .pipeline .stage.is-selected { --ring: var(--navy-700); background-color: var(--navy-700); box-shadow: inset 0 -3px 0 var(--orange); }
.ops-band .pipeline .stage::after { background: rgba(255, 255, 255, 0.18); }
.ops-band .pipeline .stage .stage__step { background: var(--navy-200); box-shadow: 0 0 0 4px var(--ring); }
.ops-band .stage__label { color: var(--navy-100); }
.ops-band .pipeline .stage__label .ar { color: var(--navy-200); }
.ops-band .pipeline .stage__count { color: #fff; }
.ops-band .pipeline .stage__count.is-zero { color: #8FA3CC; font-weight: 500; }
@media (max-width: 760px) {
  /* Phones: KPIs 2-up; each mode's stages auto-fit without sideways scroll. */
  .ops-band { gap: 12px; padding: 14px 12px 8px; }
  .ops-band .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ops-band .dash-kpi { padding: 10px 12px; }
  .ops-band .stage-group .pipeline { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
  .ops-band .stage-group .pipeline .stage { grid-column: auto; }
}
@media (min-width: 761px) and (max-width: 900px) {
  /* Tablets: the same auto-fit as phones, so a six-stage path never leaves its last stage alone on a row. */
  .ops-band .stage-group .pipeline { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
  .ops-band .stage-group .pipeline .stage { grid-column: auto; }
}

/* ---------- F7. Dashboard filters: the four selects share one row, equal widths ---------- */
@media (min-width: 761px) {
  /* 761–1100px: Search on its own row, then Company / Vendor / Owner / Stage + Apply. */
  .toolbar.toolbar--flat { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end; }
  .toolbar.toolbar--flat > .toolbar__search { grid-column: 1 / -1; }
}
@media (min-width: 1101px) {
  /* From 1101px: Search + the four selects + Apply in one row. */
  .toolbar.toolbar--flat { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) minmax(18ch, 1.35fr) auto; }
  .toolbar.toolbar--flat > .toolbar__search { grid-column: auto; }
}

/* ---------- 3 / F8. Order tables as the main surface: a status edge per row, compact rows ---------- */
/* The row's stage colour comes from its status badge (no new markup): a 4px edge on the first cell. */
.data.data--orders tbody tr { --edge: transparent; }
.data.data--orders tbody tr:has(> td.col-status .badge--waiting) { --edge: #98A2B3; }
.data.data--orders tbody tr:has(> td.col-status .badge--confirmed) { --edge: #3E6FD1; }
.data.data--orders tbody tr:has(> td.col-status .badge--sea) { --edge: #0E8C7E; }
.data.data--orders tbody tr:has(> td.col-status .badge--port) { --edge: #5146C8; }
.data.data--orders tbody tr:has(> td.col-status .badge--land) { --edge: #9A4A00; }
.data.data--orders tbody tr:has(> td.col-status .badge--completed) { --edge: var(--success); }
.data.data--orders tbody tr:has(> td.col-status .badge--cancelled) { --edge: #98A2B3; }
/* Needs action wins: stuck orange, ETA passed red (as the Needs-action buckets). */
.data.data--orders tbody tr.row--warn:has(> td.col-status) { --edge: var(--orange); }
.data.data--orders tbody tr.row--overdue:has(> td.col-status) { --edge: var(--danger); }
@media (min-width: 901px) {
  .data.data--orders tbody tr > td:first-child { box-shadow: inset 4px 0 0 var(--edge); }
  /* Compact rows: 8px cell padding, 13px text on an 18px line, 12px headers (13px Arabic). */
  .data.data--orders tbody td { padding: 8px; font-size: 13px; line-height: 18px; }
  .data.data--orders thead th { padding: 8px; font-size: 12px; line-height: 16px; }
  .data.data--orders thead tr > th .ar { margin-top: 1px; font-size: 13px; line-height: 18px; }
  .data.data--orders tbody td:first-child, .data.data--orders thead th:first-child { padding-inline-start: 14px; }
  .data.data--orders tbody td.actions { padding-inline-end: 12px; }
  .data.data--orders .cell-sub { font-size: 12px; line-height: 16px; }
  .data.data--orders .vendors, .data.data--orders .owners { line-height: 18px; }
  /* Vendors flow inline (each role stays together, long names wrap), so the cell is short. */
  .data.data--orders .vendors { display: flex; flex-wrap: wrap; column-gap: 10px; row-gap: 0; }
  .data.data--orders .transport { gap: 2px; }
  /* Short, fixed-content cells shrink to their content. */
  .data.data--orders td.col-status, .data.data--orders td[data-label="ETA"] { width: 1%; white-space: nowrap; }
  .data.data--orders td.col-status .badge { gap: 5px; padding-inline-end: 8px; }
  /* View + Edit side by side at every desktop width (the whole row also opens the order). */
  .data.data--orders td.actions .row-actions--order { flex-direction: row; align-items: center; gap: 4px; }
  .data.data--orders td.actions .btn--sm { height: 28px; padding-inline: 8px; font-size: 13px; }
}
@media (min-width: 901px) and (max-width: 1279.98px) {
  .data.data--orders td.col-service { width: 72px; }
  .data.data--orders td.col-commodity { width: 96px; }
}
@media (min-width: 1101px) and (max-width: 1279.98px) {
  .data.data--orders td.col-transport { width: 120px; }
  .data.data--orders td.col-owners { width: 104px; }
}
@media (min-width: 1280px) and (max-width: 1439.98px) {
  /* Next to the sidebar every column (incl. Vendors and Owners) must fit: tighter sides, no fixed widths. */
  .data.data--orders tbody td, .data.data--orders thead th { padding-inline: 6px; }
  .data.data--orders tbody td:first-child, .data.data--orders thead th:first-child { padding-inline-start: 12px; }
  .data.data--orders tbody td.actions { padding-inline-end: 10px; }
}
@media (min-width: 1440px) {
  .data.data--orders tbody td, .data.data--orders thead th { padding-inline: 10px; }
  .data.data--orders tbody td:first-child, .data.data--orders thead th:first-child { padding-inline-start: 14px; }
  .data.data--orders td.col-service { width: 80px; }
  .data.data--orders td.col-commodity { width: 104px; }
  .data.data--orders td.col-transport { width: 124px; }
  .data.data--orders td.col-owners { width: 112px; }
}
@media (max-width: 900px) {
  /* Phone cards (Active): the same stage edge on the card's start side. */
  .data--cards.data--orders:not(.data--archive) tbody tr { box-shadow: var(--shadow-card), inset 4px 0 0 var(--edge); }
}

/* ---------- 9 (v2). Order View: a summary card with a 5-step tracker ---------- */
.page-header.view-summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "main facts actions" "track track track";
  align-items: center; gap: 16px 32px; margin: 24px 0; padding: 20px 24px 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); clip-path: none;
}
.view-summary__main { grid-area: main; min-width: 0; }
.view-summary .page-title { gap: 6px 12px; }
.view-summary .page-title .mono { color: var(--navy-900); font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.01em; }
.view-summary .page-sub { margin-top: 4px; color: var(--text-2); font-size: var(--fs-md); }
.view-summary__facts { grid-area: facts; display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 0; }
.view-summary__facts .detail { gap: 6px; }
.view-summary__facts .detail dd.mono { color: var(--navy-900); font-size: var(--fs-lg); }
.view-summary > .page-actions--view { grid-area: actions; }
/* Tracker: done (navy), current (navy with an orange ring), upcoming (outlined). English only. */
.tracker {
  grid-area: track; display: grid; grid-template-columns: minmax(0, 1fr);
  margin: 4px -24px 0; padding: 16px 24px; list-style: none;
  background: var(--navy-50); border-top: 1px solid var(--navy-100); border-radius: 0 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px);
}
.tracker--steps-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tracker--steps-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tracker--steps-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tracker--steps-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tracker--steps-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tracker--steps-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.tracker__step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding-inline: 4px; text-align: center; }
.tracker__step + .tracker__step::before {
  content: ""; position: absolute; z-index: 0; top: 11px; inset-inline-end: 50%; width: 100%; height: 2px; background: var(--navy-100);
}
.tracker__num {
  position: relative; z-index: 1; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); color: var(--text-3); font-size: var(--fs-xs); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--border-strong);
}
.tracker__label {
  color: var(--text-3); font-size: var(--fs-sm); font-weight: 600; line-height: 1.3;
  word-break: normal; overflow-wrap: normal; hyphens: none;
}
.tracker__step.is-done .tracker__num { background: var(--navy); color: #fff; box-shadow: none; }
.tracker__step.is-done::before, .tracker__step.is-current::before { background: var(--navy); }
.tracker__step.is-done .tracker__label { color: var(--text-2); }
.tracker__step.is-current .tracker__num { background: var(--navy-900); color: #fff; box-shadow: 0 0 0 3px var(--navy-50), 0 0 0 5px var(--orange); }
.tracker__step.is-current .tracker__label { color: var(--navy-900); font-weight: 700; }
/* Completed: every step done. Cancelled: the steps are quiet with a dashed connector. */
.tracker--cancelled .tracker__num { background: var(--surface-3); color: var(--text-4); box-shadow: inset 0 0 0 1.5px var(--border); }
.tracker--cancelled .tracker__label { color: var(--text-4); }
.tracker--cancelled .tracker__step + .tracker__step::before {
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 4px, transparent 4px 8px);
}
@media (max-width: 1100px) {
  .page-header.view-summary { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main actions" "facts facts" "track track"; }
}
@media (max-width: 760px) {
  .page-header.view-summary {
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "facts" "actions" "track";
    gap: 14px; margin: 16px 0; padding: 16px 16px 0;
  }
  .view-summary__facts { gap: 12px 24px; }
  .tracker { margin-inline: -16px; padding: 14px 8px; }
  .tracker__step { padding-inline: 2px; }
  .tracker__label { font-size: 10px; line-height: 1.15; }
}

/* =====================================================================
   UI/UX proposal v2 — Phase 5d (QA pass on 549bcaa). Additive only; no
   pinned rule is edited or moved, no template changed. Arabic stays
   >= 13px, is quietened by colour only and keeps >= 4.5:1.
   ===================================================================== */

/* ---------- Q2. Order tables from 1280px: fixed column widths, short rows ---------- */
/* The first row (thead) sets the widths; Customer and Vendors share what is left, so the
   table always fits its box (also with a classic scrollbar). Nothing is hidden or cut:
   names wrap between words; the status pill, dates and BL numbers keep one line. */
@media (min-width: 1280px) {
  .data.data--orders { table-layout: fixed; width: 100%; }
  .data.data--orders thead tr > th { letter-spacing: .04em; }
  .data.data--orders thead tr > th .en { white-space: normal; }
  .data.data--orders td.col-company .cell-main { overflow-wrap: break-word; }
  .data.data--orders td.actions .btn--sm { padding-inline: 6px; }
  .data.data--orders tbody td.actions { padding-inline: 4px 8px; }
  .data.data--orders .owners span.k { letter-spacing: .02em; }
  /* Owners key | value grid (from 1381px): a 40px key column, so the names fit on one line. */
  .data.data--orders .owners > span { grid-template-columns: 40px minmax(min-content, 1fr); column-gap: 4px; }
  .data.data--orders .eta--overdue { column-gap: 3px; }
  .data.data--orders .eta--overdue .icon { width: 12px; height: 12px; }
}
@media (min-width: 1280px) and (max-width: 1439.98px) {
  .data.data--orders tbody td, .data.data--orders thead th { padding-inline: 5px; }
  .data.data--orders tbody td:first-child, .data.data--orders thead th:first-child { padding-inline-start: 12px; }
  /* Active: NG | Customer | Status | Service type | Transport | Commodity | Vendors | ETA | Owners | actions */
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(1) { width: 88px; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(3) { width: 138px; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(4) { width: 64px; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(5) { width: 114px; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(6) { width: 72px; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(8) { width: 106px; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(9) { width: 112px; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(10) { width: 100px; }
}
@media (min-width: 1440px) {
  .data.data--orders tbody td, .data.data--orders thead th { padding-inline: 6px; }
  .data.data--orders tbody td:first-child, .data.data--orders thead th:first-child { padding-inline-start: 12px; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(1) { width: 88px; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(2) { width: 14%; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(3) { width: 140px; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(4) { width: 66px; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(5) { width: 132px; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(6) { width: 74px; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(8) { width: 106px; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(9) { width: 114px; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(10) { width: 100px; }
}
@media (min-width: 1280px) {
  /* Archive: NG | Customer | Status | Commodity | Transport | Vendors | ETA (date only) | Owners | actions */
  .data.data--archive > thead > tr > th:nth-child(1) { width: 88px; }
  .data.data--archive > thead > tr > th:nth-child(3) { width: 140px; }
  .data.data--archive > thead > tr > th:nth-child(5) { width: 132px; }
  .data.data--archive > thead > tr > th:nth-child(7) { width: 96px; }
  .data.data--archive > thead > tr > th:nth-child(8) { width: 114px; }
  .data.data--archive > thead > tr > th:nth-child(9) { width: 100px; }
}

/* ---------- Q3. Order form: the Required / Optional tag of a half-width section sits under its title ---------- */
@media (min-width: 761px) {
  .form-section:not(.form-section--wide) > .form-section__head {
    grid-template-columns: minmax(0, 1fr) 20px; grid-template-areas: "t c" "b c";
  }
  .form-section:not(.form-section--wide) > .form-section__head > .form-section__title { grid-area: t; }
  .form-section:not(.form-section--wide) > .form-section__head > .section-requirement {
    grid-area: b; justify-self: start; flex-wrap: wrap; max-width: 100%; margin-inline-start: 34px;
  }
  .form-section:not(.form-section--wide) > .form-section__head > .form-section__chev { grid-area: c; }
}

/* ---------- Q4. Sidebar nav: every item fits the 240px column (no sideways scroll) ---------- */
@media (min-width: 1280px) {
  .main-nav { padding-inline: 8px; overflow-x: hidden; }
  .main-nav .nav-link { gap: 8px; padding: 0 10px; }
  .main-nav .nav-link .count { margin-inline-start: 6px; }
  .main-nav > .nav-divider { margin-inline: 16px; }
}

/* ---------- Q5. The navy sidebar column runs the full page height ---------- */
@media (min-width: 1280px) {
  body:has(> .app-header) {
    background: linear-gradient(to right, var(--navy-900) 240px, var(--bg) 240px);
  }
}

/* ---------- Q6. Phone "8 orders" / "1 arriving": the element paints its own pill (>= 4.5:1) ---------- */
/* A 44px tall box: 7px transparent borders above and below, the fill clipped to the 30px
   padding box; the thin outline is an inset shadow inside it. */
@media (max-width: 760px) {
  .page--dash .card__header > .dash-total,
  .page--dash .card__header > .dash-total:not(:hover):not(.is-selected) {
    min-height: 44px; margin-block: -9px; padding-inline: 10px;
    border: 7px solid transparent; border-inline-width: 0;
    background: var(--surface) padding-box; box-shadow: inset 0 0 0 1px var(--navy-100); color: var(--navy-900);
  }
  .page--dash .card__header > .dash-total:is(:hover, .is-selected) {
    border-color: transparent; background: var(--navy) padding-box; box-shadow: none; color: #fff;
  }
  .page--dash .card__header > .dash-total::before,
  .page--dash .card__header > .dash-total:not(:hover):not(.is-selected)::before { content: none; }
}

/* ---------- Q7. Phone operations band: stages 4 and 5 without boxed cell borders (as 1–3) ---------- */
@media (max-width: 760px) {
  .ops-band .pipeline .stage:nth-child(n+4) { border-top: 0; }
  .ops-band .pipeline .stage:nth-child(5) { border-inline-start: 0; }
}

/* =====================================================================
   UI/UX proposal v2 — Phase 5e (polish on 8105b9e). Additive only.
   ===================================================================== */

/* ---------- Q8. From 1280px the slim top bar is the sidebar's navy-900 (one navy) ---------- */
/* The 3px orange line, the white focus ring, the orange New order button and the bell stay.
   Only the fill gets darker, so every top-bar text/icon gains contrast (white 16:1; the
   0.82 icons >= 11:1). Below 1280px the header keeps --navy. */
@media (min-width: 1280px) {
  .app-header { background: var(--navy-900); }
}

/* =====================================================================
   UI/UX proposal v3 — Design's v2 re-review conditions C1–C3 (R1–R3).
   Additive only; no pinned rule is edited or moved, no template changed.
   Arabic stays >= 13px, is quietened by colour only and keeps >= 4.5:1.
   ===================================================================== */

/* ---------- C1 (R1). Whole-row link (#22): data cells sit above the stretched NG link ---------- */
/* BL numbers, vendors, owners and ETAs can be selected and copied again, and their title
   tooltips show. The NG link, the company cell and the empty space of every cell still open
   the order (the customer name itself is lifted too where it is cut: last block of this file).
   Same classes on Active and Archive, so both tables are covered. */
.data.data--orders tbody td:is(.col-transport,.col-commodity,.col-vendors,[data-label="ETA"],.col-owners) > * { position: relative; z-index: 1; }

/* Keep provider information accessible by click/touch, with a separate action column. */
.vendor-summary > summary { cursor: pointer; color: var(--navy-900); font-weight: 600; }
.vendor-summary[open] .vendors { margin-top: 8px; }
.vendor-summary .vendors > span { overflow-wrap: anywhere; }
.assignment-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) auto; gap: 12px; padding-block: 12px; border-bottom: 1px solid var(--navy-100); }
@media (max-width: 760px) {
  .assignment-row { grid-template-columns: minmax(0,1fr); }
}
@media (min-width: 901px) {
  .page--dash .ops-band { padding: 12px 16px 8px; gap: 8px; }
  .page--dash .ops-band .dash-kpi { padding: 8px 12px; }
  .page--dash .ops-band .dash-kpi b { flex-basis: auto; margin-bottom: 0; }
  .page--dash .ops-band .pipeline .stage { padding-block: 12px 20px; }
  .data.data--orders:not(.data--archive) { width: 100%; min-width: 0; table-layout: fixed; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(1) { width: 7%; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(2) { width: 12%; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(3) { width: 16%; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(4) { width: 7%; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(5) { width: 11%; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(6) { width: 11%; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(7) { width: 9%; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(8) { width: 7%; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(9) { width: 12%; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(10) { width: 8%; }
  .data.data--orders tbody td { min-width: 0; overflow-wrap: anywhere; }
  .data.data--orders td.col-service { white-space: normal; }
  .data.data--orders .owners { min-width: 0; max-width: 100%; }
  .data.data--orders tbody td.actions { position: static; }
  .data.data--orders .row-actions--order { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .data.data--orders .owners > span { grid-template-columns: 40px minmax(0,1fr); }
  .data.data--orders .owners > span, .data.data--orders td.col-commodity { overflow-wrap: anywhere; }
}

/* ---------- C2 (R2, decision A). A 96px labelled rail at 1280–1439px ---------- */
/* The full 240px sidebar (5b #20) stays from 1440px. Same markup: the rules below narrow the
   column and stack each nav item (icon, English 12px, Arabic 13px; nothing hidden or cut).
   The user card shows the avatar only; the name stays in the button as screen-reader text,
   and its menu still opens upward, to the right of the rail. */
@media (min-width: 1280px) and (max-width: 1439.98px) {
  body:has(> .app-header) {
    padding-inline-start: 96px;
    background: linear-gradient(to right, var(--navy-900) 96px, var(--bg) 96px);
  }
  .app-header__inner::before { width: 96px; }
  .brand { width: 96px; padding: 0 8px; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
  .brand img { width: 78px; height: auto; }
  .main-nav { width: 96px; padding: 12px 6px; gap: 4px; }
  .main-nav .nav-link {
    height: auto; min-height: 64px; flex-direction: column; justify-content: center; align-items: center;
    gap: 3px; padding: 8px 2px; text-align: center; white-space: normal; overflow-wrap: anywhere;
  }
  .main-nav .nav-link .en { font-size: 12px; line-height: 1.2; }
  .main-nav .nav-link .ar { margin-inline-start: 0; font-size: 13px; line-height: 1.3; }
  .main-nav .nav-link .count { position: absolute; top: 6px; inset-inline-end: 8px; margin: 0; }
  .main-nav > .nav-divider { margin: 8px 10px; }
  .header-actions > .menu:has(> .user-btn) { width: 96px; padding: 12px 8px; }
  .app-header .header-actions .user-btn { justify-content: center; padding: 0; }
  /* Name: visually hidden, still the button's accessible name (no text added or removed). */
  .header-actions .user-btn__name {
    position: absolute; width: 1px; height: 1px; max-width: none; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .header-actions .user-btn > .icon { display: none; }
  .header-actions > .menu:has(> .user-btn) > .menu__panel { inset-inline: 8px auto; }
}
/* The brand touches the top of the viewport: its white focus ring is drawn inside it. */
@media (min-width: 1280px) {
  .brand:focus-visible { outline-offset: -4px; }
}

/* ---------- C3 (decision B). The Sales role is a category, not an attention colour: neutral grey ---------- */
/* Orange stays for Needs action, the current stage, unread, the nav marker, the brand line
   and the Arrivals "Today" tile. Sales vs Ops: the label, and Ops keeps its blue. */
.badge--role-sales { background: var(--surface-2); color: var(--text-2); border-color: var(--border-strong); } /* 10:1 */
.menu__user .badge--role-sales { color: var(--text-2); }
.role-card:nth-child(3) { border-top-color: var(--border-strong); }

/* A reversible desktop rail reclaims content space; the mobile drawer stays separate. */
.sidebar-toggle { display: none; }
@media (min-width: 1280px) {
  body:has(> .app-header) { --sidebar-width: 240px; padding-inline-start: var(--sidebar-width); background: linear-gradient(to right, var(--navy-900) var(--sidebar-width), var(--bg) var(--sidebar-width)); }
  body.sidebar-compact { --sidebar-width: 72px; }
  .app-header__inner::before, .brand, .main-nav, .header-actions > .menu:has(> .user-btn) { width: var(--sidebar-width); }
  .sidebar-toggle { display: inline-flex; position: fixed; top: calc(var(--header-h) + 8px); inset-inline-start: calc(var(--sidebar-width) - 44px); width: 36px; height: 36px; }
  .main-nav { top: calc(var(--header-h) + 52px); padding: 12px 8px; }
  .main-nav .nav-link { flex-direction: row; justify-content: flex-start; text-align: start; height: 52px; min-height: 52px; padding: 8px 12px; font-size: 14px; }
  .main-nav .nav-link .en { font-size: 14px; }
  .main-nav .nav-link .ar { margin-inline-start: 4px; font-size: 13px; }
  .brand { padding: 0 20px; flex-direction: row; gap: 8px; }
  .brand img { width: 113px; }
  .header-actions .user-btn__name { position: static; width: auto; height: auto; margin: 0; clip: auto; white-space: normal; overflow: visible; }
  .header-actions .user-btn > .icon { display: block; }
  .sidebar-compact .brand { padding: 0 6px; justify-content: center; }
  .sidebar-compact .brand img { width: 60px; }
  .sidebar-compact .brand__product { display: none; }
  .sidebar-compact .main-nav .nav-link { justify-content: center; padding: 8px; }
  .sidebar-compact .main-nav .nav-link .en, .sidebar-compact .main-nav .nav-link .ar, .sidebar-compact .user-btn__name { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .sidebar-compact .main-nav .count { position: absolute; top: 4px; inset-inline-end: 4px; }
  .sidebar-compact .header-actions > .menu:has(> .user-btn) { padding: 12px 8px; }
  .sidebar-compact .user-btn { justify-content: center !important; padding: 0 !important; }
  .sidebar-compact .user-btn > .icon { display: none; }
}

/* Service paths reuse the existing cards and palette; no extra mobile scrolling. */
.form-section[hidden] { display: none; }
@media (min-width: 901px) {
  .ops-band .pipeline { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

/* New Order keeps the approved full-width operational layout. */
.new-order-layout .form-layout { display: block; }
.new-order-layout .form-section { width: 100%; }
.new-order-layout .form-section__num { display: none; }
.new-order-layout .form-aside { margin-top: 16px; }
.order-meta { display:flex; flex-wrap:wrap; gap:12px 24px; padding:12px 16px; background:#eef2f8; border-radius:8px; margin-bottom:16px; }
.field-help { font-size:12px; position:relative; color:#526079; }
.field-help > summary { display:inline-block; cursor:pointer; padding:4px 8px; font-size:16px; list-style:none; }
.field-help[open] { padding:8px; background:#f3f6fa; border-radius:6px; }
.section-help { margin:0 16px; }
.measurement-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.service-providers { border-top:1px solid #e0e5ee; padding-top:12px; }
.service-providers h3 { font-size:13px; margin:0; }
@media(max-width:640px) { .measurement-grid { grid-template-columns:1fr; } .assignment-row { min-width:0; } }

.new-order-layout .service-providers, .new-order-layout [data-sea-fcl], .new-order-layout [data-sea-lcl] { grid-column: 1 / -1; }
.new-order-layout .service-providers .assignment-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) auto; }
@media(max-width:760px) { .new-order-layout .service-providers .assignment-row { grid-template-columns: minmax(0,1fr); } }

/* ---------- Order page, final design (new-order-simplify 2026-10-13, sea-v3 / entry-sea) ----------
   Edit, View and New order: Shipment card, Stages pill bar, ONE current-stage panel, the vendors of
   earlier stages, then "All order details" collapsed. Scoped to .order-page. Values from the mockups. */
.order-page { --op-line: #EBEFF5; --op-muted: #667085; --op-label: #344054; --op-dim: #98A2B3; }
.order-page .op-layout { display: grid; grid-template-columns: minmax(0, 1044px); gap: 20px; align-items: start; }
.order-page .op-layout:has(> .op-aside) { grid-template-columns: minmax(0, 1044px) 300px; }
.order-page .op-form, .order-page .op-main { display: block; min-width: 0; order: 0; }
.order-page.order-page--view .op-main { display: block; }
.order-page .op-aside { min-width: 0; }
.order-page .op-aside__card { padding: 14px 16px; }
.order-page .order-form--sticky-actions { padding-bottom: 0; }
.order-page .op-default-submit { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
.order-page .op-head__sub { margin-top: 2px; color: #475467; font-size: 13px; }
.order-page .op-data { unicode-bidi: plaintext; }
/* Cards */
.order-page .op-card, .order-page .order-more, .order-page .op-step, .order-page .op-team {
  margin: 0 0 14px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: none; overflow: visible;
}
.order-page .op-card + .op-card, .order-page .op-card + .order-more, .order-page .op-step + .op-step { margin-top: 0; }
.order-page .op-card__head, .order-page .op-step .form-section__head, .order-page .op-step__head, .order-page .op-part__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 18px; background: none; border-bottom: 1px solid var(--op-line);
}
.order-page .op-card__title, .order-page .op-panel__title, .order-page .op-step .form-section__title, .order-page .op-team__title {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0; font-size: 15px; font-weight: 700; letter-spacing: 0;
}
.order-page .op-panel__title { align-items: center; }
.order-page .op-card__head .ar, .order-page .op-step .form-section__title .ar, .order-page .op-team__title .ar,
.order-page .order-more__title .ar { margin: 0; color: var(--op-muted); font-size: 12px; font-weight: 500; }
.order-page .op-card__head .ar::before, .order-page .op-step .form-section__title .ar::before, .order-page .order-more__title .ar::before { content: none; }
.order-page .op-num {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; align-self: center;
}
.order-page .op-panel--current .op-num { background: var(--orange); }
.order-page .op-num--done { background: var(--success) !important; }
.order-page .op-num--cancelled { background: #667085 !important; }
.order-page .op-num .icon { width: 13px; height: 13px; }
.order-page .op-tag {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 3px; padding: 3px 8px; border-radius: 999px;
  background: #F2F4F7; color: #475467; font-size: 11px; font-weight: 700; line-height: 1.35; letter-spacing: 0;
}
.order-page .op-tag--orange { background: #FFF4E5; color: var(--orange-text); }
.order-page .op-tag--green { background: var(--success-bg); color: var(--success); }
.order-page .op-tag--red { background: var(--danger-bg); color: var(--danger); }
.order-page .op-card__head .op-tag:first-of-type { margin-inline-start: 4px; }
/* Shipment facts */
.order-page .op-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 16px 18px; }
.order-page .op-fact { min-width: 0; }
.order-page .op-fact dt { color: var(--op-muted); font-size: 12px; font-weight: 400; }
.order-page .op-fact dd { margin: 0; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.order-page .op-route__to { color: var(--op-muted); font-weight: 600; }
/* Optional "From → To" of a Land order (design entry-land): two inputs on one row. */
.op-fromto__row { display: flex; align-items: center; gap: 8px; }
.op-fromto__part { flex: 1 1 0; min-width: 0; margin: 0; }
.op-fromto__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.op-fromto__grid > .op-fromto__part { display: flex; flex-direction: column; gap: 6px; }
.op-fromto__grid input, .op-fromto__grid select { width: 100%; }
@media (max-width: 640px) { .op-fromto__grid { grid-template-columns: 1fr; } }
.op-fromto__arrow { flex: none; color: var(--text-3); font-weight: 700; }
/* Stage pills */
.order-page .op-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 16px 18px; list-style: none; }
.order-page .op-steps > .op-step {
  display: inline-flex; margin: 0; align-items: center; gap: 4px; padding: 8px 12px; border: 1px dashed #C9D2DF; border-radius: 999px;
  background: #fff; color: var(--op-dim); font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap;
}
.order-page .op-steps > .op-step--done { border: 1px solid var(--success-bd); background: var(--success-bg); color: var(--success); }
.order-page .op-steps > .op-step--current { border: 1px solid var(--navy); background: var(--navy); color: #fff; }
.order-page .op-steps > .op-step .icon { width: 13px; height: 13px; }
/* Current-stage panel */
.order-page .op-panel--current { border: 2px solid var(--orange); }
.order-page .op-panel__body { display: grid; gap: 14px; padding: 16px 18px; }
.order-page .op-panel__empty { margin: 0; padding: 16px 18px; color: var(--op-muted); }
.order-page .op-panel__body > .op-panel__empty { padding: 0; }
.order-page .op-group {
  margin: 0; padding-top: 10px; border-top: 1px solid var(--op-line);
  color: #475467; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.order-page .op-panel__body > .op-group:first-child { padding-top: 0; border-top: 0; }
.order-page .op-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; align-items: start; }
.order-page .op-grid > * { min-width: 0; }
.order-page .op-span, .order-page .op-grid > .transport-builder, .order-page .op-grid > fieldset.op-span { grid-column: 1 / -1; }
.order-page .op-grid > .op-port, .order-page .op-grid > .op-party { display: grid; gap: 10px; align-content: start; }
.order-page .op-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.order-page .op-panel .field__label, .order-page .op-step .field__label { color: var(--op-label); font-size: 12px; font-weight: 600; }
.order-page .op-panel .field__label .ar, .order-page .op-step .field__label .ar { font-size: 12px; }
.order-page .op-panel select, .order-page .op-panel input[type="text"], .order-page .op-panel input[type="number"] { height: 40px; }
.order-page .op-panel .field > select, .order-page .op-panel .field > input, .order-page .op-panel .date-field { width: 100%; max-width: none; }
.order-page .op-grid > .op-port, .order-page .op-grid > .op-party { grid-template-columns: minmax(0, 1fr); }
.order-page .op-grid > .op-port > *, .order-page .op-grid > .op-party > * { grid-column: 1 / -1; min-width: 0; }
.order-page > .alert { max-width: 1044px; }
.order-page--new .op-step--load:not(:has(> .op-part:not([hidden]))),
.order-page--new .op-step--route:not(:has(.op-part:not([hidden]))) { display: none; }
.order-page .op-panel .stage-req { display: none; }  /* the panel's own asterisk says it */
.order-page abbr.req { color: var(--danger); text-decoration: none; border: 0; }
.order-page .op-state { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.order-page .op-state__ok { display: inline-flex; align-items: center; gap: 3px; color: var(--success); }
.order-page .op-state__ok .icon { width: 12px; height: 12px; }
.order-page .op-state__req { color: var(--danger); }
.order-page .op-state [hidden] { display: none; }
.order-page .op-help { display: block; margin: 4px 0 0; color: var(--op-muted); font-size: 12px; font-weight: 400; }
.order-page .op-help--line { margin: 0; }
.order-page .op-recall { margin: 0; color: #475467; font-size: 13px; }
/* Port costs: one segmented choice (Itemised / Lump sum / Customer Arranged). */
.order-page .op-mode { display: grid; gap: 5px; min-width: 0; margin: 0; padding: 0; border: 0; }
.order-page .op-mode[hidden] { display: none; }
.order-page .op-mode > legend { float: left; width: 100%; margin: 0 0 5px; padding: 0; color: var(--op-label); font-size: 12px; font-weight: 600; }
.order-page .op-seg { display: inline-flex; flex-wrap: wrap; justify-self: start; max-width: 100%; border: 1px solid var(--navy); border-radius: 8px; overflow: hidden; }
.order-page .op-seg__opt { position: relative; display: inline-flex; cursor: pointer; }
.order-page .op-seg__opt[hidden] { display: none; }
.order-page .op-seg__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.order-page .op-seg__opt span { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; background: #fff; color: var(--op-label); font-size: 13px; font-weight: 600; }
.order-page .op-seg__opt span::before { content: ""; width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 50%; }
.order-page .op-seg__opt + .op-seg__opt span { border-inline-start: 1px solid #C9D2DF; }
.order-page .op-seg__opt input:checked + span { background: var(--navy); color: #fff; }
.order-page .op-seg__opt input:checked + span::before { background: #fff; border-color: #fff; }
.order-page .op-seg__opt input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: -2px; }
.order-page .op-seg__opt input:disabled + span { cursor: default; opacity: .6; }
/* Tick-box boxes (port charges, shipping line charges, items under the land company). */
.order-page .op-box { display: grid; gap: 8px; margin: 0; padding: 10px 12px; border: 1px solid var(--op-line); border-radius: 6px; background: #F8FAFC; }
.order-page .op-box[hidden] { display: none; }
.order-page .op-box > legend.op-box__title { float: left; width: 100%; padding: 0; }
.order-page .op-box__title { margin: 0 0 2px; color: var(--op-label); font-size: 12px; font-weight: 600; }
.order-page .op-box__title .ar { margin-inline-start: 6px; color: var(--op-muted); font-weight: 500; }
.order-page .op-checks { min-width: 0; border: 0; margin: 0; padding: 0; }
.order-page .op-box.op-checks { border: 1px solid var(--op-line); padding: 10px 12px; }
.order-page .op-checks__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
.order-page .op-checks__list { display: grid; }
.order-page .op-check { display: flex; }
.order-page .op-check:not(.op-check--other) > span {
  min-height: 0; gap: 10px; padding: 4px 0; border: 0; border-radius: 0; background: none;
  color: var(--text); font-size: 13px; font-weight: 400; letter-spacing: 0; line-height: 1.35;
}
.order-page .op-check:not(.op-check--other) > span::before { width: 18px; height: 18px; border: 1.5px solid var(--op-dim); border-radius: 4px; }
.order-page .op-check:not(.op-check--other) > input:checked + span { background: none; color: var(--text); }
.order-page .op-check:not(.op-check--other) > input:checked + span::before { background-size: 12px; }
.order-page .op-check--other { flex-direction: row; align-items: center; gap: 10px; }
.order-page .op-panel [data-repeat-add] { align-self: flex-start; }
.order-page .op-check--other .field__label { flex: none; color: var(--text); font-size: 13px; font-weight: 400; }
.order-page .op-check--other input { flex: 1; height: 32px; min-height: 32px; font-size: 12px; }
.order-page .op-box .port-lines, .order-page .op-box .port-others { gap: 6px; }
.order-page .op-box .port-line { padding: 4px 0; grid-template-columns: minmax(120px, .45fr) minmax(0, 1fr); }
.order-page .op-box .port-line input, .order-page .op-box .port-other input { height: 32px; min-height: 32px; font-size: 12px; }
.order-page .op-box .port-other { grid-template-columns: minmax(110px, .45fr) minmax(0, 1fr) auto; gap: 8px; }
.order-page .op-box .port-other .repeat-remove { height: 32px; }
.order-page .op-box .port-others > .field__label { font-size: 13px; font-weight: 400; color: var(--text); }
.order-page .op-box .port-picker__tip { display: none; }
.order-page .op-desc > summary { cursor: pointer; color: var(--op-muted); font-size: 12px; }
.order-page .op-desc[open] > summary { margin-bottom: 6px; }
.order-page .op-desc:not(:has(.port-line:not([hidden]))) { display: none; }
.order-page .op-box .port-picker__provider { max-width: none; }
/* Notes */
.order-page .op-note { margin: 0; padding: 10px 12px; border: 1px solid var(--info-bd); border-radius: 6px; background: var(--info-bg); color: var(--info); font-size: 12px; }
.order-page .op-note[hidden] { display: none; }
.order-page .op-note--ok { border-color: var(--success-bd); background: var(--success-bg); color: var(--success); }
.order-page .op-lump { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--op-line); border-radius: 6px; background: #F8FAFC; }
.order-page .op-lump p { margin: 0; }
.order-page .op-lump__title { font-size: 12px; font-weight: 700; color: var(--op-label); }
.order-page .op-lump__k { font-size: 12px; font-weight: 600; color: var(--op-label); }
.order-page .op-lump__value { display: flex; align-items: center; gap: 6px; font-weight: 700; }
/* Footer: Close stage */
.order-page .op-panel__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 0 18px 16px; }
.order-page .op-close { height: 40px; padding: 0 16px; font-size: 14px; font-weight: 600; }
.order-page .op-close span { display: inline; }
.order-page .op-close [hidden] { display: none; }
.order-page .op-close:disabled { background: var(--navy); color: #fff; opacity: .4; cursor: not-allowed; box-shadow: none; }
.order-page .op-foot__ok { color: var(--success); font-size: 13px; }
.order-page .op-foot__lock { color: var(--danger); font-size: 13px; }
.order-page .op-panel__foot [hidden] { display: none; }
.order-page .op-foot__edit { margin-inline-start: auto; }
/* Chosen in earlier stages */
.order-page .op-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; }
.order-page .op-chip { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.order-page .op-chip__k { color: var(--op-muted); }
.order-page .op-chips__none { font-size: 13px; }
/* Completed / Cancelled */
.order-page .op-closed { border: 2px solid var(--success); }
.order-page .op-closed--cancelled { border: 2px solid #C9D2DF; }
.order-page .op-table-wrap { overflow-x: auto; }
.order-page .op-table { width: 100%; border-collapse: collapse; }
.order-page .op-table th, .order-page .op-table td { padding: 10px 12px; border-bottom: 1px solid var(--op-line); font-size: 13px; text-align: start; vertical-align: middle; }
.order-page .op-table th { background: #F8FAFC; color: #475467; font-size: 12px; font-weight: 600; }
.order-page .op-table__role { display: block; color: var(--op-muted); font-size: 12px; }
.order-page .op-closed__foot { padding: 12px 18px 14px; }
/* View page: the read-only panel */
.order-page .op-ro-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.order-page .op-ro dt { color: var(--op-label); font-size: 12px; font-weight: 600; }
.order-page .op-ro dt .ar { margin-inline-start: 4px; color: var(--op-muted); font-weight: 500; }
.order-page .op-ro dd { display: grid; gap: 2px; margin: 2px 0 0; font-size: 14px; }
.order-page .op-ro__names { color: var(--text-2); font-size: 13px; }
/* All order details: collapsed card, its sub-sections flat inside. */
.order-page .order-more > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 14px 18px; cursor: pointer; list-style: none; }
.order-page .order-more > summary::-webkit-details-marker { display: none; }
.order-page .order-more__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 15px; font-weight: 700; }
.order-page .order-more__hint { color: var(--op-muted); font-size: 12px; }
.order-page .order-more__chev { margin-inline-start: auto; color: var(--text-3); transition: transform .15s ease; }
.order-page .order-more[open] > summary { border-bottom: 1px solid var(--op-line); }
.order-page .order-more[open] .order-more__chev { transform: rotate(180deg); }
.order-page .order-more__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px 18px 16px; }
.order-page .order-more__body.view-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.order-page .order-more__body > .card, .order-page .order-more__body > .form-section { margin: 0; box-shadow: none; }
.order-page .op-sub { border: 1px solid var(--op-line); border-radius: 8px; background: #fff; }
.order-page .op-sub[hidden] { display: none; }
.order-page .op-sub .form-section__head { background: #F8FAFC; }
.order-page .op-sub .form-section__title { font-size: 14px; }
/* Save / Cancel: in the page flow, not a floating bar. */
.order-page .order-form .form-actions {
  position: static; width: auto; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; backdrop-filter: none; box-shadow: none;
}
/* New order (entry-sea / entry-land): 4 numbered steps, Team line, info strip. */
.order-page--new .op-step > summary { cursor: default; pointer-events: none; }
.order-page--new .op-step .card__body, .order-page--new .op-step__body { padding: 16px 18px; }
.order-page--new .op-step__body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; align-items: start; }
.order-page--new .op-step__body > .op-part { min-width: 0; }
.order-page--new .op-step__body > .op-part[hidden] { display: none; }
.order-page--new .op-step__body .card__body { padding: 0; }
.order-page--new .op-step__body .form-grid { grid-template-columns: minmax(0, 1fr); }
.order-page--new .op-step .form-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.order-page--new .op-step .form-grid:has(> [data-main-land-details], > .load-fields) { grid-template-columns: minmax(0, 1fr); }
.order-page--new .op-step--load .form-grid:has(#f-air_weight_kg) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.order-page--new .op-step--load > .op-part + .op-part:not([hidden]) { border-top: 1px solid var(--op-line); }
.order-page--new .op-step::before { content: none !important; }  /* no "holds data" edge on the steps */
.order-page--new .op-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.order-page--new .op-choice { position: relative; display: inline-flex; cursor: pointer; }
.order-page--new .op-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.order-page--new .op-choice > span { padding: 9px 14px; border: 1px solid #C9D2DF; border-radius: 8px; background: #fff; color: var(--text); font-weight: 600; }
.order-page--new .op-choice .ar { margin-inline-start: 4px; color: var(--op-muted); font-size: 12px; font-weight: 500; }
.order-page--new .op-choice input:checked + span .ar { color: var(--navy); }
.order-page--new .op-choice input:checked + span { padding: 8px 13px; border: 2px solid var(--navy); background: #EEF2FA; color: var(--navy); }
.order-page--new .op-choice input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
.order-page--new .op-team { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 14px 18px; }
/* Team: one compact line "Sales [You] · Ops [Select…]" (design entry-sea), the selects sized to their content. */
.order-page--new .op-team__fields { display: flex; flex: 1 1 420px; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.order-page--new .op-team__fields > .field { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; }
.order-page--new .op-team__fields > .field .field__label { margin: 0; }
.order-page--new .op-team__fields select { width: auto; min-width: 140px; max-width: 100%; }
.order-page--new .op-team__fields .field__error { flex-basis: 100%; }
.order-page--new .op-team__sep { color: var(--op-muted); font-weight: 700; }
.order-page--new .op-new-note { margin: 0 0 14px; }
@media (max-width: 760px) {
  .order-page .op-layout, .order-page .op-layout:has(> .op-aside) { grid-template-columns: minmax(0, 1fr); }
  .order-page .op-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-page .op-grid, .order-page .op-ro-list, .order-page .order-more__body.view-main { grid-template-columns: minmax(0, 1fr); }
  .order-page .op-panel__foot { align-items: flex-start; flex-direction: column; }
  .order-page .op-foot__edit { margin-inline-start: 0; }
  .order-page .op-close { height: 44px; }
  .order-page .op-box .port-line, .order-page .op-box .port-other { grid-template-columns: minmax(0, 1fr); }
  .order-page .op-box .port-other { grid-template-columns: minmax(0, 1fr) auto; }
  .order-page .op-box .port-other .port-other__desc { grid-column: 1; }
  .order-page .op-table thead { display: none; }
  .order-page .op-table, .order-page .op-table tbody, .order-page .op-table tr, .order-page .op-table td { display: block; width: 100%; }
  .order-page .op-table tr { padding: 8px 12px; border-bottom: 1px solid var(--op-line); }
  .order-page .op-table td { padding: 2px 0; border: 0; }
  .order-page .op-table td:first-child { color: var(--op-muted); font-size: 12px; }
  .order-page--new .op-step__body, .order-page--new .op-step--load .form-grid:has(#f-air_weight_kg) { grid-template-columns: minmax(0, 1fr); }
}
/* Port stage on a phone (design sea-v3-03a mobile / v6.4 C1, Design P3-5): Itemised / Lump sum stays one
   segmented row (a long label wraps inside its own segment, never onto a row of its own), and the port charges
   are one column of tick boxes. */
@media (max-width: 640px) {
  .order-page .op-seg { display: flex; flex-wrap: nowrap; justify-self: stretch; }
  .order-page .op-seg__opt { flex: 1 1 0; min-width: 0; }
  .order-page .op-seg__opt span { width: 100%; padding: 9px 12px; line-height: 1.3; }
  .order-page .op-checks__grid { grid-template-columns: minmax(0, 1fr); }
}

/* Leg rows inside Land transport / Customs: title + provider + optional description. */
.leg-rows:empty { display: none; }
.assignment-row--leg { grid-template-columns: minmax(140px, 0.7fr) minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
.leg-row__title { margin: 0; padding-bottom: 10px; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--navy-900); }
.leg-row__title .ar { font-weight: 600; }
.leg-row__hint { grid-column: 2 / -1; margin: 0; }
.leg-rows > .assignment-row--leg:last-of-type { border-bottom: 0; }
.assignment-row--other { position: relative; align-items: end; }
.form-section__head [data-main-component-badge] { justify-self: start; }
@media (max-width: 760px) {
  .assignment-row--leg { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .leg-row__title { padding: 4px 0 0; }
  .leg-row__hint { grid-column: 1; }
  .assignment-row--other > .field:first-child { padding-inline-end: 44px; }
  .assignment-row--other > .repeat-remove { position: absolute; top: 10px; inset-inline-end: 0; }
}

/* Customs: two fixed rows, Port customs and Border customs (Sardar 3/10). */
.customs-rows > .customs-row:last-of-type { border-bottom: 0; }
/* Customs order: the port picker and the border fees under their customs row. */
.customs-rows > .clearance-half, .port-picker__mode { border: 0; margin: 0; padding: 0; min-width: 0; }
.customs-rows > .clearance-half > .port-picker { padding-block: 4px 16px; border-bottom: 1px solid var(--navy-100); }
.customs-rows > .clearance-half:last-child > .port-picker { padding-bottom: 0; border-bottom: 0; }

/* Port Services picker: one provider, tappable service chips, one optional
   description per ticked service. */
.port-picker { display: grid; gap: 14px; }
.port-picker__provider { max-width: 420px; }
/* Port of Discharge + cost mode, then the charges (hidden for Via clearance agent). */
.port-picker__pod { display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); gap: 14px; }
.port-picker__itemized { display: grid; gap: 14px; }
.port-picker__itemized[hidden], .port-picker__lump[hidden], .port-picker__pod-provider[hidden], .port-picker__provider[hidden] { display: none; }
.port-picker__lump, .port-picker__pod-provider { margin: 0; }
.port-others { display: grid; gap: 8px; }
.port-others__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.port-other { display: grid; grid-template-columns: minmax(140px, 0.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.port-other .field { margin: 0; }
.port-others__add { justify-self: start; }
.svc-pod { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin-bottom: 14px; }
.svc-pod__k { font-size: var(--fs-sm); color: var(--text-3); }
.svc-pod__v { font-weight: 600; color: var(--text); }
@media (max-width: 640px) { .svc-pod { grid-template-columns: minmax(0, 1fr); } }
.port-picker__types { border: 0; margin: 0; padding: 0; min-width: 0; }
.port-picker__types > legend { padding: 0; margin-bottom: 8px; }
.port-picker__tip { display: block; font-weight: 400; font-size: 12px; color: var(--text-4); }
.port-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.port-chip { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.port-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.port-chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.port-chip span::before { content: ""; width: 14px; height: 14px; border: 1.5px solid var(--border-strong); border-radius: 4px; background: var(--surface); flex: none; }
.port-chip input:checked + span { border-color: var(--navy); background: var(--navy-50); color: var(--navy-900); }
.port-chip input:checked + span::before { border-color: var(--navy); background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.4'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 11px no-repeat; }
.port-chip input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
.port-picker__types:disabled .port-chip { cursor: default; opacity: .7; }
.port-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.port-lines:not(:has(> li:not([hidden]))) { display: none; }
.port-line { display: grid; grid-template-columns: minmax(140px, 0.4fr) minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.port-line[hidden] { display: none; }
.port-line:last-of-type { border-bottom: 0; }
.port-line__name { font-size: 13px; font-weight: 700; color: var(--navy-900); letter-spacing: .02em; }
.port-line__desc { margin: 0; }
.port-picker__empty { margin: 0; font-size: 13px; color: var(--text-4); }
.port-picker__extras { display: grid; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.port-picker__extras > .field__hint { margin: 0; }
@media (max-width: 640px) {
  .port-picker__provider { max-width: none; }
  .port-picker__pod { grid-template-columns: minmax(0, 1fr); }
  .port-line { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .port-other { grid-template-columns: minmax(0, 1fr) auto; }
  .port-other__desc { grid-column: 1 / -1; }
}

/* Sidebar labels (2026-10-14, audit F4): in the expanded sidebar every item has the same two lines, the English
   over the Arabic, beside its icon, and every row is 52px (Active / Completed orders wrapped their Arabic to a 66px
   row while the others stayed on one 52px line). A Turkish page hides the Arabic: the label is centred on one line.
   A label too long for the column wraps between words. The compact rail keeps its centred icons. */
@media (min-width: 1280px) {
  body:not(.sidebar-compact) .main-nav .nav-link {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-content: center; column-gap: 10px; row-gap: 0;
    height: auto; min-height: 52px; padding-block: 6px; white-space: normal;
  }
  body:not(.sidebar-compact) .main-nav .nav-link::before { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  body:not(.sidebar-compact) .main-nav .nav-link .en, body:not(.sidebar-compact) .main-nav .nav-link .ar {
    grid-column: 2; justify-self: start; min-width: 0; max-width: 100%; margin: 0; overflow-wrap: break-word;
  }
  body:not(.sidebar-compact) .main-nav .nav-link .en { grid-row: 1; line-height: 1.25; }
  body:not(.sidebar-compact) .main-nav .nav-link .ar { grid-row: 2; font-size: 12px; line-height: 1.35; }
  body:not(.sidebar-compact) .main-nav .nav-link .count { grid-column: 3; grid-row: 1 / span 2; align-self: center; margin: 0; }
}
/* 1101-1279 top bar: with three nav items the Arabic sits under the English so the
   items fit beside New order (icon to the start, spanning both lines). */
@media (min-width: 1101px) and (max-width: 1279.98px) {
  .main-nav .nav-link {
    position: relative; display: grid; grid-template-columns: auto auto; align-content: center; justify-content: start;
    column-gap: 8px; row-gap: 0;
  }
  .main-nav .nav-link::before { grid-row: 1 / span 2; align-self: center; }
  .main-nav .nav-link .en, .main-nav .nav-link .ar {
    grid-column: 2; justify-self: start; margin: 0; white-space: nowrap; line-height: 1.2;
  }
  .main-nav .nav-link .ar { font-size: 12px; }
  /* Unread count (Notifications): a corner badge on the bell, so the link keeps its width
     and height (no third row, no overlap with New order). */
  .main-nav .nav-link .count { position: absolute; top: 2px; inset-inline-start: 20px; margin: 0; }
}

/* Active orders table (2026-10-03): the NG entry date and the ETA date keep one line inside
   their own column (they ran into Customer / Owners at 1280). The width comes from Customer,
   Transport, Commodity and Owners, whose text already wraps. */
@media (min-width: 901px) {
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(1) { width: 8.5%; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(2) { width: 11%; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(3) { width: 15.5%; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(5) { width: 10%; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(6) { width: 10%; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(8) { width: 10%; }
  .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(9) { width: 11%; }
  /* Long stages (Customs clearance, Arrived at airport) no longer overflow into Service:
     the Arabic moves under the English when the pill does not fit. */
  .data.data--orders:not(.data--archive) td.col-status { white-space: normal; }
  .data.data--orders:not(.data--archive) td.col-status .badge { flex-wrap: wrap; max-width: 100%; height: auto; row-gap: 0; }
  .data.data--orders:not(.data--archive) td.col-status .badge > .en,
  .data.data--orders:not(.data--archive) td.col-status .badge > .ar { white-space: nowrap; }
}
@media (min-width: 1280px) and (max-width: 1439.98px) {
  .data.data--orders tbody td, .data.data--orders thead th { padding-inline: 6px; }
  .data.data--orders tbody td:first-child, .data.data--orders thead th:first-child { padding-inline-start: 12px; }
}

/* =====================================================================
   Home dashboard v2 (2026-10-03): KPI cards, stage board tiles, then two columns
   (Needs action | Arrivals + Workload by owner), Workload fits its column. Scoped to .page--home so the
   other pages keep their rules. Cards share the site card look (8px radius,
   --shadow-card, 1px --border); numbers stay on the 24px token.
   ===================================================================== */
.page--home { --dash-gap: 16px; }
.page--home .dash-section { margin: 0 0 var(--dash-gap); }

/* 1. KPI cards */
.page--home .kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi-card {
  --kpi-tone: var(--navy); --kpi-text: var(--navy-900);
  position: relative; display: flex; align-items: stretch; gap: 14px; min-width: 0; min-height: 108px;
  padding: 18px 18px 16px; border: 1px solid var(--border); border-top: 3px solid var(--kpi-tone);
  border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card);
  transition: border-color .15s, box-shadow .15s;
}
.kpi-card:hover { border-color: var(--navy-200); border-top-color: var(--kpi-tone); box-shadow: var(--shadow-2); }
.kpi-card:focus-within { outline: 2px solid var(--ring, var(--navy-900)); outline-offset: 2px; }
.kpi-card__icon {
  display: grid; flex: 0 0 40px; align-self: flex-start; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: var(--navy-50); background: color-mix(in srgb, var(--kpi-tone) 12%, #fff); color: var(--kpi-tone);
}
.kpi-card__icon .icon { width: 20px; height: 20px; }
.page--home .kpi-card .dash-kpi {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; padding: 0;
  border: 0; background: none; box-shadow: none; color: var(--text-2); font-size: var(--fs-md); font-weight: 600; line-height: 1.3;
}
.page--home .kpi-card .dash-kpi:hover { background: none; text-decoration: none; }
.page--home .kpi-card .dash-kpi:focus-visible { outline: none; }
.page--home .kpi-card .dash-kpi::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }  /* whole card opens the list */
.page--home .kpi-card .dash-kpi b { color: var(--kpi-text); font-size: var(--fs-2xl); font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.page--home .kpi-card .dash-kpi .ar { display: block; margin: 2px 0 0; color: var(--text-4); font-size: 13px; font-weight: 500; }
.kpi-card--attention { --kpi-tone: var(--orange); --kpi-text: var(--orange-text); }
.kpi-card--arrivals { --kpi-tone: var(--navy); --kpi-text: var(--navy-900); }
.kpi-card--archive { --kpi-tone: #667085; --kpi-text: var(--text); }
.kpi-card.is-zero { --kpi-text: var(--text-3); }
.kpi-card--attention.is-zero { --kpi-tone: var(--border-strong); }
.kpi-card--attention:not(.is-zero) { background: var(--orange-50); border-color: #FBD19B; border-top-color: var(--orange); }
.page--home .dash-kpi__sub {
  position: relative; z-index: 1; display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px;
  margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border-soft);
  color: var(--text-3); font-size: var(--fs-xs); font-weight: 600;
}
.page--home .dash-kpi__sub b { color: var(--text); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.page--home .dash-kpi__sub.is-zero b { color: var(--text-4); font-weight: 600; }
.page--home .dash-kpi__sub .ar { color: var(--text-4); font-size: var(--fs-xs); font-weight: 500; }
.page--home .dash-kpi__sub:hover { color: var(--navy); }
/* Equal-height cards: "Completed today" is the In archive card's footer. */
.kpi-card__body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 12px; min-width: 0; }
.page--home .kpi-card__body > .dash-kpi__sub { align-self: stretch; }

/* 2. Stage board: white card, one tile per stage in its stage colour */
.page--home .stage-card { padding: 20px; }
.page--home .stage-board { display: grid; gap: 20px; }
.page--home .stage-group + .stage-group { padding-top: 20px; border-top: 1px solid var(--border-soft); }
.page--home .stage-group__title {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0 0 12px;
  color: var(--navy-900); font-size: var(--fs-md); font-weight: 700; letter-spacing: 0; text-transform: none;
}
.page--home .stage-group__title .ar { margin: 0; color: var(--text-4); font-size: 13px; font-weight: 500; }
.page--home .stage-board__empty { color: var(--text-3); }
.page--home .stage-board__empty .ar { color: var(--text-4); }
.page--home .pipeline {
  /* Wraps longer paths (six-stage Door services, an extra Other tile) instead of squeezing labels. */
  display: grid; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); grid-auto-flow: row;
  gap: 12px; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; overflow: visible;
}
.page--home .pipeline .stage {
  position: relative; display: flex; flex-direction: column; justify-content: flex-start; gap: 12px;
  grid-column: auto; min-width: 0; padding: 14px 14px 12px;
  border: 1px solid var(--border); border-top: 3px solid var(--tone); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: none; color: var(--text);
}
.page--home .pipeline .stage::before, .page--home .pipeline .stage::after { content: none; display: none; }
.page--home .pipeline .stage:hover { border-color: var(--navy-200); border-top-color: var(--tone); background: var(--surface-2); }
.page--home .pipeline .stage:focus-within { outline: 2px solid var(--ring, var(--navy-900)); outline-offset: 2px; }
.page--home .stage__name { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; }
.page--home .stage__step { flex: 0 0 8px; width: 8px; height: 8px; margin-top: 4px; border: 0; border-radius: 50%; background: var(--tone); box-shadow: none; }
.page--home .stage__label { color: var(--text-2); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; line-height: 1.35; text-transform: uppercase; overflow-wrap: normal; word-break: normal; }
.page--home .stage__label .ar { display: block; margin: 2px 0 0; color: var(--text-4); font-size: var(--fs-sm); font-weight: 500; letter-spacing: normal; text-transform: none; }
.page--home .stage__figure { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; }  /* count + bar line up across a row */
.page--home .pipeline .stage .stage__count { min-width: 0; min-height: 0; color: var(--tone-text, var(--tone)); }
.page--home .pipeline .stage .stage__count::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }  /* whole tile opens the list */
.page--home .pipeline .stage .stage__count:focus-visible { outline: none; }
.page--home .pipeline .stage .stage__count.is-zero { color: var(--text-4); font-weight: 600; }
/* Empty stages step back in solid greys (--text-3 / --text-4 keep >= 4.5:1 on white and the hover surface),
   never by fading the whole tile. (No progress bar: a tile shows its number only.) */
.page--home .pipeline .stage.is-zero .stage__label { color: var(--text-3); }
/* Stage colours: the same edge colours as the rows on Active orders; clearance gets navy. */
.page--home .stage--waiting, .page--home .stage--neutral { --tone: #98A2B3; --tone-text: #475467; }
.page--home .stage--confirmed { --tone: #3E6FD1; --tone-text: #3560C0; }
.page--home .stage--sea { --tone: #0E8C7E; --tone-text: #0B6F64; }
.page--home .stage--port { --tone: #5146C8; --tone-text: #5146C8; }
.page--home .stage--clearance { --tone: var(--navy); --tone-text: var(--navy); }
.page--home .stage--land { --tone: #9A4A00; --tone-text: #9A4A00; }
.page--home .stage--completed { --tone: var(--success); --tone-text: var(--success); }

/* 3. The stage board (left) | the side column: Needs action, Arrivals, Workload by owner
   (right, dashboard final); one column below 1200px, in that order. */
.page--home .dash-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--dash-gap); align-items: start; margin: 0; }
.page--home .dash-side { display: flex; flex-direction: column; gap: var(--dash-gap); min-width: 0; }
.page--home :is(.dash-split, .dash-side) > .card { display: flex; flex-direction: column; min-width: 0; margin: 0; }
.page--home .dash-split .dash-empty { margin: 16px; }
.page--home .dash-split .buckets { grid-template-columns: minmax(0, 1fr); }  /* one bucket per row: company names stay readable */
.page--home .dash-split .bucket + .bucket { border-inline-start: 0; border-top: 1px solid var(--border-soft); }
.page--home .dash-arrivals .days { padding: 16px 16px 8px; gap: 8px; }
.page--home .dash-arrivals .card__note { margin: 0; padding: 0 16px 14px; }
/* Days with arrivals: light navy fill, navy number. Today: orange border; filled only when it has arrivals. */
.page--home .day { background: var(--surface); }
.page--home .day--today { border-color: var(--orange); background: var(--surface); }
.page--home .day--has { border-color: #D5DEF0; background: #EEF2FA; }
.page--home .day--today.day--has { border-color: var(--orange); }
.page--home .day--has .day__count { color: var(--navy); }
.page--home .day--has .day__name { color: var(--text-2); }
@media (min-width: 1024px) {
  .page--home .dash-arrivals .days { gap: 6px; padding-inline: 14px; }
}
@media (min-width: 1200px) {
  .page--home .dash-split { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
}

/* 4. Workload by owner: a Sales and an Operations list of flat rows (a divider between rows). The counts follow
   the name as one group; on phones they wrap under it and the links keep a 44px tap height. The Needs action
   pill always gets its own line under the counts. */
.page--home .dash-owners { margin: 0; }
.page--home .dash-owners > .page-header__eyebrow { margin: 0; padding: 14px 16px 2px; }
.page--home .owner-list { margin: 0 0 6px; padding: 0 16px; list-style: none; }
.page--home .owner-list > li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 0; color: var(--text-3); font-size: var(--fs-sm); }
.page--home .owner-list > li + li { border-top: 1px solid var(--border-soft); }
.page--home .owner-list__name, .page--home .owner-list__unmatched { color: var(--text); font-size: var(--fs-md); font-weight: 600; overflow-wrap: anywhere; }
.page--home .owner-list__counts { display: flex; flex-wrap: wrap; align-items: center; gap: inherit; }
.page--home .owner-list__needs { flex-basis: 100%; }
.page--home .owner-list a .unit-count b { color: inherit; }
@media (max-width: 760px) {
  .page--home .owner-list > li { row-gap: 0; padding-bottom: 0; }
  .page--home .owner-list__name, .page--home .owner-list__unmatched { flex-basis: 100%; }
  .page--home .owner-list a { display: inline-flex; align-items: center; min-height: 44px; }
}

@media (max-width: 1100px) {
  .page--home .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .page--home { --dash-gap: 16px; }
  .page--home .kpi-grid { gap: 12px; }
  .kpi-card { flex-direction: column; gap: 10px; min-height: 0; padding: 14px; }
  .kpi-card__icon { flex-basis: 32px; width: 32px; height: 32px; border-radius: 8px; }
  .kpi-card__icon .icon { width: 18px; height: 18px; }
  .kpi-card__body { gap: 10px; }
  .page--home .stage-card { padding: 14px; }
  .page--home .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .page--home .pipeline .stage { padding: 12px; }
}
@media (max-width: 600px) {
  /* Header: the date pill sits beside the title instead of on a row of its own. */
  .page--home .page-header--dash { flex-wrap: nowrap; align-items: flex-start; gap: 12px; }
  .page--home .page-header--dash .page-header__main { flex: 1 1 auto; min-width: 0; }
  .page--home .page-header--dash .page-actions { flex: 0 0 auto; }
  .page--home .page-actions > .result-count.dash-date { height: 28px; padding: 0 10px; }
  .page--home .page-actions > .result-count.dash-date b { font-size: 13px; }

  /* Stages: compact rows (label left, count right, a 3px bar under), coloured start edge. */
  .page--home .pipeline { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .page--home .pipeline .stage {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px 12px;
    min-height: 44px; padding: 6px 12px; border-top-width: 1px; border-top-color: var(--border); border-inline-start: 3px solid var(--tone);
  }
  .page--home .pipeline .stage:hover { border-top-color: var(--navy-200); }
  .page--home .stage__step { display: none; }
  .page--home .stage__label .ar { display: inline; margin: 0 0 0 6px; font-size: 13px; }
  .page--home .stage__figure { margin: 0; }
  .page--home .pipeline .stage .stage__count { min-height: 0; }
}

/* =====================================================================
   Active orders v2 (2026-10-03): one compact filter bar with quick chips,
   calmer table (Transport over BL, Vendors as a count), stage-coloured badges
   (the dashboard tile colours), aligned View / Edit, shorter phone cards.
   Scoped to .page--orders: the Archive table keeps its rules.
   ===================================================================== */
/* 1. One filter bar: fields + Apply, then My orders, the service chips and active filters. */
.page--orders .orders-bar { border-bottom: 1px solid var(--navy-100); background: var(--navy-50); }
.page--orders .orders-bar > .toolbar { padding: 12px 16px 10px; border-bottom: 0; background: transparent; }
.page--orders .orders-bar > .toolbar__row { justify-content: flex-start; padding: 0 16px 12px; border-bottom: 0; background: transparent; }
.page--orders .orders-bar .pills { gap: 6px 8px; }
.page--orders .orders-bar .chip { min-height: 32px; }
.page--orders .chip-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-inline-start: 10px; border-inline-start: 1px solid var(--navy-100); }
.page--orders .orders-bar .pills__clear { margin-inline-start: 4px; }

/* 3. Stage badges in the dashboard tile colours (tone tint, darker text, solid step). */
.page--orders .data--orders .badge { --tone: #98A2B3; --tone-text: #475467; --tone-bg: #F2F4F7; --tone-bd: #D9DEE6; --step-text: #fff;
  background: var(--tone-bg); border-color: var(--tone-bd); color: var(--tone-text); }
.page--orders .data--orders .badge .badge__step { background: var(--tone); color: var(--step-text); }
.page--orders .data--orders .badge--waiting { --step-text: var(--navy-900); }
.page--orders .data--orders .badge--confirmed { --tone: #3E6FD1; --tone-text: #3560C0; --tone-bg: #EEF3FC; --tone-bd: #C9D8F4; }
.page--orders .data--orders .badge--sea { --tone: #0B6F64; --tone-text: #0B6F64; --tone-bg: #E8F5F3; --tone-bd: #B9E0DA; }
.page--orders .data--orders .badge--port { --tone: #5146C8; --tone-text: #5146C8; --tone-bg: #EFEEFB; --tone-bd: #D3D0F3; }
.page--orders .data--orders .stage-tone--clearance .badge { --tone: var(--navy); --tone-text: var(--navy); --tone-bg: var(--navy-50); --tone-bd: var(--navy-100); }
.page--orders .data--orders .badge--land { --tone: #9A4A00; --tone-text: #9A4A00; --tone-bg: #FDF3EA; --tone-bd: #F3D3B5; }
.page--orders .data--orders .badge--completed { --tone: var(--success); --tone-text: var(--success); --tone-bg: var(--success-bg); --tone-bd: var(--success-bd); }
.page--orders .data--orders .badge .ar { color: inherit; opacity: 1; }
/* The row edge follows the badge (clearance navy, as on the dashboard). */
.page--orders .data.data--orders tbody tr:has(> td.col-status .stage-tone--clearance) { --edge: var(--navy); }
.page--orders .data.data--orders tbody tr.row--warn:has(> td.col-status) { --edge: var(--orange); }
.page--orders .data.data--orders tbody tr.row--overdue:has(> td.col-status) { --edge: var(--danger); }

/* 2. Columns: Transport (unit on top, BL under), Vendors as an "N providers" toggle. */
.page--orders .data--orders .transport, .page--orders .data--cards.data--orders .transport { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.page--orders .data--orders .transport__equip > .transport__bl { flex-basis: 100%; }  /* BL under its unit in every markup branch */
.page--orders .vendor-summary > summary {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none;
  color: var(--navy); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
}
.page--orders .vendor-summary > summary::-webkit-details-marker { display: none; }
.page--orders .vendor-summary > summary::after { content: ""; width: 6px; height: 6px; margin-inline-start: 2px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.page--orders .vendor-summary[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.page--orders .vendor-summary__n { font-weight: 700; font-variant-numeric: tabular-nums; }
.page--orders .vendor-summary > .vendors { display: grid; gap: 2px; margin-top: 6px; }
.page--orders .data--orders td.col-vendors { position: relative; z-index: 1; }  /* the toggle sits above the row link */

/* Shipping agency N/A: one grey pill; the bilingual label is its tooltip. */
.page--orders .pill-muted { display: inline-block; white-space: nowrap; font-size: 12px; line-height: 16px; padding: 2px 8px; border-radius: 999px; background: #F1F5F9; color: #475569; }
/* Service is the 12px subtitle under the stage badge ("Sea · Port to Door"), so its own column and card cell go. */
.page--orders .data.data--orders th.col-service, .page--orders .data.data--orders td.col-service { display: none; }
.page--orders .data--orders td.col-status .status-svc { color: var(--text-3); font-size: 12px; line-height: 16px; }

/* 4. View / Edit: two equal slots on every row; View always in the first, so rows without Edit stay aligned. */
.page--orders .data.data--orders td.actions .row-actions--order { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.page--orders .data.data--orders td.actions .btn--sm { width: 100%; justify-content: center; }
@media (min-width: 901px) {
  /* Desktop: 56 x 32 buttons at the cell's end; a row without Edit keeps View at the end, so the buttons line up. */
  .page--orders .data.data--orders td.actions { padding-inline: 8px; text-align: end; }
  .page--orders .data.data--orders td.actions .row-actions--order { grid-template-columns: repeat(2, auto); gap: 6px; justify-content: end; }
  .page--orders .data.data--orders td.actions .row-actions--order > .btn:only-child { grid-column: 2; }
  .page--orders .data.data--orders td.actions .btn--sm { min-width: 56px; height: 32px; padding-inline: 8px; }
}

@media (min-width: 901px) {
  /* Column widths (fixed layout). Short fixed-content columns get their measured width (NG chip, badge, ETA date,
     View + Edit); names share the rest. Vendors is back at every width now that it is a count. */
  /* Service rides under the stage badge, so Customer and Transport share what the fixed columns leave. */
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(1) { width: 82px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(3) { width: 120px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(6) { width: 140px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(7) { width: 96px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(8) { width: 96px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(10) { width: 136px; }
  .page--orders .data.data--orders th.col-vendors, .page--orders .data.data--orders td.col-vendors { display: table-cell; }
  .page--orders .data.data--orders td.col-vendors .vendors span { overflow-wrap: anywhere; }
  .page--orders .data.data--orders td.actions { width: 1%; white-space: nowrap; }
  /* Names wrap between words only (no "MOHAM-MED"); BL numbers may still break when a column is narrow. */
  .page--orders .data.data--orders td.col-company,
  .page--orders .data.data--orders td.col-commodity { overflow-wrap: break-word; word-break: normal; }
  .page--orders .data.data--orders td.col-commodity { font-size: 12px; line-height: 16px; }
  /* Customer 13px/600; the commodity at normal weight. Two lines at most, full text in the title. */
  .page--orders .data.data--orders td.col-company .cell-main { font-size: 13px; font-weight: 600; line-height: 17px; text-transform: none; }
  .page--orders .data.data--orders td.col-company .cell-main, .page--orders .data.data--orders td.col-commodity .cell-main {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: none;
  }
  .page--orders .data.data--orders td.col-commodity .cell-main { color: var(--text-2); font-weight: 400; }
  /* P2-5 (PR105 fix pass 2, 17/10): the service line wraps, never cut with "…". */
  .page--orders .data.data--orders td.col-status .status-svc { margin-top: 4px; white-space: normal; overflow-wrap: anywhere; }
  /* Owners: role key and name in two aligned columns, one line each. */
  .page--orders .data.data--orders .owners { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 6px; row-gap: 2px; min-width: 0; max-width: none; overflow: hidden; white-space: nowrap; }
  .page--orders .data.data--orders .owners > span { display: contents; font-size: 13px; }
  .page--orders .data.data--orders .owners .k { min-width: 0; color: var(--text-4); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
  /* Stage badge: step number, then the English label over the Arabic (as the column headers). */
  .page--orders .data.data--orders td.col-status .badge {
    display: inline-grid; grid-template-columns: auto auto; grid-template-rows: auto auto; align-items: center;
    column-gap: 6px; row-gap: 0; max-width: 100%; padding: 4px 10px 4px 5px; border-radius: 10px; line-height: 16px; white-space: nowrap;
  }
  .page--orders .data.data--orders td.col-status .badge > .badge__step, .page--orders .data.data--orders td.col-status .badge > .badge__dot { grid-row: 1 / span 2; }
  .page--orders .data.data--orders td.col-status .badge > .en { font-weight: 700; }
  .page--orders .data.data--orders td.col-status .badge > .ar { justify-self: left; margin: 0; font-size: 12px; line-height: 15px; }
  .page--orders .data.data--orders .transport__bl { font-size: var(--fs-xs); letter-spacing: 0; word-break: break-all; }  /* "BL" stays on the number's first line */
  .page--orders .data.data--orders td.col-ng, .page--orders .data.data--orders td.col-status { padding-inline-end: 4px; }
}
@media (min-width: 901px) and (max-width: 1099.98px) {
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th, .page--orders .data.data--orders:not(.data--archive) > tbody > tr > td { padding-inline: 6px; }
}

@media (min-width: 1180px) {
  /* Owners column visible (hide-lg ends at 1180px): the names share what is left. */
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(9) { width: 150px; }
}
@media (min-width: 1280px) and (max-width: 1439.98px) {
  /* Sidebar shown and the table at 990-1150px: a little off the fixed columns so Customer and Transport stay readable. */
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(7) { width: 92px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(8) { width: 92px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(9) { width: 140px; }
}

/* 5. Phones: a shorter card (stage + service on the NG line, two facts per row, owners on one line). */
@media (max-width: 599.98px) {
  /* Search, then the quick chips (links: they apply at once); Apply shows only with More filters open. */
  .page--orders .orders-bar { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
  .page--orders .orders-bar > .toolbar { display: contents; }
  .page--orders .orders-bar > .toolbar > .toolbar__search { order: 1; }
  .page--orders .orders-bar > .toolbar__row { order: 2; flex-direction: row; align-items: center; padding: 0; }
  .page--orders .orders-bar > .toolbar > .toolbar__more { order: 3; flex: 0 0 auto; }
  .page--orders .orders-bar > .toolbar > .toolbar__more[open] > .toolbar__more-toggle { margin-bottom: 0; }
  .page--orders .orders-bar > .toolbar > .toolbar__more[open] .toolbar__more-body { padding-top: 10px; }
  .page--orders .orders-bar > .toolbar > .toolbar__actions { order: 4; flex: 0 0 auto; }
  .page--orders .orders-bar > .toolbar > .toolbar__more:not([open]) ~ .toolbar__actions { display: none; }
  .page--orders .data--cards.data--orders tbody td.col-status { text-align: end; }
  .page--orders .data--cards.data--orders td.col-status .status-svc { margin-top: 3px; }
  .page--orders .chip-group { padding-inline-start: 0; border-inline-start: 0; }
  .page--orders .data--cards.data--orders tbody tr { gap: 10px 14px; padding: 12px 14px; }
  .page--orders .data--cards.data--orders tbody td.col-company { padding-bottom: 10px; }
  .page--orders .data--cards.data--orders td.col-company .cell-main { font-size: 15px; }
  .page--orders .data--cards.data--orders tbody td[data-label]::before { margin-bottom: 2px; font-size: var(--fs-xs); letter-spacing: .04em; }
  .page--orders .data--cards.data--orders td[data-label="ETA"] .eta__date { font-size: 15px; }
  .page--orders .data--cards.data--orders tbody td.col-vendors { order: 7; grid-column: auto; }
  .page--orders .data--cards.data--orders tbody td.col-owners { order: 8; grid-column: 1 / -1; }
  /* Owners on one line: "SALES IHAB · OPS ENVER". */
  .page--orders .data--cards.data--orders .owners { display: flex; flex-wrap: wrap; gap: 0; }
  .page--orders .data--cards.data--orders .owners > span { display: inline; white-space: nowrap; }
  .page--orders .data--cards.data--orders .owners > span + span::before { content: "·"; margin-inline: 6px; color: var(--text-4); }
  .page--orders .data--cards.data--orders .owners .k { margin-inline-end: 4px; }
  .page--orders .chip-group { display: contents; }
  .page--orders .data--cards.data--orders td.col-vendors .vendors span { overflow-wrap: anywhere; }
  .page--orders .data--cards.data--orders tbody td.actions { padding-top: 10px; }
  .page--orders .data--cards.data--orders tbody td.actions .btn { height: var(--ctl-md); min-height: var(--ctl-md); }
  .page--orders .orders-bar .chip { min-height: 32px; padding-inline: 10px; font-size: 13px; }
}

/* =====================================================================
   Settings tidy (2026-10-03): visual only, scoped to .page--settings
   (Users, Companies, Vendors, Activity log). Texts, fields and actions stay
   as they are: one filter-bar look, tables that fit 901-1600px without a
   sideways scroll, aligned row buttons, shorter phone cards.
   ===================================================================== */
/* 1. Filter bars: the navy-50 bar of Active orders; the Companies search keeps its button on the input's line. */
.page--settings .table-card > .card__header { background: var(--navy-50); border-bottom-color: var(--navy-100); }
.page--settings .table-card > .toolbar__row { background: var(--navy-50); border-bottom-color: var(--navy-100); }
.page--settings .card__header > form.input-icon { display: flex; align-items: center; gap: 6px; }
.page--settings .card__header > form.input-icon > input[type] { flex: 1 1 auto; min-width: 0; }
.page--settings .card__header > form.input-icon > .btn { flex: none; }
.page--settings .card__header > form.input-icon > .icon { top: 50%; }
/* Vendors: the category chips wrap on wide screens (one sideways-scrolling row on phones, below). */
.page--settings .table-card[aria-labelledby="vendors-h"] > .toolbar__row > .chips { flex-wrap: wrap; overflow-x: visible; margin-inline: 0; padding-inline: 0; padding-bottom: 0; gap: 6px; }
/* 6. One outlined category pill for every category: the category's own colour on text and border,
   English then Arabic on one line. */
.page--settings .vcat { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid currentColor; background: transparent; font-size: 12px; font-weight: 600; line-height: 1; max-width: none; }
.page--settings .vcat .en { font-size: 12px; }
.page--settings .vcat .ar { font-size: 12px; font-weight: 500; opacity: .75; }

/* 2. Tables fit at 901-1600px: fixed columns for status, created and the buttons; names, emails and contacts
   wrap between words (a single over-long word still breaks, so nothing is hidden). */
@media (min-width: 901px) {
  .page--settings .table-card .data:is(#users-table, #companies-table, #vendors-table) { table-layout: fixed; width: 100%; }
  .page--settings .data:is(#users-table, #companies-table, #vendors-table) td.col-company .cell-main { overflow-wrap: break-word; word-break: normal; }
  .page--settings .data:is(#users-table, #companies-table, #vendors-table) td.col-company .cell-sub { overflow-wrap: break-word; word-break: normal; }
  .page--settings .data:is(#users-table, #companies-table, #vendors-table) td.actions { width: auto; white-space: nowrap; }
  .page--settings .data:is(#users-table, #companies-table, #vendors-table) > thead > tr > th,
  .page--settings .data:is(#users-table, #companies-table, #vendors-table) > thead > tr > th * { white-space: normal; }
  /* Users: User (rest) · Role 180 · Status 116 · Created 150 · buttons 136 (Edit •••). Role fits the longest
     badge (Finance supervisor) on one line clear of the Status, also in a fallback font (25/10; was 108, the
     badge ran into Active). */
  .page--settings #users-table > thead > tr > th:nth-child(2) { width: 180px; }
  .page--settings #users-table > thead > tr > th:nth-child(3) { width: 116px; }
  .page--settings #users-table > thead > tr > th:nth-child(4) { width: 150px; }
  .page--settings #users-table > thead > tr > th:nth-child(5) { width: 136px; }
  /* Companies: Company (rest) · Status 140 · Created 170 · buttons 136. */
  .page--settings #companies-table > thead > tr > th:nth-child(2) { width: 140px; }
  .page--settings #companies-table > thead > tr > th:nth-child(3) { width: 170px; }
  .page--settings #companies-table > thead > tr > th:nth-child(4) { width: 136px; }
  /* Vendors: Vendor (rest, at least 220px, two lines at most; the full name is in its tooltip) · Category (fits the
     longest one-line pill) · Location & contact (narrow, muted) · Status · Created · buttons 136. */
  .page--settings #vendors-table > :is(thead, tbody) > tr > :is(th, td):not(.actions) { padding-left: 8px; padding-right: 8px; }
  .page--settings #vendors-table > thead > tr > th:first-child,
  .page--settings #vendors-table > tbody > tr > td:first-child { padding-left: 14px; }
  .page--settings #vendors-table > thead > tr > th:nth-child(2) { width: 320px; }
  .page--settings #vendors-table > thead > tr > th:nth-child(3) { width: 84px; }
  .page--settings #vendors-table > thead > tr > th:nth-child(4) { width: 105px; }
  .page--settings #vendors-table > thead > tr > th:nth-child(5) { width: 124px; }
  .page--settings #vendors-table > thead > tr > th:nth-child(6) { width: 136px; }
  .page--settings #vendors-table td.col-company { min-width: 220px; }
  .page--settings #vendors-table td.col-company .cell-main { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .page--settings #vendors-table td.col-location { color: var(--text-3); font-size: var(--fs-xs); line-height: 14px; overflow-wrap: break-word; }
  .page--settings #vendors-table td.col-location * { font-size: var(--fs-xs); line-height: 14px; }
  .page--settings #vendors-table td.col-location .muted > :is(.en, .ar) { display: block; text-align: left; }
  .page--settings #vendors-table > thead > tr > th:nth-child(3) { padding-left: 4px; padding-right: 4px; letter-spacing: 0; }
  /* 4. Buttons: Edit then ••• at the cell's end on every row; a protected row keeps an empty slot the size of •••,
     so Edit and the right edge line up on all rows. */
  .page--settings .data:is(#users-table, #companies-table, #vendors-table) td.actions { padding-left: 4px; padding-right: 8px; }
  .page--settings .data td.actions .row-actions { justify-content: flex-end; flex-wrap: nowrap; gap: 6px; }
  .page--settings .data:is(#users-table, #companies-table, #vendors-table) td.actions .btn--secondary { padding-inline: 8px; }
  .page--settings .data:is(#users-table, #companies-table, #vendors-table) td.actions .row-menu > summary { width: 32px; min-width: 32px; padding-inline: 0; }
  .page--settings #users-table td.actions .row-menu-slot { width: 32px; }
  /* Activity: emails and action pills stay on one line; the page scrolls (no inner scroll box). */
  .page--settings .table-card.table-card--activity .table-scroll--tall { max-height: none; }
  .page--settings .table-card.table-card--activity .data { table-layout: fixed; width: 100%; }
  .page--settings .table-card.table-card--activity .data > thead > tr > th:nth-child(1) { width: 150px; }
  .page--settings .table-card.table-card--activity .data > thead > tr > th:nth-child(2) { width: 136px; }
  .page--settings .table-card.table-card--activity .data > thead > tr > th:nth-child(3) { width: 96px; }
  .page--settings .table-card.table-card--activity .data > thead > tr > th:nth-child(4) { width: 22%; }
  .page--settings .table-card.table-card--activity .action-pill { white-space: nowrap; }
  .page--settings .table-card.table-card--activity td.col-user .clamp { display: block; -webkit-line-clamp: unset; overflow: visible; max-width: none; overflow-wrap: break-word; word-break: normal; }
}

/* 4. Users: the Protected badge sits with the name (like Owner) as a small lock badge. */
.page--settings #users-table td.col-company .badge--protected { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; font-size: 12px; line-height: 1; vertical-align: middle; white-space: nowrap; }
.page--settings #users-table td.col-company .badge--protected .icon { width: 12px; height: 12px; flex: none; }
.page--settings #users-table td.col-company .badge--protected .en,
.page--settings #users-table td.col-company .badge--protected .ar { font-size: 12px; }

/* 3. Companies: Add company is a closed disclosure row (as on Users and Vendors) above the list. Opened, the form
   stacks full width above the list below 1440px and sits beside it from 1440px. */
.page--settings #add-company.company-card:not([open]) { max-width: none; }
@media (min-width: 1280px) and (max-width: 1439.98px) {
  .page--settings .stack:has(#companies-table) { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .page--settings .stack:has(#companies-table) > #add-company { grid-column: 1; grid-row: 1; position: static; max-height: none; overflow: visible; }
  .page--settings .stack:has(#companies-table) > .table-card { grid-column: 1; grid-row: 2; }
  .page--settings .stack:has(#companies-table) > #add-company .cf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page--settings .stack:has(#companies-table) > #add-company .cf-actions { position: static; }
}
@media (min-width: 901px) and (max-width: 1439.98px) {
  .page--settings #add-company.company-card { max-width: none; }
}
/* 3b. Vendors: Add vendor is the same card as Add company. The vendors list has no side column, so the closed row
   and, from 901px, the open form span the list's width (between 640px and 900px the open card keeps ≤ 720px). */
.page--settings #add-vendor.company-card:not([open]) { max-width: none; }
@media (min-width: 901px) {
  .page--settings #add-vendor.company-card { max-width: none; }
}
@media (min-width: 1440px) {
  .page--settings .stack:has(#companies-table) { grid-template-columns: minmax(0, 1fr) 400px; }
  .page--settings .stack:has(#companies-table):not(:has(> #add-company[open])) { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .page--settings .stack:has(#companies-table):not(:has(> #add-company[open])) > #add-company { grid-column: 1; grid-row: 1; position: static; max-height: none; overflow: visible; }
  .page--settings .stack:has(#companies-table):not(:has(> #add-company[open])) > .table-card { grid-column: 1; grid-row: 2; }
}

/* 5. Phones and tablets: shorter cards, status (and Protected) in the card header, one button row (Edit + •••). */
@media (max-width: 900px) {
  .page--settings :is(#users-table, #companies-table) tbody tr { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px; }
  .page--settings :is(#users-table, #companies-table) tbody td.col-company { grid-column: 1; grid-row: 1; order: 0; padding-bottom: 0; border-bottom: 0; font-size: var(--fs-md); min-width: 0; overflow-wrap: break-word; }
  .page--settings :is(#users-table, #companies-table) tbody td.col-state { grid-column: 2; grid-row: 1; order: 1; justify-self: end; align-self: start; }
  .page--settings :is(#users-table, #companies-table) tbody td.col-state::before { display: none; }
  .page--settings #users-table tbody td.col-role { grid-column: 1 / -1; grid-row: 2; order: 2; display: flex; align-items: center; gap: 8px; }
  .page--settings #users-table tbody td.col-role::before { display: inline; margin: 0; font-size: var(--fs-xs); }
  .page--settings :is(#users-table, #companies-table) tbody td.actions { grid-column: 1 / -1; order: 9; padding-top: 8px; }
  .page--settings :is(#users-table, #companies-table) tbody td.actions .row-actions { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
  .page--settings :is(#users-table, #companies-table) tbody td.actions .row-actions > .btn { width: 100%; }
  .page--settings #users-table tbody td.actions .btn--secondary { height: var(--ctl-md); min-height: var(--ctl-md); }
  .page--settings #users-table tbody td.actions .row-menu-slot { display: block; width: 44px; grid-column: 2; grid-row: 1; }
  .page--settings #users-table tbody tr:has(.badge--protected) { position: relative; }
  .page--settings #users-table tbody tr:has(.badge--protected) td.col-state { min-width: 112px; padding-bottom: 26px; text-align: right; }
  .page--settings #users-table tbody td.col-company .badge--protected { position: absolute; top: 38px; right: 14px; }
  /* Vendors: the compact list row also shows Edit beside •••, as on the other tabs (and the menu's own Edit hides). */
  .page--settings #vendors-table .row-actions .btn--secondary { display: inline-flex; }
  .page--settings #vendors-table .row-menu__edit { display: none; }
  .page--settings #vendors-table tbody tr[data-vendor-row] td.actions { margin-inline-end: 0; }
  .page--settings #vendors-table tbody tr[data-vendor-row] td.actions .row-actions { display: flex; align-items: center; gap: 6px; }
  .page--settings #vendors-table tbody tr[data-vendor-row] td.actions .btn--secondary { height: 36px; }
  .page--settings #vendors-table .vcat { white-space: nowrap; flex-wrap: nowrap; border-radius: 999px; }
  /* Activity: time · action · NG on one line (the NG chip names itself), then user, then details. */
  .page--settings .table-card.table-card--activity .data--cards tbody td[data-label="NG"]::before { display: none; }
  .page--settings .table-card.table-card--activity .data--cards tbody td.col-user { overflow-wrap: break-word; word-break: normal; }
  .page--settings .table-card.table-card--activity .action-pill { white-space: nowrap; }
}
/* Vendors on phones: the category chips are one sideways-scrolling row, English and Arabic on one line,
   so the first vendor shows in the first screen. */
@media (max-width: 600px) {
  .page--settings #vendors-table tbody tr[data-vendor-row] { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .page--settings #vendors-table tbody tr[data-vendor-row] td.col-company { grid-column: 1; grid-row: 1; }
  .page--settings #vendors-table tbody tr[data-vendor-row] td.col-state { grid-column: 2; grid-row: 1; justify-self: end; white-space: nowrap; }
  .page--settings #vendors-table tbody tr[data-vendor-row] td.col-category { grid-column: 1 / -1; grid-row: 2; }
  .page--settings #vendors-table tbody tr[data-vendor-row] td.actions { grid-column: 1 / -1; grid-row: 3; align-self: auto; justify-self: stretch; }
  .page--settings #vendors-table tbody tr[data-vendor-row] td.actions .row-actions { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; }
  .page--settings #vendors-table tbody tr[data-vendor-row] td.actions .btn--secondary { width: 100%; height: 40px; }
  .page--settings .table-card[aria-labelledby="vendors-h"] > .toolbar__row > .chips { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; flex: 1 1 100%; width: 100%; max-width: 100%; min-width: 0; }
  .page--settings .table-card[aria-labelledby="vendors-h"] > .toolbar__row > .chips > * { flex: 0 0 auto; white-space: nowrap; height: 36px; min-height: 36px; scroll-snap-align: start; }
}

/* =====================================================================
   Completed orders tidy (2026-10-03): visual only. The page carries
   page--orders (the Active orders filter bar, stage badges, Vendors count,
   aligned View / Edit, phone cards); page--archive holds the differences.
   ===================================================================== */
/* 1. Filter bar: search grows, Search sits at the bar's end on the input's line; status chips under it, count at the end. */
.page--archive .orders-bar > .toolbar { display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 10px; }
.page--archive .orders-bar > .toolbar > .toolbar__search { flex: 1 1 auto; max-width: none; min-width: 0; }
.page--archive .orders-bar > .toolbar > .toolbar__actions { flex: 0 0 auto; margin: 0; }
.page--archive .orders-bar > .toolbar__row { justify-content: space-between; align-items: center; gap: 8px 12px; }
.page--archive .orders-bar .chips { gap: 6px 8px; }
.page--archive .orders-bar .result-count { margin: 0; white-space: nowrap; }

/* 3. Cancelled: the grey tone without the strike-through (EN and AR stay readable). */
.page--archive .data--orders .badge--cancelled { text-decoration: none; }

@media (min-width: 901px) {
  /* 2. Columns: NG chip, badge, Transport, Vendors count, ETA date, Owners and View / Edit at fixed widths;
     Customer and Commodity share the rest. */
  .page--archive .data.data--archive { table-layout: fixed; width: 100%; }
  .page--archive .data.data--archive > thead > tr > th:nth-child(1) { width: 82px; }
  .page--archive .data.data--archive > thead > tr > th:nth-child(2) { width: auto; min-width: 180px; }
  .page--archive .data.data--archive > thead > tr > th:nth-child(3) { width: 124px; }
  .page--archive .data.data--archive > thead > tr > th:nth-child(5) { width: 176px; }
  .page--archive .data.data--archive > thead > tr > th:nth-child(6) { width: 112px; }
  .page--archive .data.data--archive > thead > tr > th:nth-child(7) { width: 101px; }
  .page--archive .data.data--archive > thead > tr > th:nth-child(8) { width: 144px; }
  .page--archive .data.data--archive > thead > tr > th:nth-child(9) { width: 136px; }
  /* BL on one line, never broken inside the number. */
  .page--archive .data.data--archive .transport__bl { white-space: nowrap; word-break: normal; overflow-wrap: normal; font-variant-numeric: tabular-nums; }
  .page--archive .data.data--archive td.col-status .badge { height: auto; margin-inline-end: 6px; }  /* English over Arabic inside the pill */
  /* Owner names stay whole (no "MOHAMM-ED"). */
  .page--archive .data.data--archive .owners, .page--archive .data.data--archive .owners > span { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
}
@media (min-width: 901px) and (max-width: 1099.98px) {
  .page--archive .data.data--archive > thead > tr > th, .page--archive .data.data--archive > tbody > tr > td { padding-inline: 6px; }
}
@media (min-width: 1101px) and (max-width: 1439.98px) {
  /* Table 990-1150px (sidebar from 1280px; Owners and ETA shown from 1101px): 5px cell padding and the short columns at their content width
     (NG chip 63, badge 106, BL up to 139 + headroom, "2 providers" + chevron 85, ETA 85, owners 128, View + Edit 118),
     so Customer and Commodity share >= 186px next to a one-line BL (93px each, about the Active list's Customer at 1280). */
  .page--archive .data.data--archive > thead > tr > th, .page--archive .data.data--archive > tbody > tr > td,
  .page--archive .data.data--archive td.actions { padding-inline: 5px; }
  .page--archive .data.data--archive > thead > tr > th:nth-child(1) { width: 74px; }
  .page--archive .data.data--archive > thead > tr > th:nth-child(3) { width: 116px; }
  .page--archive .data.data--archive > thead > tr > th:nth-child(5) { width: 156px; }
  .page--archive .data.data--archive > thead > tr > th:nth-child(6) { width: 96px; }
  .page--archive .data.data--archive > thead > tr > th:nth-child(7) { width: 96px; }
  .page--archive .data.data--archive > thead > tr > th:nth-child(8) { width: 138px; }
  .page--archive .data.data--archive > thead > tr > th:nth-child(9) { width: 128px; }
  .page--archive .data.data--archive td.col-status .badge { margin-inline-end: 0; }
}

/* 5. Phones: compact header, search and a 44px Search icon on one line,
   one sideways row of status chips, and a card header where the date never runs under the badge. */
@media (max-width: 599.98px) {
  /* Eyebrow, title and description in one column (the header has no actions). */
  .page--archive .page-header { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; }
  .page--archive .page-header > div:first-child { display: contents; }
  .page--archive .page-header .page-header__eyebrow { grid-column: 1 / -1; grid-row: 1; margin: 0 0 4px; }
  .page--archive .page-header .page-title { grid-column: 1; grid-row: 2; min-width: 0; margin: 0; }
  .page--archive .page-header .page-sub { grid-column: 1 / -1; grid-row: 3; margin-top: 6px; font-size: 13px; line-height: 18px; }
  .page--archive .orders-bar { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
  .page--archive .orders-bar > .toolbar { display: flex; flex-direction: row; align-items: flex-end; gap: 8px; padding: 0; }
  .page--archive .orders-bar > .toolbar > .toolbar__search { order: 1; }
  .page--archive .orders-bar > .toolbar > .toolbar__actions { order: 2; }
  /* Search: a 44px icon button; its text stays as the accessible name (visually hidden), so the placeholder has room. */
  .page--archive .orders-bar > .toolbar > .toolbar__actions .btn { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; gap: 0; font-size: 0; line-height: 0; justify-content: center; }
  .page--archive .orders-bar > .toolbar > .toolbar__actions .btn .icon { width: 18px; height: 18px; margin: 0; }
  .page--archive .orders-bar > .toolbar__row { flex-direction: column; align-items: stretch; gap: 6px; padding: 0; }
  .page--archive .orders-bar .chips {
    display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
    width: 100%; max-width: 100%; min-width: 0; margin: 0; padding-block: 0; padding-inline: 0 16px; scroll-padding-inline: 16px;
    -webkit-mask-image: linear-gradient(to left, transparent 0, #000 28px); mask-image: linear-gradient(to left, transparent 0, #000 28px);
  }
  .page--archive .orders-bar .chips::-webkit-scrollbar { display: none; }
  .page--archive .orders-bar .chips > * { flex: 0 0 auto; white-space: nowrap; min-height: 36px; scroll-snap-align: start; }
  /* Card header: NG chip and date on the left, the badge (English over Arabic) on the right; the date wraps under the chip if needed. */
  .page--archive .data--cards.data--orders tbody tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .page--archive .data--cards.data--orders tbody td.col-ng { flex-wrap: wrap; column-gap: 6px; row-gap: 2px; min-width: 0; }
  .page--archive .data--cards.data--orders tbody td.col-status { min-width: 0; justify-self: end; text-align: end; }
  .page--archive .data--cards.data--orders td.col-status .badge {
    display: inline-grid; grid-template-columns: auto auto; align-items: center; column-gap: 6px; row-gap: 0;
    max-width: 100%; height: auto; padding: 4px 10px 4px 5px; border-radius: 10px; line-height: 16px; white-space: nowrap; text-align: start;
  }
  .page--archive .data--cards.data--orders td.col-status .badge > .badge__step, .page--archive .data--cards.data--orders td.col-status .badge > .badge__dot { grid-row: 1 / span 2; }
  .page--archive .data--cards.data--orders td.col-status .badge > .en { font-weight: 700; }
  .page--archive .data--cards.data--orders td.col-status .badge > .ar { justify-self: start; margin: 0; font-size: 12px; line-height: 15px; }
}

/* Nav: "Completed orders · الطلبات المكتملة" never clips. On the phone/tablet drawer the label wraps like a flex row
   (English, then the Arabic on a second line when it does not fit), the icon sits outside the wrap, and the item is
   at least 44px. The 1101-1279px header nav keeps its English-over-Arabic grid; the sidebar (from 1280px) has its
   two-line grid for every item (audit F4, above). */
@media (max-width: 1100.98px) {
  .main-nav .nav-link[href="/archived"] { --nav-pad: 14px; --nav-icon-w: 18px; --nav-icon-gap: 12px; }
  body:not(.sidebar-compact) .main-nav .nav-link[href="/archived"] {
    display: flex; flex-wrap: wrap; align-items: center; align-content: center; column-gap: 6px; row-gap: 0;
    height: auto; min-height: 44px; min-width: 0; padding-block: 6px; padding-inline-start: calc(var(--nav-pad) + var(--nav-icon-w) + var(--nav-icon-gap));
    white-space: normal; overflow: visible; text-overflow: clip;
  }
  body:not(.sidebar-compact) .main-nav .nav-link[href="/archived"]::before { position: absolute; inset-inline-start: var(--nav-pad); top: 50%; margin-top: calc(var(--nav-icon-w) / -2); }
  body:not(.sidebar-compact) .main-nav .nav-link[href="/archived"] .en { min-width: 0; margin: 0; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; }
  body:not(.sidebar-compact) .main-nav .nav-link[href="/archived"] .ar { margin: 0; font-size: 12px; white-space: nowrap; overflow: visible; text-overflow: clip; }
}
/* User menu in the sidebar (2026-10-14, audit F7): the popup stays inside the sidebar column (it was 300px wide over
   a 240px column and spilled onto the page). On the compact 72px rail it is a popover beside the rail, level with the
   user button. A short window scrolls it instead of pushing it off the top of the screen. */
@media (min-width: 1280px) {
  .header-actions > .menu:has(> .user-btn) > .menu__panel {
    inset-inline: 12px; width: auto; max-height: calc(100vh - var(--header-h) - 88px); overflow-y: auto;
  }
  .sidebar-compact .header-actions > .menu:has(> .user-btn) > .menu__panel { bottom: 12px; inset-inline: calc(100% + 8px) auto; width: 260px; }
  .header-actions .menu__user strong { overflow-wrap: anywhere; }
}


/* =====================================================================
   Active orders: one-line BL number (2026-10-03). The BL broke mid-number at every width from 901 to 1600.
   The "BL" / "AWB" key now sits on its own small line above the number (12px monospace, tabular figures),
   so Transport only needs the number's width (longest today 119px). The few px for it come from 4-5px cell
   padding and the short columns at their measured content width; View + Edit (side by side), the owners
   (role and name on one line) and the one-line Shipping agency pill keep their ui-60 layout and size.
   Scoped to Active orders (:not(.data--archive)); the Completed orders table keeps its own rules.
   ===================================================================== */
@media (min-width: 901px) {
  /* One line for every BL/AWB that fits the column (all of them today). Only a value wider than the whole column
     (no length limit on input) wraps inside it rather than running into Commodity. */
  .page--orders .data.data--orders:not(.data--archive) .transport__bl { font-size: 12px; line-height: 16px; white-space: normal; word-break: normal; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
  .page--orders .data.data--orders:not(.data--archive) .transport__bl > .k { display: block; font-size: 10px; line-height: 13px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(1) { width: 82px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(2) { width: auto; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(3) { width: 120px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(5) { width: 132px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(6) { width: 138px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(7), .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(8) { width: 90px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(9) { width: 142px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(10) { width: 132px; }
}
@media (min-width: 901px) and (max-width: 1439.98px) {
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th, .page--orders .data.data--orders:not(.data--archive) > tbody > tr > td { padding-inline: 5px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:first-child, .page--orders .data.data--orders:not(.data--archive) > tbody > tr > td:first-child { padding-inline-start: 12px; }
  .page--orders .data.data--orders:not(.data--archive) > tbody > tr > td.actions { padding-inline-end: 8px; }
}
/* Narrowest tables (901-1100px; 1280-1439px next to the sidebar): 4px cells, the same content widths,
   so Customer keeps about its ui-60 width (90px at 1280; "COMPANY" fits on a line). */
@media (min-width: 901px) and (max-width: 1100.98px), (min-width: 1280px) and (max-width: 1439.98px) {
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th, .page--orders .data.data--orders:not(.data--archive) > tbody > tr > td { padding-inline: 4px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:first-child, .page--orders .data.data--orders:not(.data--archive) > tbody > tr > td:first-child { padding-inline-start: 12px; }
  .page--orders .data.data--orders:not(.data--archive) > tbody > tr > td.actions { padding-inline-end: 8px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(3) { width: 118px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(5) { width: 126px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(6) { width: 134px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(7), .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(8) { width: 88px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(9) { width: 138px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(10) { width: 130px; }
}
@media (min-width: 1440px) {
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(3) { width: 122px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(5) { width: 140px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(6) { width: 140px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(7), .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(8) { width: 92px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(9) { width: 144px; }
  .page--orders .data.data--orders:not(.data--archive) > thead > tr > th:nth-child(10) { width: 136px; }
}

/* Active orders, 2026-10-04: Status is 6px wider so the service line ("Land · Door to Door", 110px) shows in full
   instead of "Land · Door to D…". At 1280-1439 (and 901-1100) that and 2px more for Owners come from Transport (-2px;
   BL 116px in 118), Shipping agency (-2px; the 127px pill may use 1px of the 4px padding) and Customer (-4px; 78px of
   text, so "COMPANY" / "INDUSTRIAL" still fit on a line). Elsewhere Customer (auto width) gives the px.
   Owners: the name inherited overflow-wrap: anywhere, so "MOHAMMED" broke as "MOHAMME / D". Names now break only
   at spaces, and with a 4px key/name gap and the 2-4px wider column the name track is 84px+ ("MOHAMMED" is 82px). */
@media (min-width: 901px) {
  .page--orders .data.data--orders:not(.data--archive) .owners { column-gap: 4px; }
  .page--orders .data.data--orders:not(.data--archive) .owners > span { white-space: normal; overflow-wrap: normal; word-break: normal; }
}

/* Top bar at 1101-1279 (2026-10-03): the nav ran under New order (by 60-161px). The Notifications link is
   phone-only (the bell sits in the header), but the bilingual grid rule above showed it here; it is hidden again,
   and the links and header gaps are a little tighter, so Dashboard / Active / Completed / Settings fit beside New order. */
@media (min-width: 1101px) and (max-width: 1279.98px) {
  .main-nav > a.nav-mobile-only { display: none; }
  .main-nav .nav-link { padding-inline: 8px; column-gap: 6px; }
  .app-header__inner { column-gap: 20px; }
}
/* Accounts (2026-10-04): with five links (admin: Accounts and Settings) the nav ran under New order again (by up to
   89px). There New order shows only its "+", as below 1101px; its title still names it. */
@media (min-width: 1101px) and (max-width: 1279.98px) {
  .app-header__inner:has(.nav-link[href="/accounts"]):has(.nav-link[href="/settings"]) .btn--new { width: var(--ctl-md); padding: 0; }
  .app-header__inner:has(.nav-link[href="/accounts"]):has(.nav-link[href="/settings"]) .btn--new .btn__label { display: none; }
}

/* Dashboard units (2026-10-04): containers / trucks next to order counts; Sea / Land tiles count units. */
.page--home .dash-kpi__units {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: auto; padding-top: 8px;
  border-top: 1px solid var(--border-soft); color: var(--text-3); font-size: var(--fs-xs); font-weight: 600;
}
.page--home .unit-count { white-space: nowrap; }
.page--home .unit-count b { color: var(--text); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.page--home .unit-count.is-zero b { color: var(--text-4); font-weight: 600; }
.page--home .unit-count .ar { display: inline; margin: 0; color: var(--text-4); font-size: var(--fs-xs); font-weight: 500; }
.page--home .stage__main { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
/* Number + unit as fixed-width columns, so the counts line up straight on phones (one tile per row). */
.page--home .pipeline .stage--units .stage__count { display: block; flex: 0 0 auto; min-width: 2ch; margin-top: 0; align-self: auto; font-size: 26px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; }
.page--home .stage__unit { flex: 0 0 auto; min-width: 64px; color: var(--tone-text, var(--tone)); font-size: 12px; font-weight: 600; line-height: 1; text-align: start; white-space: nowrap; }
.page--home .pipeline .stage.is-zero .stage__unit { color: var(--text-4); }
.page--home .stage--units .stage__figure { margin-top: auto; }
/* The progress bar spans the whole foot row in every tile (still hidden in zero tiles). */
.page--home .stage__orders { align-self: flex-start; margin-top: -8px; color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; text-decoration: none; }
.page--home .pipeline .stage a.stage__orders::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }  /* whole tile opens the order list */
.page--home .pipeline .stage a.stage__orders:focus-visible { outline: none; }
.page--home .pipeline .stage a.stage__orders:hover { text-decoration: none; }
.page--home .stage__orders .unit-count b { font-size: var(--fs-xs); color: var(--text-2); }
@media (max-width: 600px) {
  /* Phone stage rows: the bar spans the row; Arabic label on its own line so a long stage
     (CUSTOMS CLEARANCE) doesn't wrap and every row keeps the same height. */
  .page--home .stage__orders { margin-top: 0; }  /* the label is two lines now; don't pull the orders line into it */
  .page--home .stage__label { flex: 1; min-width: 0; }
  .page--home .stage__label .ar { display: block; margin: 2px 0 0; white-space: nowrap; }
}

/* ======================================================================
   Stage guide requirement items + leg row stage errors
   (built in app.js from orders.stage_guide_items; the server macro was
   unused and removed, audit R-56). Appended after the base
   .stage-list / .assignment-row--leg rules so these win on specificity.
   ====================================================================== */

/* One .req-item per requirement that becomes NEW at that stage, instead of the
   old single .req-list sentence: an open item carries a small orange dot, a
   satisfied one a green check and muted text. The stepper connector (the
   .stage-guide .stage-list > li ::before line) is untouched — the stepper
   rules target direct children only, so these nested items keep their own
   marker; they sit in column 2 of the stage <li> grid. */
.stage-list .req-items {
  grid-column: 2;
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.stage-list .req-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: start;
  font-size: var(--fs-xs);
  line-height: 1.35;
  color: var(--text-2);
}
.stage-list .req-item::before {
  content: "";
  grid-column: 1;
  width: 6px;
  height: 6px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--orange);
}
.stage-list .req-item.is-done { color: var(--text-4); }
.stage-list .req-item.is-done::before {
  content: "✓";
  width: auto;
  height: auto;
  margin-top: 0;
  border-radius: 0;
  background: none;
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}
.stage-list .req-item__en, .stage-list .req-item__ar { grid-column: 2; }
/* Arabic companion on its own line, quieter — same behaviour as the old
   .stage-list .req-list.ar (left-aligned, isolated RTL run). */
.stage-list .req-item__ar {
  display: block;
  margin: 1px 0 0;
  font-family: var(--font-ar);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-4);
  text-align: left;
  direction: rtl;
  unicode-bidi: isolate;
}
/* The stage the order is on: what is still open reads as the active ask;
   satisfied items stay muted here and everywhere else. */
.stage-list > li.is-current .req-item:not(.is-done) { color: var(--text); font-weight: 600; }

/* "Nothing new at this stage" / archive note. */
.stage-list .req-note {
  grid-column: 2;
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text-4);
}
.stage-list .req-note .ar {
  display: block;
  margin-top: 2px;
  text-align: left; /* like the item / badge Arabic lines in the guide */
  margin-inline-start: 0.35em;
  font-size: 11px;
  color: inherit;
}

/* Leg rows (pickup / delivery): the stage error belongs to the whole row, not
   to one of its three columns — field--error is the server re-render,
   field--missing the client pre-submit check in app.js. */
.assignment-row--leg.field--error,
.assignment-row--leg.field--missing {
  background: #FFFBFA;
  box-shadow: inset 3px 0 0 var(--danger);
  border-radius: var(--r);
  padding-inline-start: 10px;
}
.assignment-row--leg.field--error select,
.assignment-row--leg.field--missing select { border-color: var(--danger); }
/* Only the provider is missing: the optional Description keeps its normal label. */
.assignment-row--leg.field--error .field:not(:has(select)) .field__label,
.assignment-row--leg.field--missing .field:not(:has(select)) .field__label { color: var(--label); }
/* Full-width under the controls on the 3-column desktop grid and on the
   1-column phone grid alike. */
.leg-row__error { grid-column: 1 / -1; margin: 0; }

/* ---------- Design review PR #71 ---------- */
/* Pickup / delivery row anchors (#sec5-origin-pickup …) clear the sticky header. */
[id^="sec5-"] { scroll-margin-top: 96px; }
/* Bilingual messages (msg_lines macro / app.js messageNode): Arabic on its own
   line in the error banner and on the leg row, never "EN · AR" in one run. */
.msg__ar { display: block; direction: rtl; text-align: start; margin-top: 2px; font-family: var(--font-ar); }
.field__error .msg { display: block; min-width: 0; }
/* Leg row titles: English over Arabic. */
.assignment-row--leg { grid-template-columns: minmax(170px, 0.7fr) minmax(0, 1fr) minmax(0, 1fr); }
.leg-row__title { min-width: 170px; }
.leg-row__title .en { display: block; }
.leg-row__title .ar { display: block; font-size: 13px; white-space: nowrap; text-align: left; }
/* Land transport company / Description labels share one baseline row. */
.assignment-row--leg .field__label { min-height: 40px; align-content: flex-end; }
@media (max-width: 760px) {
  /* Phone: title, provider, its error, then Description. */
  .assignment-row--leg { display: flex; flex-direction: column; align-items: stretch; }
  .assignment-row--leg > .leg-row__title { order: 0; min-width: 0; }
  .assignment-row--leg > label.field:nth-of-type(1) { order: 1; }
  .assignment-row--leg > .leg-row__error { order: 2; }
  .assignment-row--leg > label.field:nth-of-type(2) { order: 3; }
  .assignment-row--leg > .leg-row__hint { order: 4; }
  .assignment-row--leg .field__label { min-height: 0; }
}
/* Stage guide: the row link is live on the current stage's open item only. */
.stage-list .req-item__link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.stage-list > li:not(.is-current) .req-item__link,
.stage-list .req-item.is-done .req-item__link { pointer-events: none; text-decoration: none; }
/* Orange dot only for the current stage's open items; other stages' open
   items get a hollow grey dot and regular grey text. */
.stage-list > li:not(.is-current) .req-item:not(.is-done) { color: #64748B; font-weight: 400; }
.stage-list > li:not(.is-current) .req-item:not(.is-done)::before {
  box-sizing: border-box;
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border: 1.5px solid #94A3B8;
  background: transparent;
}

/* ---------- Accounts: orders list and Cost Statement (S7) ---------- */
/* Add row / × need app.js; without it the rows shown still save. */
html:not(.js) [data-line-add], html:not(.js) [data-line-remove] { display: none !important; }
.money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.accounts-list > .card__header ~ .card__header { border-top: 1px solid var(--border); }
@media (min-width: 901px) {
  /* The Completed and Active tables share one set of column widths. */
  .accounts-list .data { table-layout: fixed; }
  .accounts-list .data th:nth-child(1) { width: 130px; }
  .accounts-list .data th:nth-child(3) { width: 220px; }
  .accounts-list .data th:nth-child(4) { width: 38%; }
}
/* Whole-row click, as section 22: the NG link is stretched over its row / card. */
.accounts-list .data tbody tr { position: relative; }
.accounts-list .data a.ng-link { position: static; }
.accounts-list .data a.ng-link::after { content: ""; position: absolute; inset: 0; }
.accounts-list .data a.ng-link:focus-visible { outline: none; }
.accounts-list .data a.ng-link:focus-visible::after { outline: 2px solid var(--navy); outline-offset: -2px; }
@media (max-width: 900px) {
  .accounts-list .data a.ng-link::after { inset: 0; border-radius: var(--r-lg); }
  .accounts-list .data tbody tr:hover { border-color: var(--navy-200); }
}
.statement-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.data--lines td { vertical-align: top; }
.data--lines tr.is-invalid > td { background: #FFFBFA; }
.data--lines td.line-vendor { min-width: 180px; max-width: 280px; }
.line-vendor__name { display: flex; align-items: center; min-height: var(--ctl-md); font-weight: 600; overflow-wrap: anywhere; }
.data--lines td.line-amount { width: 180px; }
.data--lines td.line-amount input { text-align: end; font-variant-numeric: tabular-nums; }
.data--lines td.line-currency { width: 104px; }
/* A row without a currency yet shows the "Select currency · اختر العملة" placeholder in full. */
@media (min-width: 761px) { .data--lines:has([data-line-currency] option[value=""]:checked) td.line-currency { width: 244px; } }
.data--lines td.line-remove { width: 1%; white-space: nowrap; }
.data--lines .field__error { margin-top: 4px; }
/* A saved line marked with × stays in the form — struck through, not editable,
   with Undo — until Save asks for the confirmation. × sets the line's delete
   marker; the dialog's Confirm adds confirm_delete=1, without which the server
   deletes nothing and refuses the save (also without JavaScript). */
.line-delete { display: inline-flex; align-items: center; gap: 6px; min-height: var(--ctl-md); font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.line-delete-confirm { display: block; margin-top: 8px; font-weight: 600; }
html.js .line-delete, html.js .line-delete-confirm { display: none; }
.line-deleting { display: none; margin-top: 2px; color: var(--danger); font-size: var(--fs-sm); font-weight: 600; }
.data--lines tr.is-deleting .line-deleting { display: block; }
.data--lines tr.is-deleting > td { background: #FFFBFA; }
.data--lines tr.is-deleting .line-vendor__name,
.data--lines tr.is-deleting :is(input[type="text"], select) { color: var(--text-4); text-decoration: line-through; }
html.js .data--lines tr.is-deleting :is(input[type="text"], select) { pointer-events: none; background-color: var(--surface-2); }
.dialog__note { color: var(--text-3); font-weight: 400; }
.statement__bar {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px;
  padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border-soft);
}
.statement__totals { margin-inline-start: auto; display: grid; justify-items: end; gap: 2px; text-align: end; }
.statement__totals-label { color: var(--text-3); font-size: var(--fs-sm); font-weight: 600; }
.statement__totals .money { font-size: var(--fs-lg); font-weight: 700; }
.statement__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
@media (max-width: 760px) {
  /* Phone: one block per row — vendor (and ×), then the item, then amount + currency. */
  .data--lines thead { display: none; }
  .data--lines, .data--lines tbody { display: block; }
  .data--lines tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) 136px; gap: 8px;
    padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border-soft);
  }
  .data--lines tbody td:is(.line-vendor, .line-desc, .line-amount, .line-currency, .line-remove) {
    display: block; width: auto; min-width: 0; max-width: none; padding: 0; border: 0;
  }
  .data--lines tbody td.line-vendor { grid-column: 1; grid-row: 1; }
  .data--lines tbody td.line-remove { grid-column: 2; grid-row: 1; justify-self: end; }
  .data--lines tbody td.line-desc { grid-column: 1 / -1; }
  .data--lines tbody td.line-amount { grid-column: 1; }
  .data--lines tbody td.line-currency { grid-column: 2; }
  /* No currency chosen yet: amount and currency each take the full width, so the placeholder is not cut. */
  .data--lines tbody tr:has([data-line-currency] option[value=""]:checked) td:is(.line-amount, .line-currency) { grid-column: 1 / -1; }
  /* The header is hidden here: each field carries its own small label (as the
     edit-history cards do); a fixed vendor name needs none. */
  .data--lines tbody td[data-label]::before {
    content: attr(data-label); display: block; color: var(--text-4); font-size: var(--fs-xs); font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; white-space: nowrap;
  }
  /* An invalid row is tinted as one card, not cell by cell. */
  .data--lines tbody tr:is(.is-invalid, .is-deleting) { background: #FFFBFA; box-shadow: inset 3px 0 0 var(--danger); }
  .data--lines tbody tr:is(.is-invalid, .is-deleting) > td, .data--lines tbody tr:hover > td { background: transparent; }
  .statement__foot .btn--primary { width: 100%; height: var(--ctl-touch); }
}
/* A party whose charges are the lines under it (port party, shipping line, …)
   is a heading row without an amount; its lines show ↳ before the vendor
   (design Sea-07, QA P3-7). Lump sum / Customer Arranged notes use the same row. */
.data--lines tr.line-heading > td.line-heading__cell {
  padding: 10px var(--s-4) 6px; text-align: start; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2);
  background: var(--surface-2); border-top: 1px solid var(--border-soft);
}
.line-heading__vendor { color: var(--text); font-weight: 700; }
.line-heading__note { color: var(--text-3); font-weight: 400; }
.line-heading__ar { display: block; margin-top: 2px; color: var(--text-3); font-weight: 400; }
.data--lines td.line-vendor--child .line-vendor__name::before {
  content: "↳" / ""; flex: none; margin-inline-end: 6px; color: var(--text-4); font-weight: 400;
}
@media (max-width: 760px) {
  .data--lines tbody tr.line-heading { display: block; padding: 0; }
  .data--lines tbody tr.line-heading > td.line-heading__cell { display: block; }
}

/* =====================================================================
   Active orders: the stage label stays inside its badge (ui-74, audit UI-01).
   "Customs clearance · التخليص الجمركي" (and "Arrived airport", "Waiting booking") is wider than the
   Status slot and could not wrap (nowrap), so it painted into Transport on the desktop table and over the
   entry date on the phone card. The badge is now at most as wide as its slot and a long label wraps inside
   it; a label that fits looks as before. Scoped to Active orders (:not(.data--archive)).
   ===================================================================== */
@media (min-width: 901px) {
  .page--orders .data.data--orders:not(.data--archive) td.col-status .badge {
    grid-template-columns: auto minmax(0, auto); max-width: 100%; white-space: normal;
  }
  .page--orders .data.data--orders:not(.data--archive) td.col-status .badge > .en,
  .page--orders .data.data--orders:not(.data--archive) td.col-status .badge > .ar { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 900px) {
  /* Card header: NG chip and date on the left (the date wraps under the chip if needed), the badge on the
     right — English over Arabic, as on Completed orders — never wider than its half of the card. */
  .page--orders .data--cards.data--orders:not(.data--archive) tbody td.col-ng { flex-wrap: wrap; column-gap: 6px; row-gap: 2px; min-width: 0; }
  .page--orders .data--cards.data--orders:not(.data--archive) tbody td.col-status { min-width: 0; max-width: 100%; text-align: end; }
  .page--orders .data--cards.data--orders:not(.data--archive) td.col-status .badge {
    display: inline-grid; grid-template-columns: auto minmax(0, auto); align-items: center; column-gap: 6px; row-gap: 0;
    max-width: 100%; height: auto; padding: 4px 10px 4px 5px; border-radius: 10px; line-height: 16px; white-space: normal; text-align: start;
  }
  .page--orders .data--cards.data--orders:not(.data--archive) td.col-status .badge > .badge__step,
  .page--orders .data--cards.data--orders:not(.data--archive) td.col-status .badge > .badge__dot { grid-row: 1 / span 2; }
  .page--orders .data--cards.data--orders:not(.data--archive) td.col-status .badge > .en { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
  .page--orders .data--cards.data--orders:not(.data--archive) td.col-status .badge > .ar { min-width: 0; justify-self: start; margin: 0; font-size: 12px; line-height: 15px; overflow-wrap: anywhere; }
}

/* =====================================================================
   New / Edit order: in-page jumps land below the sticky order header (ui-74, audit UI-03).
   The order header (NG, stage, entry date, company; 180-245px) is sticky under the 58px top bar, but
   fragment targets only cleared the top bar, so the error-summary links and Reopen put the field (and the
   keyboard focus) underneath it. The page's scroll-padding now includes the order header: app.js keeps
   --order-head-h at its measured height; the fallback covers its tallest layout without JavaScript.
   A field's control also leaves room for its label, and the pickup / delivery rows drop their own 96px
   allowance (the header is in the scroll-padding now).
   ===================================================================== */
html:has(.order-form-header) { scroll-padding-top: calc(var(--header-h) + var(--order-head-h, 248px) + 12px); }
[data-order-form] :is(input, select, textarea)[id^="f-"] { scroll-margin-top: 30px; }
html:has(.order-form-header) [id^="sec5-"] { scroll-margin-top: 0; }

/* =====================================================================
   Orders tables: balanced columns from 1440px (ui-76).
   Every column but Customer had a fixed px width, so on a wide screen Customer took all the spare room
   (682px at 1920, 1322px at 2560: an empty middle) while Status and Transport stayed at their 1440 width
   and wrapped ("Arrived / port", "1× / REFRIGERATOR / TRUCK"). On Completed orders Customer and Commodity
   shared that room the same way.
   The widths now come from the table's <colgroup> (one <col> per header cell; a <col> width wins over the
   th widths above), shared by Active and Completed orders:
   - 1440-1699px (table 1135-1410px): NG, Vendors, ETA and View / Edit at their content width; Status,
     Transport, Commodity and Owners a share of the table, sized so the stage badge (138px, "Arrived to the
     port") and "1× REFRIGERATOR TRUCK" (176px) keep one line; Customer what is left (about 135-270px);
   - from 1700px: every column a share of the table (they add up to 100%; Customer 20%), so the spare room
     is spread over all the columns.
   The Customer name keeps its two lines at most, cut with an ellipsis, the full name in its title.
   The colgroup is not rendered below 1440px: the phone / tablet cards and the narrower tables are unchanged.
   ===================================================================== */
.data--orders > colgroup { display: none; }
@media (min-width: 1440px) {
  .page--orders .data--orders > colgroup { display: table-column-group; }
  .page--orders .data--orders col.c-service { display: none; }  /* as its cells: the service rides under the stage badge */
  .page--orders .data--orders col.c-ng { width: 84px; }
  .page--orders .data--orders col.c-status { width: 13.1%; }
  .page--orders .data--orders col.c-transport { width: 16.7%; }
  .page--orders .data--orders col.c-commodity { width: 9.3%; }
  .page--orders .data--orders col.c-vendors { width: 96px; }
  .page--orders .data--orders col.c-eta { width: 98px; }
  .page--orders .data--orders col.c-owners { width: 13.1%; }  /* UI/UX redesign 18/10: one line per owner (customer keeps >= 130px) */
  .page--orders .data--orders col.c-actions { width: 134px; }
}
@media (min-width: 1700px) {
  .page--orders .data--orders col.c-ng { width: 6%; }
  .page--orders .data--orders col.c-customer { width: 20%; }
  .page--orders .data--orders col.c-status { width: 12%; }
  .page--orders .data--orders col.c-transport { width: 14%; }
  .page--orders .data--orders col.c-commodity { width: 12%; }
  .page--orders .data--orders col.c-vendors { width: 7%; }
  .page--orders .data--orders col.c-eta { width: 7.5%; }
  .page--orders .data--orders col.c-owners { width: 12%; }
  .page--orders .data--orders col.c-actions { width: 9.5%; }
}

/* =====================================================================
   Orders tables: the full customer name can be read (review of ui-76).
   From 901px the name is cut after two lines, its full text in the title. It lay under the stretched NG
   link (22), which took the pointer: the title never showed. Where a pointer can hover, the name now sits
   above that link like the other data cells (C1), at the width of its own text: its title shows and it can
   be selected and copied. The rest of the cell and of the row still opens the order, and so does the whole
   row on a touch screen and on the cards, where a title would never show anyway.
   In the templates the name is also a tab stop with the full name as its aria-label.
   Nothing moves: every cell keeps its place and size, the name its two lines.
   ===================================================================== */
@media (min-width: 901px) and (hover: hover) {
  .page--orders .data.data--orders td.col-company .cell-main[tabindex] { position: relative; z-index: 1; width: fit-content; }
}

/* =====================================================================
   Operations dashboard v2.4 + New Order all services (2026-10-14, ui-81).
   Dashboard: the filter row (wraps on phones), stage tiles with the number
   only (no progress bar), the red "vendor not chosen" tag of a tile, the
   service line of the small Clearance / Other block, the Completed card's two
   links. Active orders: on phones the filters stay shown and wrap two to a
   row. Order form: the charges ticked under a party.
   ===================================================================== */
.dash-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.dash-filters__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.dash-filters__form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; margin-inline-start: auto; }
.dash-filters__field { display: flex; align-items: center; gap: 6px; margin: 0; min-width: 0; }
.dash-filters__field .field__label { margin: 0; white-space: nowrap; }
.dash-filters__field select { height: var(--ctl-sm); min-width: 0; max-width: 240px; }
.stage-card__header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.stage-card__note { color: var(--text-3); font-size: var(--fs-sm); }
/* Above the tile's whole-tile link (a.stage__orders::after), so the tag opens its own list. */
.page--home .stage__alert {
  position: relative; z-index: 1; align-self: flex-start; margin-top: 4px; padding: 1px 8px;
  border-radius: 999px; background: var(--danger-bg); color: var(--danger);
  font-size: var(--fs-xs); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.page--home .stage__alert:hover { text-decoration: underline; }
.page--home .stage__service { color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; }
.page--home .dash-kpi__links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.page--home .dash-kpi__links > .dash-kpi__sub { align-self: auto; }
.tag--vendor_missing { background: var(--danger-bg); color: var(--danger); }
.party-charges { margin: 0; padding: 0; border: 0; min-width: 0; }
.party-charges__other { max-width: 420px; margin-top: 8px; }
@media (max-width: 599.98px) {
  .dash-filters__form { width: 100%; margin-inline-start: 0; }
  .dash-filters__field { flex: 1 1 calc(50% - 4px); }
  .dash-filters__field select { flex: 1 1 auto; max-width: none; }
  /* Active orders: Company / Vendor / Owner / Stage wrap two to a row instead of folding away. */
  .page--orders .orders-bar > .toolbar > .toolbar__more[data-toolbar-wrap] .toolbar__more-body { display: flex; flex-wrap: wrap; gap: 10px; }
  .page--orders .orders-bar > .toolbar > .toolbar__more[data-toolbar-wrap] .toolbar__field { flex: 1 1 calc(50% - 5px); min-width: 0; }
}

/* =====================================================================
   Language switcher EN | TR (2026-10-14, ui-82).
   One POST form with two submit buttons, in the header (navy) and on the
   sign-in page (light); the current language carries aria-current. The
   buttons are 44px tall wherever the header's other targets are.
   In Turkish the page is Turkish only: the Arabic companions are emptied and
   hidden by the server (app/i18n.py); the rule below also covers the ones
   app.js adds, and the sign-in headings use the Latin font.
   ===================================================================== */
.lang-switch { display: inline-flex; align-items: center; flex-shrink: 0; margin: 0; }
.lang-switch__btn {
  position: relative; height: 36px; min-width: 30px; padding: 0 6px; border: 0; border-radius: var(--r);
  background: none; color: rgba(255, 255, 255, 0.66); font: inherit; font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: .04em; line-height: 1; cursor: pointer;
}
.lang-switch__btn:hover { color: #fff; background: rgba(255, 255, 255, 0.09); }
.lang-switch__btn[aria-current="true"] { color: #fff; }
.lang-switch__btn[aria-current="true"]::after {
  content: ""; position: absolute; inset-inline: 6px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--orange);
}
.lang-switch__sep { color: rgba(255, 255, 255, 0.34); font-size: var(--fs-xs); line-height: 1; user-select: none; }
@media (min-width: 1101px) {
  .lang-switch__btn { height: 40px; }
  .lang-switch__btn[aria-current="true"]::after { bottom: 8px; }
}
@media (max-width: 1100px) {
  .lang-switch__btn { height: 44px; }
  .lang-switch__btn[aria-current="true"]::after { bottom: 10px; }
}
/* Sign-in page: above the card, at its right edge. */
.lang-switch--auth { width: min(420px, 100%); justify-content: flex-end; }
.lang-switch--auth .lang-switch__btn { height: 36px; color: var(--text-3); }
.lang-switch--auth .lang-switch__btn:hover { color: var(--text); background: var(--navy-50); }
.lang-switch--auth .lang-switch__btn[aria-current="true"] { color: var(--navy); }
.lang-switch--auth .lang-switch__btn[aria-current="true"]::after { bottom: 6px; }
.lang-switch--auth .lang-switch__sep { color: var(--border-strong); }
/* Room for the switcher. Phones below 390px: the header row (menu, logo, +, EN | TR, bell, user) was
   12-55px too wide, so the logo, the side padding and the switcher are a little tighter there; from
   340px down the gaps and the + / bell targets too (40px). Top bar with five links (admin,
   1101-1279px): the nav ran 4-9px under the actions, the two gaps give that back. */
@media (max-width: 389.98px) {
  .app-header__inner { padding-inline: 10px; }
  .brand img { height: 18px; }
  .lang-switch__btn { min-width: 24px; padding: 0 3px; }
  .lang-switch__btn[aria-current="true"]::after { inset-inline: 3px; }
}
@media (max-width: 340px) {
  .header-actions { gap: 2px; }
  .brand img { height: 14px; }
  .app-header .btn--new, .app-header .btn--new:hover, .app-header .icon-btn { width: 40px; }
}
@media (min-width: 1101px) and (max-width: 1279.98px) {
  .app-header__inner:has(.nav-link[href="/accounts"]):has(.nav-link[href="/settings"]) { column-gap: 12px; }
}
html[lang="tr"] [lang="ar"]:not(input):not(textarea):not(select) { display: none !important; }
html[lang="tr"] .auth h1, html[lang="tr"] .auth h2 { font-family: var(--font); }
/* Turkish labels run longer than the English ones: an alert chip of the dashboard may wrap inside its card. */
html[lang="tr"] .page--home .dash-kpi__alerts .unit-count { white-space: normal; }
/* PDF stage card (design v2-stage-ready / -locked): Close stage button. */
.stage-card{border:1px solid var(--border,#d9dee7);border-radius:8px;padding:12px;margin-bottom:12px;background:var(--surface-2,#f7f9fc)}
.stage-card__now{margin:0 0 8px}
.stage-card__hint{margin:6px 0 0;font-size:.85em;color:var(--muted,#5b6475)}
.stage-card__other{margin:4px 0 8px}
.stage-card__other summary{cursor:pointer;font-size:.9em;color:var(--muted,#5b6475)}

/* Design MATCH-final: stage names such as "On the land way" stay on one line on desktop. */
@media (min-width: 1100px) { .page--home .stage__label { white-space: nowrap; } .page--home .stage__label .ar { white-space: normal; } }
/* TR stage names are longer ("HAVALİMANINA ULAŞTI"): wrap, never cut off (Quality 9b7edc9 P3). */
@media (min-width: 1100px) { html[lang="tr"] .page--home .stage__label { white-space: normal; overflow-wrap: break-word; overflow: visible; text-overflow: clip; } }

/* =====================================================================
   Operations dashboard — final design (2026-10-14): dashboard-final.pdf, drawn
   from design/dashboard-review-2026-10-14/src/dashboard-v2.5.html (desktop 1440,
   phone 390). Visual only and scoped to .page--home; it comes after every
   earlier dashboard layer, so it wins on order (same or higher specificity).
   KPI cards with a 4px coloured top edge, one wrapping filter row, stage tiles
   with a 5px coloured start edge and a coloured stage name, numbered alert
   badges, plain day boxes (today orange), one line per owner.
   The design's values: line #E3E7EF, muted #667085, ink #1D2939, cards 12px
   radius / 16px padding / 14px apart, tiles 8px radius. Two badge fills and the
   In air / On the sea way name are one shade darker than the mock, so their
   white or coloured text keeps >= 4.5:1 (#0E8C7E -> #0B6F64, #98A2B3 -> #667085).
   ===================================================================== */
.page--home {
  --dash-gap: 14px;
  --dash-line: #E3E7EF; --dash-mut: #667085; --dash-ink: #1D2939; --dash-sub: #344054;
  --dash-red: #C0362C; --dash-green: #067647;
}
.page--home .dash-section { margin: 0 0 var(--dash-gap); }
/* Read out, not shown: the unit next to a tile's number (the block title names it), an
   alert's rule and the customer of a listed order (the NG link's tooltip shows it). */
.page--home .pipeline .stage .stage__unit,
.page--home .dash-action .bucket__rule,
.page--home .dash-action .bucket__company {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* 1. KPI cards: the number (30px), the label, a muted line under it. */
.page--home .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.page--home .kpi-card {
  --kpi-tone: var(--navy); --kpi-text: var(--dash-ink);
  display: block; min-height: 0; padding: 14px 16px;
  border: 1px solid var(--dash-line); border-top: 4px solid var(--kpi-tone); border-radius: 12px;
  background: var(--surface); box-shadow: none;
}
.page--home .kpi-card--attention { --kpi-tone: var(--dash-red); --kpi-text: var(--dash-red); }
.page--home .kpi-card--arrivals { --kpi-tone: var(--orange); }
.page--home .kpi-card--archive { --kpi-tone: var(--dash-green); --kpi-text: var(--dash-green); }
.page--home .kpi-card.is-zero { --kpi-text: var(--dash-ink); }
.page--home .kpi-card--attention.is-zero { --kpi-tone: var(--border-strong); }
.page--home .kpi-card--attention:not(.is-zero) { border-color: var(--dash-line); border-top-color: var(--kpi-tone); background: var(--surface); }
/* Sardar 25/10/2026: the whole red tile opens its list — its alert line lets the click through to the card link. */
.page--home .kpi-card--attention .dash-kpi__alerts { pointer-events: none; }
.page--home .kpi-card:hover { border-color: var(--dash-line); border-top-color: var(--kpi-tone); box-shadow: var(--shadow-1); }
.page--home .kpi-card__body { display: block; }
.page--home .kpi-card .dash-kpi {
  display: block; padding: 0; border: 0; background: none; box-shadow: none;
  color: var(--dash-mut); font-size: 13px; font-weight: 400; line-height: 1.4;
}
.page--home .kpi-card .dash-kpi b {
  display: block; margin: 0 0 2px; color: var(--kpi-text);
  font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: 0;
}
.page--home .kpi-card .dash-kpi .ar { display: inline-block; margin: 0 0 0 .35em; color: var(--dash-mut); font-size: 13px; font-weight: 400; }
/* A narrow card or tile breaks before an Arabic companion, not inside it (it still wraps when wider than the line). */
.page--home :is(.kpi-card, .stage-group__title, .stage__service) .ar { display: inline-block; }
.page--home .kpi-card .dash-kpi__units {
  display: block; margin: 4px 0 0; padding: 0; border: 0;
  color: var(--dash-mut); font-size: 12px; font-weight: 400; line-height: 1.45;
}
.page--home .dash-kpi__units .unit-count b { color: inherit; font-size: inherit; font-weight: inherit; }
.page--home .dash-kpi__units .unit-count .ar { color: inherit; }
/* "9 containers · 4 trucks": a dot between the counts; a line breaks after it, never inside a count. */
.page--home .dash-kpi__units .unit-count:not(:last-child)::after { content: "\00a0· "; white-space: normal; }
.page--home .kpi-card .dash-kpi__links { display: block; margin: 6px 0 0; line-height: 1.45; }
/* Each link moves to the next line as a whole ("1 Completed today ›" never splits after the number). */
.page--home .kpi-card .dash-kpi__links > .dash-kpi__sub {
  display: inline-block; margin: 0; padding: 0; border: 0;
  color: var(--navy); font-size: 12.5px; font-weight: 600;
}
.page--home .kpi-card .dash-kpi__links > .dash-kpi__sub:not(:last-child)::after { content: "\00a0·"; color: var(--dash-mut); font-weight: 400; }
.page--home .kpi-card .dash-kpi__sub:hover { color: var(--navy-900); text-decoration: underline; }
.page--home .kpi-card .dash-kpi__sub b, .page--home .kpi-card .dash-kpi__sub.is-zero b { color: inherit; font-size: inherit; font-weight: inherit; }
.page--home .kpi-card .dash-kpi__sub .ar { color: inherit; font-size: 12.5px; font-weight: 500; }

/* 2. Dashboard v3 service links, Sardar 16/10 19:07: seven chips only. */
.page--home .dash-service-chips {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; overflow: visible;
}
.page--home .dash-service-chip {
  display: flex; flex: 1 1 120px; flex-direction: column; justify-content: center; min-width: 0; min-height: 36px;
  padding: 5px 10px; border: 1px solid var(--dash-line); border-radius: 8px; background: var(--surface);
  color: var(--dash-ink); font-size: 13px; font-weight: 600; line-height: 1.25; text-align: center;
  white-space: normal; overflow-wrap: anywhere;
}
.page--home .dash-service-chip:hover {
  border-color: var(--navy-200); background: var(--navy-50); color: var(--navy); text-decoration: none;
}
.page--home .dash-service-chip .ar { margin: 2px 0 0; color: var(--dash-mut); font-size: 12px; font-weight: 400; }

/* Legacy dashboard filter controls are not rendered; these rules remain for old captured markup. */
.page--home .dash-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.page--home .dash-filters__chips, .page--home .dash-filters__form { display: contents; }
.page--home .dash-filters .chip {
  height: auto; min-height: 0; gap: 6px; padding: 6px 12px;
  border: 1px solid var(--dash-line); border-radius: 16px; background: var(--surface); box-shadow: none;
  color: var(--dash-ink); font-size: 13px; font-weight: 400; line-height: 1.4;
}
.page--home .dash-filters .chip:hover { border-color: var(--navy-200); background: var(--navy-50); color: var(--navy); }
.page--home .dash-filters .chip[aria-current="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.page--home .dash-filters .chip .ar { font-size: 13px; }
.page--home .dash-filters .dash-filters__field,
.page--home .dash-filters .dash-filters__mine,
.page--home .dash-filters .dash-filters__form .btn {
  display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; height: 32px; min-height: 0; margin: 0; padding: 0 10px;
  border: 1px solid var(--dash-line); border-radius: 8px; background: var(--surface); box-shadow: none;
  color: var(--dash-sub); font-size: 13px; font-weight: 400; line-height: 1.4;
}
.page--home .dash-filters .dash-filters__field { gap: 0; padding-inline-end: 0; cursor: pointer; }
.page--home .dash-filters .dash-filters__field:hover { border-color: var(--navy-200); }
.page--home .dash-filters .dash-filters__field:focus-within { border-color: var(--navy); box-shadow: var(--focus); }
/* inline-flex: no space is left before the ":" when the Arabic is hidden (Turkish). */
.page--home .dash-filters__field .field__label { display: inline-flex; align-items: baseline; gap: 0; margin: 0; color: inherit; font-size: 13px; font-weight: 400; white-space: nowrap; }
.page--home .dash-filters__field .field__label::after { content: ":"; }
.page--home .dash-filters__field .field__label .ar { margin: 0 0 0 .35em; padding: 0; color: var(--text-3); font-size: 13px; }
.page--home .dash-filters__field .field__label .ar::before { content: none; }
.page--home .dash-filters .dash-filters__field select {
  field-sizing: content; flex: 0 0 auto; width: auto; min-width: 0; max-width: 220px; height: 30px; margin: 0;
  padding: 0 26px 0 4px; border: 0; border-radius: 8px; background-color: transparent; box-shadow: none;
  color: var(--dash-sub); font-size: 13px; background-position: right 8px center; background-size: 12px;
}
.page--home .dash-filters .dash-filters__field select:focus { box-shadow: none; }
.page--home .dash-filters .dash-filters__form .btn { color: var(--navy); font-weight: 600; }
.page--home .dash-filters .dash-filters__form .btn .ar { color: var(--text-3); }
.page--home .dash-filters :is(.dash-filters__mine, .dash-filters__form .btn):hover { border-color: var(--navy-200); background: var(--navy-50); color: var(--navy); }

/* 3. Cards: white, 1px line, 12px radius, 16px inside; the title (15px) with its muted count
   or note on the right. */
.page--home .dash-split > .stage-card,
.page--home .dash-side > :is(.dash-action, .dash-at-port, .dash-arrivals, .dash-owners) {
  display: block; padding: 16px; border: 1px solid var(--dash-line); border-radius: 12px; background: var(--surface); box-shadow: none;
}
.page--home :is(.stage-card, .dash-action, .dash-at-port, .dash-arrivals, .dash-owners) > .card__header {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px;
  margin: 0 0 12px; padding: 0; border: 0; border-radius: 0; background: none;
}
.page--home :is(.stage-card, .dash-action, .dash-at-port, .dash-arrivals, .dash-owners) > .card__header > .card__title,
.page--home .dash-at-port .card__title {
  color: var(--dash-ink); font-size: 15px; font-weight: 700; line-height: 1.4; letter-spacing: 0;
}
.page--home :is(.stage-card, .dash-action, .dash-at-port, .dash-arrivals, .dash-owners) > .card__header .card__title .ar { color: var(--dash-mut); font-size: 13px; font-weight: 400; }
.page--home .stage-card__note { margin-inline-start: auto; color: var(--dash-mut); font-size: 13px; font-weight: 400; }
.page--home .card__header > .dash-total,
.page--home .card__header > .dash-total:not(:hover):not(.is-selected) {
  position: relative; display: inline; min-height: 0; margin: 0 0 0 auto; padding: 0;
  border: 0; border-radius: 0; background: none; box-shadow: none;
  color: var(--dash-mut); font-size: 13px; font-weight: 400; white-space: nowrap;
}
.page--home .card__header > .dash-total:is(:hover, .is-selected) { border: 0; background: none; box-shadow: none; color: var(--navy); text-decoration: underline; }
.page--home .card__header > .dash-total b { font-weight: 400; }
.page--home .card__header > .dash-total::before { content: none; }
.page--home .card__header > .dash-total::after { content: ""; position: absolute; inset: -12px -6px; }
.page--home .dash-side .dash-empty { margin: 0; }

/* 4. Orders by stage: a block per service (13px title), its tiles in one row when they fit
   (5 Sea, 4 Land / Air, 3 columns for the small block), else wrapping without cutting a name. */
.page--home .stage-board { display: grid; gap: 14px; }
.page--home .stage-group + .stage-group { padding-top: 0; border-top: 0; }
.page--home .stage-group__title {
  display: block; margin: 0 0 8px; color: var(--dash-sub); font-size: 13px; font-weight: 700; line-height: 1.4; letter-spacing: 0;
}
.page--home .stage-group__title .ar { margin-inline-start: .5em; color: var(--dash-mut); font-size: 13px; font-weight: 400; }
.page--home .pipeline {
  --cols: 3; --tile-min: 140px;  /* the longest English stage name (Customs clearance, 113px) + padding and edges */
  display: grid; gap: 8px; grid-auto-flow: row;
  grid-template-columns: repeat(auto-fill, minmax(max(var(--tile-min), calc((100% - (var(--cols) - 1) * 8px) / var(--cols) - 0.1px)), 1fr));
}
.page--home .pipeline:has(> .stage:nth-child(4)) { --cols: 4; }
.page--home .pipeline:has(> .stage:nth-child(5)) { --cols: 5; }
.page--home .pipeline:has(> .stage:nth-child(6)) { --cols: 6; }
.page--home .pipeline .stage {
  display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 0;
  grid-column: auto; min-width: 0; min-height: 0; padding: 8px 10px;
  border: 1px solid var(--dash-line); border-inline-start: 5px solid var(--tone); border-radius: 8px;
  background: var(--surface); box-shadow: none; color: var(--dash-ink);
}
.page--home .pipeline .stage:hover { border-color: var(--navy-200); border-inline-start-color: var(--tone); background: var(--surface-2); }
.page--home .stage--confirmed { --tone: #3E6FD1; --tone-text: #3E6FD1; }
.page--home .pipeline .stage__name { display: block; }
.page--home .pipeline .stage__step { display: none; }
.page--home .pipeline .stage__label,
.page--home .pipeline .stage.is-zero .stage__label {
  display: block; color: var(--tone-text, var(--tone)); font-size: 12px; font-weight: 600; line-height: 1.4; letter-spacing: 0; text-transform: none;
}
.page--home .pipeline .stage__label .ar { display: block; margin: 0; color: var(--dash-mut); font-size: 13px; font-weight: 400; line-height: 1.5; white-space: normal; }
.page--home .pipeline .stage .stage__figure { display: block; margin: 2px 0 0; }
.page--home .pipeline .stage .stage__main { display: block; }
.page--home .pipeline .stage .stage__count,
.page--home .pipeline .stage .stage__count.is-zero {
  display: block; width: auto; min-width: 0; min-height: 0; margin: 0;
  color: var(--dash-ink); font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: 0; text-align: start;
}
.page--home .pipeline .stage a.stage__count:hover { opacity: 1; }
.page--home .pipeline .stage .stage__orders,
.page--home .pipeline .stage .stage__service {
  display: block; align-self: auto; margin: 0; color: var(--dash-mut); font-size: 12px; font-weight: 400; line-height: 1.4;
}
.page--home .pipeline .stage .stage__orders .unit-count b { color: inherit; font-size: inherit; font-weight: inherit; }
.page--home .pipeline .stage .stage__orders .unit-count .ar { color: inherit; font-size: 12px; }
.page--home .pipeline .stage .stage__service .ar { color: inherit; font-size: 12px; }
/* The single Confirmed tile: each service with orders (its own link); its count only when there are two. */
.page--home .stage__parts .stage__part { position: relative; z-index: 1; color: inherit; }
.page--home .stage__parts .stage__part.is-zero,
.page--home .stage__parts--one .stage__part-count { display: none; }
.page--home .stage__parts .stage__part:not(.is-zero) ~ .stage__part:not(.is-zero)::before { content: "· "; }
.page--home .pipeline .stage .stage__alert {
  display: inline-block; align-self: flex-start; position: relative; z-index: 1;
  margin: 4px 0 0; padding: 1px 6px; border-radius: 8px;
  background: #FDECEA; color: var(--dash-red); font-size: 11px; font-weight: 400; line-height: 1.4; white-space: normal;
}
.page--home .stage-board__empty { margin: 0; padding: 0; color: var(--dash-mut); font-size: 13px; font-weight: 400; }

/* 5. Needs action today: a row per alert — its count in a coloured badge, the alert and
   the orders behind it, who acts on it on the right. */
.page--home .dash-action .buckets { display: block; gap: 0; padding: 0; border-radius: 0; background: none; }
.page--home .dash-action .bucket,
.page--home .dash-action .bucket + .bucket {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 10px; align-items: start;
  padding: 10px 0; border: 0; border-top: 1px solid var(--dash-line); border-radius: 0; background: none;
}
.page--home .dash-action .bucket:first-child { border-top: 0; }
.page--home .bucket--vendor_missing { --badge: var(--dash-red); }
.page--home .bucket--eta_passed { --badge: #0B6F64; }
.page--home .bucket--stuck { --badge: #9A4A00; }
.page--home .bucket--stale { --badge: #667085; }
.page--home .dash-action .bucket__head { display: contents; }
.page--home .dash-action .bucket__count,
.page--home .dash-action .bucket__count.is-zero {
  grid-column: 1; grid-row: 1 / span 3; position: relative;
  display: flex; align-items: center; justify-content: center; min-width: 34px; height: 26px; min-height: 0; padding: 0 6px;
  border-radius: 7px; background: var(--badge, #667085); color: #fff;
  font-size: 14px; font-weight: 700; line-height: 1; letter-spacing: 0;
}
.page--home .dash-action a.bucket__count:hover { opacity: .85; text-decoration: none; }
.page--home .dash-action a.bucket__count::after { content: ""; position: absolute; inset: -9px -5px; }
/* Sardar 25/10/2026: a Needs action count badge is red (an alert at 0 is unchanged). */
.page--home .dash-action .bucket__count:not(.is-zero) { background: var(--dash-red); }
.page--home .dash-action .bucket__label { grid-column: 2; grid-row: 1; color: var(--dash-ink); font-size: 14px; font-weight: 600; line-height: 1.4; }
.page--home .dash-action .bucket__label .ar { color: var(--dash-mut); font-size: 13px; font-weight: 400; }
.page--home .dash-action .bucket__who { grid-column: 3; grid-row: 1; padding-top: 2px; color: var(--dash-mut); font-size: 11px; line-height: 1.4; white-space: nowrap; }
.page--home .dash-action :is(.bucket__list, .bucket__clear) { grid-column: 2; grid-row: 2; }
.page--home .dash-action .bucket__more { grid-column: 2; grid-row: 3; }
.page--home .dash-action .bucket__list { display: block; margin: 0; padding: 0; list-style: none; color: var(--dash-mut); font-size: 12.5px; line-height: 1.45; }
.page--home .dash-action .bucket__list li { display: block; min-height: 0; padding: 0; border: 0; }
.page--home .dash-action .bucket__list .ng-link {
  display: inline; padding: 0; border: 0; border-radius: 0; background: none;
  color: var(--navy); font-family: inherit; font-size: inherit; font-weight: 600; letter-spacing: 0;
}
.page--home .dash-action .bucket__list a.ng-link:hover { background: none; color: var(--navy-900); text-decoration: underline; }
.page--home .dash-action .bucket__item { display: inline; }
.page--home .dash-action .bucket__reason { display: inline; overflow: visible; white-space: normal; color: inherit; font-size: inherit; }
.page--home .dash-action .bucket__list .tag { margin-inline-start: 4px; padding: 0 6px; font-size: 11px; line-height: 16px; vertical-align: 1px; }
.page--home .dash-action .bucket__more { display: inline-flex; align-items: center; gap: 2px; justify-self: start; min-height: 0; margin-top: 2px; font-size: 12.5px; font-weight: 600; }
.page--home .dash-action .bucket__more .icon { width: 12px; height: 12px; }
.page--home .dash-action .bucket__clear { display: block; margin: 0; color: var(--dash-mut); font-size: 12.5px; line-height: 1.45; }
.page--home .dash-action .bucket__clear .ar { color: inherit; font-size: 13px; }

/* 6. At port: mockup-local age tones on each day pill and its row bar. */
.page--home .dash-at-port .at-port__header { align-items: center; }
.page--home .at-port__heading { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.page--home .at-port__heading .card__title { margin: 0; }
.page--home .at-port__totals { color: var(--dash-mut); font-size: 13px; line-height: 1.4; }
.page--home .at-port__all {
  display: inline-flex; align-items: center; gap: 2px; margin-inline-start: auto;
  color: var(--navy); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.page--home .at-port__all .icon { width: 12px; height: 12px; }
.page--home .at-port__list { margin: 0; padding: 0; list-style: none; }
.page--home .at-port__row {
  --at-port-tone: #98A2B3;
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, .55fr) auto; gap: 6px 10px; align-items: center;
  position: relative; min-width: 0; padding: 9px 0 9px 10px;
  border-top: 1px solid var(--dash-line); font-size: 12.5px; line-height: 1.4;
}
.page--home .at-port__row:first-child { border-top: 0; }
.page--home .at-port__row::before {
  content: ""; position: absolute; inset-block: 10px; inset-inline-start: 0; width: 3px;
  border-radius: 2px; background: var(--at-port-tone);
}
.page--home .at-port__row--grey { --at-port-tone: #98A2B3; }
.page--home .at-port__row--amber { --at-port-tone: #F79009; }
.page--home .at-port__row--red { --at-port-tone: var(--dash-red); }
.page--home .at-port__ng {
  padding: 0; border: 0; border-radius: 0; background: none; color: var(--navy);
  font-family: inherit; font-size: inherit; font-weight: 700; letter-spacing: 0; white-space: nowrap;
}
.page--home .at-port__ng:hover { background: none; color: var(--navy-900); text-decoration: underline; }
.page--home .at-port__quantity { min-width: 0; color: var(--dash-sub); overflow-wrap: anywhere; }
.page--home .at-port__port { min-width: 0; color: var(--dash-mut); text-align: end; overflow-wrap: anywhere; }
.page--home .at-port__days {
  grid-column: -2 / -1; justify-self: end;
  display: inline-flex; align-items: center; justify-content: center; min-height: 26px; padding: 2px 9px;
  border: 1px solid var(--at-port-pill-border, #D0D5DD); border-radius: 999px;
  background: var(--at-port-pill-bg, #F2F4F7); color: var(--at-port-pill-text, var(--dash-sub));
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.page--home .at-port__days--grey {
  --at-port-pill-border: #D0D5DD; --at-port-pill-bg: #F2F4F7; --at-port-pill-text: #344054;
}
.page--home .at-port__days--amber {
  --at-port-pill-border: #FEDF89; --at-port-pill-bg: #FFF4E5; --at-port-pill-text: #9A4A00;
}
.page--home .at-port__days--red {
  --at-port-pill-border: #F9BEB8; --at-port-pill-bg: #FDECEA; --at-port-pill-text: var(--dash-red);
}

/* 7. Arrivals next 7 days: seven day boxes; today orange; the whole box opens that day. */
.page--home .dash-arrivals .days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.page--home .dash-arrivals .day,
.page--home .dash-arrivals .day--has {
  position: relative; display: block; min-width: 0; padding: 6px 2px;
  border: 1px solid var(--dash-line); border-radius: 8px; background: var(--surface);
  color: var(--dash-mut); font-size: 12px; text-align: center;
}
.page--home .dash-arrivals .day--today,
.page--home .dash-arrivals .day--today.day--has { border-color: var(--orange); background: var(--orange-50); }
.page--home .dash-arrivals .day__name,
.page--home .dash-arrivals .day--has .day__name { display: block; color: var(--dash-mut); font-size: inherit; font-weight: 400; line-height: 1.4; }
.page--home .dash-arrivals .day__num { display: none; }
.page--home .dash-arrivals .day__count,
.page--home .dash-arrivals .day--has .day__count,
.page--home .dash-arrivals .day__count.is-zero {
  display: block; width: auto; min-height: 0; color: var(--dash-ink); font-size: 18px; font-weight: 700; line-height: 1.25;
}
.page--home .dash-arrivals a.day__count::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.page--home .dash-arrivals a.day__count:hover { color: var(--navy); }
.page--home .dash-arrivals .card__note { margin: 8px 0 0; padding: 0; color: var(--dash-mut); font-size: 12px; }

/* 8. By owner: Sales / Operations (12px capitals), then one line per owner — the name, and on
   the right "6 orders · 2 need action" (red). */
.page--home .dash-owners > .page-header__eyebrow {
  display: block; margin: 10px 0 2px; padding: 0; color: var(--dash-mut);
  font-size: 12px; font-weight: 400; letter-spacing: .04em; line-height: 1.4; text-transform: uppercase;
}
.page--home .dash-owners > .card__header + .page-header__eyebrow { margin-top: 0; }
.page--home .dash-owners > .page-header__eyebrow .ar { color: inherit; font-size: 12px; letter-spacing: 0; }
.page--home .owner-list { margin: 0; padding: 0; list-style: none; }
.page--home .owner-list > li,
.page--home .owner-list > li + li {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px;
  padding: 7px 0; border-top: 1px solid var(--dash-line); color: var(--dash-ink); font-size: 13px; line-height: 1.4;
}
.page--home .owner-list__name, .page--home .owner-list__unmatched { flex: 0 1 auto; color: var(--dash-ink); font-size: 13px; font-weight: 400; overflow-wrap: anywhere; }
/* The counts stay on the name's line and wrap there, right-aligned. */
.page--home .owner-list__counts { display: block; flex: 1 1 10em; min-width: 0; margin-inline-start: auto; text-align: end; }
.page--home .owner-list__counts > :not(:last-child)::after { content: "\00a0· "; color: var(--dash-ink); white-space: normal; }
.page--home .owner-list a { display: inline; min-height: 0; color: var(--dash-ink); }
.page--home .owner-list a:hover { color: var(--navy); }
.page--home .owner-list .unit-count b { color: inherit; font-size: inherit; font-weight: inherit; }
.page--home .owner-list .unit-count .ar { color: var(--dash-mut); font-size: 12px; }
.page--home .owner-list a.owner-list__needs { flex-basis: auto; color: var(--dash-red); font-weight: 600; white-space: nowrap; }
.page--home .owner-list a.owner-list__needs .ar { color: inherit; font-size: 12px; font-weight: 500; }

/* 9. Two columns from 1200px: the board (1.5) and the side column (1), 14px apart. */
@media (min-width: 1200px) {
  .page--home .dash-split { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
}
/* KPIs two by two up to 760px: four bilingual cards do not fit side by side below that. */
@media (max-width: 760px) {
  .page--home .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .page--home .dash-service-chips { flex-wrap: wrap; overflow-x: visible; }
  .page--home .dash-service-chip { flex: 1 1 calc(33.333% - 6px); min-width: 104px; min-height: 44px; }
  .page--home .at-port__row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .page--home .at-port__quantity { grid-column: 1 / 3; grid-row: 2; }
  .page--home .at-port__port { grid-column: 2; grid-row: 1; }
  .page--home .at-port__days { grid-column: 3; grid-row: 1 / span 2; }
}
/* Phones (the 390 drawing): tiles two by two, smaller numbers and day boxes, no "Ops". */
@media (max-width: 600px) {
  .page--home .kpi-card .dash-kpi b { font-size: 24px; }
  .page--home .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page--home .dash-action .bucket__who { display: none; }
  .page--home .dash-arrivals .day, .page--home .dash-arrivals .day--has { font-size: 10px; }
  .page--home .dash-arrivals .day__count, .page--home .dash-arrivals .day--has .day__count,
  .page--home .dash-arrivals .day__count.is-zero { font-size: 15px; }
  .page--home .dash-filters .dash-filters__field select { max-width: 160px; }
}
/* Below the 390 drawing (320px phones): a little less side padding so "8 containers · حاويات ·" fits. */
@media (max-width: 380px) {
  .page--home .kpi-card { padding-inline: 12px; }
}

/* Dashboard visual QA (2026-10-14, dc7a4b2): side by side with dashboard-final.pdf.
   1. The five Sea tiles in one row at 1440 (beside the app sidebar the board is ~630px inside):
      a smaller tile minimum, and a stage name may break between its words on desktop too.
   2. Port / Border Clearance and Other Services: three tiles, one per service.
   3. Red tags name the role ("1 no port party"); all the tags of a tile are one link. The legend
      "Red tags = vendor not chosen" under the board.
   4. Filters in one row at 1440 (EN): All services, the seven services, Owner, Stage, Mine — the
      design's 13px chips, a little tighter; on phones they wrap two or three to a row.
   5. Needs action: one line per order; View all sits beside the orders, not under them. */
.page--home .pipeline { --tile-min: 92px; }
.page--home .pipeline .stage__label { white-space: normal; overflow-wrap: normal; }
.page--home .pipeline--services { --cols: 3; }
.page--home .stage--service .stage__part { position: relative; z-index: 1; color: inherit; text-decoration: none; }
.page--home .stage--service .stage__part:hover { text-decoration: underline; }
.page--home .stage--service .stage__part + .stage__part::before { content: "\00a0· "; color: var(--dash-mut); }
.page--home .stage--service .stage__part-count { font-weight: 700; }
.page--home .pipeline .stage .stage__alerts {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px;
  align-self: flex-start; margin: 4px 0 0; text-decoration: none;
}
.page--home .pipeline .stage .stage__alerts .stage__alert { margin: 0; }
.page--home .pipeline .stage .stage__alerts:hover .stage__alert { text-decoration: underline; }
.page--home .stage-board__legend { margin: 8px 0 0; color: var(--dash-mut); font-size: 12px; line-height: 1.4; }
.page--home .stage-board__legend .ar { margin-inline-start: .35em; color: inherit; font-size: 12px; }
.page--home .dash-filters { gap: 6px; }
.page--home .dash-filters .chip,
.page--home .dash-filters .dash-filters__mine { padding: 5px 8px; white-space: nowrap; }
.page--home .dash-filters .dash-filters__field { padding-inline-start: 8px; }
.page--home .dash-filters .dash-filters__field select { padding-inline-end: 20px; background-position: right 5px center; }
.page--home .dash-action .bucket__list li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page--home .dash-action .bucket__list .bucket__reason { white-space: nowrap; }
.page--home .dash-action .bucket__more { grid-column: 3; grid-row: 2; justify-self: end; margin-top: 0; white-space: nowrap; }
@media (max-width: 600px) {
  .page--home .dash-filters .dash-filters__field { flex: 0 0 auto; }
  .page--home .dash-action .bucket__more { grid-column: 2; grid-row: 3; justify-self: start; }
}

/* =====================================================================
   New order — design match (2026-10-14): the approved mockup, left half of
   design/preview-review-pr95-2026-10-14/sbs-1a3bf7f/sbs-team-delivery-city-new-sea-1440.png
   (source design/new-order-simplify-2026-10-13/src/proposed-sea.html), at 1440 and 390.
   Visual only, scoped to the order form; names, ids, values, data-* hooks and texts unchanged.
   - Form column 880px (was 1044px): the cards stop short of the page edge, as in the mockup.
   - Header (desktop): the title in a tighter band (24px like every page title since the design tidy T-G4).
   - Service: one compact segmented group. The English name leads (13px), the Arabic is a quieter
     12px line under it (never hidden), so the seven services fit one row at 1440; where they do not
     (phones, the longer Turkish names) the group wraps into full rows.
   - Containers / Trucks: Quantity · type · ✕ on one row (mockup 110px · 1fr · 40px), on phones too;
     the column labels once, above the first row; the builder's own title (= the step title) is read
     out, not shown; "Add" as wide as its text.
   - Team: one row, each label beside its select ("Team  Sales [You] · Ops [Select…]"); on phones
     the title, then Sales and Ops side by side.
   - LCL (order page): Number of packages and Package type on the row of Weight and CBM — in All
     order details and in the "On the sea way" panel (op_panel_card renders the optional packages
     in its details grid, after the CBM).
   ===================================================================== */
.order-page--new .op-layout { grid-template-columns: minmax(0, 880px); }
.order-page--new > .alert { max-width: 880px; }
@media (min-width: 1101px) {
  .order-page--new .op-head { padding-block: 16px 14px; margin-bottom: 18px; }
  .order-page--new .op-head .page-header__eyebrow { margin-bottom: 4px; }
  .order-page--new .op-head .page-title > .ar { font-size: 18px; }
}
/* Route (Land): From → To holds two inputs, so its column is a little wider. */
@media (min-width: 761px) {
  .order-page--new .order-form .op-step--route .op-step__body:has(> .op-part:not([hidden]) [data-main-land-details]:not([hidden]) [data-route-from-to]) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr);
  }
}
/* Service: segmented group; 1px seams drawn by the group's background between white segments. */
.order-page--new .order-form .op-choices {
  display: inline-flex; flex-wrap: wrap; gap: 1px; align-self: flex-start; max-width: 100%;
  border: 1px solid var(--border-strong); border-radius: 8px; background: var(--border-strong); overflow: hidden;
}
.order-page--new .order-form .op-choice { display: flex; flex: 1 1 auto; min-width: 0; }
.order-page--new .order-form .op-choice > span {
  display: flex; flex: 1 1 auto; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 40px; padding: 4px 12px; border: 0; border-radius: 0; background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.25; text-align: center;
}
.order-page--new .order-form .op-choice .ar { margin: 0; color: var(--op-muted); font-size: 12px; font-weight: 500; line-height: 1.3; }
.order-page--new .order-form .op-choice:hover > span { background: var(--surface-2); }
/* Selected: a real 2px border (kept in forced-colours mode), the padding 2px less so nothing moves. */
.order-page--new .order-form .op-choice input:checked + span {
  padding: 2px 10px; border: 2px solid var(--navy); background: #EEF2FA; color: var(--navy);
}
.order-page--new .order-form .op-choice input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: -4px; }
/* Forced colours paint a backplate behind each text line: room so the Arabic one leaves the English descenders. */
@media (forced-colors: active) { .order-page--new .order-form .op-choice > span { gap: 4px; } }
.order-page--new .order-form .op-choice input:disabled + span { cursor: not-allowed; opacity: .6; }
.order-page--new .order-form .op-choices-field.field--error .op-choices { border-color: var(--danger); }
/* Containers / Trucks: one row per unit, no box around it. */
.order-page--new .order-form .op-step--load .transport-builder > .field__label,
.order-page--new .order-form .op-step--load .repeat-row + .repeat-row .field__label,
.order-page .order-form .transport-builder:has(> .repeat-list > .repeat-row--package) > .field__label,
.order-page .order-form .repeat-row--package + .repeat-row--package .field__label {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.order-page--new .order-form .op-step--load .repeat-list { gap: 8px; }
.order-page--new .order-form .op-step--load .repeat-row {
  grid-template-columns: 110px minmax(0, 1fr) 40px; gap: 10px; align-items: end; padding: 0; border: 0; border-radius: 0;
}
.order-page--new .order-form .op-step--load .repeat-row .repeat-remove,
.order-page .order-form .repeat-row--package .repeat-remove { justify-self: center; color: var(--op-muted); }
.order-page--new .order-form .op-step--load .repeat-row .repeat-remove:hover,
.order-page .order-form .repeat-row--package .repeat-remove:hover { color: var(--danger); }
.order-page--new .order-form .op-step--load [data-repeat-add],
.order-page .order-form .transport-builder:has(> .repeat-list > .repeat-row--package) > [data-repeat-add] { align-self: flex-start; }
/* Team: one row. */
.order-page--new .order-form .op-team { gap: 8px 16px; padding: 12px 18px; }
.order-page--new .order-form .op-team__fields { flex: 1 1 auto; gap: 8px 12px; }
.order-page--new .order-form .op-team__fields > .field { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.order-page--new .order-form .op-team__fields > .field > .field__label { flex: none; white-space: nowrap; }
.order-page--new .order-form .op-team__fields select { flex: 0 1 auto; width: auto; min-width: 120px; max-width: 100%; }
/* A refused save: Sales and Ops one under the other, each message under its select. */
.order-page--new .order-form .op-team__fields:has(.field--error) { flex-direction: column; align-items: flex-start; }
.order-page--new .order-form .op-team__fields:has(.field--error) .op-team__sep { display: none; }
@media (min-width: 761px) {
  .order-page--new .order-form .op-team__fields select { height: var(--ctl-sm); padding-inline-start: 10px; font-size: 13px; }
}
/* Create order / Cancel as in the mockup: the primary at its text width, Cancel a bordered button. */
.order-page--new .order-form .form-actions .btn--primary { min-width: 0; padding-inline: 16px; }
.order-page--new .order-form .form-actions .btn--ghost { border-color: var(--border-strong); background: var(--surface); }
.order-page--new .order-form .form-actions .btn--ghost:hover { background: var(--surface-2); }
/* LCL: Weight | CBM | Number of packages · Package type · ✕ on one row (desktop). */
.order-page .order-form .repeat-row--package {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 10px; padding: 0; border: 0; border-radius: 0;
}
.order-page .order-form .repeat-row--package > label { display: flex; flex-direction: column; gap: 6px; }  /* as .field: inputs in line with Weight / CBM */
@media (min-width: 761px) {
  .order-page .order-form .form-grid > .measurement-grid { grid-column: 1 / -1; }
  /* Columns sized to their 13px labels, so each stays one line and the inputs line up. */
  .order-page .order-form .measurement-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 4fr) minmax(0, 8fr); gap: 14px 16px; align-items: start; }
  .order-page .order-form .measurement-grid > .transport-builder { grid-column: auto; }
  .order-page .order-form .measurement-grid > .transport-builder:only-child { grid-column: 1 / -1; }
  .order-page .order-form .op-grid--details:has(> [data-sea-lcl]) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .order-page .order-form .op-grid--details:has(> [data-sea-lcl]) > * { grid-column: span 2; }
  .order-page .order-form .op-grid--details > [data-sea-lcl]:has(#f-sea_weight_kg) { grid-column: 1 / span 1; }
  .order-page .order-form .op-grid--details > [data-sea-lcl]:has(#f-sea_volume_cbm) { grid-column: 2 / span 1; }
  .order-page .order-form .op-grid--details > [data-sea-lcl]:has([data-repeatable="cargo"]) { grid-column: 3 / span 2; }
}
/* Phones: the unit rows stay one row (the ✕ is a 44px target there); "Add" full width, its text may wrap. */
@media (max-width: 760px) {
  /* Quantity gives way first on small phones (up to 104px), so the type keeps "Select type…" readable. */
  .order-page--new .order-form .op-step--load .repeat-row { grid-template-columns: minmax(48px, 104px) minmax(134px, 1fr) 44px; }
  .order-page--new .order-form .op-step--load [data-repeat-add],
  .order-page .order-form .transport-builder:has(> .repeat-list > .repeat-row--package) > [data-repeat-add] {
    align-self: stretch; flex-wrap: wrap; row-gap: 2px; height: auto; padding-block: 6px; line-height: 1.3; white-space: normal;
  }
  .order-page .order-form .repeat-row--package { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
}
/* LCL panel on phones: Weight | CBM side by side where both labels fit one line (from 375px). */
@media (min-width: 375px) and (max-width: 760px) {
  .order-page .order-form .op-grid--details:has(> [data-sea-lcl]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-page .order-form .op-grid--details:has(> [data-sea-lcl]) > * { grid-column: 1 / -1; }
  .order-page .order-form .op-grid--details > [data-sea-lcl]:has(#f-sea_weight_kg) { grid-column: 1; }
  .order-page .order-form .op-grid--details > [data-sea-lcl]:has(#f-sea_volume_cbm) { grid-column: 2; }
}
/* Team on phones: the title, then Sales | Ops side by side (label over select). */
@media (max-width: 600px) {
  .order-page--new .order-form .op-team__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex-basis: 100%; gap: 10px; }
  .order-page--new .order-form .op-team__sep { display: none; }
  .order-page--new .order-form .op-team__fields > .field { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .order-page--new .order-form .op-team__fields select { width: 100%; min-width: 0; }
}

/* Desktop v3x (approved 14/10/2026). Top bar (1101-1279px): Accounting and Settings are their own group,
   after a divider (the sidebar above 1280px and the phone menu already draw it). */
@media (min-width: 1101px) and (max-width: 1279.98px) {
  .main-nav > .nav-divider:not(:last-of-type) { display: block; flex: none; width: 1px; height: 22px; margin: 0 8px; background: rgba(255, 255, 255, 0.22); }
}
/* Confirmed: Order setup (Service and Scope as chips) and the Team (Sales, Operations, Follower). */
.order-page .op-group--first { padding-top: 0; border-top: 0; }
.order-page .op-setup { display: grid; gap: 14px; margin-bottom: 4px; }
.order-page .op-choices--chips, .order-page .op-choices-field--chips .op-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.order-page .op-choices-field--chips .op-choice { position: relative; display: inline-flex; cursor: pointer; }
.order-page .op-choices-field--chips .op-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.order-page .op-choices-field--chips .op-choice > span, .order-page .op-chip-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid #C9D2DF; border-radius: 999px;
  background: #fff; color: #344054; font: inherit; font-size: 12px; font-weight: 600; line-height: 1.3; cursor: pointer;
}
.order-page .op-choices-field--chips .op-choice input:checked + span, .order-page .op-chip-btn[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.order-page .op-choices-field--chips .op-choice input:checked + span::before, .order-page .op-chip-btn[aria-pressed="true"]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.order-page .op-choices-field--chips .op-choice input:focus-visible + span, .order-page .op-chip-btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.order-page .op-chip-btn:disabled { cursor: default; opacity: .7; }
.order-page .op-scope { display: grid; gap: 6px; margin: 0; }
.order-page .op-scope:has(> .op-choices--chips:not([hidden])) > .op-scope__select select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.order-page .op-scope:has(> .op-choices--chips:not([hidden])) > .op-scope__select { gap: 6px; }
.order-page .op-grid--team { margin-top: 2px; }
.order-page .op-team__hint { margin-top: -8px; }
.order-page .op-na { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--text); font-size: 13px; cursor: pointer; }
.order-page .op-na input { width: 16px; height: 16px; min-height: 0; }
.order-page .op-foot__free { margin-inline-start: auto; color: var(--op-muted); font-size: 12px; }
/* Cost Statement (desktop v3x p07): Stage · Vendor (role above the name) · Charge type · Currency · Amount,
   then Total USD · Total IQD · Lines · Missing. */
.page--statement .statement__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 16px; border-bottom: 1px solid var(--border, #E4E7EC); }
.page--statement .statement__head .card__title { margin: 0; font-size: 15px; }
.page--statement .statement__head .card__title .ar { margin-inline-start: 6px; color: var(--text-muted, #667085); font-size: 12px; font-weight: 500; }
.page--statement .statement__tag { padding: 3px 9px; border-radius: 999px; background: #EEF2F6; color: #344054; font-size: 11px; font-weight: 600; }
.page--statement .line-stage { color: var(--text); font-size: 13px; white-space: nowrap; }
.page--statement .line-heading__stage { font-weight: 700; }
.page--statement .line-vendor__role { display: block; color: var(--text-muted, #667085); font-size: 11px; }
.page--statement .line-desc__text { font-size: 13px; }
.page--statement .statement__sums { display: flex; flex-wrap: wrap; gap: 8px 48px; margin: 0; }
.page--statement .statement__sum { display: grid; gap: 2px; }
.page--statement .statement__sum dt { color: var(--text-muted, #667085); font-size: 11px; }
.page--statement .statement__sum dd { margin: 0; font-weight: 700; }
.page--statement .statement__sum--missing dd { color: var(--danger); }

/* Gap A4: "Missing data" on a Completed order that lacks required data
   (Completed orders list, the dashboard's Completed card, the order page). */
.badge.badge--missing,
.page--orders .data--orders .badge.badge--missing {
  --tone: var(--danger); --tone-text: var(--danger); --tone-bg: var(--danger-bg); --tone-bd: var(--danger-bd);
  background: var(--danger-bg); border-color: var(--danger-bd); color: var(--danger);
}
.dash-kpi__sub .badge--missing { margin-inline-end: 2px; height: auto; max-width: 100%; flex-wrap: wrap; white-space: normal; }
.dash-kpi__sub[data-missing-data] { max-width: 100%; }
[data-closed-missing] .badge--missing { margin-inline-end: 6px; }
.os-missing { margin: 0; padding: 0 26px 18px; font-size: 14px; color: var(--text-2); }
/* QA P1-1: the Completed stage card of an order with missing data (amber, not green). */
/* QA P1-2: on the Completed orders list the badge wraps under the status, never over Commodity. */
.col-status .status-stack { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 100%; }
.col-status .status-stack .badge { max-width: 100%; height: auto; white-space: normal; flex-wrap: wrap; }

/* Gap D1: New order Team as one text line, "Change" opens the selects (design entry-sea). */
.order-page--new .op-team__summary { flex: 1 1 auto; margin: 0; font-size: 14px; }
.order-page--new .op-team__summary b { font-weight: 700; }
.order-page--new .order-form .op-team__summary .op-team__sep { display: inline; }
.order-page--new .op-team__change { flex: 1 1 100%; order: 3; }
.order-page--new .op-team__change > summary { position: absolute; inset-inline-end: 18px; top: 14px; color: var(--navy); font-weight: 600; cursor: pointer; list-style: none; }
.order-page--new .op-team__change > summary::-webkit-details-marker { display: none; }
.order-page--new .op-team__change[open] > .op-team__fields { margin-top: 10px; }
.order-page--new .op-team { position: relative; padding-inline-end: 90px; }
/* Gap D8: the port service provider of an old order without a port, de-emphasised. */
.port-picker__provider--quiet .field__label { color: var(--text-3); font-weight: 500; }
.port-picker__provider-hint { color: var(--text-4); font-size: 12px; font-weight: 400; }
/* Gap D2: the design's hint lines under New order fields. */
.order-page--new [data-hint-line] { display: block; margin-top: 4px; color: var(--text-4); font-size: 12px; }
.order-page--new [data-hint-line] .ar { color: inherit; }

/* =====================================================================
   Design tidy of the PR #98 order screens (SPEC-tidy-pr98, Sardar 15/10 21:38: «خلي يرتب التصميم شوية»):
   New order, Edit and View at 1440 and 390. One rhythm and heading scale, the ⓘ on the label line,
   a sticky Create / Save bar, the stage card's vendors before its charges, one "required to close this
   stage" look. Visual only: the controls, their names and every rule are unchanged.
   ===================================================================== */
/* T-G1: 16px between the top-level cards. */
.order-page .op-form > .card, .order-page .op-main > .card { margin: 0 0 16px; }
/* T-G2: card bodies 16px 20px (14px on phones); heads on the same 20px edge. */
.order-page .card__body, .order-page .form-section .card__body,
.order-page--new .op-step .card__body, .order-page--new .op-step__body, .order-page--new .op-team__body,
.order-page .op-panel__body, .order-page .op-facts, .order-page .op-steps, .order-page .order-more__body { padding: 16px 20px; }
.order-page--new .op-step .op-step__body .card__body { padding: 0; }  /* a part inside a step: the step pads it */
.order-page .op-card__head, .order-page .op-step .form-section__head, .order-page .op-step__head, .order-page .op-part__head,
.order-page .order-more > summary, .order-page .form-section__head { padding-inline: 20px; }
.order-page .op-chips { padding: 12px 20px; }
.order-page .op-panel__foot { padding: 0 20px 16px; }
.order-page .order-more__body > .op-sub { margin: 0; }
.order-page .order-more__body { row-gap: 12px; }
/* The sub-sections let their ⓘ text out (it hangs below its label); their edge and head keep the corners. */
.order-page .form-section { overflow: visible; }
.order-page .op-sub > .form-section__head { border-radius: 7px 7px 0 0; }
.order-page .op-sub:not([open]) > .form-section__head { border-radius: 7px; }
.order-page .form-section::before { border-start-start-radius: 7px; border-end-start-radius: 7px; }

/* T-G3: ⓘ after the label, on its line; the text opens below the label. */
.order-page .field:has(> details.field-help) { flex-direction: row; flex-wrap: wrap; align-items: center; align-content: flex-start; column-gap: 0; }
.order-page .field:has(> details.field-help) > * { order: 2; flex: 1 1 100%; min-width: 0; }
.order-page .field:has(> details.field-help) > :is(.field__label, .field__label-for) { order: 0; flex: 0 1 auto; max-width: calc(100% - 40px); }
.order-page .field:has(> details.field-help) > details.field-help { order: 1; flex: 0 0 auto; }
.order-page details.field-help { position: relative; display: inline-flex; align-items: center; margin: 0; padding: 0; background: none; color: var(--text-3); font-size: 12px; }
.order-page details.field-help[open] { padding: 0; background: none; }
.order-page details.field-help > summary {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  margin-inline-start: 6px; padding: 0 2px; color: var(--text-3); font-size: 13px; line-height: 1; cursor: pointer; list-style: none;
}
.order-page details.field-help > summary::-webkit-details-marker { display: none; }
.order-page details.field-help > .field-help__pop {
  position: absolute; top: 100%; inset-inline-start: 0; z-index: 30; display: grid; gap: 2px;
  width: max-content; max-width: 320px; margin-top: 4px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px; background: #F3F6FA; box-shadow: 0 6px 16px rgba(15, 24, 48, .10);
  color: #526079; font-size: 12px; font-weight: 400; line-height: 1.45; white-space: normal;
}
.order-page details.field-help > .field-help__pop > * { margin: 0; }
/* Section help: in the head, just before the chevron (a 28px slot is kept free there). */
.order-page .form-section > details.section-help { position: absolute; top: 12px; inset-inline-end: 44px; z-index: 2; margin: 0; }
.order-page .form-section > details.section-help > .field-help__pop { inset-inline-start: auto; inset-inline-end: 0; }

/* T-G4: heading scale. L1 page title · L2 card title · L3 sub-section · L4 group label. */
.order-page .op-head .page-title { font-size: 24px; font-weight: 700; }
.order-page :is(.form-section__title, .op-card__title, .op-panel__title, .op-team__title, .order-more__title, .card__title) {
  font-size: 16px; font-weight: 700;
}
.order-page :is(.form-section__title, .op-card__title, .op-panel__title, .op-team__title, .order-more__title, .card__title) > .ar {
  margin: 0; color: var(--text-3); font-size: 14px; font-weight: 500;
}
.order-page :is(.op-sub .form-section__title, .order-more__body .card__title) { font-size: 14px; font-weight: 700; }
.order-page :is(.op-sub .form-section__title, .order-more__body .card__title) > .ar { font-size: 13px; font-weight: 500; }
.order-page .op-group { color: var(--navy); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.order-page .op-group .ar { display: inline-block; margin-inline-start: 4px; color: var(--navy); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
/* T-B1: badges EN then AR. */
.order-page .op-tag { column-gap: 6px; }
.order-page .op-tag .ar, .order-page .op-card__head .op-tag .ar { margin: 0; color: inherit; font-size: 11px; font-weight: 600; }
/* T-M4: a numbered title keeps its Arabic on its line; it wraps as a whole only when it must. */
.order-page .form-section__title, .order-page .order-more__title, .order-page .op-team__title {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px;
}
.order-page .form-section__title > .ar, .order-page .order-more__title > .ar { display: inline; white-space: nowrap; }
.order-page .form-section__title > :is([data-sea-fcl], [data-sea-lcl]):not([hidden]) { display: contents; }
.order-page .form-section__title > :is([data-sea-fcl], [data-sea-lcl]) > .ar { display: inline; white-space: nowrap; }
.order-page :is(.form-section__title, .order-more__title, .op-team__title) > .op-num { align-self: center; }

/* T-G5: every collapsible head: the chevron at the far end (16px), the ⓘ slot just before it. */
.order-page summary.form-section__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.order-page summary.form-section__head > .form-section__title { flex: 0 1 auto; }
.order-page summary.form-section__head > .form-section__chev,
.order-page summary.order-more__head > .order-more__chev { order: 3; flex: none; width: 16px; height: 16px; margin-inline-start: auto; color: var(--text-3); }
.order-page .form-section:has(> details.section-help) > summary.form-section__head::after { content: ""; order: 2; flex: none; width: 28px; margin-inline-start: auto; }
.order-page .form-section:has(> details.section-help) > summary.form-section__head > .form-section__chev { margin-inline-start: 0; }

/* T-G6: hint lines: the English line, then the Arabic line. */
.order-page :is(.field__hint, .form-hint, .op-help) { font-size: 12px; line-height: 1.45; color: var(--text-3); }
.order-page .field__hint { display: grid; gap: 2px; }
.order-page :is(.field__hint, .form-hint, .op-help, .port-picker__tip) .ar { display: block; width: fit-content; max-width: 100%; margin: 2px 0 0; color: inherit; font-size: 12px; }
.order-page .port-picker__tip { line-height: 1.45; }

/* T-N1: Team is step 5, headed like steps 1-4; its line and "Change" share one row in the body. */
.order-page--new .order-form .op-team.op-team--line { display: block; padding: 0; }
.order-page--new .op-team__body { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-inline-end: 120px; }
.order-page--new .op-team__change > summary { top: 16px; inset-inline-end: 20px; }
.order-page--new .op-team__change > summary .ar { margin-inline-start: 4px; font-size: 12px; font-weight: 500; }
/* T-N2 / T-N3: step 6 "Service details" with its info box as the first line. */
.order-page .order-more__title > .op-num { margin-inline-end: 2px; }
.order-page--new .order-more__body > .op-new-note { margin: 0 0 4px; }  /* + the body's 12px row gap = 16px */
/* T-N5: port charges in 3 columns on wide screens. */
@media (min-width: 1200px) {
  .order-page .op-checks__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; row-gap: 8px; }
}
@media (min-width: 761px) and (max-width: 1199.98px) {
  .order-page .op-checks__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; row-gap: 8px; }
}
/* In the stage card the boxes sit two side by side: two columns of charges there. */
@media (min-width: 761px) {
  .order-page .op-grid--charges .op-checks__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* T-N6 / T-E2: the Create / Save bar stays on screen (sticky to the bottom of the form). */
.order-page .order-form .form-actions {
  position: sticky; bottom: 0; z-index: 20; display: flex; flex-wrap: nowrap; align-items: center; gap: 12px;
  width: auto; margin: 16px -20px 0; padding: 12px 20px;
  border: 0; border-top: 1px solid var(--border); border-radius: 0; background: #fff; backdrop-filter: none;
  box-shadow: 0 -4px 12px rgba(15, 24, 48, .06);
}
.order-page .order-form .form-actions .btn { height: 44px; }
.order-page .order-form .form-actions .btn--primary { min-width: 0; padding-inline: 16px; }
.order-page .order-form .form-actions .btn--ghost { border: 1px solid var(--border-strong); background: var(--surface); }
.order-page .order-form .form-actions .btn--ghost:hover { background: var(--surface-2); }
.order-page .order-form .form-actions__note { display: flex; flex-wrap: wrap; gap: 0 4px; margin-inline-start: auto; color: var(--text-3); font-size: 12px; }

/* T-E3: the Edit page header is a white card like the View page's. */
.order-page:not(.order-page--new):not(.order-page--view) .order-form-header.op-head {
  align-items: center; margin: 0 0 16px; padding: 16px 20px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: none; clip-path: none;
}
.order-page:not(.order-page--new):not(.order-page--view) .order-form-header.op-head::before { content: none; }
.order-page:not(.order-page--new):not(.order-page--view) .order-form-header.op-head > .page-actions { margin-inline-start: auto; }

/* T-E1: the stage card: vendors in two columns, then the charges boxes side by side. */
.order-page .op-grid--vendors, .order-page .op-grid--charges { gap: 16px 24px; }
.order-page .op-grid--charges > .op-field { min-width: 0; }
/* T-B2j: the Port costs switch, EN then AR in the same pill. */
.order-page .op-seg__opt .op-seg__txt span { display: inline; padding: 0; border: 0; background: none; color: inherit; font: inherit; }
.order-page .op-seg__opt .op-seg__txt span::before { content: none; }
.order-page .op-seg__opt .op-seg__txt .ar { margin-inline-start: 4px; font-size: 12px; font-weight: 500; }
@media (max-width: 640px) {
  /* Phones: the Arabic under the English inside each pill, the dot beside both. */
  .order-page .op-seg__opt > .op-seg__txt { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 6px; text-align: start; }
  .order-page .op-seg__opt > .op-seg__txt::before { grid-column: 1; grid-row: 1 / span 2; }
  .order-page .op-seg__opt > .op-seg__txt > :first-child { grid-column: 2; grid-row: 1; }
  .order-page .op-seg__opt > .op-seg__txt > .ar { grid-column: 2; grid-row: 2; justify-self: left; margin: 0; }
}
/* New order: the port is chosen under Route, so the switch has the row to itself (one line). */
.order-page .port-picker__pod:has(> [data-pod-own][hidden]) > .op-mode { grid-column: 1 / -1; }
/* T-B2c / T-B2e: Arabic beside the stage state and Close stage texts. */
.order-page .op-state .ar, .order-page .op-panel__foot .ar, .order-page .op-close .ar { font-size: 12px; font-weight: 500; color: inherit; }
.order-page .op-close .ar { margin-inline-start: 2px; }
.order-page .op-close { max-width: 100%; height: auto; min-height: 40px; padding-block: 8px; white-space: normal; text-align: start; line-height: 1.35; }
/* T-B2h: the Shipment card's labels, the Arabic as a second line. */
.order-page .op-fact dt { display: grid; }
.order-page .op-fact__ar { justify-self: start; margin: 0; color: var(--text-3); font-size: 11px; line-height: 1.35; }
/* T-V2: Chosen in earlier stages. */
.order-page .op-chips { gap: 8px; }
.order-page .op-chip { padding: 4px 10px; font-size: 12px; }

/* T-R1: the current stage is the one orange box. */
.order-page .op-panel--current { border: 2px solid var(--orange); border-radius: 10px; }
/* T-R2: what closes the stage, one look in the stage card and in All order details: an orange start
   rule; still empty after a save (.field--missing): red label, red border and the helper line. */
.order-page .field--stage,
.order-page .op-panel [data-op-slot][data-op-kind]:not([data-op-later]),
.order-page .op-panel .op-ro:has(.op-state__req) { box-shadow: inset 3px 0 0 var(--orange); padding-inline-start: 10px; }
.order-page .field--stage .field__label { color: var(--label); }
.order-page .op-panel .field--stage .field__label { color: var(--op-label); }
.order-page .field--stage :is(input, select):not([disabled]):not([aria-invalid="true"]) { border-color: var(--border-strong); background-color: var(--surface); }
.order-page .field--missing .field__label { color: var(--danger); }
.order-page .field--missing > :is(input, select):not([disabled]),
.order-page .field--missing > .date-field > input.date-field__input:not([disabled]),
.order-page .field--missing select:not([disabled]) { border-color: var(--danger); }
.order-page .stage-help, .order-page .stage-help > span { display: none; }
.order-page .stage-help { margin: 0; font-size: 12px; line-height: 1.45; }
.order-page .stage-help .ar { margin: 0; font-size: 12px; color: inherit; }
.order-page .field--stage.field--missing > .stage-help,
.order-page .field--stage.field--missing > .stage-help > .stage-help__req { display: block; color: var(--danger); }
.order-page .field--stage:not(.field--missing):is(:has(select option:checked:not([value=""])), :has(input[placeholder]:not([type="hidden"]):not(:placeholder-shown))) > .stage-help,
.order-page .field--stage:not(.field--missing):is(:has(select option:checked:not([value=""])), :has(input[placeholder]:not([type="hidden"]):not(:placeholder-shown))) > .stage-help > .stage-help__ok { display: block; color: #15803D; }

/* Phones (≤760px). */
@media (max-width: 760px) {
  .order-page .card__body, .order-page .form-section .card__body,
  .order-page--new .op-step .card__body, .order-page--new .op-step__body, .order-page--new .op-team__body,
  .order-page .op-panel__body, .order-page .op-facts, .order-page .op-steps, .order-page .order-more__body { padding: 14px; }
  .order-page--new .op-step .op-step__body .card__body { padding: 0; }
  .order-page .op-card__head, .order-page .op-step .form-section__head, .order-page .op-step__head, .order-page .op-part__head,
  .order-page .order-more > summary, .order-page .form-section__head { padding-inline: 14px; }
  .order-page .op-chips { padding: 12px 14px; }
  .order-page .op-panel__foot { padding: 0 14px 14px; }
  .order-page .form-section > details.section-help { inset-inline-end: 38px; }
  .order-page--new .op-team__body { padding-inline-end: 110px; }
  .order-page--new .op-team__change > summary { top: 14px; inset-inline-end: 14px; }
  .order-page .op-checks__grid { grid-template-columns: minmax(0, 1fr); }
  .order-page .op-close { min-height: 44px; }
  /* T-M1: the page header scrolls away (the top bar stays); title 20px, Arabic 16px, the NG beside it when it fits. */
  .order-page .op-head { position: static; }
  .order-page .op-head .page-title { font-size: 20px; }
  .order-page .op-head .page-title > .ar { font-size: 16px; }
  .order-page .op-head .form-header-ng { display: inline-flex; margin: 0; }
  .order-page:not(.order-page--new):not(.order-page--view) .order-form-header.op-head { flex-wrap: nowrap; align-items: flex-start; margin: 0 0 14px; padding: 14px; }
  .order-page:not(.order-page--new):not(.order-page--view) .order-form-header.op-head > .op-head__main { flex: 1 1 auto; min-width: 0; }
  /* T-N6 / T-E2 / T-M2: the bar fills the width, Create / Save 2 : Cancel 1; the form keeps room under its last field. */
  .order-page .order-form .form-actions {
    gap: 8px; margin-inline: calc(-1 * var(--gutter)); padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }
  .order-page .order-form .form-actions > .btn--primary { flex: 2 1 0; min-width: 0; }
  .order-page .order-form .form-actions > .btn--ghost { flex: 1 1 0; min-width: 0; }
  .order-page .order-form .form-actions__note { display: none; }
  .order-page .order-form { padding-bottom: 88px; }
  /* T-M5: tap targets. */
  .order-page details.field-help > summary { min-width: 32px; min-height: 32px; margin-inline-start: 0; }
  /* Design P1-1 (VISUAL-tidy-581d3f1): an open ⓘ popover is a full-width bar above the sticky bar,
     never anchored at the icon (it ran off the 390px screen and scrolled the page sideways). */
  .order-page details.field-help > .field-help__pop,
  .order-page .form-section > details.section-help > .field-help__pop {
    position: fixed; top: auto; left: 12px; right: 12px; bottom: 88px; inset-inline-start: 12px; inset-inline-end: 12px;
    width: auto; max-width: none; margin: 0; z-index: 40;
  }
  .order-page .op-check, .order-page .port-chip { min-height: 36px; align-items: center; }
}

/* =====================================================================
   Next round (Sardar 16/10 00:45): Design P2s of the final tidy check
   581d3f1, the Edit page cleanup and the Accounting status badge.
   ===================================================================== */
/* A2a: the role line under the Shipping agency / Origin agent label. */
.order-page .field__sub { display: block; margin: 1px 0 0; color: var(--text-3); font-size: 11px; font-weight: 500; letter-spacing: normal; text-transform: none; }
.order-page .field__sub .ar { margin: 0; font-size: 11px; color: inherit; }
/* A2d: a land leg of the provider rows, its own line under the Land transport controls. */
.order-page .land-leg-lines { margin-top: 12px; }
/* A1.5 (Design P2-5): every filled field that closes the stage shows the green helper, also a
   text input without a placeholder (app.js wireStageFilled sets .field--filled). */
.order-page .field--stage.field--filled:not(.field--missing) > .stage-help,
.order-page .field--stage.field--filled:not(.field--missing) > .stage-help > .stage-help__ok { display: block; color: #15803D; }
@media (max-width: 760px) {
  /* A1.1 (Design P2-1): the Main service component badge takes its own row under the title;
     the title, the ⓘ slot and the chevron stay on the first row. */
  .order-page summary.form-section__head { flex-wrap: wrap; }
  .order-page summary.form-section__head > [data-main-component-badge] { flex-basis: 100%; order: 4; justify-content: flex-start; width: fit-content; max-width: 100%; }
  /* A1.2 (Design P2-2, T-M5): tap targets — ⓘ 32px, charge chips and checkbox rows 36px. */
  .order-page details.field-help > summary,
  .order-page .form-section > details.section-help > summary { box-sizing: border-box; min-width: 32px; min-height: 32px; }
  .order-page .port-chip, .order-page .port-chip > span,
  .order-page .op-check, .order-page .op-check > span,
  .order-page .op-na, .order-page .party-charges .port-chip > span { box-sizing: border-box; min-height: 36px; }
  .order-page .op-check > span, .order-page .op-na { display: flex; align-items: center; }
}
/* A3: a status badge in a table cell (Accounting, Completed orders) wraps inside its cell, the
   Arabic under the English, instead of running into the next column (desktop and 390). */
.accounts-list .data td.col-status, .page--archive .data td.col-status { min-width: 0; white-space: normal; }
.accounts-list .data td.col-status .badge,
.page--archive .data td.col-status .badge { flex-wrap: wrap; height: auto; min-height: var(--badge-h); max-width: 100%; row-gap: 0; padding-block: 2px; white-space: normal; }
.accounts-list .data td.col-status .badge > .en,
.accounts-list .data td.col-status .badge > .ar,
.page--archive .data td.col-status .badge > .en,
.page--archive .data td.col-status .badge > .ar { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* Design P1-1 (VISUAL-pr99.md, sbs-09; fix pass PR #99, 16/10): at ≤760px the
   section ⓘ (absolute, top right) no longer covers the title; the title keeps
   room for the ⓘ and the chevron and wraps. */
@media (max-width: 760px) {
  .form-section__title { max-width: calc(100% - 80px); flex-wrap: wrap; }
}

/* Sardar 16/10 11:20: dashboard explanations are a small ⓘ with a popover (no caption lines). */
details.dash-info { position: relative; display: inline-flex; align-items: center; margin: 0 0 0 4px; padding: 0; background: none; vertical-align: middle; }
details.dash-info[open] { padding: 0; background: none; }
details.dash-info > summary { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; padding: 0 2px; color: var(--text-3); font-size: 14px; line-height: 1; cursor: pointer; list-style: none; }
details.dash-info > summary::-webkit-details-marker { display: none; }
details.dash-info > .field-help__pop {
  position: absolute; top: 100%; inset-inline-end: 0; z-index: 30; display: grid; gap: 4px;
  width: max-content; max-width: 320px; margin-top: 4px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px; background: #F3F6FA; box-shadow: 0 6px 16px rgba(15, 24, 48, .10);
  color: #526079; font-size: 12px; font-weight: 400; line-height: 1.45; white-space: normal; text-align: start;
}
details.dash-info > .field-help__pop > * { display: block; margin: 0; padding: 0; color: inherit; font-size: inherit; min-width: 0; overflow-wrap: anywhere; }
/* 05/11/2026 (combined batch, Design 390 metrics): a closed note takes no room, so nothing of it lies past a phone's edge. */
details.dash-info:not([open]) > .field-help__pop { display: none; }
@media (max-width: 760px) {
  details.dash-info > summary { min-width: 32px; min-height: 32px; }
  details.dash-info > .field-help__pop { position: fixed; top: auto; left: 12px; right: 12px; bottom: 16px; width: auto; max-width: none; z-index: 40; }
}

/* =====================================================================
   PR #105 fix pass 2 (Design general check 17/10: D2–D5).
   ===================================================================== */
@media (max-width: 760px) {
  /* D2: Close stage's ⓘ (a Service change not saved yet) stays right after the button on a phone;
     every other line of the foot takes its own row below. */
  .order-page .op-panel__foot { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .order-page .op-panel__foot > :not(.op-close):not([data-close-service-note]) { flex-basis: 100%; }
  .order-page .op-panel__foot > .op-close { flex: 0 1 auto; min-width: 0; }
  /* D4: the stage panel's "Add another container type" stays inside the panel; its label wraps. */
  .order-page .op-panel [data-repeat-add] {
    max-width: 100%; flex-wrap: wrap; row-gap: 2px; height: auto; padding-block: 6px; line-height: 1.3; white-space: normal;
  }
}
/* D3: a Needs action row wraps on a phone: its day badge drops under the text, never cut to "…". */
@media (max-width: 600px) {
  .page--home .dash-action .bucket__list li { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 4px; row-gap: 2px; overflow: visible; white-space: normal; }
  .page--home .dash-action .bucket__list li > .bucket__item { min-width: 0; }
  .page--home .dash-action .bucket__list .bucket__reason { white-space: normal; }
  .page--home .dash-action .bucket__list .tag { margin-inline-start: 0; }
}
/* D5: below 480px the Port costs options (Itemised / Lump sum via clearance agent / Customer Arranged)
   stack, one full-width row each — the same control and text. */
@media (max-width: 480px) {
  .order-page .op-seg { flex-direction: column; flex-wrap: nowrap; }
  .order-page .op-seg__opt { flex: 0 0 auto; width: 100%; }
  .order-page .op-seg__opt + .op-seg__opt > .op-seg__txt { border-inline-start: 0; border-top: 1px solid #C9D2DF; }
}

/* Reviewed route controls; counts stay independent on both sides of a border. */
.route-plan { margin-block: 16px; }
.route-plan .card__body { padding: 20px; }
.route-plan .route-truck-row { display:grid;grid-template-columns: minmax(80px,1fr) minmax(160px,2fr);gap:10px;margin-block:8px; }
.route-plan input,.route-plan select { max-width:100%;min-width:0; }
.route-transfer { border:1px solid var(--border,#dce3ec);border-radius:12px;padding:16px; }
.route-adopt { display:flex;gap:10px;align-items:flex-start; }
@media(max-width:600px){.route-plan .card__body{padding:14px}.route-plan .route-truck-row{grid-template-columns:90px minmax(0,1fr)}}

.receipt-parts{margin-block:8px;max-width:340px}.receipt-parts label{display:block;margin-top:8px;font-size:.85em}.receipt-parts input{width:100%;min-width:0}.receipt-parts summary{cursor:pointer;font-size:.85em}
.settings-nav{flex-wrap:wrap;gap:5px}.settings-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.settings-groups .card__body{padding:20px}.settings-link{display:flex;align-items:center;gap:12px;padding:14px 0;color:inherit;text-decoration:none;border-bottom:1px solid var(--border,#dce3ec)}.settings-link span{flex:1;min-width:0}.settings-link strong,.settings-link small{display:block}.settings-link small{color:var(--muted,#6b7586);margin-top:5px}.settings-list{display:flex;flex-wrap:wrap;gap:8px;list-style:none;padding:0}.settings-list li{background:var(--surface-soft,#f1f4f8);border:1px solid var(--border,#dce3ec);border-radius:7px;padding:7px 10px}.settings-link:hover strong{text-decoration:underline}@media(max-width:700px){.settings-groups{grid-template-columns:minmax(0,1fr)}.settings-groups .card__body{padding:16px}}

.route-fields{border:0;margin:0;padding:0;min-width:0}

.route-plan [data-route-plan-fields] { grid-template-columns:repeat(2,minmax(0,1fr));align-items:start; }
.route-plan .field > label { display:grid;gap:6px; }
.route-plan .route-transfer legend { padding-inline:6px;font-size:14px;font-weight:600; }
.route-plan .field__hint { display:block;max-width:660px; }
@media(max-width:760px){.route-plan [data-route-plan-fields]{grid-template-columns:minmax(0,1fr)}.route-plan .field--span-2{grid-column:1/-1}}

/* Important note (Owner 18/10): kept as typed, line breaks included. */
.important-note-card textarea { width: 100%; min-height: 4.5rem; resize: vertical; font: inherit; }
.important-note { white-space: pre-line; overflow-wrap: anywhere; margin: 0; }

/* ==========================================================================
   Phase 2 UI/UX redesign (Owner 18/10) — one coherent layer over the system
   above: shared reading width, unbroken chips, a single-line stage track,
   a left-to-right pipeline per service, compact order rows and notification
   kinds. Tokens only; no new colours or fonts.
   ========================================================================== */

/* Order pages: the header is exactly as wide as the content under it. */
.order-page .op-head { box-sizing: border-box; width: 100%; max-width: 1044px; margin-inline: 0; }
.order-page--new .op-head { max-width: 880px; }
.order-page:has(.op-aside) .op-head { max-width: calc(1044px + 20px + 300px); }

/* Chips and status badges read on one line wherever they sit. */
.badge, .op-tag, .chip { white-space: nowrap; }
.badge .ar { display: inline; margin-inline-start: 4px; }
.data .badge { max-width: 100%; }

/* Stage track: every stage stays visible from tablet up (it wraps); on a
   phone it is one swiped line that opens on the step before the current one
   (app.js), with a fade on the side that holds more stages. */
@media (max-width: 760px) {
  .order-page .op-steps { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; padding-bottom: 14px; }
  .order-page .op-steps > .op-step { flex: 0 0 auto; white-space: nowrap; }
  .order-page .op-steps.has-more-end { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
}

/* Dashboard: each service reads left to right as one pipeline; empty stages
   step back so the stages holding work stand out. */
/* Seven or eight stages split into two balanced rows, never six and one. */
.page--home .pipeline:has(> .stage:nth-child(7)) { --cols: 4; }
.page--home .pipeline > .stage.is-zero { background: var(--surface-2); }
.page--home .pipeline > .stage.is-zero .stage__count { color: var(--text-4); }
/* Phones: the pipeline is swiped left to right, never stacked into a tall column. */
@media (max-width: 760px) {
  .page--home .pipeline { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; padding-bottom: 4px; }
  .page--home .pipeline > .stage { flex: 0 0 132px; min-width: 0; scroll-snap-align: start; }
  .page--home .pipeline > .stage.is-zero { flex: 0 0 104px; }
}
@media (max-width: 760px) { .page--home .dash-service-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; } .page--home .dash-service-chips > * { flex: 0 0 auto; } }

/* Active / completed orders: each owner on one line (full name in its tooltip), shorter rows. */
@media (min-width: 901px) {
  .page--orders .data.data--orders .owners > span { white-space: nowrap; }
  .page--orders .data.data--orders .owners .v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page--orders .data.data--orders .owners .k { font-size: 10px; letter-spacing: .02em; }
  .page--orders .data.data--orders tbody td { padding-top: 10px; padding-bottom: 10px; }
}

@media (max-width: 900px) {
  .data--cards.data--orders .owners { display: flex; flex-wrap: wrap; gap: 2px 12px; }
  .data--cards.data--orders .row-actions .btn { min-height: 36px; }
}

/* Accounting lists: amounts line up. */
.page--accounts .data td:last-child, .page--accounts .data th:last-child { text-align: end; font-variant-numeric: tabular-nums; }

/* Notifications: what kind of event, at a glance. */
.notice__kind { display: inline-flex; align-items: center; gap: 4px; margin-inline-end: 8px; padding: 1px 8px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600; vertical-align: 1px; background: var(--navy-50); color: var(--navy); white-space: nowrap; }
.notice__kind .ar { font-weight: 500; }
.notice__kind--eta_changed { background: var(--info-bg); color: var(--info); }
.notice__kind--note_added { background: var(--orange-50); color: var(--orange-text); }
.notice__kind--status_changed { background: var(--success-bg); color: var(--success); }

/* Phones: the order's sections fold to their titles and a short summary
   (app.js); an error, a link to a field or a tap opens one. */
.form-section__meta { margin-inline-start: 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-4); white-space: nowrap; }
.form-section[open] > .form-section__head .form-section__meta { display: none; }

/* Tablets (761–900px): order cards sit two to a row instead of one long column. */
@media (min-width: 761px) and (max-width: 900px) {
  .page--orders .data--cards.data--orders tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

/* ==========================================================================
   UI/UX round 2 (Owner 18/10): order workspace, overview, new-order summary,
   full-width dashboard pipeline with units, accounting heading.
   ========================================================================== */

/* Order details as one workspace: a short list of operational groups and the
   chosen group beside it (app.js wireOrderWorkspace). Desktop and tablet only. */
@media (min-width: 761px) {
  .order-page .order-more__body.ws { row-gap: 0; }
  .order-page .order-more__body.ws > :not(.ws-nav):not(.ws-off):not([hidden]) { margin-bottom: 12px; }
  .ws-off { display: none !important; }
  .ws-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; margin-bottom: 12px; }
  .ws-tab { position: relative; display: flex; flex-direction: column; align-items: flex-start; flex: 0 0 auto; gap: 1px; min-height: var(--ctl-md);
    padding: 7px 34px 7px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--text-2);
    font: 600 var(--fs-sm)/1.25 inherit; text-align: start; cursor: pointer; }
  .ws-tab__ar { font-size: var(--fs-xs); font-weight: 500; color: var(--text-4); }
  .ws-tab:hover { border-color: var(--navy-200); background: var(--surface-2); }
  .ws-tab.is-active { border-color: var(--navy); background: var(--navy); color: #fff; }
  .ws-tab.is-active .ws-tab__ar { color: rgba(255, 255, 255, .82); }
  .ws-tab:focus-visible { outline: none; box-shadow: var(--focus); }
  .ws-tab.has-error:not(.is-active) { border-color: var(--danger-bd); background: var(--danger-bg); }
  .ws-tab__flag { position: absolute; top: 50%; inset-inline-end: 10px; transform: translateY(-50%); display: grid; place-items: center;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; }
}
@media (min-width: 1100px) {
  .order-page .order-more__body.ws { grid-template-columns: 200px minmax(0, 1fr); column-gap: 20px; align-items: start; }
  .order-page .order-more__body.ws > .ws-nav { grid-column: 1; grid-row: 1 / span 99; position: sticky; top: calc(var(--order-head-h, 0px) + 16px);
    flex-direction: column; overflow: visible; margin-bottom: 0; }
  .order-page .order-more__body.ws > :not(.ws-nav) { grid-column: 2; }
  .ws-tab { width: 100%; }
}

/* Overview: ETA and team next to customer, service, route and load. */
.order-page .op-facts { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.op-team-list { display: flex; flex-direction: column; gap: 2px; }
.op-team-list > span { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.op-team-list .op-data { min-width: 0; overflow-wrap: anywhere; }
.op-team-list .k { min-width: 62px; color: var(--text-4); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.op-fact__edit { margin-inline-start: 8px; font-size: var(--fs-xs); font-weight: 600; }
.op-fact__edit .ar { display: none; }

/* New order: the summary beside the form. */
.order-page--new .op-layout:has(> .op-summary) { grid-template-columns: minmax(0, 880px) minmax(240px, 300px); }
.order-page--new:has(.op-summary) .op-head { max-width: calc(880px + 20px + 300px); }
.op-summary { position: sticky; top: 16px; align-self: start; }
.op-summary__card { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; margin: 0; }
.op-summary__title { margin: 0; font-size: var(--fs-lg); }
.op-summary__subtitle { margin: 4px 0 0; padding-top: 10px; border-top: 1px solid var(--border-soft); font-size: var(--fs-sm); color: var(--text-2); }
.op-summary__facts { display: grid; gap: 6px; margin: 0; }
.op-summary__row { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.op-summary__row dt { color: var(--text-4); font-size: var(--fs-xs); font-weight: 600; }
.op-summary__row dt .ar { display: block; font-weight: 500; }
.op-summary__row dd { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.op-summary__row dd.is-empty { color: var(--text-4); font-weight: 500; }
.op-summary__checks { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
.op-summary__checks li { display: flex; gap: 6px; align-items: baseline; color: var(--text-2); }
.op-summary__checks li .ar { color: var(--text-4); font-size: var(--fs-xs); }
.op-summary__mark { flex: none; width: 14px; height: 14px; border: 1.5px solid var(--border-strong); border-radius: 50%; transform: translateY(2px); }
.op-summary__checks li.is-done { color: var(--success); }
.op-summary__checks li.is-done .op-summary__mark { border-color: var(--success); background: var(--success); box-shadow: inset 0 0 0 2px var(--surface); }
.op-summary__note { margin: 0; color: var(--text-4); font-size: var(--fs-xs); line-height: 1.5; }
@media (max-width: 1180px) {
  .order-page--new .op-layout:has(> .op-summary) { grid-template-columns: minmax(0, 1fr); }
  .op-summary { position: static; }
}

/* Dashboard: the stage pipeline spans the page, every service on one row, and
   each figure names its unit (Owner 18/10: units shown); the detail cards sit
   two by two below it. */
@media (min-width: 1100px) {
  .page--home .dash-split { grid-template-columns: minmax(0, 1fr); }
  .page--home .dash-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .page--home .pipeline:has(> .stage:nth-child(7)) { --cols: 7; }
  .page--home .pipeline:has(> .stage:nth-child(8)) { --cols: 8; }
}
.page--home .pipeline .stage .stage__unit { position: static; width: auto; height: auto; margin: 0 0 0 6px; overflow: visible; clip: auto;
  min-width: 0; color: var(--text-3); font-size: 12px; font-weight: 600; }
.page--home .pipeline .stage .stage__main { display: inline-flex; flex-direction: row; align-items: baseline; gap: 0; }
.page--home .pipeline .stage.is-zero .stage__unit { color: var(--text-4); }
/* Design 24/10 r2 P2-2: an order-count tile (Port / Border Clearance, Other Services, Air) reads "1 order" on one
   line, as the container / truck tiles do. */
.page--home .pipeline .stage:not(.stage--units) .stage__figure { display: flex; align-items: baseline; justify-content: flex-start; flex-wrap: nowrap; gap: 0; }
.page--home .pipeline .stage:not(.stage--units) .stage__figure > .stage__count { align-self: baseline; }

/* Accounting: TOTALS and its Arabic line end at the column's edge together. */
.page--accounts .data th:last-child, .page--accounts .data th:last-child * { text-align: right; }
/* The bleeding action bar (≤1180px) never makes the page scroll sideways; clip keeps sticky bars working. */
.order-page { overflow-x: clip; }
/* Round 2 review fixes: the group list wraps below 1100px (every group stays in view);
   overview facts fit one row; the summary leads the form on narrow screens; a stored
   border broker for a port without a land border is named, not edited. */
@media (min-width: 761px) and (max-width: 1099px) { .ws-nav { flex-wrap: wrap; overflow-x: visible; } }
.order-page .op-facts { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (max-width: 1180px) { .op-summary { order: -1; } }
.customs-held-note { margin: 0; padding: 8px 12px; border: 1px dashed var(--border-strong); border-radius: var(--r); color: var(--text-3); font-size: var(--fs-sm); }
/* Gap closure (18/10): the Shipment card reads in one pass — the service's scope on its own
   line, the team as one line under the facts; a refused save names the saved values, and an
   ETA typed but not saved is marked next to the saved one. */
@media (min-width: 761px) { .order-page .op-facts { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }
.order-page .op-fact__sub { display: block; margin-top: 2px; color: var(--text-2); font-weight: 500; }
.order-page .op-fact--team { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px;
  padding-top: 12px; border-top: 1px solid var(--border-soft); }
.order-page .op-fact--team dt { display: flex; gap: 6px; align-items: baseline; }
.order-page .op-fact--team .op-team-list { display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px 24px; }
.order-page .op-fact--team .op-team-list .k { min-width: 0; }
.order-page .op-tag--saved { background: #EEF2F9; color: var(--navy, #22325A); }
.order-page .op-unsaved { display: inline-flex; flex-wrap: wrap; gap: 0 4px; margin-top: 4px; padding: 2px 8px; border-radius: 999px;
  background: #FFF4E5; color: var(--orange-text); font-size: 12px; font-weight: 600; }
.order-page .op-unsaved[hidden] { display: none; }
/* Gap closure (18/10): on desktop Needs action today (and At port) open the dashboard, right under
   the figures, above the full-width stage board; Arrivals and By owner follow it. */
@media (min-width: 1100px) {
  .page--home .dash-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page--home .dash-side { display: contents; }
  .page--home .dash-side > .dash-action { order: 0; }
  .page--home .dash-side > .dash-at-port { order: 1; }
  .page--home .dash-split > .stage-card { order: 2; grid-column: 1 / -1; }
  .page--home .dash-side > .dash-arrivals { order: 3; }
  .page--home .dash-side > .dash-owners { order: 4; }
}
/* Gap closure (18/10): the stages a port change would give, under the saved track, until Save. */
.order-page .op-route-preview { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--orange, #E8870F); border-radius: var(--r); background: #FFFBF5; }
.order-page .op-route-preview[hidden] { display: none; }
.order-page .op-route-preview__title { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: var(--fs-sm); color: var(--text-2); }
.order-page .op-steps--preview .op-step { opacity: .9; }
/* Gap closure (18/10): the Cost Statement names what the customer performed; the history reads in words. */
.statement-customer__list { margin: 4px 0 0; padding-inline-start: 0; list-style: none; display: grid; gap: 4px; }
.statement-customer__list .ar { color: var(--text-3); }
.cost-history__receipt { display: block; color: var(--text-3); white-space: normal; }
.cost-history .nowrap { white-space: nowrap; }
/* Sardar 28/10/2026 (A22): on a phone the Financial change history is a list of cards (.data--cards), not a wide table. */
@media (max-width: 900px) {
  .cost-history.data--cards tbody tr { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .cost-history.data--cards td.money { text-align: start; }
}
.order-page .op-fact--customer { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px;
  padding-top: 12px; border-top: 1px solid var(--border-soft); }
.order-page .op-fact--customer dt { display: flex; gap: 6px; align-items: baseline; }
.order-page .op-customer-list { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; }
.order-page .op-customer { display: inline-flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
/* Gap closure (18/10): the order's stage and ETA history on its page. */
.order-page .op-history > summary { cursor: pointer; list-style: none; }
.order-page .op-history > summary::-webkit-details-marker { display: none; }
.order-page .op-history__table td.nowrap { white-space: nowrap; }
.order-page .op-history__none { margin: 0; padding: 12px 20px; }
/* Review fixes (18/10): the Customer Arranged pill on order pages and the statement; the suggested mode hint. */
:is(.order-page, .statement-customer) .pill-muted { display: inline-block; white-space: nowrap; font-size: 12px; line-height: 16px;
  padding: 2px 8px; border-radius: 999px; background: #F1F5F9; color: #475569; font-weight: 600; }
.order-page .op-help--suggested { color: var(--orange-text); }
.order-page .op-help--suggested[hidden] { display: none; }
/* Final targeted fixes (18/10): after a refused save the stage card says it holds unsaved input,
   and each field typed but not saved names the saved value. */
.order-page .op-tag--unsaved { background: #FFF4E5; color: var(--orange-text); }
.order-page .field--unsaved :is(input, select, textarea) { border-color: var(--orange, #E8870F); }
.order-page .unsaved-note { display: block; margin-top: 4px; color: var(--orange-text); font-size: 12px; font-weight: 600; }
.order-page .unsaved-note .ar { font-weight: 500; }
/* Reopen Costs (owner decision 17/10): the costs' own state beside the order's stage badge. */
.cost-state { display: inline-flex; flex-wrap: wrap; gap: 0 4px; align-items: center; margin-inline-start: 8px; padding: 2px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; background: #EEF2F9; color: var(--navy, #22325A); }
.cost-state--complete, .cost-state--locked { background: #F2F4F7; color: #475467; }
.cost-state--reopened { background: #FFF4E5; color: var(--orange-text); }
.page-actions .inline-form .btn { white-space: nowrap; }
.statement__late { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; padding: 12px 20px; border-top: 1px solid var(--border-soft); }
.statement__late .field { margin: 0; min-width: min(100%, 320px); }
form[data-costs-complete] [data-costs-unsaved] { display: block; margin-top: 4px; }
form[data-costs-complete] [data-costs-unsaved][hidden] { display: none; }

/* ==========================================================================
   UI/UX round 3 (Owner 19/10): New order, Edit order and View order as one
   shipment workspace — a navy identity band, the work beside a context column
   (the shipment and its journey, desktop), a connected journey track, service
   tiles and one calmer card system. Visual only: every name, value, data-*
   hook, text and rule is unchanged; the brand navy and orange only.
   ========================================================================== */
.page.order-page {
  --r3-line: #E2E8F0; --r3-line-soft: #EDF1F6; --r3-radius: 14px; --r3-ink: var(--navy-900);
  --r3-shadow: 0 1px 2px rgba(15, 24, 48, .04), 0 8px 24px rgba(15, 24, 48, .05);
  --r3-rail: clamp(300px, 25vw, 352px); --r3-max: 1400px;
}

/* ---------- Identity band: the order's NG, state and service on navy ---------- */
.page.order-page .op-head,
.page.order-page.order-page--new .order-form-header.op-head,
.page.order-page.order-page--edit .order-form-header.op-head,
.page.order-page.order-page--view .view-summary.op-head {
  position: relative; top: auto; z-index: 3; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 14px 24px; box-sizing: border-box; width: 100%; max-width: var(--r3-max); margin: 0 0 20px; padding: 22px 28px 26px;
  border: 0; border-radius: 16px; clip-path: none; color: #fff;
  background:
    radial-gradient(90% 160% at 100% 0%, rgba(244, 123, 32, .20) 0%, rgba(244, 123, 32, 0) 46%),
    linear-gradient(120deg, var(--navy-950) 0%, var(--navy-800) 52%, var(--navy) 100%);
  box-shadow: 0 14px 34px rgba(15, 24, 48, .20);
}
.page.order-page .op-head::before,
.page.order-page.order-page--edit .order-form-header.op-head::before,
.page.order-page.order-page--new .order-form-header.op-head::before {
  content: ""; position: absolute; inset-inline-start: 28px; inset-inline-end: auto; top: auto; bottom: 0; width: 72px; height: 4px; border-radius: 4px 4px 0 0;
  background: var(--orange); box-shadow: none; transform: none;
}
.page.order-page .op-head > .op-head__main { flex: 1 1 420px; min-width: 0; }
.page.order-page .op-head .page-header__eyebrow { margin: 0 0 8px; }
.page.order-page .op-head .page-header__eyebrow a { display: inline-flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .78); font-size: 13px; font-weight: 600; text-decoration: none; }
.page.order-page .op-head .page-header__eyebrow a:hover { color: #fff; text-decoration: underline; }
.page.order-page .op-head .page-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; color: #fff; font-size: 32px; line-height: 1.15; letter-spacing: -.01em; }
.page.order-page .op-head .page-title > .ar, .page.order-page .op-head .page-title .ar { color: rgba(255, 255, 255, .72); font-size: 20px; font-weight: 600; }
.page.order-page .op-head__ng { font-family: var(--mono); font-weight: 700; letter-spacing: .01em; }
.page.order-page .op-head .lifecycle { height: 26px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .32); background: rgba(255, 255, 255, .12); color: #fff; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.page.order-page .op-head .lifecycle--archived { border-color: rgba(244, 123, 32, .6); background: rgba(244, 123, 32, .16); }
.page.order-page .op-head .page-sub, .page.order-page .op-head .op-head__sub { margin: 10px 0 0; color: rgba(255, 255, 255, .86); font-size: 15px; font-weight: 500; }
.page.order-page .op-head [data-closed-missing] { margin: 10px 0 0; color: #fff; }
.page.order-page .op-head .form-header-ng { display: inline-flex; align-items: baseline; gap: 8px; margin: 0; padding: 4px 12px; border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px; background: rgba(255, 255, 255, .10); color: #fff; font-size: 16px; font-weight: 700; }
.page.order-page .op-head .form-header-ng .ar { color: rgba(255, 255, 255, .74); font-size: 13px; font-weight: 500; }
.page.order-page .op-head .page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.page.order-page .op-head .page-actions .btn { height: var(--ctl-md); border-radius: 10px; }
.page.order-page .op-head .page-actions .btn--secondary { border: 1px solid rgba(255, 255, 255, .38); background: rgba(255, 255, 255, .10); color: #fff; }
.page.order-page .op-head .page-actions .btn--secondary:hover { background: rgba(255, 255, 255, .18); }
.page.order-page .op-head .page-actions .btn--secondary .ar { color: rgba(255, 255, 255, .78); }
.page.order-page .op-head .page-actions .btn--primary { border: 0; background: var(--orange); color: var(--navy-950); box-shadow: 0 6px 16px rgba(244, 123, 32, .28); }
.page.order-page .op-head .page-actions .btn--primary:hover { background: #FFA43A; }
.page.order-page .op-head .page-actions .btn--primary .ar { color: rgba(15, 24, 48, .78); }
.page.order-page .op-head .order-actions > summary { border: 1px solid rgba(255, 255, 255, .38); background: rgba(255, 255, 255, .10); color: #fff; }
.page.order-page .op-head .menu__panel { color: var(--text); }
.page.order-page .op-head .btn:focus-visible, .page.order-page .op-head a:focus-visible, .page.order-page .op-head summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; box-shadow: none; }
/* The band scrolls away; the context column (desktop) keeps the order in view. */
html:has(.order-page .order-form-header) { scroll-padding-top: calc(var(--header-h) + 16px); }

/* ---------- Page width: the work and its context use the screen ---------- */
.page.order-page > .alert { box-sizing: border-box; width: 100%; max-width: var(--r3-max); margin-inline: 0; border-radius: 12px; }
.page.order-page.order-page--edit .op-layout, .page.order-page.order-page--view .op-layout,
.page.order-page.order-page--edit .op-layout:has(> .op-aside) { display: grid; grid-template-columns: minmax(0, 1fr); max-width: var(--r3-max); gap: 16px; }
.page.order-page.order-page--edit .op-layout > .op-aside { order: -1; position: static; }
.page.order-page.order-page--edit .op-aside .op-aside__card { margin: 0; padding: 12px 18px; border-radius: 12px; }
.page.order-page.order-page--edit .op-aside .card__desc { margin: 0; }

.page.order-page .op-rail > *, .page.order-page .op-work > * { min-width: 0; }

/* ---------- One card system on the three screens ---------- */
.page.order-page :is(.op-card, .op-step.card, .order-more.card, .important-note-card, .route-plan.card, .legacy-cargo-review.card, .op-team.card, .op-summary__card) {
  border: 1px solid var(--r3-line); border-radius: var(--r3-radius); background: #fff; box-shadow: var(--r3-shadow);
}
.page.order-page .op-work > .card, .page.order-page .op-rail > .card, .page.order-page .op-form > .card { margin: 0 0 16px; }
.page.order-page :is(.op-card__head, .order-more__head) { min-height: 0; padding: 16px 20px 12px; border-bottom: 1px solid var(--r3-line-soft); background: transparent; }
.page.order-page :is(.op-card__title, .order-more__title, .op-panel__title) { color: var(--r3-ink); font-size: 16px; font-weight: 700; letter-spacing: 0; }
.page.order-page :is(.op-card__title, .order-more__title, .op-panel__title) .ar { color: var(--text-3); font-weight: 500; }
.page.order-page .op-tag { border-radius: 999px; font-weight: 600; }

/* Pictograms of the shipment facts (CSS masks; the markup is unchanged). */
.page.order-page .op-fact[data-fact="company_name"] { --r3-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2' width='16' height='20' rx='2'/%3E%3Cpath d='M9 22v-4h6v4M8 6h.01M16 6h.01M12 6h.01M12 10h.01M12 14h.01M16 10h.01M16 14h.01M8 10h.01M8 14h.01'/%3E%3C/svg%3E"); }
.page.order-page .op-fact[data-fact="service"] { --r3-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8 12 3 3 8v8l9 5 9-5z'/%3E%3Cpath d='m3 8 9 5 9-5M12 13v8'/%3E%3C/svg%3E"); }
.page.order-page .op-fact[data-fact="other_services"] { --r3-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E"); }
.page.order-page .op-fact[data-fact="route"] { --r3-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E"); }
.page.order-page .op-fact[data-fact="qty"] { --r3-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 2 10 5-10 5L2 7l10-5z'/%3E%3Cpath d='m2 17 10 5 10-5M2 12l10 5 10-5'/%3E%3C/svg%3E"); }
.page.order-page .op-fact[data-fact="eta"] { --r3-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"); }
.page.order-page .op-fact[data-fact="team"] { --r3-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8'/%3E%3C/svg%3E"); }
.page.order-page .op-fact[data-fact="customer-arranged"] { --r3-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E"); }

/* ---------- Edit and View: the work beside the context column ---------- */
@media (min-width: 1180px) {
  .page.order-page.order-page--edit .op-form,
  .page.order-page.order-page--view .view-main.op-main {
    display: grid; grid-template-columns: minmax(0, 1fr) var(--r3-rail); grid-template-areas: "work rail" "actions rail";
    column-gap: 24px; row-gap: 0; align-items: start;
  }
  .page.order-page .op-rail { grid-area: rail; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
  .page.order-page .op-rail > .card { margin: 0; }
  .page.order-page .op-work { grid-area: work; min-width: 0; }
  /* On a tall screen the context column stays in view while the work scrolls. */
  @media (min-height: 1040px) { .page.order-page .op-rail { position: sticky; top: calc(var(--header-h) + 16px); } }
  .page.order-page.order-page--edit .op-form > .form-actions { grid-area: actions; }

  /* The journey as a vertical track: done, the current stage, the stages to come. */
  .page.order-page .op-rail .op-steps { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 0; margin: 0; padding: 14px 18px 16px; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .page.order-page .op-rail .op-steps > .op-step { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; column-gap: 12px;
    min-height: 40px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; white-space: normal; }
  .page.order-page .op-rail .op-steps > .op-step:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 12px; top: 30px; bottom: -10px; width: 2px;
    border-radius: 2px; background: var(--r3-line); }
  .page.order-page .op-rail .op-steps > .op-step--done:not(:last-child)::after { background: var(--success); }
  .page.order-page .op-rail .op-steps > .op-step > .icon,
  .page.order-page .op-rail .op-steps > .op-step > .op-step__n { position: relative; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; margin: 0;
    border-radius: 50%; box-sizing: border-box; font-size: 12px; font-weight: 700; }
  .page.order-page .op-rail .op-steps > .op-step--done > .icon { padding: 6px; background: var(--success); color: #fff; }
  .page.order-page .op-rail .op-steps > .op-step--current > .op-step__n { background: var(--navy); color: #fff; box-shadow: 0 0 0 5px var(--navy-100); }
  .page.order-page .op-rail .op-steps > :is(.op-step--todo, .op-step--next, .op-step--upcoming) > .op-step__n,
  .page.order-page .op-rail .op-steps > .op-step:not(.op-step--done):not(.op-step--current) > .op-step__n { border: 2px solid var(--border-strong); background: #fff; color: var(--text-4); }
  .page.order-page .op-rail .op-steps > .op-step > .op-step__label { padding: 8px 0; color: var(--text-3); font-size: 14px; font-weight: 500; line-height: 1.3; }
  .page.order-page .op-rail .op-steps > .op-step--done > .op-step__label { color: var(--text-2); }
  .page.order-page .op-rail .op-steps > .op-step--current > .op-step__label { color: var(--r3-ink); font-size: 15px; font-weight: 700; }
  .page.order-page .op-rail .op-steps > .op-step--current { margin: 4px -10px; padding: 0 10px; border-radius: 10px; background: var(--navy-50); }
  .page.order-page .op-rail .op-steps > .op-step--current:not(:last-child)::after { inset-inline-start: 22px; top: 34px; bottom: -14px; }
  .page.order-page .op-rail .op-route-preview { margin: 0 18px 16px; }
  .page.order-page .op-rail .op-route-preview .op-steps { padding: 6px 0 0; }
}

/* The shipment as a spec list (desktop context column and phones): one line per fact, its pictogram, label over value. */
@media (min-width: 1180px) {
  .page.order-page .op-rail .op-facts { display: flex; flex-direction: column; gap: 0; padding: 4px 18px 8px; }
  .page.order-page .op-rail .op-fact, .page.order-page .op-rail .op-fact--team, .page.order-page .op-rail .op-fact--customer {
    display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 12px; align-items: start; margin: 0; padding: 12px 0;
    border: 0; border-top: 1px solid var(--r3-line-soft); }
  .page.order-page .op-rail .op-fact:first-child { border-top: 0; }
  .page.order-page .op-rail .op-fact > dt { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; margin: 0 0 2px;
    color: var(--text-4); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
  .page.order-page .op-rail .op-fact > dt .op-fact__ar { display: inline; color: var(--text-4); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; }
  .page.order-page .op-rail .op-fact > dd { grid-column: 2; margin: 0; color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
  .page.order-page .op-rail .op-fact::before { grid-column: 1; grid-row: 1 / span 2; content: ""; width: 30px; height: 30px; border-radius: 9px;
    background: var(--navy-50) center / 16px 16px no-repeat; }
  .page.order-page .op-rail .op-fact::after { grid-column: 1; grid-row: 1 / span 2; content: ""; width: 16px; height: 16px; margin: 7px; background: var(--navy);
    -webkit-mask: var(--r3-icon, none) center / contain no-repeat; mask: var(--r3-icon, none) center / contain no-repeat; }
  .page.order-page .op-rail .op-team-list { flex-direction: column; gap: 4px; }
  .page.order-page .op-rail .op-fact--team .op-team-list { flex-direction: column; gap: 4px; }
  .page.order-page .op-rail .op-team-list .k { min-width: 70px; }
  .page.order-page .op-rail .op-customer-list { flex-direction: column; gap: 6px; }
}
/* ---------- Tablet and phone: the context above the work ---------- */
@media (max-width: 1179.98px) {
  .page.order-page .op-rail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
  .page.order-page .op-rail > .card { margin: 0 0 14px; }
  .page.order-page .op-rail .op-facts { padding: 6px 18px 14px; }
  /* The journey: one connected line, swiped sideways, opening on the current stage (app.js). */
  .page.order-page .op-steps { display: flex; flex-wrap: nowrap; gap: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; padding: 16px 18px 14px; margin: 0; }
  .page.order-page .op-steps > .op-step { position: relative; flex: 1 0 96px; display: flex; flex-direction: column; align-items: center; gap: 6px; width: auto; max-width: 140px;
    min-height: 0; margin: 0; padding: 0 4px; border: 0; border-radius: 0; background: none; box-shadow: none; text-align: center; white-space: normal; }
  .page.order-page .op-steps > .op-step:not(:last-child)::after { content: ""; position: absolute; top: 12px; inset-inline-start: calc(50% + 16px); width: calc(100% - 32px);
    height: 2px; border-radius: 2px; background: var(--r3-line); }
  .page.order-page .op-steps > .op-step--done:not(:last-child)::after { background: var(--success); }
  .page.order-page .op-steps > .op-step > .icon, .page.order-page .op-steps > .op-step > .op-step__n { display: grid; place-items: center; width: 26px; height: 26px;
    margin: 0; border-radius: 50%; box-sizing: border-box; font-size: 12px; font-weight: 700; }
  .page.order-page .op-steps > .op-step--done > .icon { padding: 6px; background: var(--success); color: #fff; }
  .page.order-page .op-steps > .op-step--current > .op-step__n { background: var(--navy); color: #fff; box-shadow: 0 0 0 4px var(--navy-100); }
  .page.order-page .op-steps > .op-step:not(.op-step--done):not(.op-step--current) > .op-step__n { border: 2px solid var(--border-strong); background: #fff; color: var(--text-4); }
  .page.order-page .op-steps > .op-step > .op-step__label { color: var(--text-3); font-size: 12.5px; font-weight: 500; line-height: 1.3; }
  .page.order-page .op-steps > .op-step--current > .op-step__label { color: var(--r3-ink); font-weight: 700; }
}
/* Design P2 on #252 (06/11/2026): on a small phone a strip of up to five stages (Port Clearance's) fits the card, each
   label wrapping under its step; it was a swiped row that opened on the current stage with Confirmed out of view and
   Completed cut by the fade. Six stages or more keep the swiped row. */
@media (max-width: 480px) {
  .page.order-page .op-steps:not(:has(> .op-step:nth-child(6))) { overflow: visible; padding-inline: 10px; -webkit-mask-image: none; mask-image: none; }
  .page.order-page .op-steps:not(:has(> .op-step:nth-child(6))) > .op-step { flex: 1 1 0; min-width: 0; padding: 0 2px; }
  .page.order-page .op-steps:not(:has(> .op-step:nth-child(6))) > .op-step > .op-step__label { font-size: 11.5px; overflow-wrap: break-word; }
}
@media (max-width: 760px) {
  .page.order-page .op-rail .op-fact--team, .page.order-page .op-rail .op-fact--customer { flex-wrap: wrap; }
  .page.order-page .op-rail .op-fact--team .op-team-list, .page.order-page .op-rail .op-customer-list { flex-wrap: wrap; min-width: 0; gap: 4px 16px; }
}
@media (min-width: 761px) and (max-width: 1179.98px) {
  .page.order-page .op-steps { overflow: visible; }
  .page.order-page .op-steps > .op-step { flex: 1 1 0; width: auto; min-width: 0; }
  .page.order-page .op-rail .op-facts { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .page.order-page .op-rail .op-fact--team .op-team-list, .page.order-page .op-rail .op-customer-list { flex-wrap: wrap; min-width: 0; }
}

/* The port cost switch stays one segmented row in the narrower work column; a long label wraps inside its segment. */
@media (min-width: 481px) {
  .page.order-page .op-seg { flex-wrap: nowrap; }
  .page.order-page .op-seg__opt { flex: 0 1 auto; min-width: 0; }
  .page.order-page .op-seg__opt > span { white-space: normal; line-height: 1.3; }
}

/* ---------- The current stage: the task card ---------- */
.page.order-page .op-panel--current, .page.order-page .op-closed { overflow: hidden; border-color: var(--r3-line); }
.page.order-page .op-panel--current { border-top: 0; box-shadow: 0 1px 2px rgba(15, 24, 48, .04), 0 12px 28px rgba(15, 24, 48, .07); }
.page.order-page .op-panel--current > .op-card__head { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 20px 22px 16px;
  border-bottom: 1px solid #F6E2C6; background: linear-gradient(180deg, #FFF8EE 0%, #FFFFFF 100%); }
.page.order-page .op-panel--current > .op-card__head::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--orange); }
.page.order-page .op-panel--current .op-panel__title { display: flex; align-items: center; gap: 12px; margin: 0; flex: 1 1 auto; font-size: 20px; }
.page.order-page .op-panel--current .op-panel__title .op-num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--orange);
  color: var(--navy-950); font-size: 15px; font-weight: 800; }
.page.order-page .op-panel__body { padding: 18px 22px 8px; }
.page.order-page .op-panel .op-group { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; color: var(--navy-700); font-size: 11.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; }
.page.order-page .op-panel .op-group::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--r3-line-soft); }
.page.order-page .op-panel .op-group:first-child { margin-top: 2px; }
.page.order-page .op-panel .op-group .ar { color: var(--text-3); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.page.order-page .op-panel__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 8px 0 0; padding: 16px 22px 18px;
  border-top: 1px solid var(--r3-line-soft); background: #F8FAFC; }
.page.order-page .op-panel__foot .btn, .page.order-page .op-close { min-height: 44px; border-radius: 10px; font-weight: 700; }
.page.order-page .op-closed > .op-card__head { padding: 18px 22px 14px; }
.page.order-page .op-closed:not(.op-closed--cancelled) > .op-card__head { background: linear-gradient(180deg, var(--success-bg) 0%, #fff 100%); }

/* ---------- Providers chosen at earlier stages ---------- */
.page.order-page .op-earlier .op-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; padding: 14px 18px 16px; }
.page.order-page .op-earlier .op-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--r3-line); border-radius: 10px; background: var(--surface-2); white-space: normal; }
.page.order-page .op-earlier .op-chip__k { color: var(--text-4); font-size: 12px; font-weight: 600; }
.page.order-page .op-earlier .op-chips__none { padding: 2px 0; }

/* ---------- All order details: the workspace ---------- */
.page.order-page .order-more > .order-more__head { padding: 16px 20px; }
.page.order-page .order-more[open] > .order-more__head { border-bottom: 1px solid var(--r3-line-soft); }
.page.order-page .order-more__body { padding: 18px 20px 20px; }
@media (min-width: 761px) {
  .page.order-page .ws-tab { min-height: 46px; padding: 9px 34px 9px 14px; border-radius: 10px; border-color: var(--r3-line); background: #fff; }
  .page.order-page .ws-tab.is-active { border-color: var(--navy); background: var(--navy); box-shadow: 0 6px 14px rgba(20, 50, 122, .22); }
}
@media (min-width: 1180px) and (max-width: 1439.98px) {
  .page.order-page:is(.order-page--edit, .order-page--view) .order-more__body.ws { grid-template-columns: minmax(0, 1fr); }
  .page.order-page:is(.order-page--edit, .order-page--view) .order-more__body.ws > .ws-nav { grid-column: 1; grid-row: auto; position: static; flex-direction: row; flex-wrap: wrap; margin-bottom: 12px; }
  .page.order-page:is(.order-page--edit, .order-page--view) .order-more__body.ws > :not(.ws-nav) { grid-column: 1; }
  .page.order-page:is(.order-page--edit, .order-page--view) .ws-tab { width: auto; }
}
@media (min-width: 1100px) {
  .page.order-page .order-more__body.ws { grid-template-columns: 210px minmax(0, 1fr); column-gap: 22px; }
  .page.order-page .order-more__body.ws > .ws-nav { top: calc(var(--header-h) + 16px); gap: 6px; }
}
.page.order-page .order-more__body .form-section.op-sub { border: 1px solid var(--r3-line-soft); border-radius: 12px; background: #fff; box-shadow: none; }
.page.order-page .order-more__body .form-section.op-sub > .form-section__head { padding: 14px 18px; }
.page.order-page .order-more__body .form-section.op-sub[open] > .form-section__head { border-bottom: 1px solid var(--r3-line-soft); }

/* View: the detail sections as a two-column sheet. */
.page.order-page.order-page--view .order-more__body.view-main > .card { border: 1px solid var(--r3-line-soft); border-radius: 12px; box-shadow: none; }
.page.order-page.order-page--view .order-more__body.view-main > section.card > .card__header { padding: 14px 18px 10px; border-bottom: 1px solid var(--r3-line-soft); background: transparent; box-shadow: none; }
.page.order-page.order-page--view .order-more__body.view-main > section.card { background: #fff; box-shadow: none; }
.page.order-page.order-page--view .order-more__body.view-main .card__title { color: var(--r3-ink); font-size: 15px; }
.page.order-page.order-page--view .detail dt, .page.order-page.order-page--view .op-ro-list dt { color: var(--text-4); font-size: 12px; font-weight: 600; }
.page.order-page.order-page--view .detail dd { color: var(--text); font-weight: 600; }
.page.order-page.order-page--view .op-history > .op-card__head { padding: 16px 20px; }
.page.order-page.order-page--view .view-back { margin: 4px 0 0; }

/* ---------- Fields: one control look on the three screens ---------- */
.page.order-page :is(.op-form, .op-summary) :is(input[type="text"], input[type="date"], input[type="number"], input:not([type]), select, textarea):not([type="hidden"]) {
  border-radius: 10px; border-color: var(--border-strong); }
.page.order-page .op-form :is(input, select, textarea):focus-visible { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(20, 50, 122, .16); }
.page.order-page .op-form .field__label { color: var(--text-2); font-weight: 600; }

/* ---------- The Save bar: one floating bar under the work ---------- */
.page.order-page .order-form .form-actions {
  position: sticky; bottom: 12px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 8px 0 0; padding: 12px 16px;
  border: 1px solid var(--r3-line); border-radius: 14px; background: rgba(255, 255, 255, .96); box-shadow: 0 12px 32px rgba(15, 24, 48, .16);
}
.page.order-page .order-form .form-actions .btn { height: 44px; border-radius: 10px; }
.page.order-page .order-form .form-actions .btn--primary { min-width: 132px; padding-inline: 20px; font-weight: 700; }
.page.order-page .order-form .form-actions__legend { display: flex; flex-direction: column; gap: 0; flex: 1 1 260px; min-width: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.4; }
.page.order-page .order-form .form-actions__legend .ar { color: var(--text-3); font-size: 13px; }
.page.order-page .order-form .form-actions__note { flex: 0 1 auto; margin-inline-start: auto; line-height: 1.4; }
html:has(.order-page--edit .form-actions) { scroll-padding-bottom: 116px; }
@media (max-width: 1439.98px) { .page.order-page .order-form .form-actions__legend { display: none; } }
@media (min-width: 1440px) {
  .page.order-page .order-form .form-actions:has(> .form-actions__legend) { display: grid; grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "save cancel legend" "save cancel note";
    column-gap: 12px; row-gap: 2px; align-items: center; }
  .page.order-page .order-form .form-actions:has(> .form-actions__legend) > .btn--primary { grid-area: save; }
  .page.order-page .order-form .form-actions:has(> .form-actions__legend) > .btn--ghost { grid-area: cancel; }
  .page.order-page .order-form .form-actions:has(> .form-actions__legend) > .form-actions__legend { grid-area: legend; flex-direction: row; flex-wrap: wrap; gap: 0 8px; }
  .page.order-page .order-form .form-actions:has(> .form-actions__legend) > .form-actions__note { grid-area: note; margin: 0; color: var(--text-4); font-size: 12px; }
}

/* ---------- New order: numbered steps on one line, service tiles, the summary ---------- */
.page.order-page--new .op-layout { max-width: var(--r3-max); }
@media (min-width: 1181px) {
  .page.order-page--new .op-layout:has(> .op-summary) { grid-template-columns: minmax(0, 1fr) minmax(300px, 340px); gap: 24px; }
}
.page.order-page--new .op-form > .card, .page.order-page--new .op-form > .op-step { position: relative; margin: 0 0 16px; }
/* The steps hang on one line: a connector through the number badges. */
@media (min-width: 761px) {
  .page.order-page--new .op-form { position: relative; padding-inline-start: 56px; }
  .page.order-page--new .op-form::before { content: ""; position: absolute; inset-inline-start: 19px; top: 24px; bottom: 96px; width: 2px; border-radius: 2px;
    background: linear-gradient(180deg, var(--navy-200), var(--r3-line)); }
  .page.order-page--new .op-form :is(.op-step__head, .form-section__head, .order-more__head, .op-part__head, .op-team .op-step__head) .op-num {
    position: absolute; inset-inline-start: -56px; top: 14px; width: 40px; height: 40px; border: 3px solid var(--bg, #EEF1F6); }
}
.page.order-page--new .op-form .op-step--load .op-part { position: static; }
@media (min-width: 761px) { .page.order-page--new .op-form .op-part__head .op-num { position: absolute; } }
.page.order-page--new .op-form .op-num { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; box-sizing: border-box;
  background: var(--navy); color: #fff; font-size: 14px; font-weight: 800; }
.page.order-page--new .op-form :is(.op-step__head, .form-section__head) { padding: 18px 22px 6px; border: 0; background: transparent; }
.page.order-page--new .op-form .form-section__title, .page.order-page--new .op-form .order-more__title { display: flex; align-items: center; gap: 10px; color: var(--r3-ink); font-size: 18px; font-weight: 700; }
.page.order-page--new .op-form .form-section__title .ar, .page.order-page--new .op-form .order-more__title .ar { color: var(--text-3); font-size: 14px; font-weight: 500; }
.page.order-page--new .op-form .op-step > .card__body, .page.order-page--new .op-form .op-step__body { padding: 8px 22px 20px; }

/* Service: seven tiles, each with its pictogram. */
.page.order-page .op-choices:not(.op-choices--chips) { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 4px; margin: -4px; border: 0; background: none; overflow: visible; }
.page.order-page .op-choices:not(.op-choices--chips) > .op-choice { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 96px; margin: 0; padding: 14px 14px 12px;
  border: 1.5px solid var(--r3-line); border-radius: 12px; background: #fff; color: var(--text); text-align: start; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.page.order-page .op-choices:not(.op-choices--chips) > .op-choice > input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.page.order-page .op-choices:not(.op-choices--chips) > .op-choice > .op-choice__icon { order: -1; width: 32px; height: 32px; padding: 7px; box-sizing: border-box; border-radius: 10px; background: var(--navy-50); color: var(--navy); }
.page.order-page .op-choices:not(.op-choices--chips) > .op-choice > span, .page.order-page .op-choices:not(.op-choices--chips) > .op-choice > input:checked + span, .page.order-page .op-choices:not(.op-choices--chips) > .op-choice > input:focus-visible + span {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; outline: 0;
  color: inherit; text-align: start; }
.page.order-page .op-choices:not(.op-choices--chips) > .op-choice > span::before { content: none; display: none; }
.page.order-page .op-choices:not(.op-choices--chips) > .op-choice { align-items: flex-start; }
@media (forced-colors: active) {
  .page.order-page .op-choices:not(.op-choices--chips) > .op-choice:has(> input:checked) { outline: 3px solid Highlight; outline-offset: -3px; }
}
.page.order-page .op-choices:not(.op-choices--chips) > .op-choice .en { font-size: 14px; font-weight: 700; line-height: 1.25; }
.page.order-page .op-choices:not(.op-choices--chips) > .op-choice .ar:not(.sr-only) { color: var(--text-3); font-size: 13px; font-weight: 500; }
.page.order-page .op-choices:not(.op-choices--chips) > .op-choice:hover { border-color: var(--navy-200); box-shadow: 0 4px 12px rgba(15, 24, 48, .06); }
.page.order-page .op-choices:not(.op-choices--chips) > .op-choice:has(> input:checked) { border-color: var(--navy); background: var(--navy-50); box-shadow: 0 0 0 3px rgba(20, 50, 122, .12); }
.page.order-page .op-choices:not(.op-choices--chips) > .op-choice:has(> input:checked) > .op-choice__icon { background: var(--navy); color: #fff; }
.page.order-page .op-choices:not(.op-choices--chips) > .op-choice:has(> input:checked)::after { content: ""; position: absolute; top: 12px; inset-inline-end: 12px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--orange) center / 12px 12px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F1830' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.page.order-page .op-choices:not(.op-choices--chips) > .op-choice:has(> input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 2px; }
.page.order-page .op-choices:not(.op-choices--chips) > .op-choice:has(> input:disabled) { cursor: not-allowed; opacity: .6; }
.page.order-page .op-choices-field--chips .op-choices > .op-choice { min-height: 0; flex-direction: row; align-items: center; padding: 10px 12px; }
.page.order-page .op-choices-field--chips .op-choices > .op-choice > .op-choice__icon { width: 28px; height: 28px; padding: 6px; }

/* The order summary: a ticket beside the form, with how much creating still needs. */
.page.order-page--new .op-summary { top: calc(var(--header-h) + 16px); }
.page.order-page--new .op-summary__card { gap: 12px; padding: 0 0 16px; overflow: hidden; }
.page.order-page--new .op-summary__title { margin: 0; padding: 16px 18px; background: linear-gradient(120deg, var(--navy-950), var(--navy)); color: #fff; font-size: 16px; }
.page.order-page--new .op-summary__title .ar { color: rgba(255, 255, 255, .74); }
.page.order-page--new .op-summary__facts, .page.order-page--new .op-summary__subtitle, .page.order-page--new .op-summary__checks, .page.order-page--new .op-summary__note { margin-inline: 18px; }
.page.order-page--new .op-summary__row { padding: 6px 0; border-bottom: 1px dashed var(--r3-line); }
.page.order-page--new .op-summary__row:last-child { border-bottom: 0; }
.page.order-page--new .op-summary__meter { display: block; height: 6px; margin: -4px 18px 2px; border-radius: 6px; background: var(--r3-line-soft); overflow: hidden; }
.page.order-page--new .op-summary__meter > span { display: block; width: calc(var(--sum-done, 0) * 100%); height: 100%; border-radius: 6px; background: var(--orange); transition: width .25s ease; }
.page.order-page--new .op-summary.is-ready .op-summary__meter > span { background: var(--success); }
.page.order-page--new .op-summary__checks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }

/* Below the desktop the summary leads the form, compact: what creating still needs stays above Create order. */
@media (max-width: 1180px) {
  .page.order-page--new .op-layout:has(> .op-summary) > .op-summary { order: -1; }
}
@media (min-width: 761px) and (max-width: 1180px) {
  .page.order-page--new .op-summary__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
}

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  .page.order-page .op-head,
  .page.order-page.order-page--new .order-form-header.op-head,
  .page.order-page.order-page--edit .order-form-header.op-head,
  .page.order-page.order-page--view .view-summary.op-head { align-items: flex-start; margin: 0 0 14px; padding: 16px 16px 20px; border-radius: 14px; }
  .page.order-page .op-head::before, .page.order-page.order-page--edit .order-form-header.op-head::before, .page.order-page.order-page--new .order-form-header.op-head::before { inset-inline-start: 16px; width: 56px; }
  .page.order-page .op-head > .op-head__main { flex-basis: 100%; }
  .page.order-page .op-head .page-title { font-size: 24px; }
  .page.order-page .op-head .page-title > .ar, .page.order-page .op-head .page-title .ar { font-size: 16px; }
  .page.order-page .op-head .page-sub { font-size: 14px; }
  .page.order-page .op-head .page-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .page.order-page .op-head .page-actions > .btn { width: 100%; white-space: normal; }
  .page.order-page .order-more > .order-more__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; }
  .page.order-page .order-more > .order-more__head .order-more__hint { grid-column: 1; }
  .page.order-page .order-more > .order-more__head .order-more__chev { grid-column: 2; grid-row: 1; }
  .page.order-page.order-page--edit .order-form-header.op-head > .page-actions:has(> .order-actions:only-child) { width: auto; position: absolute; top: 12px; inset-inline-end: 12px; }
  .page.order-page.order-page--edit .order-form-header.op-head > .page-actions:not(:has(> .order-actions:only-child)) { flex-direction: row; align-items: center; }
  .page.order-page :is(.op-card__head, .order-more__head) { padding: 14px 16px 10px; }
  .page.order-page .op-panel--current > .op-card__head { padding: 16px 16px 12px; }
  .page.order-page .op-panel--current .op-panel__title { font-size: 18px; flex-basis: 100%; }
  .page.order-page .op-panel__body { padding: 14px 16px 6px; }
  .page.order-page .op-panel__foot { padding: 14px 16px 16px; }
  .page.order-page .op-earlier .op-chips { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; }
  .page.order-page .order-more__body { padding: 14px 14px 16px; }
  .page.order-page .op-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .page.order-page .op-choices:not(.op-choices--chips) > .op-choice { min-height: 84px; padding: 12px; }
  .page.order-page--new .op-form :is(.op-step__head, .form-section__head) { padding: 16px 16px 4px; }
  .page.order-page--new .op-form .op-step > .card__body, .page.order-page--new .op-form .op-step__body { padding: 6px 16px 16px; }
  .page.order-page--new .op-summary__checks { grid-template-columns: minmax(0, 1fr); }
  .page.order-page .order-form .form-actions { bottom: 0; margin-inline: calc(-1 * var(--gutter)); border-radius: 14px 14px 0 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); flex-wrap: nowrap; }
  .page.order-page .order-form .form-actions__legend { display: none; }
}

/* ---------- Round 3: light polish of the other pages (consistency only) ---------- */
/* The same card edge and elevation as the order screens; radii and layouts unchanged. */
.page:not(.order-page):not(.page--home) .card { border-color: #E2E8F0; box-shadow: 0 1px 2px rgba(15, 24, 48, .04), 0 6px 18px rgba(15, 24, 48, .04); }
.page .page-header .page-title { letter-spacing: -.01em; }
/* Settings overview: the four groups line up row by row; every link ends in its arrow. */
.page--settings .settings-groups { align-items: stretch; }
.page--settings .settings-groups > .card { display: flex; flex-direction: column; margin: 0; }
.page--settings .settings-link > .icon:last-child { flex: none; color: var(--text-4); transition: transform .15s, color .15s; }
.page--settings .settings-link:hover > .icon:last-child { color: var(--navy); transform: translateX(2px); }
.page--settings .settings-link:last-of-type { border-bottom: 0; }
/* Notifications: a little more air between the events. */
.notice-list .notice { border-radius: 10px; }
.page--narrow .notice-list { display: grid; gap: 8px; }
@media print {
  .page.order-page .op-head, .page.order-page.order-page--edit .order-form-header.op-head, .page.order-page.order-page--view .view-summary.op-head,
  .page.order-page.order-page--new .order-form-header.op-head { background: #fff; color: #000; box-shadow: none; border: 1px solid #999; }
  .page.order-page .op-head :is(.page-title, .page-sub, .page-header__eyebrow a, .ar, .lifecycle, .form-header-ng) { color: #000 !important; }
  .page.order-page .op-head::before { display: none; }
  .page.order-page .op-steps > .op-step--done > .icon { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .page .card, .page.order-page :is(.op-card, .op-step.card, .order-more.card) { box-shadow: none !important; }
}


/* ---------- The order's one action area (Owner 19/10) ----------
   The floating bar under the work holds where the order stands (current stage →
   next stage, or the closed status), what Next stage still needs, and every
   action: Discard changes · Save changes · Change stage · Next stage (owner's
   final decision 19/10). Stacked in the work column; the
   stages beside the buttons only where the bar itself is wide (container query). */
.page.order-page .order-form .form-actions.order-bar {
  container-type: inline-size; display: block; padding: 0; overflow: visible;
}
.page.order-page .order-bar__inner {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "track" "state" "buttons" "note";
  align-items: center; gap: 8px; padding: 12px 16px;
}
@container (min-width: 1000px) {
  .page.order-page .order-bar__inner { grid-template-columns: minmax(360px, 1fr) minmax(0, max-content); grid-template-areas: "track buttons" "state buttons" "note note"; column-gap: 20px; }
}
.page.order-page .order-bar__track { grid-area: track; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-width: 0; }
.page.order-page .order-bar__stage { display: inline-flex; flex-direction: column; gap: 1px; min-width: 0; }
.page.order-page .order-bar__k { color: var(--text-4); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.page.order-page .order-bar__k .ar { margin-inline-start: 4px; color: var(--text-4); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.page.order-page .order-bar__stage b { color: var(--r3-ink); font-size: 15px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.page.order-page .order-bar__stage b .ar { margin-inline-start: 4px; color: var(--text-3); font-size: 13px; font-weight: 500; }
.page.order-page .order-bar__stage--now { padding-inline-start: 10px; border-inline-start: 3px solid var(--navy); }
.page.order-page .order-bar__stage--next { padding-inline-start: 10px; border-inline-start: 3px solid var(--orange); }
.page.order-page .order-bar--closed .order-bar__stage--now { border-inline-start-color: var(--success); }
.page.order-page .order-bar__to { display: inline-flex; color: var(--text-4); }
[dir="rtl"] .page.order-page .order-bar__to .icon { transform: scaleX(-1); }
.page.order-page .order-bar__state { grid-area: state; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-width: 0; font-size: 13px; }
.page.order-page .order-bar__state [hidden] { display: none; }
.page.order-page .order-bar__state .op-foot__free { margin-inline-start: 0; }
.page.order-page .order-bar__state .ar { font-size: 12px; }
.page.order-page .order-bar__buttons { grid-area: buttons; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 10px; }
.page.order-page .order-bar__buttons > .btn--ghost:first-child { margin-inline-end: auto; }
.page.order-page .order-form .order-bar__buttons .btn { height: auto; min-height: 44px; padding-block: 6px; border-radius: 10px; white-space: normal; line-height: 1.25; }
.page.order-page .order-form .order-bar__buttons .btn--primary { min-width: 0; }
.page.order-page .order-bar__buttons .btn .ar { font-size: 12px; font-weight: 500; }
.page.order-page .order-bar__buttons .op-close .op-close__ready { display: inline; }
/* The button names its destination only where the bar is wide; the track above always does. */
.page.order-page .order-bar__buttons .op-close .op-close__to { display: none; }
@container (min-width: 900px) { .page.order-page .order-bar__buttons .op-close .op-close__to { display: inline; } }
.page.order-page .order-bar__buttons .op-close:disabled { background: var(--navy); color: #fff; opacity: .45; }
.page.order-page .order-bar__next { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 6px; min-width: 0; }
.page.order-page .order-bar__buttons .field-help:not([hidden]) { display: inline-flex; align-items: center; }
.page.order-page .order-bar__buttons .field-help[hidden] { display: none; }
.page.order-page .order-form .order-bar__note { grid-area: note; display: flex; flex-wrap: wrap; gap: 0 6px; margin: 0; color: var(--text-4); font-size: 12px; line-height: 1.4; }
.page.order-page .order-form .order-bar__note .ar { font-size: 12px; }
.page.order-page .order-stage-form[hidden] { display: none; }
/* Change stage: a small panel under the stages, its own form (#order-stage). */
.page.order-page .order-bar__change { margin-inline-start: auto; }
.page.order-page .order-bar__change > summary { list-style: none; cursor: pointer; min-height: 36px; border-radius: 10px; }
.page.order-page .order-bar__change > summary::-webkit-details-marker { display: none; }
.page.order-page .order-bar__change[open] { flex: 1 1 100%; margin-inline-start: 0; }
.page.order-page .order-bar__change-panel { display: grid; gap: 8px; margin-top: 10px; padding: 12px; border: 1px solid var(--r3-line); border-radius: 10px; background: #F8FAFC; }
.page.order-page .order-bar__change-field { margin: 0; }
.page.order-page .order-bar__change-field select { width: 100%; max-width: 420px; }
.page.order-page .order-bar__change-note { margin: 0; color: var(--text-3); font-size: 12.5px; line-height: 1.4; }
.page.order-page .order-bar__change-note .ar { font-size: 12.5px; }
.page.order-page .order-bar__change-note--wait { color: var(--danger); }
.page.order-page .order-bar__change-note[hidden] { display: none; }
.page.order-page .order-bar__change-panel > .btn { justify-self: start; min-height: 44px; border-radius: 10px; }
/* Phone: a compact bar — the two stages side by side, the buttons in one row, no legend. */
@media (max-width: 760px) {
  .page.order-page .order-bar__inner { gap: 6px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .page.order-page .order-bar__track { flex-wrap: wrap; gap: 6px 8px; }
  .page.order-page .order-bar__stage { flex: 1 1 35%; }
  .page.order-page .order-bar__change { flex: 1 1 100%; margin-inline-start: 0; }
  .page.order-page .order-bar__change > summary { width: 100%; min-height: 36px; justify-content: center; }
  .page.order-page .order-bar__k { font-size: 10px; }
  .page.order-page .order-bar__k .ar, .page.order-page .order-bar__stage b .ar { display: none; }
  .page.order-page .order-bar__stage b { font-size: 13.5px; }
  .page.order-page .order-bar__state .op-foot__free { display: none; }
  .page.order-page .order-form .order-bar__note { display: none; }
  .page.order-page .order-bar__buttons { flex-wrap: nowrap; gap: 8px; }
  .page.order-page .order-bar__buttons > .btn--ghost:first-child { margin-inline-end: 0; }
  .page.order-page .order-bar__buttons > :is(.btn, .order-bar__next) { flex: 1 1 0; min-width: 0; }
  .page.order-page .order-bar__next > .btn { flex: 1 1 auto; min-width: 0; }
  .page.order-page :is(.order-bar__buttons, .order-bar__next) > .btn { padding-inline: 8px; font-size: 13.5px; flex-direction: column; justify-content: center; gap: 0; text-align: center; }
  .page.order-page :is(.order-bar__buttons, .order-bar__next) > .btn > span { display: flex; flex-direction: column; align-items: center; }
  .page.order-page :is(.order-bar__buttons, .order-bar__next) > .btn .ar { display: block; margin: 0; }
  .page.order-page .order-bar__buttons .btn .icon { display: none; }
}
html:has(.order-page--edit .order-bar) { scroll-padding-bottom: 150px; }
/* Port costs switch (Owner 20/10 13:36): its own full row in the Port party grid; both options share it,
   so neither label is clipped next to the Port of Discharge field. */
.page.order-page :is(.form-grid, .op-grid, .port-picker__pod) > .port-picker__mode { grid-column: 1 / -1; }
@media (min-width: 481px) {
  .page.order-page .port-picker__mode .op-seg { display: flex; width: 100%; max-width: 560px; }
  .page.order-page .port-picker__mode .op-seg__opt { flex: 1 1 0; min-width: 0; }
  .page.order-page .port-picker__mode .op-seg__opt > span { width: 100%; }
}
/* ---------- Action bar, one layout (Owner 20/10 13:47) ----------
   Line 1: Current stage → Next stage. Line 2, one row: Change stage (left) · Discard · Save · Next stage (right).
   Line 3: the required/amounts state and the help text, small. Change stage opens its panel above the bar. */
.page.order-page .order-bar__inner,
.page.order-page .order-bar__inner { grid-template-columns: minmax(0, 1fr); grid-template-areas: "track" "buttons" "state" "note"; gap: 8px; }
@container (min-width: 1000px) { .page.order-page .order-bar__inner { grid-template-columns: minmax(0, 1fr); grid-template-areas: "track" "buttons" "state" "note"; } }
.page.order-page .order-bar__track { flex-wrap: nowrap; gap: 4px 12px; }
.page.order-page .order-bar__stage { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 0 6px; }
.page.order-page .order-bar__buttons { flex-wrap: nowrap; justify-content: flex-end; gap: 10px; }
.page.order-page .order-bar__buttons > .btn--ghost:first-child { margin-inline-end: 0; }
.page.order-page .order-bar__buttons > .order-bar__change { position: relative; margin-inline-start: 0; margin-inline-end: auto; flex: 0 0 auto; }
.page.order-page .order-bar__buttons > .order-bar__change[open] { flex: 0 0 auto; margin-inline-end: auto; }
.page.order-page .order-bar__buttons > .order-bar__change > summary { min-height: 44px; display: inline-flex; align-items: center; }
.page.order-page .order-bar__buttons > .order-bar__change > .order-bar__change-panel { position: absolute; bottom: calc(100% + 8px); inset-inline-start: 0; z-index: 30; width: min(420px, 80vw); margin: 0; box-shadow: 0 12px 32px rgba(15, 24, 48, .18); background: #fff; }
.page.order-page .order-bar__state, .page.order-page .order-form .order-bar__note { font-size: 12px; }
@media (max-width: 760px) {
  .page.order-page .order-bar__track { flex-wrap: wrap; }
  .page.order-page .order-bar__stage { flex-direction: column; gap: 1px; }
  .page.order-page .order-bar__buttons { flex-wrap: wrap; }
  .page.order-page .order-bar__buttons > .order-bar__change { flex: 1 1 100%; margin-inline-end: 0; }
  .page.order-page .order-bar__buttons > .order-bar__change > summary { width: 100%; justify-content: center; }
  .page.order-page .order-bar__buttons > .order-bar__change > .order-bar__change-panel { width: 100%; }
}
/* Edit page sections (Owner 20/10 13:47): one consistent 2-column grid that fills the section; From → To spans
   the row with full-width selects; one column on phones. */
@media (min-width: 761px) {
  .page.order-page.order-page--edit .order-more .form-section .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page.order-page.order-page--edit .order-more .form-section .form-grid > :is(.op-fromto, .op-part, .field--span-2, .transport-builder, fieldset, .field--static, .op-note, p) { grid-column: 1 / -1; }
}
.page.order-page .op-fromto { min-width: 0; }
.page.order-page .op-fromto__row { width: 100%; }
.page.order-page .op-fromto__part, .page.order-page .op-fromto__part select { width: 100%; }
@media (max-width: 760px) {
  .page.order-page.order-page--edit .order-more .form-section .form-grid { grid-template-columns: minmax(0, 1fr); }
}
/* Narrow bar (the work column beside the context rail): the buttons keep one line, English only (Arabic stays in title). */
.page.order-page .order-bar__buttons .btn, .page.order-page .order-bar__buttons > .order-bar__change > summary { white-space: nowrap; }
@container (max-width: 820px) {
  .page.order-page .order-bar__buttons :is(.btn, summary) .ar { display: none; }
}
.page.order-page .order-form .order-bar__buttons .btn > span, .page.order-page .order-bar__buttons .op-close__ready { white-space: nowrap; }
.page.order-page .order-form .order-bar__buttons .btn { white-space: nowrap; }
@container (max-width: 820px) {
  .page.order-page .order-form .order-bar__buttons :is(.btn, summary) .ar { display: none; }
}
/* The destination is already on line 1 (Next stage → …): the button just says Next stage. */
.page.order-page .order-form .order-bar__buttons .op-close .op-close__to { display: none; }
@container (min-width: 900px) { .page.order-page .order-form .order-bar__buttons .op-close .op-close__to { display: none; } }
/* The missing item, named and one click away (Owner 20/10 13:50). */
.page.order-page .op-foot__go { display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; border: 0; background: none; color: var(--danger); font: inherit; font-size: 12.5px; font-weight: 700; text-decoration: underline; cursor: pointer; }
.page.order-page .op-foot__go[hidden] { display: none; }
.page.order-page .op-foot__go .icon { width: 14px; height: 14px; }
/* ---------- New / Edit order: one calm, centred column (Owner 20/10 13:52) ----------
   The page (header band, work and the summary rail) is one centred block of a fixed max width; every part
   inside fills it, so the edges line up and the sticky bar sits under the work, centred with the page. */
.page.order-page:is(.order-page--edit, .order-page--new) { --r3-max: 100%; box-sizing: border-box; width: 100%; max-width: 1200px; margin-inline: auto; }
.page.order-page:is(.order-page--edit, .order-page--new) :is(.op-head, .op-layout, > .alert) { margin-inline: 0; }
.page.order-page:is(.order-page--edit, .order-page--new) .order-more .form-section + .form-section { margin-top: 16px; }
/* ---------- Design review 20/10 13:55 ---------- */
/* 1-2: a solid, compact bar; the help text lives in the buttons' tooltips; room under the work for the bar. */
.page.order-page .order-form .form-actions.order-bar { background: #fff; box-shadow: 0 -6px 20px rgba(15, 24, 48, .10); }
.page.order-page .order-form .order-bar__note { display: none; }
.page.order-page .order-bar__inner { gap: 6px; padding-block: 10px; }
.page.order-page.order-page--edit .op-work { padding-bottom: 24px; }
html:has(.order-page--edit .order-bar) { scroll-padding-bottom: 140px; }
/* 4: Scope chips — an even grid aligned with the service cards. */
.page.order-page .op-choices--chips:not([hidden]) { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.page.order-page .op-choices--chips > * { justify-content: center; text-align: center; }
/* 5: New order Route — the same full-width 2-column grid. */
@media (min-width: 761px) {
  .order-page--new .op-step--route .op-step__body .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-page--new .op-step--route .op-step__body .form-grid > :is(.op-fromto, .field--span-2, fieldset, p) { grid-column: 1 / -1; }
}
.order-page--new .op-step--route select { width: 100%; }
/* 7: the field the bar's link takes you to flashes orange. */
@keyframes op-flash { 0%, 70% { box-shadow: 0 0 0 3px var(--orange); } 100% { box-shadow: 0 0 0 3px transparent; } }
.page.order-page .is-flash { border-radius: 10px; animation: op-flash 1s ease-out; }
/* Service audit 20/10 14:06: labels never clip; the Team section is one row of three. */
.page.order-page .transport-builder > .field__label { overflow: visible; white-space: normal; }
@media (min-width: 761px) {
  .page.order-page.order-page--edit .order-more [data-ws-group="team"] .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* ---------- Change stage in the header (Owner 20/10 14:27): one tidy button; its small panel opens below. ---------- */
.page.order-page .op-head__stage { position: relative; align-self: center; margin-inline-start: auto; }
.page.order-page .op-head__change > summary { display: inline-flex; align-items: center; gap: 6px; min-height: var(--ctl-md); padding: 6px 14px; border: 1px solid rgba(255, 255, 255, .55); border-radius: 10px; background: rgba(255, 255, 255, .10); color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer; list-style: none; box-shadow: none; }
.page.order-page .op-head__change > summary:hover { background: rgba(255, 255, 255, .18); }
.page.order-page .op-head__change > summary .ar { color: rgba(255, 255, 255, .8); font-size: 12px; font-weight: 500; }
.page.order-page .op-head__change > summary::-webkit-details-marker { display: none; }
.page.order-page .op-head__change[open] { flex: none; margin: 0; }
.page.order-page .op-head__change > .order-bar__change-panel { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 40; width: min(340px, 86vw); margin: 0; padding: 12px; border: 1px solid var(--r3-line); border-radius: 12px; background: #fff; color: var(--text-1); box-shadow: 0 12px 32px rgba(15, 24, 48, .18); }
.page.order-page .op-head__change .order-bar__change-field select { max-width: none; }
.page.order-page .op-head__change .order-bar__change-field .field__label { color: var(--text-2); }
/* ---------- Variant 20/10 14:35: all order actions in the header (no bottom bar) ---------- */
.page.order-page.order-page--edit .order-form-header.op-head { position: sticky; top: calc(var(--header-h) + 8px); z-index: 25; align-items: center; padding-block: 16px 18px; }
.page.order-page .op-head__actions { flex: 1 1 520px; min-width: 0; display: flex; justify-content: flex-end; }
.page.order-page .op-head .form-actions.order-bar { position: static; container-type: normal; width: auto; max-width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.page.order-page .op-head .order-bar__inner { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding: 0; }
.page.order-page .op-head .order-bar__track, .page.order-page .op-head .order-bar__note { display: none; }
.page.order-page .op-head .order-bar__buttons { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.page.order-page .op-head .order-bar__buttons .ar, .page.order-page .op-head .order-bar__buttons summary .ar { display: none; }
.page.order-page .op-head .order-bar__buttons > .order-bar__change { margin: 0 6px 0 0; }
.page.order-page .op-head .order-form .order-bar__buttons .btn, .page.order-page .op-head .order-bar__buttons .btn { height: var(--ctl-md); min-height: var(--ctl-md); padding-inline: 16px; border-radius: 10px; }
.page.order-page .op-head .order-bar__buttons .btn--ghost { border: 1px solid rgba(255, 255, 255, .45); background: transparent; color: #fff; }
.page.order-page .op-head .order-bar__buttons .btn--secondary { border: 1px solid #fff; background: #fff; color: var(--navy); }
.page.order-page .op-head .order-bar__buttons .btn--primary { border: 0; background: var(--orange); color: #fff; }
.page.order-page .op-head .order-bar__buttons .op-close:disabled { background: var(--orange); opacity: .5; }
.page.order-page .op-head .order-bar__state { justify-content: flex-end; color: rgba(255, 255, 255, .85); font-size: 12px; }
.page.order-page .op-head .order-bar__state .op-foot__ok { color: #9BE3B5; }
.page.order-page .op-head .op-foot__go { color: #FFD08A; }
.page.order-page .op-head .op-foot__lock { color: #FFD08A; }
@media (max-width: 760px) {
  .page.order-page.order-page--edit .order-form-header.op-head { position: relative; top: auto; }
  .page.order-page .op-head__actions { flex-basis: 100%; }
  .page.order-page .op-head .order-bar__inner { align-items: stretch; }
  .page.order-page .op-head .order-bar__buttons { flex-wrap: wrap; }
  .page.order-page .op-head .order-bar__buttons > * { flex: 1 1 auto; }
}
@media (min-width: 761px) {
  .page.order-page .op-head__actions { flex: 0 1 auto; }
  .page.order-page.order-page--edit .op-head > .op-head__main { flex: 1 1 260px; min-width: 0; }
  .page.order-page .op-head .order-bar__buttons { flex-wrap: nowrap; }
}
.page.order-page .op-head .order-bar__buttons > .order-bar__change > summary { height: var(--ctl-md); min-height: var(--ctl-md); padding: 0 14px; border: 1px solid rgba(255, 255, 255, .45); background: transparent; color: #fff; }
/* New order: Team first, always open (Owner 20/10 14:38). */
.order-page--new .op-team--first .op-team__fields--open { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.order-page--new .op-team--first .op-team__fields--open > .field { min-width: 0; margin: 0; }
.order-page--new .op-team--first .op-team__fields--open select { width: 100%; }
@media (max-width: 760px) { .order-page--new .op-team--first .op-team__fields--open { grid-template-columns: minmax(0, 1fr); } }
/* Header buttons unified (Owner 20/10 14:42): one group, same 40px rounded box; three secondary outlined, Next = only filled primary. */
.page.order-page .op-head__actions .order-bar__buttons { display: flex; align-items: center; gap: 8px; }
.page.order-page .op-head__actions .order-bar__buttons > .order-bar__change { margin: 0; }
.page.order-page .op-head__actions .order-bar__buttons > .order-bar__change > summary,
.page.order-page .op-head__actions .order-bar__buttons .btn { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--ctl-md); min-height: var(--ctl-md); padding: 0 16px; border: 1px solid rgba(255,255,255,.55); border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; font-size: 14px; font-weight: 600; line-height: 1; text-decoration: none; box-shadow: none; opacity: 1; white-space: nowrap; }
.page.order-page .op-head__actions .order-bar__buttons > .order-bar__change > summary:hover,
.page.order-page .op-head__actions .order-bar__buttons .btn:not(.btn--primary):hover { background: rgba(255,255,255,.18); border-color: #fff; }
.page.order-page .op-head__actions .order-bar__buttons .btn--primary { border-color: var(--orange); background: var(--orange); color: #fff; }
.page.order-page .op-head__actions .order-bar__buttons .btn--primary:hover { filter: brightness(1.06); }
.page.order-page .op-head__actions .order-bar__buttons .btn:disabled,
.page.order-page .op-head__actions .order-bar__buttons .btn[aria-disabled="true"] { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.14); color: rgba(255,255,255,.6); filter: none; cursor: not-allowed; opacity: 1; }
/* New order: Create order / Cancel in the sticky header, same group as Edit (Owner 20/10 14:47). */
.page.order-page.order-page--new .order-form-header.op-head { position: sticky; top: calc(var(--header-h) + 8px); z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page.order-page .op-head__actions--new { flex: 0 1 auto; }
.page.order-page .op-head__actions--new .order-bar__buttons { flex-wrap: nowrap; }
@media (max-width: 760px) { .page.order-page.order-page--new .order-form-header.op-head { position: relative; top: auto; flex-wrap: wrap; } .page.order-page .op-head__actions--new { flex-basis: 100%; } .page.order-page .op-head__actions--new .order-bar__buttons > * { flex: 1 1 auto; } }
/* Polish 20/10 14:48: Next stays the only filled button (Save not orange on Completed); "⋯" menu matches the group; blocked line on one row. */
.page.order-page.order-page--edit .op-head > .order-actions > summary, .page.order-page.order-page--edit .op-head .order-actions > .btn { box-sizing: border-box; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.55); border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; display: inline-grid; place-items: center; }
.page.order-page.order-page--edit .op-head { align-items: center; }
.page.order-page .op-head .order-bar__state { max-width: 640px; }
.page.order-page .op-head .op-foot__go { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* Polish 20/10 14:53: Team fields line up (labels on one row, selects on one baseline). */
.order-form [data-service-section="3"] .form-grid, .order-form [data-service-section="3"] .op-grid { align-items: end; }
.order-form [data-service-section="3"] .field__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-form [data-service-section="3"] select { width: 100%; }
.page.order-page .order-form [data-service-section="3"] .section-fields > .form-grid { align-items: end !important; }
.page.order-page .order-form [data-service-section="3"] .form-grid > .field { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.page.order-page .order-form [data-service-section="3"] .form-grid > .field > .field__label { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page.order-page .order-form [data-service-section="3"] .form-grid > .field select,
.page.order-page .order-form [data-service-section="3"] .form-grid > .field .combo { width: 100%; max-width: none; }
.page.order-page .order-form [data-service-section="3"] .form-grid > .field { position: relative; }
.page.order-page .order-form [data-service-section="3"] .form-grid > .field > .field-help { position: absolute; top: 0; inset-inline-end: 0; margin: 0; }
.page.order-page .order-form [data-service-section="3"] .form-grid > .field:has(> .field-help) > .field__label { padding-inline-end: 20px; }
.page.order-page .order-form [data-service-section="3"] .form-grid > .field > select { height: var(--ctl-md); min-height: var(--ctl-md); }
/* Phone (keep 390 working, 13:56): the header buttons in a compact 2×2 grid so the stage card stays on the first screen. */
@media (max-width: 760px) {
  .page.order-page .op-head__actions .order-bar__buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .page.order-page .op-head__actions .order-bar__buttons > *, .page.order-page .op-head__actions .order-bar__buttons > .order-bar__change > summary { width: 100%; min-width: 0; padding-inline: 8px; font-size: 13px; }
  .page.order-page.order-page--edit .order-form-header.op-head { padding-block: 12px; gap: 8px; }
}
@media (max-width: 760px) {
  .page.order-page .op-head__actions .order-bar__buttons > .order-bar__change { margin: 0 !important; width: 100%; }
  .page.order-page .op-head__actions .order-bar__buttons > .order-bar__change > summary { box-sizing: border-box; width: 100%; justify-content: center; }
  .page.order-page .op-head .order-bar__state .ar { display: none; }
  .page.order-page .op-head .order-bar__state { font-size: 12px; justify-content: flex-start; }
}
@media (max-width: 760px) {
  .page.order-page .op-head .order-bar__state { line-height: 1.25; margin: 0; }
  .page.order-page .op-head .order-bar__inner { gap: 4px; }
  .page.order-page.order-page--edit .op-head .page-header__eyebrow { margin-bottom: 2px; }
}
@media (max-width: 760px) { .page.order-page.order-page--edit .order-form-header.op-head { padding-block: 10px; } .page.order-page .op-head__actions .order-bar__buttons > *, .page.order-page .op-head__actions .order-bar__buttons > .order-bar__change > summary { height: 36px; min-height: 36px; } }
/* Sidebar polish (Owner 20/10 15:40) — cosmetic only; same links and behaviour. */
@media (min-width: 1280px) {
  .brand { box-sizing: border-box; align-items: center; }
  .brand__product { font-size: 11px; letter-spacing: .08em; padding: 2px 6px; }
  .main-nav { display: flex; flex-direction: column; gap: 4px; }
  .main-nav .nav-link { box-sizing: border-box; border-radius: 10px; margin: 0; }
  .main-nav .nav-link .en { font-size: 14px; font-weight: 600; }
  body:not(.sidebar-compact) .main-nav .nav-link .ar { font-size: 12px; opacity: .72; font-weight: 500; }
  .main-nav .nav-link[aria-current="page"] { background: rgba(255,255,255,.12); box-shadow: inset 3px 0 0 var(--orange); }
  .main-nav .nav-link[aria-current="page"]::after { display: none; }
  /* Collapsed rail: centred wordmark, 44px icon tiles, avatar and toggle centred. */
  .sidebar-compact .brand { width: var(--sidebar-width); padding: 0; justify-content: center; }
  .sidebar-compact .brand img { width: 58px; height: auto; display: block; }
  .sidebar-compact .main-nav { align-items: center; padding: 12px 0; gap: 6px; }
  .sidebar-compact .main-nav .nav-link { width: 48px; height: 48px; min-height: 48px; padding: 0; justify-content: center; align-items: center; display: flex; }
  .sidebar-compact .main-nav .nav-link::before { margin: 0; }
  .sidebar-compact .main-nav .nav-link[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--orange); }
  .sidebar-compact .sidebar-toggle { inset-inline-start: calc((var(--sidebar-width) - 36px) / 2); }
  .sidebar-compact .main-nav { top: calc(var(--header-h) + 52px); }
  .sidebar-compact .header-actions > .menu:has(> .user-btn) { display: flex; justify-content: center; padding: 12px 0; }
  .sidebar-compact .user-btn { width: 40px; height: 40px; border-radius: 50%; }
}
/* ---------- Accounting group in the sidebar (Sardar 24/10/2026, accounts design 01) ----------
   "Accounting" expands: Cost Statement (the existing page), Invoice, Payment / Collection, Statement and
   Dashboard are indented under it. The sidebar (from 1280px) and the phone / tablet drawer list them under
   Accounting; the 1101–1279px top bar opens them under Accounting on hover / focus; the collapsed rail keeps
   the Accounting icon (it opens the Cost Statement list). The Accounting link itself is unchanged. */
.nav-group { position: relative; display: flex; flex-direction: column; gap: 2px; }
.nav-group > .nav-link { padding-inline-end: 34px; }
.nav-group__chev { position: absolute; top: 0; inset-inline-end: 12px; display: flex; align-items: center; height: 40px; color: rgba(255, 255, 255, 0.7); pointer-events: none; }
.nav-group__chev .icon { width: 14px; height: 14px; }
.nav-sub { display: flex; flex-direction: column; gap: 2px; }
.nav-sub__link {
  position: relative; display: flex; align-items: center; min-height: var(--ctl-sm); padding: 8px 12px 8px 46px;
  border-radius: 8px; color: rgba(255, 255, 255, 0.74); font-size: 13px; font-weight: 500; line-height: 1.3; text-decoration: none;
}
.nav-sub__link:hover { color: #fff; background: rgba(255, 255, 255, 0.07); text-decoration: none; }
.nav-sub__link[aria-current="page"] { color: #fff; font-weight: 600; background: var(--navy); box-shadow: inset 3px 0 0 var(--orange); }
.nav-sub__link:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.main-nav .nav-group > .nav-link[aria-current="true"] { color: #fff; font-weight: 600; background: rgba(255, 255, 255, 0.12); box-shadow: inset 3px 0 0 var(--orange); }
@media (min-width: 1280px) {
  .nav-group__chev { height: 52px; }
  .nav-sub__link { padding-inline-start: 38px; }  /* under the Accounting label (icon 16 + gap 10 + 12) */
  body.sidebar-compact .nav-sub, body.sidebar-compact .nav-group__chev { display: none; }
  body.sidebar-compact .main-nav .nav-group > .nav-link { padding-inline-end: 0; }
  body.sidebar-compact .main-nav .nav-group > .nav-link[aria-current="true"] { box-shadow: inset 0 -3px 0 var(--orange); }
}
@media (min-width: 1101px) and (max-width: 1279.98px) {
  .nav-group { flex-direction: row; align-items: center; }
  .nav-group > .nav-link { padding-inline-end: 12px; }
  .nav-group__chev { display: none; }
  .nav-sub {
    display: none; position: absolute; top: 100%; inset-inline-start: 0; z-index: 60; min-width: 230px; padding: 6px;
    border-radius: 0 0 8px 8px; background: var(--navy-900); box-shadow: 0 12px 28px rgba(8, 14, 30, 0.35);
  }
  .nav-group:hover > .nav-sub, .nav-group:focus-within > .nav-sub { display: flex; }
  .nav-sub__link { padding-inline-start: 14px; }
}
@media (max-width: 1100px) {
  .nav-group__chev { height: 48px; }
  .nav-sub__link { min-height: 44px; padding-inline-start: 46px; font-size: 14px; }
}
/* Change stage panel in the header group: a proper white card under the button (20/10 15:46). */
.page.order-page .op-head__actions .order-bar__change { position: relative; }
.page.order-page .op-head__actions .order-bar__change > .order-bar__change-panel { position: absolute; top: calc(100% + 8px); inset-inline-start: 0; z-index: 40; box-sizing: border-box; width: 340px; margin: 0; padding: 14px; display: grid; gap: 10px; border: 1px solid var(--r3-line, #E3E8F0); border-radius: 12px; background: #fff; color: var(--text-1, #1B2333); box-shadow: 0 12px 32px rgba(15,24,48,.18); white-space: normal; }
.page.order-page .op-head__actions .order-bar__change-panel .field, .page.order-page .op-head__actions .order-bar__change-panel label { margin: 0; background: none; color: var(--text-2, #4A5568); }
.page.order-page .op-head__actions .order-bar__change-panel select { width: 100%; max-width: none; height: var(--ctl-md); }
.page.order-page .op-head__actions .order-bar__change-panel .btn { width: 100%; justify-content: center; height: var(--ctl-md); border: 0; background: var(--orange); color: #fff; }
.page.order-page .op-head__actions .order-bar__change-panel .btn:disabled { background: #E3E8F0; color: #6B7280; }
.page.order-page .op-head__actions .order-bar__change-panel .ar { display: inline; }
.page.order-page .op-head__actions .order-bar__change > .order-bar__change-panel { height: auto !important; min-height: 0 !important; max-height: none !important; }
.page.order-page .op-head__actions .order-bar__change > .order-bar__change-panel { top: calc(100% + 8px) !important; bottom: auto !important; inset-inline-end: auto !important; }
.page.order-page .order-form [data-service-section="3"] .form-grid > .field > .field__label { white-space: normal; overflow: visible; text-overflow: clip; }
/* Customs / leg rows: the broker select and description fill their columns (20/10 15:46). */
.order-form .assignment-row--leg > .field, .order-form .assignment-row--leg > label { min-width: 0; }
.order-form .assignment-row--leg select, .order-form .assignment-row--leg input:not([type=checkbox]):not([type=radio]) { width: 100%; max-width: none; }
@media (max-width: 760px) { .page.order-page.order-page--edit .op-head .page-title { font-size: 24px; line-height: 1.15; margin: 0; } .page.order-page.order-page--edit .op-head .op-head__main p:not(.page-header__eyebrow) { font-size: 13px; margin-top: 4px; } }
@media (max-width: 760px) { .page.order-page.order-page--edit .order-form-header.op-head { padding-block: 8px; margin-bottom: 8px; } .page.order-page.order-page--edit .op-head .page-header__eyebrow { margin: 0; } }
/* Owner 20/10 16:01: the "All order details" tab list in the side column (a side card), content full width. */
@media (min-width: 1180px) {
  .page.order-page .order-more__body.ws.ws--side { grid-template-columns: minmax(0, 1fr) !important; }
  .page.order-page .order-more__body.ws.ws--side > :not(.ws-nav) { grid-column: 1 !important; }
  .page.order-page .ws-side .ws-nav { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 10px 12px 12px; position: static; overflow: visible; }
  .page.order-page .ws-side .ws-tab { width: 100%; min-height: 40px; padding: 7px 34px 7px 12px; border: 0; border-radius: 8px; background: transparent; box-shadow: none; text-align: start; display: flex; align-items: baseline; gap: 8px; }
  .page.order-page .ws-side .ws-tab:hover { background: var(--r3-soft, #F3F5F9); }
  .page.order-page .ws-side .ws-tab__en { font-size: 14px; font-weight: 600; color: var(--text-1, #1B2333); }
  .page.order-page .ws-side .ws-tab__ar { font-size: 12px; color: var(--text-3, #6B7280); }
  .page.order-page .ws-side .ws-tab.is-active { background: #EEF2FA; box-shadow: inset 3px 0 0 var(--navy); }
  .page.order-page .ws-side .ws-tab.is-active .ws-tab__en { color: var(--navy); }
  .page.order-page .ws-side .ws-tab.has-error:not(.is-active) { background: var(--danger-bg); }
  .page.order-page .ws-side__head { padding: 12px 16px; }
}
@media (min-width: 1180px) and (min-height: 760px) {
  .page.order-page .op-rail:has(.ws-side) { position: sticky; top: calc(var(--header-h) + 140px); align-self: start; }
}

/* Order lists (Sardar 20/10 16:06): the stage circle shows an icon, same colours. */
.badge__step--icon .icon { width: 12px; height: 12px; stroke-width: 2.4; }

/* Side "Order details" nav reads as buttons (Sardar 20/10 16:15): bordered tile,
   pencil "Edit" cue + chevron, hover / focus / clear active state. */
@media (min-width: 761px) {
  .page.order-page .ws-side .ws-nav { gap: 6px; }
  .page.order-page .ws-side .ws-tab {
    position: relative; align-items: center; min-height: 44px; padding: 8px 64px 8px 12px; cursor: pointer;
    border: 1px solid var(--r3-line, #D9DEE8); border-radius: 10px; background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
  }
  .page.order-page .ws-side .ws-tab::after {
    content: attr(data-edit-label); position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%);
    font-size: 12px; font-weight: 600; color: var(--text-3, #6B7280);
  }
  .page.order-page .ws-side .ws-tab:hover { border-color: var(--navy-200, #B8C3DD); background: #F6F8FC; box-shadow: 0 2px 6px rgba(20, 50, 122, .10); }
  .page.order-page .ws-side .ws-tab:hover::after { color: var(--navy); }
  .page.order-page .ws-side .ws-tab:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--navy); }
  .page.order-page .ws-side .ws-tab.is-active { border-color: var(--navy); background: var(--navy); box-shadow: 0 4px 10px rgba(20, 50, 122, .22); }
  .page.order-page .ws-side .ws-tab.is-active .ws-tab__en { color: #fff; }
  .page.order-page .ws-side .ws-tab.is-active .ws-tab__ar { color: rgba(255, 255, 255, .82); }
  .page.order-page .ws-side .ws-tab.is-active::after { content: attr(data-editing-label); color: rgba(255, 255, 255, .9); }
  .page.order-page .ws-side .ws-tab.has-error:not(.is-active) { border-color: var(--danger-bd); background: var(--danger-bg); }
  .page.order-page .ws-side .ws-tab__flag { inset-inline-end: 54px; }
}
@media (min-width: 761px) {
  .page.order-page .ws-side .ws-tab { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; text-align: start; }
}
/* BL / AWB line of the Shipment card: a document icon like its neighbours. */
.page.order-page .op-fact:is([data-fact="bl_number"], [data-fact="air_awb"]) { --r3-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M8 13h8M8 17h5'/%3E%3C/svg%3E"); }
@media (min-width: 761px) { .page.order-page .ws-side .ws-tab.is-active:is(:hover, :focus-visible) { background: var(--navy); border-color: var(--navy); } }

/* Sardar 20/10 16:24: no coloured start bar on field wrappers; the asterisk and
   the "✓ chosen" / "Required" line carry the state. Fields get their width back. */
.order-page .field--stage,
.order-page .op-panel [data-op-slot][data-op-kind]:not([data-op-later]),
.order-page .op-panel .op-ro:has(.op-state__req) { box-shadow: none; padding-inline-start: 0; }
/* Sardar 20/10 16:25: no decorative coloured start bars on the order pages
   (sections, All order details, fee blocks, stage card, New order): clean,
   uniform card borders. */
.order-page :is(.form-section, .op-sub, .op-part, .op-box, .op-panel, .order-more, .order-more__body, .op-step, .card, [data-service-section], .transport-builder, .port-picker, .port-picker__pod, .op-party, .party-charges)::before { content: none !important; }
.page.order-page .op-form::before { content: none !important; }
.order-page .alert.archive-banner { border-inline-start-width: 1px; }

/* Accounting pages match the order pages (Sardar 20/10 16:33): English-only
   buttons, one tidy rounded button group, no coloured start bar on alerts. */
:is(.page--statement, .page--accounts) :is(.btn, button) .ar { display: none; }
.page--statement .page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page--statement .page-actions :is(.btn, button) { min-height: var(--ctl-md); border-radius: 10px; }
:is(.page--statement, .page--accounts, .order-page) .alert { border-inline-start-width: 1px; }
/* A closed help popup takes no room; an open one never runs past the page edge. */
.order-page details.field-help:not([open]) > .field-help__pop { display: none; }
@media (min-width: 761px) {
.order-page details.field-help > .field-help__pop { max-width: min(320px, calc(100vw - 32px)); }
.order-page .op-fromto details.field-help > .field-help__pop,
.order-page .form-grid > :nth-child(2n) details.field-help > .field-help__pop { inset-inline-start: auto; inset-inline-end: 0; }
}

/* Cost statement declutter (Sardar 20/10 16:45). */
.page--statement .statement-back { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.page--statement .statement-back:hover { text-decoration: underline; }
.page--statement .statement-actions { justify-content: flex-end; }
.page--statement .statement__hint { margin: 0; padding: 10px 16px 14px; font-size: 12px; color: var(--text-3); }
.page--statement .statement__hint .ar { margin-inline-start: 6px; }
.page--statement .statement__bar { padding-block: 10px; }

/* Phone (PR #113): an empty BL / AWB line ("—") is left out of the phone Shipment
   card so the stage card stays on the first screen; a typed number still shows. */
@media (max-width: 760px) {
  .page.order-page .op-rail .op-fact[data-fact="bl_number"]:has(> dd > .muted:only-child),
  .page.order-page .op-rail .op-fact[data-fact="air_awb"]:has(> dd > .muted:only-child) { display: none; }
}



/* Statement without the Stage column (Sardar 17:00): flags sit above the vendor role. */
.page--statement .line-vendor__flag { display: inline-block; margin-bottom: 4px; }

/* Help next to the header Next button opens towards the page, not past its edge. */
.order-page .order-bar__next details.field-help > .field-help__pop { inset-inline-start: auto; inset-inline-end: 0; }

/* Phone header actions stay inside the card (PR #113 visual pass): the button grid
   shrinks to the header width instead of running past its right edge. */
@media (max-width: 760px) {
  .page.order-page .op-head__actions, .page.order-page .op-head .order-bar, .page.order-page .op-head .order-bar__inner,
  .page.order-page .op-head .order-bar__state { min-width: 0; max-width: 100%; box-sizing: border-box; }
  .page.order-page .op-head__actions { flex: 1 1 100%; width: 100%; }
  .page.order-page .op-head__actions .order-bar__buttons { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; min-width: 0; }
  .page.order-page .op-head__actions .order-bar__buttons > .order-bar__next > .btn { width: 100%; min-width: 0; }
  .page.order-page .op-head .op-foot__go { width: 100%; }
}
@media (max-width: 760px) {
  .page.order-page .op-head__actions .order-bar__buttons { position: relative; }
  .page.order-page .op-head__actions .order-bar__buttons > .order-bar__change { position: static; }
  .page.order-page .op-head__actions .order-bar__change > .order-bar__change-panel { inset-inline-start: 0 !important; width: 100% !important; max-width: 100% !important; box-sizing: border-box; }
}

/* No coloured start bar on phone list cards either (Sardar 16:25); the status pill carries the state. */
@media (max-width: 900px) { .data--cards tbody tr.row--completed, .data--cards tbody tr.row--cancelled { border-inline-start-width: 1px; border-inline-start-color: var(--border, #E3E8F0); } }

/* Accounting list: a long stage name stays on one line in its pill (Quality P2-1, 20/10); look unchanged. */
/* Desktop only (Quality P2-2): on a phone card the pill keeps its approved two-line shape, so it
   never covers the NG number. */
@media (min-width: 901px) {
  .page--accounts .accounts-list .data td.col-status .badge { flex-wrap: nowrap; white-space: nowrap; }
  .page--accounts .accounts-list .data td.col-status .badge { max-width: none; } .page--accounts .accounts-list .data td.col-status { white-space: nowrap; }
  .page--accounts .accounts-list .data td.col-status .badge > .en { white-space: nowrap; flex: 0 0 auto; }
  .page--accounts .accounts-list .data td.col-status .badge > .ar { white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- Cost approval page (Sardar 20-21/10/2026, designs cost-approval-2026-10-20 *-v0040) ---------- */
.page--costs { --cx-navy: #14327A; --cx-green: #16A34A; --cx-line: #E6EAF0; --cx-muted: #6B7689; --cx-field: #DFE3E9; display: block; }
.page--costs .cx-hero { position: relative; margin: 19px 0 24px; padding: 20px 28px 22px; border-radius: 10px; color: #fff;
  background: linear-gradient(90deg, #14327A 0%, #1B2541 100%); box-shadow: 0 2px 6px rgba(14, 22, 41, .12); min-height: 134px; box-sizing: border-box; }
.page--costs .cx-hero__back { color: #C9D2E6; font-size: 12px; text-decoration: none; }
.page--costs .cx-hero__row { display: flex; align-items: center; gap: 12px; margin: 10px 0 6px; }
.page--costs .cx-hero__ng { margin: 0; font-family: var(--mono); font-size: 28px; font-weight: 600; letter-spacing: .5px; color: #fff; line-height: 1.1; }
.page--costs .cx-hero__sub { margin: 0; color: #D5DCEA; font-size: 13px; }
.page--costs .cx-hero__sub .cx-nowrap { white-space: nowrap; }  /* "Cost / Sell" never split (audit 27/10/2026) */
.page--costs .cx-pill { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 10px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.page--costs .cx-pill--progress { background: #FFF4E5; color: #9A4D00; border: 1px solid #F47B20; }
.page--costs .cx-pill--done { background: #48567A; color: #fff; }
.page--costs .cx-pill--final { background: var(--cx-green); color: #fff; }
.page--costs .cx-pill .cx-lock { width: 11px; height: 11px; }
.page--costs .cx-lock { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; vertical-align: -2px; }
.page--costs .cx-card { background: #fff; border: 1px solid var(--cx-line); border-radius: 10px; box-shadow: 0 1px 2px rgba(14, 22, 41, .04); margin-bottom: 24px; }
.page--costs .cx-card__head { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 24px; border-bottom: 1px solid var(--cx-line); box-sizing: border-box; }
.page--costs .cx-card__title { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
.page--costs .cx-badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 10px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; background: #EEF1F6; color: #56657A; border: 1px solid #DFE5EE; }
.page--costs .cx-badge--edit { background: #FFF4E5; color: #9A4D00; border-color: #F47B20; }
.page--costs .cx-badge--final { background: #E7F6EC; color: #166534; border-color: #16A34A; }
.page--costs .cx-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.page--costs .cx-side { display: grid; gap: 0; }
.page--costs .cx-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.page--costs .cx-lines__body { padding: 8px 24px 24px; }
.page--costs .cx-table th { padding: 12px 6px 8px; text-align: start; font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #56657A; border-bottom: 1px solid var(--cx-line); white-space: nowrap; }
.page--costs .cx-table td { padding: 9px 6px; border-bottom: 1px solid var(--cx-line); vertical-align: middle; }
.page--costs .cx-table th.cx-num, .page--costs .cx-table td.cx-num { text-align: end; }
.page--costs .cx-item { position: relative; padding-inline-start: 22px !important; width: 26%; }
.page--costs .cx-row--new .cx-item { padding-inline-start: 6px !important; }
.page--costs .cx-item > .cx-lock { position: absolute; inset-inline-start: 2px; top: 50%; margin-top: -7px; color: #8A94A6; }
.page--costs .cx-item__name { display: block; font-weight: 600; color: var(--text); font-size: 13.5px; }
.page--costs .cx-item__sub { display: block; color: var(--cx-muted); font-size: 11.5px; margin-top: 1px; }
.page--costs .cx-select--ctype { display: block; margin-top: 4px; }
.page--costs .cx-ctype { display: inline-block; margin-inline-start: 6px; padding: 1px 6px; border-radius: 4px; background: #EEF2FA; color: #14327A; font-size: 12px; font-weight: 600; white-space: nowrap; }
.page--costs .cx-unit { width: 13%; } .page--costs .cx-qty { width: 6%; } .page--costs .cx-cur { width: 10%; }
.page--costs .cx-table td.cx-qty, .page--costs .cx-table th.cx-qty { text-align: center; }
.page--costs .cx-del { width: 40px; text-align: end; }
.page--costs .cx-total { font-weight: 700; color: var(--text); white-space: nowrap; }
.page--costs .cx-field, .page--costs .cx-select select, .page--costs .cx-select input { box-sizing: border-box; height: 40px; width: 100%; padding: 0 12px; border: 1px solid #C9D2DF; border-radius: 6px; background: #fff; font: inherit; font-size: 13px; color: var(--text); }
.page--costs .cx-field--num { text-align: end; }
.page--costs .cx-field--qty { width: 52px; text-align: center; padding: 0 4px; margin: 0 auto; display: block; }
.page--costs .cx-field:focus, .page--costs .cx-select select:focus, .page--costs .cx-select input:focus { outline: none; border-color: #F47B20; box-shadow: 0 0 0 1px #F47B20; }
.page--costs .cx-field--ro { display: flex; align-items: center; background: #EDF0F4; border-color: var(--cx-field); color: #56657A; }
.page--costs .cx-field--ro.cx-field--num { justify-content: flex-end; gap: 6px; }
.page--costs .cx-field--ro.cx-field--qty { justify-content: center; }
.page--costs .cx-select { position: relative; display: block; }
.page--costs .cx-select select { appearance: none; -webkit-appearance: none; padding-inline-end: 26px; }
.page--costs .cx-select input::placeholder, .page--costs .cx-field::placeholder { color: #A3ACBA; }
.page--costs .cx-caret { position: absolute; inset-inline-end: 11px; top: 50%; width: 8px; height: 5px; margin-top: -2px; fill: none; stroke: #56657A; stroke-width: 1.6; pointer-events: none; }
.page--costs .cx-select--vendor { margin-top: 8px; }
.page--costs .cx-row--new .cx-select select, .page--costs .cx-row--new .cx-select input, .page--costs .cx-row--new .cx-field { border-color: #D5DBE4; }
.page--costs .cx-row--new .cx-select--vendor select { border-color: #F47B20; }
.page--costs .cx-trash { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid #D5DBE4; border-radius: 6px; background: #fff; color: #56657A; cursor: pointer; }
.page--costs .cx-trash svg { width: 15px; height: 15px; }
/* Design 22/10 (707b660 follow-up): a row that cannot be deleted keeps a disabled trash. */
.page--costs .cx-trash:disabled { color: #C2C9D4; border-color: #E6EAF0; background: #F7F8FA; cursor: not-allowed; }
.page--costs .cx-lines__add, .page--costs .cx-late { display: flex; justify-content: flex-end; gap: 10px; padding-top: 10px; }
.page--costs .cx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 6px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; }
.page--costs .cx-btn svg { width: 15px; height: 15px; }
.page--costs .cx-btn--dashed { border: 1px dashed #98A2B3; background: #fff; color: var(--text); }
.page--costs .cx-btn--outline { border: 1px solid var(--cx-navy); background: #fff; color: var(--cx-navy); }
.page--costs .cx-btn--primary { border: 0; background: #F47B20; color: #1B2642; }
.page--costs .cx-btn--navy { border: 0; background: var(--cx-navy); color: #fff; height: 32px; padding: 0 14px; }
.page--costs .cx-reopen { fill: none; stroke: currentColor; stroke-width: 2.2; }
.page--costs .cx-run__body, .page--costs .cx-summary__body { padding: 16px 24px; }
.page--costs .cx-sum { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--cx-line); border-radius: 8px; font-size: 15px; }
.page--costs .cx-sum th { background: #F7F8FA; padding: 10px 16px; font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #56657A; text-align: start; border-bottom: 1px solid var(--cx-line); }
.page--costs .cx-sum th:first-child { border-top-left-radius: 8px; } .page--costs .cx-sum th:last-child { border-top-right-radius: 8px; }
.page--costs .cx-sum td { padding: 0 16px; height: 50px; border-bottom: 1px solid var(--cx-line); font-weight: 500; color: var(--text); }
.page--costs .cx-sum tr:last-child td { border-bottom: 0; }
.page--costs .cx-sum .cx-num { text-align: end; }
.page--costs .cx-cur-pill { display: inline-block; min-width: 58px; padding: 2px 0; border-radius: 999px; background: #EEF1F8; color: #1B2A4D; font-size: 10px; font-weight: 700; text-align: center; }
.page--costs .cx-sum td.cx-profit { color: var(--cx-green); font-weight: 700 !important; }
.page--costs .cx-profit.is-neg { color: var(--danger); }
.page--costs .cx-run__foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 14px 24px; background: #F7F8FA; border-top: 1px solid var(--cx-line); border-radius: 0 0 10px 10px; }
.page--costs .cx-run__foot .cx-btn { height: 36px; }
.page--costs .cx-steps { list-style: none; margin: 0; padding: 14px 24px 18px; display: grid; gap: 18px; }
.page--costs .cx-step { display: flex; gap: 10px; align-items: flex-start; }
.page--costs .cx-step b { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.page--costs .cx-step small { display: block; font-size: 11.5px; color: var(--cx-muted); }
.page--costs .cx-step__dot { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #98A2B3; color: #56657A; font-size: 11px; font-weight: 600; background: #fff; box-sizing: border-box; }
.page--costs .cx-step__dot svg { width: 13px; height: 13px; }
.page--costs .cx-step.is-done .cx-step__dot { background: var(--cx-green); border-color: var(--cx-green); color: #fff; }
.page--costs .cx-step.is-now .cx-step__dot { background: #F47B20; border-color: #F47B20; color: #1B2642; }
.page--costs .cx-step.is-wait { opacity: .45; }
.page--costs .cx-step.is-wait .cx-step__dot { border-color: #C9D2DF; }
.page--costs .cx-ship__list { margin: 0; padding: 16px 24px 18px; }
.page--costs .cx-ship__list dt { font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #56657A; margin-top: 12px; }
.page--costs .cx-ship__list dt:first-child { margin-top: 0; }
.page--costs .cx-ship__list dd { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: var(--text); }
.page--costs .cx-summary--await { border-color: #F47B20; }
.page--costs .cx-summary__body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.page--costs .cx-appr__label { margin: 0 0 8px; font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #56657A; }
.page--costs .cx-appr__btn { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 16px; margin: 0 0 12px; border-radius: 8px; box-sizing: border-box; }
.page--costs .cx-appr__btn b { display: block; font-size: 14px; font-weight: 600; }
.page--costs .cx-appr__btn small { display: block; font-size: 11.5px; }
.page--costs .cx-appr__btn .cx-btn { margin-inline-start: auto; }
.page--costs .cx-appr__ring { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; box-sizing: border-box; }
.page--costs .cx-appr__ring svg { width: 15px; height: 15px; }
.page--costs .is-pending { border: 1.5px solid var(--cx-navy); color: var(--cx-navy); background: #fff; }
.page--costs .is-pending .cx-appr__ring { border: 2px solid var(--cx-navy); }
.page--costs .is-pending small { color: var(--cx-muted); }
.page--costs .is-approved { background: var(--cx-green); color: #fff; }
.page--costs .is-approved .cx-appr__ring { background: rgba(255, 255, 255, .25); color: #fff; }
.page--costs .is-locked { background: #F1F3F6; border: 1px solid #E3E7ED; color: #B6BDC9; }
.page--costs .is-locked .cx-appr__ring { background: #E3E7ED; color: #B6BDC9; }
.page--costs .cx-summary__foot { padding: 14px 24px; border-top: 1px solid var(--cx-line); }
.page--costs .cx-history summary { cursor: pointer; font-size: 14px; font-weight: 600; }
#main:has(> .page--costs), body:has(.page--costs) #main { background: #F4F6F9; } /* Sardar 21/10: not on body, so the navy sidebar column stays full height */
/* cost approval — pass 2 sizes measured against *-v0040 at 1440 */
.page--costs .cx-hero { min-height: 133px; padding: 19px 28px 20px; }
.page--costs .cx-hero__back { font-size: 13px; }
.page--costs .cx-hero__ng { font-size: 31px; }
.page--costs .cx-hero__sub { font-size: 14px; }
.page--costs .cx-pill, .page--costs .cx-badge { height: 22px; font-size: 11.5px; padding: 0 11px; }
.page--costs .cx-card__title { font-size: 16.5px; }
.page--costs .cx-sum { font-size: 17px; }
.page--costs .cx-sum th { font-size: 11px; padding: 9px 16px; }
.page--costs .cx-cur-pill { min-width: 88px; padding: 3px 0; font-size: 11px; }
.page--costs .cx-summary__foot { background: #F7F8FA; padding: 16px 24px; border-radius: 0 0 10px 10px; }
.page--costs .cx-btn--outline { height: 40px; font-size: 14px; padding: 0 17px; }
.page--costs .cx-appr__btn { border-width: 2px; }
.page--costs .cx-appr__btn b { font-size: 15px; }
.page--costs .cx-appr__btn small { font-size: 12.5px; }
.page--costs .cx-btn--navy { font-size: 14px; height: 32px; padding: 0 14px; }
.page--costs .is-locked .cx-appr__ring { background: #fff; border: 1px solid #E3E7ED; }
.page--costs .cx-appr__label { font-size: 11px; }
.page--costs .cx-step b { font-size: 15px; }
.page--costs .cx-step small { font-size: 12.5px; }
.page--costs .cx-step__dot { width: 24px; height: 24px; font-size: 12px; }
.page--costs .cx-step__dot svg { width: 14px; height: 14px; stroke-width: 3; }
.page--costs .cx-steps { gap: 17px; padding: 18px 24px 20px; }
/* pass 3 */
.page--costs .cx-hero__back { font-size: 13.8px; }
.page--costs .cx-hero__back { display: inline-flex; align-items: center; gap: 6px; }  /* Design 24/10 P2-5: the icon back link, as on the order pages */
.page--costs .cx-hero__row { margin: 7px 0 7px; }
.page--costs .cx-pdf-actions { margin-inline-start: auto; display: inline-flex; gap: 8px; flex-wrap: wrap; }
.page--costs .cx-pdf-actions .cx-btn { min-height: var(--ctl-sm); font-size: 12px; padding-inline: 13px; }
.page--costs .cx-sum { font-size: 16.3px; }
.page--costs .cx-sum td.cx-profit { font-weight: 600 !important; }
.page--costs .cx-step b { font-size: 13.8px; }
.page--costs .cx-step small { font-size: 11.6px; }
.page--costs .cx-steps { padding-top: 14px; }
/* pass 4: exact column grid (design 04 entry / 01-03 read-only) */
.page--costs .cx-lines__body { padding: 0 24px 24px; }
.page--costs .cx-table { table-layout: fixed; width: 1101px; max-width: 100%; }
.page--costs .cx-table th, .page--costs .cx-table td { padding: 0; }
.page--costs .cx-table th { height: 37px; vertical-align: middle; }
.page--costs .cx-table td { height: 60px; }
.page--costs .cx-table--edit .c-item { width: 256px; } .page--costs .cx-table--edit .c-unit { width: 140px; }
.page--costs .cx-table--edit .c-qty { width: 68px; } .page--costs .cx-table--edit .c-cur { width: 108px; }
.page--costs .cx-table--edit .c-cpu, .page--costs .cx-table--edit .c-ct, .page--costs .cx-table--edit .c-spu { width: 124px; }
.page--costs .cx-table--edit .c-st { width: 117px; } .page--costs .cx-table--edit .c-del { width: 40px; }
.page--costs .cx-table--ro .c-item { width: 256px; } .page--costs .cx-table--ro .c-unit { width: 164px; }
.page--costs .cx-table--ro .c-qty { width: 68px; } .page--costs .cx-table--ro .c-cur { width: 108px; }
.page--costs .cx-table--ro .c-cpu, .page--costs .cx-table--ro .c-ct, .page--costs .cx-table--ro .c-spu { width: 136px; }
.page--costs .cx-table--ro .c-st { width: 97px; }
.page--costs .cx-item { width: auto; padding-inline-start: 20px !important; }
.page--costs .cx-unit, .page--costs .cx-qty, .page--costs .cx-cur { width: auto; }
.page--costs .cx-table td.cx-qty, .page--costs .cx-table th.cx-qty { text-align: start; }
.page--costs .cx-field--qty { margin: 0; width: 56px; }
.page--costs .cx-table--edit .cx-unit .cx-select { width: 128px; } .page--costs .cx-table--edit .cx-cur .cx-select { width: 96px; }
.page--costs .cx-table--edit .cx-cpu .cx-field, .page--costs .cx-table--edit .cx-spu .cx-field { width: 112px; }
.page--costs .cx-table--ro .cx-unit .cx-field { width: 152px; } .page--costs .cx-table--ro .cx-cur .cx-field { width: 96px; }
.page--costs .cx-table--ro .cx-cpu .cx-field, .page--costs .cx-table--ro .cx-spu .cx-field { width: 124px; }
.page--costs .cx-table--ro .cx-field { height: 38px; background: #F1F3F6; border-color: #E1E5EC; color: #6B7487; }
.page--costs .cx-table th.cx-cpu, .page--costs .cx-table th.cx-spu { text-align: end; }
.page--costs .cx-table--edit td.cx-cpu, .page--costs .cx-table--edit td.cx-spu, .page--costs .cx-table--edit th.cx-cpu, .page--costs .cx-table--edit th.cx-spu { padding-inline-end: 12px; }
.page--costs .cx-table--ro td.cx-cpu, .page--costs .cx-table--ro td.cx-spu, .page--costs .cx-table--ro th.cx-cpu, .page--costs .cx-table--ro th.cx-spu { padding-inline-end: 12px; }
.page--costs .cx-table td.cx-cpu .cx-field, .page--costs .cx-table td.cx-spu .cx-field { margin-inline-start: auto; }
.page--costs .cx-table--edit td.cx-ct, .page--costs .cx-table--edit th.cx-ct { padding-inline-end: 12px; }
.page--costs .cx-table--edit td.cx-st, .page--costs .cx-table--edit th.cx-st { padding-inline-end: 15px; }
.page--costs .cx-table--ro td.cx-ct, .page--costs .cx-table--ro th.cx-ct { padding-inline-end: 17px; }
.page--costs .cx-table--ro td.cx-st, .page--costs .cx-table--ro th.cx-st { padding-inline-end: 5px; }
.page--costs .cx-del { width: auto; }
/* pass 5 */
.page--costs .cx-table th.cx-item { padding-inline-start: 0 !important; }
.page--costs .cx-item > .cx-lock { fill: #A3ACBA; stroke: #A3ACBA; stroke-width: 1.5; width: 12px; height: 12px; margin-top: -6px; }
.page--costs .cx-item > .cx-lock path { fill: none; stroke-width: 2.6; }
.page--costs .cx-field, .page--costs .cx-select select, .page--costs .cx-select input { font-size: 14.5px; }
.page--costs .cx-table--ro .cx-field { font-weight: 500; }
.page--costs .cx-field--ro.cx-field--qty { justify-content: center; }
.page--costs .cx-item__name { font-size: 14.5px; }
.page--costs .cx-item__sub { font-size: 12px; }
.page--costs .cx-total { font-size: 14.5px; }
.page--costs .cx-table th { font-size: 11px; }
/* pass 6 */
.page--costs { --cx-line: #E1E5EC; }
.page--costs .cx-summary__body { padding: 16px 24px 21px; }
.page--costs .cx-lines .cx-card__head { min-height: 53px; }
.page--costs .cx-lines__body { padding-bottom: 15px; }
.page--costs .cx-field, .page--costs .cx-select select, .page--costs .cx-select input { font-size: 14px; }
.page--costs .cx-total { font-size: 13.6px; }
.page--costs .cx-card__title { font-size: 16.9px; }
.page--costs .cx-badge { font-size: 10.9px; }
/* pass 8: entry fields + vendor picker */
.page--costs .cx-table--edit .cx-field, .page--costs .cx-table--edit .cx-select select { font-weight: 600; color: #0E1629; }
.page--costs .cx-row--new .cx-field, .page--costs .cx-row--new .cx-select select, .page--costs .cx-row--new .cx-select input { font-weight: 400; }
/* Vendor picker (Sardar 10/11/2026, Design draft vendor-picker-draft-2026-11-10, ui-188). app.js puts it on <body>:
   a dropdown fixed under the field from 1024px (.vp-pick), a bottom sheet below that (.vp-sheet), so no ancestor clips
   it and no later card paints over it. Search on top, sticky group headers, the list scrolls inside, sticky footer. */
.cx-pick { box-sizing: border-box; display: flex; flex-direction: column; margin: 0; padding: 0; background: #fff; overflow: hidden; color: #0E1629; font-family: inherit; }
.vp-pick { position: fixed; z-index: 1100; border: 1px solid #E1E5EC; border-radius: 8px; box-shadow: 0 8px 24px rgba(14, 22, 41, .14); }
.cx-pick [hidden] { display: none !important; }
.vp-search { flex: none; padding: 8px; background: #fff; border-bottom: 1px solid #EEF1F5; }
.vp-search__field { position: relative; display: flex; align-items: center; }
.vp-search__icon { position: absolute; inset-inline-start: 12px; width: 16px; height: 16px; color: #6B7487; pointer-events: none; }
.cx-pick .vp-search__input { box-sizing: border-box; width: 100%; height: 40px; margin: 0; padding: 0 12px; padding-inline-start: 40px; border: 1px solid #C9D2DF; border-radius: 6px; background: #fff; color: #0E1629; font-family: inherit; font-size: 13px; font-weight: 400; line-height: 1; }
.cx-pick .vp-search__input::placeholder { color: #6B7280; }
.cx-pick .vp-search__input:focus { outline: none; border-color: #F47B20; box-shadow: 0 0 0 1px #F47B20; }
.vp-scroll { position: relative; flex: 1 1 auto; min-height: 0; max-height: 328px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #B8C0CE #F4F6F9; }
.vp-scroll::-webkit-scrollbar { width: 8px; }
.vp-scroll::-webkit-scrollbar-thumb { background: #B8C0CE; border-radius: 8px; border: 2px solid #fff; }
.vp-scroll::-webkit-scrollbar-track { background: #F4F6F9; }
.vp-group__head { position: sticky; top: 0; z-index: 2; padding: 8px 14px; background: #EEF2F9; border-bottom: 1px solid #E1E5EC; color: #14327A; font-size: 11px; font-weight: 700; letter-spacing: .06em; line-height: 12px; text-transform: uppercase; cursor: default; }
.vp-item { display: flex; align-items: center; min-height: 36px; box-sizing: border-box; padding: 8px 14px; color: #0E1629; font-size: 14px; font-weight: 400; line-height: 20px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-item:hover, .vp-item.is-active { background: #F4F6F9; }
.vp-group__head.vp-item { min-height: 0; cursor: pointer; }
.vp-group__head.vp-item:hover { background: #E3E9F4; }
.vp-item mark { padding: 0; border-radius: 2px; background: #FDE7C4; color: inherit; font-weight: 700; }
.vp-empty { padding: 12px 14px; color: #6B7487; font-size: 14px; line-height: 20px; }
/* Bottom fade: the scroll affordance while more of the list is below. */
.cx-pick.is-overflow .vp-scroll::after { content: ""; position: sticky; bottom: 0; display: block; height: 24px; margin-top: -24px; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff); pointer-events: none; }
.vp-footer { flex: none; border-top: 1px solid #E1E5EC; background: #fff; }
.vp-more { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin: 0; padding: 8px 14px; border: 0; background: #F7F8FA; color: #14327A; font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; cursor: pointer; }
.vp-more:hover { background: #EEF2F9; }
.vp-more__chev { flex: none; width: 12px; height: 12px; }
/* Bottom sheet (below 1024px, where the cost page stacks into cards). */
.vp-backdrop { position: fixed; z-index: 1090; inset: 0; background: rgba(15, 24, 48, .4); }
.vp-sheet { position: fixed; z-index: 1100; inset-inline: 0; bottom: 0; width: 100%; max-height: 72vh; padding-bottom: env(safe-area-inset-bottom, 0px); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 32px rgba(14, 22, 41, .18); }
.vp-sheet.is-expanded { max-height: 88vh; }
.vp-sheet__handle { display: flex; flex: none; justify-content: center; padding: 8px 0 0; }
.vp-sheet__handle span { width: 40px; height: 4px; border-radius: 4px; background: #D5DBE4; }
.vp-sheet__bar { display: flex; flex: none; align-items: center; justify-content: space-between; min-height: 44px; padding: 4px 16px 0; }
.vp-sheet__title { margin: 0; color: #0E1629; font-size: 16px; font-weight: 700; line-height: 24px; }
.vp-sheet__close { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #3A4560; cursor: pointer; }
.vp-sheet .vp-search { padding: 8px 16px; }
.vp-sheet .vp-scroll { max-height: none; padding-bottom: 8px; }
.vp-sheet .vp-item { min-height: 44px; padding: 12px 16px; }
.vp-sheet .vp-group__head { padding: 8px 16px; }
.vp-sheet .vp-group__head.vp-item { min-height: 44px; }
.vp-sheet .vp-more { min-height: 48px; }
/* The non-blocking note under the vendor field (Design frame 4). */
.vp-warn { display: flex; align-items: flex-start; gap: 8px; box-sizing: border-box; margin-top: 8px; max-width: 360px; padding: 8px 10px; border: 1px solid #FEDF89; border-radius: 8px; background: #FFFAEB; color: #93370D; font-size: 12px; font-weight: 600; line-height: 1.4; white-space: normal; }
.vp-warn__icon { flex: none; width: 16px; height: 16px; margin-top: 1px; color: #B45309; }
.page--costs tr.cx-row--new > td.cx-vendor { overflow: visible; }  /* the note may run under the Item column (Design frame 4) */
@media (min-width: 1024px) {
  .page--costs .vp-warn { position: relative; z-index: 2; width: 360px; }
}
@media (max-width: 1023px) {
  .cx-pick .vp-search__input { font-size: 16px; }  /* iOS does not zoom a 16px field */
  .vp-warn { max-width: none; }
}
.page--costs .cx-item { overflow: visible; }
/* pass 9 */
.page--costs .cx-table--edit .cx-field, .page--costs .cx-table--edit .cx-select select { font-size: 13.5px; }
.page--costs .cx-row--new td { vertical-align: top; padding-top: 8px; padding-bottom: 13px; }
.page--costs .cx-row--new td.cx-total { padding-top: 14px; }
/* pass 10 */
.page--costs .cx-table td { height: 61px; }
.page--costs form:not([data-costs-done]) .cx-lines .cx-card__head { min-height: 55px; }
.page--costs .cx-table .cx-row--new td.cx-item { padding-inline-start: 0 !important; }
.page--costs .cx-select select:has(option[value=""]:checked) { color: #A3ACBA; font-weight: 400; }

.page--costs .cx-hero__link{color:inherit;text-decoration:none}
.page--costs .cx-summary__body > .cx-sum--profit, .page--costs .cx-summary__body > :first-child { width: 432px; max-width: 100%; margin-top: 2px; }

/* Cost Statement below 1024px (desktop-only since Sardar 21/10 design 41:2; was 1400px, Quality PR115 P1-1): each line is a
   stacked card (the design's 390 pattern); 1440 and wider is untouched. */
@media (max-width: 1023px) {
  .page--costs .cx-grid, .page--costs .cx-summary__body { grid-template-columns: minmax(0, 1fr); }
  .page--costs .cx-summary__body > :first-child { width: auto; }
  .page--costs .cx-table, .page--costs .cx-table tbody { display: block; width: 100%; max-width: 100%; table-layout: auto; }
  .page--costs .cx-table > :first-child, .page--costs .cx-table thead { display: none; }  /* the column group and the header */
  .page--costs .cx-table tr.cx-row { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px;
    padding: 14px; margin: 0 0 12px; border: 1px solid var(--cx-line); border-radius: 10px; background: #fff; }
  .page--costs .cx-table tr.cx-row > td { display: block; height: auto; padding: 0; border: 0; min-width: 0; text-align: start; }
  .page--costs .cx-table tr.cx-row > td.cx-item { grid-column: 1 / -1; padding-inline-end: 36px; }
  .page--costs .cx-table tr.cx-row > td[data-label]::before { content: attr(data-label); display: block; margin: 0 0 4px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #56657A; }
  .page--costs .cx-table tr.cx-row > td.cx-total { align-self: end; font-weight: 700; padding-bottom: 10px; }
  .page--costs .cx-table tr.cx-row > td.cx-del { position: absolute; top: 10px; inset-inline-end: 10px; }
  .page--costs .cx-table tr.cx-row .cx-select, .page--costs .cx-table tr.cx-row .cx-field { width: 100% !important; max-width: 100%; box-sizing: border-box; }
  .page--costs .cx-table tr.cx-row > td.cx-item .cx-select { margin: 0 0 8px; }
  .page--costs .cx-lines__body { padding: 12px 16px 16px; }
  .page--costs .cx-late { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .page--costs .cx-table tr.cx-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page--costs .cx-run__foot { flex-wrap: wrap; }
  .page--costs .cx-run__foot .cx-btn, .page--costs .cx-run__foot form { width: 100%; }
  .page--costs .cx-hero__row { flex-wrap: wrap; }
  .page--costs .cx-pdf-actions { width: 100%; margin-inline-start: 0; }
  .page--costs .cx-pdf-actions .cx-btn { flex: 1 1 180px; min-height: var(--ctl-touch); }
  .page--costs .cx-sum { font-size: 12px; }
  .page--costs .cx-summary__foot form { width: 100%; }
}
@media (max-width: 640px) {
  .page--costs .cx-summary__body > :first-child { min-width: 0; max-width: 100%; overflow-x: auto; }
  .page--costs .cx-sum { width: 100%; table-layout: auto; }
  .page--costs .cx-sum th, .page--costs .cx-sum td { padding-inline: 6px; white-space: nowrap; }
  .page--costs .cx-cur-pill { min-width: 0; padding-inline: 8px; }
}
@media (max-width: 1023px) {
  .page--costs .cx-table tr.cx-row { grid-template-areas: "item item item item" "unit qty cur ." "cpu ct spu st"; }
  .page--costs .cx-table td.cx-item { grid-area: item; } .page--costs .cx-table td.cx-unit { grid-area: unit; }
  .page--costs .cx-table td.cx-qty { grid-area: qty; } .page--costs .cx-table td.cx-cur { grid-area: cur; }
  .page--costs .cx-table td.cx-cpu { grid-area: cpu; } .page--costs .cx-table td.cx-ct { grid-area: ct; }
  .page--costs .cx-table td.cx-spu { grid-area: spu; } .page--costs .cx-table td.cx-st { grid-area: st; }
}
@media (max-width: 640px) {
  .page--costs .cx-table tr.cx-row { grid-template-areas: "item item" "unit qty" "cur cur" "cpu ct" "spu st"; }
}

/* Cost page Add row (Sardar 21/10 12:40, design cost-add-row 36:3): Vendor | Item | Unit | Qty | Unit price | Total | Sell | Currency. */
.page--costs .cx-table--edit .c-vendor { width: 150px; } .page--costs .cx-table--edit .c-item { width: 208px; }
.page--costs .cx-table--edit .c-unit { width: 142px; } .page--costs .cx-table--edit .c-qty { width: 60px; }
.page--costs .cx-table--edit .c-cpu, .page--costs .cx-table--edit .c-spu { width: 124px; } .page--costs .cx-table--edit .c-ct { width: 112px; }
.page--costs .cx-table--edit .c-cur { width: 96px; } .page--costs .cx-table--edit .c-del { width: 40px; }
.page--costs .cx-table--edit .cx-unit .cx-select { width: 132px; } .page--costs .cx-table--edit .cx-cur .cx-select { width: 86px; }
.page--costs .cx-table--edit td.cx-vendor { padding-inline-end: 8px; }
.page--costs .cx-table--edit .cx-vendor .cx-select { width: 100%; }
.page--costs .cx-table--edit .cx-vendor__name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.page--costs .cx-table--edit td.cx-item { padding-inline-end: 8px; }
.page--costs .cx-table--edit .cx-item__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; max-width: calc(100% - 18px); vertical-align: middle; }
.page--costs .cx-table--edit .cx-item .cx-select { width: 100%; }
.page--costs .cx-item__other { display: block; width: 100%; margin-top: 6px; }
.page--costs .cx-item__other[hidden] { display: none; }

/* Accounting: Pending approval (Sardar 21/10, design 33:3). */
.count--pending { background: var(--orange); color: #fff; }
.acc-pending-alert { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.acc-pending { margin-bottom: 20px; }
.acc-pending .card__header { display: flex; align-items: center; justify-content: space-between; }
.acc-wait { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.acc-wait__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.acc-wait--sardar .acc-wait__dot { background: var(--navy-700, #14327A); }
.acc-open { text-align: end; white-space: nowrap; }
.acc-open a { font-weight: 600; text-decoration: none; }
.acc-pending .count--pending { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; font-size: 12px; font-weight: 700; }

/* Sardar 21/10 (NG2012, wide window): the Cost lines table fills its card. The fixed 1101px grid
   left an empty band on the right; the Vendor and Item columns now take the extra width. */
@media (min-width: 1280px) {
  .page--costs .cx-table { width: 100%; max-width: 100%; }
  .page--costs .cx-table--edit .c-vendor { width: max(150px, 16%); }
  .page--costs .cx-table--edit .c-item, .page--costs .cx-table--ro .c-item { width: auto; }
}
/* Sardar 21/10: an open sidebar has no rail toggle from 1600px. A closed rail keeps it on every width, or nothing reopens it (03/11/2026). */
@media (min-width: 1600px) {
  body:not(.sidebar-compact) .sidebar-toggle { display: none !important; }
}
/* Sardar 21/10 15:50: every page's content fills the width next to the sidebar (as the lists and the
   cost page do); the page gutter stays. Removes the centred caps of the order forms and narrow pages. */
.page--narrow,
.page.order-page:is(.order-page--edit, .order-page--new),
.order-page > .alert, .order-page--new > .alert,
.order-page .op-head, .order-page--new .op-head,
.company-card { max-width: none; }
.page.order-page:is(.order-page--edit, .order-page--new) { margin-inline: 0; }
/* Quality 21/10 (PR117 P1-1): the order view fills the width too (its 1400px cap left a right gutter). */
/* Design 21/10 (border-clearance-transfer/same-1440): the Border clearance card, one row per item. */
.bp-rows { display: grid; }
.bp-row { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 1.25fr); gap: 16px 24px; padding: 18px 0; border-top: 1px solid var(--border, #E4E7EE); align-items: start; }
.bp-row:first-child { border-top: 0; padding-top: 4px; }
.bp-row[hidden] { display: none; }
.bp-row__title { margin: 8px 0 0; font-size: 14px; font-weight: 600; }
.bp-row__fields > .field, .bp-row__fields .op-field { margin: 0; }
.bp-grid { display: grid; gap: 12px; }
.bp-grid--2 { grid-template-columns: 1fr 1fr; }
.bp-row .transport-builder { margin: 0; }
/* Design 21/10 (13): Customs & border rows laid out like the stage card's rows. */
.customs-rows .customs-row { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, .625fr) minmax(0, .625fr); gap: 12px 24px; align-items: start; padding: 18px 0; border-top: 1px solid var(--border, #E4E7EE); }
.customs-rows .customs-row:first-of-type { border-top: 0; }
.customs-rows .customs-row[hidden] { display: none; }
.customs-rows .customs-row > .leg-row__title { grid-column: 1; margin: 8px 0 0; font-size: 14px; }
.customs-rows .customs-row > .field { margin: 0; min-width: 0; }
/* Design 21/10 (10, 11): New order cards align with the header edge (number inside each card's title);
   the Team card fills the width like the other steps. */
@media (min-width: 761px) {
  .page.order-page--new .op-form { padding-inline-start: 0; }
  .page.order-page--new .op-form::before { content: none; }
  .page.order-page--new .op-form :is(.op-step__head, .form-section__head, .order-more__head, .op-part__head, .op-team .op-step__head) .op-num,
  .page.order-page--new .op-form .op-part__head .op-num { position: static; inset: auto; width: 30px; height: 30px; border: 0; }
}
.page.order-page--new .op-team { display: block; padding: 0; }
.page.order-page--new .op-team .op-step__head { padding: 18px 22px 6px; }
.page.order-page--new .op-team__body { padding: 8px 22px 20px; }
.page.order-page--new .op-team__fields, .page.order-page--new .op-team__fields--open { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; width: 100%; }
.page.order-page--new .op-team__fields > .field { display: grid; gap: 6px; }
.page.order-page--new .op-team__fields > .field select { width: 100%; }
/* Design P2 on #251 (06/11/2026): on a phone New order's Team is one field a row, as Edit's (its shell grid is one
   column up to 640px); the three-column rule above held at 390 (three 93px selects, names cut off). */
@media (max-width: 640px) {
  .page.order-page--new .op-team__fields, .page.order-page--new .op-team__fields--open { grid-template-columns: minmax(0, 1fr); }
}
/* Design 21/10 (A4, 15/A5): actions at the end of the page as a bar card (image 36:3); the page header
   scrolls with the page, so nothing covers the content. */
.op-bottom-bar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 16px 20px; margin: 16px 0 0; }
.op-bottom-bar .btn { min-width: 64px; }
.page.order-page.order-page--edit .order-form-header.op-head,
.page.order-page.order-page--new .order-form-header.op-head { position: relative; top: auto; }
.op-summary { top: calc(var(--header-h, 56px) + 16px); }
/* Design 21/10 (Sardar): the order forms and order page are English only — the Arabic
   sub-labels under headings and fields are not shown (as Turkish mode already does). */
.order-page [lang="ar"]:not(input):not(textarea):not(select) { display: none !important; }
/* Design v3 (21/10): on New order the Land route (country + city on each side) and the
   loading date / gross weight take the full row in two columns. */
.order-page--new .order-form .op-step--route .op-step__body > .op-part:has([data-route-from-to], [name="land_loading_date"]) { grid-column: 1 / -1; }
.order-page--new .order-form .op-step--route .op-part:has([name="land_loading_date"]) .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
@media (max-width: 640px) { .order-page--new .order-form .op-step--route .op-part:has([name="land_loading_date"]) .form-grid { grid-template-columns: 1fr; } }
/* Approved 21/10: stage-card items are a check + the name (no value). */
.op-ro--check dt { display: flex; align-items: center; gap: 8px; }
.op-ro--check .op-ro__check { width: 18px; height: 18px; flex: none; color: #fff; background: var(--success, #1f8a4c); border-radius: 50%; padding: 3px; box-sizing: border-box; }
.op-ro--check .op-ro__check--todo { background: transparent; border: 1.5px solid var(--border-strong); }
/* ── Cost & sell approval (Sardar 21/10/2026, design 41:2 approved 17:24) ── */
.page--costs .cx-lines__body { padding: 0 24px 8px; }
.page--costs .cx-table { width: 100%; max-width: none; table-layout: fixed; }
.page--costs .cx-table--edit .c-vendor { width: 15%; } .page--costs .cx-table--edit .c-item { width: 20%; }
.page--costs .cx-table--edit .c-unit { width: 13%; } .page--costs .cx-table--edit .c-qty { width: 6.5%; }
.page--costs .cx-table--edit .c-cpu { width: 11%; } .page--costs .cx-table--edit .c-ct { width: 11%; }
.page--costs .cx-table--edit .c-cur { width: 10%; } .page--costs .cx-table--edit .c-del { width: 40px; }
.page--costs .cx-table--edit .cx-vendor .cx-select, .page--costs .cx-table--edit .cx-item .cx-select { width: calc(100% - 12px); margin-top: 0; }
.page--costs .cx-table--edit .cx-unit .cx-select { width: calc(100% - 12px); }
.page--costs .cx-table--edit .cx-cpu .cx-field { width: calc(100% - 8px); }
.page--costs .cx-table--edit td.cx-ct { padding-inline-end: 12px; font-weight: 700; }
.page--costs .cx-table--edit .cx-cur .cx-select { width: 80px; margin-inline-start: 10px; }
.page--costs .cx-table--ro .c-vendor, .page--costs .cs-table .c-vendor { width: 17%; }
.page--costs .cx-table--ro .c-item, .page--costs .cs-table .c-item { width: 25%; }
.page--costs .cx-table--ro .c-unit, .page--costs .cs-table .c-unit { width: 13%; }
.page--costs .cx-table--ro .c-qty, .page--costs .cs-table .c-qty { width: 6%; }
.page--costs .cx-table--ro .c-cpu, .page--costs .cs-table .c-cpu { width: 12%; }
.page--costs .cx-table--ro .c-cur, .page--costs .cs-table .c-cur { width: 11%; }
.page--costs .cs-table--sell .c-pr { width: 11%; }
.page--costs .cs-table--sell .cs-val { display: block; font-weight: 500; color: var(--text); }
.page--costs .cs-table--sell .cs-val--cur { font-weight: 500; }
/* Mockup completed-v3 (v2135): Reopen Costs sits in a bottom bar, not a card. */
.page--costs .cs-footbar { display: flex; justify-content: flex-end; align-items: center; margin: 16px 0 24px; padding: 12px 0; border-top: 1px solid #E3E7EE; }
.page--costs .cx-table--ro td, .page--costs .cs-table td { height: 54px; }
.page--costs .cs-row td { padding: 0 6px; color: var(--text); }
.page--costs .cs-vendor { font-weight: 700; padding-inline-start: 0 !important; }
.page--costs .cs-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page--costs .cs-cur { color: #8A94A6; padding-inline-start: 12px !important; }
.page--costs .cx-table td.cs-total, .page--costs .cx-table th.cs-total { padding-inline-end: 0 !important; font-weight: 700; }
.page--costs .cx-table th.cs-vendor, .page--costs .cx-table th.cs-item, .page--costs .cx-table th.cs-unit { padding-inline-start: 6px; }
.page--costs .cx-table th.cs-vendor { padding-inline-start: 0; }
.page--costs .cx-table--ro thead th, .page--costs .cs-table thead th { background: #F6F7F9; }
.page--costs .cs-costtotal { width: 100%; border-collapse: collapse; margin: 0 0 8px; font-size: 13px; }
.page--costs .cs-costtotal th { text-align: start; font-weight: 700; padding: 18px 0; }
.page--costs .cs-costtotal td { padding: 18px 0; }
.page--costs .cs-costtotal td[data-run-cost] { font-size: 16px; font-weight: 700; text-align: end; }
.page--costs .cs-costtotal__cur { width: 10%; padding-inline-start: 16px !important; color: #56657A; }
.page--costs .cs-costtotal--ro { background: #F6F7F9; margin: 0 -24px -8px; width: calc(100% + 48px); border-top: 1px solid var(--cx-line); border-radius: 0 0 10px 10px; }
.page--costs .cs-costtotal--ro tbody, .page--costs .cs-costtotal--ro tr:not([hidden]) { display: block; }
.page--costs .cs-costtotal--ro tr:not([hidden]) { display: grid; grid-template-columns: 73% 11% 1fr; align-items: center; padding: 0 24px; }
.page--costs .cs-costtotal--ro th { padding-inline-start: 0; order: 1; } .page--costs .cs-costtotal--ro .cs-costtotal__cur { order: 2; width: auto; padding-inline-start: 12px !important; color: #8A94A6; }
.page--costs .cs-costtotal--ro td[data-run-cost] { order: 3; padding-inline-end: 0; }
.page--costs .cx-lines__add { padding: 14px 0 6px; display: flex; justify-content: flex-start; }
.page--costs .cx-btn--dashed { border: 1px solid var(--cx-navy); color: var(--cx-navy); height: 32px; font-size: 12.5px; }
.page--costs .cs-sell .cs-table { margin: 0 24px; width: calc(100% - 48px); }
.page--costs .cs-in { height: var(--ctl-sm); width: calc(100% - 8px); margin-inline-start: auto; display: block; }
.page--costs .cs-sel { width: 76px; } .page--costs .cs-sel select { height: var(--ctl-sm); }
.page--costs .cs-profit { font-weight: 700; } .page--costs .cs-profit.is-pos { color: #166534; } .page--costs .cs-profit.is-neg { color: #DC2626; }
.page--costs .cs-sum { display: flex; justify-content: flex-end; padding: 6px 24px 10px; background: #FAFBFC; border-top: 1px solid var(--cx-line); border-radius: 0 0 10px 10px; }
.page--costs .cs-sum__list { margin: 0; width: 300px; }
.page--costs .cs-sum__row { display: flex; align-items: center; justify-content: space-between; min-height: 46px; border-bottom: 1px solid var(--cx-line); font-size: 13px; color: #56657A; }
.page--costs .cs-sum__row:last-child { border-bottom: 0; }
.page--costs .cs-sum__row dt { font-weight: 500; } .page--costs .cs-sum__row dd { margin: 0; display: flex; align-items: center; gap: 16px; }
.page--costs .cs-sum__val { font-weight: 700; color: var(--text); min-width: 96px; text-align: end; }
.page--costs .cs-sum__cur { width: 76px; } .page--costs .cs-sel--tot { width: 76px; }
.page--costs .cs-sum__row--rate .cs-in--rate { width: 116px; }  /* Quality P3-3 (27/10/2026): a 4-digit rate with separators and decimals ("1,450.2500") fits; was 90 px (Design review PR #178 P3) */
.page--costs .cs-sum__row--profit { background: #E7F6EC; color: #166534; padding: 0 8px; border-radius: 4px; min-height: 48px; margin-top: 6px; }
.page--costs .cs-sum__row--profit .cs-sum__val { color: #166534; font-size: 16px; }
.page--costs .cs-sum__row--profit dt, .page--costs .cs-sum__row--profit .cs-sum__cur { font-weight: 700; color: #166534; }
.page--costs .cs-sum__row--profit.is-neg { background: #FDECEC; }
.page--costs .cs-sum__row--profit.is-neg, .page--costs .cs-sum__row--profit.is-neg .cs-sum__val, .page--costs .cs-sum__row--profit.is-neg dt, .page--costs .cs-sum__row--profit.is-neg .cs-sum__cur { color: #DC2626; }
.page--costs .cs-sum__save { padding: 0 24px 16px; text-align: end; }
.page--costs .cs-appr__scope { font-size: 12px; color: #56657A; }
.page--costs .cs-appr--live { border-color: #F47B20; }
.page--costs .cs-appr__list { list-style: none; margin: 0; padding: 0; }
.page--costs .cs-appr__row { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 24px; border-top: 1px solid var(--cx-line); }
.page--costs .cs-appr__row:first-child { border-top: 0; }
.page--costs .cs-appr__row--now { background: #FFF4E8; }
.page--costs .cs-appr__row:last-child { border-radius: 0 0 10px 10px; }
.page--costs .cs-appr__num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #EEF1F6; color: #56657A; font-size: 11px; font-weight: 600; }
.page--costs .cs-appr__row--now .cs-appr__num, .page--costs .cs-appr--final .cs-appr__num { background: #F47B20; color: #fff; }
.page--costs .cs-appr__row--ok .cs-appr__num { background: #E7F6EC; color: #166534; }
.page--costs .cs-appr--final .cs-appr__row--ok .cs-appr__num { background: #F47B20; color: #fff; }
.page--costs .cs-appr__name { font-size: 13.5px; margin-inline-end: auto; }
.page--costs .cs-appr__time { font-size: 12px; color: #6B7689; min-width: 84px; text-align: end; }
/* Quality #183 P3-8: Return's reason — in the confirm dialog (app.js); in the form itself only without JavaScript. */
.page--costs .cs-return { display: inline-flex; align-items: center; gap: 8px; }
.page--costs .cs-return__reason { width: 220px; height: var(--ctl-sm); }
.js .page--costs .cs-return__reason { display: none; }
.dialog__field { display: grid; gap: 4px; margin-top: 4px; font-size: var(--fs-sm); font-weight: 600; }
.dialog__field textarea { width: 100%; min-height: 72px; resize: vertical; font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.page--costs .cs-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 10px; border-radius: 999px; background: #EEF1F6; color: #56657A; font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.page--costs .cs-tag--ok { background: #E7F6EC; color: #166534; }
.page--costs .cs-btn { height: var(--ctl-sm); min-width: 64px; padding: 0 18px; font-size: 12.5px; }
.page--costs .cs-btn--wide { min-width: 124px; }
.page--costs .cs-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 16px; }
.page--costs .cs-pill--closed { background: #E7F6EC; color: #166534; border: 1px solid #16A34A; }

.page--costs .cs-sell .cx-field:disabled, .page--costs .cs-sell select:disabled { background: #fff; color: var(--text); border-color: #C9D2DF; opacity: 1; -webkit-text-fill-color: var(--text); }
.page--costs .cs-costtotal tr:not([hidden]) ~ tr th { visibility: hidden; }

/* Locked sells (sent for approval / closed) look read-only like locked cost fields */
.page--costs .cs-table--sell .cs-in:disabled, .page--costs .cs-sum .cs-in:disabled { background: #EDF0F4; border-color: var(--cx-field); color: #56657A; -webkit-text-fill-color: #56657A; opacity: 1; cursor: default; }
.page--costs .cs-sel select:disabled { background-color: #EDF0F4; border-color: var(--cx-field); color: #56657A; -webkit-text-fill-color: #56657A; opacity: 1; cursor: default; }
/* Mockup pending v2135: the totals currency select looks like a normal select while pending. */
.page--costs .cs-sel--tot select:disabled { background-color: #fff; color: var(--text); -webkit-text-fill-color: var(--text); }
.page--costs .cs-sel:has(select:disabled) .cx-caret, .page--costs .cs-sel:has(select:disabled) svg { display: none; }
.page--costs .cs-sel--tot:has(select:disabled) .cx-caret, .page--costs .cs-sel--tot:has(select:disabled) svg { display: revert; }

/* Cost page (Sardar 21/10 20:43, design cost-editing v2145): drag handle. */
.cx-grip{display:inline-block;color:#9aa3b2;cursor:grab;margin-right:10px;font-size:12px;letter-spacing:-2px;line-height:1;user-select:none;vertical-align:middle}
.cx-grip:focus-visible{outline:2px solid #F47B20;outline-offset:2px;border-radius:2px}
.cx-row.is-dragging{opacity:.5}
.page--costs td.cx-vendor{white-space:nowrap}.page--costs td.cx-vendor .cx-grip{margin-right:8px}.page--costs td.cx-vendor .cx-vendor__name{display:inline;white-space:normal}

/* ---------- Land v3 (Sardar 21/10, land-pages-2026-10-21/v3): one-column Land order page ---------- */
.page.land-page { max-width: none; padding-bottom: 0; }
.land-page .land-main, .land-page .op-layout, .land-page .op-form, .land-page .form-main { display: block !important; max-width: none !important; width: auto !important; margin: 0 !important; grid-template-columns: none !important; }
.land-page .land-head { position: relative; margin: 0 0 18px; padding: 22px 22px 22px; border-radius: 12px; color: #fff;
  background: linear-gradient(100deg, var(--navy-800) 0%, var(--navy) 55%, var(--navy-800) 100%); box-shadow: 0 8px 22px rgba(15, 24, 48, .16); }
.land-head__back { margin: 0 0 8px; }
.land-head__back a { display: inline-flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .82); font-size: 12px; text-decoration: none; }
.land-head__back a .icon { width: 12px; height: 12px; }
.land-head__title { display: flex; align-items: center; gap: 10px; margin: 0; color: #fff; font-size: 24px; line-height: 1.2; }
.land-head__ng { font-family: var(--font-mono, ui-monospace, monospace); font-weight: 700; letter-spacing: .02em; }
.land-head__sub { margin: 8px 0 0; color: rgba(255, 255, 255, .85); font-size: 12px; }
.land-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.land-badge--blue { background: #E6EEFF; color: #2B4FA8; }
.land-badge--green { background: #E3F6EA; color: #1A7F43; }
.land-badge--grey { background: #EEF1F6; color: #56657A; }
.land-page .card { border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: none; margin: 0 0 16px; }
.land-stepper { padding: 14px 16px 10px; }
.land-steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; }
.land-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 11px; color: var(--text-3); }
.land-step::before { content: ""; position: absolute; top: 9px; inset-inline-start: calc(-50% + 12px); inset-inline-end: calc(50% + 12px); height: 2px; background: var(--border); }
.land-step:first-child::before { display: none; }
.land-step--done::before, .land-step--current::before { background: #1A7F43; }
.land-step__dot { position: relative; z-index: 1; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: #fff; font-size: 9px; font-weight: 700; color: var(--text-3); }
.land-step__dot .icon { width: 10px; height: 10px; stroke-width: 3; }
.land-step--done .land-step__dot { border-color: #1A7F43; background: #1A7F43; color: #fff; }
.land-step--current .land-step__dot { border-color: var(--orange); background: var(--orange); color: #fff; }
.land-step--done .land-step__label, .land-step--current .land-step__label { color: var(--text); font-weight: 700; }
.land-step__date { font-size: 10px; color: var(--text-4); }
.land-stage { border: 1.5px solid var(--orange) !important; }
.land-stage__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.land-stage__num { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--orange); color: #fff; font-size: 10px; font-weight: 700; }
.land-stage__title { margin: 0; font-size: 15px; font-weight: 700; }
.land-tag { padding: 2px 8px; border-radius: 999px; background: var(--orange-50); color: var(--orange-text); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.land-stage__count { margin-inline-start: auto; font-size: 11px; color: var(--text-3); }
.land-stage__items { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; margin: 0; padding: 18px 16px; list-style: none; font-size: 12px; font-weight: 600; color: var(--text); }
.land-check { display: flex; align-items: center; gap: 10px; }
.land-check__mark { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1.5px dashed var(--border-strong); }
.land-check.is-done .land-check__mark { border: 0; background: #1A7F43; color: #fff; }
.land-check__mark .icon { width: 9px; height: 9px; stroke-width: 3; }
.land-sec__title { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); font-size: 13px; font-weight: 700; }
.land-sec__grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; margin: 0; padding: 4px 16px 10px; }
.land-kv { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); font-size: 11px; }
.land-kv dt { color: var(--text-3); }
.land-kv dd { margin: 0; color: var(--text); font-weight: 600; text-align: end; }
.land-foot { position: relative; z-index: 20; margin: 18px calc(-1 * var(--gutter, 24px)) 0; display: flex; justify-content: flex-end; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--border); background: #fff; }
.land-foot__btn { min-width: 74px; justify-content: center; }
.land-foot .btn--secondary { border: 1px solid var(--navy-800); color: var(--navy-800); background: #fff; }
.land-foot .btn--primary, .land-foot .btn--next { border: 0; background: var(--orange); color: var(--navy-950); font-weight: 700; }
.land-foot .land-foot__link { border: 0; background: none; color: var(--navy-800); font-weight: 700; }
/* Edit: tabs, one section shown at a time */
.land-tabs { display: flex; gap: 22px; padding: 0 16px; }
.land-tabs button { padding: 12px 0 9px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-3); font: inherit; font-size: 12px; cursor: pointer; }
.land-tabs button[aria-selected="true"] { border-bottom-color: var(--orange); color: var(--text); font-weight: 700; }
.land-page .land-edit .form-section { display: block; border: 1px solid var(--border); border-radius: 10px; background: #fff; margin: 0 0 16px; }
.land-page .land-edit .form-section > summary { list-style: none; pointer-events: none; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.land-page .land-edit .form-section > summary::-webkit-details-marker { display: none; }
.land-page .land-edit .form-section__chev { display: none; }
.land-page .land-edit [data-land-tab][data-tab-off] { display: none !important; }
.land-page .land-edit .form-section .card__body { padding: 16px; }
.land-page .land-edit .form-grid { grid-template-columns: 1fr 1fr; }
/* Open items 16/11/2026 item 20: on a phone, Sea Origin country and Port of Loading stack (full width, one under the
   other); the 1fr 1fr above stays from 641px (1440 unchanged). */
@media (max-width: 640px) { .sea-origin.form-grid, .land-page .land-edit .sea-origin.form-grid { grid-template-columns: minmax(0, 1fr); } }
.land-static { display: block; padding: 8px 0; font-size: 13px; font-weight: 700; }
.land-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border: 1px solid var(--border-strong); border-radius: 6px; background: #fff; }
.land-seg__btn { padding: 6px 8px; border: 0; border-radius: 4px; background: none; color: var(--text-3); font: inherit; font-size: 12px; cursor: pointer; }
.land-seg__btn[aria-pressed="true"] { background: var(--navy-800); color: #fff; font-weight: 700; }
.land-seg-field .land-seg__select { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.land-page .land-fromto .op-fromto__grid, .land-page .land-fromto .op-fromto__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.land-page .land-fromto .op-fromto__arrow, .land-page .land-fromto [data-fromto-title] { display: none; }
.land-page .land-fromto .op-fromto__row .sr-only { position: static; width: auto; height: auto; margin: 0 0 6px; clip: auto; overflow: visible; white-space: normal; display: block; font-size: var(--fs-sm, 12px); color: var(--text-3); text-transform: capitalize; }
.land-page .land-fromto .op-fromto__row .op-fromto__part select { width: 100%; }
.land-foot__change { margin-inline-end: auto; }
.land-foot { align-items: center; }
.land-foot .land-foot__change { margin-inline: auto 0; }
.land-foot .order-bar__change > summary { border: 0; background: none; color: var(--navy-800); font-weight: 700; box-shadow: none; }
.land-foot .order-bar__change-panel { position: absolute; bottom: calc(100% + 8px); inset-inline-end: 0; z-index: 30; }
.land-foot .order-bar__change { position: relative; }
.land-page .land-tabs-card { margin-bottom: 16px; }
.land-page .op-work.land-work { max-width: none; }

body:has(.page.land-page) > .footer, body:has(.page.land-page) .footer { display: none; }
.page.order-page.land-page .land-foot .op-head__change > summary { min-height: var(--ctl-sm); padding: 6px 12px; border: 0; background: none; color: var(--navy-800); font-size: 12px; font-weight: 700; }
.page.order-page.land-page .land-foot .op-head__change > .order-bar__change-panel { top: auto; bottom: calc(100% + 8px); }
.land-page .land-edit .customs-row .leg-row__title, .land-page .land-edit .assignment-row { border-top: 0; }
.land-page .land-edit .form-section > .form-section__head, .land-page .land-edit .form-section > summary { margin: 0; }
.land-page .land-fromto .op-fromto__part { display: flex; flex-direction: column; }
.land-page .land-fromto .op-fromto__row .op-fromto__part > .sr-only { position: static !important; width: auto !important; height: auto !important; margin: 0 0 6px !important; padding: 0 !important; clip: auto !important; clip-path: none !important; overflow: visible !important; white-space: normal !important; text-transform: none; color: var(--text-2); font-weight: 600; }
.land-page .land-edit .form-section__head { background: #fff; }
.land-page #f-land_gross_weight_t { text-align: end; }
.land-page [data-service-section="5"] .section-fields > .form-grid { grid-template-columns: 38% 1fr; align-items: start; }
.land-page [data-service-section="5"] .land-row__title { grid-column: 1; grid-row: 1 / span 4; margin: 28px 0 0; font-size: 13px; font-weight: 700; }
.land-page [data-service-section="5"] .section-fields > .form-grid > :not(.land-row__title) { grid-column: 2; }
.land-page [data-service-section="5"] [data-main-land-details] > .form-grid { grid-template-columns: 1fr; }
.land-page [data-service-section="10"] .assignment-row--other + .assignment-row--other .field__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.land-page [data-service-section="10"] [data-repeat-add], .land-page [data-service-section="10"] .repeat-add { width: auto; justify-self: start; padding: 6px 14px; border: 1px solid var(--navy-800); border-radius: 6px; background: #fff; color: var(--navy-800); }

/* New order step 1 (v3 new-00a / new-00b) */
.new-start .land-head { margin-bottom: 18px; }
.new-start__sec { padding: 0; margin-bottom: 18px; }
.new-start__title { font-size: 15px; font-weight: 600; margin: 0; padding: 18px 16px; border-bottom: 1px solid var(--border, #e5e7eb); }
.new-start__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 12px; padding: 16px; }
@media (min-width: 1024px) {
  .page.order-page.new-start .new-start__grid.op-choices { margin: 0; padding: 16px; }
}
.new-start__opt { position: relative; display: flex; align-items: center; min-height: 50px; padding: 0 14px; border: 1px solid var(--border, #d9dce3); border-radius: 6px; background: #fff; cursor: pointer; font-size: 14px; }
.new-start__opt input { position: absolute; opacity: 0; pointer-events: none; }
.new-start__opt:has(input:checked) { border-color: #F47B20; background: #fff4e5; font-weight: 600; }
.new-start__opt:has(input:focus-visible) { outline: 2px solid #F47B20; outline-offset: 2px; }
.new-start__bar { display: flex; justify-content: flex-end; padding: 12px 0; }
.new-start__sec[hidden] { display: none !important; }
.new-start__bar { position: sticky; bottom: 0; background: #fff; margin: 0; padding: 12px 24px; border-top: 1px solid var(--border, #e5e7eb); }
/* Land Other services row (v3 b2d-10 / d2d-10 / dom-06): 50/50 columns, narrow outlined Add */
.land-page [data-service-section="10"] .transport-builder { display: flex; flex-direction: column; align-items: stretch; }
.land-page [data-service-section="10"] .transport-builder > [data-repeat-add] { align-self: flex-start; display: inline-flex; width: auto !important; margin-top: 12px; }
.land-page [data-service-section="10"] .assignment-row--other { display: grid; grid-template-columns: 1fr 1fr 32px; gap: 12px; align-items: end; }
.new-start__scope { display: none; }
.new-start__form:has(input[name=service][data-svc="1"]:checked) [data-scope-for="1"] { display: block; }
.new-start__form:has(input[name=service][data-svc="2"]:checked) [data-scope-for="2"] { display: block; }
.new-start__form:has(input[name=service][data-svc="3"]:checked) [data-scope-for="3"] { display: block; }
.new-start__form:has(input[name=service][data-svc="4"]:checked) [data-scope-for="4"] { display: block; }
.new-start__form:has(input[name=service][data-svc="5"]:checked) [data-scope-for="5"] { display: block; }
.new-start__form:has(input[name=service][data-svc="6"]:checked) [data-scope-for="6"] { display: block; }
.new-start__form:has(input[name=service][data-svc="7"]:checked) [data-scope-for="7"] { display: block; }
.new-start__form:has(input[name=service][data-svc="8"]:checked) [data-scope-for="8"] { display: block; }
/* Land v3 transport (Sardar 21/10): one Trucks count beside one Truck type. */
.transport-builder--single .repeat-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
/* Cost edit item names whole at 1440 (Design 22/10 P2: "Port customs clearanc…"): the Item column takes room from Unit. */
.page--costs .cx-table--edit .c-item { width: 234px; } .page--costs .cx-table--edit .c-unit { width: 140px; }
.page--costs .cx-table--edit .cx-unit .cx-select { width: 132px; }
.page--costs .cx-table--edit .cx-item .cx-select select { padding-inline-start: 10px; }
/* Sardar 22/10 10:31: the order edit footer (Save + Next) and the cost page footer stay at the bottom of the window on desktop. */
@media (min-width: 1024px) {
  .land-foot, .order-page--edit .op-bottom-bar, .page--costs .cs-footbar--sticky { position: sticky; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid #E3E7EE; }
  .page--costs .cs-footbar--sticky { padding-inline: 12px; }
}
/* Design 22/10 13:15 (#129): the new row's vendor name shows in full (e.g. a Goods supplier), desktop. */
@media (min-width: 1024px) {
  .page--costs .cx-table--edit .c-vendor { width: 19%; }
  .page--costs .cx-table--edit .c-item { width: 214px; }
  .page--costs .cx-row--new .cx-select--vendor, .page--costs .cx-row--new .cx-select--vendor select { width: 100%; max-width: none; }
}
/* Cost-sell flow (Sardar 22/10 15:31, design cost-flow-01..04, 1440). */
.page--costs .cs-pill--done { background: #EEF1F6; color: #33415C; border: 1px solid #C9D1DE; }
.page--costs .cs-badge--draft { background: #FFF4E5; color: #9A4D00; border-color: transparent; }
.page--costs .cs-table--sell .c-vendor { width: 14%; } .page--costs .cs-table--sell .c-item { width: 21%; }
.page--costs .cs-table--sell .c-qty { width: 7%; } .page--costs .cs-table--sell .c-cost { width: 10%; }
.page--costs .cs-table--sell .c-cpu { width: 13%; } .page--costs .cs-table--sell .c-cur { width: 9%; }
.page--costs .cs-table--sell .c-ct { width: 11%; } .page--costs .cs-table--sell .c-pr { width: 15%; }
/* Design review PR #178 P2 (TR 1440: "MİKTAR" touched "TOPLAM MALİYET"): sell headers keep 12px from the
   previous column and wrap instead of running into it (Quantity 1% from Item, so "QUANTITY" fits); Vendor / Item
   keep their own start padding. */
.page--costs .cs-table--sell thead th { padding-inline-start: 12px; white-space: normal; overflow-wrap: normal; }
.page--costs .cs-sum--full { display: block; padding: 0; background: #fff; border-radius: 0; }
.page--costs .cs-sum--full .cs-sum__list { width: auto; }
.page--costs .cs-sum--full .cs-sum__row { padding: 0 16px; color: var(--text); }
.page--costs .cs-sum--full .cs-sum__row dt { font-weight: 700; }
.page--costs .cs-sum--full .cs-sum__row .cs-sum__val { font-weight: 700; color: var(--text); }
.page--costs .cs-sum--full .cs-sum__row--profit { margin-top: 0; border-radius: 0; padding: 0 16px; border-bottom: 0; }
.page--costs .cs-sum--full .cs-sum__row--profit .cs-sum__val { color: #166534; font-size: 13px; }
.page--costs .cs-sell__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--cx-line); }
.page--costs .cs-sell__foot:has(.cs-add-rate) { flex-wrap: wrap; } .page--costs .cs-sell__foot .cs-add-rate { margin-inline-end: auto; }
.page--costs .cs-sell__foot .cx-btn--primary:disabled { background: #E3E7EE; border-color: #E3E7EE; color: #8A95A8; cursor: not-allowed; }
.page--costs .cs-tag--pending { background: #FFF4E5; color: #9A4D00; }
.page--costs .cs-gap { margin: 0 0 12px; padding: 10px 14px; border: 1px solid #F5C77E; border-radius: 6px; background: #FFF4E0; color: #92400E; font-size: 12px; font-weight: 600; }
/* Cost page (Sardar 25/10/2026): every cost group shows its header row, also with no line, desktop and phone. */
.page--costs .cx-table tr.cx-group > th.cx-group__head { padding: 14px 6px 6px; background: #F7F8FA; color: var(--cx-navy);
  font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; text-align: start; border-bottom: 1px solid var(--cx-line); }
/* Cost page design notes (Sardar 25/10/2026, NG2037): an empty group's header (no row under it: the next
   row is another group or none; open orders only, a locked / closed order shows no empty group) reads muted;
   it reads as the others again once a row joins it. Every number cell and total uses tabular digits. */
.page--costs .cx-table tr.cx-group:is(:has(+ tr.cx-group), :has(+ tr.cx-group-empty:last-child), :has(+ tr.cx-group-empty + tr.cx-group), :last-child) > th.cx-group__head { color: var(--cx-muted); font-weight: 600; }
.page--costs :is(.cx-num, .cx-field--num, .cs-sum__val) { font-variant-numeric: tabular-nums; }
/* Phone: the Cost total row's currency and amount stay apart ("USD 225.50"; the 11% column overlapped them at 390px). */
@media (max-width: 640px) {
  .page--costs .cs-costtotal--ro tr:not([hidden]) { grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 6px; }
}


/* ---------- Sea v3 (Sardar 22/10 10:39, sea-pages-2026-10-21): the Land v3 page for Sea Freight / LCL ---------- */
.sea-page .sea-route .sea-route__city, .sea-page .sea-route .sea-route__load, .sea-page .sea-route [data-delivery-city],
.sea-page .sea-route .transport-builder, .sea-page .sea-route .repeat-list, .sea-page .sea-route .repeat-row { display: contents; }
.sea-page .sea-route .transport-builder > .field__label, .sea-page .sea-route [data-repeat-add],
.sea-page .sea-route .repeat-list:has(> .repeat-row:only-child) .repeat-remove { display: none; }
.sea-page .sea-route .repeat-row > label { display: flex; flex-direction: column; }
/* Container type mix (owner 02/11/2026, open orders): Add another type under the fields once the quantity is over 1;
   with two lines or more each is its own row of the page's two columns, the Remove beside it. */
.transport-builder [data-repeat-add][hidden], .cargo-mix__total[hidden] { display: none !important; }
.cargo-mix__total { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sea-page .sea-route .transport-builder--mix > [data-repeat-add]:not([hidden]) { display: inline-flex; grid-column: 1 / -1; justify-self: start; }
.sea-page .sea-route .transport-builder--mix > .cargo-mix__total { grid-column: 1 / -1; }
.sea-page .sea-route .transport-builder--mix .repeat-list:has(> .repeat-row + .repeat-row) { display: flex; flex-direction: column; gap: 12px; grid-column: 1 / -1; min-width: 0; }
.sea-page .sea-route .transport-builder--mix .repeat-list:has(> .repeat-row + .repeat-row) > .repeat-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 12px 16px; align-items: end; padding: 0; border: 0; background: none; }
@media (max-width: 640px) {
  .sea-page .sea-route .transport-builder--mix .repeat-list:has(> .repeat-row + .repeat-row) > .repeat-row { grid-template-columns: minmax(0, 1fr) 40px; }
  .sea-page .sea-route .transport-builder--mix .repeat-list:has(> .repeat-row + .repeat-row) > .repeat-row > label { grid-column: 1; }
  .sea-page .sea-route .transport-builder--mix .repeat-list:has(> .repeat-row + .repeat-row) > .repeat-row > .repeat-remove { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}
.sea-page [data-service-section="7"] .assignment-row:not([hidden]), .sea-page [data-service-section="5"] .assignment-row:not([hidden]),
.sea-page [data-service-section="9"] .assignment-row:not([hidden]) { display: grid; grid-template-columns: 38% 1fr; gap: 12px 16px; align-items: start; padding: 10px 0; border: 0; }
.sea-page [data-service-section="7"] .assignment-row > .leg-row__title, .sea-page [data-service-section="5"] .assignment-row > .leg-row__title { grid-column: 1; grid-row: 1 / span 3; margin: 28px 0 0; font-size: 13px; font-weight: 700; }
.sea-page [data-service-section="7"] .assignment-row > :not(.leg-row__title):not([hidden]):not(input), .sea-page [data-service-section="5"] .assignment-row > :not(.leg-row__title):not([hidden]):not(input) { grid-column: 2; }
.sea-page [data-service-section="7"] .leg-rows, .sea-page [data-service-section="7"] .customs-rows, .sea-page [data-service-section="5"] .leg-rows { display: block; }
.sea-page [data-service-section="8"] .port-picker__pod { max-width: calc(50% - 8px); }
.sea-page [data-service-section="8"] .port-picker__pod .field { width: 100%; }
.sea-page [data-service-section="7"] .field__hint, .sea-page [data-service-section="8"] .field__hint, .sea-page [data-service-section="8"] .field__info { display: none; }
.land-page.sea-page [data-service-section="5"] .section-fields > .form-grid { grid-template-columns: 1fr !important; }
.land-page.sea-page [data-service-section="5"] .section-fields > .form-grid > * { grid-column: 1 / -1 !important; }
.sea-page [data-service-section="8"] .port-picker__pod select { width: 100%; }
.land-page.sea-page [data-service-section="5"] .leg-rows { order: 1; }
.land-page.sea-page [data-service-section="5"] [data-land-handover] { order: 2; margin-left: calc(38% + 16px); display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.land-page.sea-page .op-closed, .land-page.sea-page [data-op-closed] { display: none; }
.land-page.sea-page .land-foot { position: sticky; bottom: 0; }

/* ---------- Clearance v3 (Sardar 22/10 16:46, clearance-pages-2026-10-22): Port / Border Clearance ---------- */
/* One column as every service since 31/10 (design unification): the Shipment card beside the page and
   its two-column grid are gone (it repeated Order & route). */
/* Design P2-2/P2-3 (PR #132): the View Edit · Next / Reopen Order bar is not sticky (sticky only while editing);
   the edit form keeps room under its last row (Entry Date) for the sticky edit footer. */
.page.clr-page:not(:has(#order-form)) .land-foot { position: static !important; }
html:has(.page.clr-page #order-form) { scroll-padding-bottom: 80px; }
.page.clr-page #order-form .land-foot { margin-top: 24px; padding-block: 5px; }
.clr-page .clr-route__entry .op-data { display: block; padding: 8px 0; }
.clr-page [data-service-section="7"] .clr-row:not([hidden]) { display: grid; grid-template-columns: 38% 1fr; gap: 12px 16px; align-items: start; padding: 10px 0; border: 0; border-top: 1px solid var(--border, #e5e7eb); }
.clr-page [data-service-section="7"] .clr-row > .leg-row__title { grid-column: 1; margin: 28px 0 0; font-size: 13px; font-weight: 700; }
.clr-page [data-service-section="7"] .clr-row > :not(.leg-row__title) { grid-column: 2; max-width: calc(50% - 8px); }
.clr-page [data-service-section="7"] .clr-row .port-picker__pod, .clr-page [data-service-section="7"] .clr-row .port-picker__pod .field { width: 100%; max-width: none; }
.clr-page [data-service-section="7"] .field__hint, .clr-page [data-service-section="7"] .field__info { display: none; }
@media (max-width: 900px) {
  .clr-page [data-service-section="7"] .clr-row:not([hidden]) { grid-template-columns: 1fr; }
  .clr-page [data-service-section="7"] .clr-row > :not(.leg-row__title) { grid-column: 1; max-width: none; }
  .clr-page [data-service-section="7"] .clr-row > .leg-row__title { margin: 0; }
}
.clr-page .sea-route .repeat-row input[name^="land_qty"] { text-align: end; }
.clr-page [data-service-section="7"] .clr-row .port-picker { width: 100%; max-width: none; margin: 0; }
.clr-page [data-service-section="7"] .clr-row .port-picker__pod select, .clr-page [data-service-section="7"] .clr-row select { width: 100%; }
.clr-page [data-service-section="7"] .customs-row:not([hidden]) { grid-template-columns: 38% 1fr 1fr !important; }
.clr-page [data-service-section="7"] .customs-row > .leg-row__title { grid-row: 1 !important; }
.clr-page [data-service-section="7"] .customs-row > :not(.leg-row__title):not([hidden]):not(input) { grid-column: auto !important; }
.clr-page [data-service-section="7"] .clr-row:not([hidden]) { grid-template-columns: 38% 1fr 1fr; }
.clr-page [data-service-section="7"] .clr-row > :not(.leg-row__title) { grid-column: 2; max-width: none; }
@media (max-width: 900px) {
  .clr-page [data-service-section="7"] .customs-row:not([hidden]), .clr-page [data-service-section="7"] .clr-row:not([hidden]) { grid-template-columns: 1fr !important; }
  .clr-page [data-service-section="7"] .clr-row > :not(.leg-row__title) { grid-column: 1; }
}
.clr-page [data-service-section="7"] .clr-row .port-picker { border-bottom: 0; padding: 0; }
.clr-page [data-service-section="7"] .clr-row .port-picker, .clr-page [data-service-section="7"] .clr-row .port-picker__pod { display: block; }
.clr-page [data-service-section="7"] .clr-row .port-picker__pod > .field { display: flex; width: 100%; }
@media (max-width: 900px) {
  .clr-page [data-service-section="7"] .clr-row:not([hidden]), .clr-page [data-service-section="7"] .customs-row:not([hidden]) { grid-template-columns: minmax(0, 1fr) !important; }
  .clr-page [data-service-section="7"] .clr-row > *, .clr-page [data-service-section="7"] .customs-row > * { grid-column: 1 !important; grid-row: auto !important; margin-top: 0 !important; }
}
/* Settings redesign (Sardar, 23/10): desktop administration workspace. Full content width like every
   other page (the shared .page container, as Settings › Company accounts; 25/10): no own max-width. */
.page--settings {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.page--settings > .page-header { display: contents; }
/* Settings v2 (design settings-redesign-2026-10-31 v2, Sardar 31/10): the hero is a navy card with a 3px orange
   underline; the subnav carries count pills and an orange inset bar on the current page; the Overview is a
   4-column board of group cards whose pages are tiles. Same groups, pages, labels and links. */
.page--settings > .page-header > div {
  position: relative;
  grid-column: 1 / -1;
  box-sizing: border-box;
  margin: 20px 0 0;
  padding: 18px 24px;
  border-radius: 14px;
  background: linear-gradient(120deg, #0F2660, #14327A);
  box-shadow: inset 0 -3px 0 #F47B20;
  color: #fff;
}
.page--settings .page-header__eyebrow {
  margin: 0;
  color: #C9D5EC;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.page--settings .page-header .page-title {
  margin: 4px 0 0;
  color: #fff;
  font-family: var(--font);
  font-size: 28px;
  font-weight: 700;
}
.settings-side-nav {
  grid-column: 1;
  grid-row: 2 / span 30;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.settings-side-nav p {
  margin: 12px 10px 4px;
  color: #56657A;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
}
.settings-side-nav a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
}
.settings-side-nav a:hover { background: var(--surface-2); color: var(--navy); }
.settings-side-nav a[aria-current="page"] {
  background: #EEF2FA;
  color: #14327A;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #F47B20;
}
.settings-count {
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  background: #F1F4F9;
  color: #56657A;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
}
.settings-side-nav__overview { margin-bottom: 2px; }
.settings-shell,
.page--settings > :not(.page-header):not(.settings-side-nav) {
  grid-column: 2;
  min-width: 0;
}
.settings-shell { display: grid; gap: 16px; }
.settings-table-card > .card__header { min-height: 52px; padding: 0 16px; }
/* Overview board: People & access 1 + Customers & providers 3; Services 1 + Operational standards 2 + Review &
   traceability 1 (the existing group order). Cards of a row share its height; the tiles fill the card. */
.settings-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.settings-group--span1 { grid-column: span 1; }
.settings-group--span2 { grid-column: span 2; }
.settings-group--span3 { grid-column: span 3; }
.page--settings .settings-overview > .settings-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 38, 96, .05);
}
.settings-group__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid #EEF1F5;
  background: #FAFBFD;
}
.settings-group__head .card__title { margin: 0; color: var(--text); font-size: 15px; font-weight: 700; }
.settings-group__pages {
  flex: none;
  margin-inline-start: auto;
  padding: 2px 9px;
  border-radius: 999px;
  background: #EEF2FA;
  color: #14327A;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.settings-tiles { flex: 1; display: grid; grid-template-columns: repeat(var(--settings-tiles, 1), minmax(0, 1fr)); }
.settings-group--tiles2 { --settings-tiles: 2; }
.settings-group--tiles4 { --settings-tiles: 4; }
.settings-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 118px;
  box-sizing: border-box;
  padding: 16px 20px;
  border-inline-end: 1px solid #EEF1F5;
  color: inherit;
  text-decoration: none;
  transition: background .15s;
}
.settings-tile:last-child { border-inline-end: 0; }
.settings-tile:hover { background: #F7F9FD; }
.settings-tile:focus-visible { outline: 3px solid var(--orange); outline-offset: -3px; }
.settings-tile__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--ctl-sm);
  height: var(--ctl-sm);
  border-radius: 9px;
  background: #EEF2FA;
  color: #14327A;
}
.settings-tile__icon .icon { width: 18px; height: 18px; stroke-width: 1.8; }
.settings-tile__label { color: var(--text); font-size: 15px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.settings-tile__count { margin-top: 4px; color: #14327A; line-height: 1; white-space: nowrap; }
.settings-tile__count > b { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.settings-tile__count > span { margin-inline-start: 2px; color: #56657A; font-size: 13px; font-weight: 500; }
.settings-tile__fact { color: #56657A; font-size: 12.5px; line-height: 1.45; }
/* The design's #C25E0F reads 4.3:1 on white; the app's orange text colour keeps AA (4.5:1). */
.settings-tile__open { margin-top: auto; color: var(--orange-text); font-size: 13px; font-weight: 600; }
.settings-tile:hover .settings-tile__open { text-decoration: underline; }
/* Narrower desktops (sidebar beside a short board): one group per row, its tiles side by side. */
@media (max-width: 1180px) {
  .settings-overview { grid-template-columns: minmax(0, 1fr); }
  .settings-overview > .settings-group { grid-column: 1; }
}
.settings-table-card { margin: 0; overflow: hidden; }
.settings-data { min-width: 720px; }
.settings-data thead th {
  padding: 10px 16px;
  background: #F8FAFC;
  color: var(--text-4);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.settings-data tbody :is(th, td) { padding: 11px 16px; font-size: 13px; }
.settings-data tbody th { color: var(--navy-950); text-align: start; }
.settings-data .actions { text-align: end; }
.settings-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-card-actions > div,
.settings-value-actions,
.settings-order-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.settings-value-actions form,
.settings-order-actions form { margin: 0; }
.settings-switch {
  display: inline-flex;
  align-items: center;
  width: 32px;
  height: 18px;
  padding: 2px;
  border: 0;
  border-radius: 18px;
  background: #CBD3DF;
  cursor: pointer;
}
.settings-switch span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 24, 48, .24);
  transition: transform .15s;
}
.settings-switch.is-on { background: var(--success); }
.settings-switch.is-on span { transform: translateX(14px); }
.settings-delete { width: 28px; height: 28px; min-width: 28px; color: var(--text-4); }
.settings-delete:hover { color: var(--danger); }
.settings-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 24, 48, .46);
}
.settings-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 81;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 24, 48, .28);
  transform: translate(-50%, -50%);
}
.settings-dialog__head,
.settings-dialog__foot { padding: 16px 20px; }
.settings-dialog__head { border-bottom: 1px solid var(--border); }
.settings-dialog__head h2 { margin: 0; color: var(--navy-950); font-size: 16px; }
.settings-dialog__body { display: grid; gap: 14px; padding: 16px 20px; }
.settings-dialog .field { display: grid; gap: 7px; margin: 0; }
.settings-dialog .field > span,
.settings-status legend { color: var(--text-2); font-size: 12px; font-weight: 700; }
.settings-dialog .field b { color: var(--danger); }
.settings-dialog input:not([type="radio"]) { width: 100%; box-sizing: border-box; }
.settings-dialog input:disabled { background: #EEF2F7; color: var(--text-4); }
.settings-status { display: flex; margin: 0; padding: 0; border: 0; }
.settings-status legend { margin-bottom: 7px; }
.settings-status label { position: relative; }
.settings-status input { position: absolute; opacity: 0; }
.settings-status span {
  display: block;
  min-width: 70px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  text-align: center;
}
.settings-status label:first-of-type span { border-radius: 7px 0 0 7px; }
.settings-status label:last-of-type span { margin-inline-start: -1px; border-radius: 0 7px 7px 0; }
.settings-status input:checked + span { position: relative; z-index: 1; border-color: var(--navy); background: var(--navy); color: #fff; }
.settings-status input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }
.settings-dialog__foot { display: flex; justify-content: flex-end; gap: 12px; border-top: 1px solid var(--border); }
@media (max-width: 800px) {
  .page--settings { grid-template-columns: minmax(0, 1fr); }
  .settings-side-nav { grid-column: 1; grid-row: auto; flex-direction: row; flex-wrap: wrap; }
  .settings-side-nav p { flex-basis: 100%; }
  .settings-shell, .page--settings > :not(.page-header):not(.settings-side-nav) { grid-column: 1; }
  .settings-overview { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .page--settings { gap: 12px; }
  .page--settings > .page-header > div { margin-top: 12px; padding: 16px; }
  .settings-side-nav {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 8px;
    border-radius: 10px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .settings-side-nav p { display: none; }
  .settings-side-nav a { flex: none; border: 1px solid var(--border); }
  .settings-side-nav__overview { margin-bottom: 0; }
  .settings-side-nav a[aria-current="page"] { border-color: #14327A; background: #14327A; color: #fff; box-shadow: none; }
  /* Orange count on the navy chip; dark text keeps AA on the orange (as the + New order button). */
  .settings-side-nav a[aria-current="page"] .settings-count { background: #F47B20; color: #1B1B1B; }
  .settings-overview { gap: 12px; }
  .settings-tiles, .settings-group--tiles2 .settings-tiles, .settings-group--tiles4 .settings-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-tile { min-height: 0; padding: 14px; border-bottom: 1px solid #EEF1F5; }
  .settings-tile:nth-child(2n) { border-inline-end: 0; }
  .settings-tile:nth-last-child(-n+2):nth-child(odd), .settings-tile:last-child { border-bottom: 0; }
  .settings-tile__open { display: none; }
  .settings-group--tiles1 .settings-tiles { grid-template-columns: minmax(0, 1fr); }
  .settings-group--tiles1 .settings-tile { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 12px; }
  .settings-group--tiles1 .settings-tile__count { margin-top: 0; }
  .settings-group--tiles1 .settings-tile__fact { width: 100%; }
}

/* Settings → Services (Sardar 24/10, design settings-05 / -06). */
.settings-note { color: var(--text-4); font-size: 12px; font-weight: 500; }
.settings-delete.is-disabled { display: inline-flex; align-items: center; justify-content: center; opacity: .38; cursor: not-allowed; }
.settings-delete.is-disabled:hover { color: var(--text-4); }
.settings-service-editor > form { display: grid; gap: 16px; }
.settings-service-editor .card { margin: 0; }
.settings-service-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding: 16px; }
.settings-service-fields .field { display: grid; gap: 7px; margin: 0; }
.settings-service-fields .field > span, .settings-service-fields .settings-status legend { color: var(--text-2); font-size: 12px; font-weight: 700; }
.settings-service-fields .field b { color: var(--danger); }
.settings-service-fields input:disabled { background: #EEF2F7; color: var(--text-4); }
.settings-stages-card .card__header { min-height: 52px; padding: 0 16px; }
.settings-stages-error { margin: 12px 16px 0; }
.settings-stages td { vertical-align: middle; }
.settings-stages tbody td { padding: 10px 12px; }
.settings-stages tbody td:first-child { width: 36px; padding-inline-start: 16px; }
.settings-step { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; }
.row--inactive .settings-step { background: #CBD3DF; }
.settings-stage-name { width: 240px; }
.settings-stage-name input { width: 100%; box-sizing: border-box; }
.settings-stage-name .settings-note { display: block; margin-top: 4px; }
.settings-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: var(--ctl-md); padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-sizing: border-box; }
.settings-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; border-radius: 6px; background: #E8EEF9; color: var(--navy-950); font-size: 12px; font-weight: 600; }
.settings-chip button { display: inline-flex; padding: 2px; border: 0; border-radius: 4px; background: none; color: var(--text-3); cursor: pointer; }
.settings-chip button:hover, .settings-chip button:focus-visible { background: #D3DDF0; color: var(--danger); }
.settings-chip .icon { width: 12px; height: 12px; }
.settings-add-field select { min-height: 28px; padding: 2px 24px 2px 6px; border: 0; background-color: transparent; color: var(--text-3); font-size: 12px; }
.settings-stages .settings-value-actions { gap: 6px; }
.settings-stages .icon-btn { width: 28px; height: 28px; min-width: 28px; color: var(--text-3); }
.settings-stages .icon-btn:hover:not(:disabled):not(.is-disabled) { background: var(--surface-2); color: var(--navy); }
.settings-stages .icon-btn:disabled { opacity: .3; cursor: default; }
label.settings-switch--check { position: relative; }
label.settings-switch--check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
label.settings-switch--check input:disabled { cursor: not-allowed; }
label.settings-switch--check:has(input:checked) { background: var(--success); }
label.settings-switch--check:has(input:checked) span { transform: translateX(14px); }
label.settings-switch--check:not(:has(input:checked)) { background: #CBD3DF; }
label.settings-switch--check:not(:has(input:checked)) span { transform: none; }
label.settings-switch--check:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 2px; }
.settings-fixed { display: inline-flex; align-items: center; justify-content: center; width: 32px; color: var(--text-4); }
.settings-stages-foot { padding: 12px 16px 16px; border-top: 1px solid var(--border); }
.settings-savebar { display: flex; justify-content: flex-end; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.settings-path-form { margin-top: -8px; }
.js .settings-path-form { display: none; }
.settings-switch.is-disabled { cursor: not-allowed; opacity: .55; }
/* Settings at phone / tablet width (QA s3 P2-4, Sardar 24/10): no page-wide horizontal scroll —
   a wide table scrolls inside its card. The tables' visually hidden labels (.sr-only, absolute)
   are kept inside their scroll box, and the service editor's form may shrink to the column. */
@media (max-width: 800px) {
  .page--settings .table-scroll { position: relative; }
  .settings-service-editor > form, .settings-service-editor > form > .card { min-width: 0; }
}

/* Design full review (22/10): signed-in pages read English only; Arabic companion
   lines added in the browser (app.js) are hidden too. The sign-in page keeps its own. */
body:has(.app-header) [lang="ar"]:not(input):not(textarea):not(select) { display: none !important; }

/* Design full review 22/10 (P2): readable at a glance on desktop. */
.table-card--activity .action-pill, .page--settings .table-card.table-card--activity .action-pill { text-transform: none; white-space: normal; max-width: none; }
.page--settings td.col-role { min-width: 180px; }
.page--settings td.col-role .badge { white-space: nowrap; margin-inline-end: 12px; }
.page--costs td.cx-vendor select, .page--costs td.cx-vendor .cx-select { display: inline-block; width: calc(100% - 24px); vertical-align: middle; }
input::placeholder, textarea::placeholder,
.page--costs .cx-select input::placeholder, .page--costs .cx-field::placeholder { color: #6B7280; }
select:invalid, select option[value=""] { color: #6B7280; }
.cx-badge--ro, .cs-tag { color: #4B5563; }
/* PR #136 re-check 23/10 (#22): on every View page the Edit · Next / Reopen Order bar scrolls with the page
   (sticky only while editing), as the Clearance fix. */
.page:not(:has(#order-form)) .land-foot, .page:not(:has(#order-form)) .op-bottom-bar { position: static !important; }
/* #19: darker captions, placeholders and Locked pills (WCAG AA on white and on the pill). */
.page--costs .cs-costtotal__cur, .page--costs .cs-costtotal--ro .cs-costtotal__cur { color: #4B5563; }
input::placeholder, textarea::placeholder, .date-field__input::placeholder { color: #4B5563; }
.cx-badge--ro, .cx-badge:not([class*="--"]) { color: #374151; }


/* Stage controls (Sardar 23/10 11:49, design v3.1): Cancel order | Back to stage on the left; Save + Next stage on the right. */
.stage-ctl__left { display: inline-flex; align-items: center; gap: 12px; margin-inline-end: auto; flex: 0 0 auto; position: relative; }
.stage-ctl__left .order-bar__change { margin: 0 !important; }
.stage-ctl__cancel { color: #B42318 !important; border: 1px solid #B42318 !important; background: #fff !important; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.stage-ctl__cancel svg { width: 16px; height: 16px; }
.stage-ctl__divider { width: 1px; height: 28px; background: var(--r3-line, #D9E0EA); }
.stage-ctl__next, .page.order-page .order-bar__buttons .op-close.stage-ctl__next { background: #F47B20; color: #0F1830; border-color: #F47B20; white-space: nowrap; width: auto; max-width: none; flex: 0 0 auto; min-height: 44px; }
.stage-ctl__next:hover { background: #E0711D; color: #0F1830; }
.land-foot__change { margin-inline-end: auto; }
.land-foot .land-foot__change { margin-inline: 0 auto; }
.land-foot .order-bar__change-panel { inset-inline-end: auto; inset-inline-start: 0; }
.page.order-page.land-page .land-foot .op-head__change > summary, .land-foot .order-bar__change > summary { min-height: 44px; padding: 0 14px; border: 1px solid var(--navy-800); border-radius: 10px; background: #fff; color: var(--navy-800); font-size: 14px; display: inline-flex; align-items: center; }
.page.order-page .order-bar__buttons > .stage-ctl__left .order-bar__change > summary { min-height: 44px; }
/* Sea/Air/clearance edit: the stage controls live once, in the bottom bar (Design 23/10 P2-4). */
.page.order-page .op-bottom-bar--stage { display: block; padding: 0; }
.page.order-page .op-bottom-bar--stage .land-foot { position: static; border-top: 0; display: flex; align-items: center; gap: 12px; padding: 16px 20px; }
.page.order-page .op-bottom-bar--stage .order-bar__change > summary, .page.order-page .land-foot .order-bar__change > summary { min-height: 44px; padding: 0 14px; border: 1px solid var(--navy-800, #0F1830) !important; border-radius: 10px; background: #fff !important; color: var(--navy-800, #0F1830) !important; -webkit-text-fill-color: currentColor; font-size: 14px; display: inline-flex; align-items: center; }
@media (min-width: 1024px) {
  /* A completed order has no Next action to keep in view. Leaving its bar in
     normal flow keeps the final form row fully visible instead of covering it. */
  .page.order-page--edit .land-foot.land-foot--closed { position: static; }
}
/* Cost / Sell list (Sardar 29/10/2026, list design v5): one card per section, a count pill in each head,
   tighter rows; "Costs closed" is a collapsed <details> (Show / Hide) between Active orders and Cancelled. */
.page--accounts .acc-search { margin-bottom: 16px; }
.page--accounts .acc-search .toolbar { border-bottom: 0; }
.page--accounts .acc-sections { display: flex; flex-direction: column; gap: 16px; }
.page--accounts .acc-section { margin: 0; overflow: hidden; }
.page--accounts .acc-section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page--accounts .acc-section__sub { margin-inline-start: 6px; color: var(--text-3); font-size: 13px; font-weight: 400; }
.page--accounts .acc-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 999px; background: #EEF1F5; color: var(--text-2); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.page--accounts .acc-section .data tbody td { padding-top: 10px; padding-bottom: 10px; }
.page--accounts .acc-closed > summary { cursor: pointer; list-style: none; }
.page--accounts .acc-closed > summary::-webkit-details-marker { display: none; }
.page--accounts .acc-closed:not([open]) > summary { border-bottom: 0; }
.page--accounts .acc-closed__head .card__title { flex: 1 1 auto; min-width: 0; }
.page--accounts .acc-closed__chev { display: inline-block; color: var(--text-3); font-size: 18px; line-height: 1; transition: transform .15s; }
.page--accounts .acc-closed[open] .acc-closed__chev { transform: rotate(90deg); }
.page--accounts .acc-closed__meta { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.page--accounts .acc-closed__toggle { color: var(--navy); font-weight: 600; font-size: 14px; }
.page--accounts .acc-closed:not([open]) .acc-closed__hide, .page--accounts .acc-closed[open] .acc-closed__show { display: none; }
.page--accounts .acc-pending-alert__where { font-weight: 600; }
@media (max-width: 640px) {
  .page--accounts .acc-section__sub { display: none; }
  .page--accounts .acc-closed__meta .badge { display: none; }
  /* Stacked rows (list design v5 at 390): NG and customer on the left, total over the status on the right. */
  .page--accounts .acc-section .data--cards tbody { gap: 0; padding: 0; background: none; }
  .page--accounts .acc-section .data--cards tbody tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "ng total" "company status";
    gap: 4px 12px; margin: 0; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; }
  .page--accounts .acc-section .data--cards tbody tr:last-child { border-bottom: 0; }
  .page--accounts .acc-section .data--cards tbody td.col-ng { grid-area: ng; }
  .page--accounts .acc-section .data--cards tbody td.col-company { grid-area: company; padding: 0; border: 0; font-size: inherit; }
  .page--accounts .acc-section .data--cards tbody td.col-status { grid-area: status; align-self: center; }
  .page--accounts .acc-section .data--cards tbody td.card-wide { grid-area: total; text-align: end; font-weight: 700; }
  .page--accounts .acc-section .data--cards tbody td.card-wide::before { display: none; }
}

/* Cost / Sell order page (Sardar 29/10/2026, design v4): the team in the header, a quiet strip of the real states,
   a Cost / Sell / Profit summary, the return banner with its time, "No lines yet" in an empty group, and phone line
   cards (≤640px, app.js wireLineCards). The fields, buttons and their order are unchanged. */
.page--costs .cx-hero__team { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 10px 0 0; color: #C9D2E6; font-size: 13px; }
.page--costs .cx-hero__team b { color: #fff; font-weight: 600; }
.page--costs .cs-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 16px; padding: 16px 12px 14px; list-style: none;
  background: #fff; border: 1px solid var(--cx-line); border-radius: 10px; }
.page--costs .cs-flow__step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.page--costs .cs-flow__step + .cs-flow__step::before { content: ""; position: absolute; top: 10px; inset-inline-end: calc(50% + 16px); width: calc(100% - 32px);
  height: 1px; background: var(--cx-line); }
.page--costs .cs-flow__dot { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid #C5CCD8; background: #fff; color: var(--cx-muted); font-size: 11px; font-weight: 700; }
.page--costs .cs-flow__label { color: var(--cx-muted); font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.page--costs .cs-flow__step.is-done .cs-flow__dot { border-color: var(--cx-green); background: var(--cx-green); color: #fff; }
.page--costs .cs-flow__step.is-now .cs-flow__dot { border-color: var(--orange); background: var(--orange); color: #fff; }
.page--costs .cs-flow__step.is-now .cs-flow__label { color: var(--text); font-weight: 700; }
.page--costs .cs-overview { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0 0 16px; padding: 12px 20px; background: #fff;
  border: 1px solid var(--cx-line); border-radius: 10px; }
.page--costs .cs-overview__item { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.page--costs .cs-overview__item dt { color: var(--cx-muted); font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.page--costs .cs-overview__item dd { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.page--costs .cs-overview__item--profit dd { color: var(--cx-green); }
.page--costs .cs-overview__item--profit.is-neg dd { color: var(--danger); }
/* Owner 02/11/2026: the Sell total is after the invoice's discount; this note names it. */
.page--costs .cs-overview__pct { color: var(--cx-muted); font-size: 12px; font-weight: 500; }
.page--costs .cs-return-banner { display: flex; align-items: flex-start; gap: 10px; border-color: var(--danger-bd); border-inline-start: 3px solid var(--danger);
  background: var(--danger-bg); color: var(--text); }
.page--costs .cs-return-banner > .icon { flex: none; margin-top: 2px; color: var(--danger); }
.page--costs .cs-return-banner p { margin: 0; }
.page--costs .cs-return-banner__head b { color: var(--danger); }
.page--costs .cs-return-banner__reason { margin-top: 2px !important; }
.page--costs .cx-table tr.cx-group-empty > td { padding: 10px 24px; color: var(--cx-muted); font-size: 13px; }
.page--costs .cx-table tr.cx-group-empty:has(+ tr[data-line]) { display: none; }
.page--costs .cx-table td.cx-lc { display: none; }
/* Sardar 02/11/2026 (option 3): cost grand total + exchange rate, on the cost page and the order page. */
.cs-grand [hidden], .cs-overview__item[hidden] { display: none !important; }
.page--costs .cs-grand { margin: -8px 0 16px; padding: 12px 24px 16px; }
.cs-grand__row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(150px, auto); align-items: center; gap: 12px; margin: 0; padding: 8px 0; }
.cs-grand__label, .cs-grand__title { color: var(--text); font-size: 14px; font-weight: 700; margin: 0; }
.cs-grand__cur { color: #4B5563; font-size: 13px; }
.cs-grand__value { text-align: end; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cs-grand__pick { display: inline-flex; gap: 8px; align-items: center; }
.cs-grand__pick select { appearance: auto; min-width: 76px; height: 36px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); font: inherit; font-size: 14px; }
.cs-grand__missing { color: #B4530A; font-size: 13px; font-weight: 600; font-variant-numeric: normal; }
.cs-overview__item .cs-grand__val { display: inline; }
.cs-grand__rates { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 24px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.cs-grand__title { flex: 0 0 100%; font-size: 13px; }
.cs-grand__rate { display: flex; align-items: center; gap: 10px; }
.cs-grand__rate-label { color: #4B5563; font-size: 13px; font-weight: 600; }
.cs-grand__rate-field { display: inline-flex; flex-direction: column; gap: 4px; }
.page--costs .cs-grand__input { width: 130px; }
.page--costs .cs-grand__input { margin-inline-start: 0; }
@media (min-width: 1024px) {
  .page--costs .cs-grand__rates { justify-content: flex-end; }
  .page--costs .cs-grand__title { text-align: end; }
}
@media (max-width: 1023px) {
  .page--costs .cs-grand__rate { align-items: flex-start; }
  .page--costs .cs-grand__rate-label { padding-top: 12px; }
}
.page--costs .cs-grand__rate-field { align-items: flex-end; text-align: end; }
@media (max-width:1023px){ .page--costs .cs-grand__rate-field { margin-inline-start: auto; } }
@media (min-width:641px) and (max-width:1023px){ .page--costs .cs-grand__rate{flex:1 1 100%;justify-content:space-between;} .page--costs .cs-grand__save{margin-inline-start:auto;} }
.cs-grand__rate-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.cs-grand__hint { color: #B4530A; font-size: 12px; }
/* Cost / Sell v2 (Sardar 16/11/2026 01:59–02:28): the Costs totals (per-currency subtotals side by side, ONE Exchange rates
   box "1 USD = X", Total in [USD | IQD]), the locked costs line, the Sell step with ONE sticky summary panel on the right,
   the missing-rate box above Send (red with its one error after a refused Send). */
.page--costs .cs-costtotal--ro tbody { display: flex !important; flex-wrap: wrap; gap: 0 32px; padding: 0 24px; }
.page--costs .cs-costtotal--ro tr:not([hidden]) { display: flex; align-items: baseline; gap: 8px; padding: 0; }
.page--costs .cs-costtotal--ro tr:not([hidden]) ~ tr th { display: none; }
.page--costs .cs-grand__rate .cs-grand__rate-field { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
.page--costs .cs-grand__rate .field__error { flex: 0 0 100%; }
.page--costs .cs-grand__rate.is-missing .cs-grand__input { border-color: #DC2626; box-shadow: 0 0 0 1px #DC2626; }
.cs-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.cs-seg__opt { position: relative; display: inline-flex; }
.cs-seg__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cs-seg__opt span { display: inline-flex; align-items: center; height: var(--ctl-sm, 32px); padding: 0 14px; font-size: 13px; font-weight: 700; color: #4B5563; cursor: pointer; }
.cs-seg__opt + .cs-seg__opt span { border-inline-start: 1px solid var(--border); }
.cs-seg__opt input:checked + span { background: #14327A; color: #fff; }
.cs-seg__opt input:focus-visible + span { outline: 2px solid #F47B20; outline-offset: -2px; }
.cs-seg__opt input:disabled + span { cursor: default; }
.page--costs .cs-locked { margin: 0 0 8px; padding: 0; }
.page--costs .cs-locked__line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 14px 24px; cursor: pointer; list-style: none; font-size: 14px; }
.page--costs .cs-locked__line::-webkit-details-marker { display: none; }
.page--costs .cs-locked__line .cx-lock { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.page--costs .cs-locked__sum { font-weight: 700; font-variant-numeric: tabular-nums; }
.page--costs .cs-locked__view { margin-inline-start: auto; color: #14327A; font-weight: 700; text-decoration: underline; }
.page--costs .cs-locked[open] .cs-locked__line { border-bottom: 1px solid var(--cx-line); }
.page--costs .cs-locked > form .cx-card { border: 0; box-shadow: none; margin: 0; }
.page--costs .cs-locked__reopen { display: flex; justify-content: flex-end; margin: 0 0 16px; }
.cx-btn--link { background: none; border: 0; color: #14327A; font-weight: 700; text-decoration: underline; padding: 0 4px; }
.page--costs .cs-step2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; margin: 0 0 16px; }
.page--costs .cs-step2 > .cs-sell { margin: 0; min-width: 0; }
.page--costs .cs-sell__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; padding: 12px 16px; border-bottom: 1px solid var(--cx-line); }
.page--costs .cs-sell__cur, .page--costs .cs-rates-ro { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page--costs .cs-sell__k { font-size: 13px; font-weight: 700; color: var(--text); }
.page--costs .cs-rates-ro__rate { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.page--costs .cs-tag--ro { background: #EEF1F6; color: #4B5563; }
.page--costs .cs-panel { position: sticky; top: 16px; margin: 0; padding: 0 0 12px; }
.page--costs .cs-panel__title { margin: 0; padding: 14px 16px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #4B5563; }
.page--costs .cs-panel .cs-sum--full { border-top: 0; }
.page--costs .cs-xrate { margin: 12px 16px 0; padding: 10px 12px; border: 1px solid var(--cx-line); border-radius: 8px; background: #FAFBFC; }
.page--costs .cs-xrate__title { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--text); }
.page--costs .cs-xrate__field { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.page--costs .cs-xrate__field .cs-in--rate { width: 120px; }
.page--costs .cs-xrate.is-invalid { border-color: #DC2626; background: #FDECEC; }
.page--costs .cs-xrate.is-invalid .cs-in--rate { border-color: #DC2626; }
.page--costs .cs-xrate .field__error { display: block; margin-top: 6px; }
.page--costs .cs-panel .cs-sell__foot { flex-direction: column; align-items: stretch; border-top: 0; padding: 12px 16px 0; }
/* Design review PR #283 P1-1 (frame c): beside the summary panel the Selling price table has six columns at desktop —
   Item (bold) with its vendor small and grey under it, Quantity, Cost total, Sell price / unit (input >= 120 px, the sell
   currency after it), Sell total, Profit. The Vendor and Currency cells are for the phone card layout only. */
.page--costs .cs-item__name { display: block; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.page--costs .cs-item__vendor { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: #6B7280; white-space: normal; }
.page--costs .cs-item__vendor .cx-truck { margin-inline-start: 6px; }
.page--costs .cs-sellin { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.page--costs .cs-sellin__cur { font-size: 12px; font-weight: 600; color: #4B5563; }
@media (min-width: 1024px) {
  .page--costs .cs-table--sell .cs-phone-only { display: none; }
  .page--costs .cs-table--sell .cs-uprice .cs-in { min-width: 120px; width: 120px; }
  .page--costs .cs-table--sell .cs-item { white-space: normal; }
  .page--costs .cs-step2 .cs-table--sell .c-item { width: 24%; } .page--costs .cs-step2 .cs-table--sell .c-qty { width: 11%; }
  .page--costs .cs-step2 .cs-table--sell .c-cost { width: 15%; } .page--costs .cs-step2 .cs-table--sell .c-cpu { width: 22%; }
  .page--costs .cs-step2 .cs-table--sell .c-ct { width: 13%; } .page--costs .cs-step2 .cs-table--sell .c-pr { width: 15%; }
}
@media (max-width: 1023px) {
  .page--costs .cs-table--sell .cs-item__vendor, .page--costs .cs-table--sell .cs-sellin__cur { display: none; }
  .page--costs .cs-sellin { display: block; }
}
@media (max-width: 1023px) {
  .page--costs .cs-step2 { grid-template-columns: minmax(0, 1fr); }
  .page--costs .cs-panel { position: static; }
}
/* Sardar 10/11/2026 (F-2, Design #273 P2): the cent-difference notice, a quiet line like the voucher / invoice acc-note. */
.cs-cent-note { margin: 0 0 8px; color: var(--text-4); font-size: 13px; }
.cs-grand--order .cs-grand__subtotals { margin-top: 4px; padding: 4px 20px 0; }
.cs-grand--order > .cs-grand__row { border-top: 1px solid var(--border); margin: 4px 20px 0; padding-bottom: 12px; }
@media (max-width: 1023px) {
  .page--costs .cx-table tr.cx-group-empty { display: block; }
  .page--costs .cx-table tr.cx-group-empty > td { display: block; padding: 0 0 8px; border: 0; }
  .page--costs .cx-table tr.cx-group-empty:has(+ tr[data-line]) { display: none; }
}
@media (max-width: 640px) {
  .page--costs .cs-flow { padding: 12px 4px; }
  .page--costs .cs-flow__label { font-size: 10px; letter-spacing: .3px; }
  .page--costs .cs-overview { flex-direction: column; padding: 12px 16px; }
  .page--costs .cs-overview__item { justify-content: space-between; }
  .page--costs .cs-grand { margin-top: 0; padding: 12px 16px; }
  .cs-grand--order .cs-grand__subtotals { padding-inline: 16px; }
  .cs-grand--order > .cs-grand__row { margin-inline: 16px; }
  .cs-grand__row { grid-template-columns: minmax(0, 1fr) auto; }
  .cs-grand__row--sub { grid-template-columns: minmax(0, 1fr) auto minmax(90px, auto); }
  .cs-grand__row:not(.cs-grand__row--sub) .cs-grand__value { grid-column: 1 / -1; }
  .cs-grand__pick select, .page--costs .cs-grand__input { height: 44px; font-size: 16px; }
  .cs-grand__rates { flex-direction: column; align-items: stretch; }
  .cs-grand__rate { justify-content: space-between; }
  .cs-grand__save { width: 100%; }
  /* A closed card: only its summary; Edit opens the row (is-open), a flagged row is open. */
  .page--costs .has-line-cards .cx-table--edit tr.cx-row:not(.is-open):has(> td.cx-lc) { display: block; }
  .page--costs .has-line-cards .cx-table--edit tr.cx-row:not(.is-open):has(> td.cx-lc) > td:not(.cx-lc) { display: none; }
  .page--costs .has-line-cards .cx-table--edit tr.cx-row:not(.is-open) > td.cx-lc { display: block; padding: 0; border: 0; }
  .page--costs .has-line-cards .cx-table--edit tr.cx-row.is-open > td.cx-lc { display: none; }
  .page--costs .cx-lc__top { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
  .page--costs .cx-lc__amt { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .page--costs .cx-lc__meta { margin: 4px 0 0; color: var(--cx-muted); font-size: 13px; overflow-wrap: anywhere; }
  .page--costs .cx-lc__acts { display: flex; gap: 16px; margin: 8px 0 0; }
  .page--costs .cx-lc__btn { padding: 4px 0; border: 0; background: none; color: var(--cx-navy); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
  .page--costs .cx-lc__btn--danger { color: var(--danger); }
}
/* =====================================================================
   Operations dashboard — light polish (Sardar 29/10/2026, design ops-light/light-polish): the same blocks, data,
   labels and links; display only, scoped to .page--home, after every earlier dashboard layer.
   1. Phones: the service links in a 2-column grid and the stage tiles in a 2-column grid (nothing cut off, no
      sideways swipe); Needs action today and At port before Orders by stage, as on a desktop.
   2. Stage tiles: equal height in a row; the name has its own two-line slot so the numbers line up; tiles with
      orders on a light tint, empty ones white (solid greys, no opacity).
   3. Clearer group titles, more space between groups; one 16px gap; Arrivals and By owner the same height.
   4. An empty Needs action / At port: the same green all-clear panel. By owner: clearer JOB OWNER / OPERATIONS 1.
   ===================================================================== */
.page--home { --dash-gap: 16px; }
.page--home .dash-split { gap: var(--dash-gap); align-items: stretch; }
.page--home .dash-side { display: contents; }
.page--home .dash-side > .dash-action { order: 0; }
.page--home .dash-side > .dash-at-port { order: 1; }
.page--home .dash-split > .stage-card { order: 2; grid-column: 1 / -1; }
.page--home .dash-side > .dash-arrivals { order: 3; }
.page--home .dash-side > .dash-owners { order: 4; }
.page--home .stage-board { gap: 18px; }
.page--home .stage-group__title { margin: 0 0 8px; color: var(--dash-ink); font-size: 13.5px; font-weight: 700; }
.page--home .pipeline { align-items: stretch; }
.page--home .pipeline > .stage { height: auto; }
.page--home .pipeline .stage__name { min-height: calc(2 * 1.4 * 12px); }
.page--home .pipeline > .stage:not(.is-zero) { background: #F8FAFC; }
.page--home .pipeline > .stage.is-zero { background: var(--surface); }
.page--home .dash-split .dash-empty--ok,
.page--home .dash-side .dash-empty--ok {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px; margin: 0; padding: 10px 14px;
  border: 1px solid #B7E4C7; border-inline-start: 4px solid var(--dash-green); border-radius: 8px;
  background: #ECFDF3; color: #166534; font-size: 13px; font-weight: 600; text-align: start;
}
.page--home .dash-empty--ok .icon { width: 16px; height: 16px; color: var(--dash-green); }
.page--home .dash-arrivals .day:not(.day--has) .day__count { color: var(--text-4); }
.page--home .dash-owners > .page-header__eyebrow { color: var(--dash-mut); font-size: 11px; font-weight: 700; letter-spacing: .07em; }
.page--home .owner-list__counts { text-align: end; }
@media (max-width: 1099.98px) {
  .page--home .dash-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .page--home .dash-service-chips { display: flex; flex-wrap: wrap; overflow-x: visible; }
  .page--home .dash-service-chips > * { flex: 1 1 calc(33.333% - 6px); }
  .page--home .pipeline { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); overflow: visible; padding-bottom: 0; }
  .page--home .pipeline > .stage, .page--home .pipeline > .stage.is-zero { flex: none; min-width: 0; }
}
@media (max-width: 600px) {
  .page--home .dash-service-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .page--home .dash-service-chips > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .page--home .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Back to stage: a plain list of earlier stages (v3.1). */
.stage-ctl__menu { display: flex; flex-direction: column; gap: 2px; padding: 6px; min-width: 220px; }
.stage-ctl__item { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 10px 12px; border-radius: 8px; color: #0F1830; font-size: 14px; cursor: pointer; white-space: nowrap; }
.stage-ctl__item:hover, .stage-ctl__item:focus-visible { background: #F1F4F9; }
.stage-ctl__item:disabled { color: #8A94A6; cursor: not-allowed; }

/* =====================================================================
   Completed orders row-cards — redesign (design
   completed-orders-redesign-2026-10-31, Sardar via CEO 31/10/2026).
   The orders list as one card per order (.archive-cards / .archive-card;
   Active orders has its own .order-card rules below); page--archive holds the
   Completed-orders differences (toolbar, pills, Completed / Cancelled edge).
   Display only: same orders, search, chips, pager, View / Edit.
   ===================================================================== */
.page--archive .oc-header { align-items: flex-end; }
.page--archive .oc-header__main { min-width: 0; }
.page--archive .oc-header .page-title { font-size: 28px; letter-spacing: -.3px; }
.page--archive .oc-header__count { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; background: #E6EBF5; color: var(--navy); font-size: 14px; font-weight: 700; letter-spacing: 0; }
.page--archive .oc-header__sub { margin: 0; max-width: none; color: var(--text-3); font-size: 13px; line-height: 1.55; text-align: end; }

/* Toolbar: one white card — search (44px, grows) + Search (navy) + the status chips (44px, count pill inside). */
.page--archive .oc-section { display: grid; gap: 12px; min-width: 0; }
.page--archive .oc-bar { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-1); }
.page--archive .oc-bar > .toolbar.oc-bar__search { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.page--archive .oc-bar__search > .input-icon { flex: 1 1 auto; min-width: 0; }
.page--archive .oc-bar__search input[type] { width: 100%; height: 44px; border: 1.5px solid #D5DCE7; border-radius: 10px; font-size: 14.5px; }
.page--archive .oc-bar__search .input-icon .icon { inset-inline-start: 14px; }
.page--archive .oc-bar__search .input-icon input[type] { padding-inline-start: 42px; }
.page--archive .oc-bar__search .btn.oc-bar__submit { flex: none; height: 44px; padding-inline: 18px; border-radius: 10px; font-size: 13.5px; }
.page--archive .oc-bar__chips.chips { display: flex; flex-wrap: nowrap; gap: 6px; flex: none; margin: 0; padding: 0; overflow: visible; }
.page--archive .oc-bar__chips .chip { height: 44px; min-height: 44px; padding: 0 14px; gap: 8px; border: 1.5px solid #D5DCE7; border-radius: 10px; background: var(--surface); color: var(--text-2); font-size: 13.5px; }
.page--archive .oc-bar__chips .chip:hover { border-color: var(--navy-200); background: var(--navy-50); color: var(--navy); }
.page--archive .oc-bar__chips .chip[aria-current="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.page--archive .oc-bar__chips .chip .chip__count { padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 700; }
.page--archive .oc-bar__chips .chip[aria-current="true"] .chip__count { background: rgba(255, 255, 255, .18); color: #fff; }
.page--archive .oc-bar__chips .chip .badge__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--oc-edge, var(--text-4)); color: inherit; }
.page--archive .oc-bar__chips .chip--completed { --oc-edge: #0E9F6E; }
.page--archive .oc-bar__chips .chip--cancelled { --oc-edge: #98A2B3; }

/* Pills row: Completed today (removable) + Clear filters; Showing x–y of N on the right. */
.page--archive .oc-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 28px; }
.page--archive .oc-pills .pill { min-height: 28px; padding: 0 8px 0 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12.5px; }
.page--archive .oc-pills .pill:hover { border-color: var(--navy-200); background: var(--navy-50); color: var(--navy); }
.page--archive .oc-pills .pill .icon { width: 18px; height: 18px; padding: 4px; border-radius: 50%; background: var(--surface-3); color: var(--text-3); }
.page--archive .oc-pills__clear { font-size: 12.5px; }
.page--archive .oc-pills .result-count { margin: 0 0 0 auto; color: var(--text-3); font-size: 12px; font-weight: 600; }

/* The cards. Grid as the design: ORDER · CUSTOMER·COMMODITY · STATUS·SERVICE · CARGO·DOCUMENT · ETA · OWNERS · View / Edit. */
.archive-cards__head, .archive-card { display: grid; grid-template-columns: 112px minmax(0, 1.7fr) minmax(0, 1.1fr) minmax(0, 1.1fr) 118px 150px 116px; gap: 18px; align-items: center; }
.archive-cards__head { padding: 2px 22px 0 24px; color: #6A7689; font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.archive-cards { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.archive-card { --oc-edge: var(--stage-1); position: relative; min-width: 0; margin: 0; padding: 16px 22px 16px 19px; background: var(--surface); border: 1px solid #E1E6EE; border-inline-start: 5px solid var(--oc-edge); border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.archive-card > * { min-width: 0; }
.archive-card--completed { --oc-edge: #0E9F6E; }
.archive-card--cancelled { --oc-edge: #98A2B3; background: #FAFBFC; }
.archive-card--cancelled .archive-card__customer > .cell-main { color: var(--text-2); }
/* The whole card opens the order (as the table row did); buttons, the providers toggle and the name stay on top. */
.archive-card a.ng-link::after { content: ""; position: absolute; inset: 0; border-radius: 13px; }
.archive-card a.ng-link:focus-visible { outline: none; }
.archive-card a.ng-link:focus-visible::after { outline: 2px solid var(--navy); outline-offset: -2px; }
.archive-card .archive-card__actions .btn, .archive-card .vendor-summary { position: relative; z-index: 1; }
/* Desktop with a pointer: the customer name takes the pointer (its full name in the tooltip), as on the table. */
@media (min-width: 1024px) and (hover: hover) {
  .archive-card .archive-card__customer > .cell-main[tabindex] { position: relative; z-index: 1; width: fit-content; }
}
.archive-card .ng-link { padding: 4px 8px; font-size: 13.5px; color: var(--navy); }
.archive-card__ng .cell-sub { display: block; margin-top: 6px; color: var(--text-3); font-size: 12px; }
.archive-card__customer > .cell-main { max-width: none; color: var(--text); font-size: 15px; font-weight: 700; line-height: 1.3; }
.archive-card__commodity { display: block; margin-top: 3px; color: var(--text-2); font-size: 13px; }
.archive-card__commodity .cell-main { display: block; max-width: none; color: inherit; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Status badge (dot + label, Completed green / Cancelled grey), Missing data under it, then the service. */
.archive-card__badges { display: flex; flex-wrap: wrap; align-items: flex-start; flex-direction: column; gap: 6px; }
.archive-card .badge { height: auto; min-height: 0; gap: 7px; padding: 5px 11px 5px 8px; border: 0; border-radius: 999px; font-size: 12.5px; font-weight: 700; text-decoration: none; white-space: nowrap; background: var(--oc-badge-bg, #F2F4F7); color: var(--oc-badge-text, #475467); }
.archive-card .badge .badge__step { display: none; }
.archive-card .badge:not(.badge--missing)::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--oc-edge); }
.archive-card .badge .badge__dot { display: none; }
.archive-card--completed .badge { --oc-badge-bg: #E8F7F0; --oc-badge-text: #05603A; }
.archive-card--cancelled .badge { --oc-badge-bg: #F2F4F7; --oc-badge-text: #475467; }
.archive-card .badge.badge--missing { padding: 2px 7px; border: 1px solid #F9C98A; border-radius: 6px; background: var(--orange-50); color: var(--orange-text); font-size: 11px; font-weight: 700; }
.archive-card__service { display: block; margin-top: 6px; color: var(--text-2); font-size: 12.5px; line-height: 1.4; }
/* Cargo + BL / CMR / AWB + providers. */
.archive-card__cargo .transport { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; font-weight: 600; }
.archive-card__cargo .transport__equip { display: inline-flex; align-items: center; gap: 6px; }
.archive-card__cargo .equip { padding: 1px 6px; border: 1px solid #CCD4E1; border-radius: 5px; background: #F7F9FC; font-family: var(--mono); font-size: 11.5px; font-weight: 700; }
.archive-card__cargo .transport__bl { flex-basis: 100%; color: var(--text-3); font-family: var(--mono); font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.archive-card__cargo .transport__bl .k { font-weight: 600; }
.archive-card__cargo .vendor-summary, .archive-card__cargo > .vendors { display: block; margin-top: 3px; color: var(--navy); font-size: 12px; font-weight: 600; }
.archive-card .vendor-summary > summary { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none; color: var(--navy); font-size: 12px; font-weight: 600; white-space: nowrap; }
.archive-card .vendor-summary > summary::-webkit-details-marker { display: none; }
.archive-card .vendor-summary > summary::after { content: ""; width: 6px; height: 6px; margin-inline-start: 2px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.archive-card .vendor-summary[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.archive-card .vendor-summary > .vendors { display: grid; gap: 2px; margin-top: 6px; color: var(--text-2); font-weight: 500; }
.archive-card .vendors .k { color: var(--text-4); font-size: 11px; font-weight: 600; }
.archive-card__eta .eta__date { font-size: 15px; font-weight: 700; color: var(--text); }
/* Owners: initials circle + tiny label + name (Job owner, Operations 1). */
.archive-card__owners { display: grid; gap: 4px; }
.archive-card__owner { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 8px; }
.archive-card__ini.avatar { width: 22px; height: 22px; box-shadow: none; background: #E6EBF5; color: var(--navy); font-size: 9.5px; letter-spacing: 0; }
.archive-card__ini--2.avatar { background: #E3F4EC; color: var(--success); }
/* Open items 16/11/2026 item 23: Operations 2 gets its own wash (a soft wash of brand orange #F47B20, the warning
   text colour), not Job owner's navy nor Operations 1's green. */
.archive-card__ini--3.avatar { background: #FDEBDC; color: var(--warning); }
.archive-card__who { display: block; min-width: 0; line-height: 1.25; }
.archive-card__who .k { display: block; color: var(--text-4); font-size: 9px; font-weight: 700; letter-spacing: .6px; line-height: 1.1; text-transform: uppercase; }
.archive-card__who .v { display: block; color: var(--text-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* View (navy) / Edit (outline). */
.archive-card__actions.row-actions { display: flex; flex-wrap: nowrap; gap: 6px; justify-content: flex-end; }
.archive-card__actions .btn { height: 36px; padding: 0 11px; border-radius: 9px; font-size: 13px; }
.archive-card__actions .btn--secondary { border: 1.5px solid #D5DCE7; }
.page--archive .pager { margin-top: 6px; }

/* Below 1024px: the compact two-column card (no header row). */
@media (max-width: 1023.98px) {
  .page--archive .oc-bar { flex-wrap: wrap; }
  .page--archive .oc-bar > .toolbar.oc-bar__search { flex: 1 1 100%; }
  .archive-cards__head { display: none; }
  .archive-card { grid-template-columns: minmax(0, 1fr) auto; column-gap: 0; row-gap: 0; padding: 14px 14px 12px 13px; border-radius: 12px; }
  /* No column gap, so the divider above cargo | ETA is one line; the right column keeps its space with padding. */
  .archive-card__badges, .archive-card__eta, .archive-card__actions.row-actions { padding-inline-start: 12px; }
  .archive-card a.ng-link::after { border-radius: 11px; }
  .archive-card__ng { grid-column: 1; grid-row: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .archive-card__ng .cell-sub { margin: 0; }
  .archive-card__status { display: contents; }
  .archive-card__badges { grid-column: 2; grid-row: 1; flex-direction: row; justify-content: flex-end; }
  .archive-card__customer { grid-column: 1 / -1; grid-row: 2; margin-top: 10px; }
  .archive-card__customer > .cell-main { display: block; -webkit-line-clamp: unset; overflow: visible; font-size: 16px; }  /* the name in full */
  .archive-card__service { grid-column: 1 / -1; grid-row: 3; margin-top: 4px; }
  .archive-card__cargo, .archive-card__eta { grid-row: 4; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
  .archive-card__cargo { grid-column: 1; }
  .archive-card__cargo, .archive-card__eta { align-self: stretch; }  /* both from the same divider line */
  .archive-card__eta { grid-column: 2; display: flex; align-items: center; justify-content: flex-end; text-align: end; }
  .archive-card__owners { grid-column: 1; grid-row: 5; margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
  .archive-card__actions.row-actions { grid-column: 2; grid-row: 5; margin-top: 12px; align-self: center; }
}

/* Phones (< 600px): status chips equal width (40px: the design's 38px is off the 32 / 40 / 44 height scale), Search button hidden (Enter searches),
   owners as initials only (names kept for screen readers and in the tooltip), no sideways scroll. */
@media (max-width: 599.98px) {
  .page--archive .oc-header { display: block; }
  .page--archive .oc-header .page-title { font-size: 24px; }
  .page--archive .oc-header__sub { display: none; }
  .page--archive .oc-bar { padding: 8px; gap: 8px; border-radius: 12px; }
  .page--archive .oc-bar__search input[type] { height: 46px; }
  .page--archive .oc-bar__search .btn.oc-bar__submit { display: none; }
  .page--archive .oc-bar__chips.chips { flex: 1 1 100%; width: 100%; margin: 0; padding: 0; overflow: visible; }
  .page--archive .oc-bar__chips .chip { flex: 1 1 0; min-width: 0; justify-content: center; height: var(--ctl-md); min-height: var(--ctl-md); padding: 0 8px; gap: 6px; font-size: 12.5px; }
  .page--archive .oc-pills .result-count { margin-inline-start: 0; flex-basis: 100%; }
  .page--archive .oc-pills .pill { min-height: 32px; }
  .archive-card__cargo .vendor-summary, .archive-card__cargo > .vendors { display: none; }
  .archive-card__owners { display: flex; flex-wrap: nowrap; gap: 0; }
  .archive-card__owner { display: block; }
  .archive-card__owner + .archive-card__owner { margin-inline-start: -4px; }
  .archive-card__ini.avatar { width: 28px; height: 28px; border: 2px solid var(--surface); font-size: 10px; }
  .archive-card__who { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .archive-card__actions .btn { padding: 0 16px; }
}

/* Active orders redesign (design active-orders-redesign-2026-10-31, Sardar via CEO 31/10 ~19:17):
   row-cards with the stage colour on the left edge, one toolbar card, filter pills + legend, and no page
   bar (every active order on one page). Scoped to .orders-list / .orders-head: Completed orders keep their table. */
.orders-list {
  --oc-sea: #0E9F6E; --oc-sea-bg: #E8F7F0; --oc-sea-text: #05603A;
  --oc-arrived: #7A5AF8; --oc-arrived-bg: #F1EEFE; --oc-arrived-text: #4A2FB8;
  --oc-land: #DC6803; --oc-land-bg: #FEF2E4; --oc-land-text: #93370D;
  --oc-clearance: #14327A; --oc-clearance-bg: #E6EBF5; --oc-clearance-text: #14327A;
  --oc-confirmed: #667085; --oc-confirmed-bg: #F2F4F7; --oc-confirmed-text: #344054;
  --oc-air: #0BA5EC; --oc-air-bg: #E7F6FD; --oc-air-text: #065986;
  --oc-grey: #98A2B3; --oc-grey-bg: #F2F4F7; --oc-grey-text: #344054;
  --oc-act: 116px;
  --oc-cols: 112px minmax(0, 1.7fr) minmax(0, 1.25fr) minmax(0, 1.05fr) 118px 150px var(--oc-act);
  --oc-ctl: #D5DCE7;
  display: grid; gap: 10px; min-width: 0;
}
.page--orders .orders-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.orders-head__title { display: flex; align-items: center; gap: 10px; }
.orders-head__count { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 11px; border-radius: 999px; background: #E6EBF5; color: var(--navy); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.orders-head__aside { display: grid; justify-items: end; gap: 2px; text-align: end; }
.orders-head__note { margin: 0; max-width: 260px; color: var(--text-4); font-size: 13px; line-height: 1.5; }
.orders-head__aside .result-count { font-size: 12.5px; }
/* One toolbar: a white card with the 44px search and the My orders toggle on one line. */
.page--orders .orders-list .orders-bar { display: grid; gap: 10px; padding: 0; border: 0; background: transparent; }
.orders-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.page--orders .orders-toolbar > .toolbar { display: block; flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; border: 0; background: transparent; }
.page--orders .orders-toolbar .toolbar__search { width: 100%; max-width: none; margin: 0; }
.orders-toolbar .toolbar__search .input-icon, .orders-toolbar .toolbar__search input { width: 100%; }
.orders-toolbar .toolbar__search input { height: var(--ctl-touch); border: 1.5px solid var(--oc-ctl); border-radius: 10px; font-size: 14.5px; }
.page--orders .orders-toolbar .chip--toggle { flex: none; min-height: var(--ctl-touch); padding-inline: 16px; border: 1.5px solid var(--oc-ctl); border-radius: 10px; background: #fff; color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.page--orders .orders-toolbar .chip--toggle[aria-current="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.page--orders .orders-list .orders-bar > .orders-bar__chips { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 0; border: 0; background: transparent; }
.page--orders .orders-list .orders-bar .pills { flex: 1 1 auto; }
.page--orders .orders-list .orders-bar .pill { border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text); }
/* White pill (Design P1, 31/10): its own dark text, not the navy pill's white; the label without the fade (AA). */
.page--orders .orders-list .orders-bar .pill .pill__k { color: var(--text-3); opacity: 1; }
.page--orders .orders-list .orders-bar .pill:hover { background: #F1F4F9; color: var(--text); }
.orders-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 0 auto; padding: 0; list-style: none; color: var(--text-4); font-size: 12px; }
.orders-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.orders-legend__item::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--hue); }
.orders-legend__item--sea { --hue: var(--oc-sea); }
.orders-legend__item--arrived { --hue: var(--oc-arrived); }
.orders-legend__item--clearance { --hue: var(--oc-clearance); }
.orders-legend__item--land { --hue: var(--oc-land); }
/* The cards. Each card's stage colour: --hue (edge, badge dot, progress), --hue-bg / --hue-text (badge, AA). */
.order-cards__head { display: none; }
.order-cards { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.order-card { --hue: var(--oc-grey); --hue-bg: var(--oc-grey-bg); --hue-text: var(--oc-grey-text);
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; align-items: start;
  padding: 14px 14px 12px 13px; border: 1px solid var(--border); border-inline-start: 5px solid var(--hue); border-radius: 12px;
  background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); color: var(--text); }
.order-card--sea { --hue: var(--oc-sea); --hue-bg: var(--oc-sea-bg); --hue-text: var(--oc-sea-text); }
.order-card--arrived { --hue: var(--oc-arrived); --hue-bg: var(--oc-arrived-bg); --hue-text: var(--oc-arrived-text); }
.order-card--land { --hue: var(--oc-land); --hue-bg: var(--oc-land-bg); --hue-text: var(--oc-land-text); }
.order-card--clearance { --hue: var(--oc-clearance); --hue-bg: var(--oc-clearance-bg); --hue-text: var(--oc-clearance-text); }
.order-card--confirmed { --hue: var(--oc-confirmed); --hue-bg: var(--oc-confirmed-bg); --hue-text: var(--oc-confirmed-text); }
.order-card--air { --hue: var(--oc-air); --hue-bg: var(--oc-air-bg); --hue-text: var(--oc-air-text); }
/* A8: no Late tag; a passed ETA keeps a soft red tint, an order long in its stage a soft orange one. */
.order-card.row--overdue { background: linear-gradient(90deg, #FFF6F5, #fff 40%); }
.order-card.row--warn { background: linear-gradient(90deg, #FFF8EE, #fff 40%); }
/* The whole card opens the order (the NG link stretched over it); the provider toggle and the buttons sit above it. */
.order-card a.ng-link { position: static; display: inline-block; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--border-soft); color: var(--navy); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; font-weight: 700; line-height: 1.2; text-decoration: none; }
.order-card a.ng-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.order-card .vendor-summary, .order-card__actions .btn { position: relative; z-index: 1; }
.order-card__ng { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.order-card__ng .cell-sub { margin: 0; color: var(--text-4); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.order-card__customer { grid-column: 1 / -1; min-width: 0; margin-top: 10px; }
.order-card__customer .cell-main { display: block; overflow: visible; font-size: 16px; font-weight: 700; line-height: 1.3; text-transform: none; white-space: normal; overflow-wrap: anywhere; -webkit-line-clamp: unset; }
.order-card__commodity { display: block; margin-top: 3px; min-width: 0; }
.order-card__commodity .cell-main { display: block; overflow: hidden; color: var(--text-2); font-size: 13px; font-weight: 400; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; }
.order-card__stage { display: contents; }
.order-card__badge { grid-column: 2; grid-row: 1; justify-self: end; }
.order-card .badge { --tone: var(--hue); display: inline-flex; align-items: center; gap: 7px; min-height: 26px; padding: 4px 11px 4px 8px; border: 0; border-radius: 999px; background: var(--hue-bg); color: var(--hue-text); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.order-card .badge::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--hue); }
.order-card .badge .badge__step, .order-card .badge .badge__dot { display: none; }
.order-card .badge .ar { color: inherit; }
.order-card__service { grid-column: 1 / -1; margin-top: 4px; color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.order-card__progress { display: none; gap: 3px; margin-top: 8px; }
.order-card__progress i { flex: 1 1 0; max-width: 22px; height: 4px; border-radius: 3px; background: #E6EAF1; }
.order-card__progress i.is-done { background: var(--hue); }
.order-card__cargo { grid-column: 1; min-width: 0; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); font-size: 13.5px; }
.order-card__cargo .transport { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.order-card__cargo .transport__qty { font-weight: 600; }
.order-card__cargo .equip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; font-weight: 700; }
.order-card__cargo .transport__bl { color: var(--text-4); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.order-card__cargo .transport__bl .k { font-weight: 500; }
.order-card__vendors { display: none; margin-top: 4px; font-size: 12px; }
.order-card__vendors .vendor-summary > summary { color: var(--navy); font-weight: 600; }
.order-card__eta { grid-column: 2; min-width: 0; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); text-align: end; }
.order-card__eta .eta { display: grid; justify-items: end; gap: 4px; }
.order-card__eta .eta__date { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-card__eta .eta__rel { display: inline-block; padding: 2px 7px; border-radius: 6px; background: var(--border-soft); color: var(--text-2); font-size: 11.5px; font-weight: 600; }
.order-card__eta .eta__rel.is-soon { background: var(--orange-50); color: var(--orange-text); }
.order-card__owners { grid-column: 1; align-self: center; min-width: 0; margin-top: 12px; }
.order-card .owners { display: flex; flex-wrap: wrap; gap: 4px 14px; min-width: 0; max-width: none; white-space: normal; }
.order-card .owner { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.order-card .owner__ini { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #E6EBF5; color: var(--navy); font-size: 9.5px; font-weight: 700; line-height: 22px; text-align: center; }
.order-card .owner--o1 .owner__ini { background: #E3F4EC; color: var(--success, #067647); }
.order-card .owner--o2 .owner__ini { background: #FDEBD3; color: var(--orange-text); }
.order-card .owner--none .owner__ini { background: var(--border-soft); color: var(--text-4); }
.order-card .owner > span[title] { min-width: 0; color: var(--text-2); font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.order-card .owner .k { display: inline; min-width: 0; margin-inline-end: 4px; color: var(--text-4); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.order-card .owner--none .v { color: var(--text-4); font-weight: 500; }
.order-card__actions { grid-column: 2; align-self: center; margin-top: 12px; }
.order-card .row-actions--order { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 6px; justify-content: flex-end; }
.order-card .row-actions--order .btn--sm { min-width: 0; min-height: 36px; padding-inline: 12px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.order-card .row-actions--order .btn--secondary { border: 1.5px solid var(--oc-ctl); background: #fff; color: var(--text); }
@media (min-width: 1024px) {
  /* Same content box as a card (5px stage edge + 22px, 22px + 1px border), so the heads sit over their zones. */
  .order-cards__head { display: grid; grid-template-columns: var(--oc-cols); gap: 18px; padding: 4px 23px 0 27px; color: var(--text-4); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .order-card { grid-template-columns: var(--oc-cols); gap: 18px; align-items: center; padding: 16px 22px 16px 22px; border-radius: 14px; }
  .order-card__ng { flex-direction: column; align-items: flex-start; gap: 6px; }
  .order-card__customer { grid-column: auto; margin-top: 0; }
  .order-card__customer .cell-main { font-size: 15px; }
  .order-card__stage { display: block; min-width: 0; text-align: start; }
  .order-card__badge { display: block; justify-self: auto; text-align: start; }
  .order-card__service { display: block; margin-top: 6px; }
  .order-card__progress { display: flex; }
  .order-card__cargo, .order-card__eta, .order-card__owners, .order-card__actions { grid-column: auto; margin-top: 0; padding-top: 0; border-top: 0; }
  .order-card__vendors { display: block; }
  .order-card__eta { text-align: start; }
  .order-card__eta .eta { justify-items: start; }
  .order-card .owners { display: grid; gap: 4px; }
  .order-card .owner { align-items: center; gap: 8px; }
  .order-card .owner > span[title] { display: grid; overflow: hidden; }
  .order-card .owner .k { display: block; margin: 0; font-size: 9px; letter-spacing: .06em; line-height: 1.1; }
  .order-card .owner .v { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  /* Turkish "Görüntüle" / "Düzenle" do not fit side by side: one under the other, the column as narrow. */
  html[lang="tr"] .orders-list { --oc-act: 104px; }
  html[lang="tr"] .order-card .row-actions--order { flex-direction: column; align-items: stretch; }
}
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .orders-list { --oc-cols: 96px minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, 1fr) 104px 132px var(--oc-act); }
  .order-cards__head, .order-card { column-gap: 12px; }
  .order-card { padding-inline-end: 14px; }
  .order-cards__head { padding-inline-end: 15px; }
}
/* Phones: a compact card (NG + date | stage, customer, commodity, service, cargo | ETA, owner initials | View / Edit), no sideways scroll. */
@media (max-width: 600px) {
  .page--orders .orders-head__note, .orders-legend { display: none; }
  .page--orders .orders-list .orders-bar > .orders-bar__chips:not(:has(.pill)) { display: none; }
  .orders-head__aside { justify-items: start; text-align: start; }
  .orders-toolbar { flex-wrap: wrap; padding: 8px; border-radius: 12px; }
  .page--orders .orders-toolbar > .toolbar { flex-basis: 100%; }
  .page--orders .orders-toolbar .chip--toggle { min-height: var(--ctl-md); padding-inline: 12px; font-size: 13px; }
  .order-card .owners { flex-wrap: nowrap; gap: 0; }
  .order-card .owner { gap: 0; margin-inline-end: -4px; }
  .order-card .owner__ini { width: 28px; height: 28px; border: 2px solid #fff; line-height: 24px; }
  .order-card .owner > span[title] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* =====================================================================
   Sidebar open / close (Sardar via CEO 31/10/2026; design sidebar-collapse-redesign-2026-10-31, HANDOFF-tech).
   From 1280px: a 240px navy sidebar that owns the brand, with a round ‹ / › toggle by the logo and a dashed
   "Collapse sidebar" button under the user card; closed it is a 76px icon rail (name tooltip on hover / focus,
   Accounting as a flyout, the pending count as a corner badge) and the page moves left. The top bar is white
   (breadcrumb, New order, EN | TR, bell). Below 1280px (the live breakpoint): a navy 56px top bar with a 2px orange
   line and the same sidebar as a 300px drawer from the left over a dimmed backdrop. From 1600px an open sidebar
   offers no toggle (Sardar 21/10, kept); a closed rail keeps both. Same items, permissions, aria-current and "maras-sidebar" state.
   Rules keyed on #app-sidebar / #main-nav win over the earlier sidebar layers (5b #20, Q4, C2, the 20/10 polish,
   the 1101–1279px top-bar nav) without editing them.
   Heights follow the control scale (items 40px, 44px in the drawer; the design's 42 / 38px are not on it). The open
   width stays 240px (design 248) and the top bar keeps the header height (61px, design 64): every page layout
   is fitted to both. The section sits above the 24/10 phone cleanup (only phone rules may follow it).
   ===================================================================== */
:root {
  --sb-bg: #141E3C; --sb-line: #22305A; --sb-line-2: #33437A; --sb-hover: #1E2B52; --sb-guide: #2A3760;
  --sb-text: #C9D2DF; --sb-icon: #8D9BBA; --sb-sub: #AEB9D0; --sb-tip: #0E1629;
}
.sidebar__mark, .sidebar__close, .sidebar-collapse, .nav-sub__head, .topbar-crumb { display: none; }
#app-sidebar { display: flex; flex-direction: column; background: var(--sb-bg); color: var(--sb-text); }
#app-sidebar :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#app-sidebar .menu__panel :focus-visible { outline-color: var(--navy); }
#app-sidebar .sidebar__head {
  display: flex; flex: none; align-items: center; gap: 10px; height: calc(var(--header-h) + 3px); padding: 0 12px 0 18px;
  border-bottom: 1px solid var(--sb-line);
}
#app-sidebar .brand {
  position: static; display: inline-flex; flex-direction: row; align-items: center; gap: 8px; width: auto; height: auto;
  min-width: 0; min-height: 44px; padding: 0; border: 0; color: #fff;
}
#app-sidebar .brand img { width: 100px; height: auto; }
#app-sidebar .brand__product {
  display: inline-block; padding: 1px 6px; border: 1px solid rgba(255, 255, 255, 0.34); border-radius: 4px;
  color: rgba(255, 255, 255, 0.9); font-size: 11px; font-weight: 700; line-height: 16px; letter-spacing: .08em; text-transform: uppercase;
}
.sidebar__mark { color: #fff; font-size: 20px; font-weight: 800; line-height: 1; }
.sidebar__mark b { color: var(--orange); }
#main-nav {
  position: static; inset: auto; display: flex; flex: 1 1 auto; flex-direction: column; align-items: stretch; gap: 3px;
  width: auto; height: auto; min-height: 0; max-height: none; padding: 14px 12px; overflow-x: hidden; overflow-y: auto;
  background: none; border: 0; border-radius: 0; box-shadow: none; animation: none; scrollbar-width: thin;
}
#main-nav .nav-link {
  position: relative; display: flex; flex-direction: row; flex-shrink: 0; align-items: center; justify-content: flex-start; gap: 12px;
  width: auto; height: var(--ctl-md); min-height: var(--ctl-md); margin: 0; padding: 0 12px; border-radius: 10px; background: none; box-shadow: none;
  color: var(--sb-text); font-size: 14px; font-weight: 500; line-height: 1.25; text-align: start; white-space: nowrap; text-decoration: none;
}
#main-nav .nav-link .en {
  min-width: 0; margin: 0; overflow: hidden; color: inherit; font-size: 14px; font-weight: inherit; line-height: 1.25;
  text-overflow: ellipsis; white-space: nowrap;
}
#main-nav .nav-link::before { position: static; width: 18px; height: 18px; margin: 0; opacity: 1; background: var(--sb-icon); }
#main-nav .nav-link:hover { background: var(--sb-hover); color: #fff; }
#main-nav .nav-link:is([aria-current="page"], [aria-current="true"]) {
  background: linear-gradient(90deg, rgba(244, 123, 32, 0.16), rgba(244, 123, 32, 0.04)); box-shadow: none; color: #fff; font-weight: 600;
}
#main-nav .nav-link:is([aria-current="page"], [aria-current="true"])::before { background: var(--orange); }
#main-nav .nav-link:is([aria-current="page"], [aria-current="true"])::after {
  content: ""; display: block; position: absolute; inset-inline: -12px auto; top: 8px; bottom: 8px; width: 4px; height: auto;
  border-radius: 0 4px 4px 0; background: var(--orange);
}
#main-nav .nav-link .count {
  position: static; min-width: 20px; height: 18px; margin: 0 0 0 auto; padding: 0 6px; border-radius: 999px;
  background: var(--orange); color: #1B1B1B; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
#main-nav > .nav-divider { display: block; flex: none; width: auto; height: 1px; margin: 10px 4px; background: var(--sb-line); }
#main-nav .nav-group { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 0; }
#main-nav .nav-group > .nav-link { padding-inline-end: 34px; }
#main-nav .nav-group__chev {
  position: absolute; top: 0; inset-inline-end: 12px; display: flex; align-items: center; height: var(--ctl-md); color: var(--sb-icon); pointer-events: none;
}
#main-nav .nav-sub {
  position: static; display: flex; flex-direction: column; gap: 0; min-width: 0; margin: 2px 0 6px 21px; padding: 0 0 0 12px;
  border-inline-start: 1px solid var(--sb-guide); border-radius: 0; background: none; box-shadow: none;
}
#main-nav .nav-sub__link {
  min-height: var(--ctl-sm); padding: 6px 10px; border-radius: 8px; background: none; box-shadow: none;
  color: var(--sb-sub); font-size: 13px; font-weight: 500; white-space: nowrap;
}
#main-nav .nav-sub__link:hover { background: var(--sb-hover); color: #fff; }
#main-nav .nav-sub__link[aria-current="page"] { background: var(--sb-hover); box-shadow: inset 2px 0 0 var(--orange); color: #fff; font-weight: 600; }
#app-sidebar .sidebar__foot { flex: none; padding: 12px; border-top: 1px solid var(--sb-line); }
#app-sidebar .sidebar__foot > .menu { position: relative; width: auto; padding: 0; border: 0; background: none; }
#app-sidebar .user-btn {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; height: auto; min-height: 48px;
  padding: 8px; border: 0; border-radius: 10px; color: #fff; text-align: start;
}
#app-sidebar .user-btn:hover, #app-sidebar .menu[open] > .user-btn { background: var(--sb-hover); }
#app-sidebar .avatar { flex: none; width: 32px; height: 32px; background: #fff; box-shadow: none; color: var(--sb-bg); font-size: 13px; }
#app-sidebar .user-btn__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
#app-sidebar .user-btn__name {
  position: static; display: block; width: auto; height: auto; max-width: none; margin: 0; overflow: hidden; clip: auto;
  font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap;
}
#app-sidebar .user-btn__role { color: var(--sb-icon); font-size: 12px; font-weight: 500; }
#app-sidebar .user-btn > .icon { display: block; flex: none; margin-inline-start: auto; transform: rotate(180deg); color: var(--sb-icon); }
#app-sidebar .sidebar__foot .menu__panel {
  top: auto; bottom: calc(100% + 4px); inset-inline: 0; width: auto; max-height: calc(100vh - 140px); overflow-y: auto;
}

/* ---------- From 1280px: sidebar (open 240px / closed 76px rail) and the white top bar ---------- */
@media (min-width: 1280px) {
  body:has(> .app-header) { --sidebar-width: 240px; padding-inline-start: var(--sidebar-width); background: var(--bg); }
  body.sidebar-compact:has(> .app-header) { --sidebar-width: 76px; }
  body.sidebar-ready:has(> .app-header) { transition: padding-inline-start .2s ease; }
  .app-header { background: #fff; color: var(--text); border-bottom: 1px solid var(--border); box-shadow: none; }
  .app-header__inner { max-width: none; height: calc(var(--header-h) + 2px); padding: 0 28px; gap: 14px; }
  .app-header__inner::before { content: none; }
  .app-header .brand--bar { display: none; }
  .app-header :focus-visible { outline-color: var(--navy); }
  .topbar-crumb {
    display: block; min-width: 0; margin: 0; overflow: hidden; color: var(--text-3); font-size: 13px; font-weight: 600;
    text-overflow: ellipsis; white-space: nowrap;
  }
  .topbar-crumb[hidden] { display: none; }
  .topbar-crumb b { color: var(--text); font-weight: 600; }
  .app-header .header-actions { gap: 14px; }
  .app-header .lang-switch__btn { color: var(--text-3); }
  .app-header .lang-switch__btn:hover { background: var(--navy-50); color: var(--text); }
  .app-header .lang-switch__btn[aria-current="true"] { color: var(--text); }
  .app-header .lang-switch__sep { color: var(--border-strong); }
  .app-header .header-actions .icon-btn { color: var(--text-2); }
  .app-header .header-actions .icon-btn:hover, .app-header .header-actions .menu[open] > .icon-btn { background: var(--navy-50); color: var(--text); }
  .app-header .icon-btn__badge { background: var(--danger); border-color: #fff; color: #fff; }

  #app-sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 45; width: var(--sidebar-width);
    border-inline-end: 1px solid var(--sb-line);
  }
  body.sidebar-ready #app-sidebar { transition: width .2s ease; }
  #app-sidebar .sidebar-toggle {
    position: static; display: inline-flex; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px;
    margin-inline-start: auto; padding: 0; border: 1px solid var(--sb-line-2); border-radius: 9px; background: var(--sb-line);
    color: #fff; cursor: pointer;
  }
  #app-sidebar .sidebar-toggle:hover { background: var(--sb-hover); }
  #app-sidebar .sidebar-toggle .icon { width: 18px; height: 18px; }
  #main-nav > a.nav-mobile-only, #main-nav > .nav-divider:has(+ a.nav-mobile-only) { display: none; }
  #app-sidebar .sidebar-collapse {
    display: flex; align-items: center; gap: 10px; width: 100%; height: var(--ctl-md); margin-top: 6px; padding: 0 12px;
    border: 1px dashed var(--sb-line-2); border-radius: 9px; background: none; color: var(--sb-sub);
    font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
  }
  #app-sidebar .sidebar-collapse:hover { background: var(--sb-hover); color: #fff; }
  #app-sidebar .sidebar-collapse .icon { flex: none; width: 18px; height: 18px; }

  /* Closed: the 76px rail. */
  body.sidebar-compact #app-sidebar .sidebar__head { flex-direction: column; justify-content: center; gap: 10px; height: auto; padding: 14px 0 10px; }
  body.sidebar-compact #app-sidebar .brand { justify-content: center; min-height: 0; }
  body.sidebar-compact #app-sidebar .brand img, body.sidebar-compact #app-sidebar .brand__product { display: none; }
  body.sidebar-compact #app-sidebar .sidebar__mark { display: block; }
  body.sidebar-compact #app-sidebar .sidebar-toggle { margin: 0; }
  body.sidebar-compact #app-sidebar .sidebar-toggle .icon { transform: rotate(180deg); }
  body.sidebar-compact #main-nav { align-items: center; overflow: visible; }
  body.sidebar-compact #main-nav .nav-link { justify-content: center; width: 52px; padding: 0; }
  body.sidebar-compact #main-nav .nav-group { align-self: stretch; align-items: center; }
  body.sidebar-compact #main-nav .nav-link .en, body.sidebar-compact #app-sidebar .user-btn__text,
  body.sidebar-compact #app-sidebar .sidebar-collapse__label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  /* Tooltip: the item's own label, shown beside the rail on hover or keyboard focus. */
  body.sidebar-compact #main-nav > a.nav-link:is(:hover, :focus-visible) .en {
    inset-inline-start: 66px; top: 50%; z-index: 70; width: auto; height: auto; margin: 0; padding: 6px 10px; overflow: visible; clip: auto;
    border-radius: 7px; background: var(--sb-tip); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25); color: #fff;
    font-size: 12.5px; font-weight: 600; line-height: 1.2; transform: translateY(-50%); pointer-events: none;
  }
  body.sidebar-compact #main-nav .nav-link .count {
    position: absolute; top: 3px; inset-inline-end: 2px; min-width: 16px; height: 16px; padding: 0 4px; line-height: 16px;
  }
  body.sidebar-compact #main-nav .nav-group__chev { display: none; }
  body.sidebar-compact #main-nav .nav-group > .nav-link { padding: 0; }
  /* Accounting: a flyout with its pages and count, on hover and while the keyboard focus is inside the group. */
  body.sidebar-compact #main-nav .nav-sub {
    display: none; position: absolute; top: 0; inset-inline-start: 64px; z-index: 70; width: 220px; margin: 0; padding: 8px;
    border: 1px solid var(--sb-line-2); border-radius: 12px; background: var(--sb-hover); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  }
  body.sidebar-compact #main-nav .nav-sub::before { content: ""; position: absolute; inset-block: 0; inset-inline-end: 100%; width: 14px; }
  body.sidebar-compact #main-nav .nav-group:is(:hover, :focus-within) > .nav-sub { display: flex; }
  body.sidebar-compact #main-nav .nav-sub__head {
    display: flex; align-items: center; gap: 8px; margin-bottom: 4px; padding: 6px 10px 8px; border-bottom: 1px solid var(--sb-line-2);
    color: #fff; font-size: 12px; font-weight: 700;
  }
  body.sidebar-compact #main-nav .nav-sub__head .count {
    min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: #1B1B1B;
    font-size: 11px; line-height: 18px; text-align: center;
  }
  body.sidebar-compact #main-nav .nav-sub__link { color: #DCE3EF; }
  body.sidebar-compact #main-nav .nav-sub__link:hover { background: rgba(255, 255, 255, 0.07); }
  body.sidebar-compact #main-nav .nav-sub__link[aria-current="page"] { background: rgba(255, 255, 255, 0.1); }
  body.sidebar-compact #app-sidebar .sidebar__foot { padding: 12px 8px; }
  body.sidebar-compact #app-sidebar .user-btn { justify-content: center; padding: 4px; }
  body.sidebar-compact #app-sidebar .user-btn > .icon { display: none; }
  body.sidebar-compact #app-sidebar .sidebar__foot .menu__panel { top: auto; bottom: 0; inset-inline: calc(100% + 16px) auto; width: 260px; }
  body.sidebar-compact #app-sidebar .sidebar-collapse { justify-content: center; padding: 0; }
}
/* Sardar 21/10 (kept): an open sidebar offers neither toggle from 1600px. A closed rail keeps both on every width, or nothing reopens it (03/11/2026). */
@media (min-width: 1600px) {
  body:not(.sidebar-compact) #app-sidebar .sidebar-collapse { display: none; }
}

/* ---------- Below 1280px: navy top bar and the sidebar as a drawer from the left ---------- */
@media (max-width: 1279.98px) {
  .app-header { background: var(--sb-bg); border-bottom: 2px solid var(--orange); }
  .app-header__inner { height: calc(var(--header-h) + 1px); padding-inline: 12px; gap: 10px; }
  .app-header .nav-toggle-btn {
    display: inline-flex; align-items: center; justify-content: center; flex: none; order: 0; width: 40px; height: 40px;
    margin: 0; border-radius: 10px; background: var(--sb-line); color: #fff; cursor: pointer;
  }
  .app-header .header-actions { margin-inline-start: auto; }
  #app-sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 60; width: min(300px, calc(100vw - 40px));
    overflow-y: auto; overscroll-behavior: contain; box-shadow: 12px 0 40px rgba(0, 0, 0, 0.35);
    transform: translateX(-102%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s;
  }
  .nav-toggle:checked ~ #app-sidebar { transform: none; visibility: visible; transition: transform .22s ease, visibility 0s; }
  #app-sidebar .sidebar__close {
    display: inline-flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0 -4px 0 auto;
    padding: 0; border: 0; border-radius: 10px; background: var(--sb-line); color: #fff; cursor: pointer;
  }
  #app-sidebar .sidebar__close .icon { width: 18px; height: 18px; }
  #main-nav { flex: none; overflow: visible; }
  #main-nav .nav-link, #main-nav .nav-sub__link { min-height: var(--ctl-touch); }
  #main-nav .nav-link { height: var(--ctl-touch); }
  #main-nav .nav-group__chev { height: var(--ctl-touch); }
  #main-nav > a.nav-mobile-only { display: flex; }
  #app-sidebar .sidebar__foot { margin-top: auto; }
  .nav-toggle:checked ~ .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 55; background: rgba(14, 22, 41, 0.55); cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  /* The page behind the open drawer does not scroll (the drawer itself still does). */
  html:has(.nav-toggle:checked) { overflow: hidden; }
}

/* Land and Sea Freight to the door: the optional Trucks and carriers rows (Sardar 02/11/2026, migration 0071; Sea: owner
   03/11/2026) and a cost line's truck. A Sea order's rows follow its Delivery carrier, whose label has order 1 on a phone. */
.truck-rows { margin-top: 4px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.leg-rows ~ .truck-rows { order: 2; }
.truck-rows__head { cursor: pointer; padding: 12px 14px; font-weight: 600; color: var(--text); }
.truck-rows__opt { margin-inline-start: 6px; font-weight: 400; font-size: 13px; color: var(--text-3); }
.truck-rows__table { padding: 0 14px 14px; }
.truck-rows__row { display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; align-items: center; padding: 6px 0; }
.truck-rows__row--head { padding: 0 0 2px; font-size: 13px; color: var(--text-3); }
.truck-rows__row--plates { grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1fr); }
.truck-rows__field { display: block; min-width: 0; }
/* The head row names the columns on a wide page; a phone's stacked row names each field. */
.truck-rows__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.truck-rows__hint { margin: 6px 0 0; font-size: 13px; color: var(--text-3); }
/* Sardar 05/11/2026: the Inland transport company where it is not asked for, as on Land; still posted, so nothing stored changes. */
[data-delivery-dup] { display: none !important; }
/* Above the shell's display: contents on its leg rows (a rule further down, one point of specificity less). */
.page.order-page .os-root .os-section__body [data-delivery-dup][data-delivery-dup][data-delivery-dup][data-delivery-dup] { display: none !important; }
/* Sardar 05/11/2026: a truck row names its two fields, spaced as .field so its inputs are in line with the land company's. */
.transport-builder[data-repeatable="land"] .repeat-row > label { display: flex; flex-direction: column; gap: 6px; }
.truck-rows__no { font-weight: 600; color: var(--text-2); }
.truck-rows__input { width: 100%; min-width: 0; }
.truck-rows__list { margin: 0; padding: 0 14px 12px; }
.truck-rows__list > div { display: flex; gap: 12px; padding: 4px 0; }
.truck-rows__list dt { flex: 0 0 96px; font-weight: 600; color: var(--text-2); }
.truck-rows__list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.page--costs .cx-truck { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 400; color: var(--text-3); white-space: normal; }
.page--costs td.cx-vendor .cx-select--truck { display: block; margin-top: 8px; }  /* under the vendor, not beside it in the nowrap cell */
.page--costs td.cx-vendor .cx-select--truck select { width: 100%; }  /* its caret stays inside the field */
@media (max-width: 640px) {
  .truck-rows__row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 10px 0; border-top: 1px solid var(--border); }
  .truck-rows__row--head { display: none; }
  .truck-rows__label { position: static; display: block; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; margin-bottom: 4px; font-size: 13px; color: var(--text-3); }
  .truck-rows__input { min-height: 44px; font-size: 16px; }
}

/* Combined audit 03/11/2026, 390px. Add row with a Truck control: the cell wraps and the control takes its width (the page
   scrolled sideways to 584px). The bar's buttons stay on one line (TR "Maliyetleri tamamla"); the bar wraps before they do. */
@media (max-width: 640px) {
  .page--costs td.cx-vendor { white-space: normal; }
  .page--costs td.cx-vendor .cx-select { display: block; width: 100%; }
  .page--costs td.cx-vendor .cx-select select { width: 100%; }
  /* TR "Düzenleniyor · Muhasebe" wraps inside its pill. */
  .page--costs .cx-badge { height: auto; min-height: 22px; padding-block: 3px; line-height: 1.2; text-align: center; }
  .page--costs .cs-actions { flex-wrap: wrap; }
  .page--costs .cs-actions .cs-btn { white-space: nowrap; }
}

/* Sardar 12/11/2026 (later notes item 10): a Sea Freight Bulk row reads Container type · Weight (tons) · Pieces (the
   Quantity is hidden). Its own grid on every order page (the id-level :not() outranks the page layouts); a phone stacks
   the type over the two figures, nothing wider than the card. */
.transport-builder--bulk .repeat-row.repeat-row--bulk:not(#bulk-row) { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 8px 12px; align-items: end; min-width: 0; }
.transport-builder--bulk .repeat-row.repeat-row--bulk:not(#bulk-row) > label { display: flex; flex-direction: column; gap: 6px; min-width: 0; grid-column: auto; }
.transport-builder--bulk .repeat-row.repeat-row--bulk:not(#bulk-row) > label[hidden] { display: none; }
.transport-builder--bulk .repeat-row.repeat-row--bulk:not(#bulk-row) > .repeat-remove { grid-column: auto; grid-row: auto; align-self: end; }
.transport-builder--bulk .repeat-row.repeat-row--bulk:not(#bulk-row) .field__label:not(.sr-only) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .transport-builder--bulk .repeat-row.repeat-row--bulk:not(#bulk-row) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; }
  .transport-builder--bulk .repeat-row.repeat-row--bulk:not(#bulk-row) > label:has(select) { grid-column: 1 / 3; }
  .transport-builder--bulk .repeat-row.repeat-row--bulk:not(#bulk-row) > .repeat-remove { grid-column: 3; grid-row: 1; }
  .transport-builder--bulk .repeat-row.repeat-row--bulk:not(#bulk-row) > [data-bulk-field] { grid-row: 2; grid-column: 1; }
  .transport-builder--bulk .repeat-row.repeat-row--bulk:not(#bulk-row) > [data-bulk-field] ~ [data-bulk-field] { grid-column: 2; }
}

/* View Order — light type + arrange on the original page (Sardar 30/10/2026 00:31 Baghdad; design
   view-order-redesign-2026-10-30, polish only). Same blocks, order, data, labels, links and buttons as before;
   View pages only (Air / Other / legacy, Land, Sea, Clearance: .order-page--view.land-page), never Edit / New.
   Type: Inter, labels 13px / values 16px / card titles 17px / NG number 30px, brand greys. Arrange: labels above
   values in a 3-column grid (2 on a phone), 16px between cards, clearer stepper, stage items in equal boxes,
   the Air (and other service) card styled as the other cards, history stacked on a phone. */
.page.order-page.order-page--view.land-page { --vo-gap: 16px; --vo-pad: 20px; }
.page.order-page.order-page--view.land-page .land-main > .card { margin: 0 0 var(--vo-gap); border-radius: 12px; }
.page.order-page.order-page--view.land-page .land-head { margin-bottom: var(--vo-gap); padding: 20px 24px; }
.page.order-page.order-page--view.land-page .land-head__back a { font-size: 14px; }
.page.order-page.order-page--view.land-page .land-head__back a .icon { width: 14px; height: 14px; }
.page.order-page.order-page--view.land-page .land-head__title { gap: 12px; font-size: 30px; }
.page.order-page.order-page--view.land-page .land-head__ng { font-size: 30px; }
.page.order-page.order-page--view.land-page .land-badge { padding: 4px 11px; font-size: 12px; }
.page.order-page.order-page--view.land-page .land-head__sub { margin-top: 10px; color: #E3E9F5; font-size: 15px; line-height: 1.5; }
.page.order-page.order-page--view.land-page .land-head__sub .op-data { color: #fff; font-weight: 600; }
/* Stepper: done green, current orange, later grey; bigger dots and labels. */
.page.order-page.order-page--view.land-page .land-stepper { padding: 18px var(--vo-pad) 14px; }
.page.order-page.order-page--view.land-page .land-step { gap: 6px; font-size: 14px; color: var(--text-3); }
.page.order-page.order-page--view.land-page .land-step::before { top: 13px; inset-inline-start: calc(-50% + 16px); inset-inline-end: calc(50% + 16px); background: #DDE3EC; }
.page.order-page.order-page--view.land-page :is(.land-step--done, .land-step--current)::before { background: #067647; }
.page.order-page.order-page--view.land-page .land-step__dot { width: 28px; height: 28px; border: 2px solid #CBD3DF; font-size: 12.5px; color: #94A3B8; }
.page.order-page.order-page--view.land-page .land-step__dot .icon { width: 13px; height: 13px; }
.page.order-page.order-page--view.land-page .land-step--done .land-step__dot { border-color: #067647; background: #067647; color: #fff; }
.page.order-page.order-page--view.land-page .land-step--current .land-step__dot { border-color: var(--orange); background: var(--orange); color: var(--navy-950, #0B1226); box-shadow: 0 0 0 4px #FDEBD3; }
.page.order-page.order-page--view.land-page .land-step__label { color: var(--text-3); font-weight: 500; line-height: 1.3; }
.page.order-page.order-page--view.land-page :is(.land-step--done, .land-step--current) .land-step__label { color: var(--text); font-weight: 600; }
.page.order-page.order-page--view.land-page .land-step__date { font-size: 12.5px; color: var(--text-4); }
/* The current stage: its items in equal boxes. */
.page.order-page.order-page--view.land-page .land-stage { background: #FFFBF5; }
.page.order-page.order-page--view.land-page .land-stage__head { gap: 10px; padding: 14px var(--vo-pad); border-bottom-color: #F6DFC0; }
.page.order-page.order-page--view.land-page .land-stage__num { width: 24px; height: 24px; font-size: 12px; color: var(--navy-950, #0B1226); }
.page.order-page.order-page--view.land-page .land-stage__title { font-size: 17px; color: var(--text); }
.page.order-page.order-page--view.land-page .land-tag { padding: 3px 9px; font-size: 11.5px; }
.page.order-page.order-page--view.land-page .land-stage__count { font-size: 13px; color: var(--text-3); }
.page.order-page.order-page--view.land-page .land-stage__items { gap: 10px; padding: 14px var(--vo-pad); font-size: 15px; }
.page.order-page.order-page--view.land-page .land-check { min-width: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); }
.page.order-page.order-page--view.land-page .land-check.is-done { color: var(--text-2); }
.page.order-page.order-page--view.land-page .land-check__mark { flex: none; width: 18px; height: 18px; border: 2px solid #CBD3DF; }
.page.order-page.order-page--view.land-page .land-check.is-done .land-check__mark { background: #067647; }
.page.order-page.order-page--view.land-page .land-check__mark .icon { width: 10px; height: 10px; }
/* Section cards (Order & route, Team, …) and the service cards (Air freight, …): one title style, labels above values. */
.page.order-page.order-page--view.land-page :is(.land-sec__title, .land-main > .view-section > .card__header) {
  margin: 0; padding: 16px var(--vo-pad); border-bottom: 1px solid var(--border); background: #fff; box-shadow: none; }
.page.order-page.order-page--view.land-page :is(.land-sec__title, .land-main > .view-section .card__title, .op-history .op-card__title) {
  font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.page.order-page.order-page--view.land-page .land-main > .view-section { overflow: hidden; background: #fff; box-shadow: none; }
.page.order-page.order-page--view.land-page .land-main > .view-section > .card__body { padding: 18px var(--vo-pad) 20px; background: #fff; }
.page.order-page.order-page--view.land-page .land-main > .view-section > .card__body > .detail-grid { padding: 0; }
/* A service card with nothing stored keeps its one-line form (title, then "—"). */
.page.order-page.order-page--view.land-page .land-main > .view-section:has(.view-empty) > .card__header { border-bottom: 0; }
.page.order-page.order-page--view.land-page .land-main > .view-section:has(.view-empty) > .card__body { padding: 0 var(--vo-pad) 0 0; }
.page.order-page.order-page--view.land-page :is(.land-sec__grid, .land-main > .view-section .detail-grid) {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 28px; margin: 0; padding: 18px var(--vo-pad) 20px; }
.page.order-page.order-page--view.land-page :is(.land-kv, .land-main > .view-section .detail) {
  display: block; min-width: 0; margin: 0; padding: 0; border: 0; font-size: 16px; }
.page.order-page.order-page--view.land-page .land-main > .view-section .detail--wide { grid-column: 1 / -1; }
.page.order-page.order-page--view.land-page :is(.land-kv, .land-main > .view-section .detail) > dt {
  margin: 0 0 4px; color: var(--text-2); font-size: 13px; font-weight: 600; line-height: 1.4; }
.page.order-page.order-page--view.land-page :is(.land-kv, .land-main > .view-section .detail) > dd {
  margin: 0; color: var(--text); font-size: 16px; font-weight: 600; line-height: 1.45; text-align: start; overflow-wrap: anywhere; }
.page.order-page.order-page--view.land-page :is(.land-kv, .land-main > .view-section .detail) > dd .muted { color: var(--text-4); font-weight: 500; }
/* Stage & ETA history: readable table on desktop. */
.page.order-page.order-page--view.land-page .op-history > .op-card__head { padding: 16px var(--vo-pad); }
.page.order-page.order-page--view.land-page .op-history__table th { padding: 10px var(--vo-pad); color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.page.order-page.order-page--view.land-page .op-history__table td { padding: 13px var(--vo-pad); font-size: 14.5px; }
.page.order-page.order-page--view.land-page .op-history__table td:first-child { font-family: var(--mono); font-size: 14px; }
.page.order-page.order-page--view.land-page .op-history__table td:is(:nth-child(3), :nth-child(5)) { color: var(--text-3); }
.page.order-page.order-page--view.land-page .op-history__table tr:last-child td { border-bottom: 0; }
.page.order-page.order-page--view.land-page .land-foot .btn { font-size: 15px; }
/* Orders pages Design v3 (owner 02/11/2026, design orders-pages-redesign-2026-11-02): the one shell (_order_shell.html)
   of New, Edit and View on every service. Scoped to .os-root; the fields keep their controls and names. */
.os-root [hidden] { display: none !important; }
/* A New order before its Service is picked: the service's sections, Scope and stars wait for the pick. CSS only, so
   the form posts what it always did; app.js removes data-pick-service on the pick. */
.os-root[data-pick-service] [data-os-section]:not([data-os-section="route"], [data-os-section="team"]),
.os-root[data-pick-service] [data-service-scope] > *,
.os-root[data-pick-service] abbr.req:not([data-pick-star]) { display: none !important; }
.os-root { padding-top: 20px; }
.os-root .os-hero { margin: 0 0 20px; padding: 0; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: none; }
.page.order-page .os-root .os-hero__back { flex: 1 1 100%; margin: 0 0 -6px; padding: 0; font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.os-hero__back a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); text-decoration: none; }
.os-hero__back a .icon { width: 12px; height: 12px; }
.os-hero__top { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 26px 20px; border-bottom: 1px solid var(--border-soft); }
.page.order-page .os-root h1.os-hero__ng { flex: none; margin: 0; padding: 8px 14px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 22px; font-weight: 800; letter-spacing: .02em; line-height: 1.2; }
.os-hero__main { min-width: 0; flex: 1 1 auto; }
.os-hero__customer { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.os-hero__sub { margin: 2px 0 0; color: var(--text-3); font-size: 13px; overflow-wrap: anywhere; }
.os-pill { flex: none; padding: 4px 10px; border-radius: 999px; background: #FFF4E5; color: #9A4D00; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.os-pill--green { background: #E3F6EA; color: #1A7F43; }
.os-pill--grey { background: #EEF1F6; color: #56657A; }
.os-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0; padding: 22px 26px 20px; list-style: none; }
.os-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 4px; text-align: center; font-size: 12px; font-weight: 600; color: #667085; }
.os-step::before { content: ""; position: absolute; top: 17px; inset-inline-start: -50%; inset-inline-end: 50%; height: 4px; background: #E4E8EF; }
.os-step:first-child::before { display: none; }
.os-step--done::before { background: #13804B; }
.os-step--current::before { background: linear-gradient(90deg, #13804B, var(--orange)); }
[dir="rtl"] .os-step--current::before { background: linear-gradient(270deg, #13804B, var(--orange)); }
.os-step__dot { position: relative; z-index: 1; display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 7px; border: 2px solid #D5DBE5; border-radius: 50%; background: #fff; color: #fff; }
.os-step__dot .icon { width: 16px; height: 16px; stroke-width: 3; }
.os-step__pip { display: block; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.os-step--done { color: var(--text); }
.os-step--done .os-step__dot { border-color: #13804B; background: #13804B; }
.os-step--current { color: #9A4D00; font-weight: 800; }
.os-step--current .os-step__dot { border-color: var(--orange); background: var(--orange); box-shadow: 0 0 0 6px rgba(244, 123, 32, .18); }
.os-step__label { overflow-wrap: anywhere; }
.os-step__date { font-size: 11px; font-weight: 500; color: #667085; }
.os-step--current .os-step__date { color: #9A4D00; }
.os-stepper__card { display: none; }
.page.order-page .os-root .os-section { display: grid; grid-template-columns: 184px minmax(0, 1fr); margin: 0 0 14px; padding: 0; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: none; }
.os-section__label { padding: 20px 18px 20px 22px; border-inline-end: 1px solid var(--border-soft); border-radius: 15px 0 0 15px; background: linear-gradient(180deg, #F8FAFC, #fff); }
.page.order-page .os-root .os-section__title { margin: 0; padding: 0; border: 0; color: var(--text); font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.os-section__body { min-width: 0; padding: 20px 24px 20px 20px; }
.page.order-page .os-root .os-section--current { border-color: #F7C98C; box-shadow: 0 0 0 3px rgba(244, 123, 32, .1); }
.os-section--current .os-section__label { background: linear-gradient(180deg, #FFF7EC, #fff); }
/* The 4-column field grid: every wrapper a section's fields sit in steps aside. */
.page.order-page .os-root .os-section__body > .section-fields { display: block; min-width: 0; margin: 0; padding: 0; border: 0; }
.page.order-page .os-root .os-section__body > .section-fields > .form-grid,
.page.order-page.land-page .os-root .land-sec__grid,
.page.order-page.land-page .os-root .os-section__body > .detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 16px 18px !important; margin: 0; padding: 0 !important; }
.page.order-page .os-root .os-section__body :is(.load-fields, .op-part, .op-part > .card__body, .op-part .section-fields, .op-part .form-grid, .load-fields > .form-grid, .leg-rows, .customs-rows, .assignment-row--leg, .clearance-half, .port-picker, .port-picker__pod, .port-slot, .os-flat, [data-main-land-provider], .sea-route__city, .sea-route__load, [data-service-scope], [data-land-route-kept], .op-grid--handover):not([hidden]) { display: contents !important; }
.page.order-page .os-root .os-section__body .transport-builder { display: block; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.page.order-page .os-root .os-section__body .transport-builder.leg-rows:not([hidden]) { display: contents !important; }
.page.order-page .os-root .os-section__body :is(.repeat-list, .repeat-row) { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.page.order-page .os-root .os-section__body .repeat-row input[type="number"] { text-align: start; }
.page.order-page .os-root .os-section__body :is(.field, .op-field) { align-self: start; min-width: 0; margin: 0; }
.page.order-page .os-root .os-section__body .assignment-row--leg > .field { grid-column: auto !important; align-self: start !important; }
.os-root .os-section__body .leg-row__title, .os-root .os-section__body [data-customs-row] > h3 { display: none; }
.page.order-page .os-root .os-section__body .field__label { display: block; margin: 0 0 6px; color: var(--text-3); font-size: 12px; font-weight: 600; }
/* Sardar 05/11/2026: a leg row's label (Inland transport company) as tall as its neighbours', so its field lines up in the grid. */
.page.order-page .os-root .os-section__body .assignment-row--leg .field__label { min-height: 0; }
.page.order-page .os-root .os-section__body .field__label.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* The shell's stars are its abbr.req (order_page.star_fields). app.js still shows the old stage markers from the
   cumulative requirements; none of them is displayed here (validation does not read them). */
.os-root .stage-req { display: none !important; }
.page.order-page .os-root .os-section__body label:has(> select[name="company_name"]),
.page.order-page .os-root .os-section__body label:has(> select[name="pod_vendor_id"]),
.page.order-page .os-root .os-section__body .field--span-2 { grid-column: span 2; }
.page.order-page .os-root .os-section__body :is(.op-fromto, .svc-builder, .truck-rows, .land-leg-lines, .customs-held-note, .port-picker__extras, [data-repeatable="merged"], .op-choices-field, .alert, .detail--wide:has(table), .svc-pod, .svc-view) { grid-column: 1 / -1; }
.page.order-page .os-root .os-section__body > .svc-view, .page.order-page .os-root .os-section__body > .svc-pod { margin: 0 0 12px; }
.page.order-page .os-root .os-section__body .repeat-row:not(.repeat-row--package) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; }
.page.order-page .os-root .os-section__body .assignment-row--other { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 16px 18px; align-items: end; }
.page.order-page .os-root .os-section__body .op-fromto__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 18px; }
.page.order-page.land-page .os-root .land-kv, .page.order-page.land-page .os-root .detail { min-width: 0; margin: 0; padding: 0; border: 0; }
.page.order-page.land-page .os-root .land-kv > dt, .page.order-page.land-page .os-root .detail > dt { margin: 0 0 6px; color: var(--text-3); font-size: 12px !important; font-weight: 600 !important; }
.page.order-page.land-page .os-root .land-kv > dd, .page.order-page.land-page .os-root .detail > dd { display: flex; align-items: center; min-height: calc(var(--ctl-md) + 2px); margin: 0; padding: 8px 12px; border: 1px solid #DDE3EC; border-radius: 10px; background: #F6F8FB; color: var(--text); font-size: 14px !important; font-weight: 500 !important; overflow-wrap: anywhere; }
/* An order's Truck N block (design review 05/11/2026): two columns of the field grid, the plates as label over value, the carrier on its own line. */
.page.order-page .truck-block { grid-column: span 2; }
.page.order-page.land-page .os-root .land-kv.truck-block > dd, .page.order-page.land-page .os-root .detail.truck-block > dd { display: block; }
.truck-block__plates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto; grid-auto-flow: column; gap: 2px 16px; margin: 0; overflow-wrap: normal; }
.truck-block__plates > dt { margin: 0; color: var(--text-3); font-size: 12px; font-weight: 600; white-space: nowrap; }
.truck-block__plates > .plate-value { margin: 0; font-weight: inherit; text-align: start; white-space: nowrap; }
.truck-block__carrier { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid #DDE3EC; overflow-wrap: break-word; }
/* Truck N block, phone: the blocks one above the other, Truck plate above Trailer plate. */
@media (max-width: 640px) {
  .page.order-page .truck-block { grid-column: 1 / -1; }
  .truck-block__plates { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
  .truck-block__plates > .plate-value + dt { margin-top: 8px; }
}
.os-root .op-closed { margin: 0 0 14px; }
.op-closed__mark { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-inline-end: 8px; border-radius: 50%; background: var(--success); color: #fff; font-size: 13px; font-weight: 700; }
.op-closed__mark--cancelled { background: #667085; }
.op-closed__mark .icon { width: 13px; height: 13px; }
.os-root .os-bar { align-items: center; }
.os-bar__stage { margin-inline-end: auto; color: var(--text-3); font-size: 13px; }
.os-bar__stage b { color: var(--text); }
.os-root .os-bar .land-foot__change { margin-inline: 0 0; }
.page.order-page--new .os-root .os-bar, .page.order-page--edit .os-root .os-bar { position: sticky; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--border); }
/* Audit R-24: the sticky bottom bars clear a phone's home indicator and rounded corners (env() is 0 on a desktop, so the
   same padding as before there). */
.land-page.sea-page .land-foot, .page.order-page--new .os-root .os-bar, .page.order-page--edit .os-root .os-bar {
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
.new-start__bar { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.form-actions, .order-page .order-form .form-actions { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
/* The desktop top bar's breadcrumb names the list from 1280px (the sidebar page): no second back link. */
@media (min-width: 1280px) { .page.order-page .os-root .os-hero__back { display: none; } .os-hero__top { padding-top: 20px; } }
@media (max-width: 1100px) {
  .page.order-page .os-root .os-section__body > .section-fields > .form-grid,
  .page.order-page.land-page .os-root .land-sec__grid,
  .page.order-page.land-page .os-root .os-section__body > .detail-grid,
  .page.order-page .os-root .os-section__body .op-fromto__grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 640px) {
  .os-hero__top { padding: 12px 16px 14px; }
  .page.order-page .os-root h1.os-hero__ng { font-size: 18px; }
  .os-hero__main { flex: 1 1 100%; order: 2; }
  .os-pill { order: 1; margin-inline-start: auto; }
  .os-track { display: none; }
  .os-stepper__card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 10px; padding: 14px 16px 16px; }
  .os-stepper__now { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .os-stepper__dot { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: #fff; box-shadow: 0 0 0 5px rgba(244, 123, 32, .18); }
  .os-stepper__dot.is-complete { background: #13804B; box-shadow: none; }
  .os-stepper__dot.is-cancelled { background: #667085; box-shadow: none; }
  .os-stepper__dot .icon { width: 14px; height: 14px; stroke-width: 3; }
  .os-stepper__name { display: block; color: var(--text); font-size: 14px; font-weight: 800; overflow-wrap: anywhere; }
  .os-stepper__of { display: block; color: var(--text-3); font-size: 12px; }
  .os-stepper__next { max-width: 44vw; color: var(--text-3); font-size: 11.5px; text-align: end; overflow-wrap: anywhere; }
  .os-stepper__next b { display: block; color: var(--text); font-size: 12px; }
  .os-stepper__bars { grid-column: 1 / -1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
  .os-seg { height: 5px; border-radius: 3px; background: #E4E8EF; }
  .os-seg--done { background: #13804B; }
  .os-seg--current { background: var(--orange); }
  .page.order-page .os-root .os-section { display: block; border-radius: 14px; }
  .page.order-page .os-root .os-bar .stage-ctl__left { flex-wrap: nowrap; width: 100%; }
  /* Each button takes its text and padding first, then a share of what is left (from a zero basis Back to stage got less
     than its text, and "Önceki aşamaya dön" ran over its 14px at 390). Too narrow for that: the text wraps inside the padding. */
  .page.order-page .os-root .os-bar .stage-ctl__left > * { flex: 1 1 auto; min-width: 0; }
  .page.order-page .os-root .os-bar .stage-ctl__divider { flex: none; }
  .page.order-page .os-root .os-bar .op-head__change > summary { width: 100%; justify-content: center; }
  .page.order-page .os-root .os-bar .op-head__change > summary, .page.order-page .os-root .os-bar .stage-ctl__cancel { line-height: 1.25; white-space: normal; text-align: center; }
  /* The stage menu opens over the bar's full width: its button sits at the end of the row. */
  .page.order-page .os-root .os-bar .order-bar__change { position: static; }
  .page.order-page.land-page .os-root .os-bar .op-head__change > .order-bar__change-panel { top: auto; bottom: calc(100% + 8px); inset-inline: 12px; width: auto; min-width: 0; max-width: none; }
  .os-section__label { padding: 14px 16px; border-inline-end: 0; border-bottom: 1px solid var(--border-soft); border-radius: 13px 13px 0 0; }
  .page.order-page .os-root .os-section__title { font-size: 16px; }
  .os-section__body { padding: 14px 16px; }
  .page.order-page .os-root .os-section__body > .section-fields > .form-grid,
  .page.order-page.land-page .os-root .land-sec__grid,
  .page.order-page.land-page .os-root .os-section__body > .detail-grid,
  .page.order-page .os-root .os-section__body .op-fromto__grid { grid-template-columns: minmax(0, 1fr) !important; }
  .page.order-page .os-root .os-section__body :is(.field--span-2, label:has(> select[name="company_name"]), label:has(> select[name="pod_vendor_id"])) { grid-column: auto; }
  .page.order-page .os-root .os-section__body .assignment-row--other { grid-template-columns: minmax(0, 1fr); }
  .os-bar__stage { display: none; }
}

/* Port costs on the Cost page (Sardar 04/11/2026, approved design portcosts-1104): on top of the Cost lines card, above the
   table header. Saved by the page's Save; the radios alone decide what shows (no script). */
.page--costs .cs-portcosts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 14px 24px 2px; padding: 12px 14px; background: #FBFCFE; border: 1px solid #E1E5EE; border-inline-start: 4px solid #F47B20; border-radius: 10px; font-size: 12px; }
.page--costs .cs-portcosts.is-locked { border-inline-start-color: #9AA3B5; }
.page--costs .cs-portcosts__label { min-width: 110px; font-size: 13px; font-weight: 700; color: #14327A; }
.page--costs .cs-portcosts__req { color: #C2410C; }
.page--costs .cs-portcosts:has(input:checked) .cs-portcosts__req { display: none; }
.page--costs .cs-portcosts__seg { display: inline-flex; overflow: hidden; background: #fff; border: 1px solid #C9D0DE; border-radius: 9px; }
.page--costs .cs-portcosts__opt { position: relative; display: flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 12px; font-weight: 600; line-height: 1.25; color: #14327A; cursor: pointer; }
.page--costs .cs-portcosts__opt + .cs-portcosts__opt { border-inline-start: 1px solid #C9D0DE; }
.page--costs .cs-portcosts__opt input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: inherit; }
.page--costs .cs-portcosts__dot { flex: none; width: 12px; height: 12px; border: 2px solid currentColor; border-radius: 50%; box-sizing: border-box; }
.page--costs .cs-portcosts__opt:has(input:checked) { background: #14327A; color: #fff; }
.page--costs .cs-portcosts__opt:has(input:checked) .cs-portcosts__dot { background: #F47B20; border-color: #fff; }
.page--costs .cs-portcosts__opt:has(input:focus-visible) { outline: 2px solid #F47B20; outline-offset: -2px; }
.page--costs .cs-portcosts.is-locked .cs-portcosts__seg { opacity: .55; }
.page--costs .cs-portcosts.is-locked .cs-portcosts__opt { cursor: not-allowed; }
.page--costs .cs-portcosts__help, .page--costs .cs-portcosts__note { margin: 0; font-size: 12px; line-height: 1.4; color: #5B6478; }
.page--costs .cs-portcosts__help { flex: 1 1 260px; min-width: 0; }
.page--costs .cs-portcosts__help--warn { font-weight: 600; color: #B45309; }
.page--costs .cs-portcosts [data-port-help], .page--costs .cs-portcosts [data-port-unsaved] { display: none; }
.page--costs .cs-portcosts:not(:has(input:checked)) [data-port-help="unselected"],
.page--costs .cs-portcosts:has(input[value="itemized"]:checked) [data-port-help="itemized"],
.page--costs .cs-portcosts:has(input[value="via_clearance"]:checked) [data-port-help="via_clearance"] { display: block; }
.page--costs .cs-portcosts:has(input:not([data-port-stored]):checked) [data-port-unsaved] { display: block; }
.page--costs .cs-portcosts__note { flex: 1 1 100%; font-weight: 600; color: #B45309; }
/* Paid by broker with port lines still holding money: the group that may be paid twice reads at a glance. */
.page--costs .cx-table tr.cx-group[data-port-stale] > th.cx-group__head, .page--costs .cx-table tr.cx-row[data-port-stale] { background: #FFF7ED; }
.page--costs .cx-table tr.cx-row[data-port-stale] > td { background: transparent; }
.page--costs .cx-group__stale { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; line-height: 1.4; letter-spacing: 0; text-transform: none; white-space: normal; color: #9A3412; }
@media (max-width: 1023px) {
  .page--costs .cx-table tr.cx-group[data-port-stale] > th.cx-group__head { padding: 6px 8px; border-radius: 6px; }
}
@media (max-width: 600px) {
  .page--costs .cs-portcosts { display: block; margin: 12px 12px 2px; }
  .page--costs .cs-portcosts__label { display: block; margin-bottom: 8px; }
  .page--costs .cs-portcosts__seg { display: flex; }
  .page--costs .cs-portcosts__opt { flex: 1 1 50%; min-width: 0; min-height: 44px; box-sizing: border-box; justify-content: center; padding: 8px 6px; text-align: start; }
  .page--costs .cs-portcosts__help, .page--costs .cs-portcosts__note { margin-top: 8px; }
}

.page.order-page { --r3-max: 100%; }
/* Phone cleanup (24/10/2026): layout only, phones up to 760px; the desktop rules above are unchanged. */
@media (max-width: 760px) {
  /* Order edit tabs wrap onto a second line instead of running off the screen. */
  .land-tabs { flex-wrap: wrap; column-gap: 18px; row-gap: 0; }
  .land-tabs button { white-space: nowrap; }
  /* Team (Job owner, Operations 1, Operations 2): one field per line, so no name or placeholder is cut. */
  .land-page .land-tab-team .form-grid { grid-template-columns: minmax(0, 1fr); }
  /* Bottom action bar: Cancel order / Back to stage on their own row, Save and Next stage below. */
  .land-foot { flex-wrap: wrap; row-gap: 8px; }
  .land-foot .land-foot__change { flex: 1 1 100%; min-width: 0; margin-inline: 0; }
  .land-foot .stage-ctl__left { flex-wrap: wrap; max-width: 100%; }
  .land-foot > .land-foot__btn { flex: 1 1 auto; }
  .land-foot .stage-ctl__next { min-width: 0; white-space: normal; }
  /* Back to stage opens from the row's left edge so its list stays on screen. */
  .land-foot .stage-ctl__left > .order-bar__change { position: static; }
  .land-foot .stage-ctl__left > .order-bar__change > .order-bar__change-panel { inset-inline-start: 0; inset-inline-end: auto; max-width: calc(100vw - 24px); }
}
/* Cost Statement cards below 1024px: Vendor first, then Item, Unit, Qty, Unit price, Currency and Total
   (the grid areas above predate the Vendor column); the read-only and Selling price rows get the same cards. */
@media (max-width: 1023px) {
  .page--costs .cx-table--edit tr.cx-row:not(.cx-row--mode) { grid-template-areas: "vendor vendor item item" "unit qty cpu cur" "total total total total"; }
  .page--costs .cx-table--edit tr.cx-row > td.cx-vendor { grid-area: vendor; }
  .page--costs .cx-table--edit tr.cx-row > td.cx-item { grid-area: item; }
  .page--costs .cx-table--edit tr.cx-row > td.cx-ct { grid-area: total; }
  .page--costs .cx-table--ro tr.cs-row { grid-template-areas: "vendor vendor item item" "unit qty uprice cur" "total total total total"; }
  .page--costs .cx-table--ro tr.cs-row > .cs-vendor { grid-area: vendor; }
  .page--costs .cx-table--ro tr.cs-row > .cs-item { grid-area: item; }
  .page--costs .cx-table--ro tr.cs-row > .cs-unit { grid-area: unit; }
  .page--costs .cx-table--ro tr.cs-row > .cs-qty { grid-area: qty; }
  .page--costs .cx-table--ro tr.cs-row > .cs-uprice { grid-area: uprice; }
  .page--costs .cx-table--ro tr.cs-row > .cs-cur { grid-area: cur; }
  .page--costs .cx-table--ro tr.cs-row > .cs-total { grid-area: total; }
  .page--costs .cs-table--sell, .page--costs .cs-table--sell tbody { display: block; width: 100%; max-width: 100%; }
  .page--costs .cs-table--sell > :first-child, .page--costs .cs-table--sell thead { display: none; }  /* the column group and the header */
  .page--costs .cs-table--sell tr.cs-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px;
    grid-template-areas: "vendor vendor item item" "qty cost sell cur" "total total profit profit";
    padding: 14px; margin: 0 0 12px; border: 1px solid var(--cx-line); border-radius: 10px; background: #fff; }
  .page--costs .cs-table--sell tr.cs-row > td { display: block; min-width: 0; height: auto; padding: 0; border: 0; text-align: start; white-space: normal; }
  .page--costs .cs-table--sell tr.cs-row > td.cs-vendor { grid-area: vendor; }
  .page--costs .cs-table--sell tr.cs-row > td.cs-item { grid-area: item; }
  .page--costs .cs-table--sell tr.cs-row > td.cs-qty { grid-area: qty; }
  .page--costs .cs-table--sell tr.cs-row > td.cs-cost { grid-area: cost; }
  .page--costs .cs-table--sell tr.cs-row > td.cs-uprice { grid-area: sell; }
  .page--costs .cs-table--sell tr.cs-row > td.cs-cur { grid-area: cur; }
  .page--costs .cs-table--sell tr.cs-row > td.cs-total:not(.cs-profit-col) { grid-area: total; }
  .page--costs .cs-table--sell tr.cs-row > td.cs-profit-col { grid-area: profit; }
  .page--costs :is(.cx-table--ro, .cs-table--sell) tr.cs-row > td[data-label]::before { content: attr(data-label); display: block; margin: 0 0 4px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #56657A; }
  .page--costs :is(.cx-table--ro, .cs-table--sell) tr.cs-row :is(.cs-item, .cs-vendor) span { white-space: normal; overflow-wrap: anywhere; }
  .page--costs .cs-table--sell :is(.cs-in, .cs-sel, .cs-sel select) { width: 100%; max-width: 100%; box-sizing: border-box; }
  .page--costs .cx-lines__body { padding-top: 12px; }
  .page--costs .cx-table--edit tr.cx-row > td.cx-item { padding-inline-start: 0 !important; }
  .page--costs .cx-table--edit tr.cx-row > td.cx-cur .cx-select { margin-inline: 0; }
}
@media (max-width: 640px) {
  .page--costs .cx-table--edit tr.cx-row:not(.cx-row--mode) { grid-template-areas: "vendor vendor" "item item" "unit qty" "cpu cur" "total total"; }
  .page--costs .cx-table--edit tr.cx-row > td.cx-vendor { padding-inline-end: 36px; }
  .page--costs .cx-table--edit tr.cx-row > td.cx-item { padding-inline-end: 0; }
  .page--costs .cx-table--ro tr.cs-row { grid-template-areas: "vendor vendor" "item item" "unit qty" "uprice cur" "total total"; }
  .page--costs .cs-table--sell tr.cs-row { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "vendor vendor" "item item" "qty cost" "sell cur" "total profit"; }
}
/* Cost page (Sardar 25/10/2026): every cost group's header row on phones and tablets (desktop rule above). */
@media (max-width: 1023px) {
  .page--costs .cx-table tr.cx-group { display: block; margin: 16px 0 8px; }
  .page--costs .cx-table tr.cx-group:first-child { margin-top: 0; }
  .page--costs .cx-table tr.cx-group > th.cx-group__head { display: block; height: auto; padding: 0 0 6px; background: none; }
}
/* Phone vendor list (Sardar 25/10/2026): a compact card per line — the vendor as the card's title (trash
   beside it), the item under it, Unit · Qty and Unit price · Currency side by side, Total on one line. */
@media (max-width: 640px) {
  .page--costs .cx-table tr.cx-row:not(.cx-row--mode) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; padding: 12px; margin: 0 0 8px; }
  .page--costs .cx-table--edit tr.cx-row:not(.cx-row--mode) { grid-template-areas: "vendor vendor vendor" "item item item" "unit unit qty" "cpu cpu cur" "total total total"; }
  .page--costs .cx-table--ro tr.cs-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; padding: 12px; margin: 0 0 8px;
    grid-template-areas: "vendor vendor vendor" "item item item" "unit unit qty" "uprice uprice cur" "total total total"; }
  .page--costs .cx-table--edit tr.cx-row > td.cx-vendor::before, .page--costs .cx-table--edit tr.cx-row > td.cx-item::before,
  .page--costs .cx-table--ro tr.cs-row > td.cs-vendor::before { display: none; }
  .page--costs .cx-table--edit tr.cx-row > td.cx-vendor .op-data, .page--costs .cx-table--ro tr.cs-row > td.cs-vendor .op-data { font-size: 14px; font-weight: 700; color: var(--text); }
  .page--costs .cx-table tr.cx-row > td.cx-item .cx-select { margin: 0; }
  .page--costs .cx-table tr.cx-row > td.cx-del { top: 8px; inset-inline-end: 8px; }
  .page--costs .cx-table--edit tr.cx-row > td.cx-ct, .page--costs .cx-table--ro tr.cs-row > td.cs-total { display: flex; justify-content: space-between; align-items: baseline;
    padding-top: 8px; border-top: 1px solid var(--cx-line); font-weight: 700; }
  .page--costs .cx-table--edit tr.cx-row > td.cx-ct::before, .page--costs .cx-table--ro tr.cs-row > td.cs-total::before { margin: 0; }
}
/* Sardar 25/10/2026: on a phone the Cost total row gives the currency and the amount the room they need
   (the desktop 73% / 11% columns put 'USD' over a long amount at 390 px). */
@media (max-width: 640px) {
  .page--costs .cs-costtotal--ro tr:not([hidden]) { grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 8px; }
  .page--costs .cs-costtotal--ro .cs-costtotal__cur { padding-inline-start: 0 !important; }
}

/* Sardar 28/10/2026 (A6, D-P2-1): below 320px the header's fixed controls (menu, + New, language, bell, user) and the
   brand need 320px, so every page (the Accounting pages too) scrolled sideways by the difference (72px at 248px):
   the brand gives way there. */
@media (max-width: 319px) {
  .app-header .brand { display: none; }
}

/* Sardar 28/10/2026 follow-up (item 7, A6 on every Accounts page): on a small phone the Cost / Sell page's approval rows
   wrap (number and name, then the state and its time, or Return / Approve) instead of scrolling the page sideways (the
   approval time ended 73px past a 248px screen). */
@media (max-width: 480px) {
  .page--costs .cs-appr__row { flex-wrap: wrap; row-gap: 6px; padding: 10px 16px; }
  .page--costs .cs-appr__time { min-width: 0; }
  .page--costs .cs-return { flex-wrap: wrap; max-width: 100%; }
  .page--costs .cs-return__reason { width: 220px; max-width: 100%; }
}
@media (max-width: 319px) {
  .page--costs .cs-sum__row dd { gap: 8px; }  /* the Sell total and its currency select fit (1px past 248px) */
  .page--costs .cs-sum__val { min-width: 0; }
}


/* View Order light polish (Sardar 30/10/2026 00:31), phone: see the View Order block above the phone cleanup. */
@media (max-width: 640px) {
  .page.order-page.order-page--view.land-page { --vo-gap: 12px; --vo-pad: 16px; }
  .page.order-page.order-page--view.land-page .land-head { padding: 16px; }
  .page.order-page.order-page--view.land-page :is(.land-head__title, .land-head__ng) { font-size: 26px; }
  .page.order-page.order-page--view.land-page .land-head__sub { font-size: 14.5px; }
  /* Stepper: no dates on a phone, so the labels do not wrap into them. */
  .page.order-page.order-page--view.land-page .land-stepper { padding: 14px 6px; }
  .page.order-page.order-page--view.land-page .land-step { font-size: 12px; }
  .page.order-page.order-page--view.land-page .land-step::before { top: 12px; inset-inline-start: calc(-50% + 14px); inset-inline-end: calc(50% + 14px); }
  .page.order-page.order-page--view.land-page .land-step__dot { width: 26px; height: 26px; }
  .page.order-page.order-page--view.land-page .land-step__date { display: none; }
  .page.order-page.order-page--view.land-page .land-stage__head { flex-wrap: wrap; row-gap: 6px; }
  .page.order-page.order-page--view.land-page .land-stage__items { grid-template-columns: minmax(0, 1fr); }
  .page.order-page.order-page--view.land-page :is(.land-sec__grid, .land-main > .view-section .detail-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .page.order-page.order-page--view.land-page :is(.land-kv, .land-main > .view-section .detail) > dd { font-size: 15.5px; }
  /* History: each change stacked (what changed: before → after, then time · by), nothing cut off on the right. */
  .page.order-page.order-page--view.land-page .op-history .table-scroll { overflow: visible; }
  .page.order-page.order-page--view.land-page .op-history__table thead { display: none; }
  .page.order-page.order-page--view.land-page .op-history__table,
  .page.order-page.order-page--view.land-page .op-history__table tbody { display: block; width: 100%; }
  .page.order-page.order-page--view.land-page .op-history__table tr { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; row-gap: 2px; padding: 12px var(--vo-pad); border-bottom: 1px solid var(--border-soft); }
  .page.order-page.order-page--view.land-page .op-history__table tr:last-child { border-bottom: 0; }
  .page.order-page.order-page--view.land-page .op-history__table tr::after { content: ""; order: 4; flex-basis: 100%; height: 0; }
  .page.order-page.order-page--view.land-page .op-history__table td { display: block; padding: 0; border: 0; font-size: 15px; white-space: normal; overflow-wrap: anywhere; }
  .page.order-page.order-page--view.land-page .op-history__table td:nth-child(2) { order: 1; }
  .page.order-page.order-page--view.land-page .op-history__table td:nth-child(2)::after { content: ":"; }
  .page.order-page.order-page--view.land-page .op-history__table td:nth-child(3) { order: 2; }
  .page.order-page.order-page--view.land-page .op-history__table td:nth-child(4) { order: 3; }
  .page.order-page.order-page--view.land-page .op-history__table td:nth-child(4)::before { content: "→ "; color: var(--text-3); font-weight: 400; }
  .page.order-page.order-page--view.land-page .op-history__table td:first-child { order: 5; color: var(--text-3); font-size: 13px; }
  .page.order-page.order-page--view.land-page .op-history__table td:nth-child(5) { order: 6; font-size: 13px; }
  .page.order-page.order-page--view.land-page .op-history__table td:nth-child(5)::before { content: "· "; }
  .page.order-page.order-page--view.land-page .land-foot > .land-foot__btn { flex: 1 1 0; }
  .page.order-page.order-page--view.land-page .land-foot > .btn--primary { flex-grow: 2; }
  .page.order-page.order-page--view.land-page .land-foot > .land-foot__btn { padding-inline: 12px; font-size: 14.5px; line-height: 1.25; white-space: normal; text-align: center; }
}
