:root {
  --ink: #182230;
  --muted: #667085;
  --soft: #98a2b3;
  --line: #dde4ee;
  --line-strong: #c9d3e2;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eaf1ff;
  --ok: #14804a;
  --ok-soft: #eaf8ef;
  --warn: #b45309;
  --warn-soft: #fff7e6;
  --danger: #c2410c;
  --danger-soft: #fff1eb;
  --shadow: 0 10px 28px rgba(16, 24, 40, .07);
  --shadow-soft: 0 2px 10px rgba(16, 24, 40, .05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #eef4ff 0, rgba(238, 244, 255, 0) 260px),
    var(--bg);
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

a:hover {
  color: var(--brand-dark);
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(221, 228, 238, .92);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px max(24px, calc((100% - 1220px) / 2));
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(16, 24, 40, .03);
}

.top .row {
  justify-content: flex-end;
}

.top form {
  margin: 0;
}

.top a:not(.brand) {
  color: #344054;
  border-radius: 8px;
  padding: 7px 9px;
  font-weight: 600;
  white-space: nowrap;
}

.top a:not(.brand):hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand::before {
  content: "";
  width: 11px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2f80ed, #12b76a);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, .08);
}

.wrap {
  max-width: 1220px;
  margin: 30px auto 48px;
  padding: 0 22px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-soft);
}

a.card,
.grid > a.card {
  display: block;
  color: inherit;
}

a.card:hover,
.grid > a.card:hover {
  border-color: #b9c8e9;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.project-card h3 {
  margin-right: 10px;
}

.project-card.is-complete {
  background: linear-gradient(180deg, #fff, #fbfdfc);
}

.project-progress {
  display: grid;
  gap: 8px;
  margin: 15px 0 12px;
}

.project-progress-head {
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.project-progress-head strong {
  color: var(--muted);
  font-size: 12px;
}

.project-progress-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
  border: 1px solid #dce5f2;
}

.project-progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 8px;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #12b76a);
}

.project-progress-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.project-progress-step {
  height: 5px;
  border-radius: 999px;
  background: #e5ebf4;
}

.project-progress-step.done {
  background: #12b76a;
}

.project-progress-step.active {
  background: #2563eb;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 13px;
}

.workflow-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.inspection-section-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
  position: relative;
}

.inspection-section-nav {
  position: sticky;
  top: 88px;
  grid-column: 1;
  grid-row: 1;
  width: 168px;
  justify-self: start;
  transform: translateX(calc(-100% - 16px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.inspection-section-nav h2 {
  margin-top: 0;
  font-size: 16px;
}

.inspection-section-nav nav {
  display: grid;
  gap: 8px;
}

.inspection-section-nav a {
  display: grid;
  gap: 3px;
  padding: 9px;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: #344054;
  font-weight: 700;
}

.inspection-section-nav a:hover {
  border-color: #9bb3e8;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.inspection-section-nav strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inspection-section-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

@media (max-width: 1380px) {
  .inspection-section-layout {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 14px;
  }

  .inspection-section-nav {
    grid-column: 1;
    transform: translateX(-18px);
  }

  .inspection-section-main {
    grid-column: 2;
  }
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #344054;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.filter-pill:hover,
.filter-pill.active {
  border-color: #9bb3e8;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.placeholder-slots {
  display: grid;
  gap: 12px;
}

.placeholder-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.between {
  justify-content: space-between;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  font-size: 28px;
  line-height: 1.25;
  margin: 0 0 18px;
  letter-spacing: 0;
}

h2 {
  font-size: 19px;
  line-height: 1.35;
  margin: 0 0 14px;
}

h3 {
  font-size: 16px;
  line-height: 1.4;
  margin: 0 0 8px;
}

p {
  margin: 0 0 12px;
}

p:last-child {
  margin-bottom: 0;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  min-height: 40px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease, opacity .15s ease;
}

.btn:hover {
  background: var(--brand-dark);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}

.btn.secondary {
  background: #fff;
  color: var(--brand);
  border-color: #b9c8e9;
  box-shadow: none;
}

.btn.secondary:hover {
  background: var(--brand-soft);
  border-color: #9bb3e8;
  color: var(--brand-dark);
}

.btn.danger {
  background: #fff;
  color: var(--danger);
  border-color: #f4c7b7;
  box-shadow: none;
}

.btn.danger:hover {
  background: var(--danger-soft);
  border-color: #ef9f83;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .5;
  box-shadow: none;
  transform: none;
}

input,
select,
textarea {
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 220px;
  min-height: 40px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

textarea {
  line-height: 1.55;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #84a7ee;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

input[type=file] {
  color: var(--muted);
  max-width: 100%;
}

input[type=radio] {
  min-width: 0;
  width: auto;
  min-height: 0;
  padding: 0;
  margin: 0 6px 0 0;
}

label {
  font-size: 14px;
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}

.field {
  margin-bottom: 14px;
}

.option {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 500;
  margin: 0 10px 6px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  min-height: 24px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  background: var(--brand-soft);
  color: var(--brand-dark);
  white-space: nowrap;
}

.badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

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

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

th {
  color: #475467;
  background: #f8fafc;
  font-weight: 800;
}

tr:hover td {
  background: #fbfdff;
}

td:first-child,
th:first-child {
  border-left: 1px solid transparent;
}

td {
  overflow-wrap: anywhere;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-scroll table {
  min-width: 1100px;
}

.table-scroll th {
  white-space: nowrap;
}

.clear-overview-card {
  width: min(1880px, calc(100vw - 32px));
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.clear-overview-scroll {
  overflow-x: auto;
  background: #fff;
}

.clear-overview-table {
  min-width: 1840px;
  table-layout: fixed;
}

.clear-overview-table th,
.clear-overview-table td {
  padding: 9px 10px;
  font-size: 13px;
  vertical-align: middle;
}

.clear-overview-table th {
  white-space: normal;
  word-break: keep-all;
  line-height: 1.25;
}

.clear-overview-table th span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.clear-overview-table th:first-child,
.clear-overview-table td:first-child {
  width: 150px;
  min-width: 150px;
  text-align: left;
}

.clear-overview-table th:nth-child(n+2),
.clear-overview-table td:nth-child(n+2) {
  width: 96px;
  min-width: 96px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.clear-overview-table .clear-diff-ok {
  color: var(--ok);
  font-weight: 700;
}

.clear-overview-table .clear-diff-bad {
  color: var(--danger);
  font-weight: 800;
}

.shipment-sheet-shell {
  width: min(1920px, calc(100vw - 32px));
  margin-left: 50%;
  transform: translateX(-50%);
}

.shipment-sheet-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.shipment-sheet-toolbar h1 {
  margin: 0;
  font-size: 24px;
}

.shipment-sheet-filter {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(5, minmax(132px, .8fr)) repeat(2, minmax(142px, .8fr)) auto auto;
  gap: 7px;
  align-items: center;
  margin-bottom: 8px;
}

.shipment-sheet-filter input,
.shipment-sheet-filter select,
.shipment-sheet-filter .btn {
  min-width: 0;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 13px;
}

.shipment-sheet-wrap {
  max-height: calc(100vh - 205px);
  min-height: 520px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: #fff;
}

.shipment-sheet-table {
  min-width: 2600px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.shipment-sheet-table th,
.shipment-sheet-table td {
  height: 32px;
  padding: 6px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  vertical-align: middle;
  background: #fff;
}

.shipment-sheet-table th {
  position: sticky;
  top: 0;
  z-index: 6;
  color: var(--ink);
  font-weight: 700;
  background: #fff;
  border-bottom-color: var(--line-strong);
}

.shipment-sheet-table td {
  overflow-wrap: normal;
}

.shipment-sheet-table .shipment-col-1 {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  white-space: normal;
}

.shipment-sheet-table .shipment-col-2 {
  position: sticky;
  left: 180px;
  z-index: 4;
  width: 108px;
  min-width: 108px;
  max-width: 108px;
}

.shipment-sheet-table .shipment-col-3 {
  position: sticky;
  left: 288px;
  z-index: 4;
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}

.shipment-sheet-table .shipment-col-4 {
  position: sticky;
  left: 420px;
  z-index: 4;
  width: 92px;
  min-width: 92px;
  max-width: 92px;
  box-shadow: 8px 0 12px -12px rgba(16, 24, 40, .35);
}

.shipment-sheet-table .shipment-col-6 {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}

.shipment-sheet-table .shipment-col-8 {
  width: 92px;
  min-width: 92px;
  max-width: 92px;
}

.shipment-sheet-table th.shipment-col-1,
.shipment-sheet-table th.shipment-col-2,
.shipment-sheet-table th.shipment-col-3,
.shipment-sheet-table th.shipment-col-4 {
  z-index: 8;
}

.shipment-sheet-table tr:hover td {
  background: #fbfdff;
}

.shipment-sheet-table tr:hover .shipment-col-1,
.shipment-sheet-table tr:hover .shipment-col-2,
.shipment-sheet-table tr:hover .shipment-col-3,
.shipment-sheet-table tr:hover .shipment-col-4 {
  background: #fbfdff;
}

.po-pool-card {
  width: min(1600px, calc(100vw - 48px));
  margin-left: 50%;
  transform: translateX(-50%);
  padding: 20px;
}

.po-pool-table-wrap {
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.po-pool-table {
  min-width: 1880px;
  border-collapse: separate;
  border-spacing: 0;
}

.po-pool-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-strong);
}

.po-pool-table th,
.po-pool-table td {
  padding: 9px 10px;
  font-size: 13px;
  vertical-align: middle;
}

.po-pool-table td:nth-child(n+4):nth-child(-n+15),
.po-pool-table th:nth-child(n+4):nth-child(-n+15) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.po-pool-table .po-sticky {
  position: sticky;
  z-index: 4;
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
}

.po-pool-table th.po-sticky {
  z-index: 5;
  background: #f8fafc;
}

.po-pool-table .po-summary-row td {
  position: sticky;
  top: 38px;
  z-index: 2;
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
  color: #7c2d12;
  font-weight: 700;
}

.po-pool-table .po-summary-row .po-sticky {
  z-index: 4;
  background: #fff7ed;
}

.po-pool-table .po-sticky-1 {
  left: 0;
  width: 126px;
  min-width: 126px;
  max-width: 126px;
}

.po-pool-table .po-sticky-2 {
  left: 126px;
  width: 168px;
  min-width: 168px;
  max-width: 168px;
}

.po-note-form {
  display: grid;
  grid-template-columns: 190px auto;
  gap: 6px;
  align-items: center;
  min-width: 270px;
}

.po-note-form input {
  width: 190px;
  min-width: 0;
  height: 34px;
  padding: 7px 9px;
  font-size: 13px;
}

.po-note-form .btn,
.po-actions .btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.po-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

.steps {
  display: flex;
  gap: 8px;
  overflow: auto;
  margin: 18px 0 0;
  padding: 2px 2px 4px;
  scrollbar-width: thin;
}

.step {
  min-width: 148px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.step.current,
.step.selected {
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-color: #a9bfef;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .08);
}

.step.done {
  background: var(--ok-soft);
  border-color: #bfe6cd;
  color: var(--ok);
}

.alert {
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid #fde6b8;
  background: var(--warn-soft);
  color: #7a2e0e;
  margin-bottom: 16px;
}

.alert.danger {
  background: var(--danger-soft);
  border-color: #f6c9b9;
  color: var(--danger);
}

.login {
  max-width: 430px;
  margin: 10vh auto;
}

.login .card {
  padding: 34px;
  box-shadow: var(--shadow);
}

.login input,
.login .btn {
  width: 100%;
}

.empty {
  text-align: center;
  padding: 38px 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, .72);
  border-style: dashed;
}

.source-panel {
  background: #f7fbff;
  border: 1px solid #d6e4ff;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0 20px;
}

.source-panel h3 {
  color: #1849a9;
}

.source-panel.compact {
  padding: 14px;
  margin: 14px 0 16px;
  background: #f8fafc;
  border-color: #dbe3ef;
}

.stage-card {
  border-top: 4px solid var(--brand);
}

.adjustment-panel {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fbfcfe;
}

.adjustment-panel h3 {
  margin-top: 0;
}

.adjustment-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.adjustment-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  color: #475467;
}

.adjustment-field input {
  width: 100%;
  min-width: 0;
}

.adjustment-wide {
  grid-column: span 2;
}

.adjustment-reason {
  grid-column: span 2;
}

.adjustment-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 4px;
  color: #475467;
}

.adjustment-check input {
  width: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
}

.adjustment-actions {
  display: flex;
  justify-content: flex-end;
}

.adjustment-actions .btn {
  min-width: 116px;
}

.workflow-status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
}

.workflow-status .badge {
  padding: 6px 11px;
  min-height: 30px;
}

.workflow-actions {
  margin-top: 16px;
}

.upload-zone {
  border: 1px dashed #aebfda;
  background: linear-gradient(180deg, #fbfdff, #f7faff);
  border-radius: 8px;
  padding: 16px;
  margin: 14px 0;
}

.upload-zone:hover {
  border-color: #84a7ee;
  background: #f8fbff;
}

.upload-zone input[type=file] {
  background: #fff;
  max-width: 100%;
}

.file-card h2 {
  margin-bottom: 0;
}

.file-table th {
  background: #f8fafc;
  color: #475467;
  font-weight: 800;
}

.file-table td:first-child {
  word-break: break-word;
}

.file-cell {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.file-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
  margin-top: 7px;
  flex: 0 0 auto;
}

.file-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
  min-height: 18px;
}

.file-note {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.file-time {
  white-space: nowrap;
  color: var(--muted);
}

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

.inline-actions form {
  margin: 0;
}

.preline {
  white-space: pre-line;
  max-width: 520px;
}

details {
  margin-top: 8px;
}

summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 700;
}

details pre {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: #344054;
  font-size: 12px;
}

.fba-summary-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 14px 0 10px;
}

.inspection-overview .fba-summary-panel {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.inspection-batch-summary tr.selected td {
  background: #f5fbff;
}

.fba-summary-panel > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 13px 14px;
}

.fba-summary-panel span {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.fba-summary-panel strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.fba-summary-code strong {
  font-size: 18px;
}

.fba-match-details {
  margin-top: 12px;
}

.fba-match-details table {
  margin-top: 10px;
}

.inspection-review-table th:nth-child(2),
.inspection-review-table td:nth-child(2) {
  width: 420px;
}

.inspection-compare {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 36px minmax(120px, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 320px;
}

.inspection-preview {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.inspection-preview img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: #fff;
}

.inspection-preview.empty {
  height: 182px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.inspection-preview figcaption {
  border-top: 1px solid var(--line);
  padding: 6px 8px;
  font-size: 12px;
  color: var(--ink);
  line-height: 1.35;
}

.inspection-preview figcaption span {
  display: block;
  color: var(--muted);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inspection-vs {
  text-align: center;
  font-weight: 800;
  color: var(--muted);
  font-size: 13px;
}

.inspection-compare.full {
  grid-template-columns: minmax(180px, 1fr) 36px minmax(180px, 1fr);
  align-items: start;
  min-width: 520px;
}

.inspection-gallery {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.inspection-gallery.all-photos {
  max-height: 420px;
  overflow: auto;
  padding: 4px;
}

.inspection-gallery-title {
  font-weight: 800;
  font-size: 13px;
  margin: 0 0 8px;
  color: var(--muted);
}

.inspection-child-rule {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: -2px 0 8px;
  padding: 7px 8px;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  background: #f0f9ff;
  color: #075985;
  font-size: 12px;
  line-height: 1.35;
}

.inspection-child-rule span {
  font-weight: 800;
}

.inspection-child-rule strong {
  color: #0f172a;
  font-weight: 700;
}

.inspection-thumb {
  width: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
}

.inspection-thumb img {
  display: block;
  width: 100%;
  height: 74px;
  object-fit: cover;
  background: #f8fafc;
}

.inspection-thumb span {
  display: block;
  padding: 5px 6px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inspection-thumb:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.inspection-gallery-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 22px 14px;
  font-size: 13px;
  background: #f8fafc;
}

.inspection-progress {
  border: 1px solid #d6e4ff;
  background: #f7fbff;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0 16px;
}

.upload-progress-box {
  flex-basis: 100%;
  width: 100%;
  border: 1px solid #d6e4ff;
  background: #f7fbff;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
}

form.is-uploading {
  opacity: .92;
}

.upload-lock-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 86px;
  background: rgba(245, 247, 251, .34);
  cursor: wait;
}

.upload-lock-layer[hidden] {
  display: none;
}

.upload-lock-panel {
  display: grid;
  gap: 4px;
  max-width: min(520px, calc(100vw - 32px));
  border: 1px solid #bcd2ff;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 12px 16px;
  color: #344054;
}

.upload-lock-panel strong {
  color: var(--brand-dark);
}

.upload-lock-panel span {
  color: var(--muted);
  font-size: 13px;
}

.progressbar {
  height: 9px;
  background: #e4e7ec;
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0;
}

.progressbar span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width .2s ease;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(16, 24, 40, .80);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.image-modal.open {
  display: flex;
}

.image-modal-panel {
  position: relative;
  max-width: min(1120px, 94vw);
  max-height: 92vh;
  background: #fff;
  border-radius: 8px;
  padding: 54px 14px 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .40);
  overflow: hidden;
}

.image-modal-stage {
  width: min(1080px, calc(94vw - 28px));
  max-width: 100%;
  max-height: calc(92vh - 112px);
  overflow: auto;
  background: #f8fafc;
  text-align: center;
  overscroll-behavior: contain;
}

.image-modal-stage img {
  display: block;
  max-width: calc(94vw - 28px);
  max-height: calc(92vh - 112px);
  object-fit: contain;
  margin: auto;
  background: #f8fafc;
  transform-origin: center center;
  transition: width .16s ease, transform .16s ease;
  user-select: none;
}

.image-modal-stage img.is-sideways {
  max-width: calc(92vh - 132px);
  max-height: calc(94vw - 48px);
}

.image-modal-title {
  padding-top: 10px;
  color: var(--ink);
  font-size: 14px;
  word-break: break-all;
}

.image-modal-close {
  border: 0;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  background: #172033;
  color: #fff;
  font-size: 24px;
  line-height: 30px;
  cursor: pointer;
}

.image-modal-toolbar {
  position: absolute;
  right: 10px;
  top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 2;
}

.image-modal-toolbar button {
  border: 0;
  border-radius: 999px;
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
  background: #172033;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.image-modal-toolbar button:hover {
  background: var(--brand);
}

@media (max-width: 900px) {
  .top {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 18px;
  }

  .top .row {
    justify-content: flex-start;
    gap: 8px;
  }

  .wrap {
    margin-top: 22px;
    padding: 0 16px;
  }

  .inspection-section-layout {
    grid-template-columns: 1fr;
  }

  .inspection-section-nav {
    position: static;
    grid-column: 1;
    grid-row: auto;
    width: auto;
    transform: none;
  }

  .inspection-section-nav nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .inspection-section-nav a {
    min-width: 190px;
  }

  .inspection-section-main {
    grid-column: 1;
    grid-row: auto;
  }

  .card {
    padding: 18px;
  }

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

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 24px;
  }

  .row {
    align-items: stretch;
  }

  .row > input,
  .row > select,
  .row > textarea,
  .row > .btn,
  .row > form,
  .upload-zone input[type=file] {
    width: 100%;
  }

  input,
  select,
  textarea {
    min-width: 0;
    width: 100%;
  }

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

  .adjustment-wide,
  .adjustment-reason {
    grid-column: auto;
  }

  .adjustment-actions,
  .adjustment-actions .btn {
    width: 100%;
  }

  .po-pool-card {
    width: auto;
    margin-left: 0;
    transform: none;
  }

  .po-pool-table-wrap {
    max-height: none;
  }

  .shipment-sheet-shell {
    width: auto;
    margin-left: 0;
    transform: none;
  }

  .shipment-sheet-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .shipment-sheet-filter {
    grid-template-columns: 1fr;
  }

  .shipment-sheet-wrap {
    max-height: none;
    min-height: 360px;
  }

  .shipment-sheet-table {
    display: table;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

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

  .fba-summary-code {
    grid-column: 1 / -1;
  }

  td {
    white-space: normal;
  }

  .steps {
    gap: 7px;
  }

  .step {
    min-width: 132px;
  }

  .inspection-review-table,
  .inspection-review-table tbody,
  .inspection-review-table tr,
  .inspection-review-table th,
  .inspection-review-table td {
    display: block;
    width: 100%;
  }

  .inspection-review-table tr {
    border-bottom: 1px solid var(--line);
  }

  .inspection-review-table th {
    display: none;
  }

  .inspection-compare,
  .inspection-compare.full {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .inspection-vs {
    padding: 2px 0;
  }

  .inspection-preview img {
    height: 180px;
  }

  .inspection-thumb {
    width: 88px;
  }

  .image-modal {
    padding: 12px;
  }

  .image-modal-stage {
    width: calc(100vw - 52px);
    max-height: calc(100vh - 156px);
  }

  .image-modal-stage img {
    max-width: calc(100vw - 52px);
    max-height: calc(100vh - 156px);
  }

  .image-modal-stage img.is-sideways {
    max-width: calc(100vh - 156px);
    max-height: calc(100vw - 52px);
  }

  .image-modal-panel {
    padding-top: 96px;
  }

  .image-modal-toolbar {
    left: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .image-modal-toolbar button {
    height: 32px;
    min-width: 32px;
    padding: 0 9px;
  }
}

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

.dashboard-heading h1,
.dashboard-filters,
.dashboard-metric strong {
  margin-top: 0;
}

.dashboard-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  align-items: end;
}

.dashboard-filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-filter-search {
  grid-column: span 2;
}

.dashboard-filter-actions {
  align-self: end;
  min-height: 42px;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.dashboard-metric {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(145deg, #fff, #f8fbff);
  box-shadow: var(--shadow-soft);
}

.dashboard-metric > span {
  color: var(--muted);
  font-weight: 700;
}

.dashboard-metric strong {
  color: #0f3273;
  font-size: clamp(24px, 2vw, 32px);
  line-height: 1.25;
}

.dashboard-metric small {
  color: var(--muted);
}

.dashboard-metric.needs-attention {
  border-color: #fed7aa;
  background: linear-gradient(145deg, #fff, #fff7ed);
}

.dashboard-metric.needs-attention strong {
  color: var(--danger);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, .8fr);
  gap: 16px;
}

.dashboard-grid .card {
  min-width: 0;
}

.dashboard-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.dashboard-table-wrap table {
  min-width: 760px;
}

.dashboard-all-projects .dashboard-table-wrap table {
  min-width: 1420px;
}

.dashboard-project-edit {
  display: grid;
  grid-template-columns: 145px minmax(160px, 1fr) auto;
  gap: 7px;
  min-width: 390px;
}

.dashboard-project-edit input,
.dashboard-project-edit button {
  min-width: 0;
}

@media (max-width: 980px) {
  .dashboard-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-filter-search {
    grid-column: span 1;
  }

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

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

@media (max-width: 640px) {
  .dashboard-filters,
  .dashboard-metrics,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-wide {
    grid-column: auto;
  }
}

.site-footer {
  padding: 18px 16px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--primary);
  text-decoration: underline;
}
