@font-face {
  font-family: "Figtree";
  src: url("assets/fonts/figtree-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("assets/fonts/figtree-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f1eb;
  --surface: #ffffff;
  --surface-soft: #faf8f4;
  --surface-warm: #f1ebe2;
  --ink: #211b17;
  --ink-soft: #5f564f;
  --muted: #827870;
  --line: #e4ddd4;
  --line-strong: #d4c8bb;
  --brand: #56351f;
  --brand-dark: #362116;
  --brand-light: #efe2d5;
  --gold: #bd8b55;
  --success: #317354;
  --success-bg: #e9f5ee;
  --danger: #a23d3d;
  --danger-bg: #fff0ef;
  --shadow: 0 12px 36px rgba(42, 30, 20, 0.07);
  --radius: 16px;
  --submission-table-min-width: 1200px;
}

* { box-sizing: border-box; }

html {
  max-width: 100%;
  overflow-x: hidden;
  color-scheme: light;
}

body {
  margin: 0;
  min-width: 320px;
  max-width: 100%;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: "Figtree", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select { font: inherit; }

a { color: inherit; text-decoration: none; }

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

code,
.data-code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.shell {
  width: min(100%, 1600px);
  min-width: 0;
  margin: 0 auto;
  padding: 34px 28px 56px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  color: #fff;
  background: rgba(34, 26, 21, 0.97);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(100%, 1600px);
  min-width: 0;
  min-height: 72px;
  margin: 0 auto;
  padding: 8px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.identity {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.identity img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  opacity: 0.94;
}

.identity span { min-width: 0; display: grid; gap: 1px; }
.identity strong { font-size: 16px; letter-spacing: 0.02em; }
.identity small { color: rgba(255, 255, 255, 0.58); font-size: 12px; }

.header-actions { min-width: 0; display: flex; align-items: center; gap: 8px; }
.header-actions form { margin: 0; }

.header-link {
  min-height: 44px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.78);
  transition: color 180ms ease, background 180ms ease;
}

.header-link:hover,
.header-link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.header-link svg { width: 18px; height: 18px; }
.button-reset { border: 0; background: none; cursor: pointer; }

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

.page-heading > * { min-width: 0; }

.page-heading h1 {
  margin: 3px 0 7px;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.page-heading p:not(.eyebrow) { margin: 0; color: var(--ink-soft); font-size: 15px; }

.export-dialog {
  width: min(92vw, 580px);
  max-height: min(88vh, 720px);
  padding: 0;
  overflow: visible;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.export-dialog::backdrop { background: rgba(27, 20, 16, 0.58); backdrop-filter: blur(3px); }
.dialog-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 80px rgba(29, 20, 14, 0.28); }
.dialog-header { padding: 22px 24px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 4px 0 0; font-size: 23px; }
.dialog-close { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.dialog-close:hover { color: var(--danger); background: var(--danger-bg); }
.dialog-summary { margin: 0; padding: 18px 24px 0; color: var(--ink-soft); }
.export-dialog-form { padding: 18px 24px 24px; display: grid; gap: 12px; }
.export-option { min-height: 66px; margin: 0; padding: 12px 14px; display: flex; align-items: center; gap: 12px; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.export-option:hover { border-color: var(--line-strong); }
.export-option-highlight { background: var(--success-bg); border-color: #c8e4d4; }
.export-option input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }
.export-option span { display: grid; gap: 3px; }
.export-option strong { font-size: 14px; }
.export-option small { color: var(--muted); font-size: 12px; font-weight: 400; }
.dialog-actions { margin-top: 6px; display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; }

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.eyebrow.light { color: #d4aa7c; }

.btn {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 5px 14px rgba(86, 53, 31, 0.18);
}

.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.btn-danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 5px 14px rgba(162, 61, 61, 0.16);
}

.btn-danger:hover { background: #843030; border-color: #843030; }

.btn-quiet {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.btn-quiet:hover { color: var(--brand); border-color: var(--line-strong); background: var(--surface-soft); }
.btn.is-disabled { opacity: 0.42; cursor: default; pointer-events: none; }
.btn-block { width: 100%; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(189, 139, 85, 0.28);
  outline-offset: 2px;
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dashboard-stats {
  min-width: 0;
  margin-bottom: 18px;
}

.stats-grid {
  min-width: 0;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  min-width: 0;
  min-height: 98px;
  padding: 19px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 5px 20px rgba(42, 30, 20, 0.045);
}

.stat-icon,
.section-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-light);
  border-radius: 12px;
}

.stat-card > span:last-child { min-width: 0; display: grid; gap: 3px; }
.stat-card small { color: var(--muted); }
.stat-card strong { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }

.country-amount-panel { padding: 20px; }

.country-amount-header {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.country-amount-header > * { min-width: 0; }
.country-amount-header h2 { margin: 4px 0 4px; font-size: 19px; }
.country-amount-header p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; }

.country-amount-total {
  flex: 0 0 auto;
  min-width: 150px;
  padding: 10px 14px;
  display: grid;
  gap: 2px;
  text-align: right;
  background: var(--brand-light);
  border: 1px solid #e3d2c1;
  border-radius: 12px;
}

.country-amount-total span { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.country-amount-total strong { color: var(--brand-dark); font-size: 22px; line-height: 1.15; font-variant-numeric: tabular-nums; }

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

.country-amount-card {
  min-width: 0;
  padding: 15px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.country-amount-card > header {
  margin-bottom: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.country-amount-card > header > span:last-child { min-width: 0; display: grid; gap: 1px; }
.country-amount-card > header strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.country-amount-card > header small { color: var(--ink-soft); font-size: 11px; }

.country-code {
  flex: 0 0 auto;
  width: 42px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
}

.country-amount-metrics {
  min-width: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.country-amount-metrics > div {
  min-width: 0;
  padding: 9px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.country-amount-metrics dt { margin-bottom: 3px; color: var(--ink-soft); font-size: 11px; }
.country-amount-metrics dd { margin: 0; overflow-wrap: anywhere; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.country-amount-metrics .amount-metric { background: var(--success-bg); border-color: #c8e4d4; }
.country-amount-metrics .amount-metric dd { color: var(--success); }

.filter-panel { margin-bottom: 18px; padding: 19px; }

[data-submission-results].is-async-loading {
  opacity: .58;
  pointer-events: none;
  cursor: progress;
}

.async-filter-error {
  margin-top: 18px;
  color: #9a2d21;
}

.dashboard-shell [data-dashboard-stats],
.dashboard-shell .filter-panel,
.dashboard-shell .table-panel {
  transition: opacity 140ms ease;
}

.filters {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  align-items: end;
  gap: 12px;
}

.filters > * { min-width: 0; }
.filter-search { grid-column: span 2; }

label {
  display: block;
  margin: 0 0 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input::placeholder { color: #a49b93; }
input:hover,
select:hover { border-color: #b9aa9a; }
input:focus,
select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(189, 139, 85, 0.12); outline: 0; }

.input-with-icon { position: relative; }
.input-with-icon svg {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 19px;
  height: 19px;
  color: var(--muted);
  pointer-events: none;
}
.input-with-icon input { padding-left: 39px; }
.filter-check {
  min-height: 44px;
  margin: 0;
  padding: 6px 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
}
.filter-check input { flex: 0 0 auto; width: 17px; height: 17px; margin: 0; accent-color: var(--brand); }
.filter-check span { min-width: 0; display: grid; gap: 1px; }
.filter-check strong { font-size: 12px; }
.filter-check small { color: var(--muted); font-size: 9px; font-weight: 400; line-height: 1.25; overflow-wrap: anywhere; }
.filter-actions {
  min-width: 0;
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.filter-actions .btn { width: 100%; min-width: 0; padding-inline: 10px; white-space: nowrap; }

.table-panel { min-width: 0; max-width: 100%; overflow: hidden; }

.table-toolbar {
  min-width: 0;
  min-height: 75px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.table-toolbar > * { min-width: 0; }

.table-toolbar h2 { margin: 0 0 3px; font-size: 17px; }
.table-toolbar p { margin: 0; color: var(--muted); font-size: 12px; }
.page-count { color: var(--ink-soft); font-size: 12px; }

.table-scroll-proxy {
  width: 100%;
  max-width: 100%;
  height: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.table-scroll-proxy-content {
  width: var(--submission-table-min-width);
  min-width: 100%;
  height: 1px;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-inline: contain;
}

.table-scroll:focus-visible {
  outline: 3px solid rgba(189, 139, 85, 0.34);
  outline-offset: -3px;
}

.submission-table {
  width: 100%;
  min-width: var(--submission-table-min-width);
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}

.submission-table .column-time { width: 85px; }
.submission-table .column-status { width: 75px; }
.submission-table .column-source { width: 115px; }
.submission-table .column-person { width: 80px; }
.submission-table .column-location { width: 115px; }
.submission-table .column-address-contact { width: 210px; }
.submission-table .column-payment { width: 160px; }
.submission-table .column-actions { width: 130px; }

.submission-table th,
.submission-table td {
  padding: 13px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.submission-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #71675f;
  background: #f8f5f0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.055em;
  white-space: nowrap;
}

.submission-table td { font-size: 13px; }
.submission-table tbody tr { transition: background 160ms ease; }
.submission-table tbody tr:hover { background: #fdfbf8; }
.submission-table tbody tr:last-child td { border-bottom: 0; }
.align-right { text-align: right !important; }

.time-cell { white-space: nowrap; }
.time-cell strong,
.time-cell span,
.person-cell strong,
.person-cell span { display: block; }
.time-cell strong { font-size: 12px; }
.time-cell span,
.person-cell span { margin-top: 3px; color: var(--muted); }
.person-cell strong,
.payment-cell strong { overflow-wrap: anywhere; }
.payment-cell { min-width: 0; }
.payment-cell strong,
.payment-cell span,
.payment-cell small { display: block; }
.payment-cell span { margin-top: 4px; color: var(--ink-soft); }
.payment-cell small { margin-top: 3px; color: var(--muted); }
.brand-cell { min-width: 0; display: flex; align-items: center; gap: 10px; }
.brand-logo {
  flex: 0 0 auto;
  width: 54px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.brand-logo img { width: 43px; max-height: 23px; object-fit: contain; }
.brand-logo-fallback { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.12em; }
.brand-cell strong { min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.payment-brand-line { min-width: 0; }
.payment-brand-copy { min-width: 0; }
.payment-brand-copy strong,
.payment-brand-copy span { overflow-wrap: anywhere; }
.payment-brand-line > span { margin-top: 0; }
.payment-brand-copy span { margin-top: 3px; }
.detail-brand { display: inline-flex; align-items: center; gap: 9px; }
.detail-brand .brand-logo { width: 54px; height: 34px; }

.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  color: var(--brand);
  background: var(--brand-light);
  border: 1px solid #e4d5c7;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.source-slug { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.status-badge { display: inline-flex; min-height: 27px; padding: 0 9px; align-items: center; border: 1px solid; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-badge.is-unextracted { color: #8a5720; background: #fff6e8; border-color: #efd8b7; }
.status-badge.is-extracted { color: var(--success); background: var(--success-bg); border-color: #c8e4d4; }
.status-time { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.copy-button {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}
.copy-button svg { width: 16px; height: 16px; }
.copy-button:hover { color: var(--brand); background: var(--brand-light); border-color: #e2d3c3; }
.copy-button.is-copied { color: var(--success); background: var(--success-bg); }

.location-cell { min-width: 0; display: grid; gap: 4px; }
.country-line { display: flex; align-items: center; gap: 8px; }
.country-flag {
  width: 25px;
  height: 18px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(31, 25, 21, 0.13);
}
.flag-placeholder { width: 25px; height: 18px; background: var(--surface-warm); border-radius: 3px; }
.location-cell code { font-size: 11px; color: var(--ink-soft); }
.location-cell small { color: var(--muted); font-size: 10px; }
.person-cell,
.address-contact-cell { min-width: 0; overflow-wrap: anywhere; }
.address-contact-details { min-width: 0; display: grid; gap: 3px; }
.address-contact-row {
  min-width: 0;
  min-height: 26px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 5px;
}
.address-contact-label {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}
.address-contact-value {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
  white-space: normal;
}
.address-contact-row a { color: var(--brand); }
.address-contact-row a:hover { text-decoration: underline; }
.address-contact-row .copy-button { width: 26px; height: 26px; border-radius: 7px; }
.address-contact-empty { grid-template-columns: 28px minmax(0, 1fr); color: var(--muted); }
.detail-link { display: inline-flex; padding: 8px 10px; color: var(--brand); font-weight: 700; border-radius: 8px; white-space: nowrap; }
.detail-link:hover { background: var(--brand-light); }
.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; }
.row-actions form { margin: 0; }
.row-actions .detail-link,
.row-actions .delete-link { padding-inline: 7px; }
.delete-link {
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--danger);
  background: transparent;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.delete-link:hover { background: var(--danger-bg); }

.empty-state {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
}
.empty-state svg { width: 38px; height: 38px; margin-bottom: 5px; color: #b4a89d; }
.empty-state strong { color: var(--ink); font-size: 15px; }

.pager {
  min-height: 72px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}
.pager .btn { min-height: 38px; padding: 0 13px; }

/* Detail */
.detail-shell { width: min(100%, 1180px); }
.payment-card-panel {
  padding: 24px;
  background: linear-gradient(135deg, #2b211b, #17110e);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(37, 25, 17, 0.18);
}

.payment-card {
  position: relative;
  min-height: 286px;
  padding: 28px 30px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(circle at 88% 4%, rgba(213, 164, 108, 0.38), transparent 37%),
    linear-gradient(135deg, #805a3e 0%, #4b3021 48%, #2b1b14 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 15px 34px rgba(0, 0, 0, 0.25);
}

.payment-card::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -110px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255, 255, 255, 0.03), 0 0 0 58px rgba(255, 255, 255, 0.025);
}

.payment-card-top,
.payment-card-bottom,
.card-number,
.chip { position: relative; z-index: 1; }
.payment-card-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.payment-card-top > span { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; opacity: 0.75; }
.payment-card-top img { width: 74px; max-height: 38px; padding: 5px 7px; object-fit: contain; background: rgba(255, 255, 255, 0.94); border-radius: 7px; }
.chip {
  width: 48px;
  height: 36px;
  margin-top: 18px;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: linear-gradient(145deg, #e6c993, #ad834a);
  border: 1px solid rgba(40, 26, 17, 0.4);
  border-radius: 7px;
}
.chip span { border-right: 1px solid rgba(56, 36, 22, 0.3); }
.chip span:last-child { border: 0; }
.card-number { font-size: clamp(21px, 3vw, 29px); letter-spacing: 0.075em; text-shadow: 0 2px 5px rgba(0, 0, 0, 0.22); }
.payment-card-bottom { display: grid; grid-template-columns: 1fr auto auto; gap: 28px; }
.payment-card-bottom span { min-width: 0; display: grid; gap: 4px; }
.payment-card-bottom small { font-size: 9px; letter-spacing: 0.12em; opacity: 0.62; }
.payment-card-bottom strong { overflow: hidden; font-size: 13px; letter-spacing: 0.04em; text-overflow: ellipsis; white-space: nowrap; }

.detail-layout {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 18px;
}

.location-card { padding: 22px; }
.section-title { margin-bottom: 21px; display: flex; align-items: center; gap: 12px; }
.section-title h2 { margin: 0 0 3px; font-size: 17px; }
.section-title p { margin: 0; color: var(--muted); font-size: 12px; }
.compact-title { margin-bottom: 16px; }
.location-summary { padding: 18px; display: flex; align-items: center; gap: 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 13px; }
.location-summary img { width: 52px; height: 37px; object-fit: cover; border-radius: 5px; box-shadow: 0 0 0 1px rgba(31, 25, 21, 0.14); }
.location-summary div { display: grid; gap: 2px; }
.location-summary strong { font-size: 18px; }
.location-summary span { color: var(--muted); font-size: 12px; }
.mini-list { margin: 15px 0 0; }
.mini-list > div { padding: 10px 0; display: flex; align-items: baseline; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.mini-list > div:last-child { border: 0; }
.mini-list dt { color: var(--muted); }
.mini-list dd { margin: 0; text-align: right; }

.detail-section { margin-top: 18px; padding: 23px; }
.detail-grid { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.detail-grid > div { min-height: 72px; padding: 14px 0; border-top: 1px solid var(--line); }
.detail-grid .span-2 { grid-column: span 2; }
.detail-grid dt { margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.detail-grid dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.detail-grid dd code { color: #2d2621; font-weight: 700; }
.wrap-code { white-space: normal; word-break: break-all; }
.protected-value { color: var(--success); font-weight: 700; }

/* Login */
.login-page { min-height: 100vh; background: #1f1814; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.06fr) minmax(420px, 0.94fr); }
.login-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background:
    radial-gradient(circle at 20% 20%, rgba(212, 161, 105, 0.26), transparent 30%),
    radial-gradient(circle at 70% 68%, rgba(180, 111, 63, 0.23), transparent 32%),
    linear-gradient(145deg, #3d2b20, #17110e 70%);
}
.login-visual::before,
.login-visual::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}
.login-visual::before { width: 520px; height: 520px; right: -150px; top: -120px; box-shadow: 0 0 0 60px rgba(255,255,255,.018), 0 0 0 120px rgba(255,255,255,.012); }
.login-visual::after { width: 340px; height: 340px; left: -130px; bottom: -120px; box-shadow: 0 0 0 45px rgba(255,255,255,.018); }
.visual-overlay { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, transparent, #000); }
.visual-content { position: relative; z-index: 2; max-width: 600px; padding: 9vw 8vw; }
.visual-content > img { width: 112px; height: 112px; margin-bottom: 35px; object-fit: contain; opacity: .92; }
.visual-content h1 { margin: 10px 0 18px; font-size: clamp(39px, 4.4vw, 66px); line-height: 1.08; letter-spacing: -0.04em; }
.visual-content > p:last-child { max-width: 430px; margin: 0; color: rgba(255,255,255,.61); font-size: 16px; }
.login-panel { min-height: 100vh; padding: 45px; display: grid; place-items: center; background: var(--surface-soft); }
.login-form-wrap { width: min(100%, 430px); }
.login-form-wrap h2 { margin: 7px 0 8px; font-size: 32px; letter-spacing: -0.025em; }
.login-intro { margin: 0 0 29px; color: var(--muted); font-size: 15px; }
.login-form-wrap .form-field { margin-bottom: 18px; }
.login-form-wrap input { height: 50px; }
.login-form-wrap .btn { height: 50px; }
.login-footnote { margin: 24px 0 0; color: #aaa097; font-size: 11px; text-align: center; }
.mobile-logo { display: none; }

.error,
.notice {
  margin-bottom: 20px;
  padding: 13px 15px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid;
  border-radius: 11px;
}
.error { color: var(--danger); background: var(--danger-bg); border-color: #f2ceca; }
.notice { color: var(--success); background: var(--success-bg); border-color: #cae6d6; }
.dashboard-notice { margin-top: -8px; }
.error strong,
.notice strong { flex: 0 0 auto; }
.error span,
.notice span { color: inherit; opacity: .9; }

/* Demo form */
.form-shell { width: min(100%, 960px); }
.submit-form { padding: 28px; }
fieldset { margin: 0; padding: 0; border: 0; }
fieldset + fieldset { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
legend { width: 100%; margin-bottom: 18px; font-size: 17px; font-weight: 700; }
.form-grid { display: grid; gap: 17px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.nested-grid { gap: 12px; }
.form-actions { margin-top: 30px; display: flex; gap: 10px; }

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

@media (max-width: 900px) {
  .shell { padding: 26px 18px 42px; }
  .header-inner { padding: 8px 18px; }
  .detail-layout { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { padding: 28px 20px; }
  .mobile-logo { display: block; margin-bottom: 28px; }
  .mobile-logo img { width: 82px; height: 82px; object-fit: contain; }
}

@media (max-width: 640px) {
  .app-header { position: relative; }
  .header-inner { flex-wrap: wrap; gap: 6px 12px; }
  .header-actions { max-width: 100%; flex-wrap: wrap; justify-content: flex-end; }
  .identity small { display: none; }
  .header-actions .header-link:first-child { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading > .btn { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 82px; }
  .country-amount-header { align-items: stretch; flex-direction: column; }
  .country-amount-total { width: 100%; min-width: 0; display: flex; align-items: center; justify-content: space-between; text-align: left; }
  .country-amount-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .filter-search,
  .filter-actions { grid-column: 1 / -1; }
  .table-toolbar { align-items: flex-start; }
  .page-count { display: none; }
  .pager { justify-content: space-between; gap: 8px; }
  .pager > span:not(.btn) { display: none; }
  .payment-card-panel { padding: 13px; }
  .payment-card { min-height: 230px; padding: 21px; }
  .card-number { font-size: 17px; letter-spacing: .045em; }
  .payment-card-bottom { gap: 13px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid .span-2 { grid-column: span 1; }
  .form-grid.cols-2 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .submit-form { padding: 20px; }
  .form-actions { flex-direction: column; }
  .dialog-header { padding: 18px; }
  .dialog-summary { padding: 16px 18px 0; }
  .export-dialog-form { padding: 16px 18px 18px; }
  .dialog-actions { grid-template-columns: 1fr 1fr; }
  .dialog-actions > .btn:first-child { grid-column: 1 / -1; order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* RMS wordmark is a horizontal dark SVG, so keep its original palette legible
   against the inherited dark admin header and login illustration. */
.identity img { width: 96px; height: 42px; padding: 5px; border-radius: 7px; background: #fff; opacity: 1; }
.visual-content > img { width: 190px; height: auto; padding: 10px 12px; border-radius: 9px; background: #fff; opacity: 1; }
@media (max-width: 900px) {
  .mobile-logo img { width: 156px; height: auto; }
}

.settings-card { padding: 22px; }
.settings-card h2 { margin: 0 0 8px; }
.settings-card > p { margin: 0 0 18px; color: var(--muted); }
.settings-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.settings-form input, .settings-form select, .settings-form textarea {
  min-height: 42px; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 0 12px; min-width: 180px; background: #fff;
}
.settings-table { width: 100%; border-collapse: collapse; }
.settings-table th, .settings-table td { padding: 13px 10px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.settings-table td code.wrap-code { display: block; max-width: 620px; }
.settings-note { font-size: 12px; color: var(--muted); }
.country-code-mark { flex: 0 0 auto; min-width: 26px; padding: 2px 4px; border-radius: 4px; color: var(--brand); background: var(--brand-light); font-size: 10px; font-weight: 700; text-align: center; }

/* Payment and domain settings */
.settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(360px,100%),1fr));gap:20px}.settings-card{padding:22px}.settings-card h2{margin:0 0 6px}.settings-card>p{margin:0 0 18px;color:#756b64}.settings-form{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:18px}.settings-form input,.settings-form select,.settings-form textarea{min-height:42px;border:1px solid #d9d1ca;border-radius:8px;padding:0 12px;flex:1;min-width:120px}.settings-form textarea{padding:12px;min-height:96px;resize:vertical}.settings-table{width:100%;border-collapse:collapse}.settings-table th,.settings-table td{padding:10px 8px;border-top:1px solid #eee7e1;text-align:left;vertical-align:top}.settings-table code{word-break:break-all}.settings-actions{display:flex;gap:8px;flex-wrap:wrap}.settings-actions form{margin:0}.settings-note{font-size:12px;color:#877b72}.pill-on{color:#126b40;background:#e4f7ed}.pill-off{color:#8a3d35;background:#fbe9e6}.settings-pill{display:inline-flex;padding:4px 9px;border-radius:999px;font-size:12px;font-weight:700}.span-all{grid-column:1/-1}.mono-lines{white-space:pre-line;word-break:break-word}
.settings-wide-label { flex: 2 1 320px; }
.settings-actions-spaced { margin-bottom: 10px; }
.settings-form-compact { margin: 0; }

.links-table-panel { margin-top: 18px; }
