:root {
  --bg: #f3f6f4;
  --bg-soft: #e9efec;
  --panel: #ffffff;
  --panel-2: #f7faf8;
  --panel-3: #eef5f1;
  --sidebar: #12201a;
  --sidebar-soft: #1d3328;
  --sidebar-active: #27513f;
  --text: #18211d;
  --muted: #66736d;
  --muted-2: #84918b;
  --border: #dbe5df;
  --border-strong: #c9d7d0;
  --line: var(--border);
  --accent: #197447;
  --accent-dark: #115d38;
  --accent-2: #e7f5ed;
  --danger: #b83232;
  --warning: #ad6b00;
  --blue: #28658d;
  --ink: var(--text);
  --shadow: 0 14px 34px rgba(28, 48, 38, 0.08);
  --shadow-soft: 0 8px 20px rgba(28, 48, 38, 0.06);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0) 260px),
    var(--bg);
  font-size: 14px;
  overflow-x: hidden;
}

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

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

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

input.entry-required,
select.entry-required,
textarea.entry-required {
  background: #fff1f4;
  border-color: #efa7b5;
}

input.entry-optional,
select.entry-optional,
textarea.entry-optional {
  background: #fff9df;
  border-color: #e5d28a;
}

input.entry-required:focus,
select.entry-required:focus,
textarea.entry-required:focus {
  border-color: #df6f84;
  box-shadow: 0 0 0 3px rgba(223, 111, 132, 0.16);
}

input.entry-submit-missing,
select.entry-submit-missing,
textarea.entry-submit-missing {
  border-color: #c51f3a !important;
  background: #ffe0e6 !important;
  box-shadow: 0 0 0 3px rgba(197, 31, 58, 0.2), inset 4px 0 0 rgba(197, 31, 58, 0.65) !important;
}

.field.field-submit-missing label {
  color: #a5142d;
  font-weight: 950;
}

input.entry-optional:focus,
select.entry-optional:focus,
textarea.entry-optional:focus {
  border-color: #c9aa3e;
  box-shadow: 0 0 0 3px rgba(201, 170, 62, 0.16);
}

button {
  border: 0;
  cursor: pointer;
}

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

.sidebar {
  background:
    linear-gradient(180deg, rgba(36, 72, 55, 0.42), rgba(18, 32, 26, 0) 280px),
    var(--sidebar);
  color: #fff;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
  min-width: 0;
}

.brand {
  padding: 8px 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 12px;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: 0;
}

.brand p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

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

.nav button {
  position: relative;
  text-align: left;
  width: 100%;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  border-radius: 7px;
  padding: 11px 12px 11px 16px;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav button::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 99px;
  background: transparent;
}

.nav button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav button.active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.nav button.active::before {
  background: #67d092;
}

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

.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nav-group-toggle b {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.58);
  font-weight: 700;
}

.nav-sub {
  display: none;
  gap: 4px;
  margin: 1px 0 4px 10px;
  padding-left: 9px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.nav-group.open .nav-sub {
  display: grid;
}

.nav button.nav-sub-item {
  padding: 9px 10px 9px 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.04);
}

.nav button.nav-sub-item:hover,
.nav button.nav-sub-item.active {
  color: #fff;
}

.main {
  min-width: 0;
  max-width: 100%;
}

.topbar {
  min-height: 68px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h2 {
  font-size: 21px;
  line-height: 1.2;
  margin: 0;
  font-weight: 850;
  letter-spacing: 0;
}

.topbar .user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 240px),
    var(--bg);
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-brand {
  padding: 28px 30px 22px;
  background:
    linear-gradient(180deg, rgba(39, 81, 63, 0.1), rgba(255, 255, 255, 0)),
    var(--panel);
  border-bottom: 1px solid var(--border);
}

.login-brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: 0;
}

.login-brand p {
  margin: 8px 0 0;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
  padding: 24px 30px 28px;
}

.login-submit {
  width: 100%;
  min-height: 42px;
}

.login-error {
  display: none;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

.login-error.show {
  display: block;
}

.login-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.content {
  padding: 24px 30px 52px;
}

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

.toolbar h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

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

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

.panel-header {
  min-height: 54px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, #fbfdfc);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h3,
.panel-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: 0;
}

.panel-body {
  padding: 18px;
  min-width: 0;
}

.kpi {
  position: relative;
  padding: 18px;
  min-height: 116px;
}

.kpi::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 3px;
  border-radius: 99px 99px 0 0;
  background: linear-gradient(90deg, var(--accent), rgba(40, 101, 141, 0.38));
}

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

.kpi .value {
  margin-top: 12px;
  font-size: 29px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0;
}

.kpi .hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #1f8652, var(--accent));
  color: white;
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(25, 116, 71, 0.16);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.btn:hover {
  background: linear-gradient(180deg, #229259, var(--accent-dark));
  box-shadow: 0 10px 22px rgba(25, 116, 71, 0.2);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.secondary {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn.danger {
  background: linear-gradient(180deg, #ca3f3f, var(--danger));
  box-shadow: 0 8px 18px rgba(184, 50, 50, 0.16);
}

.btn.table-btn {
  padding: 7px 10px;
  font-size: 12px;
  box-shadow: none;
}

button[data-edit-open],
button[data-edit-request],
button[data-base-edit] {
  border: 1px solid rgba(25, 116, 71, 0.32);
  background: #f2fbf6;
  color: var(--accent-dark);
}

button[data-delete-request] {
  border: 1px solid rgba(184, 50, 50, 0.35);
  background: #fff3f3;
  color: #9d2f2f;
}

button.btn.table-btn[data-delete-request] {
  border-color: #8f2222;
  background: linear-gradient(180deg, #c73a3a, #982525);
  color: #ffffff;
  font-weight: 900;
}

button.btn.table-btn[data-delete-request]:hover {
  border-color: #741b1b;
  background: linear-gradient(180deg, #d44b4b, #8f2020);
  color: #ffffff;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.74;
  transform: none;
}

.weigh-page {
  display: grid;
  gap: 16px;
}

.weigh-title-strip {
  min-height: 118px;
  border-radius: 8px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
}

.weigh-title-strip.inbound {
  background: linear-gradient(135deg, #126b45, #1f8a5b);
}

.weigh-title-strip.outbound {
  background: linear-gradient(135deg, #9b2f24, #c05a23);
}

.weigh-title-strip span {
  display: block;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  opacity: .86;
}

.weigh-title-strip h3 {
  margin: 8px 0 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.weigh-title-strip b {
  font-size: 42px;
  line-height: 1;
  padding: 14px 18px;
  border: 2px solid rgba(255, 255, 255, .7);
  border-radius: 8px;
}

.weigh-form input[readonly] {
  background: #f3f7f5;
  font-weight: 800;
}

.scale-live-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #c9ded2;
  border-radius: 8px;
  background: #f6fbf8;
  color: var(--text);
  font-weight: 800;
}

.scale-live-bar span {
  flex: 1 1 220px;
  min-width: 0;
}

.scale-live-bar .btn {
  padding: 8px 12px;
  box-shadow: none;
}

.weigh-warning {
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 800;
}

.weigh-warning.inbound {
  background: #e8f5ee;
  color: #126b45;
  border: 1px solid #b8dbc9;
}

.weigh-warning.outbound {
  background: #fff0e7;
  color: #9b2f24;
  border: 1px solid #f1c1aa;
}

.record-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  white-space: normal;
}

.document-actions {
  margin-bottom: 6px;
}

.document-btn {
  border: 1px solid rgba(46, 83, 122, 0.28);
  background: #eef6ff;
  color: #24476c;
}

.document-source-note {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 6px;
  border-radius: 4px;
  background: #f4f8f5;
  border: 1px solid #dbe8df;
  color: #4c6756;
  font-size: 11.5px;
}

.edit-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef5f1;
  color: #52645b;
  font-size: 12px;
  font-weight: 800;
}

.void-record-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #8f2222;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.raw-pay-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.settlement-actions {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 82px;
}

.out-payment-info {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.28;
}

.out-payment-info .status {
  width: fit-content;
}

.out-payment-info .muted {
  white-space: normal;
}

.freight-request-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px dashed rgba(25, 116, 71, 0.32);
  border-radius: 7px;
  background: #f4fbf7;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.freight-request-box.active {
  border-style: solid;
  border-color: #15803d;
  background: #ecfdf3;
  color: var(--text);
}

.freight-request-box .freight-request-copy {
  display: grid;
  flex: 1;
  min-width: 180px;
  gap: 2px;
}

.freight-request-box .freight-request-copy span {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.freight-request-box .freight-request-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.freight-request-box b {
  margin-left: auto;
  color: #0f5132;
  font-size: 13px;
  white-space: nowrap;
}

.freight-request-box.active b {
  color: #0b7a37;
}

.freight-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.freight-summary span {
  padding: 6px 9px;
  border-radius: 7px;
  background: var(--panel-3);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

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

.import-issue-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
}

.import-issue-card strong {
  color: #991b1b;
}

.import-issue-card span {
  font-weight: 900;
}

.import-issue-card small {
  color: var(--muted);
  line-height: 1.35;
  white-space: normal;
}

.excel-import-batch-table table {
  min-width: 920px;
}

.excel-import-batch-table th,
.excel-import-batch-table td {
  white-space: normal;
}

.excel-import-batch-table th:nth-child(1),
.excel-import-batch-table th:nth-child(3),
.excel-import-batch-table th:nth-child(6),
.excel-import-batch-table th:nth-child(7),
.excel-import-batch-table td:nth-child(1),
.excel-import-batch-table td:nth-child(3),
.excel-import-batch-table td:nth-child(6),
.excel-import-batch-table td:nth-child(7) {
  white-space: nowrap;
}

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

.wuqiang-filter-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.filter-action-field {
  align-self: end;
}

.filter-action-field .btn {
  width: 100%;
}

.wuqiang-ledger-table table {
  min-width: 1180px;
}

.wuqiang-ledger-table th,
.wuqiang-ledger-table td {
  white-space: normal;
}

.wuqiang-ledger-table th:nth-child(1),
.wuqiang-ledger-table th:nth-child(2),
.wuqiang-ledger-table th:nth-child(3),
.wuqiang-ledger-table th:nth-child(6),
.wuqiang-ledger-table th:nth-child(7),
.wuqiang-ledger-table th:nth-child(8),
.wuqiang-ledger-table th:nth-child(9),
.wuqiang-ledger-table th:nth-child(10),
.wuqiang-ledger-table th:nth-child(11),
.wuqiang-ledger-table th:nth-child(12),
.wuqiang-ledger-table th:nth-child(14),
.wuqiang-ledger-table td:nth-child(1),
.wuqiang-ledger-table td:nth-child(2),
.wuqiang-ledger-table td:nth-child(3),
.wuqiang-ledger-table td:nth-child(6),
.wuqiang-ledger-table td:nth-child(7),
.wuqiang-ledger-table td:nth-child(8),
.wuqiang-ledger-table td:nth-child(9),
.wuqiang-ledger-table td:nth-child(10),
.wuqiang-ledger-table td:nth-child(11),
.wuqiang-ledger-table td:nth-child(12),
.wuqiang-ledger-table td:nth-child(14) {
  white-space: nowrap;
}

.wuqiang-payable-row td {
  background: #fff7ed;
}

.wuqiang-invoice-debt-row td {
  background: #fef2f2;
}

.wuqiang-paid-row td {
  background: #f0fdf4;
}

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

@media (max-width: 760px) {
  .wuqiang-filter-bar {
    grid-template-columns: 1fr;
  }
}

.approval-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.approval-card.pending {
  padding-left: 12px;
  border-left: 4px solid var(--warn);
  background: linear-gradient(90deg, #fff8ec 0, rgba(255, 248, 236, 0) 64%);
}

.approval-card.approved {
  padding-left: 12px;
  border-left: 4px solid var(--accent);
  background: linear-gradient(90deg, #eef9f2 0, rgba(238, 249, 242, 0) 64%);
}

.approval-card.rejected {
  padding-left: 12px;
  border-left: 4px solid var(--danger);
  background: linear-gradient(90deg, #fff1f1 0, rgba(255, 241, 241, 0) 64%);
}

.approval-card:first-child {
  padding-top: 0;
}

.approval-card:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.approval-title {
  font-weight: 850;
  color: var(--text);
  margin-bottom: 6px;
}

.approval-meta,
.approval-reason {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.approval-reason {
  color: var(--text);
}

.approval-changes {
  margin-top: 10px;
  max-width: 760px;
}

.approval-changes .table-wrap {
  border: 1px solid var(--border);
  background: #fbfdfc;
}

.approval-changes table {
  min-width: 520px;
}

.approval-diff-wrap {
  display: grid;
  gap: 10px;
}

.approval-diff-title {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 6px;
  background: #edf7f1;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
}

.approval-diff-table td:nth-child(2) {
  color: var(--muted);
  background: #faf7f2;
}

.approval-diff-table td:nth-child(3) {
  color: var(--text);
  background: #f0faf4;
  font-weight: 800;
}

.approval-changes th,
.approval-changes td {
  padding: 8px 10px;
  font-size: 12px;
}

.approval-feedback {
  display: inline-flex;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #eaf7ef;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 850;
}

.approval-toolbar {
  display: grid;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

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

.approval-summary-grid div {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfc;
}

.approval-summary-grid strong {
  display: block;
  font-size: 22px;
  line-height: 1;
  color: var(--text);
}

.approval-summary-grid span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.approval-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.approval-list {
  display: grid;
}

.approval-impact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.approval-impact span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f5f7f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--border);
}

.approval-side {
  display: grid;
  justify-items: end;
  gap: 10px;
  min-width: 132px;
}

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

.settings-menu {
  display: grid;
  gap: 8px;
  position: sticky;
  top: 92px;
}

.settings-menu button {
  width: 100%;
  min-height: 38px;
  text-align: left;
  padding: 9px 12px;
  border-radius: 7px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.settings-menu button.active {
  background: var(--accent-2);
  border-color: rgba(25, 116, 71, 0.38);
  color: var(--accent-dark);
  box-shadow: inset 3px 0 0 var(--accent);
}

.settings-content {
  min-width: 0;
}

.customer-archive-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.customer-archive-section {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.customer-archive-section summary {
  min-height: 48px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  background: #f4faf6;
  border-left: 4px solid var(--accent);
  font-size: 15px;
  font-weight: 900;
}

.customer-archive-section summary::-webkit-details-marker {
  display: none;
}

.customer-archive-section summary::after {
  content: "+";
  margin-left: auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 1px solid rgba(25, 116, 71, 0.25);
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 18px;
  line-height: 1;
}

.customer-archive-section[open] summary::after {
  content: "-";
}

.customer-archive-section summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-archive-body {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
}

.customer-archive-body .table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.customer-archive-table table {
  min-width: 960px;
}

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px 0;
}

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

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

.out-items-panel {
  border: 1px solid rgba(25, 116, 71, 0.2);
  border-radius: 8px;
  background: #f3faf6;
  padding: 12px;
}

.out-items-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.out-items-title strong {
  display: block;
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
}

.out-items-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.out-item-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.out-item-row + .out-item-row,
.contract-item-row + .contract-item-row {
  margin-top: 10px;
}

.contract-items-panel {
  background: #f7f8fc;
  border-color: rgba(77, 91, 156, 0.2);
}

.contract-item-row {
  border: 1px solid rgba(77, 91, 156, 0.16);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.sales-contract-inline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px 12px;
  align-items: end;
}

.sales-contract-create-head {
  justify-content: flex-start;
}

.sales-contract-create-panel.collapsed .panel-header {
  border-bottom: 0;
}

.sales-contract-create-toggle {
  min-width: 116px;
  justify-content: center;
}

.sales-contract-inline-row {
  display: contents;
}

.sales-branch-freight-panel {
  border: 1px solid rgba(40, 101, 141, 0.18);
  border-radius: 8px;
  background: #f4f9fc;
  padding: 10px;
}

.sales-branch-freight-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sales-branch-freight-head strong {
  display: block;
  font-size: 14px;
  font-weight: 900;
}

.sales-branch-freight-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.sales-branch-freight-batch {
  display: grid;
  grid-template-columns: minmax(120px, 150px) auto;
  gap: 8px;
  align-items: center;
}

.sales-branch-freight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sales-branch-freight-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(40, 101, 141, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.78);
  padding: 8px;
}

.sales-branch-freight-row b,
.sales-branch-freight-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-branch-freight-row b {
  font-size: 12px;
  font-weight: 900;
}

.sales-branch-freight-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

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

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

.sales-order-command-card {
  border: 1px solid rgba(24, 82, 56, 0.16);
  border-radius: 8px;
  background: #f7fbf8;
  padding: 12px;
}

.sales-order-command-card.warn {
  border-color: rgba(204, 146, 40, 0.36);
  background: #fff9ec;
}

.sales-order-command-card.danger {
  border-color: rgba(190, 65, 65, 0.32);
  background: #fff5f2;
}

.sales-order-command-card span,
.sales-order-progress-meta span {
  color: var(--muted);
  font-size: 12px;
}

.sales-order-command-card strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 22px;
}

.sales-order-command-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.sales-order-progress-cell {
  min-width: 210px;
}

.external-buy-progress-cell {
  min-width: 230px;
}

.sales-order-progress-head,
.sales-order-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sales-order-progress-head {
  margin-bottom: 6px;
}

.sales-order-progress-head strong {
  color: var(--text);
}

.sales-order-progress-head span {
  color: var(--muted);
  font-size: 12px;
}

.sales-order-progress-meta {
  margin-top: 6px;
  flex-wrap: wrap;
}

.sales-order-risk-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 120px;
}

.sales-order-vehicle-count {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 58px;
  line-height: 1.15;
}

.sales-order-vehicle-count b {
  font-size: 15px;
  font-weight: 900;
}

.sales-order-vehicle-count small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.sales-order-vehicle-count.ok b {
  color: var(--success);
}

.sales-order-vehicle-count.warn b {
  color: #b7791f;
}

.sales-order-vehicle-count.danger b {
  color: var(--danger);
}

.out-item-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.out-item-row-head strong {
  font-size: 13px;
  font-weight: 900;
}

.out-item-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

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

.outbound-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  gap: 16px;
  align-items: start;
}

.outbound-primary {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.outbound-section,
.outbound-summary-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.outbound-section {
  overflow: visible;
}

.outbound-section:focus-within {
  position: relative;
  z-index: 25;
}

.outbound-section-head,
.outbound-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}

.outbound-section-head {
  border-radius: 8px 8px 0 0;
}

.outbound-section-head strong,
.outbound-summary-head strong {
  font-size: 14px;
  font-weight: 900;
}

.outbound-section-head span,
.outbound-summary-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.outbound-section-grid {
  padding: 12px;
}

.outbound-section-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.outbound-section-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.outbound-form .out-items-panel {
  border: 0;
  border-radius: 0 0 8px 8px;
  background: #f6fbf8;
  padding: 12px;
}

.outbound-form .out-items-title {
  margin-bottom: 10px;
}

.outbound-form [data-out-items] .out-item-row:nth-child(even) {
  border-color: #d99728;
  background: #fff1c9;
  box-shadow: inset 6px 0 0 #b86f00, 0 1px 0 rgba(184, 111, 0, 0.12);
}

.outbound-form [data-out-items] .out-item-row:nth-child(even) .out-item-row-head strong {
  color: #704200;
}

.outbound-summary-panel {
  position: sticky;
  top: 86px;
  box-shadow: var(--shadow-soft);
  max-height: calc(100vh - 104px);
  overflow: auto;
}

.outbound-summary-head {
  background: #eef5f1;
}

.outbound-summary-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.outbound-summary-fields .weight-alerts,
.outbound-summary-fields .freight-request-box,
.outbound-summary-fields .out-submit-check,
.outbound-summary-fields .actions {
  grid-column: 1 / -1;
}

.outbound-summary-fields .weight-alert.active {
  display: grid;
  align-items: stretch;
}

.outbound-summary-fields .freight-request-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(25, 116, 71, 0.16);
  border-radius: 8px;
  background: var(--panel-2);
}

.outbound-summary-fields .freight-request-box.active {
  border-color: #15803d;
  background: #ecfdf3;
  color: var(--text);
}

.outbound-summary-fields .freight-request-box span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.out-submit-check {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(25, 116, 71, 0.18);
  border-radius: 8px;
  background: #f5faf7;
}

.out-submit-check.warn {
  border-color: rgba(194, 128, 24, 0.28);
  background: #fff8e8;
}

.out-submit-check.danger {
  border-color: rgba(173, 49, 63, 0.32);
  background: #fff1f3;
}

.out-submit-check-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.out-submit-check-head strong {
  font-size: 13px;
  font-weight: 900;
}

.out-submit-check-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.out-submit-check.ok .out-submit-check-head span {
  color: var(--green);
}

.out-submit-check.warn .out-submit-check-head span {
  color: #9a6110;
}

.out-submit-check.danger .out-submit-check-head span {
  color: var(--danger);
}

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

.out-submit-check-grid > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(25, 116, 71, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
}

.out-submit-check-grid small,
.out-submit-check-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.out-submit-check-grid b {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.out-submit-check-lines {
  display: grid;
  gap: 5px;
}

.out-submit-check-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  border-top: 1px solid rgba(26, 52, 39, 0.08);
  font-size: 12px;
}

.out-submit-check-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.out-submit-check-line b {
  font-weight: 900;
  white-space: nowrap;
}

.out-submit-check-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.out-submit-check-alerts span {
  padding: 5px 7px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 850;
}

.out-submit-check-alerts .warn {
  background: rgba(217, 151, 40, 0.14);
  color: #8b560e;
}

.out-submit-check-alerts .danger {
  background: rgba(173, 49, 63, 0.12);
  color: var(--danger);
}

.outbound-summary-fields .actions {
  margin-top: 2px;
}

.outbound-summary-fields .actions .btn {
  width: 100%;
  min-height: 42px;
}

.outbound-stats-panel .panel {
  margin: 0;
}

.outbound-stats-collapsible.collapsed .panel-header {
  border-bottom: 0;
}

.outbound-stats-toggle-head > div {
  display: grid;
  gap: 3px;
}

.outbound-stats-toggle-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1260px) {
  .outbound-form {
    grid-template-columns: 1fr;
  }

  .outbound-summary-panel {
    position: static;
    max-height: none;
  }

  .outbound-summary-fields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .outbound-section-grid.three,
  .outbound-section-grid.four,
  .outbound-summary-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .outbound-section-head,
  .outbound-summary-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .outbound-section-head span,
  .outbound-summary-head span {
    white-space: normal;
  }

  .outbound-section-grid.three,
  .outbound-section-grid.four,
  .outbound-summary-fields {
    grid-template-columns: 1fr;
  }
}

.contract-item-fields {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.contract-acceptance-panel {
  border: 1px solid rgba(25, 116, 71, 0.18);
  border-radius: 8px;
  background: #f5fbf7;
  padding: 12px;
}

.outbound-document-rules-panel {
  border: 1px solid rgba(25, 116, 71, 0.18);
  border-radius: 8px;
  background: #f5fbf7;
  padding: 12px;
}

.outbound-document-rule-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.outbound-document-rule-grid {
  margin-top: 10px;
}

.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(25, 116, 71, 0.18);
  border-radius: 999px;
  background: #ffffff;
  color: #17342a;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.mini-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #147947;
}

.mini-check.locked {
  background: #e7f5ed;
  border-color: rgba(20, 121, 71, 0.32);
  color: #10623b;
}

.mini-check.locked input {
  cursor: default;
}

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

.acceptance-rule-group {
  border: 1px solid rgba(25, 116, 71, 0.14);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  min-width: 0;
}

.acceptance-rule-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.acceptance-rule-head strong {
  font-size: 13px;
  font-weight: 900;
}

.acceptance-rule-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.acceptance-rule-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.acceptance-rule-options label {
  display: inline-flex;
}

.acceptance-rule-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.acceptance-rule-options span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  color: #435149;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.acceptance-rule-options input:checked + span {
  border-color: rgba(25, 116, 71, 0.42);
  background: #e4f5ea;
  color: #125236;
  box-shadow: inset 0 0 0 1px rgba(25, 116, 71, 0.12);
}

.acceptance-table-note {
  margin-top: 8px;
  border-left: 3px solid rgba(25, 116, 71, 0.5);
  padding-left: 8px;
  color: #3f5f4c;
  font-size: 12px;
  line-height: 1.55;
  font-weight: 700;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field label {
  color: #52615a;
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: #fff;
  border-radius: 7px;
  padding: 9px 10px;
  min-height: 40px;
  color: var(--text);
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #b8cbc1;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(25, 116, 71, 0.12);
}

.field input.entry-required,
.field select.entry-required,
.field textarea.entry-required,
.price-input-combo input.entry-required,
.price-input-combo select.entry-required {
  background: #fff1f4;
  border-color: #efa7b5;
}

.field input.entry-optional,
.field select.entry-optional,
.field textarea.entry-optional,
.price-input-combo input.entry-optional,
.price-input-combo select.entry-optional {
  background: #fff9df;
  border-color: #e5d28a;
}

.field input.entry-required:focus,
.field select.entry-required:focus,
.field textarea.entry-required:focus,
.price-input-combo input.entry-required:focus,
.price-input-combo select.entry-required:focus {
  border-color: #df6f84;
  box-shadow: 0 0 0 3px rgba(223, 111, 132, 0.16);
}

.field input.entry-optional:focus,
.field select.entry-optional:focus,
.field textarea.entry-optional:focus,
.price-input-combo input.entry-optional:focus,
.price-input-combo select.entry-optional:focus {
  border-color: #c9aa3e;
  box-shadow: 0 0 0 3px rgba(201, 170, 62, 0.16);
}

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

.customer-picker-field {
  position: relative;
}

.customer-picker-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px auto;
  gap: 8px;
}

.customer-picker-control .btn {
  min-height: 40px;
  white-space: nowrap;
}

.customer-picker-clear {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #52615a;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.customer-picker-clear:hover,
.customer-picker-clear:focus {
  border-color: rgba(25, 116, 71, 0.42);
  background: #eaf6ef;
  color: #125236;
  outline: none;
}

.customer-picker-clear[hidden] {
  display: none;
}

.customer-picker-control:has(.customer-picker-clear[hidden]) {
  grid-template-columns: minmax(0, 1fr) auto;
}

.customer-picker-results {
  position: absolute;
  z-index: 30;
  top: calc(100% - 2px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(20, 32, 26, 0.14);
  padding: 6px;
}

.customer-picker-option {
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.customer-picker-option:hover,
.customer-picker-option:focus {
  background: #eaf6ef;
  outline: none;
}

.customer-picker-option strong {
  font-size: 13px;
  font-weight: 900;
}

.customer-picker-option span,
.customer-picker-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-picker-option.muted-option {
  color: var(--muted);
  font-weight: 800;
}

.customer-picker-empty {
  padding: 9px;
}

.price-input-combo {
  display: grid;
  grid-template-columns: minmax(150px, 0.95fr) minmax(120px, 1fr);
  gap: 8px;
}

.price-input-combo select,
.price-input-combo input {
  min-width: 0;
}

.external-direct-entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(330px, 0.78fr);
  gap: 14px;
  align-items: start;
}

.external-direct-entry-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  min-width: 0;
}

.external-direct-entry-section.external-buy-side {
  background: #f0f8f3;
  border-color: rgba(25, 116, 71, 0.24);
  box-shadow: inset 3px 0 0 rgba(25, 116, 71, 0.45);
}

.external-direct-entry-section.customer-side {
  background: #f4f7fc;
  border-color: rgba(40, 101, 141, 0.24);
  box-shadow: inset 3px 0 0 rgba(40, 101, 141, 0.42);
}

.external-direct-entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(102, 115, 109, 0.16);
}

.external-direct-entry-head strong {
  font-size: 15px;
  font-weight: 900;
}

.external-direct-entry-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

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

.external-direct-entry-section.customer-side .external-direct-entry-grid {
  grid-template-columns: minmax(0, 1fr);
}

.external-direct-entry-grid .wide {
  grid-column: 1 / -1;
}

.external-direct-check-box {
  border: 1px solid rgba(40, 101, 141, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(32, 55, 82, 0.06);
}

.external-direct-check-box.ok {
  border-color: rgba(25, 116, 71, 0.22);
  background: #f4fbf7;
}

.external-direct-check-box.warn {
  border-color: rgba(180, 122, 34, 0.28);
  background: #fffaf0;
}

.external-direct-check-box.danger {
  border-color: rgba(178, 68, 78, 0.3);
  background: #fff5f5;
}

.external-direct-check-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.external-direct-check-head strong {
  font-size: 14px;
  font-weight: 900;
}

.external-direct-check-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

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

.external-direct-check-grid div {
  min-width: 0;
  border: 1px solid rgba(102, 115, 109, 0.14);
  border-radius: 7px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.external-direct-check-grid small,
.external-direct-check-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.external-direct-check-grid b {
  display: block;
  margin: 3px 0 2px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.external-direct-check-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.external-direct-check-alerts span {
  border: 1px solid rgba(102, 115, 109, 0.18);
  border-radius: 7px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.carpool-form .carpool-selected-summary {
  border: 1px solid rgba(180, 122, 34, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff9e8;
  color: #795614;
  font-size: 13px;
  font-weight: 800;
}

.carpool-form .carpool-selected-summary.active {
  border-color: rgba(25, 116, 71, 0.24);
  background: #edf8f2;
  color: #125c37;
}

.carpool-source-block {
  border: 1px solid rgba(102, 115, 109, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbf9;
}

.carpool-block-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.carpool-block-title strong {
  font-size: 14px;
  font-weight: 900;
}

.carpool-block-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.carpool-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.carpool-suggestion-card {
  display: grid;
  gap: 5px;
  min-height: 86px;
  border: 1px solid rgba(25, 116, 71, 0.2);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.carpool-suggestion-card:hover,
.carpool-suggestion-card:focus {
  border-color: rgba(25, 116, 71, 0.45);
  box-shadow: 0 8px 20px rgba(25, 116, 71, 0.1);
}

.carpool-suggestion-card strong {
  font-size: 13px;
  font-weight: 900;
}

.carpool-suggestion-card span,
.carpool-suggestion-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.carpool-source-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 70px;
  font-weight: 900;
}

.carpool-source-table td:nth-child(6),
.carpool-record-table td:nth-child(8) {
  max-width: 320px;
  overflow-wrap: anywhere;
}

.carpool-record-source-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.carpool-record-source-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.carpool-v2-form {
  display: grid;
  gap: 14px;
}

.carpool-v2-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.carpool-v2-section.customer-side {
  background: #eef6ff;
  border-color: #c7ddff;
}

.carpool-v2-section.source-side {
  background: #f5fbf7;
  border-color: #cdebd8;
}

.carpool-v2-section-head,
.carpool-v2-line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.carpool-v2-section-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.carpool-v2-line {
  border: 1px solid #d7e7df;
  border-radius: 8px;
  padding: 10px;
  margin-top: 10px;
  background: #ffffff;
}

.carpool-v2-line:nth-child(even) {
  background: #fff8ed;
  border-color: #efd8ad;
}

.carpool-v2-line-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.carpool-v2-line.own-source .carpool-v2-supplier-field,
.carpool-v2-line.supplier-source .carpool-v2-own-field {
  display: none;
}

.carpool-v2-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.carpool-v2-summary.operator-view {
  grid-template-columns: minmax(220px, 360px);
}

.carpool-v2-summary > div {
  border: 1px solid #d8eadf;
  border-radius: 8px;
  background: #f7fbf8;
  padding: 10px;
}

.carpool-v2-summary small,
.carpool-v2-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.carpool-v2-summary b {
  display: block;
  margin: 4px 0;
  font-size: 18px;
}

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

.base-add-panel .panel-header {
  align-items: center;
}

.base-add-panel .panel-header .actions {
  margin-left: auto;
}

.base-id-select-field {
  display: none !important;
}

.base-edit-form {
  margin-top: 14px;
}

.base-edit-diff {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(25, 116, 71, 0.18);
  border-radius: 8px;
  background: #f4fbf7;
}

.base-edit-diff-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid var(--border);
}

.base-edit-diff-row strong {
  color: var(--text);
}

.base-edit-diff-row span {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 6px;
  background: #f6f8f7;
  color: var(--text);
  word-break: break-word;
}

.base-edit-diff-row span:last-child {
  background: #fff7ed;
  color: #9a4f00;
  font-weight: 800;
}

.base-edit-diff-row em {
  display: inline-block;
  margin-right: 6px;
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.base-edit-diff-empty {
  padding: 10px 12px;
  border-radius: 7px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.edit-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 30, 24, 0.42);
  backdrop-filter: blur(6px);
}

.approved-edit-panel {
  border-color: rgba(25, 116, 71, 0.28);
  box-shadow: 0 26px 72px rgba(14, 42, 29, 0.26);
}

.approved-edit-dialog {
  width: min(960px, calc(100vw - 48px));
  max-height: min(86vh, 820px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.approved-edit-panel .edit-modal-header {
  background: linear-gradient(180deg, #163d2e, #102c23);
  color: #ffffff;
  align-items: center;
}

.edit-modal-header h3 {
  color: #ffffff;
  font-size: 18px;
}

.edit-modal-header p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 700;
}

.edit-header-close {
  min-height: 40px;
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

.edit-modal-body {
  overflow: auto;
  padding: 20px;
}

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

.approved-edit-meta {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 7px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.edit-modal-actions {
  position: sticky;
  bottom: -20px;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 0 0;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), #ffffff 42%);
}

.edit-modal-actions .btn {
  min-width: 148px;
  min-height: 44px;
  font-size: 14px;
}

.edit-save-action {
  background: linear-gradient(180deg, #1f9a61, #137447);
  box-shadow: 0 12px 24px rgba(19, 116, 71, 0.24);
}

.confirm-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(9, 24, 18, 0.48);
  backdrop-filter: blur(5px);
}

.confirm-dialog {
  width: min(760px, calc(100vw - 36px));
  max-height: min(86vh, 760px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(17, 92, 59, 0.28);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 26px 70px rgba(8, 30, 20, 0.34);
}

.confirm-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #164b35, #103726);
  color: #ffffff;
}

.confirm-dialog-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 18px;
}

.confirm-dialog-close {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.confirm-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 22px 24px 18px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
  text-align: left;
}

.confirm-dialog-message {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(22, 75, 53, 0.16);
  border-radius: 8px;
  background: #f2faf5;
  color: #143c2a;
  font-weight: 760;
}

.confirm-review {
  border: 1px solid #d9e4dd;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.confirm-review-title {
  padding: 11px 14px;
  border-bottom: 1px solid #d9e4dd;
  background: #f6f8f7;
  color: #182b22;
  font-weight: 760;
}

.confirm-review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.confirm-review-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.34fr) minmax(0, 1fr);
  gap: 14px;
  padding: 10px 14px;
  border-top: 1px solid #edf2ef;
}

.confirm-review-row:first-child {
  border-top: 0;
}

.confirm-review-row span {
  color: #61726b;
}

.confirm-review-row b {
  color: #13261d;
  font-weight: 720;
  word-break: break-word;
}

.confirm-dialog-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 16px 22px 20px;
  border-top: 1px solid #e4ece7;
  background: #ffffff;
}

.confirm-dialog-actions .btn {
  min-width: 132px;
  min-height: 44px;
  font-size: 15px;
}

.confirm-input-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d9e4dd;
  border-radius: 8px;
  background: #fbfdfc;
}

.confirm-input-row label {
  color: #315043;
  font-weight: 850;
}

.confirm-input-row input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 9px 11px;
  font-size: 16px;
  font-weight: 800;
}

.confirm-cancel-action {
  background: linear-gradient(180deg, #dc4b4b, #a92d2d) !important;
  color: #ffffff !important;
  border: 1px solid rgba(130, 32, 32, 0.36) !important;
  box-shadow: 0 12px 24px rgba(169, 45, 45, 0.24) !important;
}

.confirm-ok-action {
  background: linear-gradient(180deg, #22a163, #14784a) !important;
  color: #ffffff !important;
  border: 1px solid rgba(20, 120, 74, 0.36) !important;
  box-shadow: 0 12px 24px rgba(20, 120, 74, 0.24) !important;
}

.edit-cancel-action {
  background: #ffffff !important;
  color: #23372e !important;
  border: 1px solid #b7c7bf !important;
  box-shadow: 0 8px 18px rgba(35, 55, 46, 0.08) !important;
}

.edit-delete-action {
  background: linear-gradient(180deg, #d64a4a, #a92929);
  box-shadow: 0 12px 24px rgba(169, 41, 41, 0.24);
}

.delete-retain-note {
  margin: -4px 0 16px;
  padding: 12px 14px;
  border: 1px solid #f1b5b5;
  border-radius: 7px;
  background: #fff0f0;
  color: #822222;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.55;
}

.weight-alerts {
  display: grid;
  gap: 8px;
}

.weight-alert {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 750;
}

.weight-alert.active {
  display: flex;
}

.weight-alert.confirmed {
  box-shadow: inset 0 0 0 2px rgba(25, 116, 71, 0.24);
}

.weight-alert.factory-alert {
  background: #ffe2e2;
  color: #8f1d1d;
}

.weight-alert.arrival-alert {
  background: #ffe7f1;
  color: #8d2453;
}

.weight-summary {
  padding: 9px 10px;
  border-radius: 7px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.weight-cell {
  display: inline-block;
  min-width: 78px;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--panel-3);
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.weight-cell.factory-alert {
  background: #ffd4d4;
  color: #941f1f;
}

.weight-cell.arrival-alert {
  background: #ffd7e8;
  color: #8d2453;
}

.weight-cell.pending {
  background: #f4f0df;
  color: #8a6b18;
}

.arrival-confirm-form {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.arrival-confirm-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(90px, 1fr));
  gap: 6px;
}

.arrival-confirm-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.arrival-confirm-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  font: inherit;
}

.arrival-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.arrival-compact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 240px;
}

.arrival-compact .arrival-inline-status {
  max-width: 135px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arrival-inline-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.arrival-inline-status.arrival-alert {
  color: #8d2453;
  background: #ffe7f1;
  border-radius: 6px;
  padding: 5px 6px;
  font-weight: 800;
}

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

.table-wrap {
  overflow: auto;
  border-radius: 6px;
  max-width: 100%;
  min-width: 0;
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(120px, 2fr) minmax(150px, auto);
  gap: 10px;
  align-items: center;
}

.bar-name,
.bar-value {
  font-size: 12px;
  font-weight: 800;
  color: #43534b;
}

.bar-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.bar-chip {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 0 3px rgba(26, 47, 35, 0.08);
  flex: 0 0 auto;
}

.bar-value {
  text-align: right;
  color: var(--muted);
  white-space: nowrap;
}

.bar-track {
  height: 14px;
  border-radius: 999px;
  background: var(--panel-3);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.completion-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.completion-legend {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  color: #4f665e;
  font-size: 13px;
  font-weight: 800;
}

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

.completion-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.completion-note {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #c8e3d3;
  border-radius: 8px;
  background: linear-gradient(180deg, #f3fbf6, #e8f5ee);
  color: #31584b;
  font-weight: 800;
}

.completion-flow-list {
  display: grid;
  gap: 14px;
}

.completion-flow-row {
  display: grid;
  grid-template-columns: 250px minmax(620px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.completion-flow-row.just-updated .completion-contract,
.completion-flow-row.just-updated .completion-flow-main {
  border-color: #1f9d6a;
  box-shadow: 0 0 0 3px rgba(31, 157, 106, 0.18), var(--shadow-soft);
}

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

.completion-contract,
.completion-flow-main {
  padding: 16px;
}

.completion-contract h3,
.completion-flow-main h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
}

.completion-contract p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.completion-contract strong {
  display: block;
  margin-top: 10px;
  font-size: 29px;
  line-height: 1;
  font-weight: 900;
}

.completion-contract span {
  display: block;
  margin-top: 8px;
  color: #4f665e;
}

.completion-flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.completion-stack {
  display: flex;
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eeee;
}

.completion-stack i {
  display: block;
  height: 100%;
}

.completion-stack .empty {
  background: #dce8e2;
}

.delivered,
.completion-stack .delivered {
  background: #2f946e;
}

.own,
.completion-stack .own {
  background: #55aede;
}

.external,
.completion-stack .external {
  background: #f0b94d;
}

.external-order,
.completion-stack .external-order {
  background: #a67ed7;
}

.stock,
.completion-stack .stock {
  background: #7fbf89;
}

.stock-potential,
.completion-stack .stock-potential {
  background: #9fd8b1;
}

.shortage,
.completion-stack .shortage {
  background: #e2564f;
}

.completion-lanes {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.completion-lane {
  width: 100%;
  min-height: 98px;
  padding: 12px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

button.completion-lane:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(31, 85, 58, 0.12);
}

.completion-lane span {
  display: block;
  color: #527069;
  font-size: 12px;
  font-weight: 800;
}

.completion-lane b {
  display: block;
  margin-top: 7px;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

.completion-lane small {
  display: block;
  margin-top: 8px;
  color: #4e675f;
  font-size: 12px;
}

.completion-lane.delivered {
  background: #e5f5ec;
}

.completion-lane.own {
  background: #edf8ff;
}

.completion-lane.external {
  background: #fff7df;
}

.completion-lane.external-order {
  background: #f3ecff;
}

.completion-lane.stock {
  background: #eef8ef;
}

.completion-lane.shortage {
  background: #ffe7e4;
}

.completion-source {
  display: grid;
  gap: 9px;
}

.completion-source button,
.completion-source div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #dce9e2;
  border-radius: 7px;
  background: #f6faf8;
  color: var(--text);
  font-weight: 800;
  text-align: left;
}

.completion-source button:hover {
  background: #eef8f3;
}

.completion-command-toolbar {
  align-items: flex-start;
}

.completion-command-actions-top {
  justify-content: flex-end;
  max-width: 900px;
}

.completion-command-actions-top select,
.completion-command-actions-top input {
  min-height: 38px;
  min-width: 132px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  padding: 8px 10px;
  outline: none;
}

.completion-command-actions-top input[type="search"] {
  min-width: 168px;
}

.completion-command-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.completion-command-kpi {
  min-width: 0;
  min-height: 118px;
  padding: 16px 17px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.completion-command-kpi.delivered {
  border-left-color: #2f946e;
}

.completion-command-kpi.transit {
  border-left-color: #2f73d9;
}

.completion-command-kpi.stock {
  border-left-color: #d98200;
}

.completion-command-kpi.shortage {
  border-left-color: #d43d3d;
}

.completion-command-kpi span {
  display: block;
  color: #53645d;
  font-size: 12px;
  font-weight: 900;
}

.completion-command-kpi strong {
  display: block;
  margin-top: 12px;
  color: #14271f;
  font-size: 29px;
  line-height: 1;
  font-weight: 900;
  word-break: break-word;
}

.completion-command-kpi small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 750;
}

.completion-command-board {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.completion-command-head,
.completion-command-row {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(460px, 1.58fr) minmax(220px, 0.6fr);
}

.completion-command-head {
  min-height: 48px;
  align-items: center;
  background: #f7faf8;
  border-bottom: 1px solid var(--border);
  color: #405048;
  font-size: 12px;
  font-weight: 900;
}

.completion-command-head span,
.completion-command-row > div {
  padding: 10px 12px;
  border-left: 1px solid var(--border);
}

.completion-command-head span:first-child,
.completion-command-row > div:first-child {
  border-left: 0;
}

.completion-command-row {
  min-height: 132px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

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

.completion-command-row.shortage {
  box-shadow: inset 4px 0 0 #d43d3d;
}

.completion-command-row.transit {
  box-shadow: inset 4px 0 0 #2f73d9;
}

.completion-command-row.covered,
.completion-command-row.delivered {
  box-shadow: inset 4px 0 0 #2f946e;
}

.completion-command-customer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.completion-command-contract {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 7px 13px;
  align-content: center;
}

.completion-command-customer h3 {
  margin: 0;
  color: #14271f;
  font-size: 15px;
  font-weight: 900;
}

.completion-command-meta {
  display: grid;
  gap: 2px;
  margin-top: 4px;
  color: #56685f;
  font-size: 11px;
  line-height: 1.28;
  font-weight: 750;
}

.completion-command-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.completion-command-products {
  margin-top: 4px;
  color: #31483d;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.completion-contract-total {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
  margin-top: 0;
  padding-left: 13px;
  border-left: 1px dashed #dce8e2;
}

.completion-contract-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.completion-contract-total strong {
  color: #111f18;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.completion-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.completion-progress-head span {
  display: block;
  color: #53645d;
  font-size: 12px;
  font-weight: 900;
}

.completion-progress-head strong {
  display: block;
  margin-top: 5px;
  color: #14271f;
  font-size: 20px;
  font-weight: 900;
}

.completion-progress-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.completion-stack.command {
  height: 14px;
  border-radius: 999px;
  background: #e6ece8;
}

.completion-progress-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.completion-progress-cell {
  --status-color: #6f7d76;
  --status-bg: #fbfdfc;
  --status-bg-hover: #f5fbf8;
  --status-border: #e1eae5;
  position: relative;
  min-width: 0;
  min-height: 58px;
  padding: 8px 8px 8px 10px;
  border: 1px solid var(--status-border);
  border-radius: 7px;
  background: var(--status-bg);
  text-align: left;
  color: var(--text);
  box-shadow: inset 4px 0 0 var(--status-color);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.completion-progress-cell:not(:disabled):hover {
  border-color: var(--status-color);
  background: var(--status-bg-hover);
  box-shadow: inset 4px 0 0 var(--status-color), 0 7px 16px rgba(30, 65, 49, 0.09);
  transform: translateY(-1px);
}

.completion-progress-cell:not(:disabled):focus-visible {
  outline: 2px solid var(--status-color);
  outline-offset: 2px;
}

.completion-progress-cell:disabled {
  cursor: default;
  opacity: 1;
}

.completion-progress-cell span {
  display: block;
  font-size: 11px;
  font-weight: 900;
  color: var(--status-color);
}

.completion-progress-cell b {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
}

.completion-progress-cell small {
  display: block;
  margin-top: 5px;
  color: #45554e;
  font-size: 11px;
  font-weight: 800;
}

.completion-progress-cell.delivered {
  --status-color: #2f946e;
  --status-bg: #eaf6f1;
  --status-bg-hover: #dff1e9;
  --status-border: #b9ddcf;
}

.completion-progress-cell.own {
  --status-color: #55aede;
  --status-bg: #e9f6fc;
  --status-bg-hover: #ddf0fa;
  --status-border: #b7dff1;
}

.completion-progress-cell.external {
  --status-color: #f0b94d;
  --status-bg: #fff8e8;
  --status-bg-hover: #fff1d2;
  --status-border: #f1d99c;
}

.completion-progress-cell.external-order {
  --status-color: #a67ed7;
  --status-bg: #f4eefb;
  --status-bg-hover: #ece1f8;
  --status-border: #d4c1ee;
}

.completion-progress-cell.stock {
  --status-color: #7fbf89;
  --status-bg: #eef8f0;
  --status-bg-hover: #e2f1e6;
  --status-border: #c3e1c8;
}

.completion-progress-cell.stock-potential {
  --status-color: #9fd8b1;
  --status-bg: #f0faf4;
  --status-bg-hover: #e5f5eb;
  --status-border: #ccead5;
}

.completion-progress-cell.shortage {
  --status-color: #e2564f;
  --status-bg: #fff1f0;
  --status-bg-hover: #ffe8e6;
  --status-border: #f2bdb8;
}

.completion-command-risk .danger-text {
  color: #d43d3d;
}

.completion-command-risk {
  display: grid;
  align-content: center;
  gap: 7px;
}

.completion-command-risk span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.completion-command-risk strong {
  color: #24352d;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 900;
}

.completion-command-risk p {
  margin: 0;
  color: #20342a;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 850;
}

.completion-command-risk small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 750;
}

.danger-text {
  color: var(--danger);
  font-weight: 800;
}

.package-material-status {
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid #cfe1d7;
  border-radius: 7px;
  background: #f5fbf8;
  color: #37594a;
  font-weight: 800;
}

.package-material-status.alert {
  border-color: #efb7b7;
  background: #fff0f0;
  color: var(--danger);
}

.package-material-items {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.package-material-item-row {
  border: 1px solid #d7e4dc;
  border-radius: 8px;
  background: #fbfdfb;
  padding: 12px;
}

.package-material-item-row[data-package-tone="green"] {
  border-color: #93c5a7;
  border-left: 6px solid #2e8b57;
  background: #ecf8f1;
}

.package-material-item-row[data-package-tone="rose"] {
  border-color: #e7a8ad;
  border-left: 6px solid #b94755;
  background: #fff0f1;
}

.package-material-item-row[data-package-tone="amber"] {
  border-color: #e4bf74;
  border-left: 6px solid #b77716;
  background: #fff7df;
}

.package-material-item-row[data-package-tone="blue"] {
  border-color: #9ec5e3;
  border-left: 6px solid #3d7ea6;
  background: #eef7ff;
}

.package-material-item-row[data-package-tone="purple"] {
  border-color: #c5b4e5;
  border-left: 6px solid #7c5ab8;
  background: #f6f1ff;
}

.package-material-item-row[data-package-tone="tan"] {
  border-color: #d3b58d;
  border-left: 6px solid #9a6b38;
  background: #fbf1e4;
}

.package-material-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.package-material-item-head strong {
  color: var(--ink);
  font-size: 15px;
}

.package-material-item-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.package-material-item-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(220px, 1.3fr) minmax(150px, 0.8fr) minmax(220px, 1.2fr);
  gap: 10px;
  align-items: start;
}

.production-warehouse-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 8px;
  max-height: 178px;
  overflow: auto;
  border: 1px solid #d6e2dc;
  border-radius: 8px;
  background: #fbfdfc;
  padding: 8px;
}

.production-warehouse-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #d6e2dc;
  border-radius: 7px;
  background: #fff;
  color: #24352f;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
}

.production-warehouse-option input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--green);
}

.production-warehouse-option.selected,
.production-warehouse-option:has(input:checked) {
  border-color: rgba(31, 136, 75, 0.72);
  background: #e7f5ed;
  color: #0f5f32;
  box-shadow: inset 0 0 0 1px rgba(31, 136, 75, 0.12);
}

tbody tr.package-material-alert-row td,
tbody tr.package-material-alert-row:nth-child(even) td {
  background: #fff5f5;
}

tbody tr.aging-soft-row td,
tbody tr.aging-soft-row:nth-child(even) td {
  background: #fff1ed;
}

tbody tr.aging-hard-row td,
tbody tr.aging-hard-row:nth-child(even) td {
  background: #ffd8d8;
  color: #581b1b;
  font-weight: 800;
}

.finance-aging-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.finance-aging-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid #e4dcd3;
  border-radius: 999px;
  background: #fffaf4;
}

.finance-aging-legend i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.finance-aging-legend i.soft {
  background: #ffb9aa;
}

.finance-aging-legend i.hard {
  background: #e36f6f;
}

.finance-aging-table table {
  min-width: 1180px;
}

.finance-aging-table th,
.finance-aging-table td {
  padding: 10px 9px;
  vertical-align: top;
}

.report-kpi-strip {
  margin-bottom: 12px;
}

.report-table table {
  min-width: 1220px;
}

.report-table td:nth-child(3),
.report-table td:nth-child(4),
.report-table td:nth-child(5),
.report-table td:nth-child(6),
.inventory-value-report-table td:nth-child(7),
.inventory-value-report-table td:nth-child(8) {
  font-weight: 800;
}

.inventory-value-report-table table {
  min-width: 1080px;
}

.finance-detail-list {
  display: grid;
  gap: 4px;
  min-width: 230px;
  color: #384a42;
  font-size: 12px;
  line-height: 1.45;
}

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

.receivable-status-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid #dce6df;
  border-radius: 8px;
  padding: 12px;
  background: #f8fbf9;
}

.receivable-status-card.warn {
  border-color: #e7c78e;
  background: #fffaf0;
}

.receivable-status-card.danger {
  border-color: #e4a1a1;
  background: #fff3f3;
}

.receivable-status-card.ok {
  border-color: #bcd8c7;
  background: #f3faf6;
}

.receivable-status-card span,
.receivable-status-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.receivable-status-card strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.receivable-status-card .btn {
  justify-self: start;
}

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

.receivable-risk-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid #dce6df;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.receivable-risk-card.ok {
  border-color: rgba(25, 116, 71, 0.2);
  background: #f7fbf8;
}

.receivable-risk-card.warn {
  border-color: rgba(180, 122, 34, 0.28);
  background: #fff8ed;
}

.receivable-risk-card.danger {
  border-color: rgba(178, 68, 78, 0.32);
  background: #fff1f1;
}

.receivable-risk-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 8px;
  align-items: center;
}

.receivable-risk-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.receivable-risk-head strong {
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.receivable-risk-head b {
  grid-column: 1 / -1;
  color: #8d2b32;
  font-size: 18px;
  font-weight: 950;
}

.receivable-risk-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.receivable-risk-meta span {
  border: 1px solid rgba(102, 115, 109, 0.18);
  border-radius: 7px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.receivable-risk-card ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 16px;
  color: #35453f;
  font-size: 12px;
  line-height: 1.4;
}

.receivable-risk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.payable-workbench {
  display: grid;
  gap: 12px;
}

.payable-source-grid,
.payable-status-grid {
  display: grid;
  gap: 10px;
}

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

.payable-status-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.payable-source-card,
.payable-status-card {
  min-width: 0;
  border: 1px solid #dce6df;
  border-radius: 8px;
  padding: 12px;
  background: #f8fbf9;
  text-align: left;
}

.payable-status-card {
  cursor: pointer;
}

.payable-source-card.warn,
.payable-status-card.warn {
  border-color: #e7c78e;
  background: #fffaf0;
}

.payable-source-card.danger,
.payable-status-card.danger {
  border-color: #e4a1a1;
  background: #fff3f3;
}

.payable-source-card.ok,
.payable-status-card.ok {
  border-color: #bcd8c7;
  background: #f3faf6;
}

.payable-status-card.active {
  outline: 2px solid rgba(25, 116, 71, 0.32);
  box-shadow: 0 8px 18px rgba(25, 116, 71, 0.12);
}

.payable-source-card span,
.payable-source-card small,
.payable-source-card b,
.payable-status-card span,
.payable-status-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.payable-source-card strong,
.payable-status-card strong {
  display: block;
  margin: 5px 0 4px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.payable-action-cell {
  display: grid;
  gap: 5px;
  min-width: 96px;
}

.payable-action-cell > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.finished-supplier-ledger-panel {
  border-color: #c8dcd1;
}

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

.supplier-ledger-workflow {
  display: grid;
  grid-template-columns: minmax(560px, 1.12fr) minmax(430px, 0.88fr);
  gap: 14px;
  align-items: start;
}

.supplier-ledger-master,
.supplier-ledger-side {
  border: 1px solid #d8e7df;
  border-radius: 8px;
  background: #fbfdfc;
  overflow: hidden;
}

.supplier-ledger-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2eee8;
  background: #eef7f2;
}

.supplier-ledger-block-head strong {
  color: #20342a;
  font-size: 14px;
  font-weight: 950;
}

.supplier-ledger-block-head span {
  color: #5e7168;
  font-size: 12px;
  font-weight: 850;
}

.supplier-ledger-filter-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #edf3f0;
}

.supplier-ledger-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.75fr);
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #edf3f0;
  background: #fbfdfc;
}

.supplier-ledger-toolbar .field {
  margin: 0;
}

.supplier-ledger-tabs {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.supplier-ledger-tab {
  border: 1px solid #cfdfd6;
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff;
  color: #395147;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.supplier-ledger-tab.active {
  border-color: #16794f;
  background: #e8f6ef;
  color: #145f3f;
  box-shadow: inset 0 0 0 1px rgba(22, 121, 79, 0.18);
}

.supplier-ledger-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.supplier-ledger-flow-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px;
  border: 1px solid #dbe8df;
  border-radius: 8px;
  padding: 12px;
  background: #f7fbf8;
}

.supplier-ledger-fixed-field strong {
  min-height: 36px;
  display: flex;
  align-items: center;
  border: 1px solid #d8e2dd;
  border-radius: 6px;
  padding: 0 10px;
  background: #edf7f1;
  color: #183527;
  font-size: 13px;
  font-weight: 950;
}

.supplier-ledger-row {
  border: 1px solid #e0ebe5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 35, 27, 0.04);
  overflow: hidden;
}

.supplier-account-payable {
  border-left: 5px solid #d84a4a;
}

.supplier-account-receivable {
  border-left: 5px solid #2563eb;
}

.supplier-account-prepaid {
  border-left: 5px solid #0f8b5f;
}

.supplier-account-proof {
  border-left: 5px solid #d97706;
}

.supplier-account-balanced {
  border-left: 5px solid #9aa8a0;
}

.supplier-ledger-row.active {
  border-color: #16885a;
  background: #f2fbf6;
  box-shadow: 0 0 0 2px rgba(22, 136, 90, 0.12);
}

.supplier-ledger-row-main {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.15fr) repeat(4, minmax(80px, 0.68fr));
  gap: 10px;
  align-items: center;
  border: 0;
  padding: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.supplier-ledger-row-name {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--ink);
  font-weight: 950;
  overflow-wrap: anywhere;
}

.supplier-ledger-row-status .status {
  width: fit-content;
}

.supplier-ledger-row-main em {
  display: block;
  color: #6a7d74;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.supplier-ledger-row-main b {
  display: block;
  margin-top: 3px;
  color: #173327;
  font-size: 13px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.supplier-account-net {
  border-radius: 7px;
  padding: 8px 10px;
  background: #f6faf8;
  box-shadow: inset 0 0 0 1px #e4eee8;
}

.supplier-account-net b {
  font-size: 15px;
}

.supplier-account-net small {
  display: block;
  margin-top: 3px;
  color: #74857d;
  font-size: 11px;
  font-weight: 800;
}

.supplier-ledger-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 10px;
}

.supplier-ledger-actions .btn {
  width: 100%;
}

.supplier-ledger-empty,
.supplier-ledger-flow-empty {
  border: 1px dashed #cbded5;
  border-radius: 8px;
  padding: 18px;
  background: #f8fbfa;
  color: #52685d;
  font-size: 13px;
  font-weight: 850;
}

.supplier-ledger-flow-empty {
  display: grid;
  gap: 5px;
  margin: 12px;
}

.supplier-ledger-flow-empty strong {
  color: #20342a;
  font-size: 14px;
}

.supplier-ledger-detail {
  margin: 12px;
  border: 1px solid #dce8e0;
  border-radius: 8px;
  background: #fbfdfc;
  overflow: hidden;
}

.supplier-ledger-detail-payable {
  border-color: #f1b6b6;
}

.supplier-ledger-detail-receivable {
  border-color: #b7cbf4;
}

.supplier-ledger-detail-prepaid {
  border-color: #9fd9be;
}

.supplier-ledger-detail-proof {
  border-color: #f2c27c;
}

.supplier-ledger-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #dce8e0;
  background: #eef7f2;
}

.supplier-ledger-detail-payable .supplier-ledger-detail-head {
  background: #fff1f1;
}

.supplier-ledger-detail-receivable .supplier-ledger-detail-head {
  background: #eef4ff;
}

.supplier-ledger-detail-prepaid .supplier-ledger-detail-head {
  background: #eaf8f0;
}

.supplier-ledger-detail-proof .supplier-ledger-detail-head {
  background: #fff7e8;
}

.supplier-ledger-detail-head div > span {
  display: block;
  color: #60746a;
  font-size: 12px;
  font-weight: 850;
}

.supplier-ledger-detail-head div > strong {
  display: block;
  margin-top: 3px;
  color: #183527;
  font-size: 18px;
  font-weight: 950;
}

.supplier-ledger-detail-head div > em {
  display: block;
  margin-top: 3px;
  color: #62766b;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.supplier-ledger-focus-value {
  display: grid;
  justify-items: end;
  gap: 6px;
  text-align: right;
}

.supplier-ledger-focus-value b {
  color: #163428;
  font-size: 18px;
  font-weight: 950;
}

.supplier-ledger-current-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid #e4eee8;
  background: #e4eee8;
}

.supplier-ledger-current-kpis > div {
  padding: 10px;
  background: #fff;
}

.supplier-ledger-current-kpis span {
  display: block;
  color: #687a72;
  font-size: 11px;
  font-weight: 850;
}

.supplier-ledger-current-kpis strong {
  display: block;
  margin-top: 4px;
  color: #183527;
  font-size: 14px;
  font-weight: 950;
}

.supplier-ledger-right-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e4eee8;
  background: #fbfdfc;
}

.supplier-ledger-right-actions .btn {
  width: 100%;
}

.supplier-ledger-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.supplier-ledger-detail-grid section {
  min-width: 0;
  padding: 12px;
  border-bottom: 1px solid #e4eee8;
}

.supplier-ledger-detail-grid section:last-child {
  border-bottom: 0;
}

.supplier-ledger-detail-grid h4 {
  margin: 0 0 8px;
  color: #25382f;
  font-size: 13px;
  font-weight: 950;
}

.supplier-ledger-detail-grid ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #3d4f47;
  font-size: 12px;
  line-height: 1.45;
}

.supplier-ledger-detail-grid li {
  display: grid;
  grid-template-columns: minmax(72px, 0.7fr) minmax(120px, 1fr) minmax(92px, 0.8fr) minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  border: 1px solid #edf3ef;
  border-radius: 6px;
  padding: 7px 8px;
  background: #fff;
}

.supplier-ledger-detail-grid li strong {
  color: #163428;
  font-weight: 950;
}

.supplier-ledger-detail-grid li em {
  color: #6b7d74;
  font-style: normal;
}

.supplier-ledger-flow-title {
  border-top: 1px solid #e2eee8;
}

.non-production-shell {
  display: grid;
  gap: 14px;
}

.non-production-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid #cfe1d7;
  border-radius: 8px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #f8fcfa, #eef7f2);
  box-shadow: var(--shadow-soft);
}

.non-production-hero span,
.non-production-summary-card span,
.non-production-detail-head span,
.non-production-current span,
.non-production-action-head span {
  display: block;
  color: #60746b;
  font-size: 12px;
  font-weight: 850;
}

.non-production-hero strong {
  display: block;
  margin-top: 3px;
  color: #172f24;
  font-size: 22px;
  font-weight: 950;
}

.non-production-hero p {
  margin: 5px 0 0;
  color: #52675d;
  font-size: 13px;
  font-weight: 800;
}

.non-production-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.non-production-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.non-production-summary-card {
  min-width: 0;
  border: 1px solid #dbe8e1;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.non-production-summary-card.focus {
  border-color: #c5dfd1;
  background: #eef9f3;
}

.non-production-summary-card strong {
  display: block;
  margin: 5px 0 4px;
  color: #142c22;
  font-size: 21px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.non-production-summary-card em {
  display: block;
  color: #70827a;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.non-production-workbench {
  display: grid;
  grid-template-columns: minmax(430px, 0.9fr) minmax(560px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.non-production-master,
.non-production-detail {
  min-width: 0;
  border: 1px solid #d9e7df;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.non-production-section-head,
.non-production-detail-head,
.non-production-action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid #e1eee7;
  background: #eef7f2;
}

.non-production-section-head strong,
.non-production-action-head strong {
  display: block;
  color: #193328;
  font-size: 14px;
  font-weight: 950;
}

.non-production-section-head span {
  color: #62776c;
  font-size: 12px;
  font-weight: 850;
}

.non-production-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.non-production-filter-tab {
  border: 1px solid #cdded5;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: #3b5449;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.non-production-filter-tab.active {
  border-color: #16794f;
  background: #e5f5ed;
  color: #135d3d;
  box-shadow: inset 0 0 0 1px rgba(22, 121, 79, 0.16);
}

.non-production-contract-list {
  display: grid;
  gap: 8px;
  max-height: 640px;
  overflow: auto;
  padding: 12px;
}

.non-production-contract-card {
  border: 1px solid #e0eae5;
  border-left: 5px solid #9aa8a0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.non-production-contract-card.active {
  border-color: #16885a;
  border-left-color: #16885a;
  background: #f4fbf7;
  box-shadow: 0 0 0 2px rgba(22, 136, 90, 0.12);
}

.non-production-contract-card.dimmed {
  opacity: 0.5;
  filter: saturate(0.72);
}

.non-production-contract-card.dimmed:hover,
.non-production-contract-card.dimmed:focus-within {
  opacity: 0.9;
  filter: none;
}

.non-production-contract-card.non-production-payable {
  border-left-color: #d84a4a;
}

.non-production-contract-card.non-production-invoice {
  border-left-color: #d97706;
}

.non-production-contract-card.non-production-done {
  border-left-color: #16885a;
}

.non-production-contract-card.non-production-closed {
  border-left-color: #8fa099;
  opacity: 0.86;
}

.non-production-card-select {
  width: 100%;
  display: grid;
  gap: 7px;
  border: 0;
  padding: 11px 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.non-production-card-actions,
.non-production-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 11px;
}

.non-production-detail-actions {
  justify-content: flex-end;
  padding: 0;
}

.non-production-card-edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.non-production-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.non-production-card-top b {
  min-width: 0;
  color: #162f24;
  font-size: 14px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.non-production-card-meta,
.non-production-card-focus {
  display: block;
  color: #65786e;
  font-size: 12px;
  font-weight: 850;
}

.non-production-card-focus {
  color: #1f4735;
}

.non-production-card-progress {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.non-production-card-progress em {
  color: #556960;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.non-production-card-progress i {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: #edf2ef;
  overflow: hidden;
}

.non-production-card-progress u {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #16885a;
  text-decoration: none;
}

.non-production-card-progress.invoice u {
  background: #d97706;
}

.non-production-stage-progress {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.non-production-stage-progress em {
  color: #556960;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.non-production-stage-progress b {
  display: flex;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2ef;
}

.non-production-stage-progress i {
  position: relative;
  display: block;
  min-width: 3px;
}

.non-production-stage-progress i span {
  position: absolute;
  left: 50%;
  bottom: 13px;
  display: none;
  transform: translateX(-50%);
  white-space: nowrap;
  border: 1px solid #d5e3db;
  border-radius: 5px;
  padding: 3px 6px;
  background: #fff;
  color: #2d4439;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
  z-index: 3;
}

.non-production-stage-progress i:hover span {
  display: block;
}

.stage-full { background: #16885a; }
.stage-deposit { background: #0ea5a0; }
.stage-advance { background: #3b82f6; }
.stage-before { background: #f59e0b; }
.stage-progress { background: #8b5cf6; }
.stage-tail { background: #d84a4a; }
.stage-other { background: #7a8b83; }

.non-production-empty-card,
.non-production-action-empty,
.non-production-current-empty {
  display: grid;
  gap: 5px;
  border: 1px dashed #cbded5;
  border-radius: 8px;
  padding: 16px;
  background: #f8fbfa;
  color: #52685d;
  font-size: 13px;
  font-weight: 850;
}

.non-production-detail {
  border-top: 4px solid #9aa8a0;
}

.non-production-detail.non-production-payable {
  border-top-color: #d84a4a;
}

.non-production-detail.non-production-invoice {
  border-top-color: #d97706;
}

.non-production-detail.non-production-done {
  border-top-color: #16885a;
}

.non-production-detail.non-production-closed {
  border-top-color: #8fa099;
}

.non-production-detail-head {
  align-items: flex-start;
}

.non-production-detail-head strong {
  display: block;
  margin-top: 4px;
  color: #172f24;
  font-size: 20px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.non-production-detail-head em {
  display: block;
  margin-top: 4px;
  color: #65786e;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.non-production-current {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid #e2eee8;
  background: #e2eee8;
}

.non-production-current > div {
  min-width: 0;
  padding: 10px;
  background: #fff;
}

.non-production-current strong {
  display: block;
  margin-top: 4px;
  color: #173327;
  font-size: 14px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.non-production-current em {
  display: block;
  margin-top: 3px;
  color: #6c7d75;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.non-production-current-empty {
  margin: 12px;
}

.non-production-attachment-panel {
  margin: 12px;
  border: 1px solid #dce8e0;
  border-radius: 8px;
  background: #fbfdfc;
  overflow: hidden;
}

.non-production-attachments {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.non-production-attachments a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #edf3ef;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: #173327;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.non-production-attachments a span,
.non-production-attachment-empty {
  color: #6a7d73;
  font-size: 12px;
  font-weight: 800;
}

.non-production-attachment-empty {
  padding: 12px;
}

.non-production-action-panel {
  margin: 12px;
  border: 1px solid #dce8e0;
  border-radius: 8px;
  background: #fbfdfc;
  overflow: hidden;
}

.non-production-action-panel.is-empty {
  display: none;
}

.non-production-action-head {
  padding: 9px 10px;
}

.non-production-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.non-production-form .wide,
.non-production-selected-strip {
  grid-column: 1 / -1;
}

.non-production-selected-strip {
  display: grid;
  grid-template-columns: 72px minmax(160px, 1fr) minmax(120px, 0.9fr);
  gap: 8px;
  align-items: center;
  border: 1px solid #d6e5dd;
  border-radius: 7px;
  padding: 9px 10px;
  background: #edf8f2;
}

.non-production-selected-strip span {
  color: #60746b;
  font-size: 12px;
  font-weight: 850;
}

.non-production-selected-strip strong {
  color: #173327;
  font-size: 14px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.non-production-selected-strip em {
  color: #61756b;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.non-production-flow-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 12px 12px;
}

.non-production-flow-board section {
  min-width: 0;
  border: 1px solid #e1eee7;
  border-radius: 8px;
  background: #fbfdfc;
  overflow: hidden;
}

.non-production-flow-board h4 {
  margin: 0;
  padding: 9px 10px;
  border-bottom: 1px solid #e1eee7;
  background: #f2f8f5;
  color: #243a30;
  font-size: 13px;
  font-weight: 950;
}

.non-production-flow-board ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px;
  list-style: none;
}

.non-production-flow-board li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, auto);
  gap: 10px;
  align-items: start;
  border: 1px solid #edf3ef;
  border-radius: 6px;
  padding: 8px;
  background: #fff;
  color: #40524a;
  font-size: 12px;
}

.non-production-flow-main {
  display: grid;
  grid-template-columns: 82px minmax(94px, auto) minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  min-width: 0;
}

.non-production-flow-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 86px;
}

.non-production-flow-actions .btn,
.non-production-flow-actions .edit-count,
.non-production-flow-actions .status {
  white-space: nowrap;
}

.non-production-flow-board li.empty {
  display: block;
  color: #7a8b83;
}

.non-production-flow-board li strong {
  color: #183527;
  font-weight: 950;
}

.non-production-flow-board li span,
.non-production-flow-board li strong,
.non-production-flow-board li em {
  min-width: 0;
}

.non-production-flow-board li em,
.non-production-flow-board li small {
  color: #6b7d74;
  font-style: normal;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.non-production-flow-board li small {
  grid-column: 1 / -1;
  display: block;
  min-height: 24px;
  padding: 5px 7px;
  border: 1px solid #e6f0eb;
  border-radius: 6px;
  background: #f7fbf8;
  color: #4f635a;
  line-height: 1.45;
  white-space: normal;
}

.non-production-flow-board li small:empty {
  display: none;
}

.non-production-contract-modal {
  width: min(900px, calc(100vw - 36px));
}

@media (max-width: 1180px) {
  .non-production-summary-grid,
  .non-production-workbench,
  .non-production-current,
  .non-production-flow-board {
    grid-template-columns: 1fr;
  }

  .non-production-hero,
  .non-production-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .non-production-hero-actions,
  .non-production-filter-tabs {
    justify-content: flex-start;
  }

  .non-production-form,
  .non-production-selected-strip,
  .non-production-flow-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .supplier-ledger-kpis,
  .supplier-ledger-workflow {
    grid-template-columns: 1fr;
  }

  .supplier-ledger-toolbar {
    grid-template-columns: 1fr;
  }

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

  .supplier-ledger-actions,
  .supplier-ledger-current-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.audit-strip,
.audit-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 250, 248, 0.96)),
    var(--panel);
}

.audit-strip {
  border: 1px solid #cbded4;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

.audit-strip-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #22342b;
  font-size: 16px;
  font-weight: 900;
}

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

.audit-card {
  border: 1px solid #d8e4de;
  border-left: 5px solid #7ca18f;
  border-radius: 8px;
  background: #fbfdfc;
  padding: 13px 14px;
  min-width: 0;
}

.audit-card.warn {
  border-left-color: #d18a22;
  background: #fffaf1;
}

.audit-card.danger {
  border-left-color: #c94343;
  background: #fff4f4;
}

.audit-card.ok {
  border-left-color: var(--accent);
  background: #f3fbf6;
}

.audit-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #405149;
  font-size: 12px;
  font-weight: 900;
}

.audit-card strong {
  display: block;
  margin-top: 9px;
  color: #17241e;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

.audit-card p {
  margin: 8px 0 0;
  color: #506159;
  font-size: 12px;
  line-height: 1.45;
}

.audit-card small {
  display: block;
  margin-top: 9px;
  color: #6a4f20;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 800;
}

.audit-flow-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.audit-flow-map div {
  border: 1px solid #d8e6dd;
  border-radius: 8px;
  background: #f7fbf8;
  padding: 12px;
}

.audit-flow-map b {
  display: block;
  color: #1f4634;
  font-size: 14px;
  font-weight: 900;
}

.audit-flow-map span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.audit-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

.audit-section h4 {
  margin: 0 0 12px;
  color: #1c2f25;
  font-size: 15px;
  font-weight: 900;
}

.audit-detail-block {
  margin-top: 12px;
}

.audit-detail-title {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.audit-detail-table table {
  min-width: 760px;
}

.audit-detail-table th,
.audit-detail-table td {
  padding: 9px 10px;
  vertical-align: top;
}

.completion-section-title {
  margin: 16px 0 8px;
  font-size: 15px;
  font-weight: 900;
}

.allocation-target-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 13px 15px;
  border: 1px solid #a7d9c1;
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: linear-gradient(180deg, #f0fbf5, #e4f5ec);
}

.allocation-target-box span,
.allocation-target-box small {
  color: #48665c;
  font-weight: 800;
}

.allocation-target-box b {
  font-size: 18px;
  color: var(--ink);
}

.allocation-target-box strong {
  padding: 5px 9px;
  border-radius: 6px;
  background: #fff;
  color: var(--brand-strong);
}

.allocation-target-box small {
  grid-column: 1 / -1;
  line-height: 1.5;
}

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

.completion-stock-summary span {
  display: block;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f6faf8;
  color: var(--muted);
  font-weight: 800;
}

.completion-stock-summary b {
  color: var(--text);
  font-size: 18px;
}

.completion-detail-table table {
  min-width: 900px;
}

.inventory-grouped-chart {
  display: grid;
  gap: 16px;
}

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

.inventory-ready-shell {
  margin-top: 16px;
}

.inventory-ready-collapsible.collapsed {
  border-color: #dce8e1;
  background: #fbfdfc;
  box-shadow: none;
}

.inventory-ready-toggle-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.inventory-ready-toggle-head h3 {
  margin: 0;
}

.inventory-ready-toggle-head .btn {
  min-width: 58px;
}

.inventory-detail-panel.collapsed {
  border-color: #dce8e1;
  background: #fbfdfc;
  box-shadow: none;
}

.inventory-detail-panel.collapsed .panel-header {
  border-bottom: 0;
}

.inventory-detail-toggle-head > div {
  min-width: 0;
}

.inventory-detail-toggle-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inventory-detail-filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #dce8e1;
  border-radius: 8px;
  background: #f7fbf9;
}

.inventory-log-panel.collapsed {
  border-color: #dce8e1;
  background: #fbfdfc;
  box-shadow: none;
}

.inventory-log-panel.collapsed .panel-header {
  border-bottom: 0;
}

.inventory-log-toggle-head > div {
  min-width: 0;
}

.inventory-log-toggle-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inventory-log-filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #dce8e1;
  border-radius: 8px;
  background: #f7fbf9;
}

.inventory-log-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.inventory-log-stat-card {
  padding: 12px;
  border: 1px solid #dce8e1;
  border-radius: 8px;
  background: #fbfdfc;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, auto));
  gap: 8px 14px;
  align-items: end;
}

.inventory-log-stat-card strong {
  grid-column: 1 / -1;
  font-size: 14px;
  color: var(--text);
}

.inventory-log-stat-card span,
.inventory-log-stat-card b,
.inventory-log-stat-card em {
  font-size: 12px;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.inventory-log-stat-card b,
.inventory-log-stat-card em {
  color: var(--text);
}

.inventory-log-split {
  display: grid;
  gap: 14px;
}

.inventory-log-type-block {
  border: 1px solid #dce8e1;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.inventory-log-type-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f3faf6;
  border-bottom: 1px solid #dce8e1;
}

.inventory-log-type-title h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
}

.inventory-log-type-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.inventory-log-table {
  border-radius: 0;
}

.inventory-log-day-0 td {
  background: #ffffff;
}

.inventory-log-day-1 td {
  background: #fff8ea;
}

.inventory-log-day-2 td {
  background: #eef7ff;
}

.inventory-log-day-3 td {
  background: #f5f0ff;
}

.inventory-ready-view {
  display: grid;
  gap: 12px;
}

.inventory-ready-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 1.4fr);
  gap: 12px;
  align-items: stretch;
}

.inventory-ready-controls label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  font-weight: 850;
  color: var(--muted);
}

.inventory-ready-controls select {
  min-height: 38px;
}

.inventory-ready-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.inventory-ready-summary div {
  border: 1px solid rgba(25, 116, 71, 0.14);
  border-radius: 7px;
  background: #f5faf7;
  padding: 8px 10px;
}

.inventory-ready-summary small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.inventory-ready-summary b {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.inventory-ready-note {
  border: 1px solid rgba(25, 116, 71, 0.12);
  border-radius: 7px;
  background: #eef6f2;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.inventory-ready-table table th,
.inventory-ready-table table td {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .inventory-ready-controls,
  .inventory-ready-summary {
    grid-template-columns: 1fr;
  }
}

.inventory-price-layout .inventory-model-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.inventory-price-layout .inventory-model-card {
  min-height: 150px;
  padding: 12px 11px 12px 14px;
}

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

.inventory-summary-strip > div,
.inventory-variety-total span {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbf8;
  padding: 10px 12px;
}

.inventory-summary-strip strong,
.inventory-variety-total strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  color: var(--ink);
}

.inventory-summary-strip span,
.inventory-variety-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inventory-summary-amount-card small {
  display: block;
  margin-top: 6px;
  color: #66766e;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.5;
}

.inventory-summary-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.inventory-summary-breakdown span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 7px;
  border: 1px solid #d8e4de;
  background: #f7fbf9;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.inventory-summary-breakdown em {
  font-style: normal;
  font-size: 11px;
  line-height: 1;
  color: #40544b;
  font-weight: 950;
  white-space: nowrap;
}

.inventory-summary-breakdown b {
  display: block;
  min-width: 0;
  color: #172b22;
  font-size: 15px;
  line-height: 1.15;
  white-space: nowrap;
}

.inventory-summary-breakdown .confirmed {
  border-color: #8fceb1;
  background: #eaf7ef;
}

.inventory-summary-breakdown .confirmed b {
  color: #11623c;
}

.inventory-summary-breakdown .estimated {
  border-color: #f0c977;
  background: #fff6da;
}

.inventory-summary-breakdown .estimated b {
  color: #8a5b00;
}

.inventory-summary-breakdown .unvalued {
  border-color: #e5a0a7;
  background: #fff0f2;
}

.inventory-summary-breakdown .unvalued b {
  color: #9d2734;
}

.inventory-summary-amount-card b,
.inventory-summary-amount-card i,
.inventory-price-row-breakdown i,
.inventory-valuation-breakdown b {
  font-style: normal;
  font-weight: 950;
}

.inventory-valuation-breakdown {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.inventory-valuation-breakdown.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.inventory-valuation-breakdown span {
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 850;
}

.inventory-valuation-breakdown.compact span {
  background: rgba(255, 255, 255, 0.72);
  color: #3d5048;
}

.inventory-valuation-breakdown.dark span {
  color: rgba(255, 255, 255, 0.86);
}

.inventory-variety-card {
  --inventory-accent: #28745a;
  --inventory-line: #9dc9b7;
  --inventory-bg: #f5fbf8;
  --inventory-soft: #e6f2ed;
  --inventory-card: #fbfdfc;
  --inventory-title: #184936;
  border: 2px solid var(--inventory-line);
  border-left: 7px solid var(--inventory-accent);
  border-radius: 8px;
  background: var(--inventory-bg);
  padding: 16px;
  box-shadow: 0 12px 28px rgba(24, 49, 37, 0.08);
}

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

.inventory-variety-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.inventory-variety-marker {
  width: 12px;
  height: 30px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: var(--inventory-accent);
  box-shadow: 0 0 0 4px var(--inventory-soft);
}

.inventory-variety-title h4 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  color: var(--inventory-title);
}

.inventory-variety-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inventory-variety-total {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.inventory-variety-total span {
  min-width: 92px;
  text-align: right;
  border-color: var(--inventory-line);
  background: rgba(255, 255, 255, 0.76);
}

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

.inventory-model-card {
  position: relative;
  overflow: hidden;
  align-self: stretch;
  border: 1.5px solid var(--inventory-line);
  border-radius: 8px;
  background: var(--inventory-card);
  padding: 13px 13px 13px 16px;
  min-height: 168px;
  box-shadow: 0 8px 18px rgba(24, 49, 37, 0.07);
}

.inventory-model-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--inventory-accent);
}

.inventory-variety-price-card {
  position: relative;
  overflow: hidden;
  grid-column: 1 / -1;
  align-self: start;
  border: 1.5px solid var(--inventory-line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0)),
    color-mix(in srgb, var(--inventory-accent) 88%, #152e24 12%);
  color: #fff;
  padding: 13px;
  min-height: auto;
  box-shadow: 0 10px 22px rgba(24, 49, 37, 0.12);
}

.inventory-variety-price-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: rgba(255, 255, 255, 0.72);
}

.inventory-variety-price-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.inventory-variety-price-head h5 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  line-height: 1.15;
}

.inventory-variety-price-head p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.inventory-variety-price-head > span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  padding: 4px 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.inventory-variety-money {
  margin: 10px 0 8px;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.inventory-variety-money-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.inventory-variety-money-meta span {
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.13);
  padding: 6px;
  color: rgba(255, 255, 255, 0.86);
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.inventory-variety-price-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.inventory-variety-price-card .inventory-price-row {
  grid-template-columns: minmax(0, 1fr) 76px;
  border-top-color: rgba(255, 255, 255, 0.14);
}

.inventory-variety-price-card .inventory-price-row-main strong,
.inventory-variety-price-card .inventory-price-row-main span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.inventory-variety-price-card .inventory-price-row input {
  width: 76px;
}

.inventory-variety-price-card .inventory-price-row .btn {
  padding: 0 6px;
  font-size: 11px;
}

.inventory-model-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.inventory-model-name {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--inventory-title);
}

.inventory-model-total {
  text-align: right;
  min-width: 86px;
}

.inventory-model-total strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
  color: var(--inventory-accent);
  font-weight: 900;
}

.inventory-model-total span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.inventory-model-bar {
  height: 8px;
  background: var(--inventory-soft);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 10px;
}

.inventory-model-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.inventory-model-card .inventory-model-price-row {
  grid-template-columns: minmax(0, 1fr) 86px auto auto;
  align-items: end;
  border: 1px solid color-mix(in srgb, var(--inventory-line) 82%, #ffffff 18%);
  border-radius: 7px;
  background: color-mix(in srgb, var(--inventory-soft) 54%, #ffffff 46%);
  padding: 7px;
  margin: 0 0 9px;
}

.inventory-model-card .inventory-model-price-row.saved {
  border-color: #188556;
  background: color-mix(in srgb, #dff5ea 72%, #ffffff 28%);
}

.inventory-model-card .inventory-model-price-row.warn {
  border-color: #d24d57;
  background: #fff3f4;
}

.inventory-model-card .inventory-model-price-row.saving {
  opacity: 0.82;
}

.inventory-model-card .inventory-model-price-row .inventory-price-row-main strong {
  color: var(--inventory-title);
}

.inventory-model-card .inventory-model-price-row .inventory-price-row-main span,
.inventory-model-card .inventory-model-price-row small {
  color: #61756c;
}

.inventory-model-card .inventory-model-price-row input {
  border: 1px solid var(--inventory-line);
  background: #fff;
}

.inventory-model-card .inventory-model-price-row .btn {
  min-width: 64px;
}

.inventory-model-card .inventory-model-price-row .btn.success {
  background: #188556;
  border-color: #188556;
  color: #fff;
}

.inventory-model-card .inventory-model-price-row .btn.danger {
  background: #c93a45;
  border-color: #c93a45;
  color: #fff;
}

.inventory-price-save-status {
  align-self: center;
  color: #188556;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.inventory-model-price-row.warn .inventory-price-save-status {
  color: #c93a45;
}

.inventory-model-detail-price-form {
  display: grid;
  gap: 8px;
}

.inventory-model-details {
  display: grid;
  gap: 6px;
}

.inventory-detail-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  align-items: center;
  border: 1px solid var(--inventory-line);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 5px;
  padding: 6px 7px;
}

.inventory-detail-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.inventory-detail-line span,
.inventory-detail-line b {
  font-size: 12px;
  line-height: 1.32;
}

.inventory-detail-line span {
  color: #263d33;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.inventory-detail-line small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.inventory-detail-line b {
  color: #10271e;
  font-weight: 900;
  white-space: nowrap;
  text-align: right;
}

.inventory-detail-price-fold {
  margin-top: 5px;
  border-top: 1px dashed color-mix(in srgb, var(--inventory-line) 75%, transparent);
  padding-top: 5px;
}

.inventory-detail-price-fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  color: var(--inventory-title);
  font-size: 12px;
  font-weight: 900;
}

.inventory-detail-price-fold summary em {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.inventory-detail-price-fold summary b {
  color: var(--inventory-accent);
  text-align: left;
  white-space: nowrap;
}

.inventory-detail-price-fold[open] summary {
  margin-bottom: 6px;
}

.inventory-detail-price-fold .inventory-detail-price-list {
  gap: 6px;
}

.inventory-detail-segment-row {
  grid-template-columns: minmax(0, 1fr) 104px 74px auto;
  gap: 7px;
  padding: 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
}

.inventory-detail-segment-row.contract {
  border-left: 4px solid #2d8c61;
}

.inventory-detail-segment-row.warn {
  border-left: 4px solid #d48927;
}

.inventory-detail-segment-row.manual {
  border-left: 4px solid #7a93a8;
}

.inventory-detail-segment-row.valuation-confirmed {
  background: #f4fbf7;
}

.inventory-detail-segment-row.valuation-estimated,
.inventory-detail-segment-row.live-estimated {
  background: #fff8e8;
}

.inventory-detail-segment-row.valuation-unvalued,
.inventory-detail-segment-row.live-unvalued {
  background: #fff2f4;
}

.inventory-detail-segment-row.focus-price-input {
  box-shadow: 0 0 0 2px rgba(40, 132, 96, 0.22);
}

.inventory-detail-segment-row.missing-price {
  border-color: #d24d57;
  background: #fff2f4;
  box-shadow: inset 0 0 0 1px rgba(210, 77, 87, 0.28);
}

.inventory-detail-price-input-wrap {
  display: grid;
  gap: 4px;
}

.inventory-detail-segment-row input {
  width: 104px;
  height: 32px;
}

.inventory-valuation-status {
  width: 104px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
}

.inventory-valuation-status.confirmed {
  background: #dff5ea;
  color: #116e49;
}

.inventory-valuation-status.estimated {
  background: #ffe8b6;
  color: #935b00;
}

.inventory-valuation-status.unvalued {
  background: #ffdce2;
  color: #b42331;
}

.inventory-detail-segment-row b {
  color: #8b5c1a;
  white-space: nowrap;
}

.inventory-apply-one-price {
  min-width: 62px;
  min-height: 30px;
  padding: 0 7px;
  font-size: 11px;
}

.inventory-model-price-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--inventory-line) 76%, #ffffff 24%);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  padding: 7px;
}

.inventory-model-price-actions span {
  min-width: 0;
  color: #42584e;
  font-size: 12px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.inventory-model-price-actions b {
  color: var(--inventory-accent);
}

.inventory-price-panel {
  position: static;
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    #123d2d;
  color: #fff;
  padding: 16px;
  box-shadow: 0 18px 42px rgba(18, 61, 45, 0.18);
}

.inventory-price-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.inventory-price-head h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
}

.inventory-price-head p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.inventory-price-head > span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  padding: 5px 9px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.inventory-money-total {
  margin: 14px 0 10px;
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.inventory-money-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.inventory-money-meta span {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 6px;
  color: rgba(255, 255, 255, 0.84);
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.inventory-price-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: none;
  overflow: auto;
  padding-right: 0;
}

.inventory-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
  align-items: end;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  padding-top: 10px;
}

.inventory-price-row-main {
  min-width: 0;
}

.inventory-price-row-main strong,
.inventory-price-row-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-price-row-main strong {
  color: #fff;
  font-size: 13px;
}

.inventory-price-row-main span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 800;
}

.inventory-price-row-breakdown {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  white-space: normal;
  overflow-wrap: anywhere;
}

.inventory-model-card .inventory-price-row-breakdown {
  color: #52685f;
}

.inventory-price-row label {
  display: grid;
  gap: 4px;
}

.inventory-price-row small {
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  font-weight: 800;
}

.inventory-price-row input {
  width: 86px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
  color: var(--text);
  text-align: right;
  font-weight: 900;
}

.inventory-price-row .btn {
  min-height: 32px;
  padding: 0 8px;
  font-size: 12px;
  white-space: nowrap;
}

.inventory-price-modal-summary {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 12px;
  margin-bottom: 12px;
}

.inventory-price-modal-summary strong {
  font-size: 18px;
}

.inventory-price-modal-summary span {
  color: var(--muted);
  font-weight: 800;
}

.inventory-detail-price-list {
  display: grid;
  gap: 8px;
}

.inventory-detail-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 94px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.inventory-detail-price-row span {
  min-width: 0;
}

.inventory-detail-price-row strong,
.inventory-detail-price-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-detail-price-row strong {
  font-size: 14px;
}

.inventory-detail-price-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inventory-detail-price-row input {
  width: 120px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0 9px;
  text-align: right;
  font-weight: 900;
}

.inventory-detail-price-row b {
  color: #9a5c13;
  text-align: right;
}

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

table:has(.arrival-confirm-form) {
  min-width: 1320px;
}

.out-records-table table {
  min-width: 1580px;
}

.out-records-table th,
.out-records-table td {
  padding: 9px 8px;
  font-size: 12px;
  line-height: 1.35;
}

.out-records-table th:nth-child(9),
.out-records-table td:nth-child(9),
.out-records-table th:nth-child(12),
.out-records-table td:nth-child(12),
.out-records-table th:nth-child(19),
.out-records-table td:nth-child(19),
.out-records-table th:nth-child(20),
.out-records-table td:nth-child(20),
.out-records-table th:nth-child(21),
.out-records-table td:nth-child(21) {
  min-width: 92px;
  white-space: normal;
}

.out-records-table th:nth-child(9),
.out-records-table td:nth-child(9) {
  min-width: 170px;
}

.out-records-table th:nth-child(12),
.out-records-table td:nth-child(12) {
  min-width: 185px;
}

.out-records-table .btn.table-btn {
  padding: 6px 8px;
  font-size: 11.5px;
}

.out-records-table .document-actions {
  margin-bottom: 4px;
}

.out-records-table .record-actions {
  gap: 4px;
}

.pay-proof-table table {
  min-width: 980px;
}

.external-buy-records-table table {
  min-width: 1680px;
}

.pay-proof-table th,
.pay-proof-table td,
.external-buy-records-table th,
.external-buy-records-table td {
  padding: 9px 8px;
  font-size: 12px;
  line-height: 1.35;
}

.pay-proof-table th:nth-last-child(-n + 4),
.pay-proof-table td:nth-last-child(-n + 4),
.external-buy-records-table th:nth-last-child(-n + 5),
.external-buy-records-table td:nth-last-child(-n + 5) {
  min-width: 90px;
  white-space: normal;
}

.pay-proof-table .settlement-actions,
.external-buy-records-table .settlement-actions {
  min-width: 78px;
}

.raw-in-analytics-panel .panel-header {
  align-items: flex-start;
}

.raw-in-analytics-panel .panel-header .muted {
  font-size: 12px;
  font-weight: 800;
}

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

.raw-in-origin-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #d8e7de;
  border-radius: 8px;
  background: #f3faf6;
}

.raw-in-origin-row strong,
.raw-in-origin-row span,
.raw-in-origin-row em,
.raw-in-origin-row label > span {
  display: block;
}

.raw-in-origin-row strong {
  font-size: 15px;
}

.raw-in-origin-row span {
  margin-top: 3px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.raw-in-origin-row em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.raw-in-origin-row label {
  min-width: 190px;
  margin: 0;
}

.raw-in-origin-row label > span {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
}

.raw-in-summary-card {
  padding: 12px 14px;
  border: 1px solid #d8e7de;
  border-radius: 8px;
  background: #f7fbf8;
}

.raw-in-summary-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.raw-in-summary-card strong {
  display: block;
  margin: 5px 0 4px;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.raw-in-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.raw-in-summary-card em {
  display: block;
  margin-top: 7px;
  color: #8a5a18;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

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

.raw-in-trend-card {
  padding: 12px 14px;
  border: 1px solid #dfe8e3;
  border-radius: 8px;
  background: #ffffff;
}

.raw-in-trend-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.raw-in-trend-head strong,
.raw-in-trend-head span,
.raw-in-trend-head small {
  display: block;
}

.raw-in-trend-head strong {
  font-size: 14px;
}

.raw-in-trend-head span,
.raw-in-trend-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.raw-in-trend-range-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid #dfe8e3;
  border-radius: 8px;
  background: #f7fbf8;
}

.raw-in-trend-range-controls label {
  margin: 0;
}

.raw-in-trend-range-controls span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.raw-in-trend-metrics {
  display: grid;
  gap: 12px;
}

.raw-in-trend-metric {
  padding: 10px 10px 8px;
  border: 1px solid #e3ece6;
  border-radius: 8px;
  background: #fbfdfc;
}

.raw-in-trend-metric-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 6px;
}

.raw-in-trend-metric-head strong,
.raw-in-trend-metric-head span {
  display: block;
}

.raw-in-trend-metric-head strong {
  font-size: 13px;
}

.raw-in-trend-metric-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.raw-in-trend-svg {
  width: 100%;
  height: 170px;
  display: block;
  overflow: visible;
}

.raw-in-trend-svg .raw-in-axis {
  stroke: #d7e2dc;
  stroke-width: 1;
}

.raw-in-trend-reference {
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.raw-in-trend-reference.max {
  stroke: rgba(170, 65, 82, 0.42);
}

.raw-in-trend-reference.avg {
  stroke: rgba(138, 90, 24, 0.48);
}

.raw-in-trend-reference.min {
  stroke: rgba(58, 112, 88, 0.38);
}

.raw-in-trend-reference-label {
  font-size: 10px;
  font-weight: 900;
}

.raw-in-trend-reference-label.max {
  fill: #aa4152;
}

.raw-in-trend-reference-label.avg {
  fill: #8a5a18;
}

.raw-in-trend-reference-label.min {
  fill: #3a7058;
}

.raw-in-trend-svg path {
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.raw-in-trend-ton {
  stroke: #16835d;
}

.raw-in-trend-price {
  stroke: #bf4e63;
}

.raw-in-trend-ton-dot {
  fill: #16835d;
  opacity: 0.42;
}

.raw-in-trend-price-dot {
  fill: #bf4e63;
  opacity: 0.45;
}

.raw-in-trend-svg .raw-in-trend-date {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.raw-in-trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.raw-in-trend-legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  margin-right: 5px;
  border-radius: 999px;
  vertical-align: middle;
}

.raw-in-trend-legend .ton {
  background: #16835d;
}

.raw-in-trend-legend .price {
  background: #bf4e63;
}

.raw-in-trend-legend .reference {
  background: repeating-linear-gradient(90deg, #8a5a18 0 5px, transparent 5px 9px);
}

.raw-in-trend-legend em {
  color: #8a5a18;
  font-style: normal;
}

.raw-in-filter-panel {
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #dfe8e3;
  border-radius: 8px;
  background: #fbfdfc;
}

.raw-in-filter-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.raw-in-filter-head h4 {
  margin: 0;
  font-size: 14px;
}

.raw-in-records-panel .table-wrap {
  margin-top: 10px;
}

.raw-in-filter-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.raw-in-filter-summary div {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfc;
}

.raw-in-filter-summary strong {
  display: block;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.raw-in-filter-summary span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .raw-in-trend-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .raw-in-summary-grid,
  .raw-in-filter-summary {
    grid-template-columns: 1fr;
  }

  .raw-in-filter-head,
  .raw-in-trend-head,
  .raw-in-origin-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .raw-in-trend-range-controls {
    grid-template-columns: 1fr;
  }

  .raw-in-origin-row label {
    min-width: 0;
    width: 100%;
  }
}

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

.external-direct-card {
  border: 1px solid #d5e4dc;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbf9);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.external-direct-card.deleted-record-row {
  border-color: #efb7b7;
}

.external-direct-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid #e1ebe5;
  background: #f1f8f4;
}

.external-direct-card-head strong {
  display: block;
  font-size: 16px;
  font-weight: 900;
}

.external-direct-card-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.external-direct-statuses,
.external-direct-actions,
.external-direct-settlement {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.external-direct-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  padding: 15px 16px 16px;
}

.external-direct-card-grid section {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e1ebe5;
  border-radius: 8px;
  background: #fff;
}

.external-direct-card-grid h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 900;
  color: #254638;
}

.external-direct-info {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 6px 0;
  border-top: 1px dashed #e5eee9;
}

.external-direct-info:first-of-type {
  border-top: 0;
}

.external-direct-info span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.external-direct-info b {
  min-width: 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 850;
  line-height: 1.45;
  word-break: break-word;
}

.external-direct-muted {
  padding: 9px 10px;
  border-radius: 7px;
  background: #f4f7f5;
  color: var(--muted);
  font-weight: 800;
}

.external-profit-box {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #d7e6dd;
  border-radius: 8px;
  background: #f8fbf9;
}

.external-profit-box.ok {
  border-color: rgba(25, 116, 71, 0.28);
  background: #f0f8f3;
}

.external-profit-box.danger {
  border-color: rgba(184, 50, 50, 0.28);
  background: #fff5f4;
}

.external-profit-box > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 900;
  color: #254638;
}

.external-profit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  color: #33463e;
}

.external-profit-grid b {
  grid-column: 1 / -1;
  color: #153a2b;
  font-size: 13px;
}

.external-direct-settlement {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed #e5eee9;
}

.external-direct-card .settlement-actions {
  min-width: 0;
}

.external-direct-card .record-actions,
.external-direct-card .document-actions {
  gap: 6px;
}

@media (max-width: 1200px) {
  .external-direct-card-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .external-direct-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .external-direct-card-grid {
    grid-template-columns: 1fr;
  }
}

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

.loan-toolbar-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.loan-add-button {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(20, 120, 74, 0.18);
}

.loan-add-panel {
  margin-top: 16px;
  border: 1px solid #c8ded4;
  border-left: 6px solid #287451;
  border-radius: 8px;
  background: #f7fbf9;
  box-shadow: var(--shadow-soft);
}

.loan-add-panel .panel {
  margin: 0;
  border: 0;
  box-shadow: none;
}

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

.loan-source-card {
  min-width: 0;
  border: 1px solid #d3e2db;
  border-top: 6px solid #287451;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f6faf8);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.loan-source-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #eef7f2;
  border-bottom: 1px solid #dfeae4;
}

.loan-source-head strong {
  display: block;
  color: #163327;
  font-size: 17px;
  font-weight: 900;
}

.loan-source-head span,
.loan-line-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.loan-source-next {
  flex: 0 0 auto;
  max-width: 180px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #fff;
  color: #244636;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
  border: 1px solid #d8e6de;
}

.loan-source-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 13px 16px 4px;
}

.loan-source-metrics section {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e1ebe5;
}

.loan-source-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.loan-source-metrics b {
  display: block;
  margin-top: 5px;
  color: #12291f;
  font-size: 16px;
  font-weight: 900;
  word-break: break-word;
}

.loan-line-list {
  display: grid;
  gap: 10px;
  padding: 12px 16px 16px;
}

.loan-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid #e2ece6;
  border-radius: 8px;
  background: #ffffff;
}

.loan-line-title {
  color: #162c23;
  font-weight: 900;
  line-height: 1.4;
}

.loan-line-title span {
  margin-left: 8px;
  color: #6a7b72;
  font-size: 12px;
  font-weight: 800;
}

.loan-line-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
}

.loan-flow-table table {
  min-width: 1100px;
}

.loan-flow-table th,
.loan-flow-table td {
  padding: 10px 9px;
  font-size: 12.5px;
}

@media (max-width: 1180px) {
  .loan-source-grid {
    grid-template-columns: 1fr;
  }

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

  .loan-toolbar-actions,
  .loan-add-button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .loan-source-head,
  .loan-line {
    grid-template-columns: 1fr;
  }

  .loan-source-head {
    display: grid;
  }

  .loan-source-next {
    max-width: none;
    text-align: left;
  }

  .loan-source-metrics {
    grid-template-columns: 1fr;
  }

  .loan-line-actions {
    justify-content: flex-start;
  }
}

.production-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.production-entry-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 8px;
}

.production-entry-summary div {
  display: grid;
  gap: 4px;
}

.production-entry-summary span,
.production-entry-summary small,
.production-batch-cell small,
.production-deduct-cell small {
  color: var(--muted);
  font-size: 12px;
}

.production-entry-summary strong {
  font-size: 14px;
}

.peanut-counter {
  display: grid;
  gap: 14px;
}

.peanut-counter-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.peanut-upload-card {
  position: relative;
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 154px;
  padding: 18px;
  border: 1px dashed #8bb59f;
  border-radius: 8px;
  background: #f4fbf6;
  color: #16432d;
  cursor: pointer;
}

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

.peanut-upload-card span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 8px;
  background: #dff3e7;
  color: #166534;
  font-size: 12px;
  font-weight: 900;
}

.peanut-upload-card strong {
  font-size: 18px;
  font-weight: 900;
}

.peanut-upload-card small,
.peanut-counter-note,
.peanut-counter-score small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.peanut-counter-controls {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid #e2ece6;
  border-radius: 8px;
  background: #ffffff;
}

.peanut-counter-controls input[type="range"] {
  width: 100%;
  accent-color: #197447;
}

.peanut-counter-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.peanut-counter-result {
  min-height: 70px;
}

.peanut-counter-loading {
  padding: 16px;
  border: 1px solid #f4d79d;
  border-radius: 8px;
  background: #fff7e6;
  color: #875c00;
  font-weight: 800;
}

.peanut-counter-output {
  display: grid;
  grid-template-columns: 170px minmax(150px, 190px) minmax(180px, 1fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
}

.peanut-counter-score,
.peanut-counter-final {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #cdebd9;
  border-radius: 8px;
  background: #f2fbf6;
}

.peanut-counter-score span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.peanut-counter-score strong {
  color: #166534;
  font-size: 34px;
  line-height: 1;
}

.peanut-manual-field {
  margin: 0;
}

.peanut-counter-final {
  align-content: center;
  color: #163126;
  font-weight: 900;
}

.peanut-counter-final strong {
  color: #b45309;
  font-size: 24px;
}

.peanut-counter-preview {
  display: block;
  width: 100%;
  max-height: 720px;
  object-fit: contain;
  border: 1px solid #d7e5dd;
  border-radius: 8px;
  background: #111827;
  user-select: none;
  touch-action: manipulation;
}

.peanut-counter-note {
  margin-top: 8px;
}

.peanut-sample-status {
  min-height: 18px;
  margin-top: 6px;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
}

.peanut-manual-stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #b7d5c5;
  border-radius: 8px;
  background: #123a61;
  overflow: hidden;
  cursor: crosshair;
}

.peanut-image-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 720px;
  line-height: 0;
}

.peanut-manual-stage .peanut-counter-preview {
  width: auto;
  max-width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
}

.peanut-marker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.peanut-marker {
  position: absolute;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  font-size: 10px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.production-records-table table {
  min-width: 1080px;
}

.production-records-table th,
.production-records-table td {
  padding: 10px 8px;
  white-space: normal;
  font-size: 12.5px;
}

.production-batch-cell,
.production-deduct-cell {
  display: grid;
  gap: 3px;
  min-width: 150px;
}

.production-batch-cell strong,
.production-deduct-cell strong {
  color: var(--text);
}

.production-batch-cell span,
.production-deduct-cell span {
  color: #166534;
  font-weight: 700;
}

.production-records-table th:nth-child(1),
.production-records-table th:nth-child(2),
.production-records-table th:nth-child(5),
.production-records-table th:nth-child(8),
.production-records-table th:nth-child(9),
.production-records-table td:nth-child(1),
.production-records-table td:nth-child(2),
.production-records-table td:nth-child(5),
.production-records-table td:nth-child(8),
.production-records-table td:nth-child(9) {
  white-space: nowrap;
}

.production-records-table th:nth-child(6),
.production-records-table td:nth-child(6) {
  min-width: 120px;
  white-space: normal;
}

@media (max-width: 980px) {
  .production-summary-grid,
  .production-entry-summary {
    grid-template-columns: 1fr;
  }

  .peanut-counter-layout,
  .peanut-counter-controls,
  .peanut-counter-output {
    grid-template-columns: 1fr;
  }

  .peanut-counter-actions {
    justify-content: flex-start;
  }
}

th,
td {
  padding: 12px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.45;
  vertical-align: middle;
  white-space: nowrap;
}

td:has(.arrival-confirm-form) {
  min-width: 230px;
  white-space: normal;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-2);
  color: #405048;
  font-size: 12px;
  font-weight: 850;
}

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

tbody tr:hover td {
  background: #f1f8f4;
}

tbody tr.deleted-record-row td,
tbody tr.deleted-record-row:nth-child(even) td {
  background: #ffe1e1 !important;
  color: #7a2020;
  border-bottom-color: #f0b6b6;
}

tbody tr.deleted-record-row:hover td {
  background: #ffd2d2 !important;
}

tbody tr.deleted-record-row .muted {
  color: #8a3939;
}

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

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  min-height: 24px;
  background: var(--accent-2);
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
  font-weight: 850;
  white-space: nowrap;
}

.short-no {
  display: inline-block;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.status.warn {
  background: #fff4db;
  color: var(--warning);
}

.status.danger {
  background: #ffe8e8;
  color: var(--danger);
}

.status.external-direct {
  background: #e7f0ff;
  color: #2557a7;
}

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

.scale-compact {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.scale-compact strong {
  color: var(--text);
  font-size: 12px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  gap: 16px;
}

.dashboard-control {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
  align-items: stretch;
}

.dashboard-hero {
  min-height: 260px;
  padding: 24px;
  border: 1px solid rgba(25, 116, 71, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(236, 247, 241, 0.96)),
    #ffffff;
  box-shadow: var(--shadow-soft);
}

.dashboard-eyebrow {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.dashboard-hero-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-top: 10px;
}

.dashboard-hero-title h3 {
  margin: 0;
  color: #12291f;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 900;
}

.dashboard-hero-title span,
.dashboard-panel-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-hero-value {
  margin-top: 24px;
  color: #0f3123;
  font-size: 52px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.dashboard-hero p {
  max-width: 660px;
  margin: 14px 0 0;
  color: #52665c;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 700;
}

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

.dashboard-hero-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid #dce9e2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.dashboard-hero-grid span,
.dashboard-money-card span,
.dashboard-stock-name span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-hero-grid b {
  display: block;
  margin-top: 5px;
  color: #173428;
  font-size: 17px;
  font-weight: 900;
  word-break: break-word;
}

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

.dashboard-money-card {
  min-height: 124px;
  padding: 18px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.dashboard-money-card.warn {
  border-left-color: var(--warning);
}

.dashboard-money-card.danger {
  border-left-color: var(--danger);
}

.dashboard-money-card.ok {
  border-left-color: #197447;
}

.dashboard-money-card strong {
  display: block;
  margin-top: 12px;
  color: #12251d;
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  word-break: break-word;
}

.dashboard-money-card small {
  display: block;
  margin-top: 11px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 750;
}

.boss-todo-board {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #dbe8e1;
  border-radius: 8px;
  background: #f8fbf9;
}

.boss-todo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.boss-todo-head strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.boss-todo-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.boss-todo-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.boss-todo-card {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 118px;
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.boss-todo-card.warn {
  border-left-color: var(--warning);
}

.boss-todo-card.danger {
  border-left-color: var(--danger);
}

.boss-todo-card.ok {
  border-left-color: var(--accent);
}

.boss-todo-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.boss-todo-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.boss-todo-card strong {
  color: #13281f;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  word-break: break-word;
}

.boss-todo-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 750;
}

.boss-todo-card b {
  align-self: end;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(360px, 0.76fr);
  gap: 16px;
  margin-top: 16px;
}

.dashboard-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.62fr);
  gap: 16px;
  margin-top: 16px;
}

.dashboard-stock-list,
.dashboard-risk-list,
.dashboard-flow-list {
  display: grid;
  gap: 12px;
}

.dashboard-stock-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(160px, 1.4fr) minmax(130px, auto);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e0ebe5;
  border-radius: 8px;
  background: #fbfdfc;
}

.dashboard-stock-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dashboard-stock-name i {
  width: 11px;
  height: 28px;
  border-radius: 99px;
  background: var(--stock-color);
  flex: 0 0 auto;
}

.dashboard-stock-name strong {
  display: block;
  color: #183126;
  font-size: 15px;
  font-weight: 900;
}

.dashboard-stock-meter {
  height: 13px;
  overflow: hidden;
  border-radius: 99px;
  background: #edf3ef;
}

.dashboard-stock-meter b {
  display: block;
  width: var(--stock-bar);
  height: 100%;
  border-radius: inherit;
  background: var(--stock-color);
}

.dashboard-stock-value {
  text-align: right;
}

.dashboard-stock-value strong {
  display: block;
  color: #13291f;
  font-size: 15px;
  font-weight: 900;
}

.dashboard-stock-value span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-risk-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e0ebe5;
  border-left: 4px solid var(--warning);
  border-radius: 8px;
  background: #ffffff;
}

.dashboard-risk-item.danger {
  border-left-color: var(--danger);
  background: #fffafa;
}

.dashboard-risk-item span {
  display: inline-flex;
  width: fit-content;
  min-height: 23px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff4db;
  color: var(--warning);
  font-size: 12px;
  font-weight: 900;
}

.dashboard-risk-item.danger span {
  background: #ffe8e8;
  color: var(--danger);
}

.dashboard-risk-item strong {
  display: block;
  margin-top: 8px;
  color: #162d23;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.dashboard-risk-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.dashboard-risk-item b {
  color: #172d24;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.dashboard-doc-type {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef5f1;
  color: #315a47;
  font-size: 12px;
  font-weight: 900;
}

.dashboard-doc-table table {
  min-width: 780px;
}

.dashboard-flow-item {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 84px;
  padding: 13px;
  text-align: left;
  border: 1px solid #dfeae4;
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
}

.dashboard-flow-item.down {
  border-left-color: var(--warning);
}

.dashboard-flow-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.dashboard-flow-item strong {
  color: #13291f;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

.dashboard-flow-item small {
  color: #61726b;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-production-strip {
  margin-top: 16px;
}

.notice {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 9999;
  width: min(560px, calc(100vw - 36px));
  padding: 20px 24px;
  border: 1px solid rgba(115, 231, 169, 0.54);
  background: linear-gradient(180deg, #14794f, #0f5b40);
  color: #ffffff;
  border-radius: 8px;
  margin: 0;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.55;
  text-align: center;
  box-shadow: 0 20px 54px rgba(9, 38, 26, 0.36);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.notice.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.delivery-paper {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 30px;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

.delivery-print-section {
  margin-top: 16px;
}

.delivery-print-section .panel-header {
  align-items: center;
}

.delivery-print-section .panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.delivery-print-section .actions select {
  min-width: 260px;
}

.business-doc-items {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 12px;
}

.business-doc-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.business-doc-item-row {
  display: grid;
  grid-template-columns: minmax(90px, 1.1fr) minmax(120px, 1.4fr) minmax(86px, 1fr) 74px 74px 64px 82px 92px minmax(90px, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.delivery-note-item-row {
  grid-template-columns: minmax(120px, 1.3fr) 90px minmax(120px, 1fr) 86px 72px minmax(110px, 1fr) auto;
}

.business-doc-item-row input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px;
}

.business-doc-print-source {
  margin-top: 18px;
}

.business-doc-paper {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 30px;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: var(--shadow-soft);
}

.business-doc-paper h1,
.business-doc-paper h2 {
  text-align: center;
  margin: 0;
}

.business-doc-paper h1 {
  font-size: 22px;
  font-weight: 850;
}

.business-doc-paper h2 {
  margin-top: 6px;
  margin-bottom: 18px;
  font-size: 19px;
  letter-spacing: 3px;
}

.business-doc-paper table {
  min-width: 0;
}

.business-doc-paper th,
.business-doc-paper td {
  white-space: normal;
}

.business-doc-total {
  padding: 10px 12px;
  text-align: right;
  font-weight: 850;
  border-top: 1px solid #c8d0cc;
}

.business-doc-body {
  padding: 12px;
  line-height: 1.8;
  white-space: normal;
}

.delivery-paper table {
  min-width: 0;
}

.delivery-paper th,
.delivery-paper td {
  white-space: normal;
}

.delivery-paper h1 {
  text-align: center;
  margin: 0;
  font-size: 22px;
  font-weight: 850;
}

.delivery-paper h2 {
  text-align: center;
  margin: 6px 0 18px;
  font-size: 18px;
  letter-spacing: 4px;
}

.delivery-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 28px;
  margin-bottom: 16px;
  font-size: 14px;
}

.delivery-section {
  border: 1px solid #9da7a1;
  margin-top: 12px;
}

.delivery-section h3 {
  margin: 0;
  padding: 8px 10px;
  background: #f1f4f2;
  font-size: 15px;
  font-weight: 850;
}

.delivery-section .section-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid #9da7a1;
}

.delivery-section .section-grid div {
  padding: 9px 10px;
  min-height: 38px;
  border-right: 1px solid #c8d0cc;
  border-bottom: 1px solid #c8d0cc;
}

.signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 28px;
}

.document-type-checks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.document-type-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d8e1dc;
  border-radius: 6px;
  background: #fbfdfc;
  font-weight: 750;
}

.business-doc-template-render {
  overflow: auto;
  background: #f3f4f2;
}

.business-doc-template-render .sheet {
  max-width: 100%;
}

.template-editor-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr);
  gap: 16px;
  align-items: start;
}

.template-editor-controls,
.template-editor-preview {
  min-width: 0;
}

.template-editor-preview {
  position: sticky;
  top: 14px;
  border: 1px solid #d9e4dd;
  border-radius: 8px;
  background: #f6faf8;
  overflow: hidden;
}

.template-preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #d9e4dd;
  background: #eef6f1;
}

.template-preview-toolbar strong {
  color: #163327;
  font-size: 14px;
  font-weight: 900;
}

.template-preview-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.template-live-preview {
  max-height: calc(100vh - 240px);
  padding: 12px;
  overflow: auto;
  background: #eef2ef;
}

.template-live-preview .business-doc-template-render,
.template-live-preview .business-doc-paper {
  margin: 0 auto;
  background: #fff;
}

body.print-no-stamp .stamp {
  display: none !important;
}

body.print-no-sign .auto-signature {
  color: transparent !important;
  text-shadow: none !important;
}

.auto-signature {
  display: inline-block;
  min-width: 72px;
  margin-left: 6px;
  padding: 0 10px 2px;
  border-bottom: 1px solid #111;
  color: #111;
  font-size: 20px;
  font-family: "KaiTi", "STKaiti", "SimSun", serif;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

@media (max-width: 1180px) {
  .template-editor-layout {
    grid-template-columns: 1fr;
  }

  .template-editor-preview {
    position: static;
  }

  .template-live-preview {
    max-height: none;
  }
}

.empty {
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
  background: #fbfdfc;
}

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

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

  .brand {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 4px 10px;
    margin-bottom: 10px;
  }

  .brand p {
    margin: 0;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    max-width: 100%;
    min-width: 0;
  }

  .nav button {
    width: auto;
    flex: 0 0 auto;
    padding: 9px 12px;
  }

  .nav-group {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    align-items: center;
  }

  .nav-sub {
    margin: 0;
    padding-left: 0;
    border-left: 0;
    gap: 6px;
  }

  .nav-group.open .nav-sub {
    display: flex;
  }

  .nav button.nav-sub-item {
    padding: 9px 11px;
  }

  .nav button::before {
    display: none;
  }

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

  .audit-strip-grid,
  .audit-card-grid,
  .audit-flow-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.two,
  .split {
    grid-template-columns: 1fr;
  }

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

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

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

  .inventory-price-layout {
    grid-template-columns: 1fr;
  }

  .inventory-price-panel {
    position: static;
  }

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

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

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

  .settings-menu {
    display: flex;
    position: static;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .settings-menu button {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }

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

  .inventory-price-layout .inventory-model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .dashboard-control,
  .dashboard-main-grid,
  .dashboard-lower-grid {
    grid-template-columns: 1fr;
  }

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

  .dashboard-stock-row {
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr) auto;
  }
}

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

  .brand {
    display: block;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand p {
    margin-top: 4px;
  }

  .topbar {
    min-height: 58px;
    padding: 0 14px;
  }

  .topbar h2 {
    font-size: 18px;
  }

  .topbar .user {
    display: flex;
  }

  .topbar .user span {
    display: none;
  }

  .login-shell {
    padding: 14px;
  }

  .login-brand,
  .login-form {
    padding-left: 20px;
    padding-right: 20px;
  }

  .content {
    padding: 14px 12px 32px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .weigh-title-strip {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    padding: 20px;
  }

  .weigh-title-strip h3 {
    font-size: 24px;
  }

  .weigh-title-strip b {
    font-size: 32px;
    align-self: stretch;
    text-align: center;
  }

  .grid.four,
  .grid.three,
  .grid.two,
  .split,
  .dashboard-control,
  .dashboard-finance-grid,
  .dashboard-main-grid,
  .dashboard-lower-grid,
  .dashboard-hero-grid,
  .boss-todo-grid,
  .audit-strip-grid,
  .audit-card-grid,
  .audit-flow-map,
  .completion-summary,
  .completion-lanes,
  .completion-stock-summary,
  .form-grid,
  .form-grid.two,
  .sales-order-command-grid,
  .external-buy-command-grid,
  .external-direct-entry-layout,
  .external-direct-entry-grid,
  .external-direct-check-grid,
  .receivable-status-grid,
  .receivable-risk-grid,
  .payable-source-grid,
  .payable-status-grid,
  .account-permission-grid,
  .account-credential-grid,
  .account-activity-grid {
    grid-template-columns: 1fr;
  }

  .external-direct-entry-head {
    flex-direction: column;
    gap: 3px;
  }

  .external-direct-entry-head span {
    text-align: left;
  }

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

  .out-item-fields {
    grid-template-columns: 1fr;
  }

  .contract-item-fields,
  .sales-contract-inline,
  .outbound-document-rule-grid,
  .contract-acceptance-grid {
    grid-template-columns: 1fr;
  }

  .acceptance-rule-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .completion-legend {
    justify-content: flex-start;
  }

  .completion-contract strong {
    font-size: 25px;
  }

  .completion-lane {
    min-height: 86px;
  }

  .inventory-summary-strip,
  .inventory-model-grid {
    grid-template-columns: 1fr;
  }

  .inventory-price-layout .inventory-model-grid {
    grid-template-columns: 1fr;
  }

  .inventory-variety-price-list {
    grid-template-columns: 1fr;
  }

  .package-material-item-fields {
    grid-template-columns: 1fr;
  }

  .inventory-variety-head,
  .inventory-model-top {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-variety-total {
    justify-content: flex-start;
  }

  .inventory-variety-total span,
  .inventory-model-total {
    text-align: left;
  }

  .inventory-detail-line {
    grid-template-columns: 1fr;
  }

  .inventory-price-list {
    max-height: none;
    grid-template-columns: 1fr;
  }

  .inventory-price-row,
  .inventory-detail-price-row {
    grid-template-columns: 1fr;
  }

  .inventory-price-row input,
  .inventory-detail-price-row input {
    width: 100%;
    text-align: left;
  }

  .inventory-valuation-status,
  .inventory-apply-one-price {
    width: 100%;
  }

  .inventory-price-row .btn {
    width: 100%;
  }

  .inventory-detail-price-row b {
    text-align: left;
  }

  .panel-header,
  .panel-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .kpi {
    min-height: 96px;
  }

  .kpi .value {
    font-size: 24px;
  }

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

  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .dashboard-hero {
    min-height: 0;
    padding: 18px;
  }

  .dashboard-hero-title {
    display: grid;
  }

  .dashboard-hero-value {
    font-size: 38px;
  }

  .dashboard-stock-row,
  .dashboard-risk-item {
    grid-template-columns: 1fr;
  }

  .dashboard-stock-value {
    text-align: left;
  }

  .dashboard-risk-item b {
    white-space: normal;
  }

  .bar-value {
    text-align: left;
  }

  .approval-card {
    grid-template-columns: 1fr;
  }

  .approval-side {
    justify-items: start;
  }

  .delivery-meta,
  .delivery-section .section-grid,
  .signatures {
    grid-template-columns: 1fr;
  }

  .delivery-paper {
    padding: 18px;
  }

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

  .edit-modal-backdrop {
    padding: 12px;
    place-items: stretch;
  }

  .approved-edit-dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
  }

  .approved-edit-grid {
    grid-template-columns: 1fr;
  }

  .edit-modal-header {
    align-items: stretch;
    flex-direction: column;
  }

  .edit-header-close,
  .edit-modal-actions .btn {
    width: 100%;
  }

  .edit-modal-actions {
    grid-column: 1;
  }
}

.customer-branch-editor {
  background: #f8fafc;
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  padding: 14px;
}

.customer-branch-editor.is-collapsed {
  background: #f6fbf8;
}

.customer-branch-editor-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.customer-branch-editor.is-collapsed .customer-branch-editor-body,
.customer-branch-editor.is-collapsed [data-add-customer-branch] {
  display: none;
}

.customer-branch-editor-body[hidden] {
  display: none;
}

.customer-branch-editor [data-customer-branches] {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.customer-branch-row {
  align-items: end;
  background: #ffffff;
  border: 1px solid #dfe8f3;
  border-radius: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(150px, 1.2fr) minmax(120px, .8fr) minmax(130px, .9fr) minmax(120px, .8fr) minmax(220px, 1.5fr) minmax(120px, .8fr) auto;
  padding: 12px;
}

.customer-branch-row .field {
  min-width: 0;
}

.customer-branch-row .field.wide {
  grid-column: auto;
}

@media (max-width: 980px) {
  .customer-branch-row {
    grid-template-columns: 1fr 1fr;
  }

  .customer-branch-row .field.wide,
  .customer-branch-row .btn {
    grid-column: 1 / -1;
  }
}

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

  .completion-command-head {
    display: none;
  }

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

  .completion-command-row > div {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .completion-command-row > div:first-child {
    border-top: 0;
  }

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

}

@media (max-width: 760px) {
  .completion-command-actions-top {
    justify-content: stretch;
  }

  .completion-command-actions-top select,
  .completion-command-actions-top input,
  .completion-command-actions-top .btn {
    width: 100%;
    min-width: 0;
  }

  .completion-command-summary,
  .completion-progress-grid {
    grid-template-columns: 1fr;
  }

  .completion-progress-head,
  .completion-contract-total,
  .completion-command-customer {
    align-items: flex-start;
    flex-direction: column;
  }

  .completion-command-contract {
    grid-template-columns: 1fr;
  }

  .completion-contract-total {
    grid-column: auto;
    grid-row: auto;
    padding-left: 0;
    padding-top: 10px;
    border-left: 0;
    border-top: 1px dashed #dce8e2;
  }

  .completion-progress-head small,
  .completion-contract-total strong {
    white-space: normal;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .toolbar,
  .no-print,
  .notice,
  .edit-modal-backdrop {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .content {
    padding: 0;
  }

  body.printing-delivery .content > :not(.delivery-print-section) {
    display: none !important;
  }

  body.printing-delivery .delivery-print-section {
    display: block !important;
    margin: 0 !important;
    border: 0;
    box-shadow: none;
  }

  body.printing-delivery .delivery-print-section > .panel-header {
    display: none !important;
  }

  body.printing-delivery .delivery-print-section > .panel-body {
    padding: 0;
  }

  body.printing-business-document .sidebar,
  body.printing-business-document .topbar,
  body.printing-business-document .notice,
  body.printing-business-document .content > :not(.edit-modal-backdrop) {
    display: none !important;
  }

  body.printing-business-document .edit-modal-backdrop {
    display: block !important;
    position: static;
    inset: auto;
    padding: 0;
    background: #fff;
    backdrop-filter: none;
  }

  body.printing-business-document .approved-edit-dialog {
    width: 100%;
    max-height: none;
    display: block;
    border: 0;
    box-shadow: none;
  }

  body.printing-business-document .edit-modal-header,
  body.printing-business-document .business-doc-editor {
    display: none !important;
  }

  body.printing-business-document .edit-modal-body {
    padding: 0;
    overflow: visible;
  }

  body.printing-business-document .business-doc-print-source {
    margin: 0;
  }

  .panel,
  .delivery-paper,
  .business-doc-paper {
    border: 0;
    box-shadow: none;
  }
}
.account-permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.account-permission-guide {
  text-align: left;
  border: 1px solid #d7e7dd;
  background: #f1f8f4;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  line-height: 1.6;
}

.account-permission-guide p {
  margin: 0;
}

.account-permission-guide p + p {
  margin-top: 4px;
}

.account-permission-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 12px;
}

.account-permission-card.off {
  background: #f8f5f2;
  border-color: #e5d7ce;
}

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

.account-credential-grid div {
  min-width: 0;
  border: 1px solid #d7e7dd;
  background: #eef8f2;
  border-radius: 6px;
  padding: 7px 8px;
}

.account-credential-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.account-credential-grid strong {
  display: block;
  color: var(--accent-dark);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.account-activity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.account-activity-grid div {
  min-width: 0;
  border: 1px solid #dfe9e3;
  background: #f3f8f5;
  border-radius: 6px;
  padding: 7px 8px;
}

.account-activity-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.account-activity-grid strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

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

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  font-size: 13px;
  color: var(--text);
}

.checkbox-inline input {
  width: 16px;
  height: 16px;
}

.payables-simple-hero {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 1.2fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid #d5eadf;
  border-radius: 8px;
  background: linear-gradient(135deg, #f2fbf6 0%, #ffffff 68%);
}

.payables-simple-hero span,
.statement-head span {
  display: block;
  margin-bottom: 5px;
  color: #3b7a57;
  font-size: 12px;
  font-weight: 700;
}

.payables-simple-hero h3,
.statement-head h3 {
  margin: 0 0 6px;
  color: #10291e;
  font-size: 20px;
  line-height: 1.25;
}

.payables-simple-hero p {
  margin: 0;
  color: #5c6b63;
}

.payables-simple-hero-kpis,
.payables-simple-summary,
.statement-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.payables-simple-panel {
  margin-bottom: 14px;
}

.payables-simple-panel .panel-header p {
  margin: 4px 0 0;
  color: #67746d;
  font-size: 12px;
}

.payables-simple-summary {
  margin-bottom: 12px;
}

.payables-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(260px, 1fr);
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #e2ebe6;
  border-radius: 8px;
  background: #fbfdfc;
}

.finished-supplier-statement-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.finished-supplier-list,
.finished-supplier-statement {
  border: 1px solid #dce9e2;
  border-radius: 8px;
  background: #fff;
}

.finished-supplier-list {
  max-height: 720px;
  overflow: auto;
}

.finished-supplier-list-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border-bottom: 1px solid #e4eee8;
  background: #f6fbf8;
}

.finished-supplier-list-head span {
  color: #75857d;
  font-size: 12px;
}

.finished-supplier-card {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid #edf3ef;
  border-left: 4px solid transparent;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.finished-supplier-card:hover {
  background: #f8fcfa;
}

.finished-supplier-card.active {
  border-left-color: #12834d;
  background: #eef8f2;
}

.finished-supplier-card-title {
  color: #12281e;
  font-size: 14px;
  font-weight: 800;
}

.finished-supplier-card span:not(.finished-supplier-card-title) {
  color: #69776f;
  font-size: 12px;
}

.finished-supplier-card strong {
  color: #0f6b41;
  font-size: 14px;
}

.finished-supplier-statement {
  min-width: 0;
  padding: 14px;
}

.statement-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5eee8;
}

.statement-head > strong {
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff3d9;
  color: #9a5c00;
  white-space: nowrap;
}

.statement-head > strong.statement-credit {
  background: #e4f6ef;
  color: #087545;
}

.statement-kpis {
  margin-bottom: 12px;
}

.prepayment-entry {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid #dbeee5;
  border-radius: 8px;
  background: #f4fbf7;
}

.prepayment-entry p {
  margin: 5px 0 0;
  color: #69776f;
  font-size: 12px;
  line-height: 1.5;
}

.prepayment-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.prepayment-form .btn {
  min-height: 38px;
}

.statement-section {
  margin-top: 12px;
}

.statement-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.statement-section-head span {
  color: #718078;
  font-size: 12px;
}

.payables-simple-table th,
.payables-simple-table td {
  white-space: nowrap;
}

.supplier-statement-table td:nth-child(5) {
  min-width: 220px;
  white-space: normal;
}

.supplier-prepay-list {
  display: grid;
  gap: 8px;
}

.supplier-prepay-line {
  display: grid;
  grid-template-columns: 130px 100px 140px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e3ece7;
  border-radius: 8px;
  background: #fbfdfc;
}

.supplier-prepay-line strong {
  color: #0b6f44;
}

.supplier-prepay-line span {
  color: #4f6057;
}

.supplier-prepay-line em {
  color: #75857d;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payable-request-panel {
  border-left: 4px solid #0f8b57;
}

.payable-request-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.payable-request-list {
  display: grid;
  gap: 10px;
}

.payable-request-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.25fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid #dce9e2;
  border-radius: 8px;
  background: #fbfdfc;
}

.payable-request-card.urgent {
  border-color: #f0c36a;
  background: #fffaf0;
}

.payable-request-main {
  display: grid;
  gap: 4px;
}

.payable-request-main span {
  color: #9a5c00;
  font-size: 12px;
  font-weight: 800;
}

.payable-request-main strong {
  color: #10291e;
  font-size: 15px;
}

.payable-request-main em,
.payable-request-main small {
  color: #607168;
  font-style: normal;
  font-size: 12px;
  line-height: 1.45;
}

.payable-request-main b {
  color: #b42318;
}

.payable-request-pay-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.payable-request-pay-form .btn {
  min-height: 38px;
}

.payable-instruction-cell {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 160px;
}

.payable-instruction-cell.active {
  display: grid;
  gap: 3px;
  padding: 6px 8px;
  border: 1px solid #b8e2cd;
  border-radius: 8px;
  background: #eefaf4;
  color: #0f6b41;
}

.payable-instruction-cell.active strong {
  font-size: 12px;
}

.payable-instruction-cell.active span {
  color: #35624c;
  font-size: 12px;
}

.payable-feedback-details,
.payables-raw-details {
  margin-top: 12px;
}

.payable-feedback-details summary,
.payables-raw-details summary {
  cursor: pointer;
  user-select: none;
}

.payables-raw-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dce9e2;
  border-radius: 8px;
  background: #f6fbf8;
}

.payables-raw-details summary strong {
  color: #10291e;
}

.payables-raw-details summary span {
  color: #66756d;
  font-size: 12px;
}

.payables-raw-details[open] summary {
  margin-bottom: 12px;
  border-color: #9fd5bb;
  background: #ecf8f2;
}

.payable-feedback-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.payable-feedback-line {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 110px minmax(160px, 0.8fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #e3ece7;
  border-radius: 8px;
  background: #fff;
}

.payable-feedback-line span,
.payable-feedback-line em {
  color: #65756d;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .payables-simple-hero,
  .finished-supplier-statement-layout,
  .prepayment-entry,
  .payable-request-card {
    grid-template-columns: 1fr;
  }

  .prepayment-form,
  .payable-request-pay-form,
  .payable-feedback-line,
  .payable-request-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.handling-fee-shell {
  display: grid;
  gap: 14px;
}

.handling-fee-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 18px;
  align-items: stretch;
  padding: 18px 20px;
  border: 1px solid #dbeee5;
  border-radius: 8px;
  background: linear-gradient(135deg, #f4fbf7 0%, #ffffff 68%);
}

.handling-fee-hero h2 {
  margin: 4px 0 6px;
  font-size: 22px;
  line-height: 1.3;
}

.handling-fee-hero p {
  max-width: 780px;
  margin: 0;
  color: #5e6d64;
  line-height: 1.6;
}

.handling-fee-rule {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px;
  border: 1px solid #b8dfcb;
  border-radius: 8px;
  background: #e8f7ef;
}

.handling-fee-rule span,
.handling-fee-rule small,
.handling-fee-summary-card span,
.handling-fee-summary-card small {
  color: #65766c;
}

.handling-fee-rule strong {
  font-size: 24px;
  color: #0d6f44;
}

.handling-fee-rule-note {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #f0d9a9;
  border-radius: 8px;
  background: #fff8e7;
  color: #8a5c07;
  font-weight: 700;
}

.handling-fee-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.handling-fee-summary-card {
  min-height: 92px;
  padding: 13px 14px;
  border: 1px solid #dfeae4;
  border-radius: 8px;
  background: #fff;
}

.handling-fee-summary-card.primary {
  border-color: #b9dac9;
  background: #f2fbf6;
}

.handling-fee-summary-card.danger {
  border-color: #f3cbc6;
  background: #fff4f2;
}

.handling-fee-summary-card strong {
  display: block;
  margin: 4px 0;
  font-size: 22px;
}

.handling-fee-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
}

.handling-fee-filter-details {
  overflow: hidden;
}

.handling-fee-filter-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.handling-fee-filter-details summary::-webkit-details-marker {
  display: none;
}

.handling-fee-filter-details summary strong,
.handling-fee-filter-details summary small {
  display: block;
}

.handling-fee-filter-details summary small {
  margin-top: 4px;
  color: #6b7b72;
}

.handling-fee-filter-details[open] summary {
  border-bottom: 1px solid #dcebe3;
  background: #f3fbf7;
}

.handling-fee-filter-details[open] .panel-header {
  border-top: 1px solid #edf4ef;
}

.handling-fee-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 14px;
}

.handling-fee-form {
  margin: 0;
}

.handling-fee-flex-details {
  overflow: hidden;
}

.handling-fee-flex-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.handling-fee-flex-details summary::-webkit-details-marker {
  display: none;
}

.handling-fee-flex-details summary strong,
.handling-fee-flex-details summary small {
  display: block;
}

.handling-fee-flex-details summary small {
  margin-top: 4px;
  color: #6b7b72;
}

.handling-fee-flex-details[open] summary {
  border-bottom: 1px solid #dcebe3;
  background: #f3fbf7;
}

.handling-fee-form-hint,
.handling-fee-settlement-scope {
  padding: 10px 12px;
  border: 1px solid #d7eadf;
  border-radius: 8px;
  background: #f3fbf7;
  color: #52645a;
}

.handling-fee-settlement-scope {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.handling-fee-settlement-scope strong {
  color: #0b6f44;
}

.handling-fee-days {
  display: grid;
  gap: 12px;
}

.handling-fee-day-card {
  border: 1px solid #d9e9e0;
  border-radius: 8px;
  overflow: hidden;
  background: #fbfefc;
}

.handling-fee-day-card.alt {
  background: #fffaf1;
  border-color: #eadbb8;
}

.handling-fee-day-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.handling-fee-day-head small {
  display: block;
  margin-top: 4px;
  color: #6d7b73;
}

.handling-fee-day-total {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  text-align: right;
}

.handling-fee-day-total span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #5f6e65;
  font-size: 12px;
}

.handling-fee-day-total strong {
  font-size: 18px;
  color: #0b6f44;
}

.handling-fee-source-cell {
  display: grid;
  gap: 3px;
}

.handling-fee-source-cell small {
  color: #718078;
}

.handling-fee-detail-table {
  border-radius: 0;
}

.handling-fee-detail-table th,
.handling-fee-detail-table td {
  white-space: nowrap;
}

.handling-fee-detail-table td:last-child {
  min-width: 160px;
  white-space: normal;
}

.raw-handling-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.raw-handling-action small {
  color: #7b877f;
}

@media (max-width: 1280px) {
  .handling-fee-hero,
  .handling-fee-work-grid {
    grid-template-columns: 1fr;
  }

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