:root {
  color-scheme: light;
  --bg: #eef2f6;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9e1ea;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --accent: #b45309;
  --danger: #b42318;
  --success-bg: #e8f7ef;
  --success-ink: #166534;
  --error-bg: #fee4e2;
  --error-ink: #b42318;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

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

button {
  cursor: pointer;
}

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

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

.receipt-route-page {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: #eef2f6;
}

.receipt-route-card {
  display: grid;
  gap: 16px;
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: #ffffff;
  box-shadow: 0 18px 52px rgba(15, 23, 42, 0.12);
}

.receipt-route-card h1 {
  font-size: 24px;
}

.receipt-route-card p {
  color: var(--muted);
  word-break: break-all;
}

.receipt-image-page {
  grid-column: 1 / -1;
  min-height: 100vh;
  padding: 0;
  background: #eef2f6;
}

.receipt-image {
  display: block;
  width: min(1188px, 100%);
  height: auto;
  margin: 0 auto;
  background: #ffffff;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.14);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
  background: #17202a;
  color: #f8fafc;
}

.brand {
  display: grid;
  gap: 4px;
}

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

.brand span {
  color: #cbd5e1;
  font-size: 13px;
}

nav {
  display: grid;
  gap: 10px;
}

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

.nav-item {
  position: relative;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #cbd5e1;
  background: transparent;
  text-align: left;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.nav-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nav-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  color: #94a3b8;
  transform: rotate(-45deg);
  transition:
    transform 0.16s ease,
    color 0.16s ease;
}

.nav-group.expanded .nav-caret {
  transform: rotate(45deg);
  color: #5eead4;
}

.sub-nav {
  position: relative;
  display: grid;
  gap: 5px;
  padding-left: 18px;
}

.sub-nav[hidden] {
  display: none;
}

.sub-nav::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 7px;
  width: 1px;
  background: #334155;
}

.sub-nav-item {
  position: relative;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  color: #cbd5e1;
  background: transparent;
  text-align: left;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    padding-left 0.16s ease;
}

.sub-nav-item::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  display: inline-block;
  width: 10px;
  height: 1px;
  margin: 0;
  background: #334155;
  transform: translateY(-50%);
}

.nav-item.active,
.nav-item:hover {
  background: #213244;
  border-color: #3b516b;
  color: #ffffff;
}

.nav-item.active {
  box-shadow: none;
}

.nav-parent.active {
  color: #ffffff;
}

.sub-nav-item:hover {
  background: #1f2d3c;
  border-color: #334b63;
  color: #ffffff;
  padding-left: 14px;
}

.sub-nav-item.active {
  background: #0f3f3c;
  border-color: transparent;
  color: #ffffff;
  box-shadow: none;
}

.sub-nav-item.active::before {
  height: 2px;
  background: #5eead4;
}

.sub-nav-nested {
  display: grid;
  gap: 5px;
  padding-left: 18px;
}

.sub-nav-item-level-3 {
  min-height: 30px;
  font-size: 12px;
}

.sub-nav-item-level-3::before {
  left: -12px;
  width: 8px;
}

.session {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.user-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
}

.user-menu-button:hover {
  border-color: #b6c3d1;
  background: #f8fafc;
}

.user-menu-caret {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 12;
  min-width: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.user-menu-item {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.user-menu-item:hover {
  background: #f1f5f9;
}

.main {
  min-width: 0;
  padding: 24px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

.topbar h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

.panel > h2,
.form > h2,
.api-map > h2 {
  margin-bottom: 16px;
}

h3 {
  margin: 0;
  font-size: 15px;
}

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

.toolbar,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.toolbar-action {
  margin-left: auto;
  min-height: 32px;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 12px;
}

.provider-add-action {
  min-width: 132px;
  padding-inline: 18px;
}

.filters,
.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

.filters {
  gap: 8px;
}

.filters .field {
  gap: 4px;
  min-width: 132px;
}

.filters .field:has(.order-no-filter-input) {
  min-width: 292px;
}

.filters .field:has(.datetime-filter-input) {
  min-width: 214px;
}

.filters .field span {
  font-size: 12px;
}

.filters input,
.filters select {
  min-height: 32px;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
}

.datetime-filter-input {
  cursor: pointer;
}

.filters .primary,
.filters .secondary {
  min-height: 32px;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 12px;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 16px;
}

.order-test-side {
  display: grid;
  align-content: start;
  gap: 16px;
}

.panel {
  padding: 18px;
}

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

.result-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.result-summary small {
  color: inherit;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.78;
}

.result-success {
  color: var(--success-ink);
  background: var(--success-bg);
}

.result-error {
  color: var(--danger);
  background: #fee4e2;
}

.result-pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #0f172a;
}

.result-pre code {
  display: block;
  max-width: none;
  overflow: visible;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

.report-panel {
  display: grid;
  gap: 16px;
}

.report-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.report-card span,
.report-card small {
  color: var(--muted);
  font-size: 12px;
}

.report-card strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.report-window-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-window-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.report-window-tabs button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  background: #ffffff;
}

.report-window-tabs button:hover {
  color: var(--ink);
  background: #f8fafc;
}

.report-window-tabs button.active {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #eff6ff;
}

.report-custom-filter {
  margin: 0;
}

.report-window {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.report-window-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.report-window-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.report-window-head strong {
  color: #16a34a;
  font-size: 26px;
  line-height: 1;
}

.report-window-cards {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.report-window-cards .report-card {
  padding: 12px;
}

.report-window-cards .report-card strong {
  font-size: 18px;
}

.report-stats-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.report-section-title {
  margin: 0;
}

.report-stats-tabs {
  display: flex;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.report-stats-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  background: transparent;
}

.report-stats-tabs button.active,
.report-stats-tabs button:hover {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.report-merchant-table {
  min-width: 980px;
}

.transaction-import-table {
  min-width: 1040px;
}

.transaction-progress {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.transaction-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.transaction-progress-head strong {
  color: var(--ink);
}

.transaction-progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.transaction-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 0.18s ease;
}

.form {
  display: grid;
  gap: 14px;
  align-content: start;
}

.field {
  display: grid;
  gap: 3px;
  min-width: 180px;
}

.field-wide {
  min-width: 100%;
}

.field span {
  color: var(--muted);
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  min-height: 28px;
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
  background: #ffffff;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
  border-color: var(--brand);
}

input[readonly] {
  color: #475467;
  background: #f8fafc;
}

.input-button-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.input-button-group .secondary {
  min-height: 28px;
  padding: 0 12px;
  font-size: 13px;
}

.api-copy-group {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.order-number-field {
  min-width: 260px;
}

.primary,
.secondary,
.danger,
.text-button,
.segmented button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
}

.primary {
  background: var(--brand);
  color: #ffffff;
}

.primary:hover {
  background: var(--brand-strong);
}

.secondary {
  color: var(--brand-strong);
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.danger {
  color: #ffffff;
  background: var(--danger);
}

.small {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover {
  color: var(--ink);
  background: #f1f5f9;
}

.text-button {
  padding: 0;
  min-height: auto;
  text-align: center;
  color: var(--brand-strong);
  background: transparent;
}

.full {
  width: 100%;
}

.segmented {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.segmented button {
  min-width: 72px;
  background: transparent;
  color: var(--muted);
}

.segmented .active {
  background: var(--ink);
  color: #ffffff;
}

.tips {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 20;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
  transform: translateX(-50%);
  pointer-events: none;
}

.tip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  font-size: 14px;
  line-height: 1.4;
  pointer-events: auto;
}

.tip-success {
  border-color: #bbf7d0;
}

.tip-error {
  border-color: #fecaca;
}

.tip-loading {
  border-color: #fed7aa;
}

.tip-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--success-ink);
}

.tip-error .tip-dot {
  background: var(--error-ink);
}

.tip-loading .tip-dot {
  background: var(--accent);
}

.tip-close {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
  line-height: 1;
}

.tip-close:hover {
  color: var(--ink);
  background: #f1f5f9;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.merchant-edit-modal {
  width: min(860px, 100%);
}

.channel-enterprise-modal {
  width: min(580px, 100%);
}

.channel-balance-log-modal {
  width: min(860px, calc(100vw - 32px));
  overflow: visible;
}

.channel-balance-log-modal .table-panel {
  overflow: visible;
}

.channel-balance-log-modal table {
  min-width: 0;
}

.receipt-modal-backdrop {
  padding: 24px;
}

.receipt-modal {
  display: flex;
  flex-direction: column;
  width: min(1241px, calc(100vw - 48px));
  height: min(820px, calc(100vh - 72px));
  max-height: calc(100vh - 72px);
  background: #f5f5f5;
}

.receipt-modal-header {
  justify-content: flex-end;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.receipt-modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 0;
}

.modal-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.modal-title-actions h2 {
  margin: 0;
}

.confirm-modal {
  width: min(420px, 100%);
}

.confirm-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--danger);
  background: #fee4e2;
  font-weight: 800;
}

.confirm-body {
  padding: 18px 18px 4px;
}

.confirm-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.confirm-actions {
  padding: 14px 18px 18px;
}

.confirm-actions button {
  width: 112px;
}

.modal > .form {
  padding: 18px;
}

.modal-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.merchant-edit-body {
  grid-template-rows: auto minmax(560px, auto);
  min-height: 630px;
}

.merchant-tab-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 560px;
}

.merchant-tab-panel > .modal-section {
  min-height: 520px;
}

.modal-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 48px;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.modal-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--muted);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  background: transparent;
}

.modal-tabs button:hover {
  color: var(--ink);
  background: #eef4fb;
}

.modal-tabs button.active {
  color: #1f3a5f;
  background: #e4edf7;
  box-shadow: inset 0 0 0 1px #bfd0e3;
}

.modal-section {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

.rate-form-grid {
  display: grid;
  gap: 14px;
  max-width: none;
}

.provider-check-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.provider-check-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
}

.provider-check-item input {
  width: 16px;
  min-height: 16px;
}

.provider-check-item span {
  display: grid;
  gap: 2px;
}

.provider-check-item strong {
  font-size: 13px;
  font-weight: 600;
}

.provider-check-item small {
  color: var(--muted);
  font-size: 12px;
}

.rate-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
  align-items: center;
}

.rate-input-row strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand);
  background: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.field-help {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.field-help code {
  display: inline;
  max-width: none;
  padding: 2px 6px;
  border-radius: 5px;
  background: #f2f4f7;
  color: var(--ink);
  font-size: 12px;
}

.channel-enterprise-modal > .form {
  gap: 6px;
  padding: 10px 12px 12px;
}

.channel-enterprise-modal textarea {
  min-height: 116px;
}

.channel-enterprise-modal .modal-actions {
  padding-top: 0;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding-top: 4px;
}

.modal-actions button {
  width: 112px;
}

.table-panel {
  overflow: auto;
}

.receipt-wrap {
  flex: 1;
  min-height: 0;
  padding: 24px 24px 12px;
  overflow: auto;
  background: #f5f5f5;
}

.receipt-sheet {
  width: 1188px;
  min-height: 720px;
  margin: 0 auto;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 0 0 1px #d9d9d9;
}

.receipt-body {
  padding: 48px 43px 44px 70px;
  font-family: "SimSun", "Songti SC", "Noto Serif CJK SC", serif;
}

.receipt-title {
  margin: 0 0 26px;
  text-align: center;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.35;
}

.receipt-meta {
  margin-bottom: 20px;
  font-size: 17px;
  line-height: 1.8;
}

.receipt-meta p {
  margin: 0;
}

.receipt-meta-label {
  position: relative;
  top: -2px;
}

.certify-line {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 0;
  white-space: nowrap;
}

.mosaic-field {
  display: inline-block;
  min-width: 304px;
  height: 25px;
  padding: 0 4px;
  color: transparent;
  line-height: 25px;
  word-break: break-all;
  vertical-align: -6px;
  background-color: #f3f3f3;
  background-image: repeating-conic-gradient(#d2d2d2 0% 25%, #f3f3f3 0% 50%);
  background-size: 4px 4px;
  overflow: hidden;
}

.mosaic-field.wide {
  min-width: 496px;
}

.mosaic-field.block {
  width: 100%;
  height: 26px;
  vertical-align: middle;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-top: 16px;
  font-size: 17px;
}

.receipt-label-col {
  width: 144px;
}

.receipt-value-col-left {
  width: 396px;
}

.receipt-label-col-right {
  width: 160px;
}

.receipt-value-col-right {
  width: 378px;
}

.receipt-table td {
  height: 52px;
  border: 1px solid #dedede;
  padding: 9px 12px;
  vertical-align: middle;
  line-height: 1.6;
  word-break: break-all;
}

.receipt-table .cell-label {
  width: 144px;
  text-align: left;
  font-weight: 400;
  background: #f7f7f7;
}

.receipt-table .cell-value {
  color: #000000;
}

.receipt-footer {
  position: relative;
  margin-top: 20px;
  min-height: 168px;
  font-size: 17px;
  line-height: 1.75;
}

.receipt-footer p {
  margin: 0;
}

.notes-title {
  font-weight: 700;
  margin-bottom: 8px !important;
}

.usage-line {
  color: #000000;
}

.apply-date {
  position: absolute;
  right: 0;
  bottom: 0;
  margin-top: 0 !important;
  text-align: right;
}

.receipt-seal-img {
  position: absolute;
  right: 82px;
  bottom: 8px;
  width: 108px;
  height: 108px;
  transform: rotate(8deg);
  opacity: 0.72;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 2px;
  color: var(--muted);
  font-size: 12px;
}

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

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.panel-title h2 {
  margin: 0;
}

.panel-title-path {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.panel-title-path-link {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: 400;
  cursor: pointer;
}

.panel-title-path-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

.panel-title-path-separator {
  margin: 0 4px;
}

.refresh-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5f6368;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.refresh-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.refresh-icon:hover {
  color: #202124;
  background: #f1f3f4;
}

.refresh-icon.is-loading svg {
  animation: refresh-spin 0.75s linear infinite;
}

@keyframes refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
  line-height: 1.35;
}

th {
  color: var(--muted);
  font-weight: 600;
  background: #f8fafc;
}

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: #f8fafc;
}

code {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #475467;
}

.channel-table {
  table-layout: fixed;
  min-width: 900px;
}

.order-table {
  table-layout: auto;
}

.order-table-enter {
  min-width: 1060px;
}

.order-table-out {
  min-width: 1560px;
}

.order-id-cell,
.stacked-cell {
  display: grid;
  gap: 3px;
  white-space: nowrap;
}

.order-id-cell small,
.stacked-cell small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.order-status-cell {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: max-content;
}

.receipt-link,
.manual-confirm-link {
  border: 0;
  padding: 0;
  min-width: 58px;
  color: var(--brand-strong);
  background: transparent;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}

.receipt-link:hover,
.manual-confirm-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

.text-link {
  border: 0;
  padding: 0;
  color: var(--brand-strong);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.text-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

.amount-positive {
  color: var(--success-ink);
  font-weight: 700;
}

.amount-negative {
  color: var(--error-ink);
  font-weight: 700;
}

.amount-neutral {
  color: var(--muted);
}

.manual-confirm-modal {
  width: min(520px, 100%);
}

.manual-confirm-form {
  padding: 18px;
}

.manual-confirm-info {
  display: grid;
  gap: 8px;
  margin-bottom: 2px;
}

.aliwork-channel-table {
  min-width: 1170px;
}

.channel-table th,
.channel-table td {
  overflow: hidden;
}

.truncate-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-actions {
  white-space: nowrap;
}

.table-actions .small + .small {
  margin-left: 6px;
}

.status-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  border: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.status-switch-track {
  position: relative;
  width: 38px;
  height: 20px;
  border-radius: 999px;
  background: #d0d5dd;
  transition: background 0.16s ease;
}

.status-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  transition: transform 0.16s ease;
}

.status-switch.active {
  color: var(--success-ink);
}

.status-switch.active .status-switch-track {
  background: var(--success-ink);
}

.status-switch.active .status-switch-thumb {
  transform: translateX(18px);
}

.status-switch-text {
  min-width: 24px;
  text-align: left;
}

.channel-col-name {
  width: 38%;
}

.channel-col-id {
  width: 42%;
}

.channel-col-type {
  width: 20%;
}

.channel-col-username {
  width: 120px;
}

.channel-col-provider {
  width: 130px;
}

.channel-col-balance {
  width: 90px;
}

.channel-col-amount-low {
  width: 110px;
}

.channel-col-weight {
  width: 80px;
}

.channel-col-url {
  width: 150px;
}

.channel-col-app-type {
  width: 150px;
}

.channel-col-corp {
  width: 140px;
}

.channel-col-form {
  width: 190px;
}

.channel-col-process {
  width: 220px;
}

.channel-col-pay {
  width: 130px;
}

.channel-col-tg-group {
  width: 140px;
}

.channel-col-status {
  width: 90px;
}

.channel-col-actions {
  width: 126px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: #854d0e;
  background: #fef3c7;
  font-size: 12px;
}

.pill-success {
  color: var(--success-ink);
  background: var(--success-bg);
}

.pill-error {
  color: var(--error-ink);
  background: var(--error-bg);
}

.empty {
  color: var(--muted);
  text-align: center;
}

.login-page {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 40px 28px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.86), rgba(15, 118, 110, 0.42)),
    url("../src/pay-control-room.svg") center / cover no-repeat;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  width: min(880px, 100%);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 22px 78px rgba(15, 23, 42, 0.34);
}

.login-copy {
  display: grid;
  align-content: center;
  gap: 12px;
  min-height: 430px;
  padding: 46px;
  color: #ffffff;
  background:
    linear-gradient(160deg, rgba(15, 118, 110, 0.9), rgba(23, 32, 42, 0.9)),
    url("../src/pay-control-room.svg") center / cover no-repeat;
}

.login-copy h1 {
  max-width: 360px;
  font-size: 52px;
  line-height: 1.04;
}

.login-copy p {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #ccfbf1;
}

.login-form {
  align-content: center;
  gap: 15px;
  padding: 48px 40px;
}

.login-form-title {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.login-form-title p {
  margin: 0;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.login-form-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
}

.login-form .primary {
  margin-top: 20px;
}

.settings {
  max-width: 1120px;
}

.settings-form {
  max-width: 520px;
}

.settings-sections {
  display: grid;
  gap: 22px;
}

.settings-section {
  display: grid;
  gap: 14px;
}

.settings-table {
  margin-top: 2px;
}

.settings-section + .settings-section {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

dl {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 10px 16px;
  margin: 0;
}

dt {
  color: var(--ink);
  font-weight: 700;
}

dd {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  #app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  .nav-item {
    text-align: center;
    padding-inline: 8px;
  }

  .sub-nav {
    padding-left: 0;
  }

  .sub-nav-item {
    text-align: center;
    padding-inline: 6px;
  }

  .workbench,
  .login-panel {
    grid-template-columns: 1fr;
  }

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

  .report-window-controls,
  .report-window-tabs {
    width: 100%;
    margin-left: 0;
  }

  .report-window-controls {
    justify-content: flex-start;
  }

  .report-stats-head {
    align-items: stretch;
    flex-direction: column;
  }

  .report-stats-tabs {
    width: 100%;
  }

  .report-stats-tabs button {
    flex: 1;
  }

  .login-copy {
    min-height: 210px;
    padding: 34px;
  }

  .login-copy h1 {
    font-size: 40px;
  }

  .login-form {
    padding: 34px;
  }
}

@media (max-width: 620px) {
  body {
    overflow-x: hidden;
  }

  #app {
    min-width: 0;
  }

  .main,
  .login-page {
    padding: 10px;
  }

  .sidebar {
    gap: 10px;
    padding: 12px 10px;
    overflow-x: hidden;
  }

  .brand {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }

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

  .brand span {
    font-size: 11px;
  }

  nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .nav-group {
    flex: 0 0 auto;
    min-width: 116px;
    scroll-snap-align: start;
  }

  .nav-item {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .nav-parent {
    justify-content: center;
  }

  .nav-caret {
    display: none;
  }

  .sub-nav {
    gap: 4px;
    margin-top: 4px;
  }

  .sub-nav::before,
  .sub-nav-item::before {
    display: none;
  }

  .sub-nav-item {
    min-height: 32px;
    border-color: #334155;
    padding: 0 8px;
    font-size: 12px;
    white-space: nowrap;
  }

  .login-copy {
    min-height: 170px;
    padding: 24px;
  }

  .login-copy h1 {
    font-size: 32px;
  }

  .login-form {
    padding: 26px 22px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .topbar p {
    font-size: 12px;
  }

  .session {
    justify-content: flex-start;
  }

  .user-menu {
    right: auto;
    left: 0;
  }

  .filters,
  .toolbar,
  .button-row {
    align-items: stretch;
    width: 100%;
  }

  .toolbar,
  .panel {
    border-radius: 8px;
    padding: 12px;
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .filters .field,
  .filters .field:has(.order-no-filter-input),
  .filters .field:has(.datetime-filter-input) {
    min-width: 0;
  }

  .field,
  .filters .primary,
  .filters .secondary,
  .toolbar-action {
    width: 100%;
  }

  .filters input,
  .filters select {
    min-height: 38px;
    font-size: 14px;
  }

  .toolbar-action {
    margin-left: 0;
  }

  .table-panel {
    margin-inline: -10px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 760px;
  }

  th,
  td {
    padding: 9px 8px;
    font-size: 12px;
  }

  .order-table-enter {
    min-width: 980px;
  }

  .order-table-out {
    min-width: 1320px;
  }

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

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

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

  .modal-backdrop {
    padding: 10px;
  }

  .modal {
    width: 100%;
    max-height: calc(100vh - 20px);
    border-radius: 8px;
  }

  .modal-header {
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }

  .modal-header h2,
  .modal-title-actions h2 {
    font-size: 18px;
  }

  .modal-title-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-body,
  .modal > .form {
    padding: 12px;
  }

  .modal-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 40px;
  }

  .modal-tabs button {
    font-size: 12px;
  }

  .merchant-tab-panel > .modal-section {
    min-height: 0;
  }

  .readonly-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  .receipt-modal-backdrop,
  .receipt-modal-backdrop * {
    visibility: visible;
  }

  .no-print {
    display: none !important;
  }

  .receipt-modal-backdrop {
    position: static;
    inset: auto;
    display: block;
    padding: 0;
    background: #ffffff;
  }

  .receipt-modal {
    width: auto;
    max-height: none;
    overflow: visible;
    border: 0;
    box-shadow: none;
    background: #ffffff;
  }

  .receipt-wrap {
    padding: 0;
    overflow: visible;
  }

  .receipt-sheet {
    width: 1188px;
    min-height: 720px;
    box-shadow: none;
  }
}
