/*
 * ecomPay merchant dashboard.
 * Copyright (C) 2026 E Commerce Professionals Limited. ecomPay is a trade mark. Proprietary.
 */
@font-face {
  font-family: "ecomPay Archivo";
  src: url("/assets/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --ink: #141414;
  --red: #cd2525;
  --bg: #f4f5f7;
  --paper: #fff;
  --line: #d6d9de;
  --soft: #e9ebee;
  --muted: #5b6068;
  --ok: #1e7b45;
  --okbg: #e6f3eb;
  --warn: #8a5a00;
  --warnbg: #fff4dc;
  --badbg: #fbe9e9;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "ecomPay Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* ---------- auth screens ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--paper); border: 1.5px solid var(--ink);
  border-radius: 14px; padding: 28px 24px; box-shadow: 0 14px 30px rgba(20, 20, 20, .10);
}
.auth-card img { width: 140px; display: block; margin-bottom: 20px; }
.auth-card h1 { font-size: 22px; margin: 0 0 4px; }
.auth-card p.sub { margin: 0 0 18px; color: var(--muted); }
.auth-switch { margin-top: 16px; font-size: 14px; color: var(--muted); }
.auth-switch button { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; font-weight: 600; color: var(--ink); }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; outline: none;
}
textarea { min-height: 96px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 8px; border: 1.5px solid var(--ink); background: #fff;
  font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.small { padding: 6px 10px; font-size: 13.5px; }
.btn.link { border: 0; background: none; padding: 0; text-decoration: underline; font-weight: 600; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.err { color: var(--red); font-size: 14px; min-height: 1em; margin: 6px 0 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.atop { align-items: flex-start; }
.row > .grow { flex: 1 1 200px; }

/* ---------- shell ---------- */
.top {
  position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1.5px solid var(--ink);
  display: flex; align-items: center; gap: 14px; padding: 10px 20px;
}
.top img { width: 118px; display: block; }
.top .biz { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.modes { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; flex: none; }
.modes button { border: 0; background: #fff; padding: 6px 14px; font-weight: 700; font-size: 13px; cursor: pointer; }
.modes button[aria-pressed=true] { background: var(--ink); color: #fff; }
.modes button.live[aria-pressed=true] { background: var(--ok); }
.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: calc(100vh - 58px); }
nav.side { padding: 18px 12px; border-right: 1.5px solid var(--line); background: var(--paper); }
nav.side a {
  display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; color: var(--muted); margin-bottom: 2px;
}
nav.side a[aria-current=page] { background: var(--ink); color: #fff; }
nav.side .out { margin-top: 18px; }
main.view { padding: 24px 28px 60px; max-width: 1100px; width: 100%; }
main.view h1 { font-size: 24px; margin: 0 0 4px; }
main.view > p.sub { margin: 0 0 20px; color: var(--muted); }
.testbar {
  background: var(--ink); color: #fff; font-weight: 600; font-size: 13.5px; padding: 7px 20px; text-align: center;
}

/* ---------- cards and tables ---------- */
.card { background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; }
.card h2 { font-size: 17px; margin: 0 0 4px; }
.card > p.sub { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 24px; margin-top: 2px; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--soft); }
.steps li:first-child { border-top: 0; }
.tick {
  flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: var(--muted);
}
.tick.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps .what { flex: 1; min-width: 0; }
.steps .what b { display: block; }
.steps .what small { color: var(--muted); }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1.5px solid var(--line); }
table.list td { padding: 10px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: #fafafb; }
.scroll { overflow-x: auto; }
.amount { font-weight: 700; white-space: nowrap; }
.muted { color: var(--muted); }
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--ink);
  text-transform: capitalize; white-space: nowrap;
}
.pill.paid, .pill.succeeded, .pill.approved { background: var(--okbg); color: var(--ok); }
.pill.failed, .pill.declined, .pill.disputed, .pill.error { background: var(--badbg); color: var(--red); }
.pill.refunded, .pill.processing, .pill.pending, .pill.challenge { background: var(--warnbg); color: var(--warn); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input { flex: 1 1 220px; }
.filters select { flex: 0 0 160px; }
.pager { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
dl.facts { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--muted); font-weight: 600; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.notice { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.notice.ok { background: var(--okbg); color: var(--ok); }
.notice.warn { background: var(--warnbg); color: var(--warn); }
.notice.bad { background: var(--badbg); color: var(--red); }
.secret {
  display: flex; gap: 8px; align-items: center; background: var(--soft); border-radius: 8px; padding: 10px 12px; margin: 10px 0;
}
.secret code { flex: 1; overflow-wrap: anywhere; font-size: 13px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
pre.snippet { background: var(--ink); color: #f4f4f4; border-radius: 10px; padding: 14px; overflow-x: auto; font-size: 12.5px; margin: 0; }
.mt { margin-top: 14px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 16px; }
.choice { text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.choice b { display: block; font-size: 15px; }
.choice small { color: var(--muted); font-size: 13px; }
.choice[aria-pressed=true] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: -4px 0 14px; }
.share .row { margin: 6px 0 12px; }
.share .qr { display: block; width: 160px; height: 160px; border: 1px solid var(--soft); border-radius: 8px; }
.back { display: inline-block; margin-bottom: 12px; font-weight: 600; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: 10px; font-weight: 600; font-size: 14px; z-index: 20; max-width: calc(100% - 32px);
}

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .top { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .top img { width: 100px; }
  .top .biz { order: 3; flex-basis: 100%; font-size: 14px; }
  .layout { grid-template-columns: 1fr; }
  nav.side { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; border-right: 0; border-bottom: 1.5px solid var(--line); }
  nav.side a { flex: none; margin: 0; padding: 7px 12px; }
  nav.side .out { margin: 0; flex: none; }
  main.view { padding: 18px 16px 50px; }
  dl.facts { grid-template-columns: 1fr; gap: 2px; }
  dl.facts dd { margin-bottom: 8px; }
  table.list .hide-sm { display: none; }
}
