:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --panel: #ffffff;
  --ink: #17211b;
  --muted: #637066;
  --line: #dce3dd;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #b45309;
  --danger: #b42318;
  --soft-green: #e7f4ef;
  --soft-amber: #fff3d6;
  --soft-red: #fde8e6;
  --shadow: 0 12px 34px rgba(30, 47, 37, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 3vw, 34px);
  background: rgba(245, 247, 244, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: 0;
}

.brand-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-title span {
  color: var(--brand);
  font-size: 15px;
  font-weight: 800;
}

.topbar p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

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

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 22px clamp(14px, 3vw, 34px) 48px;
}

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

.summary-card {
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary-card.total {
  background: #123c35;
  color: #fff;
}

.summary-card span,
.summary-card small {
  display: block;
  color: inherit;
  opacity: 0.72;
}

.summary-card strong {
  display: block;
  margin: 13px 0 8px;
  font-size: clamp(24px, 3.4vw, 38px);
  line-height: 1;
}

.merchant-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 20px 0;
}

.submission-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.submission-panel.compact .submission-list {
  display: none;
}

.submission-panel.compact .submission-search {
  display: none;
}

.submission-panel.expanded .submission-list {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.submission-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.submission-head-actions button {
  min-height: 34px;
  padding: 0 14px;
}

.submission-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 420px;
  min-width: min(520px, 100%);
}

.submission-search input {
  flex: 1 1 auto;
  min-width: 180px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.submission-search button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.submission-search .secondary-button {
  background: var(--soft-green);
  color: var(--ink);
  border: 1px solid var(--line);
}

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

.section-head h2 {
  font-size: 18px;
}

.section-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.section-head span,
.empty-line {
  color: var(--muted);
  font-size: 13px;
}

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

.submission-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) 72px minmax(120px, 1fr) 88px 96px 86px repeat(3, minmax(88px, auto)) 40px;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  font-size: 13px;
}

.submission-row button {
  min-height: 34px;
  padding: 0 10px;
}

.submission-row .submission-delete-action {
  width: 34px;
  min-height: 34px;
  padding: 0;
  color: #9b2c2c;
}

.payout-status {
  display: inline-grid;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  font-weight: 800;
}

.review-status {
  display: inline-grid;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  font-weight: 800;
  padding: 0 10px;
}

.payout-status.pending,
.review-status.pending {
  background: var(--soft-amber);
  color: var(--accent);
}

.payout-status.paid,
.review-status.paid {
  background: var(--soft-green);
  color: var(--brand-dark);
}

.pay-tip,
.pay-identity-notice {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  color: var(--muted);
  line-height: 1.6;
}

.pay-identity-notice.warn {
  border-color: #f4d39a;
  background: var(--soft-amber);
  color: var(--accent);
  font-weight: 700;
}

.pay-identity-notice.ready {
  border-color: rgba(11, 122, 117, 0.22);
  background: var(--soft-green);
  color: var(--brand-dark);
  font-weight: 700;
}

.submission-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.inline-form,
.search-wrap {
  display: flex;
  min-width: 0;
}

.inline-form {
  flex: 1 1 520px;
  gap: 10px;
}

.search-wrap {
  flex: 1 1 360px;
}

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

.amount-field {
  position: relative;
  display: block;
  width: 100%;
}

.amount-field input {
  padding-right: 36px;
}

.amount-field span {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 700;
  pointer-events: none;
}

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

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

button,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

a.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef4f0;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

a.nav-button:hover {
  background: #dfeae4;
}

button:hover,
.file-button:hover {
  background: var(--brand-dark);
}

.secondary-button,
.ghost-button {
  background: #eef4f0;
  color: var(--ink);
  border: 1px solid var(--line);
}

.secondary-button:hover,
.ghost-button:hover {
  background: #dfeae4;
}

.danger-button {
  background: var(--soft-red);
  color: var(--danger);
  border: 1px solid #f5c3bf;
}

.danger-button:hover {
  background: #fbd0cd;
}

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

.merchant-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.merchant-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.merchant-title {
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 22px;
  font-weight: 800;
  background: transparent;
}

.merchant-title:focus {
  box-shadow: none;
  border-bottom: 2px solid var(--brand);
}

.merchant-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.merchant-stats span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f1f5f2;
}

.icon-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  background: #f2f4f2;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover {
  background: var(--soft-red);
  color: var(--danger);
}

.order-form {
  display: grid;
  grid-template-columns: 1.2fr 1.3fr 0.9fr 1.3fr auto;
  gap: 8px;
  align-items: center;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbf9;
}

.segmented label {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.segmented input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.segmented span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 0 8px;
}

.segmented input:checked + span {
  background: var(--brand);
  color: #fff;
}

.segmented label:has(input[value="missing"]) {
  color: var(--danger);
  font-size: 15px;
}

.segmented input[value="missing"]:checked + span {
  background: var(--danger);
  color: #fff;
}

.batch-panel {
  display: grid;
  gap: 9px;
}

.batch-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.batch-requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, auto)) minmax(220px, 1fr);
  gap: 8px;
  grid-column: 1 / -1;
}

.delete-missing-orders {
  grid-column: 1;
  width: fit-content;
  min-width: 142px;
}

.batch-requirements label,
.bulk-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
  color: var(--ink);
}

.batch-requirements input[type="checkbox"],
.bulk-check input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef4f0;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.secondary-link:hover {
  background: #dfeae4;
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.order-list {
  display: grid;
  gap: 8px;
  max-height: 460px;
  overflow: auto;
  padding-right: 2px;
}

.order-list.search-active {
  padding: 8px;
  border: 1px solid #f3c56b;
  border-radius: 8px;
  background: #fff8e6;
}

.order-row {
  display: grid;
  grid-template-columns: 1fr 110px 90px 58px;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.order-row input {
  min-height: 34px;
  padding: 7px 8px;
}

.tag {
  display: inline-grid;
  min-height: 32px;
  place-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: default;
  user-select: none;
}

.tag.provided {
  background: var(--soft-green);
  color: #106452;
}

.tag.missing {
  background: var(--soft-amber);
  color: var(--accent);
}

.empty-state {
  display: none;
  min-height: 280px;
  place-items: center;
  border: 1px dashed #b8c6bd;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
}

.empty-state.show {
  display: grid;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #17211b;
  color: #fff;
  box-shadow: var(--shadow);
  transition: 0.18s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 18, 16, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.detail-modal {
  width: min(860px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.18);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-size: 20px;
}

.modal-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.detail-rows {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding: 16px 18px;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 130px minmax(220px, 1.3fr);
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
}

.detail-row strong {
  overflow-wrap: anywhere;
}

.detail-bulk-panel {
  display: grid;
  gap: 14px;
  padding: 4px 0;
}

.detail-bulk-summary {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
}

.detail-bulk-summary strong {
  font-size: 18px;
}

.detail-bulk-summary span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.detail-bulk-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.detail-bulk-panel input {
  min-height: 46px;
  font-size: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.settings-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  font-weight: 700;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.settings-link-row {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.settings-link-row input {
  color: var(--ink);
}

.settings-note-row {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.settings-note-row textarea {
  min-height: 96px;
  resize: vertical;
  color: var(--ink);
  line-height: 1.6;
}

.user-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 42%),
    var(--bg);
}

.home-link {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.home-link:hover {
  background: var(--soft-green);
  border-color: rgba(11, 122, 117, 0.28);
}

.user-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.user-card {
  width: min(560px, 100%);
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-login-page {
  background:
    radial-gradient(circle at 18% 16%, rgba(220, 38, 38, 0.18), transparent 34%),
    linear-gradient(135deg, #fff1f2 0%, #fff7f7 46%, #f8fafc 100%);
}

.admin-login-card {
  border-color: rgba(185, 28, 28, 0.34);
  box-shadow: 0 18px 46px rgba(127, 29, 29, 0.16);
}

.admin-login-card .user-head h1 {
  color: #991b1b;
}

.admin-login-card .customer-form button {
  background: #dc2626;
  color: #fff;
}

.admin-login-card .customer-form button:hover {
  background: #b91c1c;
}

.admin-login-card input:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.user-head {
  margin-bottom: 18px;
}

.user-head p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}

#merchantNotice {
  padding: 10px 12px;
  border: 1px solid rgba(11, 122, 117, 0.22);
  border-radius: 6px;
  background: var(--soft-green);
  color: var(--brand-dark);
  font-weight: 700;
}

.customer-form {
  display: grid;
  gap: 13px;
}

.customer-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

.customer-form label span {
  font-weight: 700;
}

.customer-form button {
  width: 100%;
  margin-top: 4px;
}

.requirement-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(11, 122, 117, 0.24);
  border-radius: 6px;
  background: #fbfdfc;
}

.requirement-panel[hidden] {
  display: none;
}

.requirement-panel strong {
  color: var(--brand-dark);
  font-size: 16px;
}

.requirement-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.upload-field {
  display: grid;
  gap: 8px;
  cursor: pointer;
}

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

.upload-box {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 82px;
  padding: 14px;
  border: 1px dashed rgba(11, 122, 117, 0.45);
  border-radius: 8px;
  background: var(--soft-green);
  color: var(--brand-dark);
  text-align: center;
}

.upload-box strong {
  font-size: 17px;
}

.upload-box small {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.customer-result {
  min-height: 22px;
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.customer-result.success {
  color: var(--brand-dark);
  font-weight: 700;
}

.customer-result.error {
  color: var(--danger);
  font-weight: 700;
}

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

  .merchant-toolbar,
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .order-form button,
  .order-note,
  .segmented {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  main {
    padding-inline: 10px;
  }

  .summary-grid,
  .merchant-grid,
  .order-form,
  .order-row,
  .submission-row {
    grid-template-columns: 1fr;
  }

  .merchant-grid {
    gap: 12px;
  }

  .merchant-card {
    padding: 12px;
  }

  .inline-form {
    flex-direction: column;
  }

  .batch-actions button,
  .batch-actions .file-button,
  .topbar-actions button,
  .topbar-actions .nav-button {
    flex: 1 1 auto;
  }
}

/* Clean admin template */
:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #17211b;
  --muted: #6b756e;
  --line: #e1e7e3;
  --brand: #0b7a75;
  --brand-dark: #075f5b;
  --soft-green: #edf7f4;
  --shadow: 0 10px 30px rgba(23, 33, 27, 0.06);
}

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

.topbar {
  position: static;
  padding: 14px 24px;
  background: #fff;
}

.order-row.search-hit {
  border-color: #f0b84b;
  background: #fff3cf;
  box-shadow: inset 4px 0 0 #d97706;
}

h1 {
  font-size: 26px;
}

.brand-title span {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--soft-green);
  font-size: 12px;
}

main {
  width: min(1360px, 100%);
  padding: 18px 24px 36px;
}

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

.summary-card {
  min-height: 94px;
  padding: 14px 16px;
  border-radius: 6px;
  box-shadow: none;
}

.summary-card.total {
  background: #0f3f3b;
}

.summary-card strong {
  margin: 8px 0 5px;
  font-size: 28px;
}

.submission-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 6px;
  box-shadow: none;
}

.workbench {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

.merchant-sidebar,
.merchant-workspace {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.merchant-sidebar {
  position: sticky;
  top: 14px;
  padding: 14px;
}

.merchant-sidebar .section-head {
  margin-bottom: 12px;
}

.sidebar-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 12px;
}

.sidebar-form input,
.sidebar-form button {
  min-height: 38px;
}

.merchant-nav {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 230px);
  overflow: auto;
}

.merchant-nav-item {
  display: grid;
  width: 100%;
  min-height: 74px;
  justify-content: stretch;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.merchant-nav-item:hover,
.merchant-nav-item.active {
  border-color: rgba(11, 122, 117, 0.38);
  background: var(--soft-green);
}

.merchant-nav-item strong {
  font-size: 16px;
}

.merchant-nav-item span,
.merchant-nav-item small {
  color: var(--muted);
  font-size: 12px;
}

.merchant-workspace {
  min-width: 0;
  padding: 14px;
}

.merchant-grid {
  display: block;
}

.merchant-card {
  gap: 16px;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.merchant-head {
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.merchant-title {
  min-height: 34px;
  font-size: 24px;
}

.merchant-stats span {
  border-radius: 6px;
  background: #f5f7f6;
}

.order-form {
  grid-template-columns: 220px minmax(260px, 1fr) auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
}

.segmented {
  background: #fff;
}

.segmented label {
  font-size: 12px;
}

.batch-panel {
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
}

.batch-text {
  min-height: 104px;
}

.batch-actions,
.batch-requirements {
  display: grid;
  align-content: start;
}

.batch-actions button,
.batch-actions .file-button,
.batch-actions .secondary-link {
  width: 100%;
}

.order-list {
  max-height: 520px;
  gap: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.order-row {
  grid-template-columns: minmax(180px, 1fr) 120px 86px 58px;
  min-height: 52px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.order-row.search-hit {
  background: #fff3cf;
  box-shadow: inset 4px 0 0 #d97706;
}

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

.empty-state.show {
  min-height: 180px;
  border-radius: 6px;
  background: #fff;
}

@media (max-width: 1060px) {
  .workbench {
    grid-template-columns: 1fr;
  }

  .merchant-sidebar {
    position: static;
  }

  .merchant-nav {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    max-height: none;
  }

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

  .batch-requirements {
    grid-column: auto;
  }

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

  .order-form button,
  .order-note,
  .segmented {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .topbar,
  main {
    padding-inline: 12px;
  }

  .summary-grid,
  .order-form,
  .order-row,
  .detail-row {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .home-link {
    position: static;
    margin: 12px 12px 0 auto;
    width: fit-content;
  }
}
