/* OMS redesign — factory Freight page + shipment workspace.
 *
 * Loaded on factory-new.html only, right after oms-rd-factory.css. Drawn by
 * /js/oms-rdf-freight.js:
 *   #rdf-freight        the Freight page (inside #page-freight)
 *   #rdf-sw-overlay     the shipment workspace (full-window, appended to <body>)
 *   #rdf-rowmenu        a list row's "…" menu (fixed popover)
 * These are the admin's Part 8 rules (oms-rd-admin.css + admin's tail <style>
 * for .vw-overlay/.vw-shell), which the factory does not load, re-scoped by id
 * so they beat the inline <style> and oms-mobile.css (loaded later) without
 * !important. Base components (.btn, .card, .tbl, .pill, .seg, .wtabs,
 * .col-card, .stages, .menu, .tlb, .kvl, .tl, .att …) come from oms-rd.css.
 * Also: the two legacy freight popups (#po-shipment-split-modal and the now
 * unused #shipment-add-modal) restyled to the redesign's dialog look.
 * No remote assets.
 */

/* ======================================================================
   1. FREIGHT PAGE
   ====================================================================== */
#rdf-freight.rd { display: flex; flex-direction: column; gap: 16px; font-size: 14px; }
#rdf-freight .ph { align-items: flex-end; flex-wrap: wrap; }
#rdf-freight .ph h1 { color: var(--ink); }
#rdf-freight .ph p { margin-top: 4px; max-width: 720px; }
#rdf-freight .rdf-h1-en { font-weight: 600; color: var(--muted); font-size: 18px; }
#rdf-freight .btn { cursor: pointer; }
#rdf-freight .btn:disabled { opacity: .5; cursor: not-allowed; }

/* KPI strip */
#rdf-freight .todo-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
#rdf-freight .todo-sum-k { appearance: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: none; }
#rdf-freight .todo-sum-k:hover { border-color: var(--line-2); box-shadow: 0 1px 2px rgba(20,24,60,.06); }
#rdf-freight .todo-sum-k:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#rdf-freight .todo-sum-k.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
#rdf-freight .todo-sum-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
#rdf-freight .todo-sum-tx b { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
#rdf-freight .todo-sum-tx span { font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#rdf-freight .todo-sum-k > i { font-style: normal; font-size: 11.5px; font-weight: 700; align-self: flex-start; white-space: nowrap; }

/* Stage tabs */
#rdf-freight .ord-segrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
#rdf-freight .seg.ord-seg { flex-wrap: wrap; max-width: 100%; }
#rdf-freight .seg.ord-seg a { cursor: pointer; user-select: none; white-space: nowrap; }
#rdf-freight .seg.ord-seg a:hover { color: var(--ink); }
#rdf-freight .seg.ord-seg a .c { font-weight: 700; }

/* Cards, toolbar, footer */
#rdf-freight .card.rdf-pane { padding: 0; position: relative; overflow: visible; box-shadow: none; }
#rdf-freight .card.rdf-pane[hidden] { display: none; }
#rdf-freight .ord-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
#rdf-freight .ord-toolbar .search-input { height: 36px; min-width: 220px; flex: 1 1 220px; max-width: 360px; padding: 0 12px; font-family: inherit; font-size: 13.5px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; color: var(--ink); margin: 0; }
#rdf-freight .ord-toolbar .filter-select { height: 36px; padding: 0 10px; font-family: inherit; font-size: 13px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; color: var(--ink); width: auto; margin: 0; }
#rdf-freight .ord-toolbar .chip { font-weight: 700; }
#rdf-freight .shp-hint { font-size: 12.5px; font-weight: 600; }
#rdf-freight .rdf-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
#rdf-freight .rdf-check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
#rdf-freight .ord-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; }
#rdf-freight .ord-foot:has(#rdf-foot-count:empty) { display: none; }
#rdf-freight .rdf-scroll, #rdf-sw .rdf-scroll { overflow-x: auto; }

/* Tables */
#rdf-freight .tbl, #rdf-sw .tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; background: transparent; }
#rdf-freight .tbl th, #rdf-sw .tbl th { text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--sunk); white-space: nowrap; }
#rdf-freight .tbl td, #rdf-sw .tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; color: var(--ink); background: transparent; }
#rdf-freight .tbl.ord-tbl th, #rdf-freight .tbl.ord-tbl td, #rdf-sw .tbl.ord-tbl th, #rdf-sw .tbl.ord-tbl td { padding-left: 10px; padding-right: 10px; width: auto; max-width: none; min-width: 0; }
#rdf-freight .tbl tr:last-child td, #rdf-sw .tbl tbody tr:last-child td { border-bottom: 0; }
#rdf-freight .tbl td.ord-cust { white-space: normal; min-width: 120px; line-height: 1.35; }
#rdf-freight .tbl .ord-link, #rdf-sw .ord-link { font-weight: 800; color: var(--ink); cursor: pointer; }
#rdf-freight .tbl .ord-link:hover, #rdf-sw .ord-link:hover { color: var(--accent); }
#rdf-freight .ord-more { width: 30px; height: 30px; border: 0; background: transparent; cursor: pointer; }
#rdf-freight .ord-more:hover { background: var(--sunk); }
#rdf-freight .rdf-addr { font-size: 12px; display: inline-block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

#rdf-freight .shp-sub, #rdf-sw .shp-sub { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 2px; white-space: nowrap; }
#rdf-freight .tbl td.shp-empty, #rdf-sw .tbl td.shp-empty { text-align: center; padding: 42px 20px; white-space: normal; }
#rdf-freight .tbl td.shp-empty b { display: block; font-size: 14px; margin-bottom: 4px; }
#rdf-freight .tbl td.shp-empty .muted { font-size: 13px; }
#rdf-freight .chip.shp-sample, #rdf-sw .chip.shp-sample { height: 20px; margin-left: 6px; font-size: 11px; background: #FEF3C7; border-color: #FCD34D; color: #92400E; }
#rdf-freight .shp-trk, #rdf-sw .shp-trk { font-size: 12px; font-weight: 700; color: var(--ink-2); }
#rdf-freight a.shp-trk, #rdf-sw a.shp-trk { color: var(--accent); }
#rdf-freight .shp-novol, #rdf-sw .shp-novol { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 9px; background: var(--bad-soft); color: var(--bad); font-size: 9.5px; font-weight: 800; letter-spacing: .03em; vertical-align: middle; }
#rdf-freight .prl-thumb, #rdf-sw .prl-thumb { width: 36px; height: 36px; border-radius: 8px; overflow: hidden; background: #F1F2F7; flex: none; }
#rdf-freight .prl-thumb img, #rdf-sw .prl-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; }
#rdf-freight .shp-noimg, #rdf-sw .shp-noimg { display: grid; place-items: center; font-size: 11px; color: #B4B8CC; font-weight: 700; }

/* Ready to ship: grouped by PO */
#rdf-freight .shp-ready-tbl input[type="checkbox"], #rdf-sw .shp-ready-tbl input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); margin: 0; }
#rdf-freight .shp-ready-tbl tr.shp-grp td, #rdf-sw .shp-ready-tbl tr.shp-grp td { background: var(--sunk); padding: 8px 14px; font-size: 12.5px; white-space: normal; }
#rdf-freight .shp-ready-tbl tr.shp-grp td > *, #rdf-sw .shp-ready-tbl tr.shp-grp td > * { vertical-align: middle; margin-right: 8px; }
#rdf-freight .shp-ready-tbl tr.shp-grp label, #rdf-sw .shp-ready-tbl tr.shp-grp label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 800; font-size: 13px; color: var(--ink); }
#rdf-freight .shp-ready-tbl tr.shp-grp .pill, #rdf-sw .shp-ready-tbl tr.shp-grp .pill { height: 20px; font-size: 11px; }
#rdf-freight .shp-ready-tbl tr.shp-grp.sel td, #rdf-sw .shp-ready-tbl tr.shp-grp.sel td { background: #E9ECFF; }
#rdf-freight .shp-ready-tbl tr.shp-line.sel td, #rdf-sw .shp-ready-tbl tr.shp-line.sel td { background: var(--accent-soft); }
#rdf-freight .shp-ready-tbl tr.shp-line:hover td, #rdf-sw .shp-ready-tbl tr.shp-line:hover td { background: rgba(61,78,232,.035); }
#rdf-freight .shp-ready-tbl tr.shp-line.sel:hover td, #rdf-sw .shp-ready-tbl tr.shp-line.sel:hover td { background: var(--accent-soft); }
#rdf-freight .shp-open { font-size: 12px; font-weight: 700; cursor: pointer; }

/* Shipments list */
#rdf-freight .shp-tbl tr.shp-row { cursor: pointer; }
#rdf-freight .shp-tbl tr.shp-row:hover td { background: rgba(61,78,232,.035); }
#rdf-freight .shp-tbl tr.shp-row.is-open td { background: #F7F8FF; }
#rdf-freight .shp-tbl tr.shp-row.is-sample td:first-child { box-shadow: inset 3px 0 0 #F5C77A; }
#rdf-freight .shp-tbl td .chip { height: 22px; font-size: 11.5px; }
#rdf-freight .shp-tbl td.shp-chev-td { text-align: center; padding: 0 0 0 8px; cursor: pointer; }
#rdf-freight .shipment-chevron { display: inline-block; color: var(--muted); font-size: 11px; width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 6px; user-select: none; transition: transform .15s; }
#rdf-freight .shp-chev-td:hover .shipment-chevron { background: var(--sunk); color: var(--ink); }
#rdf-freight .shp-tbl tr.shp-expand > td { background: var(--sunk); padding: 0; white-space: normal; }
#rdf-freight .shp-expand-b { padding: 14px 18px 16px 44px; }

/* PO groups (row expand + workspace) */
#rdf-freight .sw-pos, #rdf-sw .sw-pos { display: flex; flex-direction: column; gap: 12px; }
#rdf-freight .sw-po, #rdf-sw .sw-po { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
#rdf-freight .sw-po-h, #rdf-sw .sw-po-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--sunk); font-size: 12.5px; }
#rdf-freight .sw-po-h .pill, #rdf-sw .sw-po-h .pill { height: 20px; font-size: 11px; }
#rdf-freight .sw-po-h .muted, #rdf-sw .sw-po-h .muted { font-weight: 600; }
#rdf-freight .sw-styles, #rdf-sw .sw-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
#rdf-freight .sw-style, #rdf-sw .sw-style { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); font-size: 12.5px; min-width: 0; }
#rdf-freight .sw-style-m, #rdf-sw .sw-style-m { flex: 1; min-width: 0; line-height: 1.4; }
#rdf-freight .sw-style-m > div, #rdf-sw .sw-style-m > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#rdf-freight .sw-style-q, #rdf-sw .sw-style-q { font-size: 15px; font-variant-numeric: tabular-nums; flex: none; }
#rdf-freight .sw-pos.compact .sw-po { border-radius: 10px; }
#rdf-freight .sw-pos.compact .sw-styles { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
#rdf-sw .sw-style { align-items: flex-start; }
#rdf-sw .sw-style .prl-thumb { width: 48px; height: 48px; }
#rdf-sw .rdf-sizes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; white-space: normal; }
#rdf-sw .rdf-sz { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--sunk); border: 1px solid var(--line); font-size: 11.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
#rdf-sw .rdf-sz b { color: var(--muted); font-weight: 700; }

/* Row "…" menu */
#rdf-rowmenu { position: fixed; z-index: 1600; width: 240px; }
#rdf-rowmenu[hidden] { display: none; }
#rdf-rowmenu .menu { position: static; width: 100%; }
#rdf-rowmenu .menu button[data-ic]::before, #rdf-sw .menu button[data-ic]::before { content: attr(data-ic); width: 16px; flex: none; text-align: center; color: var(--muted); font-size: 14px; line-height: 1; }
#rdf-rowmenu .menu button.danger, #rdf-sw .menu button.danger { color: var(--bad); }

/* ======================================================================
   2. SHIPMENT WORKSPACE (#rdf-sw-overlay > #rdf-sw)
   ====================================================================== */
#rdf-sw-overlay { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(15,23,42,0); transition: background 150ms ease; align-items: stretch; justify-content: flex-end; }
#rdf-sw-overlay.open { background: rgba(15,23,42,.55); }
#rdf-sw-overlay #rdf-sw.vw-shell { position: fixed; top: 0; right: 0; bottom: 0; width: 100%; max-width: 1440px; background: var(--bg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform 220ms cubic-bezier(.22,.61,.36,1); box-shadow: -4px 0 24px rgba(11,22,58,.18); font-size: 14px; }
#rdf-sw-overlay.open #rdf-sw.vw-shell { transform: translateX(0); }

#rdf-sw .ow-head { flex: none; position: relative; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 28px 12px; display: flex; flex-direction: column; gap: 10px; }
#rdf-sw .ow-head-r1, #rdf-sw .ow-head-r2 { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
#rdf-sw .ow-head-r1 > div:first-child { min-width: 0; flex: 1; }
#rdf-sw .ow-head .crumb { margin-bottom: 4px; }
#rdf-sw .ow-head .crumb a { cursor: pointer; }
#rdf-sw .ow-head .ws-head { gap: 10px; }
#rdf-sw .ow-head .ws-head h1 { font-size: 22px; line-height: 1.2; color: var(--ink); margin: 0; }
#rdf-sw .ws-head h1.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.01em; }
#rdf-sw .ws-head .chip.shp-sample { margin-left: 0; }
#rdf-sw .iconbtn { cursor: pointer; }
#rdf-sw .btn { cursor: pointer; }
#rdf-sw .btn:disabled { opacity: .5; cursor: not-allowed; }
#rdf-sw .sw-meta { gap: 10px; flex-wrap: wrap; min-width: 0; }
#rdf-sw .sw-meta .chip { height: 26px; font-size: 12.5px; }
#rdf-sw .sw-meta .chip.rdf-left { background: var(--ok-soft); border-color: transparent; color: var(--ok); font-weight: 700; }
#rdf-sw .sw-meta-t { font-size: 12.5px; font-weight: 700; }

#rdf-sw .menu.ow-menu { width: 310px; max-height: calc(var(--rd-vh, 100vh) - 170px); overflow-y: auto; }
#rdf-sw .menu.ow-menu[hidden] { display: none; }
#rdf-sw .menu button:disabled { opacity: .5; cursor: not-allowed; }
#rdf-sw .menu .ow-mgrp:first-child .sep { display: none; }

#rdf-sw .vw-body.ow-body { flex: 1; overflow-y: auto; padding: 18px 28px 48px; display: flex; flex-direction: column; gap: 16px; }
#rdf-sw .wtab { cursor: pointer; }
#rdf-sw .ow-pane { display: flex; flex-direction: column; gap: 16px; }
#rdf-sw .ow-pane[hidden] { display: none; }
#rdf-sw .dgrid.ow-dgrid { align-items: start; }
#rdf-sw .ow-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
#rdf-sw .sw-col-right { position: sticky; top: 0; }
#rdf-sw .ow-hint { font-size: 12px; color: var(--muted); font-weight: 600; }
#rdf-sw .ow-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 0; margin: 0; }
#rdf-sw .card { padding: 0; box-shadow: none; }
#rdf-sw .col-b[hidden] { display: none; }
#rdf-sw .col-b { display: flex; flex-direction: column; gap: 12px; }

#rdf-sw .sw-f2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
#rdf-sw .f select.input, #rdf-sw .f input.input { height: 34px; font-size: 13.5px; margin: 0; }
#rdf-sw .f textarea.input { height: auto; min-height: 64px; padding: 8px 12px; font-size: 13.5px; line-height: 1.45; resize: vertical; margin: 0; }
#rdf-sw .input:disabled { background: var(--sunk); color: var(--ink-2); cursor: not-allowed; }
#rdf-sw .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#rdf-sw .rdf-ro { min-height: 34px; display: flex; align-items: center; font-size: 13.5px; font-weight: 700; }
#rdf-sw .sw-trk-row { display: flex; gap: 8px; align-items: center; }
#rdf-sw .sw-trk-row .input { flex: 1; min-width: 0; height: 34px; }
#rdf-sw .sw-trk-row .btn { flex: none; }
#rdf-sw .sw-sample { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; cursor: pointer; line-height: 1.45; }
#rdf-sw .sw-sample input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
#rdf-sw .sw-sample .muted { font-weight: 600; }
#rdf-sw .sw-note { padding: 9px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; line-height: 1.45; }
#rdf-sw .sw-note.ok { background: var(--ok-soft); color: var(--ink-2); }
#rdf-sw .tlb { margin-bottom: 2px; }
#rdf-sw .tlb .big.muted { color: var(--muted); }
#rdf-sw .tlb .big.warn { color: var(--warn); }
#rdf-sw .tlb .fill.warn { background: #E8A21A; }
#rdf-sw .kvl span:last-child { min-width: 0; overflow-wrap: anywhere; }
#rdf-sw .tl .r b { font-weight: 700; }

/* Documents & photos */
#rdf-sw .att .att-name { color: var(--ink); font-weight: 700; word-break: break-all; }
#rdf-sw .att .att-name:hover { color: var(--accent); }
#rdf-sw .att .ico { width: 32px; height: 32px; border-radius: 9px; }
#rdf-sw .att .ico svg { width: 16px; height: 16px; }
#rdf-sw .rdf-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 4px; }
#rdf-sw .rdf-photo { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
#rdf-sw .rdf-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
#rdf-sw .rdf-photo:hover { border-color: var(--accent); }

/* Line items table */
#rdf-sw .sw-alloc td, #rdf-sw .sw-alloc th { padding: 8px 12px; font-size: 12.5px; }
#rdf-sw .sw-alloc tfoot td { font-weight: 800; border-top: 2px solid var(--line); border-bottom: 0; background: var(--sunk); }
#rdf-sw .sw-alloc .ord-link { font-weight: 700; }
#rdf-sw .pv-rm { border: 0; background: none; color: var(--bad); font-weight: 700; font-size: 12.5px; cursor: pointer; font-family: inherit; padding: 4px 6px; border-radius: 7px; }
#rdf-sw .pv-rm:hover { background: var(--bad-soft); }

/* Workspace popup (Add items) */
#rdf-sw .ow-modal-ov { position: absolute; inset: 0; background: rgba(20,24,45,.45); z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding: 70px 16px 16px; overflow: auto; }
#rdf-sw .ow-modal { background: #fff; border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(20,24,45,.45); width: min(900px, 100%); max-height: calc(var(--rd-vh, 100vh) - 110px); display: flex; flex-direction: column; overflow: hidden; }
#rdf-sw .ow-modal .ch h3 { margin: 0; }
#rdf-sw .ow-modal .ow-modal-b { padding: 0; overflow: auto; flex: 1; min-height: 0; }
#rdf-sw .ow-modal .ow-modal-b .ow-empty { padding: 40px 20px; }
#rdf-sw .rdf-modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); gap: 8px; }

/* ======================================================================
   3. LEGACY FREIGHT POPUPS — redesign dialog look
   ====================================================================== */
#po-shipment-split-modal, #shipment-add-modal {
    --line: #E4E7EF; --line-2: #D3D7E4; --ink: #1F2340; --ink-2: #454A68; --muted: #62678A;
    --sunk: #F7F8FB; --accent: #3D4EE8; --accent-soft: #ECEEFD;
    background: rgba(20,24,45,.45);
    font-family: "Plus Jakarta Sans", -apple-system, "Segoe UI", sans-serif;
}
#po-shipment-split-modal .modal, #shipment-add-modal .modal { border-radius: 16px; background: #fff; box-shadow: 0 30px 80px -20px rgba(20,24,45,.45); border: 0; }
#po-shipment-split-modal .modal-header, #shipment-add-modal .modal-header { background: #fff; color: var(--ink); padding: 16px 20px; border-bottom: 1px solid var(--line); }
#po-shipment-split-modal .modal-title, #shipment-add-modal .modal-title { font-size: 17px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
#po-shipment-split-modal .modal-close, #shipment-add-modal .modal-close { background: #fff; color: var(--ink-2); border: 1px solid var(--line); border-radius: 9px; height: 34px; padding: 0 12px; font-weight: 700; font-family: inherit; cursor: pointer; }
#po-shipment-split-modal .modal-close:hover, #shipment-add-modal .modal-close:hover { background: var(--sunk); }
#po-shipment-split-modal .modal-body, #shipment-add-modal .modal-body { padding: 16px 20px; color: var(--ink); }
#po-shipment-split-modal .modal-footer, #shipment-add-modal .modal-footer { padding: 12px 20px; border-top: 1px solid var(--line); background: #fff; display: flex; gap: 8px; justify-content: flex-end; }
#po-shipment-split-modal .sub-table, #shipment-add-modal .sub-table { border-collapse: collapse; font-size: 13px; }
#po-shipment-split-modal .sub-table th, #shipment-add-modal .sub-table th { background: var(--sunk); color: var(--muted); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
#po-shipment-split-modal .sub-table tr, #shipment-add-modal .sub-table tr { background: transparent; }
#po-shipment-split-modal .sub-table td, #shipment-add-modal .sub-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
#po-shipment-split-modal input[type="checkbox"], #shipment-add-modal input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
#po-shipment-split-modal input[type="number"] { border: 1px solid var(--line-2); border-radius: 8px; height: 30px; font-family: inherit; }
#po-shipment-split-modal .btn, #shipment-add-modal .btn { height: 36px; padding: 0 14px; border-radius: 9px; font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; }
#po-shipment-split-modal .btn-outline, #shipment-add-modal .btn-outline { background: #fff; color: var(--ink); border: 1px solid var(--line-2); }
#po-shipment-split-modal .btn-primary, #shipment-add-modal .btn-primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
#po-shipment-split-modal .btn-primary:disabled, #shipment-add-modal .btn-primary:disabled { opacity: .5; cursor: not-allowed; }

/* ======================================================================
   4. NARROW SCREENS (oms-mobile.css loads later; id selectors win)
   ====================================================================== */
@media (max-width: 1100px) {
    #rdf-sw .dgrid.ow-dgrid { grid-template-columns: minmax(0, 1fr); }
    #rdf-sw .sw-col-right { position: static; }
}
@media (max-width: 900px) {
    #rdf-freight .ph { align-items: flex-start; }
    #rdf-freight .ord-toolbar .search-input { max-width: none; min-width: 0; }
    #rdf-freight .shp-expand-b { padding: 12px; }
    #rdf-sw-overlay #rdf-sw.vw-shell { max-width: 100%; }
    #rdf-sw .ow-head { padding: 12px 14px; }
    #rdf-sw .ow-head-r1, #rdf-sw .ow-head-r2 { flex-wrap: wrap; }
    #rdf-sw .vw-body.ow-body { padding: 14px 12px 40px; }
    #rdf-sw .stages { flex-direction: column; }
    #rdf-sw .stg, #rdf-sw .stg:first-child, #rdf-sw .stg:last-child { margin-left: 0; margin-top: -1px; border-radius: 0; }
    #rdf-sw .sw-f2 { grid-template-columns: minmax(0, 1fr); }
    #rdf-sw .sw-styles { grid-template-columns: minmax(0, 1fr); }
    #rdf-sw .menu.ow-menu { right: auto; left: 0; width: min(310px, calc(var(--rd-vw, 100vw) - 32px)); }
}
