/* SHINING 3D UI v2 — one geometry and visual vocabulary across all modules. */
:root {
  --wms-header-height: 60px; --wms-sidebar-width: 208px; --wms-page-padding: 28px;
  --bg: #fff; --panel: #fff; --panel-soft: #f7f9fc; --line: #e2e7ef;
  --text: #1d2636; --muted: #737f92; --ink: #1d2636;
  --accent: #0173ff; --accent-strong: #0061db; --blue: #0173ff;
  --shadow: none; --radius: 8px; --pod-accent: #0173ff; --pod-accent-strong: #0061db;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px; color: var(--text); background: #fff; color-scheme: light;
  scrollbar-gutter: stable;
}
* { box-sizing: border-box; }
body.wms-ui { min-width: 0; margin: 0; padding: 0; background: #fff; color: var(--text); font-family: inherit; font-size: 14px; line-height: 1.5; }
.wms-ui [hidden] { display: none !important; }
.wms-ui button, .wms-ui input, .wms-ui select, .wms-ui textarea { font-family: inherit; }
.wms-ui button { box-shadow: none; }
.wms-ui button:disabled { cursor: not-allowed; }
.wms-ui :focus-visible { outline: 3px solid #75b5ff; outline-offset: 2px; }
.wms-ui input[type="checkbox"], .wms-ui input[type="radio"] { accent-color: var(--accent); }
.wms-ui input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .wms-ui select:not(.status-select):not(.header-filter), .wms-ui textarea { border-color: #d7dfe9; border-radius: 6px; background-color: #fff; color: var(--text); }
.wms-ui .primary-button, .wms-ui button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.wms-ui .primary-button:hover, .wms-ui button.primary:hover { background: var(--accent-strong); }
.wms-ui .ghost-button, .wms-ui .icon-button, .wms-ui .wb-outline-button { background: #fff; color: var(--text); border-color: #ccd6e3; font-weight: 550; }
.wms-ui .ghost-button:hover, .wms-ui .icon-button:hover, .wms-ui .wb-outline-button:hover { background: #f4f8fd; border-color: #8dbbf1; }
.wms-skip { position: fixed; top: -80px; left: 16px; z-index: 1500; padding: 10px 16px; background: #fff; color: #0061db; }
.wms-skip:focus { top: 8px; }
.wms-header { position: fixed; inset: 0 0 auto; z-index: 500; height: var(--wms-header-height); display: flex; align-items: center; gap: 18px; padding: 0 24px; background: #141e34; color: #fff; }
.wms-header > div { display: flex; }
.wms-brand { flex: 0 0 auto; align-items: center; gap: 22px; }
.wms-logo { width: 170px; height: 40px; object-fit: contain; display: block; }
.wms-brand-name { padding-left: 22px; border-left: 1px solid #647084; color: #f7f9ff; font-size: 17px; font-weight: 600; white-space: nowrap; }
.wms-header-actions { margin-left: auto; align-items: center; gap: 16px; min-width: 0; }
.wms-header .workboard-user-area { position: relative; gap: 16px; }
.wms-header .language-toggle, .wms-header .wb-icon-button, .wms-header .wms-account-menu summary { width: auto; min-width: 36px; min-height: 36px; height: 36px; margin: 0; padding: 6px 10px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #f3f6fc; font-size: 13px; font-weight: 500; }
.wms-header .language-toggle:hover, .wms-header .wms-account-menu summary:hover { background: #ffffff14; }
.wms-header .wms-account-menu { color: var(--text); font-family: inherit; }
.wms-header .wms-account-dropdown { top: calc(100% + 12px); border-color: var(--line); box-shadow: 0 12px 28px #14243a22; }
.wms-menu-toggle { display: none; }
.wms-sidebar { position: fixed; inset: var(--wms-header-height) auto 0 0; width: var(--wms-sidebar-width); z-index: 400; padding: 22px 12px; border-right: 1px solid var(--line); background: #f5f7fa; overflow-y: auto; }
.wms-nav-caption { padding: 0 12px 20px; color: #8a94a5; font-size: 11px; letter-spacing: .06em; }
.wms-navigation { display: grid; gap: 4px; }
.wms-nav-link, .wms-nav-group { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 44px; padding: 10px 12px; border-radius: 6px; color: #344159; font-size: 14px; text-decoration: none; line-height: 1.4; }
.wms-nav-link svg, .wms-nav-group svg { width: 20px; height: 20px; flex: 0 0 auto; }
.wms-nav-group { margin-top: 14px; font-weight: 600; }
.wms-nav-link.is-nested { padding-left: 22px; }
.wms-nav-link.is-nested svg { width: 17px; height: 17px; }
.wms-nav-link:hover { background: #eaf0f8; color: #0061db; }
.wms-nav-link[aria-current="page"] { position: relative; background: #e4f0ff; color: #006de9; font-weight: 600; }
.wms-nav-link[aria-current="page"]::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: #0173ff; }
.wms-navigation > .wms-nav-link:last-child:not(.is-nested):not(:first-child) { margin-top: 20px; }
.wms-sidebar-backdrop { display: none; }
body.wms-ui > main.wms-main { position: relative; width: auto; max-width: none; min-width: 0; min-height: calc(100vh - var(--wms-header-height)); margin: var(--wms-header-height) 0 0 var(--wms-sidebar-width); padding: 22px var(--wms-page-padding) 36px; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
.wms-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 100px; margin-bottom: 18px; }
.wms-heading-text { min-width: 0; }
.wms-ui .wms-breadcrumb { margin: 0 0 8px; color: #8490a3; font-size: 12px; line-height: 18px; }
.wms-ui .wms-page-title { margin: 0; color: #182338; font-size: 28px; font-weight: 650; line-height: 36px; letter-spacing: -.025em; }
.wms-ui .wms-page-subtitle { min-height: 20px; margin: 7px 0 0; color: #7b879b; font-size: 12px; line-height: 20px; }
.wms-ui .wms-page-subtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wms-environment { margin-top: 48px; padding: 0 12px; color: #8994a6; font-size: 11px; }
.wms-page-actions, .wms-page-actions > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.wms-page-actions { flex: 0 0 auto; max-width: 50%; }
.wms-page-actions button { min-height: 38px; height: auto; padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 550; white-space: nowrap; }
.wms-page-actions #refreshBtn { order: 2; }
.wms-ui .notice { border-color: var(--line); background: #f8fafc; box-shadow: none; }
.wms-ui .toolbar, .wms-ui .warehouse-toolbar, .wms-ui .inventory-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; min-height: 44px; margin: 0 0 18px; padding: 0; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
.wms-ui .search-wrap, .wms-ui .warehouse-search, .wms-ui .inventory-search { flex: 1 1 320px; min-width: 220px; height: 42px; border: 1px solid #d7dfe9; border-radius: 6px; background: #fff; box-shadow: none; }
.wms-ui .search-wrap input, .wms-ui .warehouse-search input, .wms-ui .inventory-search input { background: transparent !important; min-width: 0; }
.wms-ui #statusFilter { flex: 0 1 240px; width: 240px; min-height: 42px; }
.wms-ui .metric { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 0; min-width: 70px; padding: 0 16px; border: 0; border-left: 1px solid var(--line); background: none; }
.wms-ui .metric strong { font-size: 24px; line-height: 28px; color: var(--text); }
.wms-ui .metric span { font-size: 12px; color: var(--muted); }
.wms-ui .status-summary { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 14px; padding-bottom: 0; border-bottom: 1px solid var(--line); }
.wms-ui .status-summary-card { flex: 0 0 auto; display: flex; flex-direction: row-reverse; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 12px; border: 0; border-top: 0 !important; border-bottom: 3px solid transparent; border-radius: 0; background: #fff; color: #617087; box-shadow: none; }
.wms-ui .status-summary-card strong { font-size: 13px; line-height: 20px; font-weight: 600; }
.wms-ui .status-summary-card span { margin: 0; font-size: 13px; font-weight: 500; white-space: nowrap; color: inherit; }
.wms-ui .status-summary-card::after { display: none; }
.wms-ui .status-summary-card[aria-pressed="true"] { background: #fff; border-color: var(--accent); color: var(--accent); box-shadow: none; }
.wms-ui .status-summary-card:hover { background: #f7faff; transform: none; }
.wms-ui .status-summary .abd-led { flex: 0 0 10px; }
.wms-ui .table-panel, .wms-ui .inventory-table-panel, .wms-ui .um-panel { border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: none; }
.wms-ui .table-scroll, .wms-ui .inventory-table-scroll { max-height: calc(100dvh - 330px); min-height: 220px; overflow: auto; scrollbar-gutter: stable; }
.wms-ui .table-panel > .table-scroll > table { min-width: var(--orders-min-width, 1280px); }
.wms-ui .table-panel > .table-scroll > table > thead > tr > th, .wms-ui .inventory-table th, .wms-ui .um-table-wrap th { position: sticky; top: 0; z-index: 4; height: 42px; padding: 10px 12px; background: #f3f6fa; color: #5c6a80; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 550; }
.wms-ui .table-panel > .table-scroll > table > tbody > tr.row-status > td { height: 60px; padding: 9px 12px; background: #fff; border-color: #e9edf3; font-size: 13px; }
.wms-ui .table-panel > .table-scroll > table > tbody > tr.row-status:hover > td { background: #f8faff; }
.wms-ui .table-panel > .table-scroll > table > thead > tr > th:first-child, .wms-ui .table-panel > .table-scroll > table > tbody > tr.row-status > td:first-child { position: sticky; left: 0; z-index: 2; width: 140px; min-width: 140px; box-shadow: 1px 0 #e2e7ef; }
.wms-ui .table-panel > .table-scroll > table > thead > tr > th:first-child { z-index: 6; }
.wms-ui .status-col select { height: 32px; min-height: 30px; border: 0; border-radius: 18px; padding: 0 9px; background: color-mix(in srgb, var(--status-color) 14%, #fff) !important; color: var(--status-color) !important; font-size: 12px; font-weight: 650; }
.wms-ui .row-status { border-left: 0; height: 60px; }
.wms-ui .order-number { padding: 0; border: 0; border-radius: 0; background: transparent; color: #2f4260; font-weight: 600; }
.wms-ui .country-pill { background: transparent; border: 0; padding: 0; min-width: 0; border-radius: 0; }
.wms-ui #syncLine.wms-page-subtitle, .wms-ui #inventorySyncLine.wms-page-subtitle { min-height: 20px; margin: 7px 0 0; line-height: 20px; }
.wms-ui .table-panel > .table-scroll > table > :is(thead, tbody) > tr:is(.row-status, :has(> th)) > :is(th, td):nth-child(1) { width: 196px; }
.wms-ui .table-panel > .table-scroll > table > :is(thead, tbody) > tr:is(.row-status, :has(> th)) > :is(th, td):nth-child(2) { width: var(--orders-date-width); }
.wms-ui .table-panel > .table-scroll > table > :is(thead, tbody) > tr:is(.row-status, :has(> th)) > :is(th, td):nth-child(3) { width: var(--orders-date-width); }
.wms-ui .table-panel > .table-scroll > table > :is(thead, tbody) > tr:is(.row-status, :has(> th)) > :is(th, td):nth-child(4) { width: 216px; }
.wms-ui .table-panel > .table-scroll > table > :is(thead, tbody) > tr:is(.row-status, :has(> th)) > :is(th, td):nth-child(5) { width: var(--orders-customer-width); }
.wms-ui .table-panel > .table-scroll > table > :is(thead, tbody) > tr:is(.row-status, :has(> th)) > :is(th, td):nth-child(6) { width: var(--orders-sales-width); }
.wms-ui .table-panel > .table-scroll > table > :is(thead, tbody) > tr:is(.row-status, :has(> th)) > :is(th, td):nth-child(7) { width: 136px; }
.wms-ui .table-panel > .table-scroll > table > :is(thead, tbody) > tr:is(.row-status, :has(> th)) > :is(th, td):nth-child(8) { width: 120px; }
.wms-ui .table-panel > .table-scroll > table > :is(thead, tbody) > tr:is(.row-status, :has(> th)) > :is(th, td):nth-child(9) { width: calc(var(--orders-flex-width) - var(--orders-customer-width)); }
.wms-ui .shipment-panel { border-color: #d9e5f5; border-left-color: var(--accent); box-shadow: none; }
.wms-ui .order-expanded-row > td { padding: 0 8px 12px; background: #f8faff; }
.wms-ui .shipment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; background: #fff; padding: 16px; }
.wms-ui .shipment-head > div:first-child { flex: 1 1 170px; }
.wms-ui .shipment-head > p { order: 3; flex-basis: 100%; max-width: none; font-size: 12px; }
.wms-ui .shipment-actions { flex: 1 1 550px; gap: 10px; }
.wms-ui .shipment-option-toggle { padding: 5px 0; border: 0; background: transparent; color: #475770; font-size: 12px; font-weight: 500; text-transform: none; }
.wms-ui .shipment-print-button { border-color: #ccd6e3; background: #fff; color: #30445f; }
.wms-ui .shipment-table { min-width: 900px; }
.wms-ui .shipment-table th { white-space: normal; text-overflow: clip; }
.wms-ui .shipment-table th, .wms-ui .warehouse-pick-table th { background: #f3f6fa; color: #617087; }
.wms-ui .shipment-head strong { color: #213149; }
.wms-ui .shipment-push-button:not(:disabled):not(.is-pushed):not(.is-partial) { background: var(--accent); border-color: var(--accent); }
.wms-ui .shipment-memo-strip { background: #f8faff; }
.wms-ui .inventory-summary { display: flex; flex-wrap: wrap; gap: 0; padding: 18px 0; margin-bottom: 18px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: none; }
.wms-ui .inventory-summary > div { flex: 1 1 150px; min-height: 46px; padding: 0 24px; border: 0; border-right: 1px solid var(--line); background: transparent; }
.wms-ui .inventory-summary > div:last-child { border-right: 0; }
.wms-ui .inventory-summary strong { font-size: 26px; }
.wms-ui .inventory-filter, .wms-ui .warehouse-tabs { flex-shrink: 0; border-color: var(--line); border-radius: 6px; background: #f6f8fb; }
.wms-ui #inventorySort { width: 174px; flex: 0 0 174px; min-height: 42px; }
.wms-ui .inventory-filter-button.active, .wms-ui .warehouse-tab.active { background: #e7f1ff; color: #0064d9; box-shadow: none; }
.wms-ui .inventory-table td { background: #fff; padding: 14px 12px; }
.wms-ui .warehouse-date-tabs { padding: 0 0 12px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.wms-ui .warehouse-date-tab { border-color: var(--line); background: #fff; color: #6b778c; border-radius: 6px; }
.wms-ui .warehouse-date-tab.active { border-color: #b6d5ff; background: #edf5ff; color: var(--accent); }
.wms-ui .warehouse-date-tab.active strong { background: #dcecff; color: #0064d9; }
.wms-ui .warehouse-task-list { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: start; gap: 18px; }
.warehouse-task-index { display: grid; gap: 8px; max-height: calc(100dvh - 300px); overflow: auto; padding: 0 3px 3px 0; }
.warehouse-index-button { display: grid; gap: 4px; width: 100%; padding: 14px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
.warehouse-index-button strong { font-size: 14px; }
.warehouse-index-button span { color: #758297; font-size: 12px; overflow-wrap: anywhere; }
.warehouse-index-button[aria-current="true"] { border-color: #91bcff; background: #f0f6ff; box-shadow: inset 3px 0 var(--accent); }
.warehouse-task-detail { min-width: 0; }
.wms-ui .warehouse-task-card { border: 1px solid var(--line); box-shadow: none; background: #fff; border-radius: 8px; }
.wms-ui .warehouse-task-head { position: static; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; width: auto; margin: 0; padding: 18px; border-bottom: 1px solid var(--line); background: #fff; }
.wms-ui .warehouse-task-head > div { display: block; }
.wms-ui .warehouse-task-head > .warehouse-head-actions { display: flex; }
.wms-ui .warehouse-title-line strong { font-size: 17px; }
.wms-ui .warehouse-task-body { padding: 0; }
.wms-ui .warehouse-expanded-address { background: #f8faff; }
.wms-ui .warehouse-table-wrap { overflow: auto; }
.wms-ui .warehouse-pick-table { min-width: 780px; }
.wms-ui .warehouse-pick-table td:first-child { white-space: normal; overflow-wrap: anywhere; font-size: 13px; }
.wms-ui .warehouse-packaging { overflow-x: auto; }
.wms-ui .warehouse-card-foot { background: #f8faff; }
.wms-ui .workboard-layout { grid-template-columns: minmax(230px, .85fr) minmax(350px, 1.6fr) minmax(260px, 1fr); gap: 18px; }
.wms-ui .workboard-layout.calendar-collapsed { grid-template-columns: minmax(230px, .85fr) minmax(350px, 2.6fr); }
.wms-ui .wb-panel { border-color: var(--line); border-radius: 8px; background: #fff; box-shadow: none; min-width: 0; }
.wms-ui .team-panel, .wms-ui .personal-panel { padding: 18px; }
.wms-ui .wb-panel-head h1 { font-size: 18px; line-height: 26px; color: #26364e; }
.wms-ui .wb-panel-head p { font-size: 12px; line-height: 1.5; }
.wms-ui .calendar-rail { grid-column: auto; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.wms-ui .calendar-card, .wms-ui .calendar-stack-card { min-height: 0; }
.wms-ui .calendar-head { flex-wrap: wrap; gap: 8px; }
.wms-ui .calendar-head h2, .wms-ui .stack-card-head h2 { font-size: 14px; }
.wms-ui .calendar-day { min-width: 0; }
.wms-ui .team-task-card, .wms-ui .personal-task-row { border-color: var(--line); }
.wms-ui .team-task-card { box-shadow: none; }
.wms-ui .team-switcher button.active, .wms-ui .segmented-control button.active, .wms-ui .filter-chips button.active, .wms-ui .mini-segmented button.active { border-color: #c4dcff; background: #eaf3ff; color: #0064d9; box-shadow: none; }
.wms-ui .quick-task-form { border-color: var(--line); background: #fafcff; }
.wms-ui .personal-toolbar { flex-wrap: wrap; gap: 8px; }
.wms-ui .query { display: flex; flex-wrap: wrap; gap: 16px; min-height: 0; padding: 0 0 16px; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
.wms-ui .query .quick-search { flex: 1 1 330px; width: auto; max-width: 560px; min-width: 0; }
.wms-ui .query-tools { display: flex; width: 100%; flex: 1 1 100%; flex-wrap: wrap; gap: 16px; overflow: visible; }
.wms-ui .date-range-tools, .wms-ui .query-actions { flex-direction: row; flex-wrap: wrap; width: auto; gap: 8px; }
.wms-ui .query-actions { margin-left: auto; }
.wms-ui .query-tools #search, .wms-ui #quickSearchButton { background: var(--accent); color: #fff; }
.wms-ui #collectDbPod, .wms-ui #uploadDhlPod, .wms-ui #exportExcel { background: #fff; border: 1px solid #ccd6e3; color: #30445f; border-radius: 6px; }
.wms-ui #collectDbPod:hover, .wms-ui #uploadDhlPod:hover, .wms-ui #exportExcel:hover { background: #f1f6fd; }
.wms-ui .cache-status { border: 0; min-height: 28px; padding: 4px 0 8px; }
.wms-ui .summary { min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px 8px 0 0; background: #fff; box-shadow: none; }
.wms-ui .table-wrap { max-height: calc(100dvh - 370px); min-height: 220px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; box-shadow: none; scrollbar-gutter: stable; }
.wms-ui .table-wrap > table { min-width: 1900px; }
.wms-ui .table-wrap > table > thead > tr > th { height: 46px; background: #f3f6fa; color: #617087; font-size: 11px; font-weight: 550; border-color: var(--line); }
.wms-ui .table-wrap > table > tbody > tr:not(.fulfillment-detail-row) > td { height: 48px; border-color: #e8edf4; }
.wms-ui .fulfillment-detail-panel { border-color: #d9e5f5; border-left-color: var(--accent); box-shadow: none; }
.wms-ui .fulfillment-items-table th { background: #f3f6fa; }
.wms-ui .um-tabs { gap: 24px; border-bottom: 1px solid var(--line); }
.wms-ui .um-tabs button { padding: 10px 2px 12px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: #6b788b; }
.wms-ui .um-tabs button[aria-pressed="true"] { background: #fff; border-color: var(--accent); color: var(--accent); }
.wms-ui .um-notice { color: #6a788e; }
.wms-ui .um-table-wrap table { min-width: 760px; }
.wms-ui .um-pills span { background: #edf4ff; border-color: #dce9fb; color: #4d709e; }
.wms-ui .permission-matrix, .wms-ui .permission-group { border-color: var(--line); }
.wms-ui .um-preview { border-color: #dce8fb; background: #f6f9ff; }
.wms-ui .account-nav { margin: 0; }
.wms-ui #accountForm { max-width: 600px; padding: 24px; border: 1px solid var(--line); border-radius: 8px; }
.wms-ui dialog { max-width: calc(100vw - 32px); max-height: calc(100dvh - 48px); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 80px #13223a33; scrollbar-gutter: stable; }
.wms-ui dialog::backdrop { background: #14203955; backdrop-filter: blur(2px); }
.wms-ui #userDialog, .wms-ui #roleDialog { width: min(760px, calc(100vw - 32px)); }
.wms-ui .dialog-head, .wms-ui .dialog-heading { border-color: var(--line); }
@media (max-width: 1280px) {
  :root { --wms-page-padding: 22px; }
  .wms-ui .workboard-layout { grid-template-columns: minmax(230px, .85fr) minmax(350px, 1.6fr); }
  .wms-ui .calendar-rail { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wms-ui .warehouse-task-list { grid-template-columns: 210px minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  :root { --wms-sidebar-width: 184px; --wms-page-padding: 20px; }
  .wms-nav-link, .wms-nav-group { font-size: 13px; }
  .wms-ui .workboard-layout, .wms-ui .workboard-layout.calendar-collapsed { grid-template-columns: minmax(0, 1fr); }
  .wms-ui .calendar-rail { grid-template-columns: minmax(0, 1fr); }
  .wms-ui .warehouse-task-list { grid-template-columns: minmax(0, 1fr); }
  .warehouse-task-index { display: flex; max-height: 160px; padding-bottom: 8px; }
  .warehouse-index-button { flex: 0 0 220px; }
  .wms-ui .warehouse-task-head { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  :root { --wms-sidebar-width: 0px; --wms-page-padding: 16px; }
  .wms-header { gap: 10px; padding: 0 12px; }
  .wms-logo { width: 128px; height: 32px; }
  .wms-brand-name { display: none; }
  .wms-header-actions, .wms-header .workboard-user-area { gap: 3px; }
  .wms-header .wms-account-menu summary { max-width: 132px; overflow: hidden; text-overflow: ellipsis; }
  .wms-menu-toggle { display: block; margin: 0; padding: 5px 8px; min-height: 36px; border: 0; background: transparent; color: #fff; font-size: 20px; }
  .wms-sidebar { width: 236px; transform: translateX(-100%); visibility: hidden; }
  .wms-nav-open .wms-sidebar { transform: translateX(0); visibility: visible; }
  .wms-nav-open .wms-sidebar-backdrop { display: block; position: fixed; inset: var(--wms-header-height) 0 0; z-index: 350; margin: 0; padding: 0; border: 0; border-radius: 0; background: #14203955; }
  .wms-page-heading { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 100px 38px; min-height: 150px; align-items: start; gap: 12px; }
  .wms-page-actions { max-width: 100%; justify-content: flex-start; }
  .wms-ui .wms-page-title { font-size: 25px; }
  .wms-ui .search-wrap, .wms-ui .warehouse-search, .wms-ui .inventory-search { flex-basis: 100%; min-width: 0; }
  .wms-ui .toolbar { flex-direction: row; }
  .wms-ui #statusFilter { flex: 1 1 130px; width: auto; }
  .wms-ui .metric { min-width: 50px; padding: 0 10px; }
  .wms-ui .inventory-filter { display: flex; flex-wrap: wrap; }
  .wms-ui .inventory-summary > div { flex-basis: 50%; padding: 8px 16px; }
  .wms-ui .query .quick-search { width: 100%; flex-basis: 100%; }
  .wms-ui .query-tools { flex-direction: row; }
  .wms-ui .query-actions { margin-left: 0; }
  .wms-ui .query-tools label input { width: 145px; }
  .wms-ui .summary { flex-direction: column; align-items: flex-start; gap: 8px; }
  .wms-ui .summary p { padding: 0; border: 0; }
  .wms-ui .table-wrap, .wms-ui .table-scroll, .wms-ui .inventory-table-scroll { max-height: 65dvh; }
}
@media (prefers-reduced-motion: reduce) { .wms-ui * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media print { .wms-header, .wms-sidebar, .wms-skip, .wms-sidebar-backdrop { display: none !important; } body.wms-ui > main.wms-main { margin: 0; padding: 0; } }

/* Compact status column and its administration dialog. */
.wms-ui .status-col .status-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wms-ui .status-settings-btn { display: inline-flex; align-items: center; justify-content: center; padding: 4px; margin: 0; width: 26px; min-width: 26px; height: 26px; min-height: 26px; color: #718098; background: #fff; border: 1px solid #dbe3ed; border-radius: 6px; }
.wms-ui .status-settings-btn[hidden] { display: none; }
.wms-ui .status-settings-btn:hover { color: var(--accent); border-color: var(--accent); }
.wms-ui .status-col select.status-select { width: 168px; max-width: 168px; height: 30px; min-height: 30px; padding: 0 6px 0 10px; border-radius: 7px; text-overflow: ellipsis; }
.wms-ui dialog.status-manager-dialog { width: 800px; padding: 0; overflow: auto; }
.sm-form { margin: 0; padding: 24px; }
.sm-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.sm-header h2 { margin: 0; font-size: 22px; letter-spacing: -.5px; }
.sm-header p { color: #748097; font-size: 13px; margin: 6px 0 0; }
.wms-ui .sm-close { min-width: 30px; min-height: 30px; padding: 0; font-size: 22px; border: 0; background: transparent; color: #748097; }
.sm-hint { padding: 12px 14px; margin: 20px 0; border: 1px solid #e3ebf6; border-radius: 8px; color: #60728e; background: #f7faff; font-size: 12px; line-height: 1.7; }
.sm-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.sm-list { display: grid; gap: 0; max-height: min(460px, calc(100dvh - 330px)); overflow-y: auto; overscroll-behavior: contain; padding-right: 8px; scrollbar-gutter: stable; }
.sm-row { display: grid; grid-template-columns: 42px minmax(100px, 1fr) minmax(130px, 1.3fr) 126px 46px; align-items: end; gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf0f5; }
.sm-row label, .sm-preview-wrap { display: grid; min-width: 0; gap: 6px; }
.sm-row label > span, .sm-preview-wrap > span:first-child { font-size: 11px; color: #8290a3; }
.wms-ui .sm-row input[type=text] { width: 100%; min-width: 0; height: 34px; min-height: 34px; font-size: 13px; font-family: inherit; padding: 5px 9px; border: 1px solid #dbe3ed; border-radius: 6px; background: #fff; color: #263750; box-shadow: none; }
.wms-ui .sm-row input[type=color] { width: 34px; height: 34px; min-height: 34px; padding: 3px; cursor: pointer; border-radius: 7px; border: 1px solid #dbe3ed; background: #fff; }
.sm-preview { display: block; height: 30px; line-height: 30px; max-width: 126px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 10px; border-radius: 7px; font-size: 12px; font-weight: 600; color: color-mix(in srgb, var(--preview-color) 75%, #172033); background: color-mix(in srgb, var(--preview-color) 14%, #fff); }
.sm-system { align-self: end; line-height: 34px; font-size: 11px; color: #929eaf; text-align: center; }
.wms-ui .sm-delete { padding: 0; min-height: 34px; background: transparent; border: 0; color: #ce5454; font-size: 12px; }
.wms-ui .sm-delete:disabled { color: #929eaf; }
.sm-add-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.sm-add-row > span { color: #929eaf; font-size: 12px; }
.wms-ui .sm-add-row button { color: var(--accent); background: #fff; border-style: dashed; border-color: #c8d9ee; font-size: 13px; }
.sm-custom-hint { font-size: 11px; color: #8290a3; margin: 10px 0 0; }
.sm-message { color: #bd3333; font-size: 12px; line-height: 1.6; margin: 12px 0 0; }
.sm-message:empty { display: none; }
.sm-footer { display: flex; justify-content: end; gap: 8px; border-top: 1px solid #e8edf3; padding-top: 18px; margin-top: 20px; }
@media (max-width: 760px) {
  .sm-form { padding: 18px; }
  .sm-list { max-height: min(380px, calc(100dvh - 430px)); }
  .sm-header h2 { font-size: 20px; }
  .sm-row { grid-template-columns: 34px minmax(0, 1fr) 46px; gap: 10px; }
  .sm-color-label { grid-column: 1; grid-row: 1 / 3; align-self: start; }
  .sm-row > label:nth-child(2) { grid-column: 2; grid-row: 1; }
  .sm-row > label:nth-child(3) { grid-column: 2; grid-row: 2; }
  .sm-preview-wrap { grid-column: 2; grid-row: 3; }
  .sm-system, .sm-delete { grid-column: 3; grid-row: 1 / 3; align-self: center; }
}

.wms-ui .sm-footer button { min-height: 36px; padding: 7px 14px; border: 1px solid #dbe3ed; border-radius: 7px; font-size: 13px; font-weight: 500; font-family: inherit; background: #fff; color: #536580; }
.wms-ui .sm-footer button.primary-button { color: #fff; background: var(--accent); border-color: var(--accent); }

.wms-ui .orders-scroll { container-type: inline-size; }
/* Give dates breathing room; cap name columns so wide screens do not create empty gaps. */
.wms-ui .orders-table {
  --orders-min-width: 1540px;
  --orders-date-width: clamp(144px, 7cqw, 176px);
  --orders-fixed-width: calc(668px + var(--orders-date-width) * 2);
  --orders-sales-width: clamp(168px, 12cqw, 220px);
  --orders-flex-width: calc(max(var(--orders-min-width), 100cqw) - var(--orders-fixed-width) - var(--orders-sales-width));
  --orders-customer-width: min(400px, calc(var(--orders-flex-width) * .48));
  --order-cell-padding: 14px;
  --order-toggle-size: 16px;
  --order-toggle-gap: 8px;
}
.wms-ui .table-panel .orders-scroll .orders-table > :is(thead, tbody) > tr:is(.row-status, :has(> th)) > :is(th, td) { padding-left: var(--order-cell-padding); padding-right: var(--order-cell-padding); text-align: left; }
.wms-ui .orders-table > thead > tr > th { text-transform: none; letter-spacing: 0; text-align: left; }
.wms-ui .table-panel .orders-scroll .orders-table > thead > tr > th.document-head { padding-left: calc(var(--order-cell-padding) + var(--order-toggle-size) + var(--order-toggle-gap)); }
.wms-ui .orders-table > tbody > tr.row-status > td { vertical-align: middle; line-height: 18px; }
.wms-ui .orders-table .date-cell { color: #728096; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wms-ui .orders-table .order-number { display: inline-grid; grid-template-columns: var(--order-toggle-size) minmax(0, 1fr); column-gap: var(--order-toggle-gap); align-items: center; text-align: left; max-width: 100%; font-size: 13px; font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wms-ui .orders-table .order-number::before { width: var(--order-toggle-size); margin-right: 0; }
.wms-ui .orders-table .order-cell-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; max-height: 36px; line-height: 18px; white-space: normal; overflow-wrap: anywhere; }
.wms-ui .orders-table .customer-cell { color: #293a52; font-weight: 500; }
.wms-ui .orders-table .sales-cell { color: #536179; }
.wms-ui .table-panel .orders-scroll .orders-table > thead > tr > th.amount-col, .wms-ui .table-panel .orders-scroll .orders-table > tbody > tr.row-status > td.amount-col { text-align: right; padding-right: var(--order-cell-padding); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wms-ui .orders-table > tbody > tr.row-status > td.amount-col { font-weight: 600; color: #293a52; }
.wms-ui .table-panel .orders-scroll .orders-table > thead > tr > th:last-child, .wms-ui .table-panel .orders-scroll .orders-table > tbody > tr.row-status > td.memo-cell { padding-left: 20px; }
.wms-ui .orders-table .memo-cell { max-width: none; color: #77859a; font-size: 12px; }
.wms-ui .orders-table .header-filter-button { display: inline-flex; align-items: center; gap: 5px; font-weight: inherit; font-size: inherit; text-transform: none; letter-spacing: 0; }
.wms-ui .orders-table .country-content { display: flex; align-items: center; gap: 8px; justify-content: flex-start; }
.wms-ui .orders-table .country-pill { flex: 0 1 auto; max-width: none; min-width: 0; min-height: 0; font-weight: 500; color: #536179; white-space: normal; line-height: 17px; overflow-wrap: anywhere; }
.wms-ui .orders-table .abd-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; gap: 4px; width: auto; min-height: 22px; padding: 2px 5px; border: 1px solid #e6ebf2; border-radius: 5px; background: #fff; }
.wms-ui .orders-table .abd-toggle .abd-led { width: 7px; height: 7px; }
.wms-ui .orders-table .abd-toggle span { font-size: 9px; line-height: 14px; font-weight: 600; }

/* POD keeps its original controls and permissions; only the workspace geometry changes. */
html[data-wms-page="pod"] body.wms-ui > main.wms-main { display: flex; flex-direction: column; height: calc(100dvh - var(--wms-header-height)); min-height: 0; padding-bottom: 20px; }
html[data-wms-page="pod"] .wms-main > :not(.table-wrap):not(dialog) { flex: 0 0 auto; }
html[data-wms-page="pod"] .wms-page-heading { min-height: 80px; margin-bottom: 6px; }
html[data-wms-page="pod"] .wms-ui .wms-breadcrumb { margin-bottom: 4px; }
html[data-wms-page="pod"] .wms-ui .wms-page-subtitle { margin-top: 2px; }
html[data-wms-page="pod"] .wms-ui .query { flex-direction: row; align-items: flex-end; gap: 10px 14px; padding-bottom: 10px; }
html[data-wms-page="pod"] .wms-ui .query .quick-search { flex: 1 1 300px; width: auto; min-width: 240px; max-width: 440px; margin: 0; }
html[data-wms-page="pod"] .wms-ui .query-tools { display: contents; }
html[data-wms-page="pod"] .wms-ui .date-range-tools { flex: 0 1 auto; width: auto; max-width: 100%; align-items: flex-end; gap: 6px; }
html[data-wms-page="pod"] .wms-ui .query-actions { flex: 0 1 auto; width: auto; max-width: 100%; margin-left: auto; align-items: flex-end; gap: 6px; }
html[data-wms-page="pod"] .wms-ui .query label { gap: 3px; }
html[data-wms-page="pod"] .wms-ui .query button { height: 38px; margin-top: 0; padding: 0 12px; }
html[data-wms-page="pod"] .wms-ui .query input { height: 38px; }
html[data-wms-page="pod"] .wms-ui .quick-search input { min-width: 0; }
html[data-wms-page="pod"] .wms-ui .query-tools label input { width: 136px; }
html[data-wms-page="pod"] .wms-ui .query-tools #search { margin-left: 2px; }
html[data-wms-page="pod"] .wms-ui .cache-status { min-height: 24px; padding: 3px 0 5px; font-size: 11px; }
html[data-wms-page="pod"] .wms-ui .summary { min-height: 40px; padding: 6px 14px; gap: 16px; }
html[data-wms-page="pod"] .wms-ui .summary strong { font-size: 20px; }
html[data-wms-page="pod"] .wms-ui .collector-errors { padding: 6px 12px; }
html[data-wms-page="pod"] .wms-ui .collector-errors summary { font-size: 12px; }
html[data-wms-page="pod"] .wms-ui .collector-errors ul { margin: 4px 0 0; max-height: 96px; }
html[data-wms-page="pod"] .wms-ui .collector-errors li { margin: 3px 0; }
html[data-wms-page="pod"] .wms-ui .table-wrap { flex: 1 1 auto; min-height: 220px; max-height: none; margin-top: 0; margin-bottom: 0; }
@media (max-width: 760px) {
  html[data-wms-page="pod"] .wms-page-heading { grid-template-rows: 80px auto; min-height: 0; gap: 6px; }
  html[data-wms-page="pod"] .wms-ui .query .quick-search { flex-basis: 100%; min-width: 0; max-width: none; width: 100%; }
  html[data-wms-page="pod"] .wms-ui .date-range-tools, html[data-wms-page="pod"] .wms-ui .query-actions { margin-left: 0; }
  html[data-wms-page="pod"] .wms-ui .query-tools #search { width: auto; }
  html[data-wms-page="pod"] .wms-ui .summary { gap: 4px; }
}
@media (max-width: 760px), (max-height: 680px) {
  html[data-wms-page="pod"] body.wms-ui > main.wms-main { height: auto; min-height: calc(100dvh - var(--wms-header-height)); }
  html[data-wms-page="pod"] .wms-ui .table-wrap { flex: none; height: 60dvh; min-height: 260px; }
}
