/* ===== tokens ============================================================
   Light is the default. Dark exists behind the Day/Night toggle and the
   viewer's OS preference, but every token is declared here first.
   ========================================================================= */
:root {
  --bg:          #f4f6f6;
  --bg-elev:     #ffffff;
  --bg-elev-2:   #fafbfb;
  --bg-inset:    #eef1f1;
  --line:        #d8dfdf;
  --line-soft:   #e7ecec;
  --text:        #0e1a1c;
  --text-dim:    #55666a;
  --text-faint:  #82969a;

  --brand:       #0f766e;
  --brand-hi:    #0a5c55;
  --brand-soft:  rgba(15, 118, 110, .10);
  --on-brand:    #ffffff;

  --ok:          #0f8a5f;
  --warn:        #a86a00;
  --danger:      #c0392f;
  --info:        #0b6fa8;
  --money:       #0f8a5f;

  --radius:      12px;
  --radius-sm:   9px;
  --shadow:      0 1px 2px rgba(14, 26, 28, .05), 0 8px 24px -14px rgba(14, 26, 28, .18);
  --shadow-lift: 0 2px 4px rgba(14, 26, 28, .06), 0 18px 40px -18px rgba(14, 26, 28, .28);

  --ff:   "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:         #0b1213;
    --bg-elev:    #121b1d;
    --bg-elev-2:  #182325;
    --bg-inset:   #0e1819;
    --line:       #243436;
    --line-soft:  #1d2b2d;
    --text:       #e8efef;
    --text-dim:   #9fb3b5;
    --text-faint: #708587;
    --brand:      #2dd4bf;
    --brand-hi:   #5eead4;
    --brand-soft: rgba(45, 212, 191, .12);
    --on-brand:   #04211f;
    --ok:         #34d399;
    --warn:       #fbbf24;
    --danger:     #f87171;
    --info:       #38bdf8;
    --money:      #34d399;
    --shadow:      0 1px 2px rgba(0,0,0,.4), 0 10px 30px -18px rgba(0,0,0,.8);
    --shadow-lift: 0 2px 6px rgba(0,0,0,.5), 0 20px 46px -20px rgba(0,0,0,.9);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg:         #0b1213;
  --bg-elev:    #121b1d;
  --bg-elev-2:  #182325;
  --bg-inset:   #0e1819;
  --line:       #243436;
  --line-soft:  #1d2b2d;
  --text:       #e8efef;
  --text-dim:   #9fb3b5;
  --text-faint: #708587;
  --brand:      #2dd4bf;
  --brand-hi:   #5eead4;
  --brand-soft: rgba(45, 212, 191, .12);
  --on-brand:   #04211f;
  --ok:         #34d399;
  --warn:       #fbbf24;
  --danger:     #f87171;
  --info:       #38bdf8;
  --money:      #34d399;
  --shadow:      0 1px 2px rgba(0,0,0,.4), 0 10px 30px -18px rgba(0,0,0,.8);
  --shadow-lift: 0 2px 6px rgba(0,0,0,.5), 0 20px 46px -20px rgba(0,0,0,.9);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--ff);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--brand); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: content-box; }

.hidden { display: none !important; }

/* ===== login ============================================================= */
#login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 20px;
  background:
    linear-gradient(180deg, var(--bg-inset), var(--bg) 380px);
}

.login-card {
  width: 100%;
  max-width: 392px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 34px 30px;
  box-shadow: var(--shadow-lift);
}

.login-card .brand { justify-content: center; margin-bottom: 4px; }

.login-sub {
  text-align: center;
  color: var(--text-dim);
  margin: 0 0 26px;
  font-size: 13.5px;
}

.field { margin-bottom: 15px; }

.field > label {
  display: block;
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 6px;
}

.input, .select {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
  transition: border-color .14s, box-shadow .14s;
}
.input::placeholder { color: var(--text-faint); }
.input:focus, .select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}
.input[aria-invalid="true"] { border-color: var(--danger); }

textarea.input { resize: vertical; min-height: 84px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 10px 17px;
  font-weight: 600;
  font-size: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text);
  transition: background .14s, border-color .14s, transform .06s;
}
.btn:hover { background: var(--bg-inset); border-color: var(--text-faint); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}
.btn-primary:hover { background: var(--brand-hi); border-color: var(--brand-hi); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }

.form-error {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 38%, transparent);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 18px;
  flex-wrap: wrap;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}
.check input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

.linkish {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  padding: 0;
  border-radius: 4px;
}
.linkish:hover { text-decoration: underline; }

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-faint);
  font-size: 12px;
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

.demo-note {
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.8;
}
.demo-note code {
  font-family: var(--mono);
  background: var(--bg-inset);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text-dim);
  font-size: 12px;
}

/* ===== sign up / verify ================================================== */
.signup-card { max-width: 440px; }
.verify-card { max-width: 400px; text-align: center; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.req { color: var(--danger); font-weight: 400; }
.hint { font-size: 11.5px; color: var(--text-faint); margin-top: 6px; line-height: 1.5; }

/* Country code and number read as one control, so they share a border. */
.phone-row { display: flex; gap: 0; }
.phone-row .select {
  width: 128px;
  flex: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-right: none;
  font-family: var(--mono);
  font-size: 13px;
  padding-right: 26px;
  background-position: right 7px center;
}
.phone-row .input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  min-width: 0;
}
.phone-row .select:focus, .phone-row .input:focus { position: relative; z-index: 1; }

.avatar-picker {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 0 18px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
}
.avatar-preview {
  width: 62px; height: 62px;
  border-radius: 50%;
  flex: none;
  display: grid; place-items: center;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  color: var(--text-faint);
  overflow: hidden;
}
.avatar-preview.lg { width: 76px; height: 76px; }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-picker label.btn { cursor: pointer; }

/* Feedback while typing, not a gate — the server enforces the minimum. */
.strength { margin-top: 8px; display: flex; align-items: center; gap: 9px; }
.strength i {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.strength i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w, 0%);
  background: var(--c, var(--line));
  transition: width .18s, background .18s;
}
.strength span { font-size: 11px; color: var(--text-faint); min-width: 54px; }

.verify-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  margin: 2px auto 14px;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.verify-title { margin: 0 0 4px; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }

.code-input {
  font-family: var(--mono);
  font-size: 26px;
  letter-spacing: .34em;
  text-align: center;
  padding: 13px 10px;
  font-weight: 600;
}
.code-input.sm {
  font-size: 15px;
  letter-spacing: .2em;
  padding: 7px 10px;
  width: 116px;
}

.form-note {
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  color: var(--brand);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
  text-align: left;
  line-height: 1.55;
}
.form-note code {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .1em;
}

/* ===== verification banner =============================================== */
.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: color-mix(in srgb, var(--warn) 9%, var(--bg-elev));
  border: 1px solid color-mix(in srgb, var(--warn) 34%, transparent);
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 20px;
}
.banner > svg { color: var(--warn); flex: none; }
.banner-body { flex: 1; min-width: 180px; font-size: 13px; line-height: 1.5; }
.banner-body strong { display: block; }
.banner-body span { color: var(--text-dim); font-size: 12.5px; }
.banner-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }

/* ===== my account ======================================================== */
.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.section-title {
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
  vertical-align: 1px;
  margin-left: 4px;
}
.badge.ok { background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); }
.badge.no { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }

.input:disabled {
  background: var(--bg-inset);
  color: var(--text-dim);
  cursor: not-allowed;
}

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.summary-row:last-child { border-bottom: none; }
.summary-row .k { color: var(--text-dim); }
.summary-row .v { font-weight: 600; font-family: var(--mono); text-align: right; }
.summary-row .v.plain { font-family: var(--ff); }

@media (max-width: 980px) {
  .account-grid { grid-template-columns: 1fr; }
}

/* ===== shell ============================================================= */
#app { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-row {
  max-width: 1300px;
  margin: 0 auto;
  padding: 11px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.015em;
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--brand);
  color: var(--on-brand);
  flex: none;
}

.topbar-spacer { flex: 1; }

.balance {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-inset);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 5px 13px;
}
.balance .lbl {
  font-size: 9.5px;
  letter-spacing: .1em;
  color: var(--text-faint);
  font-weight: 600;
}
.balance .amt {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.acct {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 9px 4px 4px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.acct:hover { background: var(--bg-inset); border-color: var(--line-soft); }

.avatar {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600; font-size: 13px;
  flex: none;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.acct-name { font-weight: 600; font-size: 13px; line-height: 1.2; text-align: left; }
.acct-name small { display: block; font-weight: 400; color: var(--text-faint); font-size: 11px; }

.menu {
  position: absolute;
  right: 24px;
  top: calc(100% - 6px);
  min-width: 236px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 6px;
  z-index: 60;
}
.menu-head {
  padding: 9px 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 5px;
  display: flex; gap: 10px; align-items: center;
}
.menu-head .who { font-weight: 600; font-size: 13.5px; }
.menu-head .who small { display: block; font-weight: 400; color: var(--text-faint); font-size: 11.5px; }

.menu-item {
  width: 100%;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px;
  border-radius: 7px;
  font-size: 13.5px;
  text-align: left;
  color: var(--text-dim);
}
.menu-item:hover { background: var(--bg-inset); color: var(--text); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: color-mix(in srgb, var(--danger) 9%, transparent); }

.nav {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

/* Underline tabs, not pills — this is a workspace, not a toolbar. */
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px 12px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .14s, border-color .14s;
}
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--brand); border-bottom-color: var(--brand); }

main {
  max-width: 1300px;
  margin: 0 auto;
  padding: 26px 24px 64px;
}

.page-head { margin-bottom: 20px; }
.page-head h1 {
  margin: 0 0 3px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.page-head p { margin: 0; color: var(--text-dim); font-size: 13.5px; }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }

/* ===== stats =============================================================
   Plain figures on the page ground — they support the form, they aren't
   the point of it, so they don't get card treatment.
   ========================================================================= */
/* Fixed counts, not auto-fit: four tiles must divide evenly or one is left
   stranded in a row on its own. */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 24px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  background: var(--bg-elev);
  padding: 15px 18px;
  display: flex;
  gap: 13px;
  align-items: center;
}
.stat-ico {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  flex: none;
}
.stat .k { font-size: 11.5px; color: var(--text-dim); font-weight: 500; }
.stat .v {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.02em;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ===== new order ========================================================= */
.order-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}

.searchbox { position: relative; margin-bottom: 16px; }
.searchbox svg {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
}
.searchbox .input { padding-left: 36px; background: var(--bg-inset); }
.searchbox .input:focus { background: var(--bg-elev); }

.platform-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ptab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 13px;
}
.ptab:hover { color: var(--text); border-color: var(--text-faint); }
.ptab.active {
  color: var(--text);
  border-color: var(--brand);
  background: var(--brand-soft);
}
.ptab .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2382969a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 34px;
  cursor: pointer;
}
.select optgroup { background: var(--bg-elev); color: var(--text-faint); font-style: normal; }
.select option { background: var(--bg-elev); color: var(--text); }

.minmax {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 7px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* The two numbers the order turns on — one rule between them, no boxes. */
.meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 20px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.meta { padding: 14px 4px; }
.meta + .meta { border-left: 1px solid var(--line-soft); padding-left: 20px; }
.meta .k {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 5px;
}
.meta .v {
  font-size: 19px;
  font-weight: 600;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.meta.charge .v { color: var(--money); }
.meta .k svg { color: var(--text-faint); }

/* ===== details panel ===================================================== */
.detail-panel { position: sticky; top: 86px; }
.detail-panel .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 12px;
  margin-bottom: 18px;
}
.detail-k {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 4px;
}
.detail-v { font-weight: 600; font-size: 13.5px; word-break: break-word; }
.detail-v.ok { color: var(--ok); }

.copy-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 18px;
}

.icon-btn {
  width: 30px; height: 30px;
  border-radius: 7px;
  display: grid; place-items: center;
  color: var(--text-faint);
  border: 1px solid transparent;
  flex: none;
}
.icon-btn:hover { background: var(--bg-inset); color: var(--brand); border-color: var(--line-soft); }

.chip {
  display: inline-flex; align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--bg-inset);
  border: 1px solid var(--line-soft);
  color: var(--text-dim);
  font-family: var(--mono);
}

/* ===== history =========================================================== */
.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
}
.filter:hover { color: var(--text); border-color: var(--text-faint); }
.filter.active {
  background: var(--brand);
  color: var(--on-brand);
  border-color: var(--brand);
}
.filter .count {
  font-size: 11px;
  background: var(--bg-inset);
  color: var(--text-faint);
  border-radius: 4px;
  padding: 0 5px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.filter.active .count {
  background: color-mix(in srgb, var(--on-brand) 22%, transparent);
  color: var(--on-brand);
}

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  padding: 10px 14px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-elev-2); }

.oid { font-family: var(--mono); font-weight: 600; font-size: 13px; }
.odate {
  color: var(--text-faint);
  font-size: 11.5px;
  font-family: var(--mono);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.svc-name { max-width: 380px; line-height: 1.45; }
.svc-link {
  display: block;
  color: var(--info);
  font-size: 12px;
  margin-top: 4px;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.num {
  font-family: var(--mono);
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.num.money { color: var(--money); }

/* Status reads as a coloured stripe plus a word, so it registers at a glance
   without relying on colour alone. */
.status {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px 3px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg-inset);
  border-left: 3px solid currentColor;
}
.s-Pending    { color: var(--warn); }
.s-Processing { color: var(--info); }
.s-InProgress { color: var(--brand); }
.s-Completed  { color: var(--ok); }
.s-Partial    { color: var(--warn); }
.s-Canceled   { color: var(--danger); }

.progress {
  height: 3px;
  border-radius: 99px;
  background: var(--bg-inset);
  margin-top: 6px;
  overflow: hidden;
  min-width: 70px;
}
.progress i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }

.empty {
  text-align: center;
  padding: 58px 20px;
  color: var(--text-faint);
}
.empty svg { color: var(--line); margin-bottom: 12px; }
.empty h3 { margin: 0 0 6px; color: var(--text-dim); font-size: 15px; font-weight: 600; }
.empty p { margin: 0 0 18px; font-size: 13px; }

/* ===== deposits ========================================================== */
.nav-badge {
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
  font-family: var(--mono);
}

.opt { color: var(--text-faint); font-weight: 400; }

.input.file { padding: 8px 10px; cursor: pointer; }
.input.file::file-selector-button {
  font: inherit;
  font-weight: 600;
  font-size: 12.5px;
  margin-right: 10px;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-inset);
  color: var(--text);
  cursor: pointer;
}

/* The account the customer must pay into — the one block on the page that
   should look like something to copy from, so it gets its own surface. */
.bank-card {
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.bank-card h3 {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}
.bank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
}
.bank-row:last-of-type { border-bottom: none; }
.bank-row .k { font-size: 12.5px; color: var(--text-dim); }
.bank-row .v {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  text-align: right;
  word-break: break-all;
}
.bank-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.55;
}

.dep-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
.dep-item:last-child { border-bottom: none; }
.dep-ref { font-family: var(--mono); font-weight: 600; font-size: 12.5px; }
.dep-amt {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--money);
  white-space: nowrap;
}
.dep-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

.s-Approved { color: var(--ok); }
.s-Rejected { color: var(--danger); }

/* ===== receipt ===========================================================
   Laid out as a document, not a dialog: a masthead, parties side by side, the
   figure it is all about, then the audit trail.
   ========================================================================= */
.modal.receipt-modal { max-width: 560px; }
.receipt { font-size: 13.5px; position: relative; }

.receipt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--text);
}
.receipt-head .brand { font-size: 16px; gap: 8px; }
.receipt-head .kind {
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  margin-top: 6px;
  padding-left: 37px;
}
.receipt-head .ref { text-align: right; flex: none; }
.receipt-head .ref .lbl {
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}
.receipt-head .ref .n {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.01em;
}
.receipt-head .ref .d { font-size: 11px; color: var(--text-faint); font-family: var(--mono); margin-top: 3px; }

/* Payer and payee read as a pair, so they sit in one bordered band. */
.parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--line-soft);
}
.party { padding: 16px 0 16px 18px; }
.party:first-child { padding-left: 0; padding-right: 18px; border-right: 1px solid var(--line-soft); }
.party .lbl {
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 7px;
}
.party .line { font-size: 13px; line-height: 1.55; }
.party .line.strong { font-weight: 600; }
.party .line.mono { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }

.receipt-total {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}
.receipt-total .l {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-faint);
  font-weight: 600;
}
.receipt-total .words {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 5px;
  max-width: 260px;
  line-height: 1.5;
}
.receipt-total .v {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -.03em;
  white-space: nowrap;
}

/* The status seal: the one place on the receipt that gets to be loud. */
.seal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 2px solid currentColor;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.seal.ok { color: var(--ok); }
.seal.wait { color: var(--warn); }
.seal.no { color: var(--danger); }

.receipt-section { padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.receipt-section > .lbl {
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 10px;
}

.rline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0;
  font-size: 13px;
}
.rline .k { color: var(--text-dim); }
.rline .v { font-weight: 600; text-align: right; word-break: break-word; }
.rline .v.mono { font-family: var(--mono); font-size: 12.5px; }

/* Balance effect, only on an approved deposit. */
.ledger {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  margin-top: 4px;
}
.ledger .cell .k { font-size: 10px; color: var(--text-faint); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.ledger .cell .v { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.ledger .cell:last-child { text-align: right; }
.ledger .cell:last-child .v { color: var(--money); }
.ledger .arrow { color: var(--text-faint); }

/* Submitted -> reviewed, as a real sequence. */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-step { display: flex; gap: 12px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; flex: none; }
.tl-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--brand);
  margin-top: 5px;
}
.tl-dot.pending { background: var(--bg-elev); border: 2px solid var(--line); }
.tl-line { width: 2px; flex: 1; background: var(--line-soft); margin: 3px 0; min-height: 16px; }
.tl-body { padding-bottom: 14px; }
.tl-step:last-child .tl-body { padding-bottom: 0; }
.tl-title { font-weight: 600; font-size: 13px; }
.tl-when { font-size: 11.5px; color: var(--text-faint); font-family: var(--mono); margin-top: 1px; }
.tl-note { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }

.receipt-foot {
  padding-top: 14px;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.65;
}
.receipt-foot .rule {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

@media print {
  @page { size: A4; margin: 18mm; }
  html, body { background: #fff !important; }
  body::before { display: none; }
  .topbar, #toasts, .modal-head, .no-print, #app > main { display: none !important; }
  .overlay {
    position: static;
    background: none;
    backdrop-filter: none;
    padding: 0;
    display: block;
  }
  .modal, .modal.receipt-modal {
    max-width: none;
    max-height: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
  }
  .modal-body { padding: 0; }
  .receipt-section, .parties, .receipt-total { break-inside: avoid; }
}

/* ===== services page ===================================================== */
.svc-group { margin-bottom: 26px; }
.svc-group h2 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 10px;
  display: flex; align-items: center; gap: 9px;
  color: var(--text-dim);
}

/* ===== modal ============================================================= */
.overlay {
  position: fixed; inset: 0;
  background: rgba(14, 26, 28, .42);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 20px;
  z-index: 100;
}
.modal {
  width: 100%;
  max-width: 470px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  z-index: 2;              /* scrolled content must pass behind it, not through */
  background: var(--bg-elev);
}
.modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 600; }
.modal-body { padding: 20px; }

.kv { display: grid; grid-template-columns: 116px 1fr; gap: 11px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-faint); font-weight: 500; font-size: 12px; padding-top: 1px; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

/* ===== toast ============================================================= */
#toasts {
  position: fixed;
  right: 22px; bottom: 22px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 200;
  max-width: calc(100vw - 44px);
}
.toast {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow-lift);
  font-size: 13.5px;
  animation: slide-in .2s ease-out;
  min-width: 250px;
}
.toast.err { border-left-color: var(--danger); }
.toast .t-title { font-weight: 600; }
.toast .t-sub { color: var(--text-dim); font-size: 12.5px; margin-top: 2px; }
.toast svg { flex: none; margin-top: 1px; }
.toast.ok svg { color: var(--ok); }
.toast.err svg { color: var(--danger); }

@keyframes slide-in { from { opacity: 0; transform: translateY(6px); } }

/* ===== responsive ======================================================== */
@media (min-width: 900px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .order-grid { grid-template-columns: 1fr; }
  .detail-panel { position: static; }
}

@media (max-width: 640px) {
  .topbar-row { padding: 10px 16px; gap: 10px; }
  .nav { padding: 0 16px; }
  main { padding: 20px 16px 48px; }
  .balance .lbl { display: none; }
  .acct-name { display: none; }
  .brand span { display: none; }
  .qty-row, .detail-panel .row { grid-template-columns: 1fr; }
  .meta-row { grid-template-columns: 1fr; }
  .meta + .meta { border-left: none; border-top: 1px solid var(--line-soft); padding-left: 4px; }
  .menu { right: 16px; left: 16px; }
  #toasts { left: 16px; right: 16px; }
  .svc-name, .svc-link { max-width: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
