:root {
  --bg: #eef3f4;
  --panel: #ffffff;
  --panel-soft: #f8fbfb;
  --line: #d7e1e4;
  --text: #17262b;
  --muted: #5f6f76;
  --accent: #1f756b;
  --accent-strong: #155f57;
  --warn: #a35d21;
  --danger: #b94b42;
  --blue: #466eb5;
  --green: #52783d;
  --shadow: 0 14px 36px rgba(24, 45, 54, 0.08);
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(31, 117, 107, 0.12), transparent 32%),
    linear-gradient(225deg, rgba(70, 110, 181, 0.1), transparent 34%),
    var(--bg);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }

.app-shell {
  width: min(1840px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 28px;
}

.topbar,
.toolbar,
.table-panel,
.notice,
.status-summary-card {
  border: 1px solid rgba(215, 225, 228, 0.96);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 86px;
  padding: 16px;
  margin-bottom: 14px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  font-weight: 780;
  letter-spacing: 0;
}

#syncLine {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.top-actions,
.toolbar,
.search-wrap,
.metric,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions { flex-wrap: wrap; justify-content: flex-end; }

.topbar-main {
  min-width: 0;
  flex: 1 1 auto;
}

.workspace-nav {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #c8d6dc;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(25, 51, 65, 0.05);
}

.workspace-nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 142px;
  min-height: 52px;
  padding: 0 24px;
  border-right: 1px solid #c8d6dc;
  color: #142a34;
  background: #ffffff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.workspace-nav-item:last-child {
  border-right: 0;
}

a.workspace-nav-item:hover,
a.workspace-nav-item:focus-visible {
  background: #edf6f7;
  color: var(--accent-strong);
  outline: none;
}

.workspace-nav-item.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.15);
}

.workspace-nav-item.is-active:hover,
.workspace-nav-item.is-active:focus-visible {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #ffffff;
}

.workspace-nav-compact .workspace-nav-item {
  min-width: 112px;
  min-height: 42px;
  padding: 0 16px;
  font-size: 16px;
}

.top-actions {
  flex: 0 0 auto;
}

.top-actions > .primary-button,
.top-actions > .ghost-button {
  min-height: 46px;
  padding-inline: 18px;
  font-weight: 750;
}

.primary-button,
.ghost-button,
.file-button,
.icon-button {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 750;
  box-shadow: 0 8px 18px rgba(31, 117, 107, 0.18);
}

.primary-button:hover { background: var(--accent-strong); }
.ghost-button, .file-button { padding: 0 14px; }


.file-button {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
}

.file-button input { display: none; }

.icon-button {
  width: 40px;
  display: inline-grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 110px 120px;
  padding: 12px;
  margin-bottom: 14px;
}

.search-wrap {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 0 10px;
}

.metric {
  height: 42px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.metric strong { font-size: 20px; }
.metric span { color: var(--muted); font-size: 12px; font-weight: 700; }

.notice {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 12px 14px;
  color: #6f4617;
  background: #fff8ed;
  box-shadow: none;
}

.notice span { line-height: 1.45; }

.status-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr)) minmax(76px, 0.45fr);
  gap: 10px;
  margin-bottom: 14px;
}

.status-summary-card {
  min-height: 84px;
  padding: 12px;
  box-shadow: 0 8px 22px rgba(24, 45, 54, 0.05);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.status-summary strong {
  display: block;
  font-size: 26px;
  line-height: 1;
}

.status-summary span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.abd-summary-card {
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.status-summary-card.abd-summary-card::after {
  display: none;
}

.status-summary .abd-summary-label {
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
}

.abd-led {
  display: block;
  width: 10px;
  height: 10px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: #d92d20;
}

.abd-led.is-pending,
.abd-toggle.is-pending .abd-led {
  border-color: #b42318;
  background: #d92d20;
}

.abd-led.is-uploaded,
.abd-toggle.is-uploaded .abd-led {
  border-color: #237a31;
  background: #2f8a3b;
}

/* Keep the existing third-state key while displaying the new yellow color. */
.abd-led.is-pink,
.abd-toggle.is-pink .abd-led {
  border-color: #b3b300;
  background: #ffff00;
}

@media (max-width: 1280px) {
  .status-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.table-panel { overflow: hidden; }
.table-scroll { overflow: auto; }

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f6fbfa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

tbody tr:hover { background: #fbfdfc; }
.status-col { width: 152px; }
.amount-col { width: 120px; text-align: center; }
td.amount-col { font-weight: 750; }

.order-number {
  font-weight: 800;
  color: var(--accent-strong);
  white-space: nowrap;
}

.cell-muted {
  color: var(--muted);
  max-width: 360px;
  overflow-wrap: anywhere;
}

.row-status {
  border-left: 4px solid var(--status-color);
}

.detail-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(31, 117, 107, 0.3);
  border-radius: var(--radius);
  background: #f6fbfa;
  color: var(--accent-strong);
  font-weight: 750;
}

.empty-state {
  padding: 42px 16px;
  color: var(--muted);
  text-align: center;
}

dialog {
  width: min(720px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop { background: rgba(22, 34, 39, 0.36); }
form { padding: 18px; }

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.dialog-head h2 {
  font-size: 22px;
  overflow-wrap: anywhere;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.detail-card {
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 10px;
}

.detail-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-card strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.detail-pod-panel {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #cfe0e3;
  border-radius: 12px;
  background: linear-gradient(145deg, #f7fbfc, #ffffff);
}

.detail-pod-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.detail-pod-head > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.detail-pod-head span,
.detail-pod-record span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-pod-open,
.detail-pod-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 850;
}

.detail-pod-open {
  border: 1px solid #bdd7dc;
  background: #ffffff;
  color: #0f766e;
}

.detail-pod-records {
  display: grid;
  gap: 9px;
}

.detail-pod-record {
  display: grid;
  grid-template-columns: repeat(4, minmax(105px, 1fr)) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #dae6e9;
  border-left: 4px solid #c8d5d8;
  border-radius: 9px;
  background: #ffffff;
}

.detail-pod-record.has-pod { border-left-color: #168273; }
.detail-pod-record.needs-pod { border-left-color: #d68c28; }

.detail-pod-record > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.detail-pod-record strong {
  overflow: hidden;
  color: #17343a;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-pod-view {
  background: #e6f2ff;
  color: #075ba8;
}

.detail-pod-missing {
  color: #9a5a12 !important;
  text-align: right;
}

.detail-pod-state {
  margin: 0;
  padding: 8px 2px;
  color: var(--muted);
  font-size: 13px;
}

.detail-pod-error { color: #b13c34; }

@media (max-width: 900px) {
  .detail-pod-record { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-pod-view,
  .detail-pod-missing { justify-self: start; text-align: left; }
}

.note-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 10px;
  resize: vertical;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

@media (max-width: 980px) {
  .topbar { align-items: stretch; flex-direction: column; }
  .top-actions { justify-content: flex-start; }
  .workspace-nav { width: 100%; }
  .workspace-nav-item { flex: 1 1 0; min-width: 0; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .status-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .app-shell { width: min(100% - 20px, 620px); padding-top: 14px; }
  .toolbar, .status-summary, .detail-grid { grid-template-columns: 1fr; }
  .top-actions > * { width: 100%; justify-content: center; }
  .workspace-nav { display: grid; grid-template-columns: 1fr; }
  .workspace-nav-item { min-height: 46px; border-right: 0; border-bottom: 1px solid #c8d6dc; }
  .workspace-nav-item:last-child { border-bottom: 0; }
}

[hidden] { display: none !important; }

/* Order manager polish pass */
body {
  background:
    radial-gradient(circle at 8% 4%, rgba(196, 61, 54, 0.08), transparent 26%),
    radial-gradient(circle at 88% 0%, rgba(49, 95, 186, 0.09), transparent 26%),
    linear-gradient(180deg, #f5f8f8 0%, #e8eff1 100%);
}

.topbar {
  border-color: rgba(199, 214, 219, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 252, 0.94));
}

.eyebrow {
  color: #315fba;
}

h1 {
  color: #132328;
}

.toolbar {
  background: rgba(255, 255, 255, 0.94);
}

.status-summary-card {
  position: relative;
  overflow: hidden;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.status-summary-card::after {
  content: "";
  position: absolute;
  inset: auto 10px 10px auto;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.07;
}

.status-summary-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(24, 45, 54, 0.09);
}

.status-summary-card[aria-pressed="true"] {
  background: rgba(232, 246, 244, 0.96);
  box-shadow: 0 0 0 2px rgba(20, 126, 116, 0.22), 0 14px 28px rgba(24, 45, 54, 0.09);
}

.status-summary-card:focus-visible {
  outline: 3px solid rgba(20, 126, 116, 0.32);
  outline-offset: 2px;
}

.table-panel {
  border-color: rgba(199, 214, 219, 0.98);
  background: rgba(255, 255, 255, 0.96);
}

table {
  table-layout: fixed;
  min-width: 1320px;
}

th {
  height: 44px;
  background: linear-gradient(180deg, #f7fbfb, #edf4f4);
  border-bottom: 1px solid #c9d8dc;
}

th:nth-child(1), td:nth-child(1) { width: 154px; }
th:nth-child(2), td:nth-child(2) { width: 116px; }
th:nth-child(3), td:nth-child(3) { width: 120px; }
th:nth-child(4), td:nth-child(4) { width: 154px; }
th:nth-child(5), td:nth-child(5) { width: 230px; }
th:nth-child(6), td:nth-child(6) { width: 190px; }
th:nth-child(7), td:nth-child(7) { width: 330px; }
th:nth-child(8), td:nth-child(8) { width: 122px; }
th:nth-child(9), td:nth-child(9) { width: 78px; }

tbody tr {
  height: 58px;
  background: #ffffff;
  transition: background 120ms ease, box-shadow 120ms ease;
}

tbody tr:nth-child(even) {
  background: #fbfdfd;
}

tbody tr:hover {
  background: #f5fbfa;
  box-shadow: inset 0 0 0 999px rgba(31, 117, 107, 0.025);
}

th, td {
  padding: 8px 10px;
  vertical-align: middle;
}

td {
  height: 58px;
  line-height: 1.28;
  overflow: hidden;
}

td:not(.memo-cell) {
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-col select {
  height: 34px;
  border-color: color-mix(in srgb, var(--status-color) 38%, var(--line));
  background: color-mix(in srgb, var(--status-color) 9%, #ffffff);
  color: var(--text);
  font-weight: 750;
}

.order-number {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--order-color) 34%, transparent);
  background: color-mix(in srgb, var(--order-color) 10%, #ffffff);
  color: var(--order-color);
  font-weight: 850;
}

.memo-cell {
  max-width: 330px;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: help;
}

.memo-cell:hover {
  color: var(--text);
}

.detail-button {
  min-height: 32px;
  background: #ffffff;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.detail-button:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 117, 107, 0.55);
  background: #eef8f6;
}

.primary-button,
.ghost-button,
.file-button,
.icon-button,
select,
.search-wrap,
.metric {
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.primary-button:hover,
.ghost-button:hover,
.file-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.search-wrap:focus-within {
  border-color: rgba(31, 117, 107, 0.5);
  box-shadow: 0 0 0 3px rgba(31, 117, 107, 0.1);
}

/* Shipment detail expansion */
table {
  min-width: 1565px;
}

th:nth-child(1), td:nth-child(1) { width: 154px; }
th:nth-child(2), td:nth-child(2) { width: 116px; }
th:nth-child(3), td:nth-child(3) { width: 120px; }
th:nth-child(4), td:nth-child(4) { width: 164px; }
th:nth-child(5), td:nth-child(5) { width: 220px; }
th:nth-child(6), td:nth-child(6) { width: 180px; }
th:nth-child(7), td:nth-child(7) { width: 320px; }
th:nth-child(8), td:nth-child(8) { width: 170px; }
th:nth-child(9), td:nth-child(9) { width: 122px; }
th:nth-child(10), td:nth-child(10) { width: 78px; }

.order-number {
  border: 1px solid color-mix(in srgb, var(--order-color) 34%, transparent);
  font: inherit;
  cursor: pointer;
}

.order-number::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--order-color) 18%, #ffffff);
  font-size: 12px;
  line-height: 1;
}

.order-number.open::before {
  content: "-";
}

.expanded-parent {
  background: #f5fbfa !important;
}

.country-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  max-width: 112px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid #d4e2e6;
  background: #f7fbfc;
  color: #385057;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-content {
  display: grid;
  grid-template-columns: minmax(0, 112px) 28px;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
}

.abd-toggle {
  display: inline-grid;
  flex: 0 0 28px;
  justify-self: center;
  grid-template-rows: 10px auto;
  place-items: center;
  width: 28px;
  min-height: 34px;
  padding: 2px 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #4b5c61;
  font: inherit;
  cursor: pointer;
  row-gap: 2px;
}

.abd-toggle:hover {
  border-color: #d4e2e6;
  background: #f7fbfc;
}

.abd-toggle:focus-visible {
  outline: 3px solid rgba(20, 126, 116, 0.25);
  outline-offset: 1px;
}

.abd-toggle .abd-led {
  width: 9px;
  height: 9px;
}

.abd-toggle span {
  margin: 0;
  color: inherit;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.order-expanded-row,
.order-expanded-row:hover {
  height: auto;
  background: #f4faf9 !important;
  box-shadow: none;
}

.order-expanded-row > td {
  height: auto;
  padding: 0 12px 14px 178px;
  border-bottom: 1px solid #c9d8dc;
  white-space: normal;
  overflow: visible;
}

.shipment-panel {
  border: 1px solid #cfe0e3;
  border-left: 4px solid var(--status-color, var(--accent));
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(24, 45, 54, 0.07);
  overflow: hidden;
}

.shipment-head {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(360px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #dce8ea;
  background: linear-gradient(180deg, #fbfefe, #f4faf9);
}

.shipment-head strong {
  display: block;
  font-size: 15px;
}

.shipment-head span,
.shipment-head p {
  color: var(--muted);
  font-size: 12px;
}

.shipment-head p {
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}


.shipment-memo-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 6px 16px;
  border-bottom: 1px solid #e0ecee;
  background: #fbfefe;
  color: #3f5962;
  cursor: pointer;
}

.shipment-memo-strip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.shipment-memo-strip strong {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 700;
}

.shipment-memo-strip:hover strong {
  color: var(--accent-strong);
  text-decoration: underline;
}
.shipment-table-wrap {
  overflow: auto;
}

.shipment-table {
  width: 100%;
  min-width: 1000px;
  table-layout: fixed;
  border-collapse: collapse;
}

.shipment-table th,
.shipment-table td {
  height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid #edf2f3;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shipment-table th:nth-child(1), .shipment-table td:nth-child(1) { width: 7%; text-align: center; }
.shipment-table th:nth-child(2), .shipment-table td:nth-child(2) { width: 12%; }
.shipment-table th:nth-child(3), .shipment-table td:nth-child(3) { width: 23%; }
.shipment-table th:nth-child(4), .shipment-table td:nth-child(4) { width: 7%; text-align: center; }
.shipment-table th:nth-child(5), .shipment-table td:nth-child(5) { width: 7%; text-align: center; }
.shipment-table th:nth-child(6), .shipment-table td:nth-child(6) { width: 38%; }
.shipment-table th:nth-child(6) { text-align: center; }
.shipment-table th:nth-child(7), .shipment-table td:nth-child(7) { width: 6%; text-align: center; }

.shipment-table tbody tr {
  height: 42px;
}


.shipment-table tbody tr:hover {
  background: #f7fbfb;
}

.shipment-empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .shipment-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .order-expanded-row > td {
    padding-left: 12px;
  }
}
.sales-rep-head {
  overflow: visible;
  position: sticky;
}

.header-filter-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  cursor: pointer;
}

.header-filter-button span {
  font-size: 11px;
  line-height: 1;
  transform: translateY(-1px);
}

.header-filter-button:hover,
.header-filter-button:focus-visible {
  color: #124f75;
  outline: none;
}

.header-filter-menu {
  position: absolute;
  top: calc(100% - 2px);
  left: 10px;
  z-index: 20;
  min-width: 150px;
  padding: 6px;
  border: 1px solid rgba(38, 74, 96, .16);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(22, 42, 56, .18);
}

.header-filter-menu[hidden] {
  display: none !important;
}

.header-filter-menu button {
  display: block;
  width: 100%;
  min-height: 30px;
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #22313a;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.header-filter-menu button:hover,
.header-filter-menu button.active {
  background: #e8f4f8;
  color: #0e5a7d;
}
.language-toggle {
  min-width: 58px;
  padding: 0 12px;
  font-weight: 800;
}
.shipment-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.shipment-print-button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.shipment-print-button:hover {
  background: var(--accent-strong);
}

.shipment-push-button {
  min-width: 76px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #2563eb;
  border-radius: 7px;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.shipment-push-button:hover:not(:disabled) {
  background: #1d4ed8;
}

.shipment-push-button.is-partial,
.shipment-push-button.is-partial:disabled {
  border-color: #c66a0a;
  background: #fff4df;
  color: #9a4b00;
  opacity: 1;
}

.shipment-push-button.is-pushed,
.shipment-push-button.is-pushed:disabled {
  border-color: #16836f;
  background: #dff5ed;
  color: #0b6757;
  opacity: 1;
}

.shipment-dhl-button {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid #d6a400;
  border-radius: 7px;
  background: #ffcc00;
  color: #181818;
  font-size: 12px;
  font-weight: 900;
}

.shipment-dhl-button:hover:not(:disabled) {
  background: #f2c200;
}

.shipment-dhl-button.is-ready,
.shipment-dhl-button.is-ready:disabled {
  border-color: #16836f;
  background: #dff5ed;
  color: #0b6757;
  opacity: 1;
}

.shipment-dhl-button.is-error {
  border-color: #d93025;
}

.shipment-dhl-error {
  max-width: 300px;
  color: #b3261e;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.shipment-description {
  display: flex;
  align-items: center;
  min-width: 0;
}

.shipment-description > span:first-child {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shipment-serial-cell {
  vertical-align: middle;
}

.shipment-quantity-shortage {
  background: #fff0ee !important;
  color: #b42318 !important;
  text-align: center !important;
  white-space: normal !important;
}

.shipment-quantity-shortage strong {
  display: block;
  color: #b42318;
  font-size: 15px;
  font-weight: 900;
}

.shipment-quantity-shortage span {
  display: block;
  margin-top: 2px;
  color: #b42318;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
}

.shipment-serial-lines {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.shipment-serial-line {
  display: block;
  min-width: 0;
  padding: 3px 7px;
  border: 1px solid #aabce5;
  border-radius: 6px;
  background: #eef3ff;
  color: #294d91;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  user-select: text;
}

.shipment-serial-more {
  min-height: 30px;
  max-width: 100%;
  border: 1px solid #aabce5;
  border-radius: 7px;
  background: #eef3ff;
  color: #294d91;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.shipment-serial-more:hover {
  border-color: #6685ca;
  background: #e2eaff;
}

.serial-dialog {
  width: min(620px, calc(100% - 28px));
}

.serial-dialog-panel {
  padding: 18px;
}

.serial-dialog-list {
  display: grid;
  gap: 7px;
  max-height: min(60vh, 520px);
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fbfb;
}

.serial-dialog-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d7e0e4;
  border-radius: 8px;
  background: #fff;
}

.serial-dialog-row code {
  min-width: 0;
  color: #17345c;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
  user-select: text;
}

.serial-dialog-row strong {
  color: var(--accent-strong);
  font-size: 14px;
}

.serial-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.serial-dialog-actions > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.warehouse-pushed-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 0;
  padding: 0 8px;
  border: 1px solid #a8d9cc;
  border-radius: 999px;
  background: #e7f7f1;
  color: #0b6757;
  font-size: 11px;
  font-weight: 850;
  vertical-align: middle;
}

.shipment-push-state-cell {
  text-align: center !important;
}

.shipment-selection-count {
  min-width: 74px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.shipment-check-cell {
  width: 84px;
  text-align: center !important;
}

.shipment-item-check {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}
.shipment-option-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--option-color) 32%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--option-color) 8%, #ffffff);
  color: var(--option-color);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.pickup-toggle { --option-color: #7a4db5; }
.rma-toggle { --option-color: #b14b61; }
.express-toggle { --option-color: #b91c1c; }

.shipment-option-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--option-color);
}

.shipment-readonly-flags {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.shipment-option-readonly {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--option-color) 32%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--option-color) 8%, #ffffff);
  color: var(--option-color);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}













/* Warehouse picking page */
.warehouse-page {
  background: #f2f6f7;
}

.warehouse-shell {
  width: min(1840px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 24px;
}

.warehouse-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 136px;
  padding: 16px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(24, 45, 54, 0.06);
}

.warehouse-header-main {
  min-width: 0;
}

.warehouse-header-main .eyebrow {
  margin-bottom: 5px;
}

.warehouse-topbar h1 {
  font-size: 30px;
  white-space: nowrap;
}

.warehouse-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.warehouse-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(24, 45, 54, 0.06);
}

.warehouse-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.warehouse-search:focus-within {
  border-color: rgba(31, 117, 107, 0.5);
  box-shadow: 0 0 0 3px rgba(31, 117, 107, 0.1);
}

.warehouse-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.warehouse-tabs {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.warehouse-tab {
  min-width: 118px;
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-weight: 750;
}

.warehouse-tab:last-child { border-right: 0; }
.warehouse-tab.active { background: var(--accent); color: #fff; }
.warehouse-tab strong { margin-left: 6px; }

.warehouse-date-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 7px 10px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  overflow-x: auto;
  box-shadow: 0 6px 18px rgba(24, 45, 54, 0.04);
}

.warehouse-date-tab {
  flex: 0 0 auto;
  min-width: 88px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.warehouse-date-tab strong {
  margin-left: 5px;
  color: var(--muted);
  font-size: 12px;
}

.warehouse-date-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.warehouse-date-tab.active strong { color: #dff5f1; }

.warehouse-task-list {
  display: grid;
  gap: 12px;
}

.warehouse-task-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 26px rgba(24, 45, 54, 0.06);
  overflow: hidden;
}
.warehouse-task-card.is-completed {
  border-color: #d8e1e1;
  background: #f2f5f5;
  box-shadow: none;
  opacity: 0.62;
  filter: saturate(0.5);
}

.warehouse-task-card.is-completed:hover,
.warehouse-task-card.is-completed:focus-within {
  opacity: 0.78;
}

/* Completed tasks stay visually subdued in the list, but become fully
   readable while expanded because their picking data can be corrected and
   submitted again. */
.warehouse-task-card.is-completed.is-expanded {
  opacity: 1;
  filter: saturate(0.82);
}

.warehouse-task-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.warehouse-task-summary { min-width: 0; }

.warehouse-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.warehouse-head-actions .ghost-button {
  min-height: 36px;
  padding: 0 14px;
}

.warehouse-delete-btn {
  border-color: #efb2ad;
  color: #c9342d;
  background: #fff8f7;
}

.warehouse-task-body {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: #fbfdfd;
}

.warehouse-title-line,
.warehouse-meta-line {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.warehouse-title-line strong {
  font-size: 26px;
  line-height: 1;
}

.warehouse-partial-flag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid #e6a34e;
  border-radius: 6px;
  color: #9a4e00;
  background: #fff5e8;
  font-size: 12px;
  font-weight: 900;
}

.warehouse-completed-flag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid #aab8b8;
  border-radius: 6px;
  color: #596969;
  background: #edf1f1;
  font-size: 12px;
  font-weight: 850;
}

.warehouse-shortage-flag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid #ef9a91;
  border-radius: 999px;
  background: #fff0ee;
  color: #b42318;
  font-size: 12px;
  font-weight: 850;
}

.warehouse-flag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid #f19955;
  border-radius: 6px;
  color: #d35400;
  background: #fff9f2;
  font-size: 12px;
  font-weight: 850;
}

.warehouse-meta-line span {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.warehouse-expanded-address {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #dce7e9;
  border-radius: var(--radius);
  background: #f7fbfb;
}

.warehouse-expanded-address strong {
  color: var(--accent-strong);
  font-size: 14px;
  white-space: nowrap;
}

.warehouse-expanded-address span {
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.warehouse-table-wrap,
.warehouse-packaging {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.warehouse-pick-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.warehouse-pick-table th,
.warehouse-pick-table td {
  border-bottom: 1px solid #e2eaec;
  border-right: 1px solid #e2eaec;
  padding: 9px 12px;
  font-size: 14px;
  text-align: left;
  vertical-align: top;
}

.warehouse-pick-table th {
  background: #f7fafb;
  color: #33464d;
  font-size: 12px;
  text-transform: uppercase;
}

.warehouse-pick-table th:nth-child(1),
.warehouse-pick-table td:nth-child(1) { width: 12%; }
.warehouse-pick-table th:nth-child(2),
.warehouse-pick-table td:nth-child(2) { width: 31%; }
.warehouse-pick-table th:nth-child(3),
.warehouse-pick-table td:nth-child(3),
.warehouse-pick-table th:nth-child(4),
.warehouse-pick-table td:nth-child(4) { width: 10%; text-align: center; }
.warehouse-pick-table th:nth-child(5),
.warehouse-pick-table td:nth-child(5) { width: 37%; }

.warehouse-pick-table tbody .warehouse-item-row > td:nth-child(-n+4) {
  vertical-align: middle;
  font-size: 17px;
  line-height: 1.55;
}

.warehouse-pick-table tbody .warehouse-item-row > td:nth-child(1) {
  font-weight: 850;
}

.warehouse-pick-table tbody .warehouse-item-row > td:nth-child(2) {
  font-size: 16px;
}

.warehouse-item-row > td {
  transition: background-color .18s ease;
}

.warehouse-item-row.is-capture-complete > td {
  background: #edf9f4;
}

.warehouse-item-row.is-capture-complete > td:first-child {
  box-shadow: inset 4px 0 0 #37a58d;
}

.warehouse-item-row.is-capture-over > td {
  background: #fff4f3;
}

.warehouse-item-row.is-capture-skipped > td {
  background: #f3f6f7;
  color: #607177;
}

.warehouse-item-row.is-capture-skipped > td:first-child {
  box-shadow: inset 4px 0 0 #9aacb2;
}

.warehouse-item-row.is-capture-shortage > td {
  background: #fff3f1;
}

.warehouse-item-row.is-capture-shortage > td:first-child {
  box-shadow: inset 4px 0 0 #d92d20;
}

.warehouse-item-row.is-capture-shortage > td:nth-child(3),
.warehouse-item-row.is-capture-shortage .capture-progress {
  color: #b42318;
  font-weight: 850;
}

.picking-entry {
  display: grid;
  gap: 8px;
}

.tracking-mode-toggle {
  display: inline-flex;
  justify-self: start;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #f5f8f9;
}

.tracking-mode-btn {
  min-height: 30px;
  padding: 0 11px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tracking-mode-btn:last-child { border-right: 0; }
.tracking-mode-btn.active { background: var(--accent); color: #fff; }

.serial-capture-panel,
.quantity-capture-panel {
  display: grid;
  gap: 7px;
}

.serial-supplement-note {
  justify-self: start;
  padding: 4px 8px;
  border: 1px solid #efb3ad;
  border-radius: 999px;
  background: #fff;
  color: #b42318;
  font-size: 12px;
  font-weight: 800;
}

.serial-scan-input {
  width: 100%;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: #fff;
  color: var(--text);
  font: 14px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.serial-scan-input:focus,
.serial-allocation-quantity:focus,
.picked-quantity-input:focus {
  border-color: rgba(31, 117, 107, 0.65);
  box-shadow: 0 0 0 3px rgba(31, 117, 107, 0.1);
}

.serial-allocation-list {
  display: grid;
  gap: 5px;
}

.serial-allocation-empty {
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.serial-allocation-row {
  display: grid;
  grid-template-columns: 28px minmax(90px, 1fr) auto 54px 30px 30px 30px;
  gap: 5px;
  align-items: center;
  min-height: 36px;
  padding: 3px 5px;
  border: 1px solid #dce7e9;
  border-radius: 7px;
  background: #fff;
}

.serial-allocation-index {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.serial-allocation-row code {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.serial-times {
  color: var(--muted);
  font-weight: 900;
}

.serial-allocation-quantity,
.picked-quantity-input {
  width: 100%;
  min-height: 28px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: 0;
  background: #fff;
  text-align: center;
  font-weight: 800;
}

.allocation-step-btn,
.allocation-remove-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7fafb;
  color: var(--text);
  font-weight: 900;
}

.allocation-remove-btn {
  border-color: #efc0bc;
  background: #fff8f7;
  color: #c9342d;
}

.capture-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  color: var(--muted);
  font-size: 12px;
}

.capture-progress strong { color: var(--text); font-size: 14px; }
.capture-progress.is-complete { color: #187264; }
.capture-progress.is-complete strong { color: #187264; }
.capture-progress.is-over,
.capture-progress.is-over strong { color: #c9342d; }

.copy-serials-btn,
.fill-required-btn {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.copy-serials-btn:disabled { opacity: .45; }

.quantity-capture-panel {
  grid-template-columns: auto 82px auto;
  align-items: center;
  justify-content: start;
  column-gap: 10px;
}

.quantity-capture-panel label {
  display: contents;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.quantity-capture-panel .picked-quantity-input {
  min-height: 40px;
  font-size: 20px;
}

.quantity-capture-panel .fill-required-btn {
  min-height: 40px;
  padding: 0 18px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 15px;
}

.quantity-capture-panel .capture-progress {
  grid-column: 1 / -1;
  font-size: 14px;
}
.box-type-row input,
.package-line input,
.package-line select {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
}

.warehouse-packaging {
  margin-top: 10px;
}

.warehouse-package-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfd;
}

.warehouse-package-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.warehouse-package-detail {
  padding: 12px 14px;
  background: #f9fcfc;
}

.package-detail-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.package-detail-head strong {
  color: var(--accent-strong);
  font-size: 16px;
}

.package-detail-head span {
  color: var(--muted);
  font-size: 12px;
}

.package-detail-head button {
  margin-left: 0;
  order: 0;
}

.package-row-list {
  display: grid;
  gap: 8px;
}

.package-line {
  display: grid;
  grid-template-columns: 90px 96px minmax(260px, 1.7fr) repeat(4, 112px) 132px 32px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.package-line label {
  display: grid;
  grid-template-columns: auto minmax(50px, 1fr) auto;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.package-line .package-quantity-field {
  grid-template-columns: auto 48px;
  font-weight: 750;
}

.package-line .box-type-select {
  min-width: 260px;
  min-height: 40px;
  padding: 0 12px;
  font-size: 18px;
  font-weight: 750;
}

.package-line .box-type-select option,
.package-line .box-type-select optgroup {
  font-size: 18px;
}

.package-line .battery-check {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  gap: 8px;
  width: auto;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #d9e5e6;
  border-radius: 7px;
  background: #f7fafb;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.package-line .battery-check input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.package-line .battery-check:has(input:checked) {
  border-color: #8bc7bf;
  background: #edf8f6;
  color: var(--accent-strong);
}

.pallet-line {
  grid-template-columns: 100px 100px repeat(4, 126px) 142px 32px;
  justify-content: start;
}

.package-remove {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #d6332a;
  font-size: 22px;
}

.warehouse-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #dce9e7;
  border-radius: var(--radius);
  background: #fbfefe;
}

.warehouse-card-foot span {
  color: var(--muted);
  font-size: 13px;
}

.warehouse-card-foot .primary-button {
  min-width: 132px;
  justify-content: center;
}

.box-types-dialog {
  width: min(1180px, calc(100vw - 40px));
}

.box-types-rows {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.box-type-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) 126px 76px repeat(4, minmax(82px, 1fr)) 82px;
  gap: 8px;
  align-items: center;
}

.box-type-row input,
.box-type-row select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 9px;
  color: var(--text);
}

.box-type-header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 4px;
  background: #f3f8f8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.shipping-address-panel {
  margin-top: 12px;
  border: 1px solid #cfe3e0;
  border-radius: var(--radius);
  background: #f7fbfa;
  box-shadow: 0 5px 18px rgba(15, 104, 92, .06);
  overflow: hidden;
}

.shipping-address-head {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 14px;
  border-bottom: 1px solid #cfe3e0;
  background: linear-gradient(90deg, #eaf7f4 0%, #f7fbfa 65%);
  color: var(--accent-strong);
  font-size: 15px;
}

.shipping-address-head::before {
  width: 5px;
  height: 18px;
  margin-right: 9px;
  border-radius: 99px;
  background: var(--accent);
  content: "";
}

.shipping-address-body {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}

.shipping-address-contact-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) minmax(180px, .9fr) minmax(250px, 1.35fr) minmax(170px, .8fr);
  gap: 10px;
}

.shipping-address-lines-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shipping-address-lines-grid > :only-child {
  grid-column: 1 / -1;
}

.shipping-address-location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.shipping-address-field {
  min-width: 0;
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid #dce9e7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(13, 66, 60, .025);
}

.shipping-address-field.is-company,
.shipping-address-field.is-address {
  border-left: 3px solid #65aa9f;
}

.shipping-address-field > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.shipping-address-field > strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.shipping-address-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 12px;
}

.shipping-address-flags span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #eaf6f3;
  color: #146a5f;
  font-size: 10px;
  font-weight: 800;
}.warehouse-result-panel {
  margin-top: 10px;
  border: 1px solid #dce9e7;
  border-radius: var(--radius);
  background: #f9fcfc;
  overflow: hidden;
}

.warehouse-result-head {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #dce9e7;
  color: var(--accent-strong);
}

.warehouse-result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 10px 12px;
}

.warehouse-result-grid section > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.warehouse-result-grid section div {
  display: flex;
  gap: 10px;
  line-height: 1.6;
}

.warehouse-result-grid section div span {
  color: var(--text);
}

.notice[data-type="success"] {
  color: #155f57;
  background: #eefaf7;
}

@media (max-width: 1100px) {
  .warehouse-topbar,
  .warehouse-toolbar { grid-template-columns: 1fr; }
  .warehouse-header-actions { justify-content: flex-start; }
  .warehouse-task-head { grid-template-columns: 1fr; }
  .warehouse-head-actions { justify-content: flex-end; }
  .warehouse-title-line,
  .warehouse-meta-line { flex-wrap: wrap; }
  .package-line,
  .pallet-line,
  .box-type-row { grid-template-columns: 1fr; }
  .shipping-address-contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shipping-address-lines-grid { grid-template-columns: 1fr; }
  .shipping-address-lines-grid > * { grid-column: 1 / -1; }
  .warehouse-result-grid { grid-template-columns: 1fr; }
}

.top-link { display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; color: var(--text); text-decoration: none; font-weight: 700; }

/* Inventory management page */
.inventory-page {
  background: #f2f6f7;
}

.inventory-shell {
  width: min(1840px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 26px;
}

.inventory-topbar,
.inventory-toolbar,
.inventory-summary,
.inventory-table-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
}

.inventory-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 104px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(24, 45, 54, 0.06);
}

.inventory-heading h1 {
  font-size: 34px;
}

.inventory-heading > p:last-child {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.inventory-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.current-page {
  min-height: 40px;
  text-decoration: none;
}

.inventory-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto 190px;
  gap: 14px;
  align-items: center;
  padding: 12px;
  margin-bottom: 14px;
}

.inventory-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.inventory-search:focus-within {
  border-color: rgba(31, 117, 107, 0.5);
  box-shadow: 0 0 0 3px rgba(31, 117, 107, 0.1);
}

.inventory-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.inventory-filter {
  display: inline-flex;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.inventory-filter-button {
  min-width: 104px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-weight: 720;
  white-space: nowrap;
}

.inventory-filter-button:last-child {
  border-right: 0;
}

.inventory-filter-button:hover {
  background: #f2f8f7;
}

.inventory-filter-button.active {
  background: var(--accent);
  color: #fff;
}

.inventory-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
  box-shadow: 0 8px 22px rgba(24, 45, 54, 0.04);
}

.inventory-summary > div {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  min-height: 90px;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.inventory-summary > div:last-child {
  border-right: 0;
}

.inventory-summary strong {
  font-size: 34px;
  line-height: 1;
}

.inventory-summary span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.inventory-summary .summary-shortage strong {
  color: #c4352c;
}

.inventory-summary .summary-sufficient strong {
  color: #398431;
}

.inventory-notice {
  margin-bottom: 14px;
}

.inventory-notice[data-type="error"] {
  color: #8b2c25;
  background: #fff6f5;
}

.inventory-table-panel {
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(24, 45, 54, 0.05);
}

.inventory-table-scroll {
  overflow: auto;
}

table.inventory-table {
  width: 100%;
  min-width: 1120px;
  table-layout: fixed;
  border-collapse: collapse;
}

.inventory-table th,
.inventory-table td {
  padding: 10px 14px;
  border-right: 1px solid #dce5e7;
  border-bottom: 1px solid #dce5e7;
}

.inventory-table th:last-child,
.inventory-table td:last-child {
  border-right: 0;
}

.inventory-table th {
  height: 50px;
  background: #f6f9fa;
  color: #33464d;
  font-size: 12px;
  text-align: left;
  text-transform: uppercase;
}

.inventory-table th:nth-child(1),
.inventory-table td:nth-child(1) {
  width: 15%;
}

.inventory-table th:nth-child(2),
.inventory-table td:nth-child(2) {
  width: 34%;
}

.inventory-table th:nth-child(3),
.inventory-table td:nth-child(3) {
  width: 12%;
  text-align: center;
}

.inventory-table th:nth-child(4),
.inventory-table td:nth-child(4) {
  width: 10%;
  text-align: center;
}

.inventory-table th:nth-child(5),
.inventory-table td:nth-child(5) {
  width: 9%;
  text-align: center;
}

.inventory-table th:nth-child(6),
.inventory-table td:nth-child(6) {
  width: 11%;
  text-align: center;
}

.inventory-table th:nth-child(7),
.inventory-table td:nth-child(7) {
  width: 9%;
  text-align: center;
}

.inventory-table tbody tr.inventory-row {
  height: 56px;
}

.inventory-table tbody tr.inventory-shortage {
  background: #fff8f7;
}

.inventory-table tbody tr.inventory-shortage:hover {
  background: #fff2f0;
}

.inventory-table tbody tr.inventory-sufficient {
  background: #fff;
}

.inventory-table tbody tr.inventory-nonstock {
  background: #fafbfb;
}

.inventory-description {
  color: #33464d;
}

.inventory-number {
  font-variant-numeric: tabular-nums;
}

.inventory-shortage .inventory-shortage-value {
  color: #cf2f27;
  font-size: 16px;
  font-weight: 850;
}

.inventory-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  min-width: 94px;
  padding: 0 10px;
  border: 1px solid;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.inventory-status-shortage {
  border-color: #ef645d;
  color: #c82f27;
  background: #fff8f7;
}

.inventory-status-sufficient {
  border-color: #6eaf67;
  color: #397c34;
  background: #f8fff7;
}

.inventory-status-nonstock {
  border-color: #9ba8ad;
  color: #5d6b70;
  background: #fafbfb;
}

.related-orders-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: #235fa7;
  font-weight: 800;
  white-space: nowrap;
}

.related-orders-button::after {
  content: "›";
  font-size: 20px;
  line-height: 1;
  transition: transform 120ms ease;
}

.related-orders-button[aria-expanded="true"]::after {
  transform: rotate(90deg);
}

.related-orders-button:hover {
  color: #124b88;
  text-decoration: underline;
}

.inventory-related-row,
.inventory-related-row:hover {
  height: auto;
  background: #f5f9fa !important;
  box-shadow: none;
}

.inventory-related-row > td {
  height: auto;
  padding: 10px 14px 14px;
  white-space: normal;
  overflow: visible;
}

.inventory-related-list {
  display: grid;
  gap: 6px;
  padding-left: 15%;
}

.inventory-related-order {
  display: grid;
  grid-template-columns: 150px minmax(220px, 1fr) 110px 130px 110px;
  gap: 14px;
  align-items: center;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #dce6e8;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}

.inventory-related-order span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.inventory-related-order b {
  color: var(--accent-strong);
  text-align: right;
}

.inventory-empty {
  padding: 44px 20px;
  color: var(--muted);
  text-align: center;
}

#inventoryRefreshBtn.is-loading {
  animation: inventory-spin 800ms linear infinite;
}

@keyframes inventory-spin {
  to { transform: rotate(360deg); }
}

/* Order list: keep Country/ABD and Amount compact, and give Memo the remaining space. */
.table-panel > .table-scroll > table > thead > tr > th:nth-child(7),
.table-panel > .table-scroll > table > tbody > tr.row-status > td:nth-child(7) {
  width: 170px;
}

.table-panel > .table-scroll > table > thead > tr > th:nth-child(8),
.table-panel > .table-scroll > table > tbody > tr.row-status > td:nth-child(8) {
  width: 120px;
}

.table-panel > .table-scroll > table > thead > tr > th:nth-child(9),
.table-panel > .table-scroll > table > tbody > tr.row-status > td:nth-child(9) {
  width: 320px;
}

@media (max-width: 1150px) {
  .inventory-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-actions {
    justify-content: flex-start;
  }

  .inventory-toolbar {
    grid-template-columns: 1fr;
  }

  .inventory-filter {
    width: 100%;
  }

  .inventory-filter-button {
    flex: 1;
  }
}

@media (max-width: 720px) {
  .shipping-address-body { padding: 10px; }
  .shipping-address-contact-grid,
  .shipping-address-location-grid { grid-template-columns: 1fr; }
  .inventory-shell {
    width: min(100% - 20px, 700px);
  }

  .inventory-summary {
    grid-template-columns: 1fr 1fr;
  }

  .inventory-summary > div:nth-child(2) {
    border-right: 0;
  }

  .inventory-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .inventory-filter {
    display: grid;
    height: auto;
    grid-template-columns: 1fr 1fr;
  }

  .inventory-filter-button {
    min-height: 40px;
    border-bottom: 1px solid var(--line);
  }

  .inventory-related-list {
    padding-left: 0;
  }

  .inventory-related-order {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .inventory-related-order b {
    text-align: left;
  }
}

/* Unified workspace header shared by Order Management, Picking and Inventory. */
:root {
  --workspace-shell-width: calc(100% - 24px);
  --workspace-header-height: 92px;
  --workspace-header-top: 10px;
}

.app-shell,
.warehouse-shell,
.inventory-shell {
  width: var(--workspace-shell-width);
  max-width: none;
  padding-top: 10px;
}

.topbar,
.warehouse-topbar,
.inventory-topbar {
  position: sticky;
  top: var(--workspace-header-top);
  z-index: 100;
  width: 100%;
  height: var(--workspace-header-height);
  min-height: var(--workspace-header-height);
  padding: 12px 18px;
  margin-bottom: 14px;
  border: 1px solid rgba(199, 214, 219, .96);
  border-radius: 9px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 10px 28px rgba(24, 45, 54, .08);
  backdrop-filter: blur(12px);
}

.warehouse-topbar {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.warehouse-header-main {
  flex: 1 1 auto;
}

.warehouse-header-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.topbar-main,
.warehouse-header-main,
.inventory-heading {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 5px;
}

.topbar .eyebrow,
.warehouse-topbar .eyebrow,
.inventory-topbar .eyebrow {
  margin: 0;
  color: #315fba;
  font-size: 11px;
  line-height: 1;
  letter-spacing: .04em;
}

.workspace-nav {
  height: 48px;
  border-color: #c8d6dc;
  border-radius: 8px;
  box-shadow: none;
}

.workspace-nav-item {
  min-width: 116px;
  min-height: 48px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 800;
}

.top-actions,
.warehouse-header-actions,
.inventory-actions {
  align-self: center;
}

#syncLine.page-sync-line,
#inventorySyncLine.page-sync-line {
  min-height: 18px;
  margin: -5px 4px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

@media (max-width: 900px) {
  .workspace-nav-item {
    min-width: 105px;
    padding-inline: 14px;
  }
}

/* Keep the workspace navigation compact, matching the POD header. */
.topbar-main,
.warehouse-header-main,
.inventory-heading,
.workboard-brand {
  flex: 0 1 auto;
  width: fit-content;
  max-width: calc(100% - 280px);
}

.workspace-nav {
  width: fit-content;
  justify-self: start;
}

.workspace-nav-item {
  min-width: 104px;
  padding-inline: 14px;
}

.top-actions,
.warehouse-header-actions,
.inventory-actions,
.workboard-user-area {
  flex: 0 0 auto;
  margin-left: auto;
}

