/* Merchant dashboard — light theme default, dark via body[data-theme=dark] */
:root {
  --bg: #f3f4f6; --panel: #ffffff; --ink: #111827; --muted: #6b7280;
  --line: #e5e7eb; --line-2: #d1d5db; --sidebar: #1f2937; --sidebar-ink: #d1d5db; --sidebar-active: #ffffff;
  --primary: #2563eb; --primary-ink: #ffffff; --green: #10b981; --pink: #ec4899;
  --yellow: #f59e0b; --red: #ef4444; --grey: #6b7280; --blue: #3b82f6;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.04);
}
body[data-theme=dark] {
  --bg: #0b1220; --panel: #111827; --ink: #e5e7eb; --muted: #9ca3af;
  --line: #1f2937; --line-2: #374151; --sidebar: #0a0f1c; --sidebar-ink: #94a3b8; --sidebar-active: #ffffff;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--primary); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { margin-left: auto; }
.center { text-align: center; }

.app { display: grid; grid-template-columns: 240px 1fr; height: 100vh; overflow: hidden; }
/* Sidebar stays pinned; only the main column scrolls. The topbar inside .main
   is also sticky so it stays visible while content scrolls. */
.sidebar { position: sticky; top: 0; height: 100vh; align-self: start; overflow-y: auto; }
.main { overflow-y: auto; }
.topbar { position: sticky; top: 0; z-index: 5; }

/* ---- Sidebar ---- */
.sidebar { background: var(--sidebar); color: var(--sidebar-ink); padding: 16px 0 16px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 18px 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-mark { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,#f97316,#ec4899,#a855f7); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; }
.brand-title { color: #fff; font-weight: 700; font-size: 16px; }
.brand-pro { color: var(--pink); font-weight: 600; font-size: 12px; }
.nav { display: flex; flex-direction: column; padding: 8px 0; flex: 1; overflow-y: auto; }
.nav-sec { color: #6b7280; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 18px 18px 8px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 18px; color: var(--sidebar-ink); font-size: 14px; cursor: pointer; background: none; border: none; border-left: 3px solid transparent; text-align: left; width: 100%; }
.nav-item:hover { background: rgba(255,255,255,.04); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.06); color: var(--sidebar-active); border-left-color: var(--primary); }
.nav-item .ic { width: 18px; display: inline-block; text-align: center; opacity: .8; }
.sidebar-foot { padding: 8px 18px; display: flex; gap: 8px; align-items: center; border-top: 1px solid rgba(255,255,255,.06); }

/* ---- Main / Topbar ---- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.company { font-size: 18px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.expiry-pill { background: var(--pink); color: #fff; padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.avatar-circle { width: 40px; height: 40px; border-radius: 50%; background: #d1fae5; display: grid; place-items: center; font-size: 20px; }
.icon-btn { background: transparent; border: 1px solid var(--line); color: inherit; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; }

.content { padding: 24px; max-width: 100%; overflow-x: hidden; }
.crumbs { font-size: 14px; margin-bottom: 16px; }
.crumbs .sep { color: var(--muted); margin: 0 6px; }
.crumbs .muted { color: var(--muted); }

/* ---- Panels / cards ---- */
.panel { background: var(--panel); border-radius: 12px; padding: 24px; box-shadow: var(--shadow); margin-bottom: 16px; }
.panel h2 { margin: 0 0 16px; font-size: 18px; }
.panel h3 { margin: 16px 0 8px; font-size: 15px; }
.panel label { display: block; font-size: 13px; margin: 12px 0 6px; color: var(--muted); }
.panel input, .panel select, .panel textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit;
}
.panel textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1024px) { .two-col { grid-template-columns: 1fr; } .app { grid-template-columns: 0 1fr; } }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ---- Dashboard cards ---- */
.cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 16px; }
/* KPI cards: clean white surface, single accent token, no neon gradients. */
.info-card, .metric-card {
  position: relative;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  min-height: 96px;
  box-shadow: 0 1px 2px rgba(15,20,25,.04);
  display: flex; flex-direction: column; justify-content: center;
  transition: border-color .15s, box-shadow .15s;
}
.info-card:hover, .metric-card:hover { border-color: var(--line-2); box-shadow: 0 4px 12px rgba(15,20,25,.06); }
.info-lbl, .metric-lbl {
  font-size: 11px; font-weight: 600; color: var(--muted);
  letter-spacing: .04em; text-transform: uppercase;
  margin: 0 0 6px;
  order: -1; /* visually-first regardless of DOM order */
}
.info-val { font-size: 22px; font-weight: 700; line-height: 1.15; color: var(--ink); letter-spacing: -.01em; }
.metric-val { font-size: 22px; font-weight: 700; line-height: 1.15; color: var(--ink); letter-spacing: -.01em; }
.info-ic, .metric-ic {
  position: absolute; right: 14px; top: 14px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
}
/* Color comes only from the icon chip, not the whole card. */
.info-card.green .info-ic, .metric-card.green .metric-ic { background: rgba(16,185,129,.10); color: #047857; }
.info-card.blue  .info-ic                                 { background: rgba(59,130,246,.10); color: #1d4ed8; }
.info-card.grey  .info-ic, .metric-card.grey  .metric-ic  { background: rgba(107,114,128,.10); color: #4b5563; }
.info-card.pink  .info-ic                                 { background: rgba(236,72,153,.10); color: #be185d; }
.metric-card.yellow .metric-ic                            { background: rgba(245,158,11,.10); color: #b45309; }
/* Field order: label on top (small), then big value, then optional delta. */
.metric-card, .info-card { padding-right: 56px; }
.metric-delta {
  display: inline-block; margin-top: 6px;
  background: var(--bg); color: var(--muted);
  padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
}
.metric-delta.up    { background: rgba(16,185,129,.10); color: #047857; }
.metric-delta.down  { background: rgba(239,68,68,.10);  color: #b91c1c; }
.metric-delta.flat  { background: var(--bg);            color: var(--muted); }
/* Connector health tile color states */
.info-card.red  .info-ic { background: rgba(239,68,68,.10); color: #b91c1c; }
.info-card.yellow .info-ic { background: rgba(245,158,11,.10); color: #b45309; }
.info-card.grey .info-ic { background: rgba(107,114,128,.10); color: #4b5563; }
.info-card.green .info-val { color: var(--ink); }
.info-card.red   .info-val { color: #991b1b; }
.refresh-note { text-align: center; color: var(--muted); margin-bottom: 16px; }

/* ---- Account info card ---- */
.ai-grid > div { padding: 12px 0; }
.ai-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.ai-val { margin-top: 6px; font-size: 15px; color: var(--ink); word-break: break-all; }
.ai-val.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* ---- Top-right profile dropdown ---- */
.profile-menu-wrap { position: relative; }
.avatar-circle { border: none; cursor: pointer; padding: 0; }
.avatar-circle:hover { outline: 2px solid rgba(99,102,241,.25); outline-offset: 2px; }
.profile-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 240px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15,20,25,.12); padding: 6px; z-index: 200;
}
.profile-menu .pm-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.profile-menu .pm-name { font-weight: 600; color: var(--ink); }
.profile-menu .pm-email { margin-top: 2px; }
.profile-menu .pm-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; width: 100%;
  border: none; background: transparent; color: var(--ink); text-decoration: none;
  border-radius: 8px; font: inherit; cursor: pointer; text-align: left;
}
.profile-menu .pm-item:hover { background: var(--bg); }
.profile-menu .pm-item i { width: 16px; height: 16px; }
.profile-menu .pm-danger { color: #b91c1c; }
.profile-menu .pm-danger:hover { background: rgba(239,68,68,.06); }

/* ---- Transactions table (clean fixed-width layout) ---- */
.tx-table { table-layout: fixed; }
.tx-table th, .tx-table td { vertical-align: top; }
.tx-table .tx-num    { width: 48px; text-align: center; color: var(--muted); }
.tx-table .tx-when   { width: 110px; }
.tx-table .tx-id     { width: 36%; overflow: hidden; }
.tx-table .tx-order  { width: 18%; }
.tx-table .tx-source { width: 100px; }
.tx-table .tx-amt    { width: 120px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-table .tx-status { width: 110px; }
.tx-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }
.tx-table .tx-id-sub { margin-top: 2px; }
.tx-table .tx-when-date { font-weight: 600; }
.tx-table .tx-when-time { margin-top: 2px; }
.src-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(99,102,241,.10); color: #4338ca; text-transform: capitalize;
}
.status-pill {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.status-pill.ok    { background: rgba(16,185,129,.12); color: #047857; }
.status-pill.warn  { background: rgba(245,158,11,.12); color: #b45309; }
.status-pill.err   { background: rgba(239,68,68,.12);  color: #b91c1c; }

/* ---- Sparklines on metric cards ---- */
.spark { display: block; width: 100%; height: 32px; margin: 8px 0 4px; opacity: .9; }

/* ---- Headline 7-day revenue chart ---- */
.chart-panel { padding: 20px 24px; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chart-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.chart-sub { margin-top: 2px; }
.chart-legend { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 14px; }
.chart-legend .lg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
.chart-legend .lg-recv { background: linear-gradient(180deg, #22c55e, #16a34a); }
.chart-legend .lg-fail { background: linear-gradient(180deg, #cbd5e1, #94a3b8); }
.rev7-chart { width: 100%; }
.rev7-svg { width: 100%; height: auto; max-height: 220px; }
.rev7-lbl { font-size: 11px; fill: var(--muted); font-family: inherit; }
.rev7-bar rect { transition: opacity .15s; cursor: pointer; }
.rev7-bar:hover rect { opacity: .85; }

/* ---- Buttons ---- */
.primary { background: var(--primary); color: #fff; border: none; padding: 10px 18px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 500; margin-top: 12px; }
.primary:hover { filter: brightness(1.05); }
.ghost-btn { background: transparent; border: 1px solid var(--line-2); color: inherit; padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; }
.ghost-btn.small { padding: 4px 10px; font-size: 12px; }
.danger { background: transparent; border: 1px solid var(--red); color: var(--red); padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.danger.small { padding: 4px 8px; font-size: 12px; }

/* ---- Copy rows ---- */
.copy-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.copy-row input { flex: 1; background: #f9fafb; }
body[data-theme=dark] .copy-row input { background: #0b1220; }
.copy-btn { padding: 10px 18px; border-radius: 8px; border: none; color: #fff; cursor: pointer; font: inherit; font-weight: 500; }
.copy-btn.green { background: var(--green); }
.copy-btn.blue { background: var(--primary); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.data th { background: var(--bg); font-weight: 600; }

/* ---- Switch ---- */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 24px; transition: .2s; }
.switch span:before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span:before { transform: translateX(20px); }

/* ---- Forms ---- */
.form-inline { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.form-inline label { margin: 0; }
.form-inline input { max-width: 320px; }
.form-msg { margin-top: 8px; padding: 8px 12px; border-radius: 6px; background: #fef3c7; color: #92400e; }
.form-msg.ok { background: #d1fae5; color: #065f46; }
.form-msg.err { background: #fee2e2; color: #991b1b; }

.link-result { margin-top: 12px; padding: 12px; background: #f0f9ff; border-radius: 8px; display: flex; gap: 8px; align-items: center; }
body[data-theme=dark] .link-result { background: #0b2942; }
.link-result input { flex: 1; }

/* ---- KV display ---- */
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: none; }

/* ---- Theme tiles — mini mockups of the real checkout page ------------ */
/* ============================================================================
   Theme tiles - miniaturised replicas of the real checkout page.
   Each tile renders the full checkout chrome (header, countdown, amount,
   framed QR, VPA pay-to row, dark Share button, expandable row, Order/Ref,
   and the "All UPI Accepted | paytm PhonePe GPay BHIM RuPay" footer strip).
   Sizes are scaled down ~3x; colors are theme-specific.
   ============================================================================ */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin: 16px 0; }
.theme-tile { cursor: pointer; padding: 6px; border: 3px solid transparent; border-radius: 18px; transition: border .15s; }
.theme-tile.selected { border-color: var(--green); }
.theme-label { text-align: center; margin-top: 10px; font-weight: 500; }

/* The mock is a backdrop (the theme's body gradient/color); the card sits on top. */
.theme-mock {
  border-radius: 14px;
  padding: 14px 12px;
  display: flex; align-items: center; justify-content: center;
  font: 9.5px/1.4 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.theme-mock .tm-card {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 14px 28px -10px rgba(15,20,25,.18), 0 2px 6px rgba(15,20,25,.06);
  color: #0f1419;
  display: flex; flex-direction: column;
}
/* Header strip */
.theme-mock .tm-head {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
  position: relative;
}
.theme-mock .tm-avatar {
  width: 22px; height: 22px; border-radius: 6px;
  background: #fff; border: 1px solid #eef2f7;
  display: grid; place-items: center;
  font-size: 6.5px; font-weight: 700; color: #ea580c;
  flex-shrink: 0;
}
.theme-mock .tm-head-text { flex: 1; min-width: 0; line-height: 1.2; }
.theme-mock .tm-kicker { font-size: 6.5px; color: #6b7280; }
.theme-mock .tm-payee {
  font-size: 9.5px; font-weight: 700; color: #0f1419;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.theme-mock .tm-verified { color: #f59e0b; font-size: 8px; }
.theme-mock .tm-verified-sub { font-size: 6.5px; font-style: italic; color: #f59e0b; margin-top: 1px; }
.theme-mock .tm-x { position: absolute; top: 8px; right: 10px; color: #94a3b8; font-size: 11px; line-height: 1; }
/* Countdown pill */
.theme-mock .tm-countdown {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 8px auto 4px;
  background: rgba(245,158,11,.1); color: #b45309;
  padding: 3px 9px; border-radius: 999px;
  font-size: 7px; font-weight: 500;
}
.theme-mock .tm-dot { width: 4px; height: 4px; border-radius: 50%; background: #b45309; }
/* Amount block */
.theme-mock .tm-amount-lbl { text-align: center; font-size: 6.5px; color: #6b7280; letter-spacing: .08em; }
.theme-mock .tm-amount {
  text-align: center; font-size: 22px; font-weight: 800;
  letter-spacing: -.03em; line-height: 1; margin: 2px 0 1px; color: #0f1419;
}
.theme-mock .tm-amount-sub { text-align: center; font-size: 7px; color: #6b7280; }
/* Welcome banner */
.theme-mock .tm-banner {
  display: flex; align-items: center; gap: 5px; justify-content: center;
  margin: 6px 10px 4px; padding: 4px 8px;
  background: rgba(59,130,246,.08); color: #1d4ed8;
  border-radius: 6px; font-size: 6.5px; font-weight: 500;
}
.theme-mock .tm-spin { width: 6px; height: 6px; border: 1.2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
/* QR with corner brackets */
.theme-mock .tm-qr-wrap {
  position: relative;
  width: 56%; aspect-ratio: 1;
  margin: 4px auto;
  padding: 6px;
  background: #fff; border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.05);
}
.theme-mock .tm-qr { width: 100%; height: 100%; display: block; border-radius: 3px; object-fit: contain; }
.theme-mock .tm-corner {
  position: absolute; width: 8px; height: 8px; border: 1.5px solid currentColor; border-radius: 2px;
}
.theme-mock .tm-corner.tl { top: 2px; left: 2px;  border-right: none; border-bottom: none; }
.theme-mock .tm-corner.tr { top: 2px; right: 2px; border-left: none;  border-bottom: none; }
.theme-mock .tm-corner.bl { bottom: 2px; left: 2px;  border-right: none; border-top: none; }
.theme-mock .tm-corner.br { bottom: 2px; right: 2px; border-left: none;  border-top: none; }
.theme-mock .tm-scan { text-align: center; font-size: 7px; color: #4b5563; margin: 4px 0 6px; }
/* VPA pay-to row */
.theme-mock .tm-vpa-row {
  display: inline-flex; align-items: center; gap: 5px; align-self: center;
  margin: 0 auto 6px; padding: 4px 9px;
  background: #f3f4f6; border-radius: 6px;
  font-size: 7px; color: #0f1419;
}
.theme-mock .tm-vpa-row strong { font-family: ui-monospace, Menlo, monospace; font-weight: 600; }
.theme-mock .tm-vpa-row a { color: #2563eb; text-decoration: underline; font-weight: 500; }
/* Share button - solid dark */
.theme-mock .tm-share {
  align-self: center;
  background: #0f1419; color: #fff;
  padding: 5px 11px; border-radius: 6px;
  font-size: 7.5px; font-weight: 600;
  margin: 2px auto 8px;
}
/* Or-open expandable row */
.theme-mock .tm-open {
  display: flex; justify-content: space-between; align-items: center;
  margin: 0 10px 6px; padding: 6px 9px;
  background: #f8fafc; border: 1px solid #eef2f7; border-radius: 7px;
  font-size: 7px; font-weight: 600; color: #0f1419;
}
.theme-mock .tm-chev { color: #94a3b8; font-size: 9px; }
/* Order/Ref strip */
.theme-mock .tm-meta {
  margin: 0 10px 6px; padding: 6px 9px;
  background: #f8fafc; border-radius: 6px;
  font-size: 6.5px; color: #6b7280; line-height: 1.45;
}
/* Footer strip - the "bottom line" the user called out */
.theme-mock .tm-foot {
  background: #f8fafc;
  border-top: 1px solid #eef2f7;
  padding: 6px 9px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 5px;
}
.theme-mock .tm-foot-lbl { font-size: 6px; font-weight: 600; color: #6b7280; flex: 1; }
.theme-mock .tm-mark {
  font-size: 5.5px; font-weight: 700; letter-spacing: .02em;
  padding: 1.5px 4px; border-radius: 2px; color: #fff;
}
.theme-mock .tm-mark-paytm   { background: #00b9f1; }
.theme-mock .tm-mark-phonepe { background: #5f259f; }
.theme-mock .tm-mark-gpay    { background: #1a73e8; }
.theme-mock .tm-mark-bhim    { background: #00a89d; }
.theme-mock .tm-mark-rupay   { background: linear-gradient(90deg,#0f6cb8,#e94e1b 65%,#098240); font-style: italic; }

/* ---- Per-theme color overrides (matches public-checkout/styles.css) ---- */
/* Classic - light cream backdrop, dark accents */
.theme-mock.classic { background: #f1f3f6; }
.theme-mock.classic .tm-corner { color: #0f1419; }
.theme-mock.classic .tm-share { background: #0f1419; }

/* Orange - warm orange gradient backdrop, cream card */
.theme-mock.orange { background: linear-gradient(180deg,#fb923c 0%,#fdba74 35%,#fff7ed 100%); }
.theme-mock.orange .tm-card { background: #fff; color: #431407; }
.theme-mock.orange .tm-head { background: #fff7ed; border-bottom-color: #fed7aa; }
.theme-mock.orange .tm-payee, .theme-mock.orange .tm-amount { color: #c2410c; }
.theme-mock.orange .tm-corner { color: #ea580c; }
.theme-mock.orange .tm-vpa-row { background: #fff7ed; color: #431407; }
.theme-mock.orange .tm-vpa-row a { color: #ea580c; }
.theme-mock.orange .tm-share { background: #ea580c; color: #fff; }
.theme-mock.orange .tm-open { background: #fff7ed; border-color: #fed7aa; color: #431407; }
.theme-mock.orange .tm-meta { background: #fff7ed; }
.theme-mock.orange .tm-foot { background: #fff7ed; border-top-color: #fed7aa; }

/* Dark - deep slate backdrop, dark card */
.theme-mock.dark { background: #0a0e1a; }
.theme-mock.dark .tm-card { background: #161b28; color: #f1f5f9; box-shadow: 0 14px 28px -10px rgba(0,0,0,.6); }
.theme-mock.dark .tm-head { background: #1e293b; border-bottom-color: #1f2937; }
.theme-mock.dark .tm-avatar { background: #0f172a; border-color: #1f2937; color: #93c5fd; }
.theme-mock.dark .tm-kicker, .theme-mock.dark .tm-amount-lbl, .theme-mock.dark .tm-amount-sub, .theme-mock.dark .tm-scan { color: #94a3b8; }
.theme-mock.dark .tm-payee, .theme-mock.dark .tm-amount { color: #f1f5f9; }
.theme-mock.dark .tm-corner { color: #3b82f6; }
.theme-mock.dark .tm-banner { background: rgba(59,130,246,.15); color: #93c5fd; }
.theme-mock.dark .tm-vpa-row, .theme-mock.dark .tm-meta, .theme-mock.dark .tm-open, .theme-mock.dark .tm-foot { background: #0f172a; color: #cbd5e1; border-color: transparent; }
.theme-mock.dark .tm-foot { border-top: 1px solid #1f2937; }
.theme-mock.dark .tm-vpa-row a { color: #60a5fa; }
.theme-mock.dark .tm-share { background: #3b82f6; color: #fff; }
.theme-mock.dark .tm-foot-lbl { color: #94a3b8; }

/* Blue - electric blue gradient backdrop */
.theme-mock.blue { background: linear-gradient(180deg,#1e3a8a 0%,#3b82f6 45%,#dbeafe 100%); }
.theme-mock.blue .tm-card { background: #fff; color: #0c1b3d; }
.theme-mock.blue .tm-head { background: #eff6ff; border-bottom-color: #dbeafe; }
.theme-mock.blue .tm-avatar { color: #1e40af; }
.theme-mock.blue .tm-payee { color: #0c1b3d; }
.theme-mock.blue .tm-amount { color: #1e40af; }
.theme-mock.blue .tm-corner { color: #1e40af; }
.theme-mock.blue .tm-vpa-row { background: #eff6ff; }
.theme-mock.blue .tm-vpa-row a { color: #1e40af; }
.theme-mock.blue .tm-share { background: #1e40af; color: #fff; }
.theme-mock.blue .tm-open { background: #eff6ff; border-color: #dbeafe; }
.theme-mock.blue .tm-meta { background: #eff6ff; }
.theme-mock.blue .tm-foot { background: #eff6ff; border-top-color: #dbeafe; }

/* ---- SDK grid ---- */
.sdk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.sdk-card { background: var(--panel); padding: 20px; border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.sdk-card.featured { background: linear-gradient(135deg,#faf5ff,#f3e8ff); position: relative; overflow: hidden; }
.sdk-card .ribbon { position: absolute; top: 12px; right: -28px; background: #a855f7; color: #fff; padding: 4px 32px; transform: rotate(45deg); font-size: 11px; font-weight: 700; }
.sdk-card h3 { margin: 0 0 8px; font-size: 17px; }
.sdk-card p { color: var(--muted); flex: 1; font-size: 13px; }
.sdk-card .dl { margin-top: 12px; padding: 10px; border: none; border-radius: 8px; color: #fff; cursor: pointer; font: inherit; font-weight: 600; }

/* ---- Docs ---- */
.docs h1 { font-size: 24px; }
.docs h2 { margin-top: 28px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.docs code, .docs pre { background: #1f2937; color: #f9fafb; padding: 2px 6px; border-radius: 4px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.docs pre { padding: 14px; border-radius: 8px; overflow: auto; white-space: pre; }
.docs .endpoint { font-size: 14px; padding: 4px 8px; }
.docs .warn { background: #fef3c7; color: #92400e; padding: 12px; border-radius: 8px; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab { background: transparent; border: none; padding: 10px 16px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font: inherit; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* ---- Hist controls ---- */
.hist-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.hist-bar select { width: auto; display: inline-block; }
.hist-bar input { width: 220px; display: inline-block; }
.hist-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

/* ---- Status pill ---- */
.status-pill { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 12px; background: var(--line); }
.status-pill.ok { background: #d1fae5; color: #065f46; }
.status-pill.warn { background: #fef3c7; color: #92400e; }
.active-domain { background: #e0f2fe; color: #075985; padding: 12px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; margin: 12px 0; }
body[data-theme=dark] .active-domain { background: #0b2942; color: #93c5fd; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; color: #fff; font-size: 11px; font-weight: 600; }
.badge.red { background: var(--pink); }

/* ---- Logo upload ---- */
.logo-row { display: flex; gap: 16px; align-items: stretch; }
.logo-frame { width: 200px; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; }
.logo-frame img { max-width: 100%; max-height: 100%; }
.logo-drop { flex: 1; border: 2px dashed var(--line-2); border-radius: 12px; display: grid; place-items: center; cursor: pointer; padding: 24px; text-align: center; }

/* ---- Dark instruction panel ---- */
.dark-panel { background: #1f2937; color: #f9fafb; }
.dark-panel .muted { color: #9ca3af; }
.steps { list-style: none; padding: 0; counter-reset: s; }
.steps li { padding: 12px 0 12px 44px; position: relative; counter-increment: s; border-bottom: 1px solid rgba(255,255,255,.08); }
.steps li:last-child { border-bottom: none; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 12px; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 600; }
.bullets { padding-left: 0; list-style: none; }
.bullets li { padding: 6px 0; }


/* ---- Toast ---- */
.toast { position: fixed; top: 24px; right: 24px; background: #111827; color: #fff; padding: 12px 18px; border-radius: 8px; z-index: 100; box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.blue-h { color: var(--primary); }

/* ---- Sidebar collapse (☰ toggle) — collapse to icons only --------------- */
.app.sidebar-collapsed { grid-template-columns: 64px 1fr; }
.app.sidebar-collapsed .sidebar .brand-title,
.app.sidebar-collapsed .sidebar .brand-pro,
.app.sidebar-collapsed .sidebar .nav-sec { display: none; }
/* Hide every text node inside a nav-item except the .ic icon */
.app.sidebar-collapsed .sidebar .nav-item { font-size: 0; padding: 12px 0; justify-content: center; }
.app.sidebar-collapsed .sidebar .nav-item .ic { font-size: 18px; opacity: 1; }
.app.sidebar-collapsed .sidebar .nav-item .pill { display: none; }
.app.sidebar-collapsed .sidebar .brand { justify-content: center; padding: 0 0 16px; }
.app.sidebar-collapsed .sidebar .sidebar-foot { justify-content: center; padding: 8px 0; }

/* On mobile (≤1024px) sidebar fully hides; ☰ shows it as overlay */
@media (max-width: 1024px) {
  .app { grid-template-columns: 0 1fr; }
  .app:not(.sidebar-collapsed) .sidebar {
    position: fixed; top: 0; left: 0; width: 240px; height: 100vh; z-index: 30;
    box-shadow: 4px 0 16px rgba(0,0,0,.2);
  }
}

/* ---- Lucide icon sizing (works inside nav-items, buttons, cards) -------- */
.nav-item i[data-lucide],
.icon-btn i[data-lucide] { width: 18px; height: 18px; stroke-width: 2; flex: 0 0 18px; }
.info-ic i[data-lucide],
.metric-ic i[data-lucide] { width: 16px; height: 16px; stroke-width: 2; opacity: 1; }
.avatar-circle i[data-lucide] { width: 20px; height: 20px; }
/* Collapsed sidebar: hide nav-item labels, center the icon */
.app.sidebar-collapsed .sidebar .nav-item > span { display: none; }
.app.sidebar-collapsed .sidebar .nav-item i[data-lucide] { width: 22px; height: 22px; }

/* ---- "Coming soon" pill ------------------------------------------------- */
.soon-pill {
  display: inline-block;
  font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(245, 158, 11, .15); color: #b45309;
  padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle;
}
body[data-theme=dark] .soon-pill { background: rgba(245, 158, 11, .2); color: #fbbf24; }
.nav-item .soon-pill { margin-left: auto; padding: 1px 5px; font-size: 9px; }

/* ---- Placeholder panels (Subscription, etc.) ---------------------------- */
.panel.placeholder { text-align: center; padding: 48px 32px; }
.placeholder-ic {
  width: 64px; height: 64px; margin: 0 auto 16px;
  border-radius: 16px; background: var(--bg); display: grid; place-items: center;
}
.placeholder-ic i[data-lucide] { width: 32px; height: 32px; color: var(--muted); }
.panel.placeholder h2 { margin: 0 0 12px; }
.placeholder-list { display: inline-block; text-align: left; list-style: none; padding: 0; margin: 20px 0 0; }
.placeholder-list li { padding: 6px 0; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.placeholder-list i[data-lucide] { width: 16px; height: 16px; color: var(--green); }

/* ---- SDK page notice + disabled download buttons ----------------------- */
.sdk-notice {
  grid-column: 1 / -1;
  background: #fef3c7; color: #92400e;
  padding: 14px 16px; border-radius: 12px;
  display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px;
}
.sdk-notice i[data-lucide] { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 2px; }
body[data-theme=dark] .sdk-notice { background: #422006; color: #fde68a; }
.sdk-card .dl:disabled { opacity: .7; cursor: not-allowed; }
.sdk-card .dl i[data-lucide] { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }

/* ---- Impersonation banner (shown when admin "View as" lands here) ------ */
.imp-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: #fef3c7; color: #92400e;
  border-bottom: 1px solid #fde68a; font-size: 13px;
}
.imp-banner i[data-lucide] { width: 18px; height: 18px; flex: 0 0 18px; }
.imp-exit { margin-left: auto; color: #b45309; text-decoration: underline; font-weight: 600; }
body[data-theme=dark] .imp-banner { background: #422006; color: #fbbf24; border-bottom-color: #78350f; }

/* ============================================================================
   Auth pages (login, forgot password, reset). Centered card, no sidebar/layout.
   ============================================================================ */
.auth-body {
  background: linear-gradient(135deg, #1e3a8a 0%, #6d28d9 100%);
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.auth-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 36px 32px 24px;
  max-width: 400px; width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  color: var(--ink, #111827);
}
.auth-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.auth-brand .brand-mark {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg,#f97316,#ec4899,#a855f7);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.auth-brand-text { line-height: 1.2; }
.auth-brand-title { font-size: 17px; font-weight: 700; color: #111827; }
.auth-brand-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.auth-card h1 { margin: 0 0 6px; font-size: 22px; font-weight: 700; color: #111827; }
.auth-card .muted { font-size: 13px; color: #6b7280; margin: 0 0 20px; }
.auth-card label { display: block; font-size: 12px; font-weight: 500; color: #4b5563; margin: 14px 0 6px; }
.auth-card input {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #d1d5db; border-radius: 8px;
  font: 14px inherit; color: #111827;
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
.auth-card input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.auth-card button.primary {
  width: 100%; margin-top: 18px;
  padding: 10px 16px;
  background: #2563eb; color: #fff;
  border: 0; border-radius: 8px;
  font: 14px inherit; font-weight: 600;
  cursor: pointer;
  transition: background .12s;
}
.auth-card button.primary:hover { background: #1d4ed8; }
.auth-card button.primary:disabled { background: #9ca3af; cursor: default; }
.auth-card .form-msg { margin-top: 12px; padding: 8px 12px; border-radius: 6px; font-size: 13px; }
.auth-card .form-msg.err { background: #fee2e2; color: #991b1b; }
.auth-card .form-msg.ok  { background: #dcfce7; color: #166534; }
.auth-foot {
  display: flex; justify-content: space-between;
  margin: 20px 0 0;
  font-size: 12px;
}
.auth-foot a { color: #2563eb; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }
.auth-alt { border-top: 1px solid #f1f5f9; margin-top: 20px; padding-top: 18px; }

.user-email { font-size: 12px; color: var(--muted); padding: 4px 10px; border-radius: 6px; background: var(--bg); }

/* ===== Docs page polish ===== */
.docs h1 { font-size: 28px; margin: 0 0 24px; }
.docs h2 { font-size: 22px; margin: 36px 0 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.docs h2:first-of-type { border-top: 0; padding-top: 0; }
.docs h3 { font-size: 16px; margin: 22px 0 8px; }
.docs pre { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; line-height: 1.55; }
.docs pre code { background: transparent; padding: 0; color: inherit; }
/* Inline code chips: high contrast no matter what theme. Stripe-style dark on
   white, with explicit !important to beat any cascading author rules. */
.docs code:not(pre code),
.docs td code,
.docs li code,
.docs details code,
.docs p code {
  background: #1e293b !important;
  color: #f8fafc !important;
  padding: 1px 7px !important;
  border-radius: 4px !important;
  font-size: 12.5px !important;
  font-weight: 500;
  font-family: ui-monospace, Menlo, Consolas, monospace !important;
}
.docs table.data { width: 100%; border-collapse: collapse; margin: 8px 0 16px; }
.docs table.data th { text-align: left; padding: 8px 10px; background: var(--bg); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.docs table.data td { padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; font-size: 13.5px; }
.docs p.warn { background: rgba(245, 158, 11, .08); border-left: 3px solid #f59e0b; padding: 10px 14px; border-radius: 4px; margin: 10px 0; font-size: 13px; }
.docs p.warn code { background: #92400e !important; color: #fffbeb !important; }
.doc-toc { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.doc-toc strong { margin-right: 6px; font-size: 13px; color: var(--muted); }
.doc-toc a { font-size: 13px; color: var(--primary); text-decoration: none; }
.doc-toc a:hover { text-decoration: underline; }
.quickstart { line-height: 1.7; }
.quickstart li { margin-bottom: 6px; }
.docs details { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 8px 0; }
.docs details[open] { background: var(--panel); border-color: var(--line-2); }
.docs details summary { cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 8px; }
.docs details summary::before { content: '▸'; color: var(--muted); transition: transform .15s; display: inline-block; }
.docs details[open] summary::before { transform: rotate(90deg); }
.docs details p { margin: 10px 0 0; font-size: 13.5px; color: var(--ink); }
.changelog { padding-left: 20px; line-height: 1.7; font-size: 13.5px; }
.changelog li { margin-bottom: 4px; }

/* Global: the HTML `hidden` attribute MUST win over any author display rule.
   Without this, e.g. `.imp-banner { display: flex }` makes <div hidden> show. */
[hidden] { display: none !important; }

/* Lucide icons inline with text */
.bullets li { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.bullets li i[data-lucide] { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 4px; color: var(--primary); stroke-width: 2.25; }
.docs p.warn { display: flex; align-items: flex-start; gap: 10px; }
.docs p.warn i[data-lucide] { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 3px; color: #b45309; stroke-width: 2.25; }
.docs p.warn > * { flex: 1; }
