:root {
  color-scheme: light;
  --ink: #142b34;
  --muted: #53676d;
  --line: #dce6e4;
  --paper: #f3f7f6;
  --white: #fff;
  --accent: #116558;
  --deep: #123c37;
  font: 16px/1.55 system-ui, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); min-width: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 2px solid #117668; outline-offset: 3px; }
h1, h2, p { margin: 0; }
.shell { width: min(100% - 3rem, 74rem); margin-inline: auto; }
.masthead { background: var(--white); border-bottom: 1px solid var(--line); }
.masthead-inner { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { color: var(--ink); text-decoration: none; display: inline-flex; gap: .65rem; align-items: center; font-size: 1.2rem; }
.brand-mark { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: .65rem; background: var(--deep); color: #d9fae9; font-weight: 800; }
.header-actions, .pagination { display: flex; gap: .55rem; align-items: center; }
.ghost, .primary { min-height: 2.65rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--white); padding: .5rem .85rem; color: var(--ink); font-weight: 660; }
.ghost:hover:not(:disabled) { background: #eaf2ef; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--white); }
.primary:hover:not(:disabled) { background: var(--deep); }
.login {
  display: grid; grid-template-columns: 1fr .92fr; margin: clamp(2rem, 10vh, 7rem) auto;
  max-width: 58rem; background: var(--white); border-radius: 1.2rem; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 14px 36px #123c370c;
}
.login-intro { padding: clamp(1.5rem, 5vw, 4.5rem); background: var(--deep); color: #fff; }
.section-label { color: var(--accent); font-weight: 750; font-size: .85rem; }
.login-intro .section-label { color: #a9deca; }
.login-intro h1 { font-size: clamp(2rem, 4.2vw, 3.4rem); line-height: 1.25; margin: .75rem 0 1rem; }
.login-intro p { color: #def2ed; max-width: 25ch; }
.login-form { padding: clamp(1.5rem, 4vw, 3rem); display: grid; align-content: center; gap: .45rem; }
.login-form h2 { margin-bottom: .65rem; }
.login-form label:not(:first-of-type) { margin-top: .55rem; }
.login-form button { margin-top: .75rem; }
label { display: block; font-size: .87rem; font-weight: 680; }
input, select { width: 100%; min-height: 2.65rem; border: 1px solid #bacdc9; border-radius: .55rem; padding: .45rem .65rem; color: var(--ink); background: var(--white); }
.store-heading { padding-block: 2.75rem 1.45rem; }
.store-heading h1 { margin: .2rem 0; font-size: clamp(1.9rem, 4vw, 3.1rem); overflow-wrap: anywhere; text-align: start; }
.store-origin { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin-bottom: 1.5rem; }
.metric { padding: 1rem 1.1rem; border-radius: .82rem; background: var(--white); border: 1px solid var(--line); display: grid; gap: .3rem; }
.metric span { font-size: .88rem; color: var(--muted); }
.metric strong { font-size: 1.85rem; font-variant-numeric: tabular-nums; }
.metric-main { background: var(--deep); color: var(--white); border-color: var(--deep); }
.metric-main span { color: #def2ed; }
.orders { margin-bottom: 3rem; background: var(--white); border: 1px solid var(--line); border-radius: .95rem; padding: clamp(.8rem, 2.4vw, 1.5rem); }
.orders-heading { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .85rem; }
.orders-heading p { color: var(--muted); font-size: .85rem; }
.filters { display: grid; grid-template-columns: minmax(9rem, 1.35fr) repeat(3, minmax(8.25rem, 1fr)) auto auto; gap: .55rem; align-items: end; }
.filters label { margin-bottom: .25rem; }
.filters > div { min-width: 0; }
.table-wrap { margin-top: 1.15rem; }
table { width: 100%; border-collapse: collapse; text-align: start; }
th { text-align: start; background: #eff5f3; color: var(--muted); font-size: .84rem; }
td, th { padding: .78rem .75rem; border-bottom: 1px solid var(--line); }
td { font-size: .91rem; }
td:first-child { max-width: 20rem; overflow-wrap: anywhere; font-weight: 680; }
td:nth-child(3) { font-weight: 680; }
.amount-caption { display: block; font-size: .75rem; color: var(--muted); font-weight: 450; }
.chip { display: inline-block; padding: .25rem .6rem; border-radius: 1rem; color: #455c67; background: #eaf0f4; font-weight: 700; font-size: .78rem; white-space: nowrap; }
.chip.paid { color: #116345; background: #e0f3e9; }
.chip.failed, .chip.test_failed { color: #913b34; background: #fceae7; }
.chip.review_required, .chip.processing { color: #785300; background: #fff2d6; }
.order-result { display: inline-grid; justify-items: start; gap: .35rem; max-width: 32ch; }
.order-reason { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.order-reason code { display: block; color: var(--ink); unicode-bidi: isolate; text-align: end; }
.pagination { justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; font-size: .87rem; }
.notice { color: var(--muted); font-size: .91rem; }
.notice:not(:empty) { margin-top: 1rem; }
.error { color: #913b34; }
.cell-label { display: none; }
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media(max-width: 58rem) {
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media(max-width: 40rem) {
  .shell { width: calc(100% - 1.5rem); }
  .masthead-inner { min-height: 3.9rem; }
  .login { grid-template-columns: 1fr; margin-block: 1.25rem; }
  .login-intro p { max-width: none; }
  .store-heading { padding-block: 1.75rem 1rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .metric { padding: .7rem .85rem; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .search { grid-column: 1 / -1; }
  .table-wrap thead { position: absolute; inline-size: 1px; block-size: 1px; clip-path: inset(50%); overflow: hidden; }
  table, tbody, tr, td { display: block; }
  tbody tr { background: #f8fbfa; border: 1px solid var(--line); border-radius: .65rem; padding: .3rem .65rem; margin-block: .55rem; }
  tbody td { display: flex; gap: .65rem; justify-content: space-between; align-items: start; padding: .45rem 0; text-align: end; }
  td:first-child { max-width: none; }
  td:last-child { border: 0; }
  .cell-label { display: inline; color: var(--muted); font-weight: 500; text-align: start; flex-shrink: 0; font-size: .83rem; }
  .order-result { justify-items: end; min-width: 0; }
}
