:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef3f6;
  --text: #17202a;
  --muted: #657282;
  --line: #d9e0e7;
  --blue: #2f7ebc;
  --green: #2f8f62;
  --amber: #b98017;
  --red: #c9492c;
  --purple: #7257a5;
  --shadow: 0 12px 28px rgba(23, 32, 42, 0.08);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef2f5;
}

.login-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.login-panel form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.login-panel h1 {
  margin: 0;
  font-size: 26px;
}

.login-panel p {
  margin: 0 0 4px;
  color: var(--muted);
  line-height: 1.45;
}

.login-panel label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

.login-panel input {
  width: 100%;
  min-height: 44px;
}

.login-panel .primary-btn {
  min-height: 44px;
  justify-content: center;
}

.form-message {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
  line-height: 1.4;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px 1fr;
}

.sidebar {
  background: #17202a;
  color: #fff;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #e8f1f8;
  color: #17202a;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #b8c4ce;
  font-size: 13px;
  margin-top: 4px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  height: 46px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #dfe7ee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: #263441;
  color: #fff;
}

.nav-item b {
  min-width: 26px;
  height: 22px;
  border-radius: 999px;
  background: #3b4c5b;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border: 1px solid #334452;
  border-radius: 8px;
}

.sidebar-footer span,
.sidebar-footer strong {
  display: block;
}

.sidebar-footer span {
  color: #b8c4ce;
  font-size: 13px;
  margin-bottom: 6px;
}

.sidebar-footer select {
  min-height: 38px;
  margin-bottom: 10px;
  border-color: #465867;
  background: #202c37;
  color: #fff;
}

.sidebar-logout {
  width: 100%;
  min-height: 36px;
  margin-top: 12px;
  border: 1px solid #465867;
  border-radius: 6px;
  background: transparent;
  color: #fff;
}

.sidebar-logout:hover {
  background: #263441;
}

.workspace {
  padding: 26px 30px 34px;
  overflow: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.16;
}

.topbar p {
  color: var(--muted);
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.toolbar,
.modal-actions,
.panel-head,
.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-btn,
.ghost-btn,
.icon-btn {
  border-radius: 8px;
  border: 1px solid var(--line);
  min-height: 40px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
}

.primary-btn {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.ghost-btn:hover,
.primary-btn:hover,
.icon-btn:hover {
  filter: brightness(0.97);
}

.icon-btn {
  width: 38px;
  padding: 0;
  font-size: 22px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel,
.work-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  font-size: 34px;
  margin: 8px 0 4px;
}

.metric.warning strong {
  color: var(--red);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 18px;
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(390px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 18px;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel h2 {
  font-size: 20px;
}

.panel-note {
  color: var(--muted);
  margin-top: 5px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.action-card {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 16px;
  text-align: left;
}

.action-card strong,
.action-card span {
  display: block;
}

.action-card span {
  color: var(--muted);
  margin-top: 8px;
}

.timeline {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.timeline li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.timeline b {
  color: var(--blue);
}

.timeline span {
  color: var(--muted);
}

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

.work-card {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
}

.work-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.chip {
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 5px 9px;
  font-size: 13px;
}

.chip.red { background: #ffe8e1; color: var(--red); }
.chip.green { background: #e2f4ea; color: var(--green); }
.chip.amber { background: #fff0cf; color: var(--amber); }
.chip.purple { background: #eee8fa; color: var(--purple); }

.qty-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.qty-box {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.qty-box span,
.qty-box strong {
  display: block;
}

.qty-box span {
  color: var(--muted);
  font-size: 13px;
}

.qty-box strong {
  margin-top: 4px;
}

.card-actions {
  align-self: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 310px;
}

.segmented {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.segmented button {
  border: 0;
  background: #fff;
  padding: 9px 12px;
}

.segmented button.active {
  background: #17202a;
  color: #fff;
}

.doc-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.doc-row {
  display: grid;
  grid-template-columns: 150px 1.2fr 140px 150px 220px;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.doc-row:last-child {
  border-bottom: 0;
}

.doc-row.header {
  background: #f8fafb;
  color: var(--muted);
  font-weight: 700;
}

.modal {
  width: min(640px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.modal::backdrop {
  background: rgba(23, 32, 42, 0.46);
}

.modal form {
  margin: 0;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 18px;
}

.modal-body {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input, select, textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.search-input {
  max-width: 340px;
}

.product-list,
.cart-lines,
.exchange-list {
  display: grid;
  gap: 10px;
}

.product-card,
.cart-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 12px;
}

.product-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.product-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.product-card p {
  color: var(--muted);
  margin: 0;
}

.product-actions {
  display: grid;
  grid-template-columns: 92px 112px;
  gap: 8px;
  align-items: center;
}

.product-actions input {
  text-align: right;
}

.builder-cart {
  position: sticky;
  top: 18px;
}

.transfer-identity {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--blue);
  background: #f2f7fb;
  color: var(--muted);
}

.transfer-identity strong,
.transfer-identity span {
  display: block;
}

.transfer-identity strong {
  color: var(--text);
  margin-bottom: 3px;
}

.cart-lines {
  margin-top: 14px;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr 92px 34px;
  gap: 8px;
  align-items: center;
}

.cart-line strong,
.cart-line span {
  display: block;
}

.cart-line span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.cart-line button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cart-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: #f8fafb;
}

.json-preview {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 12px;
  font-size: 12px;
}

.exchange-row {
  display: grid;
  grid-template-columns: 74px 96px 110px 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafb;
}

.exchange-row small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.mapping-readiness {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f8fafb;
}

.mapping-head,
.mapping-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.mapping-head h3 {
  margin: 0;
  font-size: 17px;
}

.mapping-head p,
.mapping-status span,
.mapping-row span {
  color: var(--muted);
}

.mapping-head p {
  margin-top: 4px;
}

.mapping-head .meta {
  margin: 0;
  justify-content: flex-end;
}

.mapping-status {
  padding: 10px 12px;
  border-left: 3px solid var(--amber);
  background: #fff7e6;
}

.mapping-status strong,
.mapping-status span {
  display: block;
}

.mapping-list {
  display: grid;
  border: 1px solid var(--line);
  background: #fff;
}

.mapping-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(240px, 1.2fr) 130px;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.mapping-row:last-child {
  border-bottom: 0;
}

.mapping-row strong,
.mapping-row span {
  display: block;
}

.mapping-row span {
  margin-top: 3px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding: 14px 18px;
}

.modal.label-modal {
  width: min(860px, calc(100vw - 32px));
}

.label-sheet {
  display: grid;
  gap: 16px;
}

.label-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.order-label {
  border: 2px solid #17202a;
  padding: 18px;
  background: #fff;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.order-label h3 {
  margin: 0 0 6px;
  font-size: 24px;
}

.order-label p {
  margin: 5px 0;
  color: var(--muted);
}

.label-qr,
.label-barcode {
  display: block;
  width: 100%;
  max-width: 100%;
  background: #fff;
}

.label-qr {
  aspect-ratio: 1;
}

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

.package-label {
  border: 1px solid var(--line);
  padding: 12px;
  background: #fff;
}

.package-label strong {
  display: block;
  margin-bottom: 8px;
}

.dispatch-result {
  border-left: 3px solid var(--green);
  background: #eef8f2;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}

.dispatch-result.warning {
  border-left-color: var(--amber);
  background: #fff7e6;
}

.scan-result {
  border: 1px solid var(--line);
  padding: 14px;
  background: #f8fafb;
  display: grid;
  gap: 8px;
}

.scan-result h3 {
  margin: 0;
}

.access-layout {
  display: grid;
  gap: 18px;
}

.account-form {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 16px;
}

.account-form[hidden] {
  display: none;
}

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

#accountFormMessage {
  color: var(--muted);
}

.account-table,
.access-audit {
  display: grid;
  border: 1px solid var(--line);
  overflow: hidden;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) minmax(150px, 0.9fr) minmax(140px, 0.8fr) 130px 150px;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.account-row:last-child,
.audit-row:last-child {
  border-bottom: 0;
}

.account-row.header {
  min-height: 44px;
  background: #f8fafb;
  color: var(--muted);
  font-weight: 700;
}

.account-name strong,
.account-name span {
  display: block;
}

.account-name span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.audit-row {
  display: grid;
  grid-template-columns: 150px minmax(180px, 0.8fr) minmax(220px, 1.2fr) 130px;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.audit-row span,
.audit-row small {
  color: var(--muted);
}

.quality-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.quality-stat {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.quality-stat span {
  color: var(--muted);
}

.quality-stat strong {
  font-size: 24px;
}

.lot-table {
  border: 1px solid var(--line);
  overflow: hidden;
}

.lot-row {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) 110px 95px 130px 110px 110px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.lot-row:last-child {
  border-bottom: 0;
}

.lot-row.header {
  min-height: 44px;
  background: #f8fafb;
  color: var(--muted);
  font-weight: 700;
}

.lot-name strong,
.lot-name span {
  display: block;
}

.lot-name span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.quality-decision-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.map-layout > *,
.map-panel,
.placement-panel {
  min-width: 0;
}

.map-toolbar,
.map-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.warehouse-map-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  background: #f8fafb;
}

.warehouse-map {
  min-width: 680px;
  aspect-ratio: 920 / 520;
}

.warehouse-map svg {
  display: block;
  width: 100%;
  height: 100%;
}

.map-zone rect {
  stroke-width: 1.5;
}

.map-zone text {
  fill: #384653;
  font-size: 15px;
  font-weight: 700;
}

.map-zone-blue rect { fill: #e7f1f8; stroke: #88b6d6; }
.map-zone-green rect { fill: #eaf5ef; stroke: #8bc6a7; }
.map-zone-amber rect { fill: #fff4dd; stroke: #d7b96d; }
.map-zone-red rect { fill: #fdece7; stroke: #d99a8a; }

.map-edge {
  stroke: #8b98a5;
  stroke-width: 5;
  stroke-linecap: round;
}

.map-edge.is-blocked {
  stroke: var(--red);
  stroke-dasharray: 10 8;
}

.map-edge.is-route {
  stroke: var(--blue);
  stroke-width: 9;
}

.map-junction {
  fill: #657282;
}

.map-location circle {
  stroke: #fff;
  stroke-width: 4;
}

.map-location.is-free circle { fill: var(--green); }
.map-location.is-occupied circle { fill: var(--amber); }

.map-location-code {
  fill: #fff;
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
}

.map-location-qty {
  fill: #384653;
  font-size: 12px;
  text-anchor: middle;
}

.map-legend {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot.free { background: var(--green); }
.legend-dot.occupied { background: var(--amber); }

.legend-line {
  width: 24px;
  height: 4px;
  background: #8b98a5;
}

.legend-line.blocked {
  background: repeating-linear-gradient(90deg, var(--red) 0 7px, transparent 7px 11px);
}

.placement-queue,
#edgeControlList {
  display: grid;
  gap: 10px;
}

.placement-queue {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#edgeControlList {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.placement-row {
  display: grid;
  gap: 9px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.placement-row:first-child {
  padding-top: 0;
}

.placement-row:last-child {
  border-bottom: 0;
}

.placement-row.is-priority {
  padding: 12px;
  border: 1px solid #e1bb62;
  background: #fff8e8;
}

.placement-row strong,
.placement-row span {
  display: block;
}

.placement-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.placement-row .meta {
  margin: 0;
}

.route-control {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.route-control h3 {
  margin: 0;
  font-size: 16px;
}

.edge-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.edge-row span,
.edge-row small {
  display: block;
}

.edge-row small {
  color: var(--muted);
  margin-top: 3px;
}

.placement-recommendation {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-left: 3px solid var(--green);
  background: #eef8f2;
}

.placement-recommendation span,
.placement-recommendation strong {
  display: block;
}

.placement-recommendation span {
  color: var(--muted);
  margin-bottom: 4px;
}

.placement-recommendation .meta {
  margin: 0;
}

.location-labels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.location-label {
  min-height: 190px;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 2px solid #17202a;
  background: #fff;
}

.location-label img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}

.location-label strong,
.location-label span,
.location-label small {
  display: block;
  overflow-wrap: anywhere;
}

.location-label strong {
  font-size: 24px;
}

.location-label span {
  margin-top: 8px;
}

.location-label small {
  margin-top: 10px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 24px 16px 30px;
    width: 100%;
    overflow-x: hidden;
  }

  .sidebar {
    position: static;
    padding: 22px 18px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .work-card {
    display: grid;
  }

  .toolbar,
  .card-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .status-grid,
  .split-layout,
  .builder-layout,
  .map-layout,
  .action-grid,
  .qty-grid {
    grid-template-columns: 1fr;
  }

  .builder-cart {
    position: static;
  }

  .product-card,
  .cart-line,
  .exchange-row,
  .mapping-row {
    grid-template-columns: 1fr;
  }

  .mapping-head,
  .mapping-status {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-actions {
    grid-template-columns: 1fr 1fr;
  }

  .doc-row {
    grid-template-columns: 1fr;
  }

  .account-row,
  .audit-row,
  .lot-row {
    grid-template-columns: 1fr;
  }

  .account-row.header,
  .lot-row.header {
    display: none;
  }

  .quality-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .placement-queue,
  #edgeControlList {
    grid-template-columns: 1fr;
  }

  .warehouse-map {
    min-width: 620px;
  }

  .location-labels,
  .location-label {
    grid-template-columns: 1fr;
  }

  .location-label img {
    width: 160px;
    justify-self: center;
  }

  .account-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .order-label,
  .package-labels {
    grid-template-columns: 1fr;
  }

  .order-label .label-qr {
    max-width: 220px;
    justify-self: center;
  }
}

@media print {
  body.print-label {
    background: #fff;
  }

  body.print-label .app-shell,
  body.print-label .modal-head,
  body.print-label .modal-actions,
  body.print-label .label-toolbar {
    display: none !important;
  }

  body.print-label #actionModal {
    display: block;
    position: static;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  body.print-label #actionModal::backdrop {
    display: none;
  }

  body.print-label .modal-body {
    padding: 0;
  }

  body.print-label .order-label,
  body.print-label .package-label,
  body.print-label .location-label {
    break-inside: avoid;
  }
}
