/* OneBloc Pay - admin + public pages. No framework, no build step. */
:root {
  --ink: #16181d; --muted: #5d6472; --faint: #8b92a0; --line: #e4e7ec; --bg: #f6f7f9; --card: #fff;
  --brand-a: #2B7FF0; --brand-b: #7B5BF0; --brand-c: #D81FA9;
  --ok: #157a3c; --ok-bg: #eaf6ee; --warn: #8a5a00; --warn-bg: #fdf5e4; --bad: #b4232b; --bad-bg: #fdeeee;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }
a { color: var(--brand-a); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 24px 0 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }
.mono { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 12.5px; word-break: break-all; }
.right { text-align: right; } .nowrap { white-space: nowrap; }

/* ---------- admin shell ---------- */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top .in { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 22px; height: 56px; }
.brand { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.brand-dot { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, var(--brand-a), var(--brand-b) 50%, var(--brand-c)); }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { padding: 7px 11px; border-radius: 7px; color: var(--muted); white-space: nowrap; }
.nav a:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.nav a.on { background: #eef3fe; color: var(--brand-a); font-weight: 600; }
.who { color: var(--muted); font-size: 13px; white-space: nowrap; }
.who form { display: inline; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 20px 60px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat .n { font-size: 26px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 12.5px; }

.tbl-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: #eef0f3; color: #444; white-space: nowrap; }
.pill.paid, .pill.delivered, .pill.info-ok { background: var(--ok-bg); color: var(--ok); }
.pill.pending { background: var(--warn-bg); color: var(--warn); }
.pill.failed, .pill.dead, .pill.critical { background: var(--bad-bg); color: var(--bad); }
.pill.warning { background: var(--warn-bg); color: var(--warn); }
.pill.sandbox { background: #eef3fe; color: var(--brand-a); }

.alert { border-radius: 9px; padding: 12px 14px; margin: 0 0 16px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.alert svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.alert.bad { background: var(--bad-bg); border-color: #efc1c1; color: #7d1a20; }
.alert.ok { background: var(--ok-bg); border-color: #bfe0c9; color: #14532d; }
.alert.warn { background: var(--warn-bg); border-color: #ecd7a6; color: #6b4a00; }
.secret-once { background: #fffbea; border: 1px dashed #d9b84a; border-radius: 9px; padding: 14px; margin-bottom: 16px; }
.secret-once .secret-val { font-size: 14px; background: #fff; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); display: block; margin: 6px 0 10px; }

form.inline { display: inline; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
.input, select, textarea {
  font: inherit; padding: 8px 10px; border: 1px solid #cfd4dc; border-radius: 7px; background: #fff; color: var(--ink); min-width: 0;
}
.input:focus, select:focus, textarea:focus { outline: 2px solid #c7d8fb; border-color: var(--brand-a); }
.form-grid { display: grid; gap: 0 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }

.btn { font: inherit; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 7px; border: 1px solid #cfd4dc;
  background: #fff; color: var(--ink); cursor: pointer; font-weight: 600; text-decoration: none; }
.btn:hover { background: #f4f6f8; text-decoration: none; }
.btn.primary { background: var(--brand-a); border-color: var(--brand-a); color: #fff; }
.btn.primary:hover { background: #1f6fdc; }
.btn.danger { color: var(--bad); border-color: #efc1c1; }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn.wide { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.pager { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.timeline .ev { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline .ev:last-child { border-bottom: 0; }
.timeline .when { color: var(--muted); font-size: 12.5px; }
.timeline .what { font-weight: 600; }
.timeline details { margin-top: 6px; }
.timeline pre { background: #f6f7f9; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; overflow-x: auto; font-size: 12px; max-height: 260px; }
dl.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; margin: 0; }
dl.kv dt { color: var(--muted); font-weight: 600; font-size: 12.5px; }
dl.kv dd { margin: 0; }

/* ---------- sign-in (layout around ob-signin.css) ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth .inner { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px; }
.auth h1 { font-size: 22px; }
.auth .sub { color: var(--muted); margin: 0 0 20px; }
.auth .brand { margin-bottom: 22px; }

/* ---------- public checkout ---------- */
.pub { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.pub .box { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; text-align: center; }
.pub .amount { font-size: 32px; font-weight: 700; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.pub .desc { color: var(--muted); margin-bottom: 20px; }
.pub .ico { width: 52px; height: 52px; margin: 0 auto 10px; }
.pub .sandbox-note { margin-top: 14px; font-size: 12.5px; color: var(--brand-a); }
.spinner { width: 28px; height: 28px; border: 3px solid #e4e7ec; border-top-color: var(--brand-a); border-radius: 50%; margin: 8px auto 14px;
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .timeline .ev { grid-template-columns: 1fr; gap: 2px; }
  dl.kv { grid-template-columns: 1fr; gap: 2px 0; }
  dl.kv dd { margin-bottom: 8px; }
  /* Phone: brand + sign-out on one row, the menu on its own full-width scrolling row. */
  .top .in { flex-wrap: wrap; height: auto; gap: 6px 12px; padding: 10px 14px 0; }
  .brand { flex: 1; }
  .nav { order: 3; flex-basis: 100%; padding-bottom: 8px; }
  .who { font-size: 0; }               /* hide the name, keep the button */
  .who .btn { font-size: 12.5px; }
  .wrap { padding: 18px 14px 50px; }
}

/* utilities - the CSP forbids inline style attributes, so spacing lives here */
.note-center { margin: 10px 0 0; text-align: center; }
.mt-18 { margin-top: 18px; } .mt-8 { margin-top: 8px; } .mb-0 { margin-bottom: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
