/* ZenqPay merchant dashboard — the only stylesheet for the dashboard layout. */
:root {
  --accent: #4f46e5;
  --bg: #f4f5f9;
  --side: #0f172a;
  --card: #fff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 16px; margin: 0 0 10px; font-weight: 650; }
h3 { font-size: 15px; margin: 0 0 6px; }
p { margin: 0 0 8px; line-height: 1.5; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--ok); }
.neg { color: var(--ink); }

/* shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--side); color: #cbd5e1; padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; }
.brand--center { justify-content: center; color: var(--ink); margin-bottom: 18px; }
.brand__mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__link { padding: 9px 12px; border-radius: 9px; text-decoration: none; font-size: 14px; color: #cbd5e1; }
.nav__link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav__link.is-active { background: var(--accent); color: #fff; font-weight: 600; }
.side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side__merchant { display: flex; flex-direction: column; font-size: 13px; color: #e2e8f0; }
.side__merchant small { color: #94a3b8; font-size: 12px; word-break: break-all; }
.plan-tag { color: #a5b4fc !important; }
.main { padding: 32px 36px; max-width: 1180px; width: 100%; }

/* auth */
.auth { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.card--auth h1 { margin-bottom: 6px; }

/* cards & layout */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.card--accent { border-color: color-mix(in srgb, var(--accent) 40%, white); background: color-mix(in srgb, var(--accent) 6%, white); }
.empty { text-align: center; padding: 30px 10px; }
.empty h2 { margin-bottom: 4px; }
.banner { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.banner--ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.banner--error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; text-transform: capitalize; }
.chip:hover { color: var(--ink); border-color: var(--muted); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* forms */
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.field--grow { flex: 1; min-width: 240px; }
.field span { color: var(--ink); }
.field input[type="text"], .field input[type="email"], .field input[type="url"], .table--forms input[type="text"] {
  font: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; width: 100%;
}
.field input:focus, .table--forms input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, white); border-color: var(--accent); }
.field input[type="file"] { font-size: 13px; }
.field select, .field input[type="date"] {
  font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
.field select:focus, .field input[type="date"]:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, white); border-color: var(--accent); }
.filter-form .actions { margin-top: 0; }
.totals-title { font-size: 15px; margin: 18px 0 8px; }
.colour-row { display: flex; align-items: center; gap: 10px; }
.colour-row input[type="color"] { width: 44px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }
.logo-preview { display: flex; align-items: center; gap: 12px; }
.logo-preview img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: #fff; }
.btn { font: inherit; font-size: 14px; font-weight: 600; border: 0; cursor: pointer; border-radius: 9px; padding: 10px 16px; color: #fff; background: var(--accent); white-space: nowrap; }
.btn:hover { filter: brightness(1.06); }
.btn--sm { padding: 7px 12px; font-size: 13px; }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.side .btn--ghost { color: #e2e8f0; border-color: rgba(255,255,255,.18); }
.btn--danger { background: var(--bad); }
.link { color: var(--accent); text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table th.num { text-align: right; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table--forms td { vertical-align: middle; }
.table--forms input { min-width: 320px; }
.err-note { font-size: 11.5px; color: var(--bad); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err-note--wrap { white-space: normal; max-width: none; }
.attempts summary { cursor: pointer; white-space: nowrap; }
.attempts__list { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; min-width: 260px; }
.attempts__list li { margin-bottom: 4px; }
.attempts__note { font-style: italic; color: var(--muted); }
.kv { display: flex; flex-direction: column; gap: 8px; }
.kv__row { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.kv__row code { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; word-break: break-all; }

/* tags */
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #f1f5f9; color: var(--muted); text-transform: lowercase; }
.tag--paid, .tag--swept, .tag--delivered, .tag--active, .tag--sent, .tag--payment_in, .tag--extra_in { background: #ecfdf5; color: #065f46; }
.tag--detected, .tag--confirmed, .tag--pending { background: #fffbeb; color: #92400e; }
.tag--failed, .tag--revoked { background: #fef2f2; color: #991b1b; }
.tag--expired { background: #f1f5f9; color: #475569; }
.tag--fee { background: #eef2ff; color: #3730a3; }
.tag--sweep_out { background: #f0f9ff; color: #075985; }

/* plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plan { margin: 0; position: relative; }
.plan.is-current { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.plan__fee { font-size: 28px; font-weight: 700; margin: 4px 0 0; }
.plan__fee small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.plan__price { color: var(--muted); margin-bottom: 10px; }
.plan__perks { margin: 0 0 12px; padding-left: 18px; color: var(--ink); font-size: 14px; line-height: 1.7; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .side__foot { margin-top: 0; margin-left: auto; flex-direction: row; align-items: center; }
  .main { padding: 20px 16px; }
  .kv__row { grid-template-columns: 1fr; }
}
