:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-soft: #f1f5f9;
  --strong: #111827;
  --text: #1f2933;
  --muted: #687385;
  --label: #59667a;
  --placeholder: #9aa4b2;
  --field-bg: #fbfcfe;
  --field-border: #cfd6e2;
  --glass-bg: rgba(255, 255, 255, .72);
  --glass-active: rgba(255, 255, 255, .92);
  --soft-shadow: 0 18px 44px rgba(31, 41, 51, .10);
  --active-shadow: 0 16px 34px rgba(31, 41, 51, .16);
  --order-bg: #fffdf7;
  --order-line: #ead9ad;
  --order-accent: #8a5a12;
  --line: #d9dee7;
  --accent: #2563eb;
  --accent-weak: #e8f0ff;
  --good: #0f766e;
  --bad: #b42318;
  --topbar-bg: rgba(255, 255, 255, .82);
  --body-gradient: linear-gradient(180deg, rgba(244, 247, 251, .86), rgba(246, 247, 249, 1) 260px);
  --danger-soft: #fff1f0;
  --warning-soft: #fff7ed;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--body-gradient), var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

.page-loading {
  align-items: center;
  background: rgba(15, 23, 42, .18);
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity .12s ease;
  z-index: 1000;
}
.page-loading.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.page-loading-box {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .20);
  color: var(--strong);
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  gap: 10px;
  padding: 16px 20px;
}
.page-loading-spinner {
  animation: loading-spin .72s linear infinite;
  border: 3px solid #dbeafe;
  border-top-color: var(--accent);
  border-radius: 999px;
  height: 22px;
  width: 22px;
}
@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}

.brand { font-weight: 700; font-size: 18px; }
.nav { align-items: center; display: flex; gap: 16px; flex-wrap: wrap; }
.nav a {
  border-radius: 8px;
  color: var(--text);
  font-weight: 700;
  padding: 6px 8px;
}
.nav a.is-active {
  background: var(--accent-weak);
  box-shadow: inset 0 -2px 0 var(--accent);
  color: var(--accent);
}
.nav-user {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.theme-picker {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}
.theme-picker label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.theme-picker select {
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  min-height: 32px;
  padding: 4px 28px 4px 8px;
  width: auto;
}

.page { max-width: 1540px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.detail-page-head { align-items: flex-start; }
.detail-page-head > div:first-child { min-width: 0; }
.detail-back-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.detail-tool-actions { justify-content: flex-end; }
.title-with-action {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}
.title-with-action h1 {
  min-width: 0;
  overflow-wrap: anywhere;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
h1 { font-size: 26px; margin: 0; }
h2 { font-size: 18px; margin: 0 0 12px; }

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

.panel, .card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px) saturate(135%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--soft-shadow);
}
.panel:focus-within,
.card:focus-within {
  background: var(--glass-active);
}

.metric .label { color: var(--muted); font-size: 13px; font-weight: 650; }
.metric .value { font-size: 28px; font-weight: 700; margin-top: 6px; }
.metric .value a.metric-value-link {
  color: var(--accent);
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.metric-note-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: #aab4c4;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.metric-note-link:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}
.metric .value a,
.summary-card a {
  color: inherit;
  text-decoration: none;
}
.metric .value a:hover,
.summary-card a:hover {
  text-decoration: underline;
}
.metric-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  margin-top: 6px;
  min-height: 16px;
}
.dashboard-head {
  align-items: flex-start;
}
.dashboard-period {
  margin-top: 4px;
  font-weight: 650;
}
.dashboard-actions,
.period-filter,
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dashboard-actions {
  justify-content: flex-end;
}
.period-filter {
  align-items: center;
}
.period-filter select {
  width: auto;
  min-width: 108px;
}
.period-filter select,
.period-filter option,
.product-filters input,
.product-filters select,
.product-filters option,
.shipment-filters input,
.shipment-filters select,
.shipment-filters option {
  color: var(--text);
}
.period-filter select:focus,
.product-filters input:focus,
.product-filters select:focus,
.shipment-filters input:focus,
.shipment-filters select:focus {
  color: var(--text);
}
.dashboard-day-select {
  width: 92px;
  min-width: 92px;
}
.dashboard-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.dashboard-summary,
.dashboard-section {
  margin-top: 16px;
}
.summary-card {
  display: grid;
  gap: 6px;
  min-height: 104px;
}
.summary-card strong {
  color: var(--strong);
  font-size: 18px;
}
.summary-card span {
  color: var(--muted);
  font-size: 20px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.summary-card a {
  color: var(--accent);
  font-size: 20px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.dashboard-welcome {
  align-items: flex-end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 6px 0 20px;
}
.dashboard-welcome h1 {
  font-size: 30px;
  line-height: 1.25;
  margin-top: 5px;
}
.dashboard-welcome p {
  color: var(--muted);
  font-size: 16px;
  font-weight: 550;
  margin: 8px 0 0;
}
.dashboard-eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
}
.dashboard-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.dashboard-quick-actions .btn {
  min-height: 42px;
}
.dashboard-period-panel {
  align-items: end;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(190px, .7fr) minmax(620px, 1.8fr);
}
.dashboard-period-panel h2,
.dashboard-period-panel p {
  margin: 0;
}
.dashboard-period-panel p {
  margin-top: 5px;
}
.dashboard-period-filter {
  display: grid;
  gap: 10px;
  grid-template-columns: 130px minmax(180px, 1fr) minmax(150px, .8fr) auto;
}
.dashboard-period-filter label {
  display: grid;
  gap: 5px;
}
.dashboard-period-filter label > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.dashboard-period-filter select {
  min-height: 42px;
  min-width: 0;
  width: 100%;
}
.dashboard-period-filter .btn {
  min-height: 42px;
  white-space: nowrap;
}
.dashboard-block {
  margin-top: 28px;
}
.dashboard-section-heading {
  align-items: flex-end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 12px;
}
.dashboard-section-heading h2 {
  font-size: 21px;
  margin: 4px 0 0;
}
.dashboard-section-link {
  font-size: 14px;
  font-weight: 750;
}
.dashboard-task-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dashboard-task-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--good);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  color: var(--text);
  display: grid;
  gap: 7px;
  min-height: 178px;
  padding: 18px 20px;
  text-decoration: none;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.dashboard-task-card:hover {
  box-shadow: var(--active-shadow);
  text-decoration: none;
  transform: translateY(-2px);
}
.dashboard-task-card.needs-action {
  background: #fffafa;
  border-left-color: var(--bad);
}
.dashboard-task-card.needs-attention {
  background: #fffdf7;
  border-left-color: #d97706;
}
.dashboard-task-label {
  color: var(--muted);
  font-size: 15px;
  font-weight: 750;
}
.dashboard-task-card strong {
  color: var(--good);
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.dashboard-task-card.needs-action strong {
  color: var(--bad);
}
.dashboard-task-card.needs-attention strong {
  color: #b45309;
}
.dashboard-task-card strong small {
  font-size: 15px;
  font-weight: 750;
}
.dashboard-task-description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.dashboard-task-link {
  align-self: end;
  color: var(--accent);
  font-size: 14px;
  font-weight: 750;
  margin-top: auto;
}
.dashboard-performance-grid,
.dashboard-highlight-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.dashboard-metric-card {
  box-shadow: none;
  min-height: 126px;
}
.dashboard-highlight-grid .summary-card {
  box-shadow: none;
}
.dashboard-detail-section {
  margin-top: 16px;
  padding: 0;
}
.dashboard-detail-section > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  list-style: none;
  min-height: 74px;
  padding: 16px 18px;
}
.dashboard-detail-section > summary::-webkit-details-marker {
  display: none;
}
.dashboard-detail-section > summary strong,
.dashboard-detail-section > summary small {
  display: block;
}
.dashboard-detail-section > summary strong {
  color: var(--text);
  font-size: 17px;
}
.dashboard-detail-section > summary small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}
.dashboard-detail-action {
  color: var(--accent);
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}
.dashboard-detail-action::after {
  content: "＋";
  margin-left: 7px;
}
.dashboard-detail-section[open] .dashboard-detail-action::after {
  content: "－";
}
.dashboard-detail-content {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 0 16px 16px;
}
.section-head {
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-head h2 {
  margin-bottom: 0;
}

table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
td { color: var(--text); }
th { font-size: 13px; color: var(--muted); font-weight: 700; background: var(--field-bg); }
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
tfoot th {
  background: var(--surface-soft);
  color: var(--strong);
  font-weight: 800;
}
.order-lines-table {
  min-width: 1160px;
  table-layout: auto;
}
.order-lines-table tbody tr {
  background: var(--order-bg);
}
.order-lines-table tbody td {
  border-bottom-color: var(--order-line);
  font-size: 16px;
  font-weight: 500;
}
.order-brand {
  color: #4b5563;
  font-size: 14px;
  font-weight: 500;
}
.order-product {
  color: #111827;
  font-size: 17px;
  font-weight: 500;
}
.order-lines-table th,
.order-lines-table td {
  white-space: nowrap;
}
.order-lines-table th:first-child,
.order-lines-table td:first-child,
.order-lines-table th:nth-child(2),
.order-lines-table td:nth-child(2) {
  white-space: normal;
  min-width: 120px;
}
.wide-table { overflow-x: auto; margin-bottom: 16px; }
.entry-table {
  min-width: 1500px;
  table-layout: fixed;
}
.entry-table th {
  white-space: nowrap;
}
.entry-table td:not(:first-child) {
  white-space: nowrap;
}
.entry-table input,
.entry-table select { min-width: 0; }
.entry-table td:first-child,
.entry-table th:first-child {
  width: 380px;
  min-width: 380px;
}
.row-danger td { background: #fff1f0; }
.row-warning td { background: #fff7ed; }
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.order-lines-table .num {
  color: #111827;
  font-size: 16px;
  font-weight: 500;
}
.order-lines-table .pending-shipment-head,
.order-lines-table .pending-shipment-number {
  color: inherit;
}
.order-lines-table .pending-shipment-number.has-pending {
  color: var(--accent);
  font-weight: 650;
}
.muted { color: var(--muted); }
.good { color: var(--good); }
.bad { color: var(--bad); }

form.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
form.inline input,
form.inline select {
  width: auto;
}
.customer-search input {
  min-width: 320px;
}
td form { margin: 0; }
.table-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.product-filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
}
.product-filters .form-row {
  min-width: 0;
}
.product-filters .filter-search {
  flex: 1 1 320px;
  min-width: 260px;
}
.product-filters .filter-brand {
  flex: 0 1 220px;
}
.product-filters .filter-status {
  flex: 0 0 150px;
}
.product-filters .filter-year {
  flex: 0 0 112px;
}
.product-filters .filter-month {
  flex: 0 0 112px;
}
.product-filters .filter-day {
  flex: 0 0 92px;
}
.product-filters .filter-month-wide {
  flex: 0 0 150px;
}
.product-filters .filter-actions {
  flex: 0 0 auto;
}
.product-filters .filter-actions .actions {
  align-items: center;
}
.shipment-filters {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.shipment-search {
  flex: 0 1 420px;
  min-width: 0;
}
.shipment-filter-group {
  align-items: end;
  display: flex;
  flex: 1 1 720px;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}
.shipment-filter-year {
  width: 112px;
}
.shipment-filter-status {
  width: 112px;
}
.shipment-filter-basis {
  width: 126px;
}
.shipment-filter-month {
  width: 112px;
}
.shipment-filter-day {
  width: 92px;
}
.shipment-filter-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}
.shipment-results-head {
  margin-top: 24px;
}
.shipment-table {
  table-layout: fixed;
  min-width: 1360px;
  width: 100%;
}
.shipment-table th,
.shipment-table td {
  vertical-align: middle;
}
.shipment-col-code { width: 240px; }
.shipment-col-brand { width: 140px; }
.shipment-col-date { width: 118px; }
.shipment-col-status { width: 78px; }
.shipment-col-time { width: 170px; }
.shipment-col-recipient { width: 140px; }
.shipment-col-address { width: auto; }
.shipment-col-quantity { width: 82px; }
.shipment-col-count { width: 58px; }
.shipment-col-action { width: 82px; }
.shipment-table th:nth-child(3),
.shipment-table td:nth-child(3) {
  white-space: nowrap;
}
.shipment-table td:nth-child(5) {
  overflow-wrap: anywhere;
  white-space: normal;
}
.shipment-table td:nth-child(7) {
  word-break: break-word;
}
.shipment-brand-cell {
  color: #334155;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.shipment-order-row td {
  background: #eef4ff;
  border-left: 4px solid var(--primary);
  font-weight: 800;
  padding-bottom: 10px;
  padding-top: 10px;
}
.shipment-order-heading {
  align-items: baseline;
  display: flex;
  gap: 14px;
  min-width: 0;
}
.shipment-order-no,
.shipment-order-customer,
.shipment-order-count {
  white-space: nowrap;
}
.shipment-order-customer,
.shipment-order-count {
  color: var(--muted);
  font-weight: 700;
}
.shipment-order-count {
  font-size: 13px;
}
.shipment-child-row td {
  background: #fff;
}
.shipment-child-row td:first-child {
  white-space: nowrap;
}
.shipment-child-code {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}
.shipment-child-marker {
  display: inline-block;
  flex: 0 0 18px;
  height: 14px;
  margin-left: 10px;
  position: relative;
  width: 18px;
}
.shipment-child-marker::before {
  border-bottom: 2px solid #94a3b8;
  border-left: 2px solid #94a3b8;
  bottom: 2px;
  content: "";
  height: 10px;
  left: 0;
  position: absolute;
  width: 14px;
}
.shipment-edit-btn {
  min-width: 0;
  padding-left: 12px;
  padding-right: 12px;
  white-space: nowrap;
}
.order-meta-grid {
  grid-template-columns: minmax(320px, 520px) 240px;
  justify-content: start;
  align-items: end;
}
.form-row { display: grid; gap: 6px; }
.address-picker {
  display: grid;
  grid-template-columns: minmax(120px, 140px) minmax(140px, 160px) minmax(180px, 1fr) minmax(200px, 1.4fr);
  gap: 10px;
}
.manual-road { display: none; }
.manual-road.is-visible { display: grid; }
.address-detail { min-width: 0; }
.radio-group {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 14px;
}
.radio-group input {
  width: auto;
}
.readonly-address {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f6f9;
  color: var(--muted);
}
.other-address-fields {
  display: grid;
  grid-template-columns: minmax(130px, .7fr) minmax(150px, .8fr) minmax(180px, 1fr) minmax(220px, 1.4fr);
  gap: 8px;
}
.other-address-fields[hidden] { display: none; }
label,
.field-caption {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.hint { color: #8b95a5; font-weight: 400; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--field-border);
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  background: var(--field-bg);
  color: var(--strong);
  font-weight: 560;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #94a3b8;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(31, 41, 51, .08);
}
input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
  font-weight: 450;
  opacity: 1;
}
select:invalid,
input:placeholder-shown,
textarea:placeholder-shown {
  color: #5f6b7a;
}
input[readonly],
textarea[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
}
textarea { min-height: 78px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 650;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .22);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover {
  filter: brightness(1.03);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, .28);
}
.btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(37, 99, 235, .20);
}
.btn.secondary { background: var(--surface); color: var(--accent); }
.btn.compact {
  font-size: 13px;
  min-height: 30px;
  padding: 5px 9px;
}
.btn.danger {
  background: var(--surface);
  border-color: var(--bad);
  color: var(--bad);
}
.icon-btn {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  display: inline-flex;
  justify-content: center;
  min-height: 34px;
  min-width: 34px;
  text-decoration: none;
}
.icon-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .16);
}
.icon-btn svg {
  fill: none;
  height: 16px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 16px;
}
.compact-icon {
  min-height: 30px;
  min-width: 30px;
}

.alert {
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
  padding: 12px 14px;
}
.bad-alert {
  background: var(--danger-soft);
  border-color: #f2b8b5;
  color: var(--bad);
}
.info-alert {
  background: var(--accent-weak);
  border-color: #b8cdfc;
  color: #1d4ed8;
}
.warning-alert {
  background: var(--warning-soft);
  border-color: #fed7aa;
  color: #9a3412;
}
.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .72fr);
  gap: clamp(48px, 8vw, 120px);
  margin: 0 auto;
  max-width: 1180px;
  min-height: calc(100vh - 122px);
  place-items: center stretch;
  width: 100%;
}
.login-page .page {
  max-width: none;
  padding: 32px clamp(28px, 6vw, 96px);
}
.login-topbar {
  padding-left: clamp(28px, 6vw, 96px);
  padding-right: clamp(28px, 6vw, 96px);
}
.login-topbar .brand {
  font-size: 20px;
}
.login-topbar .nav {
  margin-left: auto;
}
.login-intro {
  max-width: 570px;
}
.login-eyebrow {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 14px;
}
.login-intro h1 {
  color: var(--strong);
  font-size: clamp(40px, 5vw, 64px);
  letter-spacing: -.035em;
  line-height: 1.08;
  margin: 0;
}
.login-intro > p {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.75;
  margin: 24px 0 26px;
  max-width: 520px;
}
.login-benefits {
  display: grid;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.login-benefits li {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 17px;
  font-weight: 700;
  gap: 12px;
}
.login-benefits li::before {
  align-items: center;
  background: var(--accent-weak);
  border-radius: 999px;
  color: var(--accent);
  content: "✓";
  display: inline-flex;
  flex: 0 0 30px;
  font-size: 15px;
  height: 30px;
  justify-content: center;
}
.login-panel {
  border-radius: 14px;
  max-width: 480px;
  padding: clamp(28px, 4vw, 44px);
  width: 100%;
}
.login-panel-heading {
  margin-bottom: 28px;
}
.login-panel-heading .login-eyebrow {
  margin-bottom: 10px;
}
.login-panel h2 {
  color: var(--strong);
  font-size: 30px;
  margin-bottom: 10px;
}
.login-panel-heading p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  margin: 0;
}
.login-google-btn {
  gap: 12px;
  font-size: 17px;
  min-height: 56px;
  width: 100%;
}
.google-mark {
  align-items: center;
  background: #fff;
  border-radius: 999px;
  color: #2563eb;
  display: inline-flex;
  flex: 0 0 28px;
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
}
.login-security-note {
  align-items: flex-start;
  color: var(--muted);
  display: flex;
  font-size: 14px;
  gap: 9px;
  line-height: 1.6;
  margin-top: 18px;
}
.login-security-note > span:first-child {
  color: var(--good);
  font-weight: 900;
}
.login-help {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 28px 0 0;
  padding-top: 22px;
  text-align: center;
}
.settings-note {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.7;
  padding: 12px 14px;
}
.auth-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.role-preview-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.role-preview-switcher h3,
.role-preview-switcher p {
  margin: 0;
}

.role-preview-switcher p {
  margin-top: 4px;
}

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

.role-preview-actions form {
  margin: 0;
}

.role-preview-actions .btn[disabled] {
  cursor: default;
  opacity: 1;
}

@media (max-width: 760px) {
  .role-preview-switcher {
    align-items: flex-start;
    flex-direction: column;
  }
}
.auth-status-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}
.auth-status-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.auth-status-item strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
}
.user-permission-form {
  display: contents;
}
.user-permission-form select {
  min-width: 120px;
}
.permission-rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.permission-rule-grid div {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}
.permission-rule-grid strong,
.permission-rule-grid span {
  display: block;
}
.permission-rule-grid span {
  margin-top: 4px;
  color: var(--muted);
}
.alert-list {
  margin: 8px 0 0;
  padding-left: 20px;
}
.alert-list li + li { margin-top: 4px; }

.line-editor-header,
.line-editor {
  display: grid;
  grid-template-columns: 180px minmax(300px, 1.6fr) 92px 116px 92px 116px 88px 88px;
  gap: 8px;
  min-width: 1080px;
}
.line-editor-header.no-cost,
.line-editor.no-cost {
  grid-template-columns: 180px minmax(300px, 1.6fr) 116px 92px 116px 88px 88px;
  min-width: 980px;
}
.order-line-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}
.line-editor-header {
  padding: 0 8px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.line-editor-header div {
  text-align: center;
}
.line-editor {
  align-items: end;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .42);
  backdrop-filter: blur(8px);
  transition: background .14s ease, box-shadow .14s ease, opacity .14s ease, transform .14s ease;
}
.line-editor:not(.has-content):not(:focus-within) {
  opacity: .72;
}
.line-editor.has-content {
  background: rgba(255, 253, 247, .72);
}
.line-editor:focus-within {
  background: var(--glass-active);
  box-shadow: var(--active-shadow);
  opacity: 1;
  transform: translateY(-1px);
  position: relative;
  z-index: 1;
}
.line-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.line-display {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #111827;
  display: flex;
  font-weight: 700;
  min-height: 38px;
  overflow-wrap: anywhere;
  padding: 8px 10px;
}
.line-display.product-name {
  color: #1f2933;
}
.line-field .field-caption {
  display: none;
}
.line-field input,
.line-field select {
  min-width: 0;
  height: 38px;
}
.line-field input[type="number"],
.line-field input[readonly] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.input-with-unit {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}
.input-with-unit span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.edit-line {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(6, 96px);
  gap: 8px;
  margin-bottom: 8px;
}
.line-editor input[readonly] {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
}
.line-helper,
.line-summary {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
  min-height: 28px;
  text-align: right;
}
.line-summary {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  grid-column: 1 / -1;
  margin-top: 2px;
  min-height: 34px;
  padding: 8px 10px;
  text-align: left;
  white-space: normal;
}
.add-line-btn {
  margin-top: 4px;
}
.add-items-head {
  display: flex;
  justify-content: center;
  margin-top: 18px;
  width: 100%;
}
.form-submit-row {
  display: flex;
  justify-content: flex-end;
}
.edit-line input[readonly] { background: #f4f6f9; color: var(--muted); }
.totals-row {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  padding: 12px 0 18px;
  font-variant-numeric: tabular-nums;
}
.totals-row div {
  display: grid;
  gap: 2px;
  min-width: 112px;
  text-align: right;
}
.totals-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.totals-row strong {
  color: #111827;
  font-size: 18px;
}
.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; align-items: start; }
.payments-layout {
  grid-template-columns: minmax(640px, 1.05fr) minmax(560px, .95fr);
}
.selected-payment-order td {
  background: #eef5ff;
  border-bottom-color: #bfd3ff;
}
.selected-payment-order td:first-child {
  border-left: 4px solid var(--accent);
}
.selected-payment-order a {
  font-weight: 850;
}
.selected-order-badge {
  background: var(--accent);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  margin-left: 8px;
  padding: 2px 8px;
  vertical-align: middle;
  white-space: nowrap;
}
.vendor-filter-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  align-items: end;
}
.vendor-flow {
  margin-bottom: 16px;
}
.vendor-draft-table {
  min-width: 1420px;
}
.vendor-draft-table th,
.vendor-draft-table td {
  vertical-align: middle;
}
.vendor-draft-table select {
  min-width: 420px;
}
.vendor-draft-table input:not([type="checkbox"]):not([type="hidden"]) {
  min-width: 140px;
}
.date-field.is-disabled {
  display: none;
}
.customer-layout {
  display: grid;
  gap: 16px;
}
.customer-list-panel .wide-table {
  margin-bottom: 0;
}
.customer-table {
  min-width: 1320px;
  table-layout: fixed;
}
.customer-table th:first-child,
.customer-table td:first-child {
  width: 180px;
}
.customer-table th:nth-child(2),
.customer-table td:nth-child(2) {
  width: 220px;
}
.customer-table th:nth-child(3),
.customer-table td:nth-child(3) {
  width: 180px;
}
.customer-table th:nth-child(4),
.customer-table td:nth-child(4) {
  width: 360px;
}
.customer-table th:nth-child(5),
.customer-table td:nth-child(5) {
  width: 240px;
}
.customer-table th:nth-child(6),
.customer-table td:nth-child(6) {
  width: 250px;
}
.customer-name strong {
  display: block;
  color: #111827;
  font-size: 16px;
  font-weight: 750;
}
.customer-name-row {
  align-items: center;
  display: flex;
  gap: 8px;
}
.customer-row-actions {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
}
.customer-row-actions .btn {
  box-shadow: none;
  min-height: 32px;
  min-width: 64px;
  padding: 6px 10px;
  white-space: nowrap;
}
.btn.is-disabled,
.btn.is-disabled:hover {
  background: #eef2f7;
  border-color: #d6dde8;
  color: #9aa4b2;
  cursor: not-allowed;
  text-decoration: none;
}
.customer-name span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.customer-brands {
  color: #374151;
  line-height: 1.55;
}
.customer-purchase-summary {
  margin-bottom: 16px;
}
.customer-purchase-summary p {
  margin: 0;
  color: #374151;
  font-weight: 700;
}
.danger-zone {
  margin-top: 16px;
  border-color: #fecaca;
}
.danger-zone h2 {
  color: var(--bad);
}
.vendor-check-list {
  display: grid;
  gap: 12px;
}
.vendor-check-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.vendor-check-main {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}
.vendor-check-title {
  color: #111827;
  font-size: 17px;
  font-weight: 800;
}
.vendor-check-status {
  border-radius: 6px;
  background: #f1f5f9;
  font-size: 15px;
  font-weight: 800;
  padding: 8px 10px;
  white-space: nowrap;
}
.vendor-check-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.vendor-check-grid div {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}
.vendor-check-grid span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
}
.vendor-check-grid strong {
  color: #111827;
  display: block;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.vendor-rule,
.vendor-check-reason {
  border-radius: 6px;
  margin-top: 10px;
  padding: 10px 12px;
}
.vendor-rule {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 650;
}
.vendor-check-reason {
  background: #f1f5f9;
  font-weight: 750;
}
.vendor-check-reason span {
  display: block;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.vendor-check-form {
  align-items: end;
  display: grid;
  grid-template-columns: 180px minmax(240px, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}
.vendor-check-action .btn {
  width: 100%;
}
.warning {
  color: #9a3412;
}
.contact-stack {
  display: grid;
  gap: 4px;
  color: #111827;
  font-variant-numeric: tabular-nums;
}
.contact-stack span {
  white-space: nowrap;
}
.customer-address,
.customer-memo {
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.customer-memo {
  color: #334155;
}
.customer-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.customer-form-grid .address-picker,
.customer-form-grid textarea,
.customer-address-edit,
.customer-submit-row {
  grid-column: 1 / -1;
}
.customer-address-picker {
  grid-template-columns: minmax(120px, 140px) minmax(140px, 160px) minmax(170px, 1fr) minmax(96px, .5fr) minmax(96px, .5fr) minmax(96px, .5fr) minmax(104px, .55fr) minmax(104px, .55fr);
}
.customer-submit-row {
  display: flex;
  justify-content: flex-end;
}
.customer-submit-row .btn {
  min-width: 180px;
}
.payment-record-table input,
.payment-record-table select {
  min-width: 0;
  width: 100%;
}
.payment-create-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 180px 120px 150px minmax(0, 1fr);
  max-width: 100%;
}
.payment-create-form input,
.payment-create-form select {
  min-width: 0;
  width: 100%;
}
.payment-create-form .form-row:nth-child(4) {
  grid-column: 1 / -1;
}
.payment-create-action {
  grid-column: 1 / -1;
}
.payment-create-action .btn {
  box-sizing: border-box;
  width: 100%;
}
.payment-record-table {
  table-layout: fixed;
}
.payment-record-table th:first-child,
.payment-record-table td:first-child {
  width: 150px;
}
.payment-record-table th:nth-child(2),
.payment-record-table td:nth-child(2) {
  width: 110px;
}
.payment-record-table th:nth-child(3),
.payment-record-table td:nth-child(3) {
  width: 82px;
}
.payment-record-table th:nth-child(5),
.payment-record-table td:nth-child(5) {
  width: 118px;
}
.payment-record-table th:nth-child(6),
.payment-record-table td:nth-child(6) {
  width: 112px;
}
.payment-record-table .payment-date {
  width: 128px;
}
.payment-record-table .payment-type {
  width: 64px;
}
.payment-record-table .payment-amount {
  text-align: right;
  width: 96px;
}
.payment-record-table .table-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.shipment-record-groups {
  border-top: 0;
}
.shipment-record-group {
  border-bottom: 0;
  padding: 0;
}
.shipment-record-group + .shipment-record-group {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 8px;
}
.shipment-record-group.is-editing {
  border-left: 4px solid var(--accent);
  padding-left: 12px;
}
.shipment-record-group-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 12px 0;
}
.shipment-record-identity {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.shipment-record-identity h3 {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1.35;
  margin: 0;
}
.shipment-record-identity span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.shipment-record-group-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}
.shipment-record-group-actions form {
  margin: 0;
}
.shipment-record-group-actions .btn {
  box-shadow: none;
  font-size: 14px;
  font-weight: 600;
  min-height: 34px;
  padding: 6px 12px;
  white-space: nowrap;
}
.shipment-record-group-actions .btn:hover {
  box-shadow: none;
  transform: none;
}
.shipment-record-grid-wrap {
  overflow-x: auto;
}
.shipment-record-grid {
  min-width: 1240px;
}
.shipment-record-grid-head,
.shipment-record-grid-row {
  display: grid;
  grid-template-columns: 60px 260px 72px 118px minmax(180px, 240px) 110px minmax(320px, 1fr);
}
.shipment-record-grid-head {
  border-top: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  padding: 8px 0;
}
.shipment-record-grid-row {
  align-items: start;
  border-top: 0;
  font-size: 15px;
  line-height: 1.45;
  padding: 10px 0;
}
.shipment-record-grid-head > *,
.shipment-record-grid-row > * {
  min-width: 0;
  padding-right: 14px;
}
.shipment-record-grid-row > strong {
  font-weight: 600;
}
.shipment-record-grid-items,
.shipment-record-grid-quantities {
  display: grid;
  gap: 3px;
}
.shipment-record-grid-items span {
  white-space: nowrap;
}
.shipment-record-grid-quantities strong {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.shipment-record-grid-address {
  overflow-wrap: anywhere;
}
.shipment-record-empty {
  padding: 16px 0;
}

/* Order detail uses a restrained ERP hierarchy: white data surfaces, one body
   size, and color reserved for status and actions. */
.order-detail-page .panel,
.order-detail-page .card {
  background: #fff;
  backdrop-filter: none;
  box-shadow: 0 1px 2px rgba(31, 41, 51, .05);
}
.order-detail-page .panel:focus-within,
.order-detail-page .card:focus-within {
  background: #fff;
}
.order-detail-page .order-balance-status {
  background: #fff;
  border-color: var(--line);
  border-left: 4px solid var(--good);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}
.order-detail-page .order-detail-metrics {
  gap: 12px;
}
.order-detail-page .order-detail-metrics .card {
  padding: 14px 16px;
}
.order-detail-page .metric .label {
  font-size: 14px;
  font-weight: 600;
}
.order-detail-page .metric .value {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1.2;
  margin-top: 4px;
}
.order-detail-page .order-lines-table tbody tr {
  background: #fff;
}
.order-detail-page .order-lines-table tbody td,
.order-detail-page .order-lines-table .order-brand,
.order-detail-page .order-lines-table .order-product,
.order-detail-page .order-lines-table .num {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}
.order-detail-page .order-lines-table tbody td {
  border-bottom-color: var(--line);
}
.order-detail-page .order-lines-table .order-product {
  font-weight: 600;
}
.order-detail-page .order-lines-table th {
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.order-detail-page .order-lines-table .pending-shipment-head {
  color: var(--muted);
}
.order-actions-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, .8fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}
.ship-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 8px;
  margin-bottom: 8px;
}
.ship-line input[readonly] { background: #f4f6f9; color: var(--muted); }
.shipment-edit-lines {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.shipment-edit-line {
  align-items: center;
  background: rgba(255, 255, 255, .64);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.2fr) 190px;
  padding: 12px 14px;
}
.shipment-edit-product {
  color: #111827;
  font-size: 16px;
  font-weight: 650;
}
.shipment-edit-summary {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
.shipment-edit-quantity {
  align-items: center;
  color: var(--muted);
  display: grid;
  gap: 6px;
  grid-template-columns: auto minmax(70px, 1fr) auto;
  font-size: 13px;
  font-weight: 750;
}
.shipment-edit-quantity input {
  font-size: 16px;
  font-weight: 750;
  min-width: 0;
  text-align: right;
}
.compact-shipment-form {
  display: grid;
  gap: 14px;
  max-width: 1050px;
  width: 100%;
}
.compact-shipment-form .form-row > label,
.compact-shipment-form .address-field > label {
  font-size: 16px;
  font-weight: 650;
}
.compact-shipment-form input,
.compact-shipment-form select {
  font-size: 18px;
  min-height: 46px;
  padding: 9px 11px;
}
.shipment-grid {
  display: grid;
  gap: 10px;
}
.timing-grid {
  grid-template-columns: 180px 220px 220px 220px;
}
.recipient-grid {
  grid-template-columns: 160px 180px 180px minmax(260px, 1fr);
}
.recipient-grid .address-field {
  grid-column: 1 / -1;
}
.shipment-items h2 {
  margin-top: 2px;
  margin-bottom: 8px;
}
.compact-adjust-head {
  align-items: center;
  margin-bottom: 8px;
}
.compact-adjust-head h2 {
  margin: 0;
}
.compact-adjust-meta {
  font-size: 13px;
  margin-top: 2px;
}
.compact-adjust-items {
  margin-top: 2px;
}
.active-edit-panel {
  border-color: rgba(37, 99, 235, .8);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .14), var(--shadow);
}
.active-edit-panel:target {
  border-color: var(--accent);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, .18), var(--shadow);
}
.shipment-items .ship-line {
  grid-template-columns: minmax(220px, 1fr) 300px 90px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.shipment-brand-picker .ship-line {
  border-bottom: 0;
  margin-bottom: 0;
}
.shipment-brand-head {
  align-items: center;
  margin-bottom: 4px;
  max-width: 1050px;
}
.shipment-brand-head h2 {
  margin: 0 0 4px;
}
.shipment-line-action {
  justify-self: end;
  min-width: 72px;
  text-align: center;
}
.shipment-brand-warning {
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 8px;
  color: #9a3412;
  font-weight: 700;
  padding: 10px 12px;
}
.shipment-allocation-summary {
  background: #f8fafc;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}
.shipment-allocation-summary h2 {
  font-size: 20px;
  margin: 0 0 4px;
}
.shipment-allocation-line {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 440px) auto;
  justify-content: space-between;
  padding: 9px 0;
}
.shipment-allocation-line .ship-item-label,
.shipment-allocation-line .ship-item-status strong,
.shipment-allocation-line .ship-item-status span {
  font-size: 16px;
}
.shipment-allocation-line .ship-item-label {
  font-size: 18px;
}
.shipment-allocation-line.is-over-allocated {
  background: #fef2f2;
  color: #b91c1c;
}
.shipment-allocation-line.is-over-allocated strong,
.shipment-allocation-line.is-over-allocated [data-unallocated] {
  color: #b91c1c;
}
.shipment-destinations {
  display: grid;
  gap: 14px;
}
.shipment-destination-card {
  border: 1px solid #dbe3ef;
  border-radius: 9px;
  padding: 16px 18px;
}
.shipment-destination-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 6px;
}
.shipment-destination-head h3 {
  font-size: 20px;
  margin: 0;
}
.shipment-destination-head .remove-destination {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #b42318;
  font-size: 16px;
  min-height: 44px;
  min-width: 0;
  padding: 6px 8px;
}
.shipment-destination-head .remove-destination:hover {
  background: #fff1f0;
  color: #912018;
}
.destination-quantity-list {
  display: grid;
  gap: 2px;
}
.destination-quantity-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(240px, 420px) auto;
  justify-content: start;
  column-gap: 36px;
  padding: 9px 0;
}
.destination-quantity-row label {
  color: #111827;
  font-size: 18px;
  font-weight: 750;
}
.destination-quantity-control {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 8px;
  font-weight: 650;
  font-size: 16px;
}
.destination-quantity-control input {
  font-size: 19px;
  font-weight: 750;
  width: 90px;
}
.destination-remaining {
  color: var(--accent);
  font-size: 16px;
  font-weight: 750;
  margin-left: 8px;
  min-width: 92px;
  white-space: nowrap;
}
.destination-remaining.is-over-allocated {
  color: #b91c1c;
}
.shipment-simple-info {
  border-top: 1px solid #e2e8f0;
  display: grid;
  gap: 16px;
  margin-top: 4px;
  padding-top: 16px;
}
.shipment-recipient-summary {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: 220px 240px auto;
  justify-content: start;
}
.shipment-recipient-summary > div {
  display: grid;
  gap: 3px;
}
.shipment-recipient-summary span {
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}
.shipment-recipient-summary strong {
  font-size: 18px;
}
.shipment-recipient-summary .btn {
  min-height: 44px;
  min-width: 0;
}
.shipment-recipient-summary .edit-recipient {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #475569;
  font-size: 16px;
  padding: 6px 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.shipment-recipient-summary .edit-recipient:hover {
  color: var(--accent);
}
.shipment-recipient-editor {
  background: #f8fafc;
  border-radius: 7px;
  display: grid;
  gap: 12px;
  grid-template-columns: 220px 240px 240px;
  padding: 12px;
}
.shipment-recipient-editor[hidden] {
  display: none;
}
.shipment-simple-address {
  gap: 10px;
  max-width: 720px;
}
.shipment-address-options label {
  font-size: 16px;
  font-weight: 750;
  min-height: 40px;
}
.shipment-address-options input {
  height: 22px;
  width: 22px;
}
.shipment-simple-address .readonly-address {
  border: 0;
  border-left: 4px solid #cbd5e1;
  font-size: 17px;
  min-height: 46px;
  padding: 11px 14px;
  width: 100%;
}
.shipment-simple-address .other-address-fields {
  grid-template-columns: 130px 150px 190px 220px;
}
.shipment-more-details {
  margin-top: 4px;
}
.shipment-more-details summary {
  color: #334155;
  cursor: pointer;
  font-size: 16px;
  font-weight: 750;
  padding: 10px 0 2px;
}
.shipment-more-details summary span {
  color: var(--muted);
  font-weight: 600;
}
.shipment-more-body {
  display: grid;
  gap: 12px;
  max-width: 900px;
  padding: 14px 0 2px;
}
.shipment-more-body > .form-row {
  max-width: 720px;
}
.shipment-batch-actions {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(180px, 1fr) auto;
}
.shipment-batch-error {
  color: #b91c1c;
  font-weight: 700;
}
.shipment-submit-review {
  color: var(--muted);
  display: grid;
  font-size: 16px;
  gap: 3px;
  justify-items: end;
}
.shipment-submit-review strong {
  color: var(--text);
}
#batch-shipment-submit {
  font-size: 18px;
  min-height: 50px;
  min-width: 190px;
}
@media (max-width: 760px) {
  .shipment-record-group-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
.ship-item-label {
  color: #111827;
  font-size: 16px;
  font-weight: 750;
}
.ship-item-status {
  color: var(--muted);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ship-item-status strong {
  color: var(--accent);
  font-weight: 750;
}
.ship-item-status span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.shipment-info-details {
  background: transparent;
}
.shipment-info-details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 750;
  padding: 10px 0;
}
.shipment-info-details summary:hover {
  color: var(--accent);
}
.shipment-info-body {
  display: grid;
  gap: 12px;
  padding: 8px 0 4px;
}
.shipment-footer {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 140px;
  gap: 10px;
  align-items: end;
}
.shipment-submit-row {
  grid-template-columns: 140px;
  justify-content: end;
}
.document-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
}
.document-actions {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.document-back-actions,
.document-tool-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.document-tool-actions {
  justify-content: flex-end;
}
.document-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
  box-shadow: var(--soft-shadow);
}
.document-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 2px solid #111827;
  padding-bottom: 18px;
  margin-bottom: 22px;
}
.document-header h1 {
  font-size: 26px;
  margin-bottom: 8px;
}
.document-header h2 {
  font-size: 20px;
  margin: 0;
}
.document-no {
  text-align: right;
  font-size: 20px;
  font-weight: 800;
}
.document-no span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  margin-top: 6px;
}
.document-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .7fr);
  gap: 20px;
  margin-bottom: 22px;
}
.document-grid h3,
.document-note h3 {
  color: #111827;
  font-size: 15px;
  margin: 0 0 8px;
}
.document-grid p,
.document-note p {
  margin: 4px 0;
  line-height: 1.55;
}
.document-table {
  table-layout: fixed;
}
.document-table th:first-child,
.document-table td:first-child {
  width: 120px;
}
.document-table th:nth-child(2),
.document-table td:nth-child(2) {
  width: 280px;
}
.document-note {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.document-share-note {
  margin-top: 12px;
}
.document-delivery-section {
  border-top: 2px solid #111827;
  margin-top: 24px;
  padding-top: 18px;
}
.document-delivery-section > h3 {
  font-size: 18px;
  margin: 0 0 12px;
}
.document-delivery-list,
.shipment-preview-destinations {
  display: grid;
  gap: 14px;
}
.document-delivery-card,
.shipment-preview-destination {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.document-delivery-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}
.document-delivery-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.document-delivery-meta,
.shipment-preview-logistics {
  display: grid;
  gap: 12px 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.document-delivery-meta span,
.document-delivery-address span,
.shipment-preview-summary span,
.shipment-preview-logistics span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 3px;
}
.document-delivery-address {
  margin-top: 12px;
}
.document-delivery-address strong,
.shipment-preview-address strong {
  line-height: 1.45;
}
.document-delivery-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
}
.document-delivery-items span {
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}
.document-delivery-remark,
.document-delivery-empty {
  margin: 12px 0 0;
}
.shipment-preview-summary {
  background: #f8fafc;
  border-radius: 8px;
  display: grid;
  gap: 14px 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
  padding: 16px;
}
.shipment-preview-destination > h3 {
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  margin: 0 0 14px;
  padding-bottom: 10px;
}
.shipment-preview-logistics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.shipment-preview-summary strong,
.shipment-preview-logistics strong,
.shipment-preview-items tbody td {
  font-weight: 400;
}
.shipment-preview-address {
  grid-column: span 3;
}
.shipment-preview-remark {
  grid-column: 1 / -1;
}
.shipment-preview-remark strong {
  line-height: 1.45;
  white-space: pre-wrap;
}
.shipment-preview-items {
  margin-top: 16px;
  table-layout: fixed;
}
.shipment-preview-items th:last-child,
.shipment-preview-items td:last-child {
  width: 130px;
}
@media (max-width: 720px) {
  .document-delivery-meta,
  .shipment-preview-summary,
  .shipment-preview-logistics {
    grid-template-columns: 1fr 1fr;
  }
  .shipment-preview-address {
    grid-column: span 2;
  }
}
.inline-check {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-weight: 700;
  gap: 6px;
  white-space: nowrap;
}
.vendor-filter {
  grid-template-columns: 180px repeat(4, 150px) minmax(220px, 1fr) auto;
}
.vendor-filter .compact-date {
  min-width: 0;
}
.vendor-statement-meta {
  grid-template-columns: 180px 150px 150px minmax(260px, 1fr);
  margin-bottom: 14px;
}
.recon-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  margin: 10px 0 14px;
}
.recon-summary-card {
  background: #f8fafc;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 10px 12px;
}
.recon-summary-card span {
  color: #64748b;
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}
.recon-summary-card strong {
  color: #111827;
  display: block;
  font-size: 24px;
  line-height: 1;
}
.recon-summary-card.good {
  background: #f0fdfa;
  border-color: #99f6e4;
}
.recon-summary-card.warning {
  background: #fffbeb;
  border-color: #fde68a;
}
.recon-summary-card.danger {
  background: #fef2f2;
  border-color: #fecaca;
}
.vendor-recon-table {
  min-width: 980px;
}
.vendor-recon-table th,
.vendor-recon-table td {
  vertical-align: middle;
}
.vendor-recon-table input[type="checkbox"] {
  height: 18px;
  width: 18px;
}
.vendor-recon-table tr.has-ai-match td {
  background: #fffdf8;
  border-bottom-color: #e2e8f0;
}
.vendor-recon-table tr.needs-attention td {
  background: #fff7ed;
}
.vendor-recon-table tr.has-ai-match td:first-child {
  border-left: 3px solid #f59e0b;
}
.vendor-recon-table tr.system-compare-row td {
  border-bottom-color: #eef2f7;
}
.vendor-recon-table tr.vendor-claim-row td {
  background: #fffaf3;
  border-top: 0;
  color: #334155;
  font-weight: 500;
  padding-top: 8px;
}
.vendor-recon-table tr.vendor-claim-row td a,
.vendor-recon-table tr.vendor-claim-row td strong {
  font-weight: 600;
}
.vendor-recon-table tr.vendor-claim-row .recon-verdict strong,
.vendor-recon-table tr.vendor-claim-row .ai-warning {
  font-weight: 900;
}
.vendor-recon-table tr.vendor-claim-row td:first-child {
  border-left: 3px solid #f59e0b;
  color: #f59e0b;
  font-weight: 900;
  text-align: center;
}
.vendor-recon-table tr.vendor-claim-row.no-ai td {
  background: #f8fafc;
}
.draft-review-table-wrap {
  margin: 14px 0;
}
.draft-review-table {
  min-width: 1380px;
}
.draft-review-table th,
.draft-review-table td {
  vertical-align: top;
}
.draft-review-table input,
.draft-review-table textarea {
  font-size: 14px;
  min-width: 0;
  width: 100%;
}
.draft-review-table textarea {
  margin-top: 6px;
  min-height: 48px;
  resize: vertical;
}
.draft-review-table td:nth-child(1) { min-width: 138px; }
.draft-review-table td:nth-child(2),
.draft-review-table td:nth-child(3) { min-width: 130px; }
.draft-review-table td:nth-child(4) { min-width: 128px; }
.draft-review-table td:nth-child(5) { min-width: 160px; }
.draft-review-table td:nth-child(11) { min-width: 260px; }
.source-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  padding: 7px 10px;
  white-space: nowrap;
}
.source-pill.system {
  background: #e0f2fe;
  color: #0369a1;
}
.source-pill.vendor {
  background: #ffedd5;
  color: #c2410c;
}
.source-pill.muted-pill {
  background: #e2e8f0;
  color: #64748b;
}
.compare-connector {
  display: inline-block;
  font-size: 20px;
  line-height: 1;
  transform: translateY(-1px);
}
.status-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  padding: 7px 10px;
  white-space: nowrap;
}
.status-pill.good {
  background: #ccfbf1;
  color: #0f766e;
}
.status-pill.warning {
  background: #fef3c7;
  color: #92400e;
}
.status-pill.danger {
  background: #fee2e2;
  color: #b91c1c;
}
.status-pill.neutral {
  background: #e2e8f0;
  color: #334155;
}
.recon-verdict {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.recon-verdict strong,
.recon-verdict span {
  display: inline-flex;
}
.verdict-item {
  align-items: baseline;
  color: #334155;
  gap: 4px;
  white-space: nowrap;
}
.verdict-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.verdict-detail {
  display: inline-block;
  margin-top: 0;
  max-width: none;
  white-space: nowrap;
}
.warning-text {
  color: #b45309;
}
.recon-detail {
  color: #64748b;
  font-size: 13px;
  margin-top: 5px;
  max-width: 520px;
}
.recon-detail summary {
  color: #475569;
  cursor: pointer;
  font-weight: 800;
}
.recon-detail div {
  margin-top: 3px;
}
.ai-under-row td {
  border-top: 0;
  padding-bottom: 8px;
  padding-top: 8px;
}
.ai-under-row td:first-child {
  background: #fffaf3;
  border-left: 4px solid #f59e0b;
}
.ai-child-cell {
  background: #fffaf3;
  color: #111827;
  font-size: 14px;
  line-height: 1.35;
  position: relative;
  vertical-align: top;
}
.ai-child-select {
  align-items: center;
  background: #fffaf3;
  display: flex;
  gap: 8px;
  min-height: 42px;
  padding-left: 28px;
  position: relative;
}
.ai-connector {
  border-bottom: 2px solid #fbbf24;
  border-left: 2px solid #fbbf24;
  height: 22px;
  left: 10px;
  position: absolute;
  top: 0;
  width: 14px;
}
.ai-inline {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}
.ai-child-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.ai-child-tag {
  background: #f97316;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  margin-left: 5px;
  padding: 2px 7px;
  vertical-align: middle;
}
.ai-apply {
  align-items: center;
  color: #111827;
  display: inline-flex;
  font-weight: 800;
  gap: 8px;
}
.ai-money-grid {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(120px, 160px)) minmax(180px, 1fr) minmax(260px, 2fr);
}
.ai-money-grid label {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}
.ai-money-grid input {
  margin-top: 4px;
}
.ai-note {
  min-width: 260px;
}
.ai-warning {
  display: inline-block;
  margin-right: 10px;
}
.ai-compact-note {
  color: #111827;
  font-weight: 800;
  margin-bottom: 3px;
}
.ai-raw-text {
  font-size: 12px;
  margin-top: 3px;
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-readonly-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(110px, 1fr)) minmax(220px, 2fr);
}
.ai-readonly-grid div {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
}
.ai-readonly-grid span {
  color: #64748b;
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 3px;
}
.ai-readonly-grid strong {
  color: #111827;
  font-size: 15px;
}
.unmatched-ai {
  border-top: 1px solid #dbe3ef;
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
}
.money-input {
  min-width: 0;
  text-align: right;
  width: 110px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090b;
  --panel: #121214;
  --surface: #151518;
  --surface-muted: #1a1a1e;
  --surface-soft: #222226;
  --strong: #f5f5f6;
  --text: #e5e5e7;
  --muted: #a8a8b0;
  --label: #b8b8bf;
  --placeholder: #85858f;
  --field-bg: #18181b;
  --field-border: #3b3b42;
  --glass-bg: rgba(21, 21, 24, .94);
  --glass-active: rgba(28, 28, 32, .98);
  --soft-shadow: 0 18px 44px rgba(0, 0, 0, .24);
  --active-shadow: 0 16px 34px rgba(0, 0, 0, .34);
  --order-bg: #1c1a15;
  --order-line: #4c4430;
  --order-accent: #f0c36a;
  --line: #303036;
  --accent: #82aaff;
  --accent-weak: #1b2740;
  --good: #5eead4;
  --bad: #ff8a80;
  --topbar-bg: rgba(9, 9, 11, .94);
  --body-gradient: linear-gradient(180deg, rgba(18, 18, 20, .98), rgba(9, 9, 11, 1) 300px);
  --danger-soft: #351d20;
  --warning-soft: #332719;
}

html[data-theme="dark"] .page-loading {
  background: rgba(0, 0, 0, .42);
}
html[data-theme="dark"] .page-loading-spinner {
  border-color: #35445a;
  border-top-color: var(--accent);
}
html[data-theme="dark"] .metric-note-link {
  text-decoration-color: #66758a;
}
html[data-theme="dark"] .shipment-order-row td,
html[data-theme="dark"] .selected-payment-order td {
  background: #1c3151;
  border-bottom-color: #345071;
}
html[data-theme="dark"] .shipment-child-row td,
html[data-theme="dark"] .vendor-check-card,
html[data-theme="dark"] .order-detail-page .panel,
html[data-theme="dark"] .order-detail-page .card,
html[data-theme="dark"] .order-detail-page .panel:focus-within,
html[data-theme="dark"] .order-detail-page .card:focus-within,
html[data-theme="dark"] .order-detail-page .order-balance-status,
html[data-theme="dark"] .order-detail-page .order-lines-table tbody tr,
html[data-theme="dark"] .order-detail-page .order-lines-table th {
  background: var(--surface);
}
html[data-theme="dark"] :is(
  .readonly-address,
  .line-display,
  .line-summary,
  .vendor-check-status,
  .vendor-check-grid div,
  .vendor-rule,
  .vendor-check-reason,
  .shipment-allocation-summary,
  .shipment-recipient-editor,
  .recon-summary-card,
  .btn.is-disabled,
  .line-editor input[readonly],
  .edit-line input[readonly],
  .ship-line input[readonly]
) {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--text);
}
html[data-theme="dark"] :is(
  .auth-status-item,
  .permission-rule-grid div,
  .line-editor,
  .shipment-edit-line
) {
  background: var(--glass-bg);
}
html[data-theme="dark"] .line-editor.has-content {
  background: #27251e;
}
html[data-theme="dark"] :is(
  .summary-card strong,
  .customer-name strong,
  .order-product,
  .order-lines-table .num,
  .totals-row strong,
  .vendor-check-title,
  .vendor-check-grid strong,
  .contact-stack,
  .shipment-edit-product,
  .recon-summary-card strong,
  .ai-child-cell
) {
  color: var(--strong);
}
html[data-theme="dark"] :is(
  .shipment-brand-cell,
  .order-brand,
  .customer-brands,
  .customer-purchase-summary p,
  .customer-memo,
  .shipment-more-details summary,
  .verdict-item,
  .recon-detail summary
) {
  color: var(--text);
}
html[data-theme="dark"] .info-alert {
  background: #203354;
  border-color: #405f91;
  color: #b8ccff;
}
html[data-theme="dark"] .bad-alert,
html[data-theme="dark"] .row-danger td,
html[data-theme="dark"] .shipment-allocation-line.is-over-allocated {
  background: var(--danger-soft);
  border-color: #754047;
  color: #ffb4ad;
}
html[data-theme="dark"] .warning-alert,
html[data-theme="dark"] .row-warning td,
html[data-theme="dark"] .shipment-brand-warning,
html[data-theme="dark"] .ai-inline,
html[data-theme="dark"] .vendor-recon-table tr.needs-attention td {
  background: var(--warning-soft);
  border-color: #7a5830;
  color: #ffd19a;
}
html[data-theme="dark"] .dashboard-task-card.needs-action {
  background: #1d1416;
}
html[data-theme="dark"] .dashboard-task-card.needs-attention {
  background: #1d1a13;
}
html[data-theme="dark"] .recon-summary-card.good {
  background: #173631;
  border-color: #2f6a61;
}
html[data-theme="dark"] .recon-summary-card.warning {
  background: #3a3019;
  border-color: #735f2d;
}
html[data-theme="dark"] .recon-summary-card.danger {
  background: #3a2024;
  border-color: #754047;
}
html[data-theme="dark"] .vendor-recon-table tr.has-ai-match td,
html[data-theme="dark"] .vendor-recon-table tr.vendor-claim-row td,
html[data-theme="dark"] .ai-under-row td:first-child,
html[data-theme="dark"] .ai-child-cell,
html[data-theme="dark"] .ai-child-select {
  background: #2a271e;
  border-bottom-color: var(--line);
  color: var(--text);
}
html[data-theme="dark"] .vendor-recon-table tr.vendor-claim-row.no-ai td {
  background: var(--surface-muted);
}

@media print {
  @page {
    margin: 14mm;
    size: A4;
  }
  body {
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .no-print {
    display: none !important;
  }
  .document-page {
    max-width: none;
    padding: 0;
  }
  .document-sheet {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
}

@media (max-width: 1400px) {
  .topbar {
    gap: 14px;
    padding: 12px 18px;
  }
  .brand {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .nav {
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: flex-end;
  }
  .nav a {
    font-size: 14px;
    padding: 6px 5px;
    white-space: nowrap;
  }
  .nav-user {
    font-size: 12px;
    white-space: nowrap;
  }
}

@media (max-width: 820px) {
  .grid.cols-4, .grid.cols-2, .split, .form-grid, .order-actions-grid { grid-template-columns: 1fr; }
  .login-page .page {
    padding: 28px 22px 48px;
  }
  .login-shell {
    gap: 36px;
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 32px;
  }
  .login-intro,
  .login-panel {
    margin: 0 auto;
    max-width: 600px;
  }
  .login-intro h1 {
    font-size: 42px;
  }
  .login-benefits {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .login-benefits li {
    align-items: flex-start;
    font-size: 15px;
  }
  .product-filters {
    display: grid;
    grid-template-columns: 1fr;
  }
  .product-filters .filter-search,
  .product-filters .filter-brand,
  .product-filters .filter-status,
  .product-filters .filter-year,
  .product-filters .filter-month,
  .product-filters .filter-month-wide,
  .product-filters .filter-actions {
    flex: none;
    min-width: 0;
  }
  .shipment-filters {
    display: grid;
    grid-template-columns: 1fr;
  }
  .shipment-filter-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }
  .shipment-filter-year,
  .shipment-filter-status,
  .shipment-filter-basis,
  .shipment-filter-month,
  .shipment-filter-day {
    width: auto;
  }
  .shipment-filter-actions {
    grid-column: 1 / -1;
  }
  .customer-form-grid { grid-template-columns: 1fr; }
  .customer-search {
    width: 100%;
  }
  .customer-search input {
    min-width: 0;
    flex: 1 1 220px;
  }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-welcome {
    align-items: flex-start;
    flex-direction: column;
  }
  .dashboard-quick-actions {
    justify-content: flex-start;
  }
  .dashboard-period-panel {
    align-items: stretch;
    grid-template-columns: 1fr;
  }
  .dashboard-period-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-period-filter .btn {
    align-self: end;
  }
  .dashboard-task-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-performance-grid,
  .dashboard-highlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .page-head { align-items: flex-start; flex-direction: column; }
  .dashboard-actions { justify-content: flex-start; width: 100%; }
  .period-filter { width: 100%; }
  .period-filter select { flex: 1 1 120px; }
  .shipment-edit-line {
    grid-template-columns: 1fr;
  }
  .shipment-edit-quantity {
    max-width: 240px;
  }
  .line-editor-header { display: none; }
  .order-meta-grid { grid-template-columns: 1fr; }
  .line-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    gap: 10px;
    padding: 12px;
  }
  .line-field .field-caption { display: block; }
  .line-field.brand-field,
  .line-field.product-field { grid-column: 1 / -1; }
  .edit-line { grid-template-columns: 1fr 1fr; }
  .ship-line { grid-template-columns: 1fr; }
  .timing-grid,
  .recipient-grid,
  .shipment-footer,
  .shipment-items .ship-line,
  .shipment-recipient-summary,
  .shipment-recipient-editor { grid-template-columns: 1fr; }
  .shipment-allocation-line,
  .destination-quantity-row,
  .shipment-batch-actions {
    grid-template-columns: 1fr;
  }
  .shipment-allocation-line .ship-item-status,
  .destination-quantity-control {
    justify-content: flex-start;
  }
  .shipment-batch-error {
    text-align: left;
  }
  .shipment-submit-review {
    justify-items: start;
  }
  .address-picker, .other-address-fields { grid-template-columns: 1fr; }
  .customer-address-picker { grid-template-columns: 1fr; }
  .vendor-filter,
  .vendor-statement-meta {
    grid-template-columns: 1fr;
  }
  .recon-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vendor-check-main { flex-direction: column; }
  .vendor-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vendor-check-form { grid-template-columns: 1fr; }
  .totals-row { align-items: flex-end; flex-direction: column; gap: 6px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .nav {
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .page { padding: 14px; }
  .panel, .card { padding: 12px; }
  h1 { font-size: 22px; }
  .login-topbar {
    align-items: center;
    flex-direction: row;
    padding: 12px 18px;
  }
  .login-topbar .nav {
    margin-left: auto;
    width: auto;
  }
  .login-topbar .theme-picker label {
    display: none;
  }
  .login-page .page {
    padding: 22px 18px 36px;
  }
  .login-shell {
    gap: 28px;
    padding-top: 18px;
  }
  .login-intro h1 {
    font-size: 36px;
  }
  .login-intro > p {
    font-size: 17px;
    margin: 18px 0 22px;
  }
  .login-benefits {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .login-panel {
    padding: 26px 22px;
  }
  .login-panel h2 {
    font-size: 27px;
  }
  .dashboard-kpis {
    grid-template-columns: 1fr;
  }
  .dashboard-welcome h1 {
    font-size: 25px;
  }
  .dashboard-quick-actions,
  .dashboard-quick-actions .btn {
    width: 100%;
  }
  .dashboard-period-filter,
  .dashboard-performance-grid,
  .dashboard-highlight-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .period-filter .btn,
  .dashboard-actions > .btn {
    width: 100%;
  }
  .line-editor,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .totals-row {
    align-items: stretch;
  }
  .totals-row div {
    width: 100%;
  }
  .vendor-check-grid {
    grid-template-columns: 1fr;
  }
}
