:root {
  --blue-900: #111318;
  --blue-700: #111318;
  --blue-100: #eeedf8;
  --ink: #15171a;
  --muted: #6f737a;
  --line: #d9d7ce;
  --bg: #ebe8df;
  --panel: #ffffff;
  --cream: #f3f0e7;
  --lavender: #e8e6fa;
  --green: #dcefd8;
  --lime: #d9fb5d;
  --danger: #bd3f48;
  --shadow: 0 8px 22px rgba(31, 29, 24, 0.08);
}

/* Commission pages: centered figures and a stronger hierarchy for final results. */
.commission-summary-metrics .metric,
.commission-detail-metrics .metric {
  align-content: center;
  justify-items: center;
  text-align: center;
}

.commission-summary-metrics .metric strong,
.commission-detail-metrics .metric strong {
  width: 100%;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.commission-meta-grid .metric:nth-child(1) {
  background: #eefbf5;
  border-color: #a9ddc4;
}

.commission-meta-grid .metric:nth-child(1) strong {
  color: #087f5b;
}

.commission-meta-grid .metric:nth-child(2) {
  background: #fff8e8;
  border-color: #efcd80;
}

.commission-meta-grid .metric:nth-child(2) strong {
  color: #9a5b00;
}

.commission-meta-grid .metric:nth-child(3) {
  background: #eff8ff;
  border-color: #b2d6f5;
}

.commission-meta-grid .metric:nth-child(3) strong {
  color: #175cd3;
}

.commission-meta-grid .metric:nth-child(4) {
  background: #fff1f0;
  border-color: #f0b5b0;
}

.commission-meta-grid .metric:nth-child(4) strong {
  color: #b42318;
}

.commission-financial-metrics .metric:nth-child(2) {
  background: #fff5f4;
  border-color: #f0c0bc;
}

.commission-financial-metrics .metric:nth-child(2) strong {
  color: #b42318;
}

.commission-financial-metrics .metric:nth-child(3) {
  background: #eefbf5;
  border-color: #a9ddc4;
}

.commission-financial-metrics .metric:nth-child(3) strong {
  color: #087f5b;
}

.commission-financial-metrics .metric:nth-child(4) {
  background: #fff8e8;
  border-color: #efcd80;
}

.commission-financial-metrics .metric:nth-child(4) strong {
  color: #9a5b00;
}

.commission-summary-table .commission-number,
.commission-breakdown .commission-value,
.commission-breakdown .commission-reference {
  font-variant-numeric: tabular-nums;
  text-align: center;
  vertical-align: middle;
}

.commission-summary-table td.commission-number {
  font-weight: 700;
}

.commission-summary-table .commission-total-value {
  color: #9a5b00;
  font-weight: 900;
}

.status.commission-pending {
  color: #b42318;
  background: #fff1f0;
  border-color: #f0b5b0;
}

.status.commission-waiting {
  color: #9a5b00;
  background: #fff8e8;
  border-color: #efcd80;
}

.commission-breakdown .table {
  min-width: 860px;
  margin-bottom: 0;
}

.commission-breakdown tbody th {
  width: 30%;
  padding: 13px 16px;
  color: #25282d;
  background: #fbfaf6;
  border-color: #e5e1d8;
  font-size: 13px;
  font-weight: 800;
  vertical-align: middle;
}

.commission-breakdown tbody td {
  width: 20%;
  min-width: 120px;
  font-size: 14px;
  font-weight: 750;
}

.commission-breakdown .commission-reference-row th,
.commission-breakdown .commission-reference-row td {
  background: #f4f6f8;
}

.commission-breakdown .commission-key-label,
.commission-breakdown .commission-key-value {
  border-top-width: 2px;
}

.commission-breakdown .commission-key-value {
  font-size: 19px;
  font-weight: 900;
}

.commission-breakdown .commission-key-label.cost,
.commission-breakdown .commission-key-value.cost {
  color: #b42318;
  background: #fff1f0;
  border-top-color: #e7aaa5;
}

.commission-breakdown .commission-key-label.margin,
.commission-breakdown .commission-key-value.margin {
  color: #087f5b;
  background: #eefbf5;
  border-top-color: #9ed9bd;
}

.commission-breakdown .commission-key-label.sales,
.commission-breakdown .commission-key-value.sales {
  color: #175cd3;
  background: #eff8ff;
  border-top-color: #a7d1f4;
}

.commission-breakdown .commission-key-label.rate,
.commission-breakdown .commission-key-value.rate {
  color: #9a5b00;
  background: #fff8e8;
  border-top-color: #e8c46f;
}

.commission-breakdown .commission-key-label.commission,
.commission-breakdown .commission-key-value.commission {
  color: #fff;
  background: #202328;
  border-top-color: #202328;
}

.commission-breakdown .commission-key-value.commission {
  font-size: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

a {
  color: var(--blue-700);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--blue-900);
  color: #fff;
  padding: 20px 16px;
}

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

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

.brand-logo {
  display: block;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  object-fit: contain;
  background: #fff;
  border: 1px solid #d7d3c9;
  border-radius: 50%;
  box-shadow: 0 5px 14px rgba(17, 19, 24, 0.14);
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
}

.brand-subtitle {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.sidebar nav {
  display: grid;
  gap: 6px;
  padding-top: 18px;
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  padding: 10px 12px;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  text-decoration: none;
}

.main {
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 84px;
  padding: 20px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 24px;
  font-weight: 700;
}

h2 {
  font-size: 18px;
  font-weight: 700;
}

.topbar-meta,
.muted,
.toolbar p {
  color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
}

.user-switch span {
  color: #344054;
  font-size: 13px;
  white-space: nowrap;
}

.user-switch form {
  margin: 0;
}

.login-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #202328;
  background: #eef1f3;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1fr);
  width: min(880px, 100%);
  min-height: 500px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d4d8dc;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(24, 31, 38, 0.13);
}

.login-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px;
  color: #fff;
  background: #202b31;
}

.login-brand-panel img {
  width: min(210px, 80%);
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.login-brand-panel h1 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 34px;
}

.login-brand-panel p,
.login-support {
  margin: 0;
  color: #cbd4d9;
}

.login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 54px 58px;
}

.login-heading {
  margin-bottom: 28px;
}

.login-heading span {
  color: #146c5a;
  font-size: 13px;
  font-weight: 800;
}

.login-heading h2 {
  margin: 6px 0 0;
  font-size: 28px;
}

.login-form-panel form {
  display: grid;
  gap: 18px;
}

.login-form-panel label {
  display: grid;
  gap: 7px;
  color: #41474d;
  font-size: 13px;
  font-weight: 750;
}

.login-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
}

.login-error {
  margin-bottom: 18px;
  padding: 11px 13px;
  color: #9b241b;
  background: #fff1f0;
  border: 1px solid #edb4af;
  border-radius: 6px;
}

.login-support {
  margin-top: 22px;
  color: #69737a;
  font-size: 12px;
}

.toolbar p {
  margin: 6px 0 0;
}

.content {
  padding: 24px 28px 36px;
}

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

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

.metric {
  display: grid;
  gap: 8px;
  min-height: 86px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.metric strong {
  font-size: 24px;
  color: var(--blue-900);
  word-break: break-word;
}

.metric-value-link {
  display: inline-block;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.metric-value-link:hover,
.metric-value-link:focus-visible {
  color: #0b5ed7;
  text-decoration-color: currentColor;
}

.metric-value-button {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.metric-value-button:hover,
.metric-value-button:focus-visible {
  color: #9a3412;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.approval-metric {
  background: #fff8e8;
  border-color: #f2b84b;
  box-shadow: inset 4px 0 0 #dc6803;
}

.approval-metric span {
  color: #8a3f00;
  font-weight: 700;
}

.heading-count {
  display: inline-block;
  margin-left: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.approval-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(82vh, 820px);
  padding: 0;
  overflow: hidden;
  background: #fffdf8;
  border: 2px solid #dc6803;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(62, 35, 12, 0.28);
}

.approval-dialog::backdrop {
  background: rgba(20, 27, 38, 0.58);
}

.approval-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  color: #fff;
  background: #9a3412;
}

.payment-approval-dialog {
  border-color: #b42318;
}

.payment-approval-dialog .approval-dialog-header {
  background: #b42318;
}

.approval-dialog-header span {
  color: #fedf89;
  font-size: 12px;
  font-weight: 700;
}

.approval-dialog-header h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

.dialog-close {
  width: 36px;
  height: 36px;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  font-size: 26px;
  line-height: 1;
}

.approval-dialog-body {
  display: grid;
  gap: 14px;
  max-height: calc(82vh - 76px);
  padding: 16px;
  overflow-y: auto;
}

.approval-item {
  padding: 15px;
  background: #fff;
  border: 1px solid #f2b84b;
  border-left: 5px solid #dc6803;
  border-radius: 6px;
}

.payment-approval-item {
  border-color: #f0a6a0;
  border-left-color: #b42318;
}

.approval-item-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.approval-item-heading span,
.approval-info-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.approval-item-heading h3 {
  margin: 2px 0 0;
  color: #7c2d12;
  font-size: 18px;
}

.approval-item-heading > strong {
  color: #9a3412;
  font-size: 20px;
}

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

.approval-info-grid > div {
  min-width: 0;
  padding: 9px 10px;
  background: #fff8e8;
  border-radius: 5px;
}

.approval-info-grid strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

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

.approval-decision-grid {
  margin-top: 12px;
}

.approval-submit {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.metric-value-link:focus-visible {
  outline: 2px solid #0b5ed7;
  outline-offset: 3px;
  border-radius: 2px;
}

.metric.warning strong {
  color: #a15c00;
}

.metric.success strong {
  color: #0f766e;
}

.form-select.is-placeholder,
.form-select option[value=""][disabled] {
  color: #7a8493;
}

.form-select option:not([disabled]) {
  color: #172033;
}

.purchase-item-list {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.purchase-status-list {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.purchase-item-panel {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.purchase-item-heading,
.purchase-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.purchase-item-heading {
  margin-bottom: 16px;
}

.purchase-item-heading h3 {
  margin: 3px 0 0;
  color: var(--blue-900);
  font-size: 18px;
}

.purchase-item-index {
  color: var(--muted);
  font-size: 12px;
}

.purchase-sync-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.purchase-sync-grid > div {
  min-width: 0;
  padding: 10px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.purchase-sync-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.purchase-sync-grid strong {
  display: block;
  color: #172033;
  font-size: 14px;
  word-break: break-word;
}

.purchase-config-button {
  display: inline-flex;
  margin-top: 4px;
  padding: 0;
  color: var(--blue-700);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.purchase-item-footer {
  margin-top: 16px;
  color: var(--muted);
}

.purchase-item-footer strong {
  color: var(--blue-900);
}

.purchase-item-heading-actions,
.purchase-contract-header-actions,
.contract-dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-purchase-contract,
.btn-purchase-contract:hover,
.btn-purchase-contract:focus {
  color: #fff;
  background: #176b4d;
  border-color: #176b4d;
  box-shadow: 0 5px 14px rgba(23, 107, 77, 0.2);
}

.btn-purchase-contract:hover,
.btn-purchase-contract:focus {
  background: #10543b;
  border-color: #10543b;
}

.purchase-contract-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-height: min(92vh, 920px);
}

.purchase-contract-header {
  background: #143e32;
}

.purchase-contract-header-actions > strong {
  padding: 5px 10px;
  color: #dff5e9;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(223, 245, 233, 0.35);
  border-radius: 999px;
  font-size: 12px;
}

.purchase-contract-form {
  gap: 14px;
}

.contract-section {
  padding: 15px;
  background: #fff;
  border: 1px solid #dedbd2;
  border-radius: 8px;
}

.contract-section .form-section-title {
  margin-bottom: 13px;
}

.contract-form-grid label.wide {
  grid-column: 1 / -1;
}

.contract-sync-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.contract-sync-strip > div {
  min-width: 0;
  padding: 9px 10px;
  background: #f2f5f0;
  border: 1px solid #d9e2da;
  border-radius: 6px;
}

.contract-sync-strip span,
.contract-sync-strip strong {
  display: block;
}

.contract-sync-strip span {
  margin-bottom: 3px;
  color: #6c716f;
  font-size: 11px;
}

.contract-sync-strip strong {
  color: #23342e;
  font-size: 13px;
  overflow-wrap: anywhere;
}

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

.contract-party-fields {
  display: grid;
  gap: 10px;
}

.contract-party-fields label {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #44484d;
  font-size: 12px;
}

.contract-dialog-actions {
  justify-content: flex-end;
  padding-top: 2px;
}

.btn-contract-download {
  color: #10543b;
  background: #e5f4eb;
  border-color: #acd2bb;
}

@media (max-width: 760px) {
  .purchase-item-heading-actions {
    align-items: flex-end;
    flex-direction: column-reverse;
  }

  .purchase-contract-dialog {
    width: calc(100vw - 16px);
    max-height: 94vh;
  }

  .contract-form-grid,
  .contract-sync-strip,
  .contract-party-grid {
    grid-template-columns: 1fr;
  }

  .contract-party-fields label {
    grid-template-columns: 1fr;
  }

  .contract-dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
}

.payment-record-list {
  display: grid;
  gap: 14px;
}

.payment-record {
  min-width: 0;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.payment-record-header,
.payment-record-footer,
.payment-paid-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.payment-record-header h3 {
  margin: 3px 0;
  color: var(--blue-900);
  font-size: 18px;
}

.payment-record-header p {
  margin: 0;
  color: var(--muted);
}

.payment-record-type {
  color: var(--muted);
  font-size: 12px;
}

.payment-record-amount {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-width: 120px;
}

.payment-record-amount > span:first-child {
  color: var(--muted);
  font-size: 12px;
}

.payment-record-amount strong {
  color: var(--blue-900);
  font-size: 22px;
}

.payment-state {
  padding: 3px 9px;
  color: #9a5a00;
  background: #fff3d6;
  border-radius: 999px;
  font-size: 12px;
}

.payment-state.paid {
  color: #067647;
  background: #dff7ea;
}

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

.payment-record-grid > div {
  min-width: 0;
  padding: 9px 10px;
  background: #f8fbff;
  border-radius: 6px;
}

.payment-record-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

.payment-record-grid strong {
  display: block;
  color: #172033;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.payment-record-footer {
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.payment-paid-form {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.payment-paid-form > label:not(.paid-toggle) {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.paid-toggle {
  margin: 0;
  cursor: pointer;
}

.paid-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.paid-toggle span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 12px;
  color: #667085;
  background: #f2f4f7;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-weight: 600;
}

.paid-toggle-text::before {
  content: "未打款";
}

.paid-toggle input:checked + .paid-toggle-text::before {
  content: "已打款";
}

.paid-toggle input:checked + span {
  color: #067647;
  background: #dff7ea;
  border-color: #75d6a4;
}

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

.section-toolbar {
  margin-top: 22px;
}

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

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 14px;
  color: var(--blue-700);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: nowrap;
}

.tab.active,
.tab:hover {
  color: #fff;
  background: var(--blue-700);
  border-color: var(--blue-700);
  text-decoration: none;
}

.table-wrap,
.form-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.filter-panel {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.filter-grid label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.table {
  margin-bottom: 0;
}

.table thead th {
  color: #344054;
  background: #f1f6fc;
  border-bottom-color: var(--line);
  font-size: 13px;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
}

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

.row-details summary {
  color: var(--blue-700);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.detail-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: min(560px, 72vw);
  margin-top: 10px;
}

.detail-pills span {
  padding: 7px 9px;
  color: #344054;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--blue-900);
  background: var(--blue-100);
  font-size: 13px;
  white-space: nowrap;
}

.status.paid {
  color: #067647;
  background: #dff7ea;
}

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

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

.form-grid label,
.item-row label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
}

.product-picker {
  position: relative;
}

.product-suggestions {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.product-suggestions.open {
  display: grid;
  gap: 4px;
}

.product-suggestion-item {
  width: 100%;
  padding: 8px 10px;
  color: #172b4d;
  text-align: left;
  background: #fff;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.35;
}

.product-suggestion-item:hover,
.product-suggestion-item:focus {
  background: #edf5ff;
  outline: none;
}

.product-suggestion-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
}

.form-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.product-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plug-reference-link {
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 500;
}

.plug-reference {
  margin: -2px 0 14px;
  padding: 10px 12px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.plug-reference summary {
  color: var(--blue-700);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.plug-reference img {
  display: block;
  width: min(760px, 100%);
  max-height: 520px;
  margin-top: 10px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wide {
  grid-column: span 2;
}

.form-control,
.form-select {
  border-color: #c9d6e5;
  border-radius: 8px;
}

.form-section-title {
  margin: 18px 0 12px;
  color: var(--blue-900);
  font-size: 16px;
  font-weight: 700;
}

.form-section-title:first-child {
  margin-top: 0;
}

.item-list {
  display: grid;
  gap: 12px;
  margin-bottom: 10px;
}

.item-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.7fr 0.7fr 0.8fr 1.4fr;
  gap: 12px;
  padding: 12px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-master-details {
  grid-column: 1 / -1;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #d8d5cc;
  border-radius: 6px;
}

.product-master-details summary,
.inline-item-details summary {
  color: #1f4f73;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.product-master-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.inline-item-details {
  min-width: 150px;
}

.inline-item-details div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
}

.inline-item-details span {
  color: #777b82;
}

.line-item-toolbar {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dedbd2;
}

.line-item-toolbar > span {
  color: #353941;
  font-size: 12px;
  font-weight: 800;
}

.line-item-remove {
  display: inline-grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: #b42318;
  background: #fff;
  border: 1px solid #e6b5b0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
}

.line-item-remove:hover,
.line-item-remove:focus-visible {
  color: #fff;
  background: #b42318;
  border-color: #b42318;
  outline: none;
}

.item-row.accessory-row {
  background: #f2f7f4;
  border-color: #bad3c5;
}

.accessory-row .line-item-toolbar {
  border-bottom-color: #c7dbd0;
}

.line-item-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.accessory-list:empty {
  display: none;
  margin: 0;
}

.summary-line {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  color: #344054;
}

.summary-line strong {
  color: var(--blue-900);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 280px;
}

.inline-form.nowrap {
  min-width: 210px;
}

.inline-form .form-control,
.inline-form .form-select {
  min-width: 96px;
}

.finance-table td {
  min-width: 110px;
}

.finance-table td:nth-child(5) {
  min-width: 220px;
}

.compact {
  margin-top: 16px;
}

.proof-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.proof-title {
  margin-bottom: 4px;
  color: var(--blue-900);
  font-weight: 700;
}

.proof-image {
  display: block;
  width: 160px;
  height: 110px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.btn {
  border-radius: 8px;
}

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

.btn-outline-primary {
  color: var(--blue-700);
  border-color: var(--blue-700);
}

.warehouse-record-list {
  display: grid;
  gap: 14px;
}

.warehouse-record {
  overflow: hidden;
  scroll-margin-top: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.warehouse-record-header {
  display: grid;
  grid-template-columns: minmax(145px, 1.05fr) minmax(180px, 1.25fr) minmax(105px, 0.7fr) 92px minmax(180px, auto) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  background: #f7f9fc;
  border-bottom: 1px solid var(--line);
}

.warehouse-record-header > div {
  min-width: 0;
}

.warehouse-record-header span,
.warehouse-record-header small {
  display: block;
}

.warehouse-record-header > div > span:first-child {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

.warehouse-record-header strong {
  display: block;
  color: #172033;
  overflow-wrap: anywhere;
}

.warehouse-delivery-date strong {
  color: #1d5b45;
  font-variant-numeric: tabular-nums;
}

.warehouse-record-header small {
  margin-top: 3px;
  color: var(--muted);
}

.warehouse-state {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.warehouse-state-badge {
  padding: 5px 9px;
  color: #667085;
  background: #f2f4f7;
  border: 1px solid #d0d5dd;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
}

.warehouse-state-badge.done {
  color: #067647;
  background: #e7f8ef;
  border-color: #75d6a4;
}

.warehouse-state-badge.quality:not(.done) {
  color: #9a6700;
  background: #fff8e8;
  border-color: #f2b84b;
}

.warehouse-status-form {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) minmax(150px, 1fr) minmax(200px, 1.3fr) auto;
  align-items: end;
  gap: 14px;
  padding: 16px 18px;
}

.warehouse-status-form > label:not(.warehouse-check) {
  display: grid;
  gap: 6px;
  margin: 0;
  color: #344054;
  font-size: 13px;
}

.warehouse-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  margin: 0;
  padding: 9px 11px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.warehouse-check input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: #147d64;
}

.warehouse-check span,
.warehouse-check small {
  display: block;
}

.warehouse-check strong {
  color: #172033;
  font-size: 14px;
}

.warehouse-check small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.warehouse-check:has(input:checked) {
  background: #eaf8f2;
  border-color: #75d6a4;
}

.warehouse-check:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.6;
}

.warehouse-save {
  display: flex;
  justify-content: flex-end;
}

.record-detail-dialog {
  width: min(880px, calc(100vw - 32px));
  max-height: min(86vh, 860px);
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #98a2b3;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.28);
}

.record-detail-dialog::backdrop {
  background: rgba(16, 24, 40, 0.6);
}

.record-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  color: #fff;
  background: #174a73;
}

.record-detail-header span {
  display: block;
  color: #d5e9f8;
  font-size: 12px;
  font-weight: 700;
}

.record-detail-header h2 {
  margin: 2px 0 0;
  font-size: 21px;
}

.record-detail-body {
  display: grid;
  gap: 18px;
  max-height: calc(86vh - 76px);
  padding: 18px;
  overflow-y: auto;
}

.warehouse-standalone-detail {
  display: grid;
  gap: 18px;
}

.warehouse-detail-section h3 {
  margin: 0 0 9px;
  color: #172033;
  font-size: 15px;
}

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

.warehouse-detail-grid > div {
  min-width: 0;
  padding: 9px 10px;
  background: #f7f9fc;
  border: 1px solid #e4e7ec;
  border-radius: 5px;
}

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

.warehouse-detail-grid span,
.warehouse-detail-grid strong {
  display: block;
}

.warehouse-detail-grid span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.warehouse-detail-grid strong {
  color: #172033;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.shipping-ready-panel {
  margin: 0 0 18px;
  padding: 16px 18px;
  background: #eaf8f2;
  border: 1px solid #47b881;
  border-left: 5px solid #147d64;
  border-radius: 7px;
}

.shipping-ready-heading span {
  color: #067647;
  font-size: 12px;
  font-weight: 800;
}

.shipping-ready-heading h2 {
  margin: 2px 0 12px;
  color: #134e3a;
  font-size: 19px;
}

.shipping-ready-list {
  display: grid;
  gap: 8px;
}

.shipping-ready-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 8px;
  border-top: 1px solid #b7e4ce;
}

.shipping-ready-item strong,
.shipping-ready-item span {
  display: block;
}

.shipping-ready-item span {
  margin-top: 2px;
  color: #356859;
  font-size: 12px;
}

.shipping-product-list {
  display: grid;
  gap: 16px;
}

.shipping-product-state {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.shipping-status {
  min-width: 62px;
  justify-content: center;
}

.shipping-list-table {
  min-width: 1120px;
  table-layout: fixed;
}

.shipping-list-table th:nth-child(1) {
  width: 12%;
}

.shipping-list-table th:nth-child(2) {
  width: 17%;
}

.shipping-list-table th:nth-child(3) {
  width: 15%;
}

.shipping-list-table th:nth-child(4) {
  width: 9%;
}

.shipping-list-table th:nth-child(5) {
  width: 8%;
}

.shipping-list-table th:nth-child(6) {
  width: 12%;
}

.shipping-list-table th:nth-child(7) {
  width: 9%;
}

.shipping-list-table th:nth-child(8) {
  width: 12%;
}

.shipping-list-table th:nth-child(9) {
  width: 6%;
}

.outbound-list-table table {
  min-width: 1120px;
  table-layout: fixed;
}

.outbound-list-table th:nth-child(1) {
  width: 13%;
}

.outbound-list-table th:nth-child(2) {
  width: 18%;
}

.outbound-list-table th:nth-child(3) {
  width: 17%;
}

.outbound-list-table th:nth-child(4) {
  width: 9%;
}

.outbound-list-table th:nth-child(5) {
  width: 10%;
}

.outbound-list-table th:nth-child(6) {
  width: 15%;
}

.outbound-list-table th:nth-child(7) {
  width: 10%;
}

.outbound-list-table th:nth-child(8) {
  width: 8%;
}

.shipping-product-panel {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shipping-product-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: #eef5fb;
  border-bottom: 1px solid #cbdceb;
}

.shipping-product-header span,
.shipping-product-header small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.shipping-product-header h3 {
  margin: 2px 0;
  color: #15396b;
  font-size: 19px;
}

.shipping-product-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shipping-product-status strong {
  color: #15396b;
  font-size: 18px;
}

.shipping-product-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.shipping-product-facts > div {
  min-width: 0;
  padding: 11px 13px;
  background: #fff;
}

.shipping-product-facts span,
.shipping-product-facts strong {
  display: block;
}

.shipping-product-facts span {
  color: var(--muted);
  font-size: 11px;
}

.shipping-product-facts strong {
  margin-top: 3px;
  color: #172033;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.shipping-product-form {
  padding: 18px;
}

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

.shipping-form-grid label {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  margin: 0;
  color: #344054;
  font-size: 13px;
}

.shipping-form-grid label.wide {
  grid-column: 1 / -1;
}

.shipping-form-grid label.shipping-status-field {
  grid-column: span 2;
  padding: 10px;
  color: #8a3f00;
  background: #fff8e8;
  border: 2px solid #f2b84b;
  border-radius: 6px;
  font-weight: 700;
}

.shipping-status-field .form-select {
  border-color: #dc6803;
  font-weight: 700;
}

.shipping-form-grid small {
  min-height: 18px;
  color: var(--muted);
  font-size: 11px;
}

.attachment-link {
  font-weight: 600;
}

.shipping-product-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.outbound-list-table td {
  padding: 16px 18px;
}

.outbound-order-link {
  color: #15396b;
  font-size: 17px;
  font-weight: 800;
}

.table-link-button {
  padding: 0;
  color: var(--blue-700);
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.table-link-button:hover,
.table-link-button:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.table-link-button.missing {
  color: #b42318;
}

.table-link-button.complete {
  color: var(--blue-700);
}

.shipping-edit-dialog {
  width: min(1180px, calc(100vw - 32px));
}

.shipping-edit-dialog .record-detail-body {
  padding: 12px;
}

.outbound-cost-section {
  margin-bottom: 18px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid #147d64;
  border-radius: 8px;
}

.outbound-cost-section .form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.outbound-cost-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  color: #344054;
  font-size: 13px;
}

.outbound-cost-grid label.wide {
  grid-column: 1 / -1;
}

.outbound-cost-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.outbound-product-list {
  display: grid;
  gap: 16px;
}

.outbound-product-detail {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.outbound-product-detail > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  color: #fff;
  background: #174a73;
}

.outbound-product-detail > header h3 {
  margin: 0;
  font-size: 17px;
}

.outbound-product-detail > header span {
  color: #d5e9f8;
  font-size: 13px;
}

.outbound-product-detail .warehouse-detail-section {
  padding: 15px 16px 0;
}

.outbound-product-detail .warehouse-detail-section:last-child {
  padding-bottom: 16px;
}

.production-payment-section {
  margin-top: 24px;
  padding: 18px;
  background: #fff8e8;
  border: 2px solid #f2b84b;
  border-left: 6px solid #dc6803;
  border-radius: 8px;
}

.production-payment-section .form-section-title,
.production-payment-panel .form-section-title {
  color: #8a3f00;
  font-size: 18px;
}

.production-payment-panel {
  background: #fff8e8;
  border: 2px solid #f2b84b;
  border-left: 6px solid #dc6803;
}

.production-payment-section .form-select,
.production-payment-section .form-control,
.production-payment-panel .form-select {
  border-color: #e5a33b;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    min-width: 0;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    padding: 12px;
  }

  .brand {
    padding: 4px 4px 10px;
  }

  .sidebar nav {
    display: flex;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    padding-top: 10px;
  }

  .sidebar .nav-link {
    white-space: nowrap;
  }

  .metric-grid,
  .detail-grid,
  .purchase-summary,
  .form-grid,
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .purchase-sync-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .warehouse-record-header,
  .warehouse-status-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .warehouse-record-header > .btn,
  .warehouse-save {
    justify-self: end;
  }

  .shipping-product-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .shipping-form-grid label.shipping-status-field {
    grid-column: auto;
  }

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

@media (max-width: 640px) {
  .topbar,
  .toolbar,
  .form-actions,
  .proof-panel,
  .purchase-item-heading,
  .purchase-item-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-right,
  .user-switch {
    align-items: stretch;
    width: 100%;
  }

  .topbar-right {
    flex-direction: column;
  }

  .topbar,
  .content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .metric-grid,
  .detail-grid,
  .purchase-summary,
  .form-grid,
  .filter-grid,
  .item-row {
    grid-template-columns: 1fr;
  }

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

  .wide {
    grid-column: auto;
  }

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

  .payment-record-header,
  .payment-record-footer,
  .payment-paid-form {
    align-items: stretch;
    flex-direction: column;
  }

  .payment-record-amount {
    justify-items: start;
  }

  .payment-record-grid {
    grid-template-columns: 1fr;
  }

  .warehouse-record-header,
  .warehouse-status-form,
  .warehouse-detail-grid {
    grid-template-columns: 1fr;
  }

  .warehouse-record-header > .btn,
  .warehouse-save,
  .warehouse-save .btn {
    width: 100%;
  }

  .record-detail-dialog {
    width: calc(100vw - 20px);
    max-height: 92vh;
  }

  .record-detail-body {
    max-height: calc(92vh - 76px);
    padding: 10px;
  }

  .shipping-ready-item {
    align-items: stretch;
    flex-direction: column;
  }

  .shipping-product-header,
  .shipping-product-status {
    align-items: flex-start;
    flex-direction: column;
  }

  .shipping-product-facts,
  .shipping-form-grid {
    grid-template-columns: 1fr;
  }

  .shipping-form-grid label.wide {
    grid-column: auto;
  }

  .shipping-product-actions .btn {
    width: 100%;
  }

  .outbound-cost-grid {
    grid-template-columns: 1fr;
  }

  .outbound-cost-grid label.wide {
    grid-column: auto;
  }

  .outbound-cost-actions .btn {
    width: 100%;
  }

  .approval-dialog {
    width: calc(100vw - 20px);
    max-height: 90vh;
  }

  .approval-dialog-body {
    max-height: calc(90vh - 72px);
    padding: 10px;
  }

  .approval-info-grid,
  .approval-decision-grid {
    grid-template-columns: 1fr;
  }

  .approval-item-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .payment-paid-form .btn,
  .payment-paid-form input[type="date"] {
    width: 100%;
  }

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

  .actions {
    justify-content: stretch;
  }

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

  .filter-actions {
    flex-direction: column;
  }

  .proof-image {
    width: 100%;
    height: auto;
    max-height: 280px;
  }
}

.add-on-action {
  border-color: #b86d08;
  background: #f3a712;
  color: #231a08;
  font-weight: 700;
}

.add-on-action:hover {
  border-color: #915100;
  background: #df9000;
  color: #171004;
}

.add-on-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border-left: 4px solid #d88908;
  background: #fff6df;
  color: #5c3a05;
}

.add-on-banner strong {
  padding: 3px 9px;
  border-radius: 4px;
  background: #d88908;
  color: #fff;
}

.line-total-preview[readonly] {
  border-color: #b9c8c3;
  background: #eef5f2;
  color: #125848;
  font-weight: 700;
}

.required-field {
  color: #a62c2c;
  font-weight: 700;
}

.payment-proof-pending {
  border-color: #d88908;
  background: #fff9eb;
}

/* 2026 GlobalTrade-inspired operational UI refresh */
html {
  background: var(--bg);
}

body {
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

body,
button,
input,
select,
textarea {
  letter-spacing: 0;
}

a {
  color: #202328;
  font-weight: 600;
}

a:hover {
  color: #000;
  text-decoration: none;
}

.app-shell {
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 8px;
  min-height: 100vh;
  padding: 8px;
}

.sidebar {
  position: sticky;
  top: 8px;
  display: flex;
  flex-direction: column;
  align-self: start;
  height: calc(100vh - 16px);
  padding: 10px 8px;
  color: var(--ink);
  background: #f0ede4;
  border: 1px solid #d4d1c7;
  border-radius: 8px;
}

.brand {
  gap: 10px;
  min-height: 54px;
  padding: 6px 8px 12px;
  border-bottom: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  color: #fff;
  background: #111318;
  border: 1px solid #050607;
  border-radius: 8px;
  box-shadow: 0 5px 14px rgba(17, 19, 24, 0.18);
}

.brand-title {
  color: #111318;
  font-size: 15px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 1px;
  color: #777970;
  font-size: 9px;
  font-weight: 800;
}

.sidebar nav {
  display: grid;
  gap: 4px;
  padding: 8px 0 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 39px;
  padding: 8px 10px 8px 39px;
  color: #303238;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  transition: color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.sidebar .nav-link::before {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  content: "";
  background: currentColor;
  mask: var(--nav-icon) center / contain no-repeat;
  -webkit-mask: var(--nav-icon) center / contain no-repeat;
}

.sidebar .nav-link[href="/"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='7' height='7' x='3' y='3' rx='1'/%3E%3Crect width='7' height='7' x='14' y='3' rx='1'/%3E%3Crect width='7' height='7' x='14' y='14' rx='1'/%3E%3Crect width='7' height='7' x='3' y='14' rx='1'/%3E%3C/svg%3E");
}

.sidebar .nav-link[href="/products"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 8-9 5-9-5'/%3E%3Cpath d='m3 8 9-5 9 5v8l-9 5-9-5Z'/%3E%3Cpath d='M12 13v8'/%3E%3C/svg%3E");
}

.sidebar .nav-link[href="/production-orders"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M14 2v6h6M8 13h8M8 17h8'/%3E%3C/svg%3E");
}

.sidebar .nav-link[href="/purchase-orders"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='21' r='1'/%3E%3Ccircle cx='19' cy='21' r='1'/%3E%3Cpath d='M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h7.82a2 2 0 0 0 2-1.66L20.2 6H5.12'/%3E%3C/svg%3E");
}

.sidebar .nav-link[href="/finance/payment-requests"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' x2='12' y1='2' y2='22'/%3E%3Cpath d='M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'/%3E%3C/svg%3E");
}

.sidebar .nav-link[href="/warehouse"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21V9l9-7 9 7v12'/%3E%3Cpath d='M13 13h4v8H7v-8h4'/%3E%3Cpath d='M7 17h6'/%3E%3C/svg%3E");
}

.sidebar .nav-link[href="/shipping"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17h4V5H2v12h3'/%3E%3Cpath d='M14 9h4l4 4v4h-3M14 17h1'/%3E%3Ccircle cx='7.5' cy='17.5' r='2.5'/%3E%3Ccircle cx='17.5' cy='17.5' r='2.5'/%3E%3C/svg%3E");
}

.sidebar .nav-link[href="/outbound"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/%3E%3Cpath d='m3.3 7 8.7 5 8.7-5M12 22V12'/%3E%3C/svg%3E");
}

.sidebar .nav-link[href="/commission"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='m7 16 4-5 4 3 5-7'/%3E%3C/svg%3E");
}

.sidebar .nav-link[href="/users"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
  color: #fff;
  background: #111318;
  border-color: #111318;
  box-shadow: 0 5px 14px rgba(17, 19, 24, 0.16);
  text-decoration: none;
}

.sidebar .nav-link:active {
  transform: translateY(1px);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding: 12px 10px 4px;
  color: #74776f;
  border-top: 1px solid #d7d3c8;
  font-size: 11px;
  font-weight: 600;
}

.sidebar-footer span {
  width: 7px;
  height: 7px;
  background: #60b77a;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(96, 183, 122, 0.14);
}

.sidebar-mobile-user {
  display: none;
}

.main {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d4d1c7;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(41, 38, 31, 0.07);
}

.topbar {
  min-height: 58px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid #dedcd4;
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.topbar h1 {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 14px;
  color: #fff;
  background: #111318;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.topbar-meta {
  color: #747982;
  font-size: 12px;
  white-space: nowrap;
}

.topbar-right {
  gap: 10px;
}

.user-switch {
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding-left: 14px;
  border-left: 1px solid #dedcd4;
}

.user-avatar {
  display: grid !important;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: #111318 !important;
  background: #dcd7f4;
  border: 1px solid #cbc5e8;
  border-radius: 50%;
  font-size: 13px !important;
  font-weight: 800;
}

.user-name {
  display: grid;
  gap: 0;
  min-width: 72px;
  color: #111318 !important;
  line-height: 1.2;
}

.user-name strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
}

.user-name small {
  color: #7a7d84;
  font-size: 10px;
}

.user-switch .form-select {
  width: 152px;
  min-height: 34px;
  padding-top: 4px;
  padding-bottom: 4px;
  background-color: #f7f6f2;
  border-color: #d7d4cb;
  font-size: 11px;
}

.content {
  padding: 24px 22px 36px;
}

h1,
h2,
h3,
h4 {
  color: #111318;
}

h2 {
  font-size: 20px;
  font-weight: 800;
}

.toolbar {
  margin-bottom: 14px;
}

.toolbar p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

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

.dashboard-heading h2 {
  margin-top: 3px;
  font-size: 29px;
}

.dashboard-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-kicker {
  color: #757971;
  font-size: 11px;
  font-weight: 800;
}

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

.dashboard-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: minmax(146px, auto);
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-metrics .metric {
  position: relative;
  align-content: space-between;
  min-height: 126px;
  overflow: hidden;
  padding: 18px;
  background: #fff;
  border: 1px solid #d5d2c8;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dashboard-metrics .metric::after {
  position: absolute;
  right: 17px;
  bottom: 17px;
  width: 10px;
  height: 10px;
  content: "";
  background: #111318;
  border: 3px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  box-shadow: 0 0 0 1px #111318;
}

.dashboard-metrics .metric:first-child {
  grid-row: auto;
  min-height: 146px;
  padding: 18px;
  background: #e3e6f7;
  border: 6px solid #d6d4ef;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85), var(--shadow);
}

.dashboard-metrics .metric:first-child::before {
  align-self: start;
  width: max-content;
  padding: 5px 9px;
  color: #fff;
  background: #111318;
  border-radius: 999px;
  content: "实时订单";
  font-size: 10px;
  font-weight: 800;
}

.dashboard-metrics .metric:nth-child(3) {
  background: #def0d9;
  border: 6px solid #cbe5c7;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85), var(--shadow);
}

.dashboard-metrics .metric:nth-child(5) {
  background: #eeebfa;
  border: 6px solid #e1ddf3;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85), var(--shadow);
}

.dashboard-metrics .approval-metric {
  border-width: 6px;
  box-shadow: var(--shadow);
}

.dashboard-metrics .metric:nth-child(2) {
  background: #fff0c9;
  border-color: #f1bd4f;
}

.dashboard-metrics .metric:nth-child(4) {
  background: #fde4e7;
  border-color: #e58f99;
}

.dashboard-metrics .metric:nth-child(2) > span {
  color: #8b5a00;
}

.dashboard-metrics .metric:nth-child(4) > span {
  color: #a52e3b;
}

.dashboard-metrics .approval-metric strong {
  width: max-content;
  padding-bottom: 6px;
  border-bottom: 3px solid currentColor;
}

.dashboard-metrics .metric:nth-child(2) strong {
  color: #9a6200;
}

.dashboard-metrics .metric:nth-child(4) strong {
  color: #b63140;
}

.dashboard-metrics .metric > span {
  color: #4f545c;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-metrics .metric strong {
  color: #111318;
  font-size: 36px;
  line-height: 1;
}

.dashboard-metrics .metric:first-child strong {
  font-size: 42px;
}

.metric-value-link,
.metric-value-button {
  color: inherit;
  text-decoration: none;
}

.metric-value-link:hover,
.metric-value-link:focus-visible,
.metric-value-button:hover,
.metric-value-button:focus-visible {
  color: #000;
  text-decoration: none;
}

.dashboard-table-heading {
  margin-top: 22px;
}

.text-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #34363a;
  font-size: 12px;
}

.text-action::after {
  content: "→";
  font-size: 16px;
}

.metric-grid:not(.dashboard-metrics),
.detail-grid {
  gap: 10px;
}

.metric-grid:not(.dashboard-metrics) .metric {
  min-height: 92px;
  padding: 14px 15px;
  border-color: #d9d7ce;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(30, 29, 25, 0.05);
}

.metric-grid:not(.dashboard-metrics) .metric strong {
  color: #15171a;
}

.btn {
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
}

.btn-sm {
  min-height: 31px;
  padding: 5px 11px;
  font-size: 11px;
}

.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  color: #fff;
  background: #111318;
  border-color: #111318;
}

.btn-primary:hover {
  background: #2b2e34;
  border-color: #2b2e34;
}

.btn-outline-primary,
.btn-outline-secondary {
  color: #202328;
  background: #fff;
  border-color: #cbc9c1;
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover {
  color: #fff;
  background: #111318;
  border-color: #111318;
}

.table-wrap,
.form-panel,
.filter-panel,
.purchase-item-panel,
.payment-record,
.warehouse-record,
.shipping-product-panel,
.outbound-product-detail,
.proof-panel {
  background: #fff;
  border-color: #d9d7ce;
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(35, 33, 28, 0.055);
}

.table-wrap {
  padding: 0;
  overflow-x: auto;
}

.table {
  min-width: 720px;
  color: #25282d;
}

.table thead th {
  height: 42px;
  padding: 10px 14px;
  color: #4d5158;
  background: #f2efe7;
  border-bottom: 1px solid #d6d3ca;
  font-size: 11px;
  font-weight: 800;
}

.table tbody td {
  min-height: 48px;
  padding: 12px 14px;
  border-color: #ece9e1;
  font-size: 12px;
}

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

.table tbody tr:hover td {
  background: #fbfaf6;
}

.table tbody tr[id] {
  scroll-margin-top: 18px;
}

.table td a,
.outbound-order-link,
.table-link-button {
  color: #1b1d21;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: #bbb9b1;
  text-underline-offset: 3px;
}

.table-link-button.missing {
  color: #b3353e;
  text-decoration-color: #e2a8ad;
}

.table-link-button.complete {
  color: #306e4a;
  text-decoration-color: #a8cfb7;
}

.status,
.payment-state,
.warehouse-state-badge {
  min-height: 24px;
  padding: 3px 8px;
  color: #4b4f56;
  background: #efeee9;
  border: 1px solid #ddd9cf;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.status.status-success,
.status.paid,
.payment-state.paid,
.warehouse-state-badge.done {
  color: #23734a;
  background: #e2f5e9;
  border-color: #b8dfc6;
}

.status.status-pending,
.payment-state:not(.paid),
.warehouse-state-badge.quality:not(.done) {
  color: #8a6019;
  background: #fff4d9;
  border-color: #ebd29a;
}

.status.status-danger {
  color: #a72f3a;
  background: #fde9eb;
  border-color: #efbcc1;
}

.filter-panel {
  margin-bottom: 14px;
  padding: 14px;
  background: #faf9f5;
}

.filter-grid {
  gap: 10px;
}

.filter-grid label,
.form-grid label,
.item-row label,
.shipping-form-grid label,
.outbound-cost-grid label {
  color: #50545b;
  font-size: 11px;
  font-weight: 700;
}

.form-control,
.form-select {
  min-height: 39px;
  color: #202328;
  background-color: #fff;
  border: 1px solid #d0cec6;
  border-radius: 7px;
  font-size: 12px;
}

.form-control:focus,
.form-select:focus {
  border-color: #656871;
  box-shadow: 0 0 0 3px rgba(17, 19, 24, 0.08);
}

textarea.form-control {
  min-height: 96px;
  resize: vertical;
}

.form-panel {
  padding: 18px;
}

.form-section-title {
  margin: 20px 0 12px;
  padding-bottom: 9px;
  color: #17191d;
  border-bottom: 1px solid #e3e0d8;
  font-size: 15px;
}

.item-row,
.purchase-sync-grid > div,
.payment-record-grid > div,
.warehouse-detail-grid > div,
.approval-info-grid > div {
  background: #f7f5ef;
  border-color: #dedbd2;
  border-radius: 7px;
}

.item-row {
  padding: 14px;
}

.purchase-item-heading h3,
.payment-record-header h3,
.shipping-product-header h3,
.purchase-item-footer strong,
.payment-record-amount strong,
.proof-title {
  color: #17191d;
}

.purchase-item-panel,
.payment-record {
  padding: 16px;
}

.purchase-config-button,
.plug-reference-link,
.plug-reference summary {
  color: #2b2e33;
  text-decoration: underline;
  text-decoration-color: #c5c2b9;
  text-underline-offset: 3px;
}

.tabs {
  gap: 5px;
  margin-bottom: 14px;
  padding: 3px;
  width: max-content;
  max-width: 100%;
  background: #f1efe8;
  border: 1px solid #d9d6cd;
  border-radius: 8px;
}

.tab {
  min-height: 32px;
  padding: 5px 11px;
  color: #555960;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.tab.active,
.tab:hover {
  color: #fff;
  background: #111318;
}

.warehouse-record-list,
.shipping-product-list,
.outbound-product-list,
.purchase-item-list,
.payment-record-list {
  gap: 12px;
}

.warehouse-record-header {
  padding: 14px 16px;
  background: #f3f0e8;
  border-color: #d9d6cd;
}

.warehouse-record-header strong,
.warehouse-check strong,
.shipping-product-facts strong,
.warehouse-detail-grid strong {
  color: #202328;
}

.warehouse-status-form {
  padding: 14px 16px;
}

.warehouse-check {
  background: #faf9f5;
  border-color: #d9d6cd;
  border-radius: 7px;
}

.warehouse-check:has(input:checked) {
  background: #e8f5e9;
  border-color: #a8d1b3;
}

.shipping-product-header {
  padding: 14px 16px;
  background: #f0eee7;
  border-color: #d8d5cc;
}

.shipping-product-facts {
  background: #e5e2da;
  border-color: #e0ddd5;
}

.shipping-product-form,
.outbound-cost-section {
  padding: 16px;
}

.shipping-form-grid label.shipping-status-field {
  color: #6e4f17;
  background: #fff5dc;
  border: 1px solid #e8c97c;
  border-left: 4px solid #d79a24;
  border-radius: 7px;
}

.shipping-status-field .form-select {
  border-color: #d7ae51;
}

.shipping-ready-panel {
  margin-bottom: 16px;
  padding: 15px 17px;
  background: #e4f3e3;
  border: 1px solid #b6d8bb;
  border-left: 5px solid #4b9862;
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(44, 105, 65, 0.07);
}

.shipping-ready-heading span,
.shipping-ready-heading h2 {
  color: #296640;
}

.shipping-ready-item {
  border-color: #bedcc4;
}

.outbound-product-detail > header {
  background: #24272c;
}

.outbound-cost-section {
  border-left-color: #68a67b;
}

.production-payment-section,
.production-payment-panel {
  background: #fff6df;
  border: 1px solid #e7ca87;
  border-left: 5px solid #d49b32;
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(119, 83, 21, 0.07);
}

.production-payment-section .form-section-title,
.production-payment-panel .form-section-title {
  color: #765415;
  border-bottom-color: #ead6a7;
}

.record-detail-dialog,
.approval-dialog {
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #c9c6bd;
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(22, 22, 20, 0.28);
}

.record-detail-dialog::backdrop,
.approval-dialog::backdrop {
  background: rgba(24, 25, 27, 0.56);
  backdrop-filter: blur(2px);
}

.record-detail-header,
.approval-dialog-header {
  min-height: 58px;
  padding: 13px 16px;
  color: #fff;
  background: #17191d;
  border-bottom: 1px solid #2e3035;
}

.record-detail-header span,
.approval-dialog-header span {
  color: #c9ccd1;
}

.record-detail-header h2,
.approval-dialog-header h2 {
  color: #fff;
  font-size: 18px;
}

.dialog-close {
  width: 32px;
  height: 32px;
  min-height: 32px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  font-size: 20px;
}

.record-detail-body,
.approval-dialog-body {
  gap: 12px;
  padding: 16px;
  background: #faf9f5;
}

.approval-item {
  padding: 15px;
  background: #fff;
  border: 1px solid #e2c684;
  border-left: 5px solid #d49b32;
  border-radius: 8px;
}

.payment-approval-item {
  border-color: #e4aab0;
  border-left-color: #bd3f48;
}

.approval-item-heading h3,
.approval-item-heading > strong {
  color: #2a2c31;
}

.empty-state {
  padding: 34px 14px;
  color: #82858b;
  font-size: 12px;
}

.product-suggestions {
  border-color: #d3d0c7;
  box-shadow: 0 16px 35px rgba(22, 22, 20, 0.16);
}

.product-suggestion-item:hover,
.product-suggestion-item:focus {
  color: #fff;
  background: #202328;
}

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

  .dashboard-metrics .metric:first-child {
    grid-row: auto;
    min-height: 180px;
  }
}

@media (max-width: 980px) {
  html,
  body {
    background: #fff;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100vw;
    height: auto;
    padding: 8px 10px 7px;
    background: #f0ede4;
    border: 0;
    border-bottom: 1px solid #d4d1c7;
    border-radius: 0;
  }

  .brand {
    min-height: 42px;
    padding: 0 2px 6px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
  }

  .sidebar nav {
    display: flex;
    gap: 5px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 4px 0 0;
    overflow-x: auto;
  }

  .sidebar .nav-link {
    min-height: 34px;
    padding: 6px 11px 6px 33px;
    white-space: nowrap;
  }

  .sidebar .nav-link::before {
    left: 10px;
    width: 14px;
    height: 14px;
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .topbar {
    position: static;
  }

  .metric-grid:not(.dashboard-metrics),
  .detail-grid,
  .purchase-summary,
  .form-grid,
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  html,
  body,
  .app-shell,
  .main,
  .topbar,
  .content {
    width: 100%;
    min-width: 0;
    max-width: 100vw;
  }

  body,
  .app-shell,
  .main {
    overflow-x: hidden;
  }

  .topbar {
    position: relative;
    align-items: center;
    flex-direction: row;
    gap: 6px;
    justify-content: space-between;
    min-height: 54px;
    padding: 8px 12px;
  }

  .topbar-context {
    gap: 8px;
  }

  .topbar-meta,
  .user-name {
    display: none;
  }

  .topbar-right,
  .user-switch {
    flex-direction: row;
    align-items: center;
    width: auto;
    min-width: 0;
  }

  .topbar-right {
    display: none;
  }

  .sidebar-mobile-user {
    position: absolute;
    top: 10px;
    right: 12px;
    display: block;
  }

  .sidebar-mobile-user .user-switch {
    display: flex;
  }

  .user-switch {
    position: relative;
    gap: 6px;
    width: auto;
    max-width: none;
    padding-left: 0;
    border-left: 0;
  }

  .user-switch .user-name {
    display: none;
  }

  .user-switch form .btn {
    min-height: 30px;
    padding: 3px 8px;
    font-size: 11px;
  }

  .user-avatar {
    width: 30px;
    height: 30px;
  }

  .user-switch .form-select {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    cursor: pointer;
    opacity: 0;
  }

  .content {
    padding: 18px 12px 30px;
  }

  .dashboard-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-heading h2 {
    font-size: 25px;
  }

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

  .dashboard-metrics,
  .metric-grid:not(.dashboard-metrics),
  .detail-grid,
  .purchase-summary,
  .form-grid,
  .filter-grid,
  .item-row {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics .metric:first-child {
    min-height: 170px;
  }

  .dashboard-metrics .metric:first-child strong {
    font-size: 46px;
  }

  .toolbar,
  .form-actions,
  .proof-panel,
  .purchase-item-heading,
  .purchase-item-footer {
    align-items: stretch;
  }

  .tabs {
    width: 100%;
  }

  .table-wrap {
    border-radius: 7px;
  }

  .record-detail-dialog,
  .approval-dialog {
    width: calc(100vw - 16px);
  }
}

.cancelled-order-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 16px;
  color: #8f1d18;
  background: #fff1f0;
  border: 1px solid #e9aaa5;
  border-left: 5px solid #b42318;
  border-radius: 7px;
}

.cancelled-order-banner strong,
.cancelled-order-banner span {
  display: block;
}

.cancel-order-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 22px;
  padding: 16px;
  background: #fff8f7;
  border: 1px solid #edc4c0;
  border-radius: 7px;
}

.cancel-order-panel label {
  margin: 0;
  color: #7a271a;
  font-weight: 700;
}

.cancelled-fields {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.user-edit-dialog {
  width: min(680px, calc(100vw - 32px));
}

.user-edit-dialog .checkbox-field {
  display: flex;
  align-items: center;
  align-self: end;
  min-height: 38px;
  gap: 9px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #d5d2ca;
  border-radius: 6px;
}

.user-edit-dialog .checkbox-field input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #146c5a;
}

.freight-excluded {
  display: flex;
  align-items: center;
  min-height: 39px;
  margin: 0;
  padding: 9px 11px;
  color: #17624f;
  background: #edf8f3;
  border: 1px solid #b9dfd1;
  border-radius: 7px;
  font-weight: 700;
}

.company-expense-metric {
  border-color: #e7c788 !important;
  background: #fff9e9 !important;
}

#exchangeRateInput[readonly] {
  color: #17624f;
  background: #f1f7f4;
  font-weight: 700;
}

#exchangeRateStatus {
  color: #686b70;
  font-weight: 500;
}

.role-reminder-panel {
  margin: 0 0 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d8d5cc;
  border-left: 4px solid #b64035;
  border-radius: 7px;
  box-shadow: 0 5px 18px rgba(25, 27, 31, 0.06);
}

.role-reminder-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: #fff9f4;
  border-bottom: 1px solid #e7ded4;
}

.role-reminder-panel > header span {
  display: block;
  color: #9b3f34;
  font-size: 11px;
  font-weight: 800;
}

.role-reminder-panel > header h2 {
  margin: 2px 0 0;
  color: #181a1e;
  font-size: 17px;
}

.role-reminder-panel > header > strong {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: #b64035;
  border-radius: 50%;
  font-size: 14px;
}

.role-reminder-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.role-reminder-item {
  display: flex;
  min-width: 0;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  color: #22252a;
  text-align: left;
  text-decoration: none;
  background: #fff;
  border: 0;
  border-right: 1px solid #e4e1d9;
  border-bottom: 3px solid #b64035;
  cursor: pointer;
}

.role-reminder-item:last-child {
  border-right: 0;
}

.role-reminder-item.warning {
  border-bottom-color: #c88a22;
}

.role-reminder-item.success {
  border-bottom-color: #24745f;
}

.role-reminder-item:hover,
.role-reminder-item:focus-visible {
  color: #111318;
  background: #faf9f6;
  outline: 0;
}

.role-reminder-copy {
  min-width: 0;
}

.role-reminder-copy strong,
.role-reminder-copy small {
  display: block;
}

.role-reminder-copy strong {
  margin-bottom: 4px;
  font-size: 13px;
}

.role-reminder-copy small {
  overflow: hidden;
  color: #6c7077;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-reminder-item > b {
  flex: 0 0 auto;
  color: #9b3028;
  font-size: 22px;
}

.role-reminder-item.warning > b {
  color: #9d6815;
}

.role-reminder-item.success > b {
  color: #17624f;
}

.role-reminder-empty {
  grid-column: 1 / -1;
  padding: 18px 16px;
}

.role-reminder-empty strong,
.role-reminder-empty span {
  display: block;
}

.role-reminder-empty strong {
  color: #2a2d32;
  font-size: 13px;
}

.role-reminder-empty span {
  margin-top: 3px;
  color: #777a80;
  font-size: 11px;
}

@media (max-width: 640px) {
  .role-reminder-list {
    grid-template-columns: 1fr;
  }

  .role-reminder-item {
    border-right: 0;
  }

  .login-page {
    padding: 12px;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: 150px;
    padding: 24px;
  }

  .login-brand-panel img {
    width: 150px;
  }

  .login-brand-panel h1 {
    font-size: 25px;
  }

  .login-form-panel {
    padding: 30px 24px 34px;
  }

  .cancelled-order-banner,
  .cancel-order-panel {
    align-items: stretch;
    flex-direction: column;
  }
}
