:root {
  color-scheme: light;
  --bg: #eef2f6;
  --bg-soft: #f7f9fb;
  --panel: #ffffff;
  --panel-raised: #ffffff;
  --ink: #16202b;
  --muted: #647283;
  --muted-strong: #465467;
  --line: #d7e0ea;
  --line-strong: #c6d2df;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #e4f4f1;
  --warn: #b45309;
  --danger: #b42318;
  --sidebar: #17212b;
  --sidebar-2: #202d38;
  --table-head: #edf4f5;
  --shadow: 0 18px 44px rgba(22, 32, 43, 0.1);
  --shadow-soft: 0 1px 2px rgba(22, 32, 43, 0.08);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f5f7fa 0, var(--bg) 360px),
    var(--bg);
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  font-size: 14px;
  line-height: 1.5;
}

body.is-loading::after {
  content: "加载中...";
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 650;
  pointer-events: none;
}

.auth-pending .sidebar,
.auth-pending .app {
  display: none;
}

.auth-booting .login-screen,
.auth-booting .sidebar,
.auth-booting .app {
  display: none;
}

.login-screen {
  display: none;
}

.auth-pending .login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  padding: 24px;
  background: #eef2f7;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-brand {
  padding: 0 0 16px;
  color: var(--ink);
  border-bottom-color: var(--line);
}

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

.login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.login-code-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.login-code-status.success {
  color: var(--accent-strong);
}

.login-code-status.pending {
  color: var(--warn);
}

.login-code-status.error {
  color: var(--danger);
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 100vh;
  background: var(--sidebar);
  color: #eef4f6;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.07);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.brand strong {
  letter-spacing: 0;
}

.brand span, .session small {
  display: block;
  color: #9fb0be;
  margin-top: 3px;
  font-size: 12px;
}

.mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0f172a;
}

.mark img {
  width: 100%;
  height: 100%;
  display: block;
}

nav {
  display: grid;
  gap: 5px;
}

.nav-section-label {
  margin: 9px 10px 3px;
  color: #718493;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-collapsible-group {
  display: grid;
  gap: 3px;
}

.nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 5px 0 0;
  padding: 8px 10px 5px;
  border: 0;
  color: #718493;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: left;
}

.nav-section-toggle:hover,
.nav-section-toggle:focus-visible {
  color: #c8d3dc;
}

.nav-section-toggle:focus-visible {
  outline: 2px solid #2dd4bf;
  outline-offset: 2px;
  border-radius: 5px;
}

.nav-section-toggle i {
  font-size: 16px;
  font-style: normal;
  line-height: 1;
  transition: transform 140ms ease;
}

.nav-section-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.nav-collapsible-content {
  display: grid;
  gap: 3px;
}

.nav-collapsible-content[hidden] {
  display: none;
}

.nav-flow {
  position: relative;
  display: grid;
  gap: 3px;
}

.nav-flow::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 21px;
  width: 1px;
  background: rgba(148, 163, 184, 0.24);
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border-radius: 7px;
  text-align: left;
  color: #c8d3dc;
  background: transparent;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.nav-badge {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.nav-item.active {
  background: var(--sidebar-2);
  color: #ffffff;
  box-shadow: inset 3px 0 0 #2dd4bf;
}

.nav-flow-item > span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.nav-flow-item i {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #536675;
  border-radius: 50%;
  color: #a9bac7;
  background: var(--sidebar);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.nav-flow-item.active i {
  border-color: #5eead4;
  color: #052e2b;
  background: #5eead4;
}

.session {
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.store-switcher {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.store-switcher label {
  display: grid;
  gap: 6px;
  color: #9fb0be;
  font-size: 12px;
}

.store-switcher select {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  color: #eef4f6;
  background: #17222c;
}

.session-logout {
  width: 100%;
  margin-top: 12px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #eef4f6;
}

.session-logout:hover {
  background: rgba(255, 255, 255, 0.12);
}

.app {
  grid-column: 2;
  min-width: 0;
  padding: 26px;
}

.icp-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
}

.icp-footer a {
  color: var(--muted);
  text-decoration: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.2;
  font-weight: 750;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar p {
  color: var(--muted);
  margin-top: 6px;
}

.current-store-indicator {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  margin-top: 0;
  border: 1px solid #b9ddd7;
  border-radius: 7px;
  padding: 5px 9px;
  background: #eef9f6;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.store-indicator-label {
  white-space: nowrap;
}

.store-listing-stats {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding-left: 6px;
  border-left: 1px solid #c7e7e1;
}

.store-listing-stat {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid #c7dfda;
  border-radius: 6px;
  background: #ffffff;
  color: #28584f;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.store-listing-stat:hover {
  border-color: #85b8ad;
  background: #f7fbfa;
}

.store-listing-stat.active {
  border-color: var(--accent);
  background: #dff4f0;
}

.store-listing-stat b {
  color: var(--ink);
}

.warehouse-store-stats {
  border-left-color: #b9d6ce;
}

.warehouse-stat-chip.active {
  border-color: #0f766e;
  background: #e4f4f1;
}

.current-store-indicator[hidden] {
  display: none;
}

input[readonly] {
  color: var(--muted);
  background: #f1f5f7;
}

.field-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 13px;
  cursor: pointer;
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.25;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

button:hover {
  border-color: var(--line-strong);
  background: #f8fafc;
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.image-paste-zone:focus-visible {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 118, 110, 0.16);
  outline-offset: 1px;
}

button:disabled {
  cursor: not-allowed;
  color: #8a95a3;
  background: #eef1f4;
  border-color: #d6dde5;
  opacity: 0.78;
}

button:disabled:hover {
  color: #8a95a3;
  background: #eef1f4;
}

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.secondary {
  background: #fff;
}

.secondary:hover {
  background: var(--bg-soft);
}

.danger {
  border-color: #ffd8d3;
  color: var(--danger);
  background: #fffafa;
}

.danger:hover {
  border-color: #f4b9b1;
  background: #fff1f0;
}

.dashboard-utility-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-utility-bar time {
  color: var(--muted-strong);
  font-weight: 700;
}

.dashboard-refresh {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
}

.dashboard-refresh > span {
  font-size: 17px;
  line-height: 1;
}

.dashboard-refresh:disabled > span {
  animation: dashboard-spin 900ms linear infinite;
}

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

.dashboard-command-center {
  margin: 16px 16px 0;
  overflow: hidden;
  border: 1px solid #b8d7d2;
  border-radius: 9px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.dashboard-command-center > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  color: #e7fffa;
  background: #173d3a;
}

.dashboard-command-center > header div {
  display: grid;
  gap: 3px;
}

.dashboard-command-center > header span {
  color: #9fd8cf;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.dashboard-command-center > header h2 {
  margin: 0;
  color: inherit;
  font-size: 18px;
  line-height: 1.3;
}

.dashboard-command-center > header > b {
  font-size: 24px;
}

.dashboard-command-center > header small {
  color: #b9d8d3;
  font-size: 12px;
}

.dashboard-command-summary {
  justify-items: end;
  text-align: right;
}

.dashboard-command-summary b {
  font-size: 27px;
  line-height: 1;
}

.dashboard-active-tasks {
  display: grid;
}

.dashboard-task-group {
  border-bottom: 1px solid var(--line);
}

.dashboard-task-group:last-child {
  border-bottom: 0;
}

.dashboard-task-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 15px;
  background: #f8fafb;
}

.dashboard-task-group > header > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.dashboard-task-group > header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.dashboard-task-group > header span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-task-group > header > b {
  flex: 0 0 auto;
  color: var(--muted-strong);
  font-size: 14px;
}

.dashboard-task-group > header > b small {
  color: var(--muted);
  font-size: 11px;
}

.dashboard-task-group-risk > header {
  background: #fff8f6;
}

.dashboard-task-group-risk > header h3,
.dashboard-task-group-risk > header > b {
  color: #9f241a;
}

.dashboard-task-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-task {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 72px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  min-height: 82px;
  padding: 12px 15px;
  text-align: left;
  background: #fff;
  box-shadow: none;
}

.dashboard-task:nth-child(2n) { border-right: 0; }
.dashboard-task:nth-last-child(-n + 2) { border-bottom: 0; }
.dashboard-task:hover { background: #f3faf8; }

.dashboard-task > .dashboard-task-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #cbd6df;
  border-radius: 7px;
  color: #526273;
  background: #f5f7f9;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.dashboard-task-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.dashboard-task-copy > span {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.dashboard-task-copy strong { color: var(--ink); font-size: 14px; }
.dashboard-task-copy small { color: var(--muted); font-size: 12px; font-weight: 500; }
.dashboard-priority {
  padding: 2px 6px;
  border: 1px solid #cad6df;
  border-radius: 999px;
  color: #526273;
  background: #f7f9fa;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.3;
}

.dashboard-task-age {
  color: var(--muted-strong);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.dashboard-task.critical .dashboard-task-icon,
.dashboard-task.critical .dashboard-priority {
  border-color: #f0bbb5;
  color: #9f241a;
  background: #fff1ef;
}

.dashboard-task.warning .dashboard-task-icon,
.dashboard-task.warning .dashboard-priority {
  border-color: #efc48f;
  color: #8a3b08;
  background: #fff8e8;
}

.dashboard-task.primary .dashboard-task-icon,
.dashboard-task.primary .dashboard-priority {
  border-color: #9fcfc7;
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.dashboard-task > b { min-width: 38px; color: var(--accent-strong); font-size: 21px; text-align: right; }
.dashboard-task > b small { display: block; color: var(--muted); font-size: 10px; font-weight: 600; }
.dashboard-task > u { color: var(--accent-strong); font-size: 12px; font-weight: 750; text-decoration: none; text-align: right; }
.dashboard-task > u span { margin-left: 3px; }
.dashboard-task.critical > b { color: var(--danger); }
.dashboard-task.warning > b { color: var(--warn); }
.dashboard-task.is-clear { background: #fbfcfd; }
.dashboard-task.is-clear > b, .dashboard-task.is-clear > u { color: #7b8996; }

.dashboard-cleared-tasks {
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.dashboard-cleared-tasks summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.dashboard-cleared-tasks summary:hover {
  color: var(--accent-strong);
  background: #f3faf8;
}

.dashboard-cleared-tasks summary:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.16);
  outline-offset: -3px;
}

.dashboard-cleared-tasks summary span {
  color: var(--muted);
  font-weight: 600;
}

.dashboard-all-clear {
  display: grid;
  gap: 4px;
  padding: 26px 18px;
  text-align: center;
}

.dashboard-all-clear strong { color: var(--accent-strong); font-size: 15px; }
.dashboard-all-clear span { color: var(--muted); font-size: 13px; }

.segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f6;
}

.segmented-control button {
  min-width: 62px;
  min-height: 44px;
  border: 0;
  padding: 7px 11px;
  background: transparent;
  color: var(--muted);
}

.segmented-control button.active {
  background: #fff;
  color: var(--accent-strong);
  box-shadow: var(--shadow-soft);
}

.dashboard-insights {
  margin: 14px 16px 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.dashboard-insights-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.dashboard-insights-header > div:first-child {
  display: grid;
  gap: 2px;
}

.dashboard-insights-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.dashboard-insights-header span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.dashboard-metric-grid {
  padding: 14px;
}

.workflow-trail {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid #c9ddd9;
  border-radius: 8px;
  background: #f6fbfa;
}

.detail-sections > .workflow-trail {
  margin-bottom: 2px;
}

.workflow-trail header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.workflow-trail header strong { color: #173d3a; font-size: 13px; }
.workflow-trail header span { color: var(--muted); font-size: 12px; }
.workflow-trail > div { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }

.workflow-step {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 0;
  padding: 5px 7px;
  color: #71808e;
  background: transparent;
  box-shadow: none;
}

.workflow-step::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -4px;
  width: 8px;
  height: 1px;
  background: #b8c8c5;
}

.workflow-step:last-child::after { display: none; }
.workflow-step i { width: 23px; height: 23px; display: inline-grid; place-items: center; flex: 0 0 auto; border: 1px solid #bdc9d2; border-radius: 50%; font-size: 11px; font-style: normal; font-weight: 800; background: #fff; }
.workflow-step span { overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 750; white-space: nowrap; }
.workflow-step.complete { color: var(--accent-strong); }
.workflow-step.complete i { border-color: #86c8bd; background: #dff4f0; }
.workflow-step.current { color: #fff; border-radius: 6px; background: #173d3a; }
.workflow-step.current i { border-color: #7de0cf; color: #173d3a; background: #7de0cf; }
.workflow-step:hover { color: var(--accent-strong); background: #e8f5f2; }
.workflow-step.current:hover { color: #fff; background: #214d49; }

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  box-shadow: var(--shadow-soft);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: #111827;
  font-size: 25px;
  font-weight: 780;
}

.metric small {
  display: block;
  min-height: 20px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.dashboard-sections {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 14px;
  padding: 14px 16px 16px;
}

.dashboard-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.dashboard-panel-wide {
  grid-row: span 2;
}

.dashboard-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.dashboard-panel header strong {
  color: var(--ink);
  font-size: 15px;
}

.dashboard-panel header span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-list {
  display: grid;
}

.dashboard-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
  background: #fff;
  box-shadow: none;
}

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

.dashboard-row:hover {
  background: #f6fbfa;
}

.dashboard-row span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.dashboard-row strong,
.dashboard-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-row strong {
  color: var(--ink);
  font-size: 14px;
  font-style: normal;
}

.dashboard-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

.dashboard-row b {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 13px;
}

.dashboard-row.compact {
  padding-top: 10px;
  padding-bottom: 10px;
}

.dashboard-empty {
  padding: 22px 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.dashboard-bar-row {
  display: grid;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

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

.dashboard-bar-row div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-strong);
  font-size: 13px;
}

.dashboard-bar-row strong {
  color: var(--ink);
}

.dashboard-bar-row i {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.platform-entry-page {
  display: grid;
  gap: 16px;
  padding: 16px;
  background: #fbfcfd;
}

.platform-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.platform-group header {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.platform-group-selection header {
  background: #f0faf8;
}

.platform-group-product header {
  background: #f1f6fd;
}

.platform-group-selection {
  border-color: #b9ddd7;
}

.platform-group-product {
  border-color: #bfd3ee;
}

.platform-group header strong {
  color: var(--ink);
  font-size: 16px;
}

.platform-group header span {
  color: var(--muted);
  font-size: 13px;
}

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

.platform-link-card {
  min-height: 150px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  background: #fff;
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease, background 140ms ease;
}

.platform-link-card:hover {
  border-color: #9fcfc7;
  background: #f6fbfa;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.1);
  transform: translateY(-1px);
}

.platform-group-product .platform-link-card:hover {
  border-color: #94b7e8;
  background: #f6f9fe;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.1);
}

.platform-link-card:focus-visible {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 118, 110, 0.16);
  outline-offset: 1px;
}

.platform-link-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.platform-link-card strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 780;
}

.platform-link-card em {
  color: var(--muted-strong);
  font-size: 13px;
  font-style: normal;
  line-height: 1.55;
}

.platform-link-card b {
  align-self: end;
  color: var(--accent-strong);
  font-size: 13px;
}

.platform-group-product .platform-link-card b {
  color: #1d4ed8;
}

.workspace {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 260px;
  padding: 36px;
  color: var(--muted);
  text-align: center;
  background: #fbfcfd;
}

.empty-state strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
}

.empty-state span {
  max-width: 420px;
  line-height: 1.6;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
}

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

.toolbar input {
  width: min(360px, 100%);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
}

.list-filters {
  display: grid;
  gap: 10px;
  align-items: end;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f6f9fb;
}

.selection-filters {
  grid-template-columns: minmax(180px, 1.2fr) minmax(120px, 0.7fr) minmax(190px, 1.1fr) minmax(96px, 0.6fr) minmax(118px, 0.7fr) minmax(140px, 0.8fr) auto;
}

.listing-filters {
  grid-template-columns: minmax(220px, 1.3fr) minmax(130px, 0.7fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr) auto;
}

.purchase-filters {
  grid-template-columns: minmax(200px, 1.2fr) minmax(125px, 0.7fr) minmax(190px, 1.1fr) minmax(135px, 0.7fr) auto;
}

.movement-filters {
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 1fr) minmax(150px, 0.8fr) auto;
}

.balance-filters {
  grid-template-columns: minmax(220px, 1.2fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) auto;
}

.warehouse-filter-panel {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px;
  background: #f7faf9;
}

.warehouse-filter-main {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(170px, 0.82fr) minmax(118px, 0.5fr) minmax(145px, 0.58fr) minmax(145px, 0.58fr) minmax(132px, auto);
  gap: 10px;
  align-items: end;
}

.warehouse-search-field input {
  font-weight: 650;
}

.warehouse-filter-summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #cdd8d3;
  border-radius: 7px;
  background: #ffffff;
  color: var(--muted);
  white-space: nowrap;
}

.warehouse-filter-summary strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.warehouse-filter-summary span {
  font-size: 12px;
}

.warehouse-filter-secondary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.warehouse-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.warehouse-filter-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.warehouse-chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.warehouse-filter-chip {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid #d5ded9;
  border-radius: 7px;
  background: #ffffff;
  color: #33443d;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.warehouse-filter-chip b {
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #edf3f0;
  color: #586862;
  font-size: 11px;
  line-height: 1.2;
}

.warehouse-filter-chip.active {
  border-color: #2f6f58;
  background: #e7f3ee;
  color: #184635;
}

.warehouse-filter-chip.active b {
  background: #2f6f58;
  color: #ffffff;
}

.warehouse-segmented {
  display: inline-flex;
  height: 32px;
  padding: 2px;
  border: 1px solid #d5ded9;
  border-radius: 7px;
  background: #ffffff;
}

.warehouse-segmented button {
  height: 26px;
  min-width: 42px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #586862;
  font-size: 12px;
  font-weight: 750;
}

.warehouse-segmented button.active {
  background: #233b34;
  color: #ffffff;
}

.warehouse-filter-clear {
  margin-left: auto;
  min-width: 64px;
}

.warehouse-sync-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid #f5d7a8;
  border-bottom: 1px solid #f5d7a8;
  background: #fff8ec;
}

.warehouse-sync-notice > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.warehouse-sync-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.warehouse-sync-summary,
.warehouse-sync-item > span {
  display: grid;
  gap: 4px;
}

.warehouse-sync-summary span,
.warehouse-sync-item small {
  color: var(--muted);
}

.warehouse-sync-select-all {
  padding: 10px 12px;
  border: 1px solid #d5ded9;
  border-radius: 7px;
  background: #f7faf9;
}

.warehouse-sync-select-all label,
.warehouse-sync-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}

.warehouse-sync-list {
  max-height: min(48vh, 460px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.warehouse-sync-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.warehouse-sync-item:last-child {
  border-bottom: 0;
}

.warehouse-sync-item:hover {
  background: #f7faf9;
}

.warehouse-sync-item:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.warehouse-operation-preview {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid #b9d5c8;
  border-radius: 7px;
  background: #edf7f2;
  color: #1f4939;
}

.warehouse-operation-preview span {
  font-size: 13px;
}

.warehouse-operation-preview.warning {
  border-color: #e6c17e;
  background: #fff8e8;
  color: #704b0b;
}

.warehouse-operation-preview.danger {
  border-color: #e0a6a6;
  background: #fff1f1;
  color: #842626;
}

.warehouse-operation-result {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.warehouse-result-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-left: 4px solid #2f6f58;
  background: #edf7f2;
}

.warehouse-result-status strong {
  color: #184635;
  font-size: 20px;
}

.warehouse-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.warehouse-result-grid > div,
.warehouse-result-line {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}

.warehouse-result-grid span,
.warehouse-result-line span {
  color: var(--muted);
  font-size: 12px;
}

.warehouse-result-grid strong {
  font-size: 21px;
}

.warehouse-result-line.warning {
  border-color: #e6c17e;
  background: #fff8e8;
}

.warehouse-timeline-section > div {
  grid-column: 1 / -1;
}

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

.warehouse-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  min-height: 74px;
}

.warehouse-timeline li::before {
  content: '';
  position: absolute;
  top: 15px;
  bottom: -5px;
  left: 6px;
  width: 2px;
  background: #d6e2dc;
}

.warehouse-timeline li:last-child::before {
  display: none;
}

.warehouse-timeline li > i {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border: 3px solid #d8eee4;
  border-radius: 50%;
  background: #2f6f58;
}

.warehouse-timeline li > div {
  display: grid;
  gap: 4px;
  padding-bottom: 16px;
}

.warehouse-timeline header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.warehouse-timeline time,
.warehouse-timeline span,
.warehouse-timeline small,
.warehouse-timeline-empty {
  color: var(--muted);
  font-size: 12px;
}

.warehouse-timeline p {
  margin: 0;
  color: var(--text);
}

.warehouse-sync-notice strong {
  color: #7c2d12;
  font-size: 14px;
}

.warehouse-sync-notice span {
  color: #9a5a14;
  font-size: 12px;
}

.warehouse-sync-notice button {
  white-space: nowrap;
}

.warehouse-mode-tabs {
  display: inline-flex;
  min-height: 38px;
  padding: 3px;
  border: 1px solid #cfd8dd;
  border-radius: 7px;
  background: #ffffff;
}

.warehouse-mode-tabs button {
  min-width: 84px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-strong);
  font-weight: 750;
}

.warehouse-mode-tabs button.active {
  background: #17352f;
  color: #ffffff;
}

.warehouse-workbench {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #eef4f3;
}

.warehouse-overview {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.warehouse-overview > div,
.warehouse-overview > button {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #cddbd6;
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.warehouse-overview > button {
  cursor: pointer;
}

.warehouse-overview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.warehouse-overview strong,
.warehouse-overview b {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.warehouse-overview > button.active {
  border-color: #0f766e;
  background: #e4f4f1;
}

.warehouse-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
  align-items: start;
  min-height: 0;
}

.warehouse-stage-column {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  max-height: min(760px, calc(100vh - 250px));
  min-height: 360px;
}

.warehouse-stage-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}

.warehouse-stage-column > header div {
  display: grid;
  gap: 2px;
}

.warehouse-stage-column > header strong {
  font-size: 16px;
  line-height: 1.25;
}

.warehouse-stage-column > header span {
  color: var(--muted);
  font-size: 12px;
}

.warehouse-stage-column > header b {
  min-width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #17352f;
  color: #ffffff;
  font-size: 13px;
}

.warehouse-stage-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.warehouse-job-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #cad8d4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.warehouse-job-card > header,
.warehouse-job-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.warehouse-job-card > header > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.warehouse-job-card > header strong,
.warehouse-job-card > header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-job-card > header strong {
  font-size: 14px;
}

.warehouse-job-card > header span {
  color: var(--muted);
  font-size: 12px;
}

.warehouse-stage-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.warehouse-stage-bar li {
  position: relative;
  display: grid;
  gap: 5px;
  color: #718093;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.warehouse-stage-bar li::before {
  content: "";
  position: absolute;
  top: 6px;
  left: calc(-50% + 10px);
  right: calc(50% + 10px);
  height: 2px;
  background: #d7e0ea;
}

.warehouse-stage-bar li:first-child::before {
  display: none;
}

.warehouse-stage-bar li.done::before,
.warehouse-stage-bar li.current::before {
  background: #0f766e;
}

.warehouse-stage-bar span {
  width: 14px;
  height: 14px;
  justify-self: center;
  border: 2px solid #cbd5df;
  border-radius: 999px;
  background: #ffffff;
}

.warehouse-stage-bar li.done,
.warehouse-stage-bar li.current {
  color: #0f5f58;
}

.warehouse-stage-bar li.done span {
  border-color: #0f766e;
  background: #0f766e;
}

.warehouse-stage-bar li.current span {
  border-color: #0f766e;
  box-shadow: 0 0 0 4px #dcefeb;
}

.warehouse-card-body {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.warehouse-card-body .thumb-button,
.warehouse-card-body .thumb {
  width: 54px;
  height: 54px;
}

.warehouse-card-meta {
  min-width: 0;
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

.warehouse-card-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-quantity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.warehouse-quantity-grid div {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid #e0e7e5;
  border-radius: 7px;
  background: #f8fbfa;
}

.warehouse-quantity-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.warehouse-quantity-grid dd {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
}

.warehouse-card-warning {
  margin: 0;
  padding: 8px 10px;
  border-radius: 7px;
  color: #7c2d12;
  background: #fff4e5;
  font-size: 12px;
}

.warehouse-card-transfer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #334155;
  background: #f8fafc;
  font-size: 12px;
}

.warehouse-card-transfer strong {
  color: var(--ink);
  text-align: right;
}

.warehouse-card-transfer.required {
  border-color: #f2c46d;
  color: #7c2d12;
  background: #fff8e8;
}

.warehouse-card-transfer.required strong {
  color: #9a3412;
}

.warehouse-card-transfer.pending {
  border-style: dashed;
  color: var(--muted);
}

.warehouse-transfer-quantity {
  display: inline-block;
  min-width: 28px;
  color: var(--muted-strong);
  font-weight: 800;
  text-align: center;
}

.warehouse-transfer-quantity.required {
  color: #9a3412;
}

.warehouse-stage-empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 18px;
  border: 1px dashed #b8c7c3;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.62);
}

.warehouse-stage-empty strong {
  color: var(--ink);
}

.warehouse-history-strip {
  display: grid;
  gap: 10px;
}

.warehouse-history-strip > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.warehouse-history-strip > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.warehouse-history-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #d4dfdc;
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.warehouse-history-item span,
.warehouse-history-item b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-history-item b {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.filter-field {
  min-width: 0;
}

.filter-field input,
.filter-field select {
  height: 38px;
}

.filter-field.compact {
  min-width: 96px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.pagination-left,
.pagination-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination select {
  width: auto;
  min-width: 108px;
  height: 36px;
  padding: 6px 9px;
}

.pagination-actions span {
  min-width: 92px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.page-jump {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.page-jump input {
  width: 72px;
  height: 36px;
  padding: 6px 8px;
}

.export-button {
  min-width: 68px;
  white-space: nowrap;
}

.export-scope {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.export-scope select {
  width: auto;
  min-width: 104px;
  height: 38px;
  padding: 6px 9px;
}

.table-scroll-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(520px, 100%);
  flex: 1;
}

.table-scroll-tools[hidden] {
  display: none;
}

.table-scroll-buttons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.table-scroll-buttons .icon-button {
  width: 38px;
  height: 34px;
  font-size: 13px;
  font-weight: 700;
}

.table-scroll-range {
  display: grid;
  grid-template-columns: auto minmax(180px, 420px);
  align-items: center;
  gap: 8px;
  min-width: 220px;
  max-width: 520px;
  flex: 1;
  color: var(--muted);
  font-size: 13px;
}

.table-scroll-range input {
  width: 100%;
  height: 34px;
  padding: 0;
  accent-color: var(--accent);
}

.table-wrap {
  overflow: auto;
  background: #fff;
}

.table-wrap.is-scrollable-x {
  cursor: grab;
}

.table-wrap.is-scrollable-x.dragging {
  cursor: grabbing;
  user-select: none;
}

.table-wrap tbody tr:hover,
.table-wrap tbody tr:hover td {
  background: #edf8f6;
}

.table-wrap tbody tr:hover .sticky-first,
.table-wrap tbody tr:hover td:first-child {
  background: #e2f3f0;
}

.table-wrap tbody tr:hover .sticky-action,
.table-wrap table.has-actions tbody tr:hover td:last-child {
  background: #e2f3f0;
}

.table-wrap th:first-child,
.table-wrap td:first-child,
.table-wrap .sticky-first {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #f7fbfb;
  box-shadow: 1px 0 0 var(--line);
}

.table-wrap .select-column {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  padding-left: 12px;
  padding-right: 8px;
  text-align: center;
}

.table-wrap .select-column input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.table-wrap .select-column + .sticky-first {
  left: 44px;
}

.table-wrap th:first-child,
.table-wrap thead .sticky-first {
  z-index: 5;
  background: var(--table-head);
}

.table-wrap table.has-actions th:last-child,
.table-wrap table.has-actions td:last-child,
.table-wrap .sticky-action {
  position: sticky;
  right: 0;
  z-index: 4;
  background: #f7fbfb;
  box-shadow: -1px 0 0 var(--line);
}

.table-wrap table.has-actions th:last-child {
  z-index: 6;
  background: var(--table-head);
}

.insert-row .sticky-first,
.insert-row .sticky-action {
  background: #f8fbfb;
}

.insert-row {
  background: #f8fbfb;
  box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line);
}

.insert-row td {
  padding: 10px;
  vertical-align: top;
  white-space: normal;
}

.table-stack {
  min-width: 190px;
}

.selection-category-cell {
  min-width: 260px;
}

.purchase-selection-cell {
  min-width: 280px;
}

.purchase-select-cell {
  min-width: 150px;
}

.purchase-status-cell {
  min-width: 170px;
}

.purchase-number-cell {
  min-width: 168px;
}

.purchase-shop-logistics-cell {
  min-width: 700px;
}

.purchase-shop-logistics {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(460px, 1.8fr);
  gap: 10px;
  align-items: start;
}

.purchase-shop-logistics > .table-field {
  margin-bottom: 0;
}

.purchase-shop-logistics .purchase-logistics-fields {
  margin-bottom: 0;
}

.purchase-logistics-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 8px;
  min-width: min(460px, 100%);
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #d9ebe7;
  border-radius: 7px;
  background: #fbfefd;
}

.purchase-logistics-fields .table-field {
  margin-bottom: 0;
}

.purchase-logistics-fields .table-field:last-child {
  grid-column: 1 / -1;
}

.inline-purchase-logistics {
  grid-column: 1 / -1;
}

.inline-purchase-remark {
  grid-column: span 2;
  min-width: 320px;
}

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

.table-field {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.table-field:last-child {
  margin-bottom: 0;
}

.required-mark {
  color: var(--danger);
  margin-left: 3px;
  font-weight: 700;
}

.table-field input,
.table-field select,
.table-field textarea {
  min-width: 0;
  padding: 10px 11px;
  color: var(--ink);
}

.table-field input,
.table-field select {
  height: 46px;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.table-field textarea {
  min-height: 108px;
  resize: vertical;
}

.table-field input[type="file"] {
  padding-top: 10px;
}

.cell-control {
  min-width: 120px;
  height: 34px;
  padding: 6px 8px;
}

.image-cell {
  min-width: 230px;
}

.wide-shop-column {
  min-width: 220px;
}

.product-info-cell {
  display: block;
  white-space: pre-line;
  line-height: 1.55;
}

.version-notes-cell {
  display: block;
  min-width: 360px;
  max-width: 620px;
  white-space: pre-line;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.medium-column {
  min-width: 150px;
}

.purchase-date-column,
.purchase-date-cell {
  min-width: 190px;
}

.purchase-date-input {
  min-width: 168px;
}

.copyable-sku {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: text;
}

.copy-sku-button {
  min-height: 26px;
  padding: 3px 8px;
  border-color: #c8d7d5;
  color: var(--accent-strong);
  background: #f3fbfa;
  font-size: 12px;
}

.copy-sku-button:hover {
  background: #e7f6f3;
}

.stock-balance {
  display: inline;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 700;
  line-height: inherit;
}

.stock-balance.empty {
  color: #4b5563;
}

.stock-balance.negative {
  color: var(--danger);
}

.auto-cell {
  min-width: 92px;
  line-height: 46px;
}

.stack-actions {
  display: grid;
  gap: 8px;
  min-width: 86px;
}

.insert-row .stack-actions button {
  min-height: 42px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

.table-wrap[data-wide-table="listings"] table {
  min-width: 1680px;
}

.table-wrap[data-wide-table="purchases"] table {
  min-width: 1900px;
}

th, td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted-strong);
  background: var(--table-head);
  font-size: 13px;
  font-weight: 750;
  box-shadow: inset 0 -1px 0 var(--line);
}

td {
  font-size: 14px;
  background: #fff;
}

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

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

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef6f5;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.1);
}

.status.warn {
  background: #fff7ed;
  color: var(--warn);
  box-shadow: inset 0 0 0 1px rgba(180, 83, 9, 0.12);
}

.status.danger {
  background: #fff1f0;
  color: var(--danger);
  box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.12);
}

.movement-direction,
.movement-quantity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 750;
  line-height: 1;
}

.movement-direction {
  min-width: 46px;
  font-size: 12px;
}

.movement-quantity {
  min-width: 52px;
  font-size: 14px;
}

.movement-direction.in,
.movement-quantity.in {
  background: #e7f6f3;
  color: var(--accent-strong);
}

.movement-direction.out,
.movement-quantity.out {
  background: #fff1f0;
  color: var(--danger);
}

.status.purchase-pending,
.purchase-status-select.purchase-pending {
  background: #fff7ed;
  color: #b45309;
}

.status.purchase-ordered,
.purchase-status-select.purchase-ordered {
  background: #eff6ff;
  color: #1d4ed8;
}

.status.purchase-partial,
.purchase-status-select.purchase-partial {
  background: #f5f3ff;
  color: #6d28d9;
}

.status.purchase-arrived,
.purchase-status-select.purchase-arrived {
  background: #ecfdf5;
  color: #047857;
}

.status.purchase-complete,
.purchase-status-select.purchase-complete {
  background: #eef6f5;
  color: var(--accent-strong);
}

.status.purchase-cancelled,
.purchase-status-select.purchase-cancelled {
  background: #fff1f0;
  color: var(--danger);
}

.status.purchase-unknown,
.purchase-status-select.purchase-unknown {
  background: #eef2f7;
  color: #475569;
}

.purchase-status-select {
  border-color: currentColor;
  font-weight: 650;
}

.phone-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 0 5px 5px 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf2f7;
  color: #334155;
  font-size: 12px;
  box-shadow: inset 0 0 0 1px #d8e1eb;
}

.thumb {
  width: 78px;
  height: 78px;
  display: block;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #f3f5f7;
  box-shadow: 0 1px 2px rgba(22, 32, 43, 0.1);
}

.thumb-button {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.image-empty {
  display: inline-grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 7px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
  background: #f8fafc;
}

.receipt-image-gallery {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 122px;
}

.receipt-thumb,
.receipt-image-empty {
  width: 42px;
  height: 42px;
}

.receipt-image-more {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: #f8fafc;
}

.image-source,
.upload-source {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.upload-source {
  padding: 10px;
  border: 1px solid #d9e4e1;
  border-radius: 8px;
  background: #fbfefd;
}

.upload-source label {
  margin: 0;
}

.upload-source textarea {
  min-height: 68px;
}

.sku-assets-form {
  grid-template-columns: 1fr;
}

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

.listing-edit-row textarea {
  min-width: 260px;
  min-height: 92px;
}

.table-attachment-field {
  display: grid;
  gap: 7px;
  min-width: 300px;
}

.listing-sku-cell {
  min-width: 180px;
}

.listing-spu-cell,
.listing-status-cell {
  min-width: 180px;
}

.listing-attachment-cell {
  min-width: 330px;
}

.listing-money-cell,
.listing-cost-cell,
.listing-date-cell {
  min-width: 170px;
}

.purchase-remark-cell {
  min-width: 320px;
}

.purchase-remark-textarea {
  min-width: 280px;
}

.table-upload-picker {
  min-height: 32px;
  width: max-content;
  padding: 6px 10px;
  font-size: 12px;
}

.sku-asset-summary {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #d9e4e1;
  border-radius: 8px;
  background: #f7faf9;
}

.sku-asset-summary strong {
  font-size: 16px;
}

.sku-asset-summary span {
  color: var(--muted);
  font-size: 12px;
}

.checkbox-field {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid #d9e4e1;
  border-radius: 8px;
  background: #ffffff;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.upload-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  width: fit-content;
  padding: 8px 13px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
}

.upload-picker:hover {
  background: var(--accent-strong);
}

.upload-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.image-paste-zone {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fbfcfd;
  font-size: 12px;
}

.image-paste-zone:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(13, 118, 110, 0.12);
}

.image-file-input {
  font-size: 12px;
}

.image-source-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.upload-file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}

.upload-preview-item {
  max-width: 220px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #d9e4e1;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
}

.upload-preview-item img {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: cover;
  background: #edf2f1;
}

.upload-preview-item b {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attachment-list a,
.attachment-list .attachment-link {
  max-width: 100%;
  display: inline-block;
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid #d9e4e1;
  border-radius: 7px;
  background: #f7faf9;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-list .attachment-link:hover {
  border-color: #8ab4a4;
  background: #eef7f3;
}

.attachment-list .attachment-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.image-edit-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.image-edit-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--muted);
}

.image-edit-summary strong {
  color: var(--ink);
}

.image-edit-field {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.image-edit-field .image-source {
  margin-bottom: 0;
}

#imagePreviewModal {
  width: min(1280px, calc(100vw - 24px));
}

.image-preview-modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.image-preview-modal img {
  display: block;
  max-width: 100%;
  width: 100%;
  max-height: min(86vh, 980px);
  margin: 0 auto;
  padding: 10px;
  object-fit: contain;
}

.file-preview-modal {
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background: var(--surface, #fff);
}

#filePreviewModal {
  width: min(1100px, calc(100vw - 32px));
  height: min(820px, calc(100vh - 32px));
  max-width: none;
  max-height: none;
  padding: 0;
}

.file-preview-modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

#filePreviewBody {
  min-height: 0;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: auto;
}

.file-preview-image,
.file-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

.file-preview-image {
  min-width: 0;
  min-height: 0;
}

.file-preview-download {
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
}

.file-download-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  text-decoration: none;
}

.actions {
  display: flex;
  gap: 7px;
}

.selection-actions {
  display: grid;
  gap: 6px;
}

.action-row {
  display: flex;
  gap: 7px;
}

.inline-purchase-panel {
  display: grid;
  gap: 9px;
  width: var(--inline-purchase-visible-width, 100%);
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfe7e2;
  border-radius: 7px;
  background: #f8fbfb;
}

.inline-purchase-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.inline-purchase-title strong {
  color: var(--ink);
  font-size: 15px;
}

.inline-purchase-title span {
  color: var(--muted);
  font-size: 13px;
}

.inline-purchase-grid {
  display: grid;
  grid-template-columns: 96px 140px 180px 112px 104px 100px minmax(180px, 1fr) max-content;
  gap: 8px;
  align-items: end;
  justify-content: start;
}

.inline-purchase-grid .table-field {
  gap: 3px;
  margin-bottom: 0;
}

.inline-purchase-grid .table-field input,
.inline-purchase-grid .table-field select {
  height: 34px;
  padding: 6px 8px;
}

.inline-purchase-note {
  min-height: 34px;
}

.inline-purchase-actions {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 8px;
}

.inline-purchase-actions button {
  height: 34px;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .inline-purchase-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .purchase-logistics-fields {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .purchase-shop-logistics-cell {
    min-width: 700px;
  }

  .purchase-shop-logistics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .warehouse-result-grid {
    grid-template-columns: 1fr;
  }

  .warehouse-timeline header {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .purchase-logistics-fields {
    grid-template-columns: 1fr;
    min-width: 0;
  }
}

.purchase-actions,
.warehouse-actions,
.movement-actions {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 5px;
  min-width: 0;
}

.actions button {
  min-height: 26px;
  padding: 4px 7px;
  font-size: 12px;
  line-height: 1.2;
}

.link-button {
  border: 0;
  padding: 0;
  color: var(--accent-strong);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

dialog {
  width: min(820px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: #fff;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.28);
}

#modal:has(#warehouseEditForm) {
  width: min(1080px, calc(100vw - 28px));
}

dialog::backdrop {
  background: rgba(17, 24, 32, 0.54);
}

.modal header, .modal footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.modal footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  padding: 16px;
}

.warehouse-edit-modal-body {
  max-height: min(72vh, 820px);
  overflow-y: auto;
  padding: 0;
  background: #eef4f3;
}

.warehouse-edit-form {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.warehouse-edit-hero {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid #c8d8d4;
  border-radius: 8px;
  background: #ffffff;
}

.warehouse-edit-image .thumb-button,
.warehouse-edit-image .thumb,
.warehouse-edit-image .image-empty {
  width: 88px;
  height: 88px;
}

.warehouse-edit-identity {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.warehouse-edit-titleline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.warehouse-edit-titleline strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-edit-identity > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-edit-context {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.warehouse-edit-metric {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #d7e2df;
  border-radius: 7px;
  background: #ffffff;
}

.warehouse-edit-metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.warehouse-edit-metric strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-edit-metric-warning {
  border-color: #f3c681;
  background: #fff8ec;
}

.warehouse-edit-metric-warning strong {
  color: #9a3412;
}

.warehouse-edit-rules {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #cfe0dc;
  border-radius: 7px;
  background: #f8fbfa;
}

.warehouse-edit-rules span {
  color: #28584f;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.warehouse-edit-rules b {
  color: #40514b;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.warehouse-edit-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #cbdad6;
  border-radius: 8px;
  background: #ffffff;
}

.warehouse-edit-section > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.warehouse-edit-section > header div {
  display: grid;
  gap: 2px;
}

.warehouse-edit-section > header strong {
  color: var(--ink);
  font-size: 15px;
}

.warehouse-edit-section > header span {
  color: var(--muted);
  font-size: 12px;
}

.warehouse-edit-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.warehouse-edit-section-grid .table-field {
  margin-bottom: 0;
}

.warehouse-edit-section-grid .table-field input,
.warehouse-edit-section-grid .table-field select {
  height: 42px;
}

.warehouse-edit-section-grid .table-field textarea {
  min-height: 104px;
}

.warehouse-edit-upload {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.warehouse-edit-upload .detail-item {
  box-shadow: none;
}

.warehouse-edit-upload-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.import-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.import-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.import-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.import-fields span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.detail-sections {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.detail-section {
  display: grid;
  gap: 10px;
}

.detail-section h3 {
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 750;
}

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

.detail-images {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
}

.detail-images .thumb,
.detail-images .image-empty {
  width: 112px;
  height: 112px;
}

.detail-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #fbfcfd;
  box-shadow: var(--shadow-soft);
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.detail-item strong {
  display: block;
  min-height: 22px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.detail-item a {
  color: var(--accent-strong);
}

.wide-detail {
  grid-column: 1 / -1;
}

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

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(22, 32, 43, 0.03);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

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

.wide {
  grid-column: 1 / -1;
}

.import-status {
  margin: 12px 0 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #eef3fb;
  color: #1f2a37;
  line-height: 1.45;
}

.import-status.is-success {
  background: #eef8f0;
  border-color: #cde7d3;
  color: #1f5b2e;
}

.import-status.is-error {
  background: #fff1f1;
  border-color: #f1c4c4;
  color: #8a1f1f;
}

#toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 1000;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  overflow-wrap: anywhere;
  transform: translate(-50%, -8px);
  transition: 160ms ease;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.28);
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.warehouse-task-workbench {
  padding: 14px 16px 16px;
  background: #edf3f2;
}

.warehouse-stage-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
}

.warehouse-stage-tabs button {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-content: center;
  padding: 10px 12px;
  border: 1px solid #c8d5d2;
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.warehouse-stage-tabs button:hover {
  border-color: #8eaaa4;
  background: #f8fbfa;
}

.warehouse-stage-tabs button.active {
  border-color: var(--accent);
  color: #fff;
  background: #173b35;
  box-shadow: inset 4px 0 0 #43b7a7;
}

.warehouse-stage-tabs span {
  font-size: 15px;
  font-weight: 800;
}

.warehouse-stage-tabs b {
  min-width: 28px;
  font-size: 21px;
  line-height: 1;
  text-align: right;
}

.warehouse-stage-tabs small {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-stage-tabs button.active small {
  color: #c8e8e2;
}

.warehouse-task-table-wrap {
  overflow: auto;
  border: 1px solid #c6d3d0;
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.warehouse-task-table {
  min-width: 980px;
}

.warehouse-task-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 9px 10px;
  color: #43534f;
  background: #e5eeec;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.warehouse-task-table td {
  padding: 9px 10px;
  vertical-align: middle;
}

.warehouse-task-table tbody tr {
  transition: background 120ms ease, box-shadow 120ms ease;
}

.warehouse-task-table tbody tr:hover {
  background: #f3f8f7;
}

.warehouse-task-table tbody tr.is-jit {
  box-shadow: inset 3px 0 0 #d97706;
}

.warehouse-task-identity {
  min-width: 225px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.warehouse-task-identity .thumb,
.warehouse-task-identity .thumb-button,
.warehouse-task-identity .image-empty {
  width: 48px;
  height: 48px;
}

.warehouse-task-identity > span,
.warehouse-task-source,
.warehouse-task-date,
.warehouse-task-quantity {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.warehouse-task-identity .link-button {
  justify-self: start;
  max-width: 180px;
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-task-identity small,
.warehouse-task-source span,
.warehouse-task-source small,
.warehouse-task-date small,
.warehouse-task-quantity small,
.warehouse-stock-check small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-task-identity em {
  min-height: 18px;
  display: flex;
  gap: 4px;
  overflow: hidden;
  font-style: normal;
}

.warehouse-task-flag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 5px;
  border: 1px solid #cbd8d5;
  border-radius: 3px;
  color: #49605a;
  background: #eef5f3;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.warehouse-task-flag.jit,
.warehouse-task-flag.warning {
  border-color: #eac27a;
  color: #8a4608;
  background: #fff6e5;
}

.warehouse-task-flag.danger {
  border-color: #efb8b2;
  color: #9f241b;
  background: #fff0ef;
}

.warehouse-task-source {
  min-width: 135px;
}

.warehouse-task-source strong {
  font-size: 12px;
}

.warehouse-task-quantity {
  min-width: 112px;
}

.warehouse-task-quantity > span,
.warehouse-task-date > span {
  color: var(--muted-strong);
  font-size: 11px;
}

.warehouse-task-quantity b {
  font-size: 20px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.warehouse-task-quantity.danger b {
  color: var(--danger);
}

.warehouse-task-input {
  min-width: 96px;
  display: grid;
  gap: 3px;
}

.warehouse-task-input > span {
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 750;
}

.warehouse-task-input input,
.warehouse-task-input select {
  min-height: 34px;
  padding: 6px 8px;
  border-color: #b8c8c4;
  background: #fff;
  font-variant-numeric: tabular-nums;
}

.warehouse-task-input input[type="number"] {
  width: 96px;
  font-size: 15px;
  font-weight: 750;
}

.warehouse-task-input-pair {
  display: flex;
  gap: 7px;
}

.warehouse-task-status {
  min-width: 130px;
}

.warehouse-task-resolution {
  min-width: 220px;
}

.warehouse-task-resolution input {
  width: 100%;
}

.warehouse-stock-check {
  min-width: 150px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 10px;
}

.warehouse-stock-check span {
  color: var(--muted-strong);
  font-size: 11px;
}

.warehouse-stock-check b {
  color: var(--ink);
  font-size: 16px;
}

.warehouse-stock-check small {
  grid-column: 1 / -1;
}

.warehouse-task-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.warehouse-task-actions button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.warehouse-task-empty {
  height: 220px;
  color: var(--muted);
  text-align: center;
}

.warehouse-task-empty strong,
.warehouse-task-empty span {
  display: block;
}

.warehouse-task-empty strong {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 15px;
}

.warehouse-workbench-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.warehouse-workbench-filters .warehouse-filter-main {
  grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) minmax(140px, 0.7fr) minmax(130px, 0.65fr) auto;
}

.warehouse-batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid #b7d6d0;
  background: #e8f5f2;
  box-shadow: inset 4px 0 0 var(--accent);
}

.warehouse-batch-selection {
  display: grid;
  gap: 2px;
}

.warehouse-batch-selection strong {
  font-size: 14px;
  color: var(--accent-strong);
}

.warehouse-batch-selection span {
  color: var(--muted-strong);
  font-size: 12px;
}

.warehouse-batch-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

#modal:has(.warehouse-batch-workbench) {
  width: min(1180px, calc(100vw - 28px));
}

.warehouse-batch-modal-body {
  max-height: min(76vh, 860px);
  overflow: auto;
  padding: 0;
  background: #edf3f2;
}

.warehouse-batch-workbench {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.batch-workbench-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 17px;
  border: 1px solid #bfd3cf;
  border-radius: 8px;
  background: #fff;
}

.batch-workbench-heading > div:first-child {
  display: grid;
  gap: 3px;
}

.batch-kicker {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.batch-workbench-heading strong {
  font-size: 19px;
  line-height: 1.25;
}

.batch-workbench-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.batch-count {
  min-width: 92px;
  display: grid;
  justify-items: end;
  color: var(--accent-strong);
}

.batch-count b {
  font-size: 28px;
  line-height: 1;
}

.batch-count span {
  color: var(--muted);
  font-size: 12px;
}

.batch-shared-fields {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(300px, 1.55fr);
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfb;
}

.batch-shared-fields > .upload-source {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px 12px;
  align-items: end;
}

.batch-shared-fields > .upload-source .upload-file-preview,
.batch-shared-fields > .upload-source small {
  grid-column: 1 / -1;
}

.batch-shared-note {
  display: grid;
  gap: 3px;
}

.batch-shared-note span {
  color: var(--muted);
  font-size: 12px;
}

.batch-fill-button {
  justify-self: end;
}

.batch-table-wrap {
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}

.batch-workbench-table {
  min-width: 820px;
}

.batch-workbench-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #e8f0ef;
}

.batch-workbench-table tbody tr:nth-child(even) {
  background: #f8fafb;
}

.batch-job-identity {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 210px;
}

.batch-job-identity .thumb,
.batch-job-identity .thumb-button,
.batch-job-identity .image-empty {
  width: 46px;
  height: 46px;
}

.batch-job-identity > span,
.batch-quantity-summary {
  display: grid;
  gap: 2px;
}

.batch-job-identity small,
.batch-quantity-summary span,
.batch-row-rule {
  color: var(--muted);
  font-size: 12px;
}

.batch-row-fields {
  display: flex;
  align-items: end;
  gap: 8px;
  min-width: 310px;
}

.batch-number-field,
.batch-compact-field,
.batch-text-field {
  display: grid;
  gap: 3px;
  min-width: 88px;
}

.batch-text-field {
  min-width: 180px;
  flex: 1;
}

.batch-number-field span,
.batch-compact-field span,
.batch-text-field span {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 650;
}

.batch-row-fields input,
.batch-row-fields select {
  min-height: 34px;
  padding: 6px 8px;
}

.batch-number-field input {
  width: 88px;
  font-variant-numeric: tabular-nums;
}

.batch-commit-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #c7d6e6;
  border-radius: 7px;
  color: #334155;
  background: #f3f7fb;
  font-size: 12px;
}

.batch-commit-note strong {
  color: #1e3a5f;
}

@media (max-width: 920px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    overflow-y: visible;
    min-height: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  #nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #nav .nav-section-label { grid-column: 1 / -1; }
  #nav .nav-collapsible-group { grid-column: 1 / -1; }
  #nav .nav-collapsible-content { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #nav .nav-flow { grid-column: 1 / -1; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  #nav .nav-flow::before { display: none; }
  #nav .nav-flow-item { justify-content: center; }

  .app {
    grid-column: 1;
    padding: 20px;
  }

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

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-insights-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-sections {
    grid-template-columns: 1fr;
  }

  .dashboard-panel-wide {
    grid-row: auto;
  }

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

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

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

  .warehouse-workbench-filters .warehouse-filter-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .warehouse-filter-summary {
    justify-content: flex-start;
  }

  .warehouse-filter-secondary {
    align-items: flex-start;
    flex-direction: column;
  }

  .warehouse-filter-clear {
    margin-left: 0;
  }

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

  .warehouse-board {
    grid-template-columns: 1fr;
  }

  .warehouse-history-strip > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .warehouse-edit-context {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .app {
    padding: 16px;
  }

  h1 {
    font-size: 22px;
  }

  .dashboard-grid, .form-grid, .detail-grid, .detail-section-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-sections {
    padding: 14px;
  }

  .dashboard-command-center { margin: 14px 14px 0; }
  .dashboard-insights { margin: 14px 14px 0; }
  .dashboard-insights-header .segmented-control { width: 100%; }
  .dashboard-insights-header .segmented-control button { flex: 1; }
  .dashboard-task-group > header { align-items: flex-start; }
  .dashboard-task-group > header > div { align-items: flex-start; flex-direction: column; gap: 2px; }
  .dashboard-task-list { grid-template-columns: 1fr; }
  .dashboard-task { grid-template-columns: 38px minmax(0, 1fr) auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .dashboard-task:nth-last-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .dashboard-task:last-child { border-bottom: 0; }
  .dashboard-task > u { display: none; }
  .dashboard-command-center > header h2 { font-size: 16px; }
  .workflow-trail header { align-items: flex-start; flex-direction: column; }
  .workflow-trail > div { grid-template-columns: 1fr; }
  .workflow-step::after { display: none; }
  .workflow-step { min-height: 36px; }

  .dashboard-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-row strong,
  .dashboard-row em {
    white-space: normal;
  }

  .platform-grid {
    grid-template-columns: 1fr;
  }

  .platform-entry-page {
    padding: 14px;
  }

  nav {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .toolbar-left,
  .toolbar-actions,
  .pagination-left,
  .pagination-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .list-filters {
    grid-template-columns: 1fr;
  }

  .warehouse-filter-panel {
    padding: 12px;
  }

  .warehouse-filter-main {
    grid-template-columns: 1fr;
  }

  .warehouse-filter-group {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }

  .warehouse-chip-row {
    width: 100%;
  }

  .warehouse-filter-clear,
  .warehouse-segmented {
    width: 100%;
  }

  .warehouse-segmented button {
    flex: 1;
  }

  .warehouse-mode-tabs {
    width: 100%;
  }

  .warehouse-mode-tabs button {
    flex: 1;
  }

  .warehouse-workbench {
    padding: 12px;
  }

  .warehouse-task-workbench {
    padding: 10px;
  }

  .warehouse-stage-tabs {
    gap: 6px;
  }

  .warehouse-stage-tabs button {
    min-height: 68px;
    padding: 9px 10px;
  }

  .warehouse-stage-tabs small {
    display: none;
  }

  .warehouse-workbench-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .warehouse-task-input input,
  .warehouse-task-input select,
  .warehouse-task-actions button {
    min-height: 44px;
  }

  .warehouse-overview {
    grid-template-columns: 1fr;
  }

  .warehouse-job-card > header,
  .warehouse-job-card > footer,
  .warehouse-history-strip > header {
    align-items: stretch;
    flex-direction: column;
  }

  .warehouse-history-strip > div {
    grid-template-columns: 1fr;
  }

  .warehouse-edit-modal-body {
    max-height: 74vh;
  }

  .warehouse-edit-form {
    padding: 12px;
  }

  .warehouse-edit-hero {
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: start;
  }

  .warehouse-edit-image .thumb-button,
  .warehouse-edit-image .thumb,
  .warehouse-edit-image .image-empty {
    width: 64px;
    height: 64px;
  }

  .warehouse-edit-titleline {
    align-items: flex-start;
    flex-direction: column;
  }

  .warehouse-edit-identity > span,
  .warehouse-edit-titleline strong {
    white-space: normal;
  }

  .warehouse-edit-context,
  .warehouse-edit-section-grid,
  .warehouse-edit-rules {
    grid-template-columns: 1fr;
  }

  .pagination-actions span {
    min-width: 0;
    text-align: left;
  }

  button,
  input,
  select {
    min-height: 42px;
  }

  .dashboard-grid,
  .form-grid,
  .detail-grid,
  .import-panel {
    padding: 14px;
  }

  .table-scroll-tools {
    min-width: 100%;
  }

  .warehouse-batch-bar,
  .batch-workbench-heading,
  .batch-commit-note {
    align-items: stretch;
    flex-direction: column;
  }

  .warehouse-batch-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .batch-count {
    justify-items: start;
  }

  .warehouse-batch-workbench {
    padding: 10px;
  }

  .batch-shared-fields {
    grid-template-columns: 1fr;
  }

  .batch-shared-fields > .upload-source {
    grid-template-columns: 1fr;
  }

  .batch-shared-fields > .upload-source .upload-file-preview,
  .batch-shared-fields > .upload-source small {
    grid-column: auto;
  }

  .batch-fill-button {
    justify-self: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
