caelum0x 995083b651 feat(dashboard): onchain subscriptions page and refunds that send funds
- Subscriptions: every buyer subscription with plan, network and collection
  method, status, next charge, last charge (explorer link), dunning state and
  cancel at period end / now; active count, MRR and dunning totals. Falls back
  to the core list when onchain billing is off.
- Payment detail: Refund payment sends the funds on-chain through
  POST /v1/onchain-billing/refunds (operator wallet per network, Base escrow
  via the escrow) and shows the refund transaction link; when the operator is
  not configured for the network it offers "I refunded manually" to record
  the tx hash. Refund rows link to the explorer.
- Refunds ledger links each refund to its payment instead of creating
  unsent pending refunds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:35:22 +03:00

1210 lines
20 KiB
CSS

:root {
/* STATEMENT — greenbar ledger palette (see @settlekit/ui) */
--bg: #ebede4;
--bg-panel: #f3f4ec;
--bg-elevated: #dde3d1;
--border: #cdd3c5;
--border-strong: #b4bca9;
--text: #18211c;
--text-muted: #45524b;
--text-dim: #79847c;
--accent: #1e40a2;
--accent-hover: #16306f;
--accent-soft: rgba(30, 64, 162, 0.1);
--good: #2c6e49;
--good-soft: rgba(44, 110, 73, 0.12);
--warn: #9a6a18;
--warn-soft: rgba(154, 106, 24, 0.12);
--bad: #a33a2b;
--bad-soft: rgba(163, 58, 43, 0.1);
--radius: 4px;
--radius-sm: 3px;
--font-sans: var(--font-archivo), "Archivo", system-ui, -apple-system,
"Segoe UI", Roboto, sans-serif;
--font-mono: var(--font-mono-plex), "IBM Plex Mono", ui-monospace, "SF Mono",
Menlo, Consolas, monospace;
}
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
background: var(--bg);
color: var(--text);
font-family: var(--font-sans);
font-size: 14px;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
a {
color: inherit;
text-decoration: none;
}
code {
font-family: var(--font-mono);
font-size: 0.85em;
background: var(--bg-elevated);
padding: 1px 5px;
border-radius: 4px;
}
/* ---------- App shell ---------- */
.app-shell {
display: grid;
grid-template-columns: 248px 1fr;
min-height: 100vh;
}
.sidebar {
background: var(--bg-panel);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
position: sticky;
top: 0;
height: 100vh;
overflow-y: auto;
}
.sidebar-brand {
display: flex;
align-items: center;
gap: 10px;
font-weight: 700;
font-size: 16px;
padding: 18px 20px;
border-bottom: 1px solid var(--border);
}
.sidebar-logo {
color: var(--accent);
}
.sidebar-nav {
padding: 12px 12px 24px;
flex: 1;
}
.nav-group {
margin-bottom: 18px;
}
.nav-group-title {
text-transform: uppercase;
letter-spacing: 0.06em;
font-size: 10px;
font-weight: 600;
color: var(--text-dim);
padding: 6px 10px;
}
.nav-link {
display: block;
padding: 7px 10px;
border-radius: var(--radius-sm);
color: var(--text-muted);
font-size: 13px;
transition: background 0.12s, color 0.12s;
}
.nav-link:hover {
background: var(--bg-elevated);
color: var(--text);
}
.nav-link.active {
background: var(--accent-soft);
color: var(--accent);
font-weight: 600;
}
.sidebar-footer {
padding: 14px 20px;
border-top: 1px solid var(--border);
font-size: 11px;
color: var(--text-dim);
display: flex;
flex-direction: column;
gap: 8px;
}
.sidebar-signout {
display: inline-block;
align-self: flex-start;
font-size: 12px;
font-weight: 600;
color: var(--text-muted);
padding: 4px 0;
}
.sidebar-signout:hover {
color: var(--accent);
}
/* ---------- Auth shell ---------- */
.auth-shell {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
padding: 32px 20px;
}
.auth-shell-inner {
width: 100%;
max-width: 400px;
display: flex;
flex-direction: column;
gap: 22px;
}
.auth-brand {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
font-weight: 700;
font-size: 18px;
}
.auth-heading {
text-align: center;
}
.auth-heading .page-title {
font-size: 20px;
}
.auth-card {
background: var(--bg-panel);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 24px;
display: flex;
flex-direction: column;
gap: 18px;
}
.auth-card .form {
max-width: none;
}
.auth-method-toggle {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
}
.auth-alt {
text-align: center;
font-size: 13px;
color: var(--text-muted);
}
.auth-alt a {
color: var(--accent);
font-weight: 600;
}
.main {
padding: 28px 32px 64px;
max-width: 1180px;
width: 100%;
}
/* ---------- Page header ---------- */
.page-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 16px;
margin-bottom: 24px;
}
.page-title {
font-size: 22px;
font-weight: 700;
margin: 0;
}
.page-desc {
color: var(--text-muted);
margin: 4px 0 0;
font-size: 13px;
}
/* ---------- Cards & stats ---------- */
.card {
background: var(--bg-panel);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 20px;
margin-bottom: 20px;
}
.card-title {
font-size: 14px;
font-weight: 600;
margin: 0 0 14px;
}
.stat-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 14px;
margin-bottom: 24px;
}
.stat-card {
background: var(--bg-panel);
border: 1px solid var(--border);
border-left: 3px solid var(--border-strong);
border-radius: var(--radius);
padding: 16px 18px;
}
.stat-card.tone-good {
border-left-color: var(--good);
}
.stat-card.tone-warn {
border-left-color: var(--warn);
}
.stat-card.tone-bad {
border-left-color: var(--bad);
}
.stat-card.tone-default {
border-left-color: var(--accent);
}
.stat-label {
font-size: 12px;
color: var(--text-muted);
margin-bottom: 6px;
}
.stat-value {
font-size: 24px;
font-weight: 700;
letter-spacing: -0.01em;
}
.stat-hint {
font-size: 11px;
color: var(--text-dim);
margin-top: 4px;
}
/* ---------- Tables ---------- */
.table-wrap {
overflow-x: auto;
border: 1px solid var(--border);
border-radius: var(--radius);
}
.data-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
.data-table th {
text-align: left;
font-weight: 600;
color: var(--text-muted);
padding: 10px 14px;
background: var(--bg-elevated);
border-bottom: 1px solid var(--border);
white-space: nowrap;
}
.data-table td {
padding: 11px 14px;
border-bottom: 1px solid var(--border);
vertical-align: middle;
}
.data-table tr:last-child td {
border-bottom: none;
}
.data-table tbody tr:hover {
background: var(--bg-elevated);
}
.ta-right {
text-align: right;
}
.mono {
font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
font-size: 12px;
}
/* ---------- Badges ---------- */
.badge {
display: inline-block;
padding: 2px 9px;
border-radius: 999px;
font-size: 11px;
font-weight: 600;
text-transform: capitalize;
border: 1px solid transparent;
}
.badge-good {
background: var(--good-soft);
color: var(--good);
}
.badge-warn {
background: var(--warn-soft);
color: var(--warn);
}
.badge-bad {
background: var(--bad-soft);
color: var(--bad);
}
.badge-neutral {
background: var(--bg-elevated);
color: var(--text-muted);
border-color: var(--border);
}
/* ---------- Buttons ---------- */
.btn {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 8px 14px;
border-radius: var(--radius-sm);
font-size: 13px;
font-weight: 600;
cursor: pointer;
border: 1px solid var(--border-strong);
background: var(--bg-elevated);
color: var(--text);
transition: background 0.12s, border-color 0.12s;
}
.btn:hover {
border-color: var(--accent);
}
.btn-primary {
background: var(--accent);
border-color: var(--accent);
color: #fff;
}
.btn-primary:hover {
background: var(--accent-hover);
}
.btn:disabled {
opacity: 0.55;
cursor: not-allowed;
}
/* ---------- Empty / error states ---------- */
.empty-state {
text-align: center;
padding: 48px 24px;
border: 1px dashed var(--border-strong);
border-radius: var(--radius);
background: var(--bg-panel);
}
.empty-icon {
font-size: 28px;
color: var(--text-dim);
margin-bottom: 8px;
}
.empty-title {
font-weight: 600;
font-size: 15px;
}
.empty-message {
color: var(--text-muted);
max-width: 420px;
margin: 6px auto 0;
font-size: 13px;
}
.empty-action {
margin-top: 16px;
}
.error-banner {
background: var(--bad-soft);
border: 1px solid rgba(240, 99, 99, 0.4);
color: var(--bad);
padding: 10px 14px;
border-radius: var(--radius-sm);
font-size: 12px;
margin-bottom: 18px;
}
/* ---------- Sub navigation ---------- */
.subnav {
display: flex;
gap: 4px;
margin-bottom: 22px;
border-bottom: 1px solid var(--border);
flex-wrap: wrap;
}
.subnav-link {
padding: 8px 14px;
font-size: 13px;
color: var(--text-muted);
border-bottom: 2px solid transparent;
font-weight: 500;
}
.subnav-link:hover {
color: var(--text);
}
/* ---------- Forms ---------- */
.form {
display: flex;
flex-direction: column;
gap: 16px;
max-width: 640px;
}
.field {
display: flex;
flex-direction: column;
gap: 6px;
}
.field label {
font-size: 13px;
font-weight: 600;
}
.field-hint {
font-size: 12px;
color: var(--text-dim);
}
.input,
.select,
.textarea {
background: var(--bg);
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
color: var(--text);
padding: 9px 11px;
font-size: 13px;
font-family: inherit;
}
.input:focus,
.select:focus,
.textarea:focus {
outline: none;
border-color: var(--accent);
}
.textarea {
resize: vertical;
min-height: 80px;
}
.form-row {
display: flex;
gap: 12px;
flex-wrap: wrap;
}
.form-row > .field {
flex: 1;
min-width: 160px;
}
.form-message {
font-size: 13px;
padding: 8px 12px;
border-radius: var(--radius-sm);
}
.form-message.ok {
background: var(--good-soft);
color: var(--good);
}
.form-message.err {
background: var(--bad-soft);
color: var(--bad);
}
/* ---------- Choice grid (product builder) ---------- */
.choice-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 12px;
}
.choice {
text-align: left;
background: var(--bg);
border: 1px solid var(--border-strong);
border-radius: var(--radius);
padding: 14px 16px;
cursor: pointer;
transition: border-color 0.12s, background 0.12s;
}
.choice:hover {
border-color: var(--accent);
}
.choice.selected {
border-color: var(--accent);
background: var(--accent-soft);
}
.choice-title {
font-weight: 600;
font-size: 14px;
}
.choice-desc {
font-size: 12px;
color: var(--text-muted);
margin-top: 3px;
}
.step-label {
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--accent);
margin-bottom: 10px;
}
.builder-actions {
display: flex;
justify-content: flex-end;
gap: 10px;
margin-top: 8px;
}
/* ---------- Misc ---------- */
.muted {
color: var(--text-muted);
}
.dim {
color: var(--text-dim);
}
.row-between {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.tag-list {
display: flex;
gap: 6px;
flex-wrap: wrap;
}
.tag {
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: 4px;
padding: 1px 7px;
font-size: 11px;
color: var(--text-muted);
}
.detail-grid {
display: grid;
grid-template-columns: 160px 1fr;
gap: 10px 18px;
font-size: 13px;
}
.detail-grid dt {
color: var(--text-muted);
}
.detail-grid dd {
margin: 0;
font-weight: 500;
}
.breadcrumb {
font-size: 12px;
color: var(--text-dim);
margin-bottom: 6px;
}
.breadcrumb a:hover {
color: var(--accent);
}
/* ---------- Button variants ---------- */
.btn-ghost {
background: transparent;
border-color: var(--border-strong);
color: var(--text-muted);
}
.btn-ghost:hover {
color: var(--text);
border-color: var(--accent);
}
.btn-sm {
padding: 5px 11px;
font-size: 12px;
}
/* ---------- Onboarding checklist ---------- */
.onboarding {
border-color: var(--accent);
background: var(--bg-panel);
border-left: 3px solid var(--accent);
}
.onboarding-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 16px;
}
.onboarding-pct {
font-size: 22px;
font-weight: 700;
color: var(--accent);
font-variant-numeric: tabular-nums;
}
.onboarding-progress {
height: 6px;
border-radius: 999px;
background: var(--bg-elevated);
overflow: hidden;
margin: 14px 0 18px;
}
.onboarding-progress-fill {
height: 100%;
background: var(--accent);
border-radius: 999px;
transition: width 0.3s ease;
}
.onboarding-steps {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: 8px;
}
.onboarding-step {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 14px;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
background: var(--bg-elevated);
}
.onboarding-step.next {
border-color: var(--accent);
}
.onboarding-step.done {
opacity: 0.7;
}
.onboarding-check {
flex: 0 0 22px;
width: 22px;
height: 22px;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 999px;
font-size: 13px;
background: var(--bg-panel);
color: var(--text-dim);
}
.onboarding-step.done .onboarding-check {
background: var(--good-soft);
color: var(--good);
}
.onboarding-step-body {
display: flex;
flex-direction: column;
gap: 2px;
flex: 1 1 auto;
min-width: 0;
}
.onboarding-step-title {
font-weight: 600;
font-size: 14px;
}
.onboarding-step.done .onboarding-step-title {
text-decoration: line-through;
text-decoration-color: var(--text-dim);
}
.onboarding-step-status {
font-size: 12px;
flex: 0 0 auto;
}
/* ---------- Topbar + notification center ---------- */
.topbar {
display: flex;
align-items: center;
justify-content: flex-end;
margin-bottom: 12px;
}
.bell-wrap {
position: relative;
}
.bell {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
border-radius: var(--radius-sm);
border: 1px solid var(--border-strong);
background: var(--bg-elevated);
color: var(--text);
font-size: 16px;
cursor: pointer;
transition: background 0.12s, border-color 0.12s;
}
.bell:hover {
border-color: var(--accent);
}
.bell-badge {
position: absolute;
top: -6px;
right: -6px;
min-width: 18px;
height: 18px;
padding: 0 4px;
border-radius: 999px;
background: var(--bad);
color: #fff;
font-size: 10px;
font-weight: 700;
line-height: 18px;
text-align: center;
}
.notif-dropdown {
position: absolute;
top: calc(100% + 8px);
right: 0;
width: 340px;
max-width: 90vw;
background: var(--bg-panel);
border: 1px solid var(--border-strong);
border-radius: var(--radius);
box-shadow: 0 8px 24px rgba(24, 33, 28, 0.12);
z-index: 40;
overflow: hidden;
}
.notif-head {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 14px;
font-weight: 600;
font-size: 13px;
border-bottom: 1px solid var(--border);
}
.notif-refresh {
border: none;
background: none;
color: var(--accent);
font-size: 12px;
font-weight: 600;
cursor: pointer;
padding: 0;
}
.notif-body {
max-height: 360px;
overflow-y: auto;
}
.notif-empty {
padding: 24px 14px;
margin: 0;
text-align: center;
color: var(--text-dim);
font-size: 13px;
}
.notif-item {
display: flex;
gap: 10px;
padding: 12px 14px;
border-bottom: 1px solid var(--border);
}
.notif-item:last-child {
border-bottom: none;
}
.notif-dot {
flex: 0 0 auto;
width: 8px;
height: 8px;
margin-top: 5px;
border-radius: 999px;
background: var(--text-dim);
}
.notif-dot.dot-good {
background: var(--good);
}
.notif-dot.dot-warn {
background: var(--warn);
}
.notif-dot.dot-bad {
background: var(--bad);
}
.notif-content {
min-width: 0;
}
.notif-title {
font-size: 13px;
font-weight: 600;
text-transform: capitalize;
}
.notif-detail {
font-size: 12px;
color: var(--text-muted);
margin-top: 2px;
word-break: break-word;
}
.notif-time {
font-size: 11px;
color: var(--text-dim);
margin-top: 4px;
}
.notif-viewall {
display: block;
padding: 10px 14px;
text-align: center;
font-size: 12px;
font-weight: 600;
color: var(--accent);
text-decoration: none;
border-top: 1px solid var(--border);
}
.notif-viewall:hover {
background: var(--accent-soft);
}
/* ---------- Merchant workspace ---------- */
.sidebar-logo {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 3px;
background: var(--accent);
}
.nav-summary {
cursor: pointer;
list-style: none;
}
.nav-summary::-webkit-details-marker {
display: none;
}
.nav-summary::after {
content: " +";
}
details[open] > .nav-summary::after {
content: " -";
}
.link {
color: var(--accent);
}
.link:hover {
text-decoration: underline;
}
.small {
font-size: 12px;
}
.field-error {
font-size: 12px;
color: var(--bad);
}
.input-error {
border-color: var(--bad) !important;
}
.checkbox-row {
display: flex;
align-items: center;
gap: 8px;
font-size: 13px;
padding: 4px 0;
cursor: pointer;
}
.toggle-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 2px 16px;
margin-top: 6px;
}
.network-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
gap: 10px;
}
.network-choice {
display: flex;
gap: 10px;
align-items: flex-start;
padding: 12px 14px;
border: 1px solid var(--border-strong);
border-radius: var(--radius);
background: var(--bg);
cursor: pointer;
transition: border-color 0.12s, background 0.12s;
}
.network-choice.selected {
border-color: var(--accent);
background: var(--accent-soft);
}
.network-choice input {
margin-top: 3px;
}
.network-choice-body {
display: flex;
flex-direction: column;
gap: 2px;
}
.network-choice-title {
font-weight: 600;
display: flex;
gap: 6px;
align-items: center;
}
.network-choice-desc {
font-size: 12px;
color: var(--text-muted);
}
.network-choice-warn {
font-size: 11px;
color: var(--warn);
}
.network-chip {
display: inline-flex;
gap: 6px;
align-items: center;
white-space: nowrap;
}
.network-chip-asset {
font-family: var(--font-mono);
font-size: 11px;
color: var(--text-muted);
background: var(--bg-elevated);
padding: 1px 6px;
border-radius: var(--radius-sm);
}
.tag-agent {
background: var(--accent-soft);
color: var(--accent);
}
.copy-row {
display: flex;
gap: 8px;
align-items: flex-start;
}
.copy-row .input,
.copy-row .textarea {
flex: 1;
}
.share-link .field {
margin-bottom: 12px;
}
.callout {
border-color: var(--accent);
}
.wizard-steps {
display: flex;
gap: 18px;
list-style: none;
padding: 0;
margin: 0 0 18px;
flex-wrap: wrap;
}
.wizard-steps li {
display: flex;
align-items: center;
gap: 8px;
color: var(--text-dim);
font-weight: 600;
font-size: 13px;
}
.wizard-steps li.current {
color: var(--accent);
}
.wizard-steps li.done {
color: var(--good);
}
.wizard-num {
width: 22px;
height: 22px;
border-radius: 50%;
border: 1px solid currentColor;
display: inline-flex;
align-items: center;
justify-content: center;
font-size: 12px;
}
.timeline {
list-style: none;
margin: 0;
padding: 0;
}
.timeline li {
display: flex;
gap: 12px;
padding: 8px 0;
position: relative;
}
.timeline li:not(:last-child)::before {
content: "";
position: absolute;
left: 5px;
top: 22px;
bottom: -8px;
width: 1px;
background: var(--border-strong);
}
.timeline-dot {
width: 11px;
height: 11px;
margin-top: 5px;
border-radius: 50%;
border: 2px solid var(--border-strong);
background: var(--bg-panel);
flex-shrink: 0;
}
.timeline li.done .timeline-dot {
border-color: var(--good);
background: var(--good);
}
.timeline-title {
font-weight: 600;
}
.timeline li.todo .timeline-title {
color: var(--text-dim);
}
.timeline-meta {
font-size: 12px;
color: var(--text-muted);
}
.plain-list {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
gap: 8px;
}
.refund-form {
max-width: 560px;
text-align: left;
}
.filter-bar {
display: flex;
flex-wrap: wrap;
gap: 6px;
align-items: center;
margin-bottom: 14px;
}
.filter-pill {
font-size: 12px;
padding: 4px 10px;
border-radius: 999px;
border: 1px solid var(--border-strong);
color: var(--text-muted);
}
.filter-pill.active {
border-color: var(--accent);
background: var(--accent-soft);
color: var(--accent);
font-weight: 600;
}
.filter-sep {
width: 1px;
height: 18px;
background: var(--border-strong);
margin: 0 6px;
}
.bar-list {
display: flex;
flex-direction: column;
gap: 8px;
}
.bar-row {
display: grid;
grid-template-columns: 160px 1fr 140px;
gap: 12px;
align-items: center;
font-size: 13px;
}
.bar-track {
height: 8px;
background: var(--bg-elevated);
border-radius: 4px;
overflow: hidden;
}
.bar-fill {
display: block;
height: 100%;
background: var(--accent);
}
.bar-value {
text-align: right;
font-family: var(--font-mono);
font-size: 12px;
}
.access-pill {
display: inline-flex;
gap: 6px;
align-items: center;
font-size: 12px;
}
/* --- Subscriptions / refunds ---------------------------------------------- */
.inline-actions {
display: inline-flex;
gap: 6px;
align-items: center;
flex-wrap: wrap;
justify-content: flex-end;
}
.btn-small {
padding: 4px 10px;
font-size: 12px;
}
.refund-mode {
display: flex;
gap: 16px;
margin-bottom: 10px;
}