/* OneiPay - dashboard styles (no build step) */
:root {
    --bg: #0d0e10; --panel: #15171a; --panel-2: #1c1f23; --line: #2a2e33; --line-2: #353a40;
    --text: #eceef0; --muted: #959ca4; --accent: #f7931a; --accent-2: #ffa94d; --accent-soft: rgba(247,147,26,.12);
    --ok: #22c55e; --ok-soft: rgba(34,197,94,.12); --warn: #eab308; --warn-soft: rgba(234,179,8,.12);
    --bad: #ef4444; --bad-soft: rgba(239,68,68,.12); --info: #60a5fa; --info-soft: rgba(96,165,250,.12);
    --radius: 12px; --sidebar: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.55 Inter, system-ui, -apple-system, Segoe UI, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
code, .mono { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; font-size: 13px; }
code { background: var(--panel-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
pre { background: #0a0b0c; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; overflow-x: auto; font: 13px/1.6 'JetBrains Mono', Consolas, monospace; color: #d6d9dc; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* layout */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: none; background: var(--panel); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 700; font-size: 16px; color: var(--text); }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #111; display: grid; place-items: center; font-weight: 800; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; }
.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 28px; border-bottom: 1px solid var(--line); background: rgba(13,14,16,.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.content { padding: 28px; max-width: 1240px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.menu-btn { display: none; }

/* components */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-body { padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { padding: 18px; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 13px; color: var(--muted); font-weight: 500; }
.stack > * + * { margin-top: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #111; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #111; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); color: var(--bad); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.inline { display: inline; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--panel); }
tbody tr:hover { background: rgba(255,255,255,.02); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 40px 18px; text-align: center; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-paid, .b-matched, .b-delivered, .b-active { color: var(--ok); background: var(--ok-soft); }
.b-pending, .b-confirming { color: var(--warn); background: var(--warn-soft); }
.b-expired, .b-cancelled, .b-ignored, .b-revoked, .b-inactive { color: var(--muted); background: rgba(149,156,164,.12); }
.b-late, .b-failed, .b-unmatched, .b-error { color: var(--bad); background: var(--bad-soft); }
.b-manual, .b-admin { color: var(--info); background: var(--info-soft); }

.form { display: grid; gap: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.input, select.input, textarea.input { width: 100%; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); border-radius: 9px; padding: 10px 12px; font: 14px Inter, system-ui, sans-serif; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-error { border-color: var(--bad); }
.error-text { color: var(--bad); font-size: 12px; margin-top: 5px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .input { width: auto; min-width: 160px; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; }
.alert-success { background: var(--ok-soft); border-color: rgba(34,197,94,.3); color: #bbf7d0; }
.alert-error { background: var(--bad-soft); border-color: rgba(239,68,68,.3); color: #fecaca; }
.alert-warn { background: var(--warn-soft); border-color: rgba(234,179,8,.3); color: #fde68a; }
.secret-box { background: #0a0b0c; border: 1px dashed var(--accent); border-radius: 10px; padding: 14px; margin-top: 10px; word-break: break-all; }

dl.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-all; }

.pagination { display: flex; gap: 6px; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pagination .current { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(800px 400px at 50% -10%, rgba(247,147,26,.10), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 410px; }
.auth-card .brand { justify-content: center; padding-bottom: 26px; font-size: 18px; }
.auth-card .card-body { padding: 28px; }

@media (max-width: 1080px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
    .sidebar { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
    .shell.open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.55); }
    .menu-btn { display: inline-flex; }
    .content { padding: 20px 16px; }
    .topbar { padding: 12px 16px; }
    .grid-2 { grid-template-columns: 1fr; }
    dl.kv { grid-template-columns: 1fr; gap: 2px; }
    dl.kv dd { margin-bottom: 10px; }
}
@media (max-width: 520px) { .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Auth (OneiPay split layout) ---------- */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg); }
.auth-aside { position: relative; overflow: hidden; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
              background: radial-gradient(700px 420px at 15% 0%, rgba(247,147,26,.18), transparent 60%), #0a0b0d; border-right: 1px solid var(--line); }
.auth-aside .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); }
.auth-aside .logo img { height: 34px; width: auto; }
.auth-aside .logo .mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #111; display: grid; place-items: center; font-weight: 800; }
.auth-aside h2 { font-size: 34px; line-height: 1.15; font-weight: 750; max-width: 460px; }
.auth-aside h2 span { color: var(--accent); }
.auth-aside p.lead { color: var(--muted); font-size: 15px; max-width: 440px; margin: 16px 0 0; }
.auth-points { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; color: #cfd3d7; }
.auth-points svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 2px; }
.auth-aside .foot { color: var(--muted); font-size: 12px; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 400px; }
.auth-form h1 { font-size: 26px; }
.auth-form .sub { color: var(--muted); margin: 6px 0 26px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); font: 600 12px Inter, sans-serif; cursor: pointer; padding: 6px 8px; }
.pw-toggle:hover { color: var(--accent); }
.pw-meter { height: 4px; border-radius: 4px; background: var(--line); margin-top: 8px; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; background: var(--bad); transition: width .2s, background .2s; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.auth-alt { text-align: center; color: var(--muted); margin-top: 22px; }
.secure-note { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; margin-top: 18px; }
.secure-note svg { width: 14px; height: 14px; }
@media (max-width: 900px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-aside { padding: 28px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
    .auth-aside h2 { font-size: 24px; }
    .auth-points, .auth-aside .foot, .auth-aside p.lead { display: none; }
    .auth-main { padding: 28px 16px 40px; align-items: start; }
}

/* dashboard bars */
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; height: 180px; align-items: end; }
.bar-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.bar { width: 100%; max-width: 46px; max-height: calc(100% - 40px); background: linear-gradient(180deg, var(--accent), rgba(247,147,26,.45)); border-radius: 6px 6px 2px 2px; }
.bar-val { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bar-label { font-size: 12px; color: var(--muted); }

/* fixes */
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field .row label { margin-bottom: 6px; }
.btn.menu-btn { display: none; }
@media (max-width: 860px) { .btn.menu-btn { display: inline-flex; } }

.form { align-content: start; }
.form > .btn:not(.btn-block) { justify-self: start; }

/* installer steps */
.steps { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; text-align: center; }
.steps .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--panel); font-weight: 700; }
.steps li.current { color: var(--text); }
.steps li.current .num { background: var(--accent); border-color: var(--accent); color: #111; }
.steps li.done .num { background: var(--ok-soft); border-color: rgba(34,197,94,.4); color: var(--ok); }
[hidden] { display: none !important; }
@media (max-width: 520px) { .steps .txt { display: none; } }

.b-refunded, .b-resolved, .b-answered { color: var(--info); background: var(--info-soft); }
.b-blocked, .b-open, .b-rejected { color: var(--warn); background: var(--warn-soft); }
.b-closed { color: var(--muted); background: rgba(149,156,164,.12); }
.msg { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--panel-2); }
.msg.staff { border-color: rgba(247,147,26,.4); background: var(--accent-soft); }
.msg-body { white-space: pre-wrap; word-break: break-word; margin-top: 6px; }

/* ---------- public site ---------- */
.site-wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.site-head { position: sticky; top: 0; z-index: 10; background: rgba(13,14,16,.88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-head .row { height: 64px; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { color: var(--muted); font-weight: 500; }
.site-nav a:hover { color: var(--text); }
.site-nav a.btn { color: #111; }
.site-menu-btn { display: none; }
.hero { padding: 88px 0 64px; background: radial-gradient(900px 420px at 50% -10%, rgba(247,147,26,.14), transparent); text-align: center; }
.hero h1 { font-size: 52px; line-height: 1.05; letter-spacing: -.03em; max-width: 860px; margin: 0 auto; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--muted); font-size: 18px; max-width: 640px; margin: 18px auto 30px; }
.section { padding: 64px 0; }
.section h2.title { font-size: 32px; text-align: center; margin-bottom: 10px; letter-spacing: -.02em; }
.section p.lead { color: var(--muted); text-align: center; max-width: 620px; margin: 0 auto 36px; }
.feature { padding: 22px; }
.feature svg { width: 26px; height: 26px; color: var(--accent); }
.feature h3 { margin: 12px 0 6px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 12px; color: var(--muted); font-size: 13px; }
.prose { max-width: 780px; margin: 0 auto; line-height: 1.75; }
.prose h2 { margin: 28px 0 10px; font-size: 22px; }
.prose h3 { margin: 22px 0 8px; }
.prose p, .prose li { color: #cfd3d7; }
.prose a { text-decoration: underline; }
.prose pre { margin: 12px 0; }
.site-foot { border-top: 1px solid var(--line); padding: 40px 0 28px; margin-top: 40px; }
.site-foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.site-foot h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.site-foot a { display: block; color: var(--text); margin-bottom: 6px; font-size: 14px; }
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; padding: 40px 0; }
.docs-nav { position: sticky; top: 84px; align-self: start; display: grid; gap: 4px; }
.docs-nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; }
.docs-nav a:hover { color: var(--text); background: var(--panel-2); }
.docs section { scroll-margin-top: 84px; margin-bottom: 44px; }
.docs h2 { font-size: 24px; margin-bottom: 10px; }
.docs h3 { margin: 18px 0 8px; }
.docs p, .docs li { color: #cfd3d7; line-height: 1.7; }
.method-tag { display: inline-block; font: 700 12px 'JetBrains Mono', monospace; padding: 2px 8px; border-radius: 6px; background: var(--ok-soft); color: var(--ok); margin-right: 6px; }
.method-tag.get { background: var(--info-soft); color: var(--info); }
@media (max-width: 860px) {
    .site-menu-btn { display: inline-flex; }
    .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: flex-start; padding: 16px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
    .site-nav.open { display: flex; }
    .hero h1 { font-size: 34px; }
    .site-foot-grid { grid-template-columns: 1fr 1fr; }
    .docs { grid-template-columns: 1fr; }
    .docs-nav { position: static; grid-template-columns: repeat(3, 1fr); }
}
.b-operational { background: var(--ok-soft); color: var(--ok); }
.b-degraded { background: var(--bad-soft); color: var(--bad); }
.b-idle { background: var(--panel-2); color: var(--muted); }
.plan-card .plan-price { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.plan-card .plan-price small { font-size: 14px; color: var(--muted); font-weight: 500; }
.plan-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: #cfd3d7; font-size: 14px; }
.plan-list li::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 10px; vertical-align: middle; }
.plan-featured { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(247,147,26,.25); }
.docs > div { min-width: 0; }
.docs pre { overflow-x: auto; }
.check-row { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

/* ---- admin live overview ---- */
.crumbs { margin-bottom: 4px; }
.ov-actions { align-items: center; }
.count-pill { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: rgba(0,0,0,.25); font-size: 12px; text-align: center; }
.count-pill.warn { background: var(--warn-soft); color: var(--warn); }
.live-btn .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.live-btn.on { border-color: rgba(34,197,94,.4); color: var(--ok); }
.live-btn.on .live-dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: livepulse 1.6s infinite; }
@keyframes livepulse { 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
@media (prefers-reduced-motion: reduce) { .live-btn.on .live-dot { animation: none; } }
details.export { position: relative; }
details.export summary { list-style: none; }
details.export summary::-webkit-details-marker { display: none; }
.export-box { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 240px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.kpis { margin-bottom: 16px; }
.kpi { padding: 18px; border-top: 2px solid var(--accent); color: inherit; }
a.kpi:hover { border-color: var(--line-2); border-top-color: var(--accent); color: inherit; }
.kpis-small .kpi { border-top-color: var(--line-2); padding: 14px 18px; }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; }
.kpi-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.kpi-ico svg { width: 18px; height: 18px; }
.kpi .value { font-size: 28px; font-weight: 750; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .value.sm { font-size: 22px; }
.kpi .value.warn { color: var(--warn); } .kpi .value.bad { color: var(--bad); }
.kpi-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.kpi-sub b { color: var(--text); font-weight: 600; }
.chart-card .legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.chart-card .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-vol, .bar-vol { background: var(--accent); fill: var(--accent); }
.lg-rev, .bar-rev { background: var(--info); fill: var(--info); }
.chart-wrap { padding: 12px 16px 6px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart rect:hover { opacity: .85; }
.nav-label.grp { margin-top: 14px; color: var(--accent); }
.nav .nav-badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #111; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.nav .nav-badge.warn { background: var(--warn); }
