/* Screens and functions follow the prototype (docs/prototype.html); the LOOK is the Artwork Management
   System (AMS): its tokens, IBM Plex Sans, navy header with the logo, text tabs, navy table headers,
   2px corners, square signal labels. Values copied from ams/frontend/css. */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("assets/fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* AMS palette */
  --ink: #1F2933; --steel: #5B6673; --rule: #D6DBE0; --ground: #EDF0F3; --surface: #FFFFFF;
  --accent: #0A6FAA; --accent-dark: #085A8A; --accent-tint: #E6F0F7; --navy: #0B3D66;
  --ok: #2E7D4F; --ok-tint: #E5F2EA; --warn: #A15C00; --warn-tint: #FBEFDC; --info: #0A6FAA; --info-tint: #E6F0F7;
  --settled: #5B6673; --settled-1: #EEF1F4; --bad: #B42318; --bad-tint: #FDECEA; --bad-50: #FEF3F2;
  --radius: 2px; --header-h: 56px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --fs: 13px; --fs-small: 12px; --fs-min: 11px; --fs-h1: 20px; --fs-h2: 16px; --fs-h3: 14px;
  /* names the prototype screens use, mapped to the AMS palette */
  --bg: var(--ground); --muted: var(--steel); --line: var(--rule); --field: var(--surface); --link: var(--accent);
  --ok-bg: var(--ok-tint); --warn-bg: var(--warn-tint); --bad-bg: var(--bad-tint); --info-bg: var(--info-tint);
  --bar: var(--accent); --sans: var(--font); --mono: var(--font);
  color-scheme: light;
}

/* ---- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body { margin: 0; font-family: var(--font); font-size: var(--fs); line-height: 1.45; color: var(--ink); background: var(--ground); }
[hidden]:not([hidden=until-found i]) { display: none !important; }
img { max-width: 100%; }
h1, h2, h3 { font-weight: 600; color: var(--ink); line-height: 1.25; }
h2 { font-size: var(--fs-h2); margin: 0 0 10px; }
b, strong { font-weight: 600; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
button, input, select, textarea { font-family: var(--font); font-size: var(--fs); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--steel); opacity: 1; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mono, .num, table, time { font-variant-numeric: tabular-nums; }
.note { font-size: var(--fs-small); color: var(--steel); }
.meta { font-size: var(--fs-small); color: var(--steel); margin: 8px 0 0; }
.msg { min-height: 18px; font-size: var(--fs-small); color: var(--bad); margin: 8px 0 0; }
b.n { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- header (AMS: navy bar, logo, system name, Pricing / Export Sales, user, icon buttons) */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.hdr { height: var(--header-h); flex: none; position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px;
  padding: 0 16px 0 12px; background: var(--navy); color: #fff; }
.hdr .brand { display: flex; align-items: center; gap: 12px; }
.appbar-logo { height: 40px; width: auto; display: block; }
.hdr .sys { font-weight: 600; font-size: var(--fs); white-space: nowrap; }
.groups { display: flex; gap: 8px; margin-left: 12px; }
.gtab { all: unset; box-sizing: border-box; cursor: pointer; padding: 5px 12px; border: 1px solid #fff; border-radius: var(--radius);
  color: #fff; font-weight: 600; font-size: var(--fs); white-space: nowrap; opacity: .9; }
.gtab:hover { opacity: 1; background: var(--accent-dark); color: #fff; border-color: #fff; }   /* text stays white (the general button hover would make it dark blue on dark blue) */
.gtab[aria-current="true"], .gtab[aria-current="true"]:hover { background: #fff; color: var(--navy); border-color: #fff; opacity: 1; }
.gtab:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.hdr .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.hdr .who { line-height: 1.2; text-align: right; color: #fff; }
.hdr .who b { display: block; font-size: var(--fs-small); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr .who span { display: block; font-size: var(--fs-min); }
.top-divider { width: 1px; height: 24px; background: #fff; margin: 0 2px; }
.iconbtn { all: unset; box-sizing: border-box; position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: 1px solid #fff; border-radius: var(--radius); background: transparent; color: #fff; cursor: pointer; }
.iconbtn:hover { background: var(--accent-dark); color: #fff; border-color: #fff; }   /* keep the icon white (button:hover makes it dark blue) */
.iconbtn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.iconbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* ---- menu (AMS: one row of text tabs under the header, the open page blue with a bar underneath) */
/* no sideways scrolling (30 Nov 2026): the tabs sit closer; on a small screen they wrap onto a second row */
.tabsbar { flex: none; position: sticky; top: var(--header-h); z-index: 30; display: flex; flex-wrap: wrap; align-items: stretch; gap: 0 2px;
  padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--rule); box-shadow: 0 1px 3px rgba(31, 41, 51, .06); }
.nav { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 7px; padding: 14px 10px 11px; cursor: pointer; white-space: nowrap;
  color: var(--steel); font-size: var(--fs); font-weight: 500; letter-spacing: .01em; border-bottom: 3px solid transparent; transition: color .15s, border-color .15s; }
.nav:hover { color: var(--ink); border-bottom-color: var(--rule); }
.nav[aria-current="page"] { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.nav:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav .badge { font-size: var(--fs-min); font-weight: 600; color: var(--bad); border: 1px solid var(--bad); padding: 0 5px; border-radius: var(--radius); }

/* ---- page */
.pageWrap { flex: 1; padding: 16px 24px 40px; width: 100%; max-width: 1280px; }
h1.pt { font-size: var(--fs-h1); margin: 0 0 12px; }
.cols { display: grid; gap: 12px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.panel + .panel, .cols > div > .panel + .panel { margin-top: 12px; }
.row { display: grid; gap: 10px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 10px; }
.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sub { font-weight: 600; font-size: var(--fs-h3); margin: 4px 0 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.pattern { font-size: var(--fs-min); font-weight: 400; border: 1px solid var(--rule); border-radius: var(--radius); padding: 3px 7px; color: var(--steel); }
.nb { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--accent); border-radius: var(--radius);
  color: var(--accent); font-size: var(--fs-min); font-weight: 600; margin-right: 6px; }
.bomline { border-top: 1px dashed var(--rule); padding-top: 10px; margin-top: 4px; }
.lines { display: grid; gap: 8px; margin-bottom: 8px; }


/* Undo step by step (SKUs and packaging) */
.undo-bar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin:4px 0 10px; padding:8px 10px; border:1px solid var(--rule); border-radius:var(--radius); background:var(--panel-2, #F6F8FA); }
.undo-bar .undo-list summary { cursor:pointer; color:var(--accent); font-size:13px; }
.undo-bar .undo-list ol { margin:6px 0 0; padding-left:20px; max-height:180px; overflow-y:auto; font-size:13px; }

/* Approvals: one request in detail (27 Nov 2026) */
.req.rq { display: block; padding: 14px 0; border-top: 1px solid var(--rule); }
.req.rq:first-of-type { border-top: 0; }
.rq-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.rq-grid { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel-2, #F6F8FA); }
.rq-k { color: var(--steel, #5B6673); font-size: var(--fs-small); padding-top: 2px; }
.rq-v { min-width: 0; }
.rq-reason { margin: 0 0 10px; }
/* the Head's remark with the answer (27 Nov 2026) */
.rq-note { margin: 6px 0 2px; }
.rq-note input { width: 100%; max-width: 560px; min-height: 0; padding: 6px 10px; font-size: 13px; }
.rq-note.done { font-size: 13px; color: var(--ink); background: var(--ground); border-radius: 6px; padding: 6px 10px; max-width: 560px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 700px) { .rq-grid { grid-template-columns: 1fr; } .rq-k { padding-top: 6px; } }
/* Approvals list: one short row per request, details under it (27 Nov 2026) */
.req.rq { padding: 10px 0; }
.rq-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 230px auto; gap: 12px; align-items: center; }
.rq-cust b { overflow-wrap: anywhere; }
.rq-act { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.rq-more { margin-top: 10px; }
@media (max-width: 900px) { .rq-row { grid-template-columns: 1fr 1fr; } .rq-act { justify-content: flex-start; } }
/* ---- forms (AMS) */
label { display: block; font-size: var(--fs-small); font-weight: 600; color: var(--steel); margin: 0 0 4px; }
input, select, textarea { width: 100%; padding: 6px 8px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface);
  color: var(--ink); line-height: 1.35; min-height: 32px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--accent); }
.price-input { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chk { display: flex; gap: 8px; align-items: center; color: var(--ink); font-weight: 400; font-size: var(--fs); margin: 0; }
.chk input { width: auto; min-height: 0; margin: 0; }
.docs { display: grid; gap: 6px; margin-bottom: 8px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; align-items: end; }
.filters > div { min-width: 160px; }

/* ---- searchable dropdown (AMS pm-combo): white list under the field, code in bold, name in grey */
.pm-combo { position: relative; }
.pm-combo input { padding-right: 34px; }
.pm-combo-toggle { all: unset; position: absolute; right: 3px; top: 3px; bottom: 3px; width: 30px; z-index: 2; display: flex; align-items: center; justify-content: center;
  color: var(--steel); cursor: pointer; border-radius: var(--radius); }
.pm-combo-toggle:hover, .pm-combo.open .pm-combo-toggle { background: var(--accent-tint); color: var(--accent); }
.pm-combo-toggle svg { width: 14px; height: 14px; }
.pm-combo.open .pm-combo-toggle svg { transform: rotate(180deg); }
.pm-combo.open input { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
.pm-combo-menu { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 120; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); overflow: hidden; box-shadow: 0 8px 24px rgba(31, 41, 51, .14); min-width: 260px; }
.pm-combo.open .pm-combo-menu { display: block; }
.pm-combo-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--rule); color: var(--steel); font-size: var(--fs-small); }
.pm-combo-menu-head b { color: var(--ink); font-weight: 600; }
.pm-combo-options { max-height: 300px; overflow: auto; }
button.pm-combo-option { all: unset; box-sizing: border-box; width: 100%; min-height: 36px; padding: 8px 14px; display: flex; align-items: baseline; gap: 14px; cursor: pointer; color: var(--ink); font-size: var(--fs); }
button.pm-combo-option:hover, button.pm-combo-option.active { background: var(--ground); }
button.pm-combo-option[aria-selected="true"] { background: var(--accent-tint); }
.pm-combo-code { flex: none; width: 96px; font-weight: 600; font-size: var(--fs); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-combo-name { flex: 1; min-width: 0; font-size: var(--fs); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-combo-code + .pm-combo-name { color: var(--steel); }
.pm-combo-option:has(.pm-combo-wide) { flex-wrap: wrap; row-gap: 2px; }
.pm-combo-code.pm-combo-wide { width: auto; max-width: none; white-space: normal; }
.pm-combo-wide + .pm-combo-name { flex: 1 1 auto; white-space: normal; }
/* ---- "Draft kept" note, copied from the AMS (status.css) */
.pm-availability { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; margin: 8px 0; border: 1px solid var(--rule); border-radius: var(--radius);
  font-size: var(--fs-small); line-height: 1.45; background: var(--surface); color: var(--ink); }
.pm-availability.checking { background: var(--warn-tint); }
.pm-status-dot { width: 8px; height: 8px; margin-top: 4px; flex: none; border-radius: 50%; background: var(--steel); }
.pm-availability.checking .pm-status-dot { background: var(--warn); }
/* ---- Code and BOM form, copied from the AMS BOM Generator (forms.css, overlays.css, bom.css, buttons.css) */
.pm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.pm-field { min-width: 0; }
.pm-field.full { grid-column: 1 / -1; }
.pm-field > label { display: flex; align-items: center; gap: 6px; }
.pm-help { font-size: var(--fs-min); color: var(--steel); margin-top: 3px; line-height: 1.4; }
.pm-help:empty { display: none; }
.pm-help.bad { color: var(--bad); }
.tiny { font-size: var(--fs-min); color: var(--steel); font-weight: 400; }
.bom-sub { border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px; margin-top: 8px; background: var(--surface); }
.bom-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 30px; gap: 8px; align-items: center; margin-bottom: 6px; }
.bom-row-label { font-size: var(--fs-small); font-weight: 600; color: var(--steel); }
.bom-add { margin-top: 2px; }
.pm-icon-small { all: unset; box-sizing: border-box; position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); color: var(--accent); cursor: pointer; }
.pm-icon-small:hover { background: var(--ground); border-color: var(--accent); }
.pm-combo.ams .pm-combo-menu-head { padding: 6px 10px; font-size: var(--fs-min); }
.pm-combo.ams .pm-combo-options { max-height: 240px; }
.pm-combo.ams button.pm-combo-option { display: grid; grid-template-columns: minmax(70px, auto) 1fr auto; align-items: center; gap: 10px; padding: 6px 10px; min-height: 0; }
.pm-combo.ams .pm-combo-code { width: auto; font-size: var(--fs-small); }
.pm-combo.ams .pm-combo-name { font-size: var(--fs-small); color: var(--steel); }
.pm-combo.ams .pm-combo-check { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
.pm-combo.ams .pm-combo-add .pm-combo-code { color: var(--accent); font-weight: 700; }
@media (max-width: 560px) { .pm-grid { grid-template-columns: 1fr; } .pm-field.full { grid-column: auto; } .bom-row { grid-template-columns: 1fr 30px; } .bom-row .bom-row-label { grid-column: 1 / -1; } }
.pm-combo-empty { padding: 14px 12px; color: var(--steel); font-size: var(--fs-small); text-align: center; }


/* SKU and quantity, one line per SKU with its loading quantity (30 Nov 2026) */
.sku-line { margin-bottom: 8px; }
/* the same columns on every line (SKU | qty | unit | × | loading), so the lines stand straight under each other */
#skuRows { container-type: inline-size; }
.sku-line-main { display: grid; grid-template-columns: minmax(0, 1fr) 72px 118px 28px 168px; gap: 6px; align-items: center; }
.sku-line-sku { min-width: 0; }
.sku-line-main > input.num, .sku-line-main > select { width: 100%; }
.sku-rm-gap { width: 28px; }
.sku-load { font-size: var(--fs-small); font-weight: 600; color: var(--steel); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@container (max-width: 560px) { .sku-line-main { grid-template-columns: minmax(0, 1fr) 72px 112px 28px; } .sku-load { grid-column: 1 / -1; } }

/* new buyer's emails, one box each (30 Nov 2026) */
.ce-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.ce-row .ce-in { flex: 1; min-width: 0; }

/* freight from the freight table, locked for salespeople (27 Nov 2026) */
input.ro-locked { background: var(--ground); color: var(--ink); cursor: not-allowed; }
/* ---- buttons (AMS: primary = solid Able blue, others = blue outline, 2px corners) */
button, a.button { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; padding: 5px 12px;
  border: 1px solid var(--accent); border-radius: var(--radius); background: transparent; color: var(--accent);
  font-weight: 600; line-height: 1.2; cursor: pointer; white-space: nowrap; text-decoration: none; }
button:hover, a.button:hover { background: var(--ground); color: var(--accent-dark); border-color: var(--accent-dark); }
a.button.small { min-height: 26px; padding: 3px 9px; font-size: var(--fs-small); }   /* a link that looks like a button (opens another site) */
button.primary { background: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
button.small { min-height: 26px; padding: 3px 9px; font-size: var(--fs-small); }
button.ghost { border-style: dashed; color: var(--steel); border-color: var(--steel); }
button:disabled { background: var(--ground); color: var(--steel); border-color: var(--rule); cursor: not-allowed; }
input:disabled, select:disabled, textarea:disabled { background: var(--ground); color: var(--steel); cursor: not-allowed; }   /* locked / set by the Admin: clearly grey */
.xbtn { all: unset; cursor: pointer; padding: 0 2px; color: inherit; font-size: 14px; line-height: 1; }
.save-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* ---- tables (AMS: navy header row, white labels, numbers right-aligned) */
.scroll { overflow: auto; background: var(--surface); }
/* a panel that just opened (e.g. the quotation preview after Save): fades and rises in; the page glides to it */
@keyframes reveal-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.reveal { animation: reveal-in .45s cubic-bezier(.2, .7, .2, 1) both; scroll-margin-top: 96px; }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }
/* SKUs and packaging: a wide table in its own box, so its left-right scroll bar is always in view; Lock + SKU stay on the left */
.grid-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.sku-grid { border: 1px solid var(--rule); }   /* no scroll box of its own: the SKU list has pages (Previous / Next) */
.sku-grid th:nth-child(1), .sku-grid td:nth-child(1) { position: sticky; left: 0; width: 56px; min-width: 56px; max-width: 56px; }
.sku-grid th:nth-child(2), .sku-grid td:nth-child(2) { position: sticky; left: 56px; box-shadow: 2px 0 0 var(--rule); }
.sku-grid td:nth-child(1), .sku-grid td:nth-child(2) { background: var(--surface); z-index: 1; }
.sku-grid th:nth-child(1), .sku-grid th:nth-child(2) { z-index: 3; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
th { position: sticky; top: 0; z-index: 1; background: var(--navy); color: #fff; text-align: left; font-weight: 600; font-size: var(--fs-small);
  padding: 7px 10px; border-bottom: 1px solid var(--navy); white-space: nowrap; }
td { padding: 7px 10px; border-bottom: 1px solid var(--rule); color: var(--ink); vertical-align: top; }
tbody tr:hover td { background: var(--ground); }
td.r, th.r { text-align: right; }
td input, td select { min-height: 28px; padding: 4px 6px; }

/* ---- status labels (AMS: square, outlined in the signal colour) */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border: 1px solid currentColor; border-radius: var(--radius);
  font-size: var(--fs-min); font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--info-tint); color: var(--info); }
.chip.ok { background: var(--ok-tint); color: var(--ok); }
.chip.warn { background: var(--warn-tint); color: var(--warn); }
.chip.bad { background: var(--bad-tint); color: var(--bad); }

/* ---- message blocks */
.banner { background: var(--warn-tint); color: var(--ink); border: 1px solid var(--warn); border-radius: var(--radius); padding: 8px 10px; font-size: var(--fs-small); margin-bottom: 12px; }
.alert { background: var(--bad-tint); color: var(--ink); border: 1px solid var(--bad); border-radius: var(--radius); padding: 8px 10px; font-size: var(--fs-small); margin-bottom: 12px; }
.check { border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; margin: 4px 0 12px; background: var(--info-tint); }
.check.ok { background: var(--ok-tint); border-color: var(--ok); }
.check.warn { background: var(--warn-tint); border-color: var(--warn); }
.check.bad { background: var(--bad-tint); border-color: var(--bad); }
.check .headline { font-weight: 600; margin-bottom: 2px; }
.check .detail { font-size: var(--fs-small); color: var(--ink); }
.check .actions { margin-top: 10px; display: grid; gap: 8px; }
.totals { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 10px 0; border-top: 1px solid var(--rule); font-size: var(--fs); }
.doc { white-space: pre-wrap; background: var(--ground); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px; font-size: var(--fs); margin: 0 0 12px; overflow-x: auto; font-family: var(--font); }

/* ---- KPI tiles (AMS: label above the figure) */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.kpi .v { font-size: 22px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: var(--fs-small); color: var(--steel); margin-bottom: 4px; }

/* ---- lists: confirmations, requests, SO stages, orders */
.deal { padding: 10px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 2px; }
.deal:last-child { border-bottom: 0; }
.deal .l1 { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.deal .t, .l2 { font-size: var(--fs-small); color: var(--steel); }
.deal .l3 { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: var(--fs); }
.req { padding: 12px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 6px; }
.req:last-child { border-bottom: 0; }
.req .btns { display: flex; gap: 8px; }
.stage { padding: 12px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 8px; }
.stage:last-child { border-bottom: 0; }
.stage .sh { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* a shipment of an SO (30 Nov 2026): a card with a blue edge */
.stage.ship-card { border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.stage.ship-card .row { margin-bottom: 0; }
.orderBtn { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; border-bottom: 1px solid var(--rule); padding: 10px 8px; color: var(--ink); }
.orderBtn:hover { background: var(--ground); }
.orderBtn[aria-current="true"] { background: var(--accent-tint); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
#reqBox { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
.barcell { width: 38%; min-width: 90px; }
.bar { height: 10px; border-radius: var(--radius); background: var(--accent); }
.chart text { fill: var(--steel); font-size: 11px; font-family: var(--font); }
/* freshness board (Cost Configuration) */
details.fb > summary { cursor: pointer; display: flex; align-items: center; gap: 10px; list-style: none; font-size: var(--fs-h3); }
details.fb > summary::-webkit-details-marker { display: none; }
details.fb > summary::before { content: "▸"; color: var(--steel); }
details.fb[open] > summary::before { content: "▾"; }
details.fb > summary { flex-wrap: wrap; }
.fb-sum { font-size: var(--fs-small); font-weight: 600; }
.fb-sum.bad { color: var(--bad); }
.fb-sum.warn { color: var(--warn); }
details.fb[open] .fb-sum { display: none; }
.fb-hint { margin-left: auto; font-size: var(--fs-small); color: var(--steel); text-decoration: underline; }
.fb-list { margin-top: 10px; display: grid; }
.fb-row { display: grid; grid-template-columns: 74px minmax(170px, 230px) 1fr minmax(130px, 210px) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule); }
.fb-name { display: flex; flex-direction: column; }
.fb-name span { font-size: var(--fs-small); color: var(--steel); }
.fb-row.red .fb-name span { color: var(--bad); font-weight: 600; }
.fb-row.orange .fb-name span { color: var(--warn); font-weight: 600; }
.fb-detail, .fb-when { font-size: var(--fs-small); color: var(--steel); }
.fb-pill { display: inline-block; text-align: center; padding: 2px 6px; border-radius: 10px; font-size: var(--fs-min); font-weight: 600; white-space: nowrap; }
.fb-pill.ok { background: var(--ok-tint); color: var(--ok); }
.fb-pill.warn { background: var(--warn-tint); color: var(--warn); }
.fb-pill.bad { background: var(--bad-tint); color: var(--bad); }
@media (max-width: 900px) { .fb-row { grid-template-columns: 74px 1fr auto; } .fb-detail, .fb-when { grid-column: 2 / -1; } }
/* Forex: rate used in costing */
.fx-status { display: grid; gap: 4px; padding: 10px 12px; border-left: 3px solid var(--ok); background: var(--ground); border-radius: var(--radius); }
.fx-status.manual { border-left-color: var(--warn); background: var(--warn-tint); }
.fx-status .chip { justify-self: start; }
.fx-form { margin-top: 12px; }

/* Today's suggested rate (27 Nov 2026): Bank Negara, buffer − / +, suggested rate, Confirm */
.fx-confirm { margin-top: 12px; padding: 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel-2, #F6F8FA); }
.fx-confirm.fx-warn { border-color: var(--warn, #B54708); background: #FFF7ED; }
table.fx-sug { width: 100%; }
table.fx-sug td, table.fx-sug th { vertical-align: middle; }
.fx-buf { display: inline-flex; align-items: center; gap: 4px; }
.fx-buf input { width: 64px; text-align: right; min-height: 0; padding: 4px 6px; }
.fx-buf button { min-width: 30px; font-weight: 700; }

/* ---- tidy bottom of the Forex page (30 Nov 2026, "make it clean"): sources in two columns across the page */
.fx-src { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fx-src-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius); }
@media (max-width: 760px) { .fx-src { grid-template-columns: minmax(0, 1fr); } }

/* forward rate sources in Admin Settings (30 Nov 2026) */
.fwd-src { padding: 10px 0; border-top: 1px solid var(--rule); }
.fwd-src:first-of-type { border-top: 0; }
/* sales dashboard */
.dash-kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi.dk { flex-direction: column; justify-content: flex-start; gap: 2px; }
.kpi.dk .l { margin: 0; }
.kpi .ks { font-size: var(--fs-small); color: var(--steel); }
.kpi .kd { font-size: var(--fs-small); color: var(--steel); margin-top: 4px; }
.kpi .kd .up { color: var(--ok); font-weight: 600; }
.kpi .kd .dn { color: var(--bad); font-weight: 600; }
.panel.attn { margin-bottom: 16px; }
.attn-list { list-style: none; margin: 0; padding: 0; }
.attn-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.attn-list li:last-child { border-bottom: 0; }
.attn-list li span:nth-child(2) { flex: 1; }
.attn-n { min-width: 28px; height: 24px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--warn-tint); color: var(--warn); font-weight: 600; font-variant-numeric: tabular-nums; }
.dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dash-head h2 { margin: 0; }
.chart .hit { cursor: crosshair; }
.chart .hit:hover { fill: var(--steel); fill-opacity: .07; }
.sb-figs { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 4px 0 12px; }
.sb-figs div { display: flex; flex-direction: column; }
.sb-figs span { font-size: var(--fs-small); color: var(--steel); }
.sb-figs b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sb-box { width: 100%; overflow: hidden; }
.hb { display: grid; gap: 8px; }
.hb-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 10px; }
.hb-label { font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 10px; background: var(--ground); border-radius: 0 4px 4px 0; }
.hb-bar { height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; }
.hb-bar.other { background: var(--steel); opacity: .55; }
.hb-val { font-size: var(--fs-small); text-align: right; white-space: nowrap; }
.hb-val span { display: block; color: var(--steel); font-size: var(--fs-min); }
.hb-row:hover .hb-bar { filter: brightness(1.12); }
.pd-bar { display: flex; gap: 2px; height: 18px; border-radius: 4px; overflow: hidden; background: var(--surface); }
.pd-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: var(--fs-small); color: var(--steel); }
.pd-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.pd-legend b { color: var(--ink); margin-left: 4px; }
.viz-tip { position: fixed; z-index: 300; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(31, 41, 51, .15); padding: 6px 10px; font-size: var(--fs-small); max-width: 320px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .hb-row { grid-template-columns: 1fr auto; } .hb-track { grid-column: 1 / -1; grid-row: 2; } }

/* ---- My Dashboard: the month's target (30 Nov 2026) */
.tg .tg-row { margin: 0 0 12px; max-width: 720px; }
.tg .tg-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.tg .tg-p { font-weight: 600; font-variant-numeric: tabular-nums; }
.tg .tg-p.ok { color: var(--ok); }
.tg .tg-track { height: 12px; background: var(--ground); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.tg .tg-bar { height: 100%; background: var(--accent); }
.tg .tg-bar.ok { background: var(--ok); }
.tg .tg-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 6px; }
.tg .tg-form input { width: 170px; }

/* ---- tidy dashboard layout (30 Nov 2026, "make it clean"): the two panels side by side are the same width, start on the
   same line and end on the same line; every bar in a panel has the same length (the figures get a fixed column) */
.dash-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; margin-top: 16px; }
.dash-cols > .panel { margin-top: 0; }
#dashBody > .panel { margin-top: 16px; }
.hb-row { grid-template-columns: minmax(90px, 32%) 1fr 118px; padding: 2px 0; }
.hb-val { line-height: 1.25; }
@media (max-width: 980px) { .dash-cols { grid-template-columns: minmax(0, 1fr); } .dash-cols > .panel + .panel { margin-top: 0; } }
@media (max-width: 560px) { .hb-row { grid-template-columns: 1fr auto; } }
/* list view (Quotation List, Trade Confirmations) */
.lv-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.lv-n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--ground); color: var(--ink); font-size: var(--fs-min); font-variant-numeric: tabular-nums; }
button.primary .lv-n { background: rgba(255, 255, 255, .25); color: #fff; }
table.lv tr.lv-row { cursor: pointer; }
table.lv tr.lv-row:hover td, table.lv tr.lv-row.open td { background: var(--accent-tint); }
table.lv tr.lv-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
table.lv tr.lv-detail > td { background: var(--ground); padding: 12px 14px; }
table.lv td { white-space: normal; }
.lv-sort { all: unset; cursor: pointer; font-weight: 600; color: inherit; }
.lv-sort:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lv-totals { margin: 10px 0 0; font-size: var(--fs-small); color: var(--steel); font-variant-numeric: tabular-nums; }
.lv-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; font-size: var(--fs-small); color: var(--steel); }
.lv-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lv-inline:not(:empty) { margin-top: 12px; }
tr.lv-detail > td { background: var(--ground); padding: 12px 14px; }
.inline-panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px; }
.inline-panel h2 { font-size: var(--fs-h3); margin: 0 0 8px; }
.ip-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 10px; }
.ip-head button { margin-left: auto; }
.cost-grid { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 16px; align-items: start; }
.cost-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cf { background: var(--ground); border-radius: var(--radius); padding: 7px 9px; display: flex; flex-direction: column; }
.cf span { font-size: var(--fs-min); color: var(--steel); }
.cf b { font-size: 14px; font-variant-numeric: tabular-nums; }
.cf em { font-style: normal; font-size: var(--fs-min); color: var(--steel); }
.cf:first-child { grid-column: 1 / -1; background: var(--accent-tint); }
.cf:first-child b { font-size: 18px; }
.cost-table table td, .cost-table table th { padding-top: 4px; padding-bottom: 4px; }
@media (max-width: 760px) { .cost-grid { grid-template-columns: 1fr; } }
/* price trend chart (Overview, Oil prices) */
.trend-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; margin-bottom: 10px; }
.trend-figs { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.trend-figs div { display: flex; flex-direction: column; }
.trend-figs span { font-size: var(--fs-small); color: var(--steel); }
.trend-figs b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.trend-range { display: flex; gap: 4px; }
.trend-box { position: relative; touch-action: pan-y; }
.trend-hit { cursor: crosshair; }
.trend-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 2px 8px rgba(31, 41, 51, .15);
  padding: 6px 10px; font-size: var(--fs-small); white-space: nowrap; font-variant-numeric: tabular-nums; z-index: 5; }
.trend-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 6px; font-size: var(--fs-small); color: var(--steel); }
.trend-legend i { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 6px; }
.trend-legend i.dash { background: repeating-linear-gradient(90deg, var(--warn) 0 5px, transparent 5px 9px); height: 2px; }

/* ---- toast (AMS: bottom right) */
.toast { position: fixed; right: 16px; bottom: 16px; z-index: 250; min-width: 240px; max-width: 380px; padding: 9px 12px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: var(--radius); font-size: var(--fs-small); box-shadow: 0 8px 24px rgba(31, 41, 51, .18); }

/* ---- dialog (AMS modal) */
.overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto; background: rgba(31, 41, 51, .55); }
.dialog { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; }
.dialog .row { grid-template-columns: minmax(0, 1fr); }

/* ---- sign-in (AMS: full navy page, white card with the logo) */
.login-screen { min-height: 100vh; display: flex; flex-direction: column; background: var(--navy); }
.login-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); background: #fff; border-radius: var(--radius); padding: 34px 40px 30px; box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }
.login-brand { text-align: center; margin: 0 0 22px; }
.login-logo { height: 70px; width: auto; display: block; margin: 0 auto; }
.login-app { margin-top: 12px; font-size: 15px; color: var(--steel); letter-spacing: .01em; }
.login-card label { margin: 12px 0 6px; font-size: var(--fs); font-weight: 500; color: var(--ink); }
.login-card input { padding: 10px 12px; font-size: 15px; }
.login-card button.primary { width: 100%; margin-top: 22px; padding: 12px; font-size: 16px; background: var(--navy); border-color: var(--navy); }
.login-card button.primary:hover { filter: brightness(1.15); }
.login-secure { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 16px 0 0; color: var(--steel); font-size: var(--fs-small); }
.secure-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.login-foot { padding: 12px 16px; font-size: var(--fs-min); color: rgba(255, 255, 255, .75); text-align: center; }

/* ---- smaller screens */
@media (max-width: 980px) { .cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .hdr .sys, .hdr .who, .top-divider { display: none; }
  .tabsbar { padding: 0 8px; }
  .pageWrap { padding: 12px 16px 32px; }
}
@media (max-width: 560px) { .row, .row.three, #reqBox { grid-template-columns: minmax(0, 1fr); } .groups { margin-left: 0; } }

/* ---- Costing Check (Daily Costing Checker report in the OPMS look) */
table.dcc-t { font-size: var(--fs-small); width: 100%; }
table.dcc-t th, table.dcc-t td { white-space: nowrap; vertical-align: top; padding: 8px 6px; }
table.dcc-t td:nth-child(4), table.dcc-t td:nth-child(5) { white-space: normal; min-width: 70px; }   /* product, period: two lines if needed */
table.dcc-t th { white-space: normal; line-height: 1.25; }   /* headings may take two lines */
table.dcc-t tr.dcc-warn > td { background: var(--bad-50); }
table.dcc-t td .l2 { white-space: nowrap; }
/* long text wraps, so the table fits the screen without scrolling sideways: customer, profit notes, destination */
table.dcc-t td:nth-child(3), table.dcc-t td:nth-child(14), table.dcc-t td:nth-child(15) { white-space: normal; min-width: 110px; }
table.dcc-t td:nth-child(14) { min-width: 130px; }
table.dcc-t td:nth-child(3) { min-width: 100px; }
table.dcc-t td:nth-child(3) .l2, table.dcc-t td:nth-child(14) .l2, table.dcc-t td:nth-child(15) .l2 { white-space: normal; }
/* Full screen: the contract table over the whole window (Esc or the button closes it) */
section.dcc-fs { position: fixed; inset: 0; z-index: 1000; margin: 0 !important; border-radius: 0; overflow: auto; max-width: none; }
section.dcc-fs .scroll { max-height: none; }
body.dcc-fs-open { overflow: hidden; }
/* Search and filters above the contract table */
.dcc-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.dcc-tools .dcc-q { flex: 1 1 280px; max-width: 420px; }
.dcc-tools select { width: auto; }
/* ---- Settings menu on the right of the tab bar (as in the AMS) */
.tabsbar .navsp { flex: 1 1 auto; }
.nav.setbtn { gap: 6px; }
.nav.setbtn svg { display: block; }
.setmenu { position: fixed; z-index: 60; min-width: 220px; padding: 4px 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(31, 41, 51, .14); }
.setmenu button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 10px 18px; cursor: pointer; color: var(--ink); font-size: var(--fs); }
.setmenu button:hover, .setmenu button:focus-visible { background: var(--ground); }
.setmenu button[aria-current="page"] { color: var(--accent); background: var(--accent-tint); font-weight: 600; }
/* User Manual (as in the AMS): chapter list on the left, one chapter on the right; print = the whole manual. */
.man-wrap { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 20px; align-items: start; }
.man-side { position: sticky; top: calc(var(--header-h) + 64px); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - var(--header-h) - 90px); overflow: auto; }
.man-books { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.man-books button { all: unset; box-sizing: border-box; text-align: center; padding: 6px 8px; border: 1px solid var(--rule); border-radius: var(--radius);
  cursor: pointer; font-size: var(--fs-small); color: var(--steel); }
.man-books button:hover { color: var(--ink); border-color: var(--steel); }
.man-books button.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.man-title { font-size: 17px; font-weight: 700; color: var(--ink); padding: 2px 2px 0; }
.man-search input { width: 100%; }
.man-toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.man-toc a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); color: var(--ink); text-decoration: none;
  border-left: 3px solid transparent; line-height: 1.3; }
.man-toc a:hover { background: var(--ground); }
.man-toc a.active { background: var(--accent-tint); border-left-color: var(--accent); color: var(--accent); font-weight: 600; }
.man-n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--ground); color: var(--steel); }
.man-toc a.active .man-n { background: var(--accent); color: #fff; }
.man-print { justify-content: center; width: 100%; }
.man-main { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 28px 34px 24px; min-width: 0; }
.man-head { border-bottom: 1px solid var(--rule); padding-bottom: 14px; margin-bottom: 18px; }
.man-kicker { font-size: var(--fs-min); text-transform: uppercase; letter-spacing: .08em; color: var(--steel); font-weight: 600; }
.man-head h2 { margin: 4px 0 8px; font-size: 24px; color: var(--ink); }
.man-purpose { margin: 0; color: var(--steel); font-size: 15px; }
.man-purpose b { color: var(--ink); }
.man-flow { display: flex; align-items: stretch; gap: 8px; margin: 0 0 22px; flex-wrap: wrap; }
.man-flow-step { flex: 1 1 150px; background: var(--accent-tint); border: 1px solid #B9D5E8; border-radius: var(--radius); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 3px; }
.man-flow-step b { color: var(--accent); }
.man-flow-step span { font-size: var(--fs-small); color: var(--steel); }
.man-flow-arrow { align-self: center; color: var(--accent); font-size: 20px; font-weight: 700; }
.man-step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; margin: 0 0 26px; }
.man-step-n { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 15px; }
.man-step-body p { margin: 6px 0 12px; font-size: 15px; line-height: 1.6; color: var(--ink); }
.man-shot { display: block; max-width: 100%; height: auto; border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 2px 10px rgba(31, 41, 51, .10); cursor: zoom-in; }
.man-box { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-radius: var(--radius); margin: 4px 0 16px; line-height: 1.55; }
.man-box.tip { background: #eef6ff; border-left: 4px solid var(--accent); }
.man-box.warn { background: #fff6e5; border-left: 4px solid #c58a12; }
.man-faq dt { font-weight: 700; color: var(--ink); margin-top: 14px; }
.man-faq dd { margin: 4px 0 0; color: var(--steel); line-height: 1.55; }
.man-pager { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--rule); padding-top: 16px; margin-top: 8px; }
#manPrintArea { display: none; }
@media (max-width: 900px) { .man-wrap { grid-template-columns: 1fr; } .man-side { position: static; max-height: none; } .man-main { padding: 18px; } }
/* print: only the manual (cover, then every chapter on a new page) */
@media print {
  body.man-printing > *:not(#manPrintArea) { display: none !important; }
  body.man-printing #manPrintArea { display: block; }
  body.man-printing { background: #fff; }
  .man-cover { text-align: center; padding-top: 30vh; page-break-after: always; }
  .man-cover img { height: 60px; }
  .man-cover h1 { font-size: 32px; margin: 24px 0 8px; }
  .man-print-ch { page-break-before: auto; break-inside: auto; margin-bottom: 24px; }
  .man-print-ch + .man-print-ch { page-break-before: always; }
  .man-step { break-inside: avoid; }
  .man-shot { box-shadow: none; max-height: 18cm; width: auto; }
}
/* ---- Freight table (27 Nov 2026): the lowest shipping line's rate in green (book it first), the shipping lines bar */
input.fr-low, .fr-low { background: #E7F6EC !important; border-color: #12B76A !important; color: #05603A; font-weight: 600; }
.fr-liners { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.fr-liners .chip { display: inline-flex; align-items: center; gap: 4px; }
button.linkish { background: none; border: 0; padding: 0 2px; min-height: 0; color: inherit; cursor: pointer; font-weight: 700; }
button.linkish:hover { color: var(--bad); }/* Rate used: the Head's choice (default = the Business rule) above the rate it gives; a row set by hand is marked orange (27 Nov 2026) */
.fr-used { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }   /* list and rate side by side */
.fr-used select.fr-pick { width: 126px; min-height: 0; padding: 4px 6px; font-size: var(--fs-small); }
.fr-used select.fr-pick-x { border-color: var(--warn, #B54708); background: #FFF7ED; color: #7A2E0E; font-weight: 600; }
/* the freight table fits the screen: long headings on two lines, tighter cells (27 Nov 2026) */
#fBody table th { white-space: normal; line-height: 1.2; }
#fBody table th, #fBody table td { padding-left: 6px; padding-right: 6px; }
/* ---- The choice of portals after signing in and the "Coming soon" pages (27 Nov 2026), as the AMS portal page:
        the logo on the navy page, "Welcome, name" and "Choose a portal", white cards side by side, Sign out under them */
.portal-screen { position: fixed; inset: 0; z-index: 900; overflow: auto; display: flex; flex-direction: column; background: var(--navy); color: #fff; }
.portal-screen[hidden] { display: none; }
/* sizes follow the window height (clamp + vh), so the whole page fits without scrolling, also with browser zoom or Windows scaling */
.pt-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(14px, 4vh, 48px) 16px clamp(10px, 2vh, 24px); }
.pt-logo { height: clamp(46px, 9vh, 84px); width: auto; display: block; margin: 0 0 clamp(10px, 3vh, 30px); }
.pt-h1 { font-size: clamp(22px, 4.2vh, 34px); font-weight: 700; margin: 0 0 4px; color: #fff; text-align: center; line-height: 1.2; }
.pt-sub { font-size: clamp(14px, 2.2vh, 18px); margin: 0 0 clamp(14px, 3.5vh, 34px); color: rgba(255, 255, 255, .85); text-align: center; }
.pt-cards { width: min(1180px, 100%); display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: clamp(14px, 2.5vw, 30px); }
.pt-cards.one { width: min(560px, 100%); grid-template-columns: 1fr; }
.pt-card { background: #fff; color: var(--ink); border: 2px solid transparent; padding: clamp(18px, 4vh, 44px) 24px clamp(16px, 3.5vh, 36px); text-align: center; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); display: flex; flex-direction: column; align-items: center; }
.pt-card:hover, .pt-card:focus-within { border-color: #2F6FD0; }
.pt-ico { color: var(--navy); margin: 0 0 clamp(8px, 2vh, 22px); }
.pt-ico svg { width: clamp(38px, 6.5vh, 60px); height: clamp(38px, 6.5vh, 60px); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; }
.pt-card h2 { font-size: clamp(18px, 3vh, 24px); font-weight: 600; color: var(--navy); margin: 0 0 clamp(4px, 1.2vh, 12px); }
.pt-card p { font-size: clamp(13px, 1.9vh, 16px); color: var(--steel); margin: 0 0 clamp(12px, 2.8vh, 26px); flex: 1; }
.pt-open, .pt-soon { padding: clamp(8px, 1.4vh, 12px) 36px; font-size: clamp(14px, 1.9vh, 16px); font-weight: 600; border-radius: 3px; cursor: pointer; }
.pt-open { background: var(--navy); color: #fff; border: 1px solid var(--navy); }
.pt-open:hover { filter: brightness(1.2); }
.pt-soon { background: #fff; color: var(--steel); border: 1px solid var(--rule); }
.pt-out { display: inline-flex; align-items: center; gap: 10px; margin: clamp(14px, 4vh, 42px) 0 0; padding: clamp(8px, 1.4vh, 12px) 30px; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .8); border-radius: 3px; font-size: clamp(14px, 1.9vh, 16px); font-weight: 600; cursor: pointer; }
.pt-out:hover { background: rgba(255, 255, 255, .1); }
.pt-out svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.portal-screen .login-foot { padding: 8px 16px; }
@media (max-width: 640px) { .pt-cards { grid-template-columns: 1fr; } }/* the switch in the dark top bar of Export Sales: white text, always readable */
.portal-btn { margin-right: 10px; border-radius: 6px; padding: 6px 12px; font-weight: 600; cursor: pointer; }
.hdr button.portal-btn, button#portalBtn { background: rgba(255, 255, 255, .14) !important; color: #fff !important; border: 1px solid rgba(255, 255, 255, .7) !important; opacity: 1 !important; }
.hdr button.portal-btn:hover, button#portalBtn:hover, button#portalBtn:focus-visible { background: rgba(255, 255, 255, .26) !important; color: #fff !important; }
/* ---- 20ft / 40ft tabs at the top of SKUs and packaging (27 Nov 2026) */
.sku-tabs { display: flex; gap: 0; margin: 0 0 14px; border-bottom: 2px solid var(--rule); }
.sku-tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; margin-bottom: -2px; padding: 8px 16px; font-weight: 600; color: var(--steel); }
.sku-tabs button.primary { background: transparent; color: var(--accent); border-bottom-color: var(--accent); }
.sku-tabs button:hover { color: var(--ink); }
/* ---- Oil Position (27 Nov 2026): the same layout as the OPMS screens (navy bar, menu bar, white panels) */
#oilShell .neg, #oilShell .l2.neg { color: var(--bad); }
#oilShell .pos { color: var(--ok); }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btnrow .msg { margin: 0; }
.msg.ok { color: var(--ok); }
.op-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.op-stat { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; }
.op-stat .k, .op-stat .n { color: var(--steel); font-size: 13px; }
.op-stat .v { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 2px 0; }
.op-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.op-form .span2 { grid-column: span 2; }
@media (max-width: 900px) { .op-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .op-form { grid-template-columns: minmax(0, 1fr); } .op-form .span2 { grid-column: auto; } }
.op-stock { margin: 0 0 12px; padding: 9px 12px; background: var(--accent-tint, #E6F0F7); border-radius: var(--radius); font-size: 14px; }
.op-stock.bad { background: #FDF0EE; color: var(--bad); }
textarea.op-wa { font-family: inherit; background: var(--ground); }
#opPaste { width: 100%; font-family: inherit; }
.op-found { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.op-chk { display: flex; gap: 8px; align-items: center; font-weight: normal; margin: 0 0 20px; }
.op-chk input { width: auto; min-height: 0; }
.op-ctrl { display: flex; flex-wrap: wrap; gap: 18px; align-items: end; margin-bottom: 14px; }
.op-ctrl input[type=month] { width: auto; }
.op-split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .op-split { grid-template-columns: minmax(0, 1fr); } }
.op-split td input.op-in { width: 110px; min-height: 0; padding: 4px 8px; text-align: right; }
tr.op-shut td { background: var(--warn-bg, #FFF6D6); }
tr.op-wkend td { background: var(--ground); color: var(--steel); }
tr.op-sel td { background: var(--accent-tint, #E6F0F7); }
.op-dl { margin: 0; font-size: 14px; }
.op-dl div { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--rule); }
.op-dl dd { margin: 0; font-variant-numeric: tabular-nums; }
.op-chart text { fill: var(--steel); font: 11px "IBM Plex Sans", system-ui, sans-serif; }
.op-chart .ln { stroke: var(--accent); fill: none; stroke-width: 2; }
.op-chart .gr { stroke: var(--rule); }
.op-chart .dot { fill: var(--accent); }

/* the Download box next to the month (30 Nov 2026) */
.op-dl-box label { display: block; }
.op-dl-box select { min-height: 0; padding: 6px 10px; }
/* ---- the bell at the top (30 Nov 2026, like the AMS) */
.nt-bell { position: relative; }
.nt-badge { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #D92D20; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--navy, #0B3D66); }
.nt-pop { position: fixed; z-index: 1000; width: 380px; max-width: calc(100vw - 16px); max-height: min(70vh, 560px); display: flex; flex-direction: column;
  background: var(--surface, #fff); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius, 6px); box-shadow: 0 12px 32px rgba(16, 24, 40, .18); }
.nt-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.nt-head .small { min-height: 0; padding: 3px 10px; }
.nt-list { overflow-y: auto; }
.nt-item { display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0;
  background: transparent; color: var(--ink); cursor: pointer; font: inherit; min-height: 0; }
.nt-item:hover { background: var(--ground); }
.nt-item.unread { background: var(--accent-tint, #E6F0F7); }
.nt-item.unread:hover { filter: brightness(.98); }
.nt-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; background: var(--accent); }
.nt-dot.red { background: #D92D20; } .nt-dot.orange { background: #F79009; } .nt-dot.blue { background: var(--accent); }
.nt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nt-body b { font-size: 14px; font-weight: 600; }
.nt-msg { font-size: 13px; color: var(--steel); overflow-wrap: anywhere; }
.nt-body time { font-size: 12px; color: var(--steel); }
.nt-empty { margin: 0; padding: 20px 14px; color: var(--steel); }
/* long messages wrap (buttons do not wrap text by default, which made the list scroll sideways) */
.nt-list { overflow-x: hidden; }
.nt-item { white-space: normal; height: auto; align-items: flex-start; }
.nt-body { flex: 1; }
.nt-body b, .nt-msg { white-space: normal; overflow-wrap: anywhere; }
