:root { font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft Yahei",sans-serif; font-synthesis: none; color: #192e37; background: #f5f7f8; -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
body, button, input, select, textarea { font-family: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: #19666b; text-underline-offset: 3px; }
button, .button { cursor: pointer; border: 1px solid #cbd7db; background: #fff; color: #294550; border-radius: 8px; font-size: 13px; font-weight: 600; line-height: 1.4; padding: 9px 14px; }
button:hover:not(:disabled) { background: #edf4f4; }
button:disabled { opacity: .48; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #59a6a9; outline-offset: 2px; }
.primary { background: #19565b; color: white; border-color: #19565b; }
.primary:hover:not(:disabled) { background: #12494c; }
.danger { color: #994439; }
input, select, textarea { font-size: 14px; font-weight: 400; outline: none; width: 100%; min-width: 0; padding: 10px; border: 1px solid #c8d5d8; border-radius: 7px; background: #fff; color: #17313a; }
input:disabled, select:disabled { color: #637681; background: #f4f6f7; }
label { font-size: 13px; font-weight: 600; display: grid; gap: 6px; }
h1,h2,h3,p { margin: 0; }
h1 { font-size: clamp(25px, 3vw, 32px); line-height: 1.3; letter-spacing: -.04em; }
h2 { font-size: 18px; line-height: 1.4; }
.mark { width: 35px; height: 35px; display: inline-grid; place-items: center; border-radius: 11px; background: #d5efdf; color: #214d45; font-size: 23px; line-height: 1; flex-shrink: 0; }
.login-screen { min-height: 100svh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 65% 0%,#dfedeb 0,transparent 55%),#f4f6f6; }
.login-box { width: min(100%,405px); padding: 30px; background: #fff; border: 1px solid #dce4e4; border-radius: 18px; box-shadow: 0 18px 60px -38px #23454e80; }
.login-heading,.identity { display: flex; align-items:center; gap: 11px; }
.brand { font-size: 14px; font-weight: 700; color: #31575b; }
.login-box h1 { margin: 25px 0 20px; font-size: 26px; }
#login-form, #fields { display: grid; gap: 15px; }
#login-form button { margin-top: 4px; }
#workspace { display:grid; grid-template-columns: 204px minmax(0,1fr); min-height:100svh; }
.rail { background: #17373e; color: #e1eeec; }
.rail-inner { position: sticky; top: 0; min-height: 100svh; padding: 26px 13px 16px; display: flex; flex-direction: column; gap: 28px; }
.identity { padding-inline: 5px; }
.identity strong, .identity small { display:block; }
.identity strong { font-size: 16px; }
.identity small { margin-top: 3px; font-size: 11px; color: #b8d2d0; }
nav { display: grid; gap: 4px; }
nav a { display:block; border-radius: 8px; padding: 10px 14px; color: #c4d9d8; text-decoration:none; font-size: 14px; font-weight: 550; white-space: nowrap; }
nav a:hover { background: #ffffff10; }
nav a[aria-current="page"] { color: #fff; background: #33565a; box-shadow: inset 3px 0 #9bd7c3; }
.session { margin-top:auto; border-top: 1px solid #ffffff23; padding:15px 5px 0; display:flex; align-items:center; justify-content:space-between; gap:6px; }
.session span { overflow-wrap:anywhere; font-size: 12px; }
.session button { color:#cae2dd; background:transparent; border:0; font-size:12px; padding:5px; white-space:nowrap; }
.session button:hover:not(:disabled) { background:#ffffff16; }
.desk { padding: clamp(20px,4vw,52px); max-width: 1520px; width:100%; margin-inline:auto; }
.page-header,.section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.page-header { margin-bottom:24px; }
.page-header p { margin-top:6px; color:#62757c; font-size:13px; }
.filters { display:flex; align-items:end; flex-wrap:wrap; gap:10px; padding:13px 15px; margin-bottom:16px; border:1px solid #d9e3e4; border-radius:12px; background:#fff; }
.filters label { min-width: 125px; max-width: 290px; flex:1; font-size:12px; }
.filters input,.filters select { padding:8px; font-size:13px; }
.flash,.error { padding:10px 12px; font-size:13px; line-height:1.55; border-radius:8px; overflow-wrap:anywhere; }
.flash { color:#27554e; background:#e4f2e9; margin-bottom:14px; }
.error,.flash.error { color:#933c32; background:#fbede9; }
.loading,.empty { font-size:14px; padding:24px; color:#667a81; }
.panel { background:#fff; border:1px solid #d9e3e4; border-radius:14px; overflow:hidden; }
.panel + .panel { margin-top:20px; }
.section-head { padding:16px 18px; border-bottom:1px solid #e1e8e9; }
.section-head h2 { font-size:16px; }
.scroll { overflow:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th,td { padding:12px 14px; text-align:left; vertical-align:middle; border-bottom:1px solid #e7ecee; }
th { background:#f5f8f8; font-size:12px; color:#576d74; font-weight:600; white-space:nowrap; }
tbody tr:last-child td { border-bottom:0; }
tbody tr:hover { background:#fafcfc; }
.money,.timestamp { font-variant-numeric:tabular-nums; white-space:nowrap; }
.mono { font-family: ui-monospace,Menlo,monospace; overflow-wrap:anywhere; font-size:12px; }
.subline { display:block; margin-top:3px; color:#677c82; font-size:11px; }
.cell-actions { display:flex; flex-wrap:wrap; gap:4px 6px; min-width:90px; }
.cell-actions button,.light { background:transparent; color:#176368; border:0; padding:4px; font-size:12px; font-weight:600; }
.cell-actions button.danger { color:#974337; }
.pill { display:inline-block; border-radius:5px; padding:3px 7px; white-space:nowrap; color:#4b6070; background:#edf1f3; font-size:11px; }
.pill.good { background:#e6f4eb; color:#25684a; }
.pill.warn { background:#fff2d9; color:#785314; }
.pill.bad { background:#f9ebe7; color:#984635; }
.stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:10px; margin-bottom:20px; }
.stat { background:#fff; border:1px solid #d9e3e4; border-radius:13px; padding:17px; }
.stat:first-child { background:#eaf3ed; border-color:#c6dacb; }
.stat dt { font-size:12px; color:#557069; }
.stat dd { margin:8px 0 0; font-size:clamp(19px,2.4vw,29px); font-weight:650; letter-spacing:-.035em; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
dl { margin:0; }
.pagination { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px; font-size:12px; color:#62757c; border-top:1px solid #e7ecee; padding:10px 14px; }
.pagination button { font-size:12px; padding:5px 9px; }
dialog { color:#192e37; width:min(460px,calc(100% - 28px)); max-height:90svh; border:1px solid #dbe4e5; border-radius:16px; padding:0; box-shadow:0 28px 80px #142a3540; }
dialog::backdrop { background:#152b3580; }
#editor { padding:22px; }
.dialog-head,.dialog-actions { display:flex; align-items:center; gap:10px; }
.dialog-head { justify-content:space-between; margin-bottom:20px; }
.dialog-head button { border:0; background:transparent; color:#64777d; font-size:23px; padding:0 5px; }
.dialog-actions { justify-content:flex-end; padding-top:18px; }
#form-error:not([hidden]) { margin-top:14px; }
.hint { font-size:12px; font-weight:400; color:#657980; line-height:1.55; }
@media(max-width:760px) {
  #workspace { display:block; }
  .rail-inner { position:static; min-height:auto; padding:14px 16px 7px; display:grid; grid-template-columns:1fr auto; gap:12px; }
  .identity { padding:0; }
  .identity strong { font-size:15px; }
  .session { grid-column:2; grid-row:1; margin:0; border:0; padding:0; }
  .session span { display:none; }
  nav { grid-column:1/-1; display:flex; overflow-x:auto; gap:4px; }
  nav a { padding:7px 11px; }
  nav a[aria-current="page"] { box-shadow:inset 0 -2px #9bd7c3; }
  .desk { padding:21px 13px; }
  .page-header { margin-bottom:16px; }
  .stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stat { padding:13px; }
  table { min-width:620px; }
  .filters { padding:11px; }
}
td.mono { min-width: 155px; max-width: 240px; }
.desk { container-type: inline-size; }
@container (max-width: 740px) {
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stats .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.ledger-balance strong { font-weight: 650; }
.ledger-balance .increase { color: #25684a; }
.ledger-balance .decrease { color: #974337; }
.ledger-order { min-width: 146px; max-width: 260px; }
.ledger-order button { text-align: left; overflow-wrap: anywhere; padding-left: 0; }
.pagination select { width: auto; font-size: 12px; padding: 6px; }
.pagination input { width: 62px; font-size: 12px; padding: 6px; }
.merchant-field { display:grid; gap:6px; font-size:13px; font-weight:600; }
.merchant-field button { text-align:left; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.filters .merchant-field { min-width:125px; max-width:290px; flex:1; font-size:12px; }
.dialog-body { padding:20px; }
#merchant-dialog { width:min(520px,calc(100% - 24px)); }
.picker-search { display:flex; align-items:end; flex-wrap:wrap; gap:8px; padding-bottom:12px; border-bottom:1px solid #e2e8ea; }
.picker-search label:first-child { flex:1; min-width:180px; }
.merchant-choices { display:grid; max-height:43vh; overflow:auto; }
.merchant-choices button { text-align:left; border:0; border-bottom:1px solid #e4e9eb; border-radius:0; }
.merchant-choices .subline { overflow-wrap:anywhere; }
#log-dialog { width:min(780px,calc(100% - 24px)); }
.log-heading { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.log-meta { display:grid; grid-template-columns:minmax(95px,auto) 1fr; gap:6px 14px; margin:16px 0; font-size:13px; }
.log-meta dt { color:#577078; }
.log-meta dd { margin:0; overflow-wrap:anywhere; }
.log-payload + .log-payload { margin-top:18px; }
.log-payload h3 { font-size:15px; border-top:1px solid #d9e3e4; padding-top:12px; }
.log-payload h4 { font-size:11px; color:#657780; margin:10px 0 4px; }
.log-payload pre { margin:0; padding:10px; max-height:270px; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere;
  font:12px/1.6 ui-monospace,Menlo,monospace; color:#254452; background:#f2f5f6; border-radius:7px; }

#toolbar { display: flex; align-items: center; gap: 8px; }

.log-related:not(:empty) { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }

.order-filters { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:10px 18px; }
.order-filter-main { grid-column:1/-1; display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,155px),1fr)); align-items:end; gap:10px; }
.order-filters label,.order-filters .merchant-field { min-width:0; max-width:none; }
.order-filter-actions { display:flex; align-items:center; gap:9px; align-self:start; }
.order-filter-more { min-width:0; }
.order-filter-more summary { cursor:pointer; color:#22646a; font-weight:600; font-size:13px; padding:9px 0; }
.order-filter-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:6px 0; }
.order-filter-range { min-width:0; margin:0; border:1px solid #dbe4e5; border-radius:8px; padding:8px 10px 10px; display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap:8px; }
.order-filter-range legend { padding:0 4px; font-size:12px; font-weight:600; color:#35545a; }
.order-filter-range label { color:#526a70; }
td.order-email { min-width:120px; max-width:260px; overflow-wrap:anywhere; }
@container (max-width:640px) {
  .order-filters { display:flex; flex-direction:column; align-items:stretch; }
  .order-filter-main,.order-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .order-filter-main label:has([name=orderId]),.order-filter-main label:has([name=paypalEmail]),.order-filter-range { grid-column:1/-1; }
  .order-filter-main .merchant-field { grid-column:1/-1; }
  .order-filter-actions { align-self:flex-end; }
  .record-table,.record-table tbody { display:block; min-width:0; width:100%; }
  .record-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .record-table tbody tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px 14px; padding:15px; border-bottom:1px solid #dbe4e5; }
  .record-table tbody tr:last-child { border-bottom:0; }
  .record-table td { display:grid; align-content:start; justify-items:start; gap:4px; border:0; padding:0; min-width:0; max-width:none; white-space:normal; overflow-wrap:anywhere; }
  .record-table td::before { content:attr(data-label); color:#61777d; font:600 11px/1.3 Inter,-apple-system,sans-serif; }
  .record-table td.order-number,.record-table td.order-email,.record-table td.identity-cell,.record-table td.row-actions { grid-column:1/-1; }
}

#account-paste { resize:vertical; min-height:7em; line-height:1.5; font-family:ui-monospace,Menlo,monospace; }

.scope-note { padding:12px 18px; color:#456069; background:#f5f9f8; font-size:12px; line-height:1.5; }
.identity-cell .subline { overflow-wrap:anywhere; }
