:root {
  color-scheme: light;
  --ink: #182126;
  --muted: #64717a;
  --line: #dde5e8;
  --soft: #f4f7f8;
  --surface: #ffffff;
  --primary: #126b5f;
  --primary-dark: #0b4f46;
  --accent: #d86d3f;
  --warning: #f1b957;
  --danger: #ca4b52;
  --success: #27845f;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--soft);
}

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

button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

button:hover {
  border-color: #b8c8ca;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  padding: 18px 12px;
  color: #d9e7e4;
  background: #132421;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 20px;
}

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

.brand strong {
  color: #fff;
  font-size: 16px;
}

.brand small {
  margin-top: 4px;
  color: #8fb1aa;
  font-size: 11px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
}

.menu {
  display: grid;
  gap: 6px;
}

.menu button {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 0;
  color: #c6d8d4;
  text-align: left;
  background: transparent;
}

.menu button:hover,
.menu button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.menu span {
  font-weight: 800;
}

.menu em {
  color: #8fb1aa;
  font-size: 12px;
  font-style: normal;
}

.app {
  min-height: 100vh;
  margin-left: 236px;
  padding: 28px;
}

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

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.25;
}

h2 {
  margin-bottom: 8px;
  font-size: 20px;
}

.top-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.import-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
}

.import-box p {
  margin: 6px 0 0;
  color: var(--muted);
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  white-space: nowrap;
}

.upload-btn input {
  display: none;
}

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

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

.ghost {
  color: var(--primary-dark);
  background: #eef8f5;
}

.view {
  display: grid;
  gap: 18px;
}

.home-shell {
  display: grid;
  align-content: center;
  gap: 32px;
  min-height: calc(100vh - 160px);
  padding: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef5f3;
  box-shadow: 0 20px 52px rgba(19, 36, 33, 0.08);
}

.home-hero-copy {
  justify-self: center;
  max-width: 720px;
  text-align: center;
}

.home-hero-copy h2 {
  margin-bottom: 12px;
  font-size: 38px;
  line-height: 1.18;
}

.home-hero-copy p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.home-entry-grid {
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  width: min(880px, 100%);
}

.home-entry-card {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 28px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  text-align: center;
  box-shadow: 0 16px 38px rgba(19, 36, 33, 0.12);
}

.home-entry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(19, 36, 33, 0.16);
}

.home-entry-card:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.home-entry-card strong {
  font-size: 30px;
  letter-spacing: 0;
}

.home-entry-card.coral {
  background: #d86d3f;
}

.home-entry-card.gold {
  color: #2a2416;
  background: #f1b957;
}

.home-entry-card.green {
  background: #126b5f;
}

.home-entry-card.blue {
  background: #376b8f;
}

.product-home-shell {
  min-height: calc(100vh - 180px);
}

.product-home-grid .home-entry-card {
  min-height: 170px;
}

.login-panel {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 160px);
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(19, 36, 33, 0.1);
}

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

.login-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 38px rgba(19, 36, 33, 0.06);
}

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

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.metric {
  min-height: 122px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfb;
}

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

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

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

.subpanel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfb;
}

.danger-panel {
  border-color: rgba(202, 75, 82, 0.35);
  background: rgba(202, 75, 82, 0.06);
}

.subpanel h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.subpanel p {
  margin: 0 0 12px;
  color: var(--muted);
}

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

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

.import-grid label,
.filter-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.import-status-card {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
}

.import-status-card strong {
  display: block;
  margin-bottom: 6px;
}

.import-status-card p {
  color: var(--muted);
  margin: 0 0 4px;
}

.finance-import-history {
  margin-top: 14px;
}

.finance-import-history h3 {
  font-size: 18px;
  margin: 0 0 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.locked-select {
  color: var(--muted);
  background: #eef5f3;
  border-color: #bfd3cf;
}

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

.form-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.inline-note {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #b9d8d2;
  border-radius: 8px;
  color: var(--primary-dark);
  background: #eef8f5;
  font-weight: 700;
  line-height: 1.5;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-link {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 700;
}

.table-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.notice {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(18, 107, 95, 0.22);
  border-radius: 8px;
  background: #f2faf7;
}

.notice.error {
  border-color: rgba(202, 75, 82, 0.35);
  background: #fff4f5;
}

.notice strong {
  font-size: 16px;
}

.notice p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.operation-report-wrap {
  overflow-x: auto;
  border: 1px solid #1f2933;
  border-radius: 4px;
  background: #fff;
  max-width: 100%;
}

.operation-report-table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
  font-size: clamp(11px, 0.78vw, 13px);
  line-height: 1.25;
}

.operation-report-table th,
.operation-report-table td {
  width: clamp(92px, 7.2vw, 138px);
  min-width: clamp(92px, 7.2vw, 138px);
  padding: clamp(6px, 0.58vw, 10px) clamp(7px, 0.68vw, 12px);
  border: 1px solid #1f2933;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.operation-report-table th {
  color: #111820;
  font-weight: 900;
  background: #eef4f4;
}

.operation-report-transposed th:first-child,
.operation-report-transposed td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: clamp(92px, 7.8vw, 128px);
  min-width: clamp(92px, 7.8vw, 128px);
  text-align: left;
  background: #eef4f4;
}

.operation-report-transposed th:first-child {
  z-index: 3;
}

.operation-report-transposed th span {
  display: block;
  max-width: clamp(82px, 7vw, 150px);
  margin: 0 auto;
  overflow-wrap: anywhere;
}

.operation-report-transposed th em {
  display: block;
  margin-top: 4px;
  color: #64727c;
  font-size: clamp(10px, 0.68vw, 11px);
  font-style: normal;
  font-weight: 800;
}

.operation-report-transposed .metric-name {
  color: #111820;
  font-weight: 900;
}

.operation-report-transposed .total-col {
  font-weight: 900;
  background: #f8fbfb;
}

.operation-report-table .total-row td {
  font-weight: 900;
  background: #f8fbfb;
}

.operation-report-table tr:last-child td {
  border-bottom: 1px solid #1f2933;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 14px;
}

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

th {
  color: var(--muted);
  font-size: 13px;
  background: #edf3f3;
}

tr:last-child td {
  border-bottom: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.tag.warning {
  color: #77520a;
  background: #fff4d8;
}

.tag.danger {
  color: #8c2730;
  background: #ffe8ea;
}

.tag.success {
  color: #176142;
  background: #e4f6ee;
}

.tag.neutral {
  color: #43525a;
  background: #edf1f2;
}

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

.module-card {
  display: grid;
  gap: 10px;
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfb;
}

.module-card span {
  color: var(--muted);
  line-height: 1.6;
}

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

.product-sticky-panel {
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 8px 22px rgba(16, 24, 32, 0.08);
}

.product-module-nav .module-card {
  min-height: 82px;
  padding: 18px 18px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.product-module-nav .module-card strong {
  font-size: 17px;
}

.product-module-nav .module-card span {
  font-size: 13px;
  line-height: 1.45;
}

.product-module-nav .module-card.active {
  border-color: var(--primary);
  background: #eef8f5;
}

.product-module-nav .module-card.muted {
  background: #f6f8f8;
}

@media (max-width: 1180px) {
  .product-module-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.compact-table input {
  width: 100%;
  min-width: 92px;
  height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.compact-table select,
.compact-table textarea {
  width: 100%;
  min-width: 92px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.transfer-image-cell {
  min-width: 150px;
}

.thumb {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
}

.image-hover-preview {
  position: relative;
  display: inline-grid;
  place-items: center;
  cursor: zoom-in;
}

.image-hover-float {
  position: fixed;
  z-index: 9999;
  width: min(560px, calc(100vw - 36px));
  height: min(680px, calc(100vh - 36px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 54px rgba(15, 31, 36, 0.24);
  pointer-events: none;
}

.image-hover-float img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.transfer-size-tags {
  display: grid;
  grid-template-columns: repeat(2, minmax(42px, 1fr));
  gap: 5px;
  min-width: 116px;
}

.transfer-size-tags span {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid #d8e3e3;
  border-radius: 6px;
  background: #f6fbfa;
  color: #142126;
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
}

.transfer-size-tags strong {
  color: var(--primary);
  font-weight: 900;
}

.returned-tags span {
  background: #eef8f5;
}

.transfer-return-batches {
  display: grid;
  gap: 10px;
  min-width: 210px;
}

.transfer-return-batch {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid #d8e3e3;
  border-radius: 6px;
  background: #f8fbfb;
}

.transfer-return-date-input {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.transfer-return-person,
.locked-return-batch em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.transfer-return-size-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(54px, 1fr));
  gap: 6px;
  min-width: 140px;
}

.transfer-return-size-input {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.transfer-return-size-input input,
.inline-date {
  width: 100%;
  min-width: 146px;
  height: 32px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  text-align: center;
}

.permission-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 760px;
}

.permission-editor {
  display: grid;
  gap: 10px;
  max-width: 780px;
}

.permission-subtitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  margin-top: 2px;
}

.permission-check {
  align-items: center;
  background: #f5faf9;
  border: 1px solid #dce8e6;
  border-radius: 6px;
  display: inline-flex;
  gap: 6px;
  padding: 6px 9px;
  white-space: nowrap;
}

.permission-check input {
  margin: 0;
}

.permission-mode {
  align-items: center;
  background: #f5faf9;
  border: 1px solid #dce8e6;
  border-radius: 6px;
  display: inline-flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 186px;
  padding: 6px 8px;
}

.permission-mode span {
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.permission-mode-select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-width: 104px;
  padding: 5px 7px;
}

.permission-actions {
  max-width: 340px;
}

.permission-summary {
  color: var(--ink);
  line-height: 1.7;
  max-width: 520px;
}

.maintenance-banner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 18px;
}

.maintenance-banner strong {
  flex: 0 0 auto;
}

.maintenance-panel {
  border-color: #fed7aa;
}

.status-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  height: 32px;
  padding: 0 12px;
  white-space: nowrap;
}

.status-pill.success {
  background: #ecfdf5;
  color: #047857;
}

.status-pill.danger {
  background: #fff1f2;
  color: #be123c;
}

.status-pill.warning {
  background: #fffbeb;
  color: #b45309;
}

.order-return-warning-row.warning-yellow td {
  background: #fffbeb;
}

.order-return-warning-row.warning-red td {
  background: #fff1f2;
}

.order-return-warning-row.warning-purple td {
  background: #f5f3ff;
}

.return-warning-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  min-height: 28px;
  padding: 0 10px;
  white-space: nowrap;
}

.return-warning-pill.warning-yellow {
  background: #fef3c7;
  color: #92400e;
}

.return-warning-pill.warning-red {
  background: #ffe4e6;
  color: #be123c;
}

.return-warning-pill.warning-purple {
  background: #ede9fe;
  color: #6d28d9;
}

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

.delivery-check-panel {
  background: #f8fbfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 2px;
  padding: 14px;
}

.delivery-check-head,
.delivery-check-body {
  display: flex;
  gap: 14px;
}

.delivery-check-head {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.delivery-check-head strong {
  display: block;
  font-size: 16px;
}

.delivery-check-head span {
  color: var(--muted);
}

.delivery-photo-box {
  align-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: flex;
  flex: 0 0 150px;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  min-height: 150px;
  padding: 10px;
  text-align: center;
}

.delivery-photo-box img {
  max-height: 104px;
  max-width: 128px;
  object-fit: contain;
}

.delivery-photo-list {
  display: grid;
  gap: 8px;
  width: 100%;
}

.delivery-photo-list figure {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 6px;
}

.delivery-photo-list figcaption {
  color: var(--muted);
  font-size: 11px;
}

.delivery-photo-list .mini-btn {
  min-height: 24px;
  padding: 3px 8px;
}

.delivery-upload-btn {
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
}

.delivery-note-file-input {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.delivery-check-table-wrap {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
}

.delivery-check-table {
  border-collapse: collapse;
  min-width: 520px;
  width: 100%;
}

.delivery-check-table th,
.delivery-check-table td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: center;
}

.delivery-check-table th {
  background: #eef7f5;
  color: var(--muted);
}

.delivery-check-table input {
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 34px;
  text-align: center;
  width: 74px;
}

.delivery-diff {
  color: #dc2626;
  font-weight: 900;
}

.delivery-check-message {
  color: var(--muted);
  margin-top: 8px;
}

.delivery-check-note {
  flex: 0 0 220px;
}

.delivery-check-note textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 76px;
  padding: 8px;
  resize: vertical;
  width: 100%;
}

.delivery-check-meta {
  color: var(--muted);
  display: grid;
  gap: 4px;
  font-size: 13px;
  margin: 8px 0;
}

.readonly-note {
  color: var(--muted);
  line-height: 1.6;
}

.transfer-entry-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.transfer-entry-table {
  width: max-content;
  min-width: 1640px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.transfer-entry-table th,
.transfer-entry-table td {
  border-bottom: 1px solid var(--line);
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

.transfer-entry-table th {
  height: 58px;
  padding: 6px 4px;
  background: #eef6f5;
  color: var(--muted);
  font-weight: 800;
}

.transfer-entry-table td {
  height: 146px;
  background: #fff;
}

.transfer-entry-table th:nth-child(1),
.transfer-entry-table td:nth-child(1) { width: 82px; }
.transfer-entry-table th:nth-child(2),
.transfer-entry-table td:nth-child(2) { width: 76px; }
.transfer-entry-table th:nth-child(3),
.transfer-entry-table td:nth-child(3) { width: 124px; }
.transfer-entry-table th:nth-child(4),
.transfer-entry-table td:nth-child(4) { width: 96px; }
.transfer-entry-table th:nth-child(5),
.transfer-entry-table td:nth-child(5) { width: 104px; }
.transfer-entry-table th:nth-child(6),
.transfer-entry-table td:nth-child(6) { width: 92px; }
.transfer-entry-table th:nth-child(7),
.transfer-entry-table td:nth-child(7) { width: 68px; }
.transfer-entry-table th:nth-child(8),
.transfer-entry-table td:nth-child(8) { width: 108px; }
.transfer-entry-table th:nth-child(9),
.transfer-entry-table td:nth-child(9) { width: 98px; }
.transfer-entry-table th:nth-child(10),
.transfer-entry-table td:nth-child(10) { width: 96px; }
.transfer-entry-table th:nth-child(n+11):nth-child(-n+16),
.transfer-entry-table td:nth-child(n+11):nth-child(-n+16) { width: 72px; }
.transfer-entry-table th:nth-child(17),
.transfer-entry-table td:nth-child(17) { width: 70px; }
.transfer-entry-table th:nth-child(18),
.transfer-entry-table td:nth-child(18) { width: 70px; }
.transfer-entry-table th:nth-child(19),
.transfer-entry-table td:nth-child(19) { width: 92px; }
.transfer-entry-table th:nth-child(20),
.transfer-entry-table td:nth-child(20) { width: 108px; }
.transfer-entry-table th:nth-child(21),
.transfer-entry-table td:nth-child(21) { width: 118px; }
.transfer-entry-table th:nth-child(22),
.transfer-entry-table td:nth-child(22) { width: 118px; }

.transfer-entry-table input,
.transfer-entry-table select,
.transfer-entry-table textarea {
  width: calc(100% - 12px);
  min-width: 0;
  height: 40px;
  padding: 5px 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  color: var(--text);
}

.transfer-entry-table textarea {
  height: 88px;
  resize: none;
  line-height: 1.45;
}

.transfer-entry-table input[name="transferQty"] {
  width: 58px;
  text-align: center;
  font-size: 12px;
}

.transfer-tracking-cell {
  padding: 8px !important;
}

.transfer-tracking-list {
  display: grid;
  gap: 6px;
}

.transfer-tracking-list input,
.transfer-tracking-list textarea {
  width: 100%;
}

.transfer-tracking-list textarea {
  height: 54px;
}

.transfer-add-tracking {
  margin-top: 6px;
  min-height: 28px;
  width: 100%;
}

.transfer-tracking-tags {
  display: grid;
  gap: 4px;
}

.transfer-tracking-tags span {
  background: #eef8f5;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: inline-block;
  padding: 3px 6px;
  white-space: nowrap;
}

.transfer-entry-main-table,
.transfer-entry-size-table {
  width: 100%;
  min-width: 0;
}

.transfer-entry-main-table {
  border-bottom: 1px solid var(--line);
}

.transfer-entry-main-table td {
  height: 150px;
}

.transfer-entry-size-table td {
  height: 94px;
}

.transfer-entry-main-table th:nth-child(1),
.transfer-entry-main-table td:nth-child(1) { width: 110px; }
.transfer-entry-main-table th:nth-child(2),
.transfer-entry-main-table td:nth-child(2) { width: 110px; }
.transfer-entry-main-table th:nth-child(3),
.transfer-entry-main-table td:nth-child(3) { width: 170px; }
.transfer-entry-main-table th:nth-child(4),
.transfer-entry-main-table td:nth-child(4) { width: 150px; }
.transfer-entry-main-table th:nth-child(5),
.transfer-entry-main-table td:nth-child(5) { width: 160px; }
.transfer-entry-main-table th:nth-child(6),
.transfer-entry-main-table td:nth-child(6) { width: 130px; }
.transfer-entry-main-table th:nth-child(7),
.transfer-entry-main-table td:nth-child(7) { width: 96px; }
.transfer-entry-main-table th:nth-child(8),
.transfer-entry-main-table td:nth-child(8) { width: 150px; }
.transfer-entry-main-table th:nth-child(9),
.transfer-entry-main-table td:nth-child(9) { width: 140px; }
.transfer-entry-main-table th:nth-child(10),
.transfer-entry-main-table td:nth-child(10) { width: 150px; }

.transfer-entry-size-table th:nth-child(n+1):nth-child(-n+5),
.transfer-entry-size-table td:nth-child(n+1):nth-child(-n+5) { width: 84px; }
.transfer-entry-size-table th:nth-child(6),
.transfer-entry-size-table td:nth-child(6) { width: 84px; }
.transfer-entry-size-table th:nth-child(7),
.transfer-entry-size-table td:nth-child(7) { width: 110px; }
.transfer-entry-size-table th:nth-child(8),
.transfer-entry-size-table td:nth-child(8) { width: 110px; }
.transfer-entry-size-table th:nth-child(9),
.transfer-entry-size-table td:nth-child(9) { width: 140px; }
.transfer-entry-size-table th:nth-child(10),
.transfer-entry-size-table td:nth-child(10) { width: 150px; }
.transfer-entry-size-table th:nth-child(11),
.transfer-entry-size-table td:nth-child(11) { width: 210px; }
.transfer-entry-size-table th:nth-child(12),
.transfer-entry-size-table td:nth-child(12) { width: 190px; }

.transfer-entry-table input:focus,
.transfer-entry-table select:focus,
.transfer-entry-table textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(18, 107, 95, 0.14);
}

.transfer-entry-table .transfer-total,
.transfer-entry-table .transfer-shortage {
  font-weight: 800;
  color: #d52525;
}

.transfer-entry-table .transfer-image-cell {
  padding: 8px;
}

.transfer-suggestion-grid {
  margin-top: 14px;
}

.inline-actions {
  align-self: end;
  margin: 0;
}

.transfer-image-preview {
  min-height: 94px;
  max-height: 94px;
}

.transfer-image-preview img {
  max-width: 104px;
  max-height: 94px;
  object-fit: contain;
}

.transfer-image-fetch {
  width: calc(100% - 18px);
  margin-top: 6px;
  min-height: 26px;
  padding: 5px 6px;
  font-size: 11px;
}

.product-order-entry-table input {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 22px;
  padding: 4px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  text-align: center;
  outline: none;
}

.product-order-entry-table textarea {
  width: 100%;
  height: 100%;
  min-height: 198px;
  padding: 8px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  resize: none;
  outline: none;
}

.product-order-entry-table select {
  width: 100%;
  height: 100%;
  min-height: 76px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  text-align: center;
  text-align-last: center;
  outline: none;
}

.product-order-entry-table input:focus {
  background: #eef8f5;
  box-shadow: inset 0 0 0 2px var(--primary);
}

.product-order-entry-table textarea:focus {
  background: #eef8f5;
  box-shadow: inset 0 0 0 2px var(--primary);
}

.product-order-entry-table select:focus {
  background: #eef8f5;
  box-shadow: inset 0 0 0 2px var(--primary);
}

.product-order-entry-table select[name="color"] {
  min-height: 198px;
}

.product-order-entry-table .product-image-cell {
  height: 198px;
  padding: 6px 10px;
  overflow: hidden;
  vertical-align: top;
}

.product-image-fetch {
  width: 100%;
  min-height: 24px;
  margin: 8px auto 0;
  padding: 6px 8px 2px;
  font-size: 11px;
  line-height: 1;
}

.entry-image-preview {
  display: grid;
  place-items: center;
  min-height: 158px;
  max-height: 158px;
  overflow: hidden;
}

.entry-image-preview img {
  max-width: 168px;
  max-height: 158px;
  object-fit: contain;
}

.product-order-entry-table .product-order-note input {
  min-height: 76px;
}

.product-order-list {
  display: grid;
  gap: 24px;
}

.product-order-card {
  display: grid;
  gap: 10px;
}

.product-return-card {
  background: #fff;
  border: 2px solid #111;
  border-radius: 8px;
  padding: 14px;
}

.return-card-title {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
}

.return-card-title strong {
  display: block;
  font-size: 18px;
}

.return-card-title span,
.return-card-title em {
  color: var(--muted);
  font-style: normal;
}

.product-order-table-wrap {
  width: max-content;
  max-width: 100%;
  border: 1px solid #111;
  border-radius: 0;
  background: #fff;
}

.product-order-table {
  width: 710px;
  min-width: 710px;
  border-collapse: collapse;
  table-layout: fixed;
  color: #000;
  font-size: 12px;
  line-height: 1.2;
}

.product-order-table th,
.product-order-table td {
  height: 22px;
  padding: 0 4px;
  border: 1px solid #111;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
}

.product-order-table th {
  background: #fff;
  color: #111;
  font-weight: 400;
}

.product-order-table th:nth-child(1),
.product-order-table .product-image-cell {
  width: 180px;
}

.product-order-table th:nth-child(2) {
  width: 72px;
}

.product-order-table th:nth-child(3),
.product-order-table th:nth-child(4),
.product-order-table th:nth-child(5),
.product-order-table th:nth-child(6),
.product-order-table th:nth-child(7),
.product-order-table th:nth-child(8) {
  width: 73px;
}

.product-order-table th:nth-child(3),
.product-order-supplier,
.product-order-supplier-text {
  width: 90px;
}

.product-order-supplier-text {
  padding: 4px 6px;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.product-return-table-wrap {
  overflow-x: auto;
}

.product-return-filter-grid {
  margin-bottom: 16px;
}

.product-stats-filter-grid {
  margin-bottom: 14px;
}

.product-total-filter-grid {
  margin-bottom: 14px;
}

.stats-grid {
  display: grid;
  gap: 22px;
  margin-top: 18px;
}

.stats-block {
  display: grid;
  gap: 10px;
}

.stats-grid h3,
.compact-head h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--text);
}

.compact-head {
  margin-bottom: 0;
}

.product-return-table {
  width: max-content;
  min-width: 710px;
}

.product-return-table .return-col {
  width: 92px;
  min-width: 92px;
  padding: 3px 4px;
}

.product-return-table .return-col span {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  font-weight: 800;
}

.product-return-table input[type="date"],
.product-return-table input[type="number"] {
  width: 100%;
  min-width: 0;
  height: 22px;
  padding: 1px 2px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 11px;
  text-align: center;
  outline: none;
}

.product-return-table input[type="date"]:focus,
.product-return-table input[type="number"]:focus {
  background: #eef8f5;
  box-shadow: inset 0 0 0 2px var(--primary);
}

.product-return-table .return-qty-cell {
  padding: 0;
}

.product-return-table .return-remark-row td {
  background: #fbfdfd;
}

.product-return-table .return-remark-label {
  color: var(--muted);
  font-size: 11px;
}

.product-return-table .return-remark-cell {
  padding: 3px;
  vertical-align: middle;
}

.product-return-table .return-remark-cell textarea {
  width: 100%;
  min-width: 86px;
  height: 44px;
  padding: 4px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 11px;
  line-height: 1.25;
  resize: vertical;
  outline: none;
  text-align: left;
}

.product-return-table .return-remark-cell textarea:focus {
  background: #eef8f5;
  box-shadow: inset 0 0 0 2px var(--primary);
}

.product-return-table .return-add-col {
  width: 42px;
  min-width: 42px;
}

.return-add-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--primary);
  border-radius: 50%;
  background: #eef8f5;
  color: var(--primary);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.product-order-table .total-row td {
  font-weight: 800;
  background: #fff;
}

.product-image-cell {
  width: 180px;
  min-width: 180px;
  height: 220px;
  background: #fff;
}

.product-image-cell img {
  max-width: 156px;
  max-height: 178px;
  object-fit: contain;
}

.product-image-placeholder {
  display: inline-grid;
  place-items: center;
  width: 132px;
  height: 132px;
  color: var(--muted);
  border: 1px dashed var(--line);
}

.product-order-note {
  height: 48px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.product-order-batch {
  height: 48px;
  color: #111;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.product-order-batch span,
.product-order-batch strong {
  display: block;
}

.product-order-batch span {
  font-size: 11px;
  color: #5f6f78;
}

.product-order-batch strong {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 800;
}

.product-order-entry-table select {
  min-height: 48px;
}

.product-order-actions {
  border-bottom: 1px solid var(--line);
  justify-content: flex-end;
  color: var(--muted);
  padding-bottom: 12px;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
  text-align: center;
}

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

.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--primary-dark);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

@media (max-width: 1120px) {
  .sidebar {
    position: static;
    width: auto;
  }

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

  .app {
    margin-left: 0;
  }

  .home-entry-grid {
    grid-template-columns: 1fr;
  }

  .home-shell {
    min-height: auto;
  }

  .metrics,
  .form-grid,
  .import-grid,
  .filter-grid,
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1500px) {
  .operation-report-table {
    font-size: 11px;
  }

  .operation-report-table th,
  .operation-report-table td {
    width: 88px;
    min-width: 88px;
    padding: 6px 7px;
  }

  .operation-report-transposed th:first-child,
  .operation-report-transposed td:first-child {
    width: 92px;
    min-width: 92px;
  }

  .operation-report-transposed th span {
    max-width: 84px;
  }
}

@media (max-width: 760px) {
  body {
    min-width: 0;
    background: #f3f7f7;
  }

  body.mobile-readonly::before {
    content: "手机端只读查看";
    position: sticky;
    top: 0;
    z-index: 80;
    display: block;
    padding: 8px 14px;
    color: #0b4f46;
    background: #e7f5f1;
    border-bottom: 1px solid #cfe3df;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
  }

  .sidebar {
    position: sticky;
    top: 33px;
    z-index: 70;
    width: 100%;
    max-height: none;
    padding: 10px 12px 12px;
    overflow: visible;
    box-shadow: 0 8px 18px rgba(19, 36, 33, 0.16);
  }

  .brand {
    gap: 8px;
    padding: 0 2px 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .brand strong {
    font-size: 15px;
  }

  .brand small {
    font-size: 10px;
  }

  .menu {
    display: flex;
    gap: 8px;
    margin: 0 -2px;
    padding: 0 2px 2px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .menu button {
    flex: 0 0 auto;
    min-width: 96px;
    min-height: 48px;
    padding: 8px 10px;
    border-radius: 8px;
    scroll-snap-align: start;
  }

  .menu span {
    font-size: 14px;
  }

  .menu em {
    font-size: 10px;
  }

  .app {
    margin-left: 0;
    padding: 14px 10px 18px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .topbar {
    margin-bottom: 12px;
  }

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

  .top-actions button,
  .actions button,
  .form-actions button {
    width: 100%;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 18px;
  }

  .eyebrow {
    font-size: 11px;
  }

  .panel {
    padding: 14px;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(19, 36, 33, 0.05);
  }

  .view {
    gap: 12px;
  }

  .home-shell {
    gap: 20px;
    min-height: calc(100vh - 220px);
    padding: 22px 14px;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(19, 36, 33, 0.08);
  }

  .home-hero-copy {
    max-width: 100%;
  }

  .home-hero-copy h2 {
    margin-bottom: 8px;
    font-size: 24px;
  }

  .home-hero-copy p:not(.eyebrow) {
    font-size: 13px;
  }

  .home-entry-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
  }

  .home-entry-card {
    min-height: 112px;
    padding: 18px;
    box-shadow: 0 10px 22px rgba(19, 36, 33, 0.12);
  }

  .home-entry-card strong {
    font-size: 21px;
  }

  .product-home-shell {
    min-height: calc(100vh - 230px);
  }

  .product-home-grid .home-entry-card {
    min-height: 104px;
  }

  .menu,
  .metrics,
  .grid-2,
  .form-grid,
  .import-grid,
  .filter-grid,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .metrics {
    gap: 10px;
  }

  .metric {
    min-height: 94px;
    padding: 14px;
  }

  .metric strong {
    margin: 8px 0 4px;
    font-size: 24px;
  }

  .section-head p,
  .panel p {
    line-height: 1.55;
  }

  .login-panel {
    min-height: calc(100vh - 210px);
  }

  .login-card {
    padding: 20px;
  }

  .import-box,
  .delivery-check-body,
  .delivery-check-head {
    flex-direction: column;
    align-items: stretch;
  }

  .delivery-check-note,
  .delivery-photo-box {
    flex: 1 1 auto;
  }

  .table-wrap {
    border: 0;
    overflow: visible;
  }

  .table-wrap > table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
    font-size: 14px;
  }

  .table-wrap > table thead {
    display: none;
  }

  .table-wrap > table tr {
    display: block;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .table-wrap > table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    min-height: 34px;
    padding: 8px 0;
    border-bottom: 1px solid #edf2f2;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .table-wrap > table td:last-child {
    border-bottom: 0;
  }

  .table-wrap > table td::before {
    content: attr(data-label);
    flex: 0 0 36%;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-align: left;
  }

  .table-wrap > table td:empty::after {
    content: "-";
  }

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

  .row-actions button {
    flex: 1 1 96px;
  }

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

  .table-pagination button {
    width: 100%;
  }

  .operation-report-wrap,
  .product-return-table-wrap,
  .transfer-entry-wrap,
  .delivery-check-table-wrap {
    max-width: calc(100vw - 48px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .operation-report-table {
    font-size: 11px;
  }

  .operation-report-table th,
  .operation-report-table td {
    width: 86px;
    min-width: 86px;
    padding: 6px;
  }

  .operation-report-transposed th:first-child,
  .operation-report-transposed td:first-child {
    width: 84px;
    min-width: 84px;
  }

  .product-sticky-panel {
    top: 126px;
    z-index: 60;
    padding-bottom: 10px;
  }

  .product-module-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .product-module-nav .module-card {
    flex: 0 0 220px;
    min-height: 78px;
    padding: 12px;
  }

  .product-module-nav .module-card strong {
    font-size: 15px;
  }

  .product-module-nav .module-card span {
    font-size: 12px;
  }

  .product-order-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .product-order-table,
  .product-return-table {
    transform-origin: top left;
  }

  .product-order-table {
    width: 660px;
    min-width: 660px;
    font-size: 12px;
  }

  .product-order-table th,
  .product-order-table td {
    padding: 5px 7px;
  }

  .product-order-table .product-photo,
  .product-order-table .order-product-photo {
    max-width: 120px;
    max-height: 150px;
  }

  .product-order-list {
    gap: 18px;
  }

  .product-return-card {
    padding: 10px;
  }

  .return-card-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .transfer-entry-table {
    min-width: 1240px;
    font-size: 10px;
  }

  .transfer-entry-table th {
    height: 48px;
  }

  .transfer-entry-table td {
    height: 112px;
  }

  .thumb {
    width: 46px;
    height: 46px;
  }

  .image-hover-float {
    display: none;
  }

  .mobile-readonly button.danger-btn,
  .mobile-readonly button.primary[data-action],
  .mobile-readonly .upload-btn,
  .mobile-readonly input[type="file"] {
    display: none;
  }
}
