/* ClassyPay design system: light, high-contrast fintech UI. */

:root {
    color-scheme: light;
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f4f8;
    --border: #e4e8ef;
    --border-strong: #d3d9e3;
    --ink: #0b1220;
    --text: #1e293b;
    --muted: #5f6b82;
    --subtle: #94a0b5;

    --brand: #059669;
    --brand-700: #047857;
    --brand-800: #065f46;
    --brand-50: #ecfdf5;
    --brand-100: #d1fae5;
    --brand-200: #a7f3d0;

    --info: #2563eb;
    --info-50: #eff6ff;
    --warn: #b45309;
    --warn-50: #fffbeb;
    --warn-200: #fde68a;
    --danger: #dc2626;
    --danger-700: #b91c1c;
    --danger-50: #fef2f2;
    --danger-200: #fecaca;
    --violet: #7c3aed;
    --violet-50: #f5f3ff;

    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 24px 48px -16px rgba(15, 23, 42, 0.22);
    --ring: 0 0 0 4px rgba(5, 150, 105, 0.16);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --sidebar-w: 264px;
    --topbar-h: 64px;
    --bottomnav-h: 66px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv11', 'ss01';
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--brand-800); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); letter-spacing: -0.02em; margin: 0; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15.5px; font-weight: 700; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
code, kbd, .mono { font-family: var(--font-mono); font-size: 0.88em; }
code { background: var(--surface-3); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; color: var(--ink); overflow-wrap: anywhere; }
pre { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--brand-100); color: var(--ink); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
[hidden] { display: none !important; }
.num, .amount { font-variant-numeric: tabular-nums; }

/* ---------- Icons & logo ---------- */
.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -0.03em; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 32px; height: 32px; flex-shrink: 0; }
.brand small { font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-100); padding: 2px 7px; border-radius: 999px; }

/* ---------- Buttons ---------- */
.btn {
    --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--border-strong);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px;
    background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
    border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; line-height: 1;
    cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
    box-shadow: var(--shadow-xs);
}
.btn:hover { color: var(--btn-fg); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { --btn-bg: var(--brand); --btn-fg: #fff; --btn-bd: var(--brand); box-shadow: 0 1px 2px rgba(5, 150, 105, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn-dark { --btn-bg: var(--ink); --btn-fg: #fff; --btn-bd: var(--ink); }
.btn-dark:hover { background: #1c2740; color: #fff; }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-bd: var(--danger); }
.btn-danger:hover { background: var(--danger-700); border-color: var(--danger-700); color: #fff; }
.btn-danger-soft { --btn-bg: var(--surface); --btn-fg: var(--danger-700); --btn-bd: var(--danger-200); }
.btn-danger-soft:hover { background: var(--danger-50); color: var(--danger-700); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: rgba(255,255,255,0.9) rgba(255,255,255,0.9) transparent transparent; animation: spin 0.7s linear infinite; }
.btn-secondary.is-loading::after, .btn:not(.btn-primary):not(.btn-dark):not(.btn-danger).is-loading::after { border-color: var(--muted) var(--muted) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; min-width: 0; }
.label { font-size: 13px; font-weight: 600; color: var(--ink); }
.label .optional { color: var(--subtle); font-weight: 500; }
.hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
    width: 100%; height: 42px; padding: 0 13px;
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6b82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input::placeholder, .textarea::placeholder { color: var(--subtle); }
.input:hover, .select:hover, .textarea:hover { border-color: #b9c1cf; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input[readonly] { background: var(--surface-2); }
.input-lg { height: 48px; font-size: 15px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { flex: 1; }
.input-group .prefix { position: absolute; left: 13px; color: var(--muted); font-weight: 600; pointer-events: none; }
.input-group .prefix + .input { padding-left: 32px; }
.input-group .suffix-btn { position: absolute; right: 6px; height: 30px; padding: 0 8px; border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; }
.input-group .suffix-btn:hover { color: var(--ink); background: var(--surface-3); }
.input-group .suffix-btn + .input, .input-group .input:has(+ .suffix-btn) { padding-right: 44px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); cursor: pointer; }
.check input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--brand); flex-shrink: 0; }
.file-drop { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.file-drop:hover, .file-drop.is-active { border-color: var(--brand); background: var(--brand-50); }
.file-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop .file-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; color: var(--brand-700); flex-shrink: 0; overflow: hidden; }
.file-drop .file-icon img { width: 100%; height: 100%; object-fit: cover; }
.file-drop .file-text { min-width: 0; }
.file-drop .file-name { font-weight: 600; color: var(--ink); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-error .input, .field-error .select { border-color: var(--danger); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-header .card-subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.card-highlight { border-color: var(--brand-200); box-shadow: 0 0 0 4px var(--brand-50); }
.card-warning { border-color: var(--warn-200); background: linear-gradient(180deg, var(--warn-50), var(--surface) 70%); }
.stack { display: grid; gap: 20px; }
.stack-sm { display: grid; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }

/* ---------- Stats ---------- */
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 18px 16px; box-shadow: var(--shadow-xs); min-width: 0; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); }
.stat-icon.tone-info { background: var(--info-50); color: var(--info); }
.stat-icon.tone-warn { background: var(--warn-50); color: var(--warn); }
.stat-icon.tone-violet { background: var(--violet-50); color: var(--violet); }
.stat-icon.tone-danger { background: var(--danger-50); color: var(--danger); }
.stat-value { margin-top: 12px; font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.15; }
.stat-meta { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.stat-meta a { font-weight: 600; }
.balance-card { position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 24px; color: var(--ink); background: radial-gradient(120% 140% at 100% 0%, #d1fae5 0%, rgba(209, 250, 229, 0) 55%), linear-gradient(135deg, #ffffff 0%, #f0fdf7 100%); border: 1px solid var(--brand-100); box-shadow: var(--shadow-sm); }
.balance-card .stat-label { color: var(--brand-800); }
.balance-card .stat-value { font-size: 34px; }
.balance-card::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%; border: 28px solid rgba(5, 150, 105, 0.07); }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.is-link { cursor: pointer; }
.table .text-right, .table th.text-right { text-align: right; }
.table .cell-title { font-weight: 600; color: var(--ink); }
.table .cell-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn-group { justify-content: flex-end; flex-wrap: nowrap; }
.amount-in { color: var(--brand-700); font-weight: 600; }
.amount-out { color: var(--ink); font-weight: 600; }

/* Responsive card-style tables on phones */
@media (max-width: 720px) {
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
    .table-stack tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
    .table-stack tbody tr:last-child { border-bottom: 0; }
    .table-stack td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 16px; text-align: right; }
    .table-stack td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: left; flex-shrink: 0; }
    .table-stack td.cell-primary { display: block; text-align: left; padding-bottom: 6px; }
    .table-stack td.cell-primary::before { display: none; }
    .table-stack td.actions { justify-content: flex-start; padding-top: 10px; }
    .table-stack td.actions::before { display: none; }
}

/* ---------- Badges & alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-3); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge.no-dot::before { display: none; }
.badge-success { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.badge-warning { background: var(--warn-50); color: var(--warn); border-color: var(--warn-200); }
.badge-danger { background: var(--danger-50); color: var(--danger-700); border-color: var(--danger-200); }
.badge-info { background: var(--info-50); color: var(--info); border-color: #bfdbfe; }
.badge-violet { background: var(--violet-50); color: var(--violet); border-color: #ddd6fe; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--radius); border: 1px solid; font-size: 14px; }
.alert .icon { margin-top: 1px; }
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-weight: 700; color: inherit; margin-bottom: 2px; }
.alert-success { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-800); }
.alert-error { background: var(--danger-50); border-color: var(--danger-200); color: var(--danger-700); }
.alert-warning { background: var(--warn-50); border-color: var(--warn-200); color: #92400e; }
.alert-info { background: var(--info-50); border-color: #bfdbfe; color: #1e40af; }
.alert a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.alert .alert-close { margin-left: auto; background: none; border: 0; color: inherit; opacity: 0.6; cursor: pointer; padding: 2px; border-radius: 6px; }
.alert .alert-close:hover { opacity: 1; }
.flash-stack { display: grid; gap: 10px; margin-bottom: 20px; }

/* ---------- Key/value, lists, empty states ---------- */
.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 0; }
.kv dt, .kv dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { color: var(--ink); font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.kv-left dd { text-align: left; }
.empty { text-align: center; padding: 44px 20px; }
.empty .empty-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 380px; margin: 0 auto 16px; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.text-ink { color: var(--ink); }
.text-success { color: var(--brand-700); }
.text-danger { color: var(--danger-700); }
.small { font-size: 12.5px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--subtle); font-size: 12.5px; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; border-top: 1px solid var(--border); }
.copy-field { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 13px; color: var(--ink); }
.copy-field span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.secret-reveal { background: var(--warn-50); border: 1px solid var(--warn-200); border-radius: var(--radius); padding: 16px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .icon { color: var(--brand); margin-top: 2px; }

/* ---------- Page header, toolbar, tabs, pagination ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-header .page-title { min-width: 0; }
.page-header p { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--muted); font-weight: 500; }
.breadcrumb a:hover { color: var(--ink); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.toolbar .input, .toolbar .select { height: 38px; }
.toolbar .search { flex: 1 1 240px; max-width: 380px; }
.toolbar .select { width: auto; min-width: 150px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-color: var(--brand); }
.tabs .count { background: var(--surface-3); border-radius: 999px; padding: 0 7px; font-size: 12px; line-height: 20px; }
.segmented { display: inline-flex; background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented a { padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: 13px; }
.segmented a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); flex-wrap: wrap; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar-w);
    display: flex; flex-direction: column;
    background: var(--surface); border-right: 1px solid var(--border);
}
.sidebar-head { height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar-close { display: none; }
.sidebar-body { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-section { margin-bottom: 18px; }
.nav-title { padding: 0 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--subtle); }
.nav-link { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 10px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; position: relative; }
.nav-link .icon { color: var(--subtle); }
.nav-link:hover { background: var(--surface-3); color: var(--ink); }
.nav-link:hover .icon { color: var(--ink); }
.nav-link.active { background: var(--brand-50); color: var(--brand-800); }
.nav-link.active .icon { color: var(--brand); }
.nav-link.active::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.account-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.account-chip:hover { background: var(--surface-3); }
.avatar { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-100), #e0f2fe); color: var(--brand-800); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; font-family: var(--font-display); }
.account-chip .who { min-width: 0; flex: 1; }
.account-chip .who strong { display: block; font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chip .who span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: rgba(245, 247, 250, 0.86); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
.topbar-menu { display: none; }
.topbar-brand { display: none; }
.topbar-title { font-family: var(--font-display); font-weight: 700; color: var(--ink); font-size: 15px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.env-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--brand-50); color: var(--brand-800); border: 1px solid var(--brand-100); font-size: 12px; font-weight: 700; }
.env-pill.warn { background: var(--warn-50); color: #92400e; border-color: var(--warn-200); }
.content { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 28px 40px; }
.app-footer { padding: 16px 28px; border-top: 1px solid var(--border); color: var(--subtle); font-size: 12.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.app-footer a { color: var(--muted); }

.bottom-nav { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.38); z-index: 39; opacity: 0; pointer-events: none; transition: opacity 0.2s; }

@media (max-width: 1023px) {
    .sidebar { transform: translateX(-102%); transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: var(--shadow-lg); width: min(300px, 86vw); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .scrim { opacity: 1; pointer-events: auto; }
    body.nav-open { overflow: hidden; }
    .sidebar-close { display: inline-flex; }
    .main { margin-left: 0; }
    .topbar { padding: 0 16px; background: rgba(255, 255, 255, 0.92); }
    .topbar-menu { display: inline-flex; }
    .topbar-brand { display: inline-flex; }
    .topbar-title { display: none; }
    .content { padding: 20px 16px calc(var(--bottomnav-h) + var(--safe-bottom) + 28px); }
    .app-footer { display: none; }
    .bottom-nav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
        display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
        height: calc(var(--bottomnav-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
        background: rgba(255, 255, 255, 0.96); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
        border-top: 1px solid var(--border); box-shadow: 0 -6px 20px -12px rgba(15, 23, 42, 0.2);
    }
    .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--subtle); font-size: 11px; font-weight: 600; background: none; border: 0; cursor: pointer; position: relative; }
    .bottom-nav .icon { width: 21px; height: 21px; }
    .bottom-nav a.active { color: var(--brand-700); }
    .bottom-nav a.active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
    .bottom-nav .dot { position: absolute; top: 9px; left: calc(50% + 6px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }
    .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
    body { font-size: 14px; }
    h1 { font-size: 22px; }
    .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 20px; }
    .balance-card .stat-value { font-size: 28px; }
    .card-header, .card-body, .toolbar, .pagination { padding-left: 16px; padding-right: 16px; }
    .page-header { align-items: stretch; }
    .page-header .btn-group { width: 100%; }
    .page-header .btn-group .btn { flex: 1; }
    .toolbar .search { max-width: none; }
    .kv { grid-template-columns: 1fr 1fr; }
}

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; display: none; }
.dropdown.open .dropdown-menu { display: block; animation: pop 0.14s ease; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: 14px; background: none; border: 0; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-3); color: var(--ink); }
.dropdown-menu .danger { color: var(--danger-700); }
.dropdown-menu .menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-menu .menu-head strong { display: block; color: var(--ink); font-size: 14px; }
.dropdown-menu .menu-head span { font-size: 12.5px; color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- Modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-root.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px); animation: fade 0.15s ease; }
.modal { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); animation: rise 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.modal-lg { max-width: 640px; }
.modal-header { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 6px; }
.modal-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--brand-50); color: var(--brand-700); }
.modal-icon.danger { background: var(--danger-50); color: var(--danger); }
.modal-icon.warning { background: var(--warn-50); color: var(--warn); }
.modal-icon.info { background: var(--info-50); color: var(--info); }
.modal-title { font-size: 17px; margin-top: 2px; }
.modal-text { color: var(--muted); margin-top: 6px; font-size: 14px; }
.modal-close { margin-left: auto; }
.modal-body { padding: 14px 22px 4px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 22px 22px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (max-width: 720px) {
    .modal-root { align-items: flex-end; padding: 0; }
    .modal { max-width: none; border-radius: 22px 22px 0 0; max-height: 92vh; padding-bottom: var(--safe-bottom); animation: sheet 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
    .modal-footer .btn { flex: 1; }
    @keyframes sheet { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
}
body.modal-open { overflow: hidden; }

/* ---------- Toasts ---------- */
.toast-region { position: fixed; z-index: 120; top: 18px; right: 18px; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 14px; color: var(--ink); animation: rise 0.2s ease; }
.toast .icon { margin-top: 1px; }
.toast.success .icon { color: var(--brand); }
.toast.error .icon { color: var(--danger); }
.toast.info .icon { color: var(--info); }
.toast.leaving { opacity: 0; transform: translateY(-6px); transition: all 0.2s; }
@media (max-width: 720px) { .toast-region { top: auto; bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 12px); right: 16px; } }

/* ---------- Mini chart ---------- */
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; align-items: end; height: 160px; padding-top: 10px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-fill { width: 100%; max-width: 38px; min-height: 3px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #34d399, var(--brand)); position: relative; }
.bar-fill.is-zero { background: var(--surface-3); }
.bar-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.bar-fill[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }

/* ---------- Steps (onboarding) ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 10px; }
.step-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--border-strong); color: var(--muted); font-size: 12px; font-weight: 700; flex-shrink: 0; background: var(--surface); }
.step.done .step-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.current { background: var(--brand-50); }
.step.current .step-dot { border-color: var(--brand); color: var(--brand-700); }
.step strong { display: block; color: var(--ink); font-size: 14px; }
.step span { font-size: 12.5px; color: var(--muted); }

/* ---------- Code blocks (docs, developers) ---------- */
.code { position: relative; background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface-3); font-size: 12px; font-weight: 600; color: var(--muted); }
.code pre { padding: 14px 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 12.8px; line-height: 1.7; color: #1e293b; }
.code .tok-k { color: #7c3aed; }
.code .tok-s { color: #047857; }
.code .tok-c { color: #94a3b8; }
.method { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; }
.method-post { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }
.method-get { background: var(--info-50); color: var(--info); border: 1px solid #bfdbfe; }

/* =================================================================
   Public site
   ================================================================= */
.site { background: var(--surface); font-size: 16px; }
.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, 0.86); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.site-header.scrolled { border-color: var(--border); }
.site-header .container { display: flex; align-items: center; gap: 24px; height: 70px; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.site-nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 15px; }
.site-nav a:hover { color: var(--ink); background: var(--surface-3); }
.site-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.site-menu-btn { display: none; margin-left: auto; }
.mobile-menu { display: none; }
@media (max-width: 860px) {
    .site-nav, .site-actions { display: none; }
    .site-menu-btn { display: inline-flex; }
    .mobile-menu.open { display: grid; gap: 4px; padding: 10px 20px 20px; border-top: 1px solid var(--border); background: #fff; }
    .mobile-menu a { padding: 12px; border-radius: 10px; font-weight: 600; color: var(--ink); }
    .mobile-menu a:hover { background: var(--surface-3); }
    .mobile-menu .btn { margin-top: 6px; }
}
.hero { position: relative; overflow: hidden; padding: 84px 0 72px; background:
        radial-gradient(900px 420px at 85% -10%, rgba(52, 211, 153, 0.18), transparent 60%),
        radial-gradient(700px 400px at -10% 10%, rgba(96, 165, 250, 0.10), transparent 60%), #fff; }
.hero::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%); pointer-events: none; }
.hero .container { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-xs); font-size: 13px; font-weight: 600; color: var(--text); }
.eyebrow b { background: var(--brand-50); color: var(--brand-700); border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.hero h1 { font-size: clamp(36px, 5.2vw, 60px); line-height: 1.04; letter-spacing: -0.045em; margin: 22px 0 18px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--brand), #0ea5e9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 18.5px; color: var(--muted); max-width: 560px; line-height: 1.6; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-proof { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 30px; color: var(--muted); font-size: 14px; }
.hero-proof span { display: inline-flex; align-items: center; gap: 7px; }
.hero-proof .icon { color: var(--brand); }
.mock { position: relative; }
.mock-card { background: #fff; border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 30px 60px -20px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.02); padding: 22px; }
.mock-float { position: absolute; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-size: 13.5px; }
.mock-float .stat-icon { width: 32px; height: 32px; }
.section { padding: 88px 0; }
.section-alt { background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-kicker { color: var(--brand-700); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.035em; line-height: 1.12; font-weight: 800; }
.section-head p { color: var(--muted); font-size: 17px; margin-top: 14px; }
.feature { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; transition: box-shadow 0.2s, transform 0.2s; }
.feature:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.feature .stat-icon { width: 42px; height: 42px; border-radius: 12px; margin-bottom: 18px; }
.feature h3 { font-size: 17px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 15px; }
.how { counter-reset: how; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.how li { list-style: none; position: relative; padding-top: 52px; }
.how li::before { counter-increment: how; content: counter(how); position: absolute; top: 0; left: 0; width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-family: var(--font-display); }
.how h3 { margin-bottom: 6px; }
.how p { color: var(--muted); font-size: 15px; }
.pricing-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 34px; box-shadow: var(--shadow); }
.price { font-family: var(--font-display); font-size: 56px; font-weight: 800; letter-spacing: -0.05em; color: var(--ink); line-height: 1; }
.price small { font-size: 18px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.cta-band { border-radius: var(--radius-xl); padding: 52px; background: radial-gradient(600px 300px at 100% 0%, rgba(52, 211, 153, 0.25), transparent 60%), linear-gradient(135deg, #ecfdf5, #f0f9ff); border: 1px solid var(--brand-100); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.035em; }
.site-footer { border-top: 1px solid var(--border); padding: 44px 0 30px; background: #fff; }
.site-footer .container { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.site-footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 12px; font-family: var(--font); }
.site-footer a { display: block; color: var(--text); padding: 4px 0; font-size: 14.5px; }
.site-footer a:hover { color: var(--brand-700); }
.site-footer .legal { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 20px; margin-top: 10px; color: var(--subtle); font-size: 13.5px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 960px) {
    .hero { padding: 56px 0 48px; }
    .hero .container { grid-template-columns: 1fr; gap: 40px; }
    .mock-float { display: none; }
    .how { grid-template-columns: repeat(2, 1fr); }
    .site-footer .container { grid-template-columns: 1fr 1fr; }
    .section { padding: 64px 0; }
    .cta-band { padding: 32px; }
}
@media (max-width: 560px) {
    .container { width: calc(100% - 32px); }
    .how { grid-template-columns: 1fr; }
    .hero-actions .btn { flex: 1; }
    .site-footer .container { grid-template-columns: 1fr; }
}

/* ---------- Docs ---------- */
.docs-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 48px; padding: 40px 0 80px; }
.docs-nav { position: sticky; top: 94px; align-self: start; display: grid; gap: 2px; }
.docs-nav a { padding: 7px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 14.5px; }
.docs-nav a:hover { background: var(--surface-3); color: var(--ink); }
.docs-nav .nav-title { margin-top: 14px; }
.doc { max-width: 820px; }
.doc section { padding-top: 12px; margin-bottom: 44px; scroll-margin-top: 90px; }
.doc h1 { font-size: 38px; letter-spacing: -0.04em; margin-bottom: 12px; }
.doc h2 { font-size: 24px; margin-bottom: 12px; letter-spacing: -0.03em; }
.doc h3 { margin: 22px 0 10px; }
.doc p, .doc li { color: var(--muted); font-size: 15.5px; line-height: 1.75; }
.doc ul { padding-left: 20px; }
.doc .code { margin: 14px 0; }
.doc .card { margin: 14px 0; }
.endpoint { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 14px; color: var(--ink); margin: 6px 0 14px; }
@media (max-width: 860px) { .docs-layout { grid-template-columns: 1fr; gap: 20px; } .docs-nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 6px; } .docs-nav .nav-title { display: none; } .docs-nav a { white-space: nowrap; background: var(--surface-3); } .doc h1 { font-size: 30px; } }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: #fff; }
.auth-main { display: flex; flex-direction: column; padding: 28px clamp(20px, 5vw, 64px); }
.auth-form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 0; }
.auth-form { width: 100%; max-width: 410px; }
.auth-form.wide { max-width: 560px; }
.auth-form h1 { font-size: 28px; letter-spacing: -0.035em; margin-bottom: 8px; }
.auth-form .lede { color: var(--muted); margin-bottom: 26px; font-size: 15px; }
.auth-form .form { gap: 18px; }
.auth-foot { color: var(--muted); font-size: 14px; text-align: center; margin-top: 22px; }
.auth-legal { color: var(--subtle); font-size: 12.5px; text-align: center; }
.auth-aside { position: relative; overflow: hidden; margin: 12px; border-radius: 26px; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(600px 400px at 100% 0%, rgba(52, 211, 153, 0.35), transparent 60%), radial-gradient(500px 360px at 0% 100%, rgba(56, 189, 248, 0.22), transparent 60%), linear-gradient(160deg, #f0fdf6, #ecfeff); border: 1px solid var(--brand-100); }
.auth-aside h2 { font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -0.035em; line-height: 1.15; max-width: 460px; font-weight: 800; }
.auth-aside .checklist { margin-top: 26px; font-size: 15px; color: var(--text); }
.auth-quote { background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-sm); max-width: 440px; backdrop-filter: blur(6px); }
@media (max-width: 960px) { .auth { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* ---------- Hosted checkout ---------- */
.pay-page { min-height: 100vh; background: radial-gradient(800px 360px at 50% -10%, rgba(52, 211, 153, 0.16), transparent 70%), var(--bg); padding: 28px 16px 40px; }
.pay-shell { max-width: 480px; margin: 0 auto; }
.pay-merchant { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.pay-merchant .avatar { width: 42px; height: 42px; border-radius: 12px; font-size: 16px; }
.pay-card { background: #fff; border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 24px 50px -24px rgba(15, 23, 42, 0.25); overflow: hidden; }
.pay-amount { padding: 24px 24px 20px; border-bottom: 1px dashed var(--border-strong); }
.pay-amount .value { font-family: var(--font-display); font-size: 38px; font-weight: 800; letter-spacing: -0.04em; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.pay-body { padding: 22px 24px 24px; }
.pay-detail { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.pay-detail:last-child { border-bottom: 0; }
.pay-detail .k { color: var(--muted); font-size: 13.5px; }
.pay-detail .v { color: var(--ink); font-weight: 700; text-align: right; font-size: 15.5px; overflow-wrap: anywhere; }
.pay-detail .v.big { font-family: var(--font-mono); font-size: 21px; letter-spacing: 0.04em; }
.pay-timer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; padding: 12px 14px; background: var(--warn-50); border: 1px solid var(--warn-200); border-radius: 12px; color: #92400e; font-size: 13.5px; }
.pay-timer strong { font-family: var(--font-mono); font-size: 17px; color: #78350f; }
.pay-status { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--muted); font-size: 13.5px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5); animation: pulse 1.6s infinite; flex-shrink: 0; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(5, 150, 105, 0); } 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); } }
.pay-result { text-align: center; padding: 34px 24px; }
.pay-result .result-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; background: var(--brand-50); color: var(--brand); border: 6px solid #f0fdf8; }
.pay-result .result-icon.warn { background: var(--warn-50); color: var(--warn); border-color: #fffdf3; }
.pay-result .result-icon .icon { width: 28px; height: 28px; stroke-width: 2.4; }
.pay-secure { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 20px; color: var(--subtle); font-size: 12.5px; }

/* ---------- Error pages ---------- */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; background: var(--bg); }
.error-page .code-num { font-family: var(--font-display); font-size: 88px; font-weight: 800; letter-spacing: -0.06em; color: var(--brand); line-height: 1; }

@media print { .sidebar, .topbar, .bottom-nav, .app-footer { display: none !important; } .main { margin: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* Small-phone refinements */
@media (max-width: 480px) {
    .topbar .env-pill { display: none; }
    .pay-amount, .pay-body { padding-left: 18px; padding-right: 18px; }
    .pay-amount .value { font-size: 32px; }
    .pay-detail { flex-wrap: wrap; gap: 6px 12px; }
    .pay-detail .v.big { font-size: 19px; }
    .brand { font-size: 17px; }
    .brand-mark { width: 28px; height: 28px; }
    .brand small { display: none; }
}

/* ---------- Searchable select (combobox) ---------- */
.combo { position: relative; }
.combo-input { padding-left: 36px; padding-right: 36px; cursor: text; }
.combo::after { content: ''; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none; transition: transform 0.15s; }
.combo.is-open::after { transform: rotate(-135deg); margin-top: -2px; }
.combo-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; display: inline-flex; }
.combo-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden; }
.combo-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px); max-height: 264px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; animation: pop 0.12s ease; overscroll-behavior: contain; }
.combo-option { padding: 9px 10px; border-radius: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.combo-option.is-active { background: var(--surface-3); color: var(--ink); }
.combo-option.is-selected { font-weight: 600; color: var(--brand-800); }
.combo-option.is-selected::after { content: '✓'; float: right; color: var(--brand); }
.combo-empty { padding: 10px; font-size: 13px; color: var(--muted); }
.combo.is-invalid .combo-input { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12); }
.combo.is-invalid::before { content: 'Choose your bank from the list'; position: absolute; top: calc(100% + 4px); left: 2px; font-size: 12.5px; color: var(--danger-700); }

/* Larger thumbnail once an image preview is available */
.file-drop.has-preview .file-icon { width: 64px; height: 64px; border-radius: 12px; }

/* Image avatars (merchant and staff) */
.avatar-img { padding: 0; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); }
.avatar-img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; border-radius: inherit; }

/* Business switcher (merchant top bar) */
.business-switcher > .btn { max-width: 240px; gap: 6px; }
.business-switcher-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.business-switcher .dropdown-menu { min-width: 260px; max-width: calc(100vw - 32px); }
.business-switcher .dropdown-menu .menu-head span { white-space: normal; }
.business-switcher .dropdown-menu form { margin: 0; }
@media (max-width: 720px) { .business-switcher > .btn { max-width: 140px; } }
