:root {
  color: #17202a;
  background: #f4f6f8;
  font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; }
header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem max(1rem, calc((100vw - 1440px) / 2));
  background: #17202a;
  color: #fff;
}
header h1 { flex: 1; margin: 0; font-size: 1.2rem; }
header form { margin: 0; }
.admin-user { color: #d9e2ea; }
main { max-width: 1440px; margin: 1.5rem auto 3rem; padding: 0 1rem; }
h2 { margin: 0; font-size: 1.15rem; }
p { margin: .35rem 0; }
.muted { color: #5e6a75; }
.tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.tabs button[aria-current="page"] { background: #124f80; }
section { min-width: 0; padding: 1rem; border: 1px solid #d9dee3; background: #fff; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
button {
  min-height: 2.4rem;
  padding: .5rem .8rem;
  border: 1px solid #1769aa;
  border-radius: 4px;
  background: #1769aa;
  color: #fff;
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}
button:hover { background: #125588; }
button:focus-visible, input:focus-visible { outline: 3px solid #82c4f4; outline-offset: 2px; }
button:disabled { cursor: wait; opacity: .65; }
button.secondary { border-color: #b7c0c8; background: #fff; color: #263746; }
button.secondary:hover { background: #edf1f4; }
button.danger { border-color: #b42318; background: #b42318; }
.link { min-height: auto; padding: .25rem .4rem; border: 0; background: transparent; color: #fff; text-decoration: underline; }
.link:hover { background: #263746; }
.notice { min-height: 1.5rem; margin: 0 0 .75rem; color: #17613b; }
.notice:empty { display: none; }
.notice.error, .error-text { color: #b42318; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .65rem .6rem; border-bottom: 1px solid #e6e9ec; text-align: left; vertical-align: top; }
th { color: #40505e; font-size: .85rem; font-weight: 650; }
td small { display: block; margin-top: .25rem; color: #5e6a75; }
.mono, code { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; }
.amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.actions { min-width: 180px; }
.actions button { margin: 0 .35rem .35rem 0; }
.status { white-space: nowrap; }
.status-pending { color: #835b00; }
.status-processing, .status-awaiting_customer_confirmation { color: #155a8a; }
.status-completed, .status-active { color: #17613b; }
.status-failed, .status-inactive { color: #a22c26; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; margin: 1rem 0; padding: 1rem; background: #f7f9fa; }
label { display: block; min-width: 155px; font-weight: 600; }
label.wide { flex: 1 1 300px; }
input { display: block; width: 100%; min-height: 2.4rem; margin-top: .3rem; padding: .5rem; border: 1px solid #b7c0c8; border-radius: 3px; color: inherit; font: inherit; }
td input { min-width: 110px; margin: 0; }
.secret-result { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .8rem; border: 1px solid #d4a72c; background: #fff8db; white-space: pre-wrap; overflow-wrap: anywhere; }
.secret-result[hidden] { display: none; }
.secret-result code { flex: 1 1 300px; user-select: all; }
.empty-state { padding: 2rem 1rem; color: #5e6a75; text-align: center; }
.wrap { min-width: 160px; max-width: 280px; overflow-wrap: anywhere; }
dialog { width: min(42rem, calc(100vw - 2rem)); max-height: 85vh; padding: 1.25rem; border: 1px solid #c3ccd4; border-radius: 6px; color: inherit; }
dialog::backdrop { background: rgb(20 30 40 / 55%); }
.account-value { max-height: 45vh; overflow: auto; padding: .9rem; background: #f4f6f8; white-space: pre-wrap; overflow-wrap: anywhere; }
.form-dialog { width: min(30rem, calc(100vw - 2rem)); }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.auth .panel { width: min(26rem, calc(100vw - 2rem)); margin: 12vh auto; padding: 2rem; border: 1px solid #d9dee3; background: #fff; }
.auth form { margin-top: 1.25rem; }

@media (max-width: 640px) {
  header { flex-wrap: wrap; }
  header h1 { flex-basis: 100%; }
  .section-title { align-items: flex-start; }
  .inline-form { align-items: stretch; }
  .inline-form label, .inline-form label.wide { flex: 1 1 100%; }
  .inline-form button { width: 100%; }
  section { padding: .7rem; }
  th, td { padding: .55rem .45rem; }
}
