/* =========================================================
   App design system – responsive, light/dark, brand-driven
   ========================================================= */
:root {
  --brand: #4f46e5;
  --brand-rgb: 79, 70, 229;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e7eaf1;
  --text: #0f172a;
  --muted: #64748b;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, .18);
  --sidebar-w: 264px;
  --topbar-h: 64px;
  --bottom-h: 66px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
[data-bs-theme="dark"] {
  --bg: #0b1020;
  --surface: #121829;
  --surface-2: #182036;
  --border: #232c45;
  --text: #e6e9f2;
  --muted: #94a3b8;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --bs-body-bg: #0b1020;
  --bs-body-color: #e6e9f2;
  --bs-border-color: #232c45;
  --bs-secondary-bg: #182036;
  --bs-tertiary-bg: #141b2e;
}

* { -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
.min-w-0 { min-width: 0; }
h1, h2, h3, h4, h5, h6 { color: inherit; }
.score-scale-labels { max-width: 420px; }
.consent-box { display: flex; gap: .65rem; align-items: flex-start; padding: .9rem 1rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.text-muted { color: var(--muted) !important; }
.fw-800 { font-weight: 800; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; }
.btn-lg { border-radius: 12px; }
.btn-brand, .btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: rgba(var(--brand-rgb), .88); --bs-btn-hover-border-color: rgba(var(--brand-rgb), .88);
  --bs-btn-active-bg: rgba(var(--brand-rgb), .8); --bs-btn-active-border-color: rgba(var(--brand-rgb), .8);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
  background: var(--bs-btn-bg); color: #fff;
  box-shadow: 0 6px 16px -6px rgba(var(--brand-rgb), .6);
}
.btn-outline-brand {
  --bs-btn-color: var(--brand); --bs-btn-border-color: rgba(var(--brand-rgb), .35);
  --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--brand); --bs-btn-active-color: #fff;
}
.btn-soft {
  background: rgba(var(--brand-rgb), .1); color: var(--brand); border: 0;
}
.btn-soft:hover { background: rgba(var(--brand-rgb), .18); color: var(--brand); }
.btn-icon {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 0; background: transparent; color: var(--text);
}
.btn-icon:hover { background: var(--surface-2); }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 10px; border-color: var(--border); background-color: var(--surface); padding: .6rem .85rem; }
.form-control-lg, .form-select-lg { border-radius: 12px; font-size: 1rem; padding: .8rem 1rem; }
.form-control:focus, .form-select:focus { border-color: rgba(var(--brand-rgb), .6); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .12); }
.form-label { font-weight: 600; font-size: .875rem; margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; }
.input-group-text { border-color: var(--border); background: var(--surface-2); border-radius: 10px; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
@media (min-width: 992px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1030; }
  .main { margin-left: var(--sidebar-w); }
}
@media (max-width: 991.98px) {
  .sidebar.offcanvas-lg { --bs-offcanvas-width: 284px; }
}
.sidebar-brand { display: flex; align-items: center; gap: .5rem; padding: 1.1rem 1.1rem .9rem; }
.brand-name { font-weight: 800; font-size: 1.05rem; color: var(--text); letter-spacing: -.01em; }
.brand-icon { border-radius: 10px; object-fit: cover; }
.brand-icon-md { width: 38px; height: 38px; }
.brand-icon-sm { width: 32px; height: 32px; border-radius: 9px; }
.brand-icon-lg { width: 56px; height: 56px; border-radius: 14px; }
.brand-logo { object-fit: contain; }
.brand-logo-md { max-height: 38px; max-width: 150px; }
.brand-logo-sm { max-height: 30px; max-width: 120px; }
.brand-logo-lg { max-height: 56px; max-width: 220px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .25rem .75rem 1rem; }
.nav-group-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 1rem .75rem .4rem; }
.nav-link-x {
  display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: 10px;
  color: var(--text); text-decoration: none; font-weight: 500; margin-bottom: 2px; transition: background .15s, color .15s;
}
.nav-link-x i { font-size: 1.1rem; color: var(--muted); width: 20px; text-align: center; transition: color .15s; }
.nav-link-x:hover { background: var(--surface-2); color: var(--text); }
.nav-link-x.active { background: rgba(var(--brand-rgb), .1); color: var(--brand); font-weight: 600; }
.nav-link-x.active i { color: var(--brand); }
.sidebar-foot { padding: .75rem; border-top: 1px solid var(--border); }
.wallet-card {
  display: block; border-radius: 14px; padding: .9rem 1rem; color: #fff !important;
  background: linear-gradient(135deg, var(--brand), rgba(var(--brand-rgb), .7));
  box-shadow: 0 10px 24px -12px rgba(var(--brand-rgb), .8);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1020; height: var(--topbar-h);
  display: flex; align-items: center; gap: .5rem; padding: 0 1rem;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .topbar { background: var(--surface); } }
.page-title { font-size: 1.1rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
@media (max-width: 991.98px) { .page-title { font-size: 1rem; } }
@media (max-width: 420px) { .topbar .page-title { display: none; } }
.wallet-chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .75rem; border-radius: 999px;
  background: rgba(var(--brand-rgb), .1); color: var(--brand); font-weight: 700; font-size: .875rem; text-decoration: none; white-space: nowrap;
}
.avatar-btn { border: 0; background: transparent; padding: 0; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: #fff; background: linear-gradient(135deg, var(--brand), #06b6d4);
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }
.content { padding: 1.5rem; flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; }
@media (max-width: 991.98px) { .content { padding: 1rem 1rem calc(var(--bottom-h) + 1.25rem + var(--safe-bottom)); } }
.app-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: 1rem 1.5rem; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--border); }
@media (max-width: 991.98px) { .app-footer { display: none; } }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--bottom-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -8px 24px -16px rgba(15, 23, 42, .25);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .68rem; font-weight: 600;
}
.bottom-nav a i { font-size: 1.3rem; line-height: 1; }
.bottom-nav a.active { color: var(--brand); }
.bottom-nav a.bn-center i {
  width: 48px; height: 48px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; margin-top: -22px; box-shadow: 0 10px 20px -8px rgba(var(--brand-rgb), .8);
}

/* ---------- Cards ---------- */
.card-x { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-x-head {
  display: flex; align-items: center; gap: .5rem; padding: .95rem 1.15rem; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .95rem;
}
.card-x-head > i { color: var(--brand); }
.card-x-head .actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.card-x-body { padding: 1.15rem; }
.card { border-color: var(--border); border-radius: var(--radius); background: var(--surface); }

.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.page-head h2 { font-size: 1.35rem; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* Stat cards */
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem;
  display: flex; align-items: center; gap: .9rem; height: 100%; box-shadow: var(--shadow-sm);
}
.stat-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 600; }
.stat-value { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
@media (max-width: 575.98px) {
  .stat { padding: .85rem; gap: .65rem; flex-direction: column; align-items: flex-start; }
  .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; border-radius: 12px; }
  .stat-value { font-size: 1.15rem; }
}
.stat-mini { display: flex; gap: .7rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .8rem; height: 100%; }
.stat-mini-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-mini-label { font-size: .72rem; color: var(--muted); font-weight: 600; }
.stat-mini-value { font-weight: 800; font-size: 1rem; }

/* Hero / welcome */
.hero-card {
  border-radius: 20px; padding: 1.5rem; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.18), transparent 40%), linear-gradient(135deg, var(--brand), rgba(var(--brand-rgb), .72) 60%, #0ea5e9);
  box-shadow: 0 18px 40px -20px rgba(var(--brand-rgb), .9);
}
.hero-card::after { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); right: -60px; bottom: -90px; }
.hero-card .btn-light { color: var(--brand); }
.hero-balance { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
@media (max-width: 575.98px) { .hero-balance { font-size: 1.8rem; } .hero-card { padding: 1.2rem; } }

/* Badges */
.badge-soft { display: inline-block; padding: .3em .7em; border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.badge-soft-success { background: rgba(16,185,129,.12); color: #059669; }
.badge-soft-danger { background: rgba(239,68,68,.12); color: #dc2626; }
.badge-soft-warning { background: rgba(245,158,11,.14); color: #b45309; }
.badge-soft-info { background: rgba(14,165,233,.12); color: #0284c7; }
.badge-soft-primary { background: rgba(var(--brand-rgb),.1); color: var(--brand); }
.badge-soft-secondary { background: rgba(100,116,139,.12); color: #475569; }
[data-bs-theme="dark"] .badge-soft-secondary { color: #cbd5e1; }
[data-bs-theme="dark"] .badge-soft-success { color: #34d399; }
[data-bs-theme="dark"] .badge-soft-danger { color: #f87171; }
[data-bs-theme="dark"] .badge-soft-warning { color: #fbbf24; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .8rem; font-weight: 600; }

/* Service cards */
.svc-card {
  position: relative; display: flex; flex-direction: column; height: 100%; padding: 1.15rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.svc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(var(--brand-rgb), .35); color: var(--text); }
.svc-icon { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; background: rgba(var(--brand-rgb), .1); color: var(--brand); margin-bottom: .85rem; }
.svc-title { font-weight: 700; font-size: 1rem; margin-bottom: .25rem; }
.svc-desc { color: var(--muted); font-size: .84rem; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.svc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .9rem; padding-top: .8rem; border-top: 1px dashed var(--border); }
.svc-price { font-weight: 800; color: var(--brand); }
.svc-badge { position: absolute; top: .9rem; right: .9rem; }
@media (max-width: 575.98px) {
  .svc-card { padding: .9rem; }
  .svc-icon { width: 42px; height: 42px; font-size: 1.15rem; margin-bottom: .6rem; }
  .svc-title { font-size: .9rem; }
  .svc-desc { font-size: .78rem; }
}

.filter-pills { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
.filter-pills::-webkit-scrollbar { display: none; }
.filter-pills .pill {
  white-space: nowrap; padding: .45rem .95rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-weight: 600; font-size: .85rem; cursor: pointer;
}
.filter-pills .pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.search-box { position: relative; }
.search-box i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .form-control { padding-left: 2.5rem; }

/* Lists */
.list-x { display: flex; flex-direction: column; }
.list-x-item { display: flex; align-items: center; gap: .85rem; padding: .85rem 1.15rem; border-bottom: 1px solid var(--border); }
.list-x-item:last-child { border-bottom: 0; }
a.list-x-item { color: var(--text); text-decoration: none; }
a.list-x-item:hover { background: var(--surface-2); }
.li-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.1rem; }

/* Tables → cards on mobile */
.table-x { margin: 0; --bs-table-bg: transparent; }
.table-x thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; padding: .75rem 1rem; }
.table-x td { padding: .8rem 1rem; vertical-align: middle; border-color: var(--border); }
.table-x tbody tr:hover { background: var(--surface-2); }
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { border-bottom: 1px solid var(--border); padding: .6rem .9rem; }
  .table-stack td { border: 0; padding: .3rem 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: right; }
  .table-stack td::before { content: attr(data-label); font-size: .75rem; color: var(--muted); font-weight: 600; text-align: left; flex-shrink: 0; }
  .table-stack td[data-label=""]::before, .table-stack td:not([data-label])::before { content: none; }
  .table-stack td.td-actions { justify-content: flex-end; }
}

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .5rem; opacity: .5; }
.empty-state p { margin: 0; }

/* Toasts */
.toast-stack { position: fixed; top: calc(var(--topbar-h) + 10px); right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 32px)); }
.area-auth .toast-stack, .area-public .toast-stack { top: 16px; }
.toast-x {
  display: flex; align-items: flex-start; gap: .6rem; padding: .85rem 1rem; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); font-size: .9rem; font-weight: 500; animation: toastIn .3s ease;
}
.toast-x > i { font-size: 1.15rem; }
.toast-success > i { color: #10b981; } .toast-danger > i { color: #ef4444; } .toast-warning > i { color: #f59e0b; } .toast-info > i { color: #0ea5e9; }
.toast-success { border-left: 4px solid #10b981; } .toast-danger { border-left: 4px solid #ef4444; } .toast-warning { border-left: 4px solid #f59e0b; } .toast-info { border-left: 4px solid #0ea5e9; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@media (max-width: 575.98px) { .toast-stack { left: 16px; right: 16px; } }

.announce { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 14px; background: rgba(var(--brand-rgb), .08); border: 1px solid rgba(var(--brand-rgb), .2); font-size: .9rem; }
.announce i { color: var(--brand); font-size: 1.1rem; }

/* Page loader */
.page-loader { position: fixed; inset: 0; z-index: 3000; display: none; flex-direction: column; align-items: center; justify-content: center; background: rgba(15, 23, 42, .55); color: #fff; backdrop-filter: blur(3px); }
.page-loader.show { display: flex; }
.page-loader .spinner-border { width: 3rem; height: 3rem; color: #fff !important; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .auth-wrap { grid-template-columns: 1.05fr 1fr; } }
.auth-side {
  display: none; position: relative; overflow: hidden; color: #fff; padding: 3rem;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.15), transparent 35%), linear-gradient(140deg, var(--brand), rgba(var(--brand-rgb), .75) 55%, #0ea5e9);
}
@media (min-width: 992px) { .auth-side { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-side h1 { font-weight: 800; font-size: 2.4rem; letter-spacing: -.03em; line-height: 1.15; }
.auth-feature { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1rem; }
.auth-feature i { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-weight: 800; letter-spacing: -.02em; }
.pw-wrap { position: relative; }
.pw-wrap .pw-toggle { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); padding: .4rem; }

/* ---------- Landing ---------- */
.lp-nav { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.lp-hero { padding: 4.5rem 0 3.5rem; position: relative; overflow: hidden; }
.lp-hero::before { content: ''; position: absolute; inset: -40% -10% auto auto; width: 700px; height: 700px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--brand-rgb), .18), transparent 65%); z-index: -1; }
.lp-hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.08; }
.lp-hero .lead { color: var(--muted); font-size: 1.15rem; max-width: 560px; }
.grad-text { background: linear-gradient(90deg, var(--brand), #0ea5e9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-mock { border-radius: 24px; padding: 1.25rem; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 30px 60px -30px rgba(var(--brand-rgb), .55); }
.lp-section { padding: 3.5rem 0; }
.lp-section h2 { font-weight: 800; letter-spacing: -.02em; }
.feature-box { padding: 1.4rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); height: 100%; }
.feature-box i { font-size: 1.5rem; color: var(--brand); }
.step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* ---------- Credit report ---------- */
.score-hero { display: flex; gap: 1.5rem; align-items: center; padding: 1.5rem; flex-wrap: wrap; background: linear-gradient(135deg, rgba(var(--brand-rgb), .06), transparent 60%); }
@media (max-width: 575.98px) { .score-hero { flex-direction: column; text-align: center; } .score-hero .d-flex { justify-content: center; } }
.score-ring {
  --pct: 50; --clr: #10b981; width: 160px; height: 160px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--clr) calc(var(--pct) * 1%), var(--border) 0); display: flex; align-items: center; justify-content: center;
}
.score-inner { width: 128px; height: 128px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: inset 0 2px 8px rgba(0,0,0,.06); }
.score-num { font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.score-lbl { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: .25rem; }
.score-scale { position: relative; height: 8px; border-radius: 999px; background: linear-gradient(90deg, #ef4444, #f59e0b 40%, #3b82f6 65%, #10b981); max-width: 420px; }
.score-scale span { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--text); transform: translate(-50%, -50%); }
@media (max-width: 575.98px) { .score-scale { margin: 0 auto; } .score-scale-labels { margin: 0 auto; } }
.acc { border: 1px solid var(--border); border-radius: 14px; margin-bottom: .6rem; background: var(--surface); }
.acc summary { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; cursor: pointer; list-style: none; }
.acc summary::-webkit-details-marker { display: none; }
.acc[open] summary { border-bottom: 1px solid var(--border); }
.acc-logo { width: 42px; height: 42px; border-radius: 12px; background: rgba(var(--brand-rgb), .1); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; flex-shrink: 0; }
.acc-body { padding: 1rem; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.kv-grid > div { display: flex; flex-direction: column; background: var(--surface-2); border-radius: 10px; padding: .6rem .75rem; }
.kv-grid span { font-size: .72rem; color: var(--muted); font-weight: 600; }
.kv-grid b { font-size: .9rem; word-break: break-all; }
.ps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.ps-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ps-cell small { font-size: .6rem; color: var(--muted); white-space: nowrap; }
.ps { width: 32px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; }
.ps-ok { background: rgba(16,185,129,.15); color: #059669; }
.ps-na { background: var(--surface-2); color: var(--muted); }
.ps-warn { background: rgba(245,158,11,.18); color: #b45309; }
.ps-bad { background: rgba(239,68,68,.15); color: #dc2626; }

/* Generic result */
.result-hero { padding: 1.25rem; background: linear-gradient(135deg, rgba(16,185,129,.07), transparent 60%); }
.result-icon { width: 54px; height: 54px; border-radius: 16px; background: rgba(16,185,129,.14); color: #10b981; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.result-icon.bad { background: rgba(239,68,68,.14); color: #ef4444; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .85rem 1rem; min-width: 0; }
.tile-wide { grid-column: 1 / -1; }
.tile-label { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3rem; }
.tile-value { font-weight: 600; word-break: break-word; }
.tile-good { border-color: rgba(16,185,129,.4); background: rgba(16,185,129,.05); }
.tile-bad { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.04); }
.nested { display: flex; flex-direction: column; gap: .3rem; font-weight: 500; }
.nested-row { display: grid; grid-template-columns: minmax(110px, 30%) 1fr; gap: .75rem; padding: .35rem 0; border-bottom: 1px dashed var(--border); font-size: .88rem; }
.nested-row:last-child { border-bottom: 0; }
.nested-row > span { color: var(--muted); font-size: .8rem; }
.nested .nested { padding-left: .5rem; border-left: 2px solid var(--border); }
@media (max-width: 575.98px) { .nested-row { grid-template-columns: 1fr; gap: .1rem; } }

pre.json { background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 1rem; font-size: .8rem; max-height: 480px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

/* Wallet */
.amt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.amt-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: .7rem .5rem; font-weight: 700; color: var(--text); transition: all .15s; }
.amt-btn:hover, .amt-btn.active { border-color: var(--brand); color: var(--brand); background: rgba(var(--brand-rgb), .06); }
.amt-input { font-size: 1.6rem; font-weight: 800; text-align: center; }

/* Settings tabs */
.tabs-x { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; scrollbar-width: none; }
.tabs-x::-webkit-scrollbar { display: none; }
.tabs-x a { padding: .7rem 1rem; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs-x a.active { color: var(--brand); border-bottom-color: var(--brand); }
.color-input { width: 52px; height: 42px; padding: 4px; border-radius: 10px; }
.img-preview { width: 72px; height: 72px; border-radius: 16px; border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; background: var(--surface-2); overflow: hidden; }
.img-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }

/* Bars chart (no lib) */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bars .bar div { width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--brand), rgba(var(--brand-rgb), .55)); min-height: 3px; transition: height .4s; }
.bars .bar small { font-size: .62rem; color: var(--muted); margin-top: 4px; white-space: nowrap; }

/* Misc */
.dropdown-menu { border-radius: 12px; padding: .4rem; background: var(--surface); }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; font-size: .9rem; }
.modal-content { border-radius: 18px; border: 0; background: var(--surface); }
.offcanvas { background: var(--surface); }
.pagination .page-link { border-radius: 8px !important; margin: 0 2px; border-color: var(--border); color: var(--text); background: var(--surface); }
.pagination .active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.alert { border-radius: 12px; }
.nav-pills .nav-link.active { background: var(--brand); }
.text-brand { color: var(--brand) !important; }
.bg-brand-soft { background: rgba(var(--brand-rgb), .1) !important; }
.fade-up { animation: fadeUp .4s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media print {
  .sidebar, .topbar, .bottom-nav, .app-footer, .no-print, .toast-stack { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
  details.acc { break-inside: avoid; }
}

/* ---------- Loan marketplace ---------- */
.offer-card { position: relative; display: flex; flex-direction: column; height: 100%; padding: 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s; overflow: hidden; }
.offer-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(var(--brand-rgb), .35); }
.offer-card.offer-locked { opacity: .9; background: var(--surface-2); }
.offer-card.offer-locked:hover { transform: none; }
.offer-ribbon { position: absolute; top: 14px; right: -34px; transform: rotate(45deg); background: linear-gradient(90deg, #f59e0b, #f97316); color: #fff; font-size: .62rem; font-weight: 800; padding: 3px 38px; letter-spacing: .04em; text-transform: uppercase; }
.offer-logo { width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.offer-logo img { max-width: 90%; max-height: 90%; object-fit: contain; }
.offer-logo span { font-weight: 800; color: var(--brand); }
.offer-title { font-weight: 700; font-size: 1.02rem; margin-bottom: .75rem; line-height: 1.3; }
.offer-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; padding: .7rem; border-radius: 12px; background: rgba(var(--brand-rgb), .05); margin-bottom: .75rem; }
.offer-stats span { display: block; font-size: .66rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.offer-stats b { font-size: .86rem; display: block; word-break: break-word; }
.offer-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.offer-hl { list-style: none; padding: 0; margin: 0 0 .5rem; font-size: .84rem; }
.offer-hl li { display: flex; gap: .4rem; margin-bottom: .2rem; }
.offer-hl i { color: #10b981; }
.offer-req { font-size: .76rem; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: .45rem .6rem; }
.offer-why { font-size: .8rem; color: #b91c1c; background: rgba(239,68,68,.07); border-radius: 10px; padding: .55rem .7rem; }
[data-bs-theme="dark"] .offer-why { color: #fca5a5; }
.offer-why div + div { margin-top: .2rem; }
.range-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.range-bar > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), #0ea5e9); }

/* ===================== Recharge plans (GPay / PhonePe style) ===================== */
.rp-wrap { margin-bottom: 1rem; }
.rp-head { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; margin-bottom: .75rem; flex-wrap: wrap; }
.rp-op { width: 48px; height: 48px; border-radius: 14px; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; flex-shrink: 0; box-shadow: 0 6px 16px -6px rgba(0,0,0,.35); }
.rp-title { font-weight: 800; font-size: 1.1rem; line-height: 1.2; }
.rp-sub { color: var(--muted); font-size: .85rem; margin-top: .15rem; }
.rp-sort { margin-left: auto; min-width: 170px; }
.rp-search { position: relative; margin-bottom: .75rem; }
.rp-search i { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.rp-search input { padding-left: 2.5rem; border-radius: 999px; height: 46px; background: var(--surface); }
.rp-tabs { display: flex; gap: .5rem; overflow-x: auto; padding: .1rem .1rem .6rem; margin-bottom: .4rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; position: sticky; top: var(--topbar-h); z-index: 5; background: var(--bg); }
.rp-tabs::-webkit-scrollbar { display: none; }
.rp-tab { flex-shrink: 0; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: .45rem .95rem; font-size: .85rem; font-weight: 600; white-space: nowrap; transition: all .15s; }
.rp-tab span { color: var(--muted); font-weight: 500; margin-left: .2rem; font-size: .78rem; }
.rp-tab:hover { border-color: rgba(var(--brand-rgb), .5); }
.rp-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 14px -6px rgba(var(--brand-rgb), .7); }
.rp-tab.active span { color: rgba(255,255,255,.8); }
.rp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .75rem; }
.rp-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1rem 1.05rem .85rem; display: flex; flex-direction: column; gap: .7rem; transition: transform .15s, box-shadow .15s, border-color .15s; }
.rp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(var(--brand-rgb), .35); }
.rp-card[hidden] { display: none; }
.rp-off { opacity: .55; }
.rp-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.rp-price { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.rp-validity { font-size: .8rem; font-weight: 600; color: var(--brand); background: rgba(var(--brand-rgb), .1); padding: .3rem .65rem; border-radius: 999px; white-space: nowrap; }
.rp-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: .4rem; background: var(--surface-2); border-radius: 12px; padding: .55rem .6rem; }
.rp-feat { min-width: 0; }
.rp-feat small { display: block; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.rp-feat b { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-desc { font-size: .83rem; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rp-desc.open { -webkit-line-clamp: unset; display: block; }
.rp-foot { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-top: auto; border-top: 1px dashed var(--border); padding-top: .6rem; }
.rp-cat { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.rp-badge { font-size: .68rem; font-weight: 700; padding: .12rem .45rem; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.rp-5g { background: linear-gradient(135deg, #7c3aed, #db2777); color: #fff; border: 0; }
.rp-perday { font-size: .75rem; color: #059669; font-weight: 700; margin-left: auto; }
.rp-more { border: 0; background: none; color: var(--brand); font-size: .8rem; font-weight: 600; padding: 0; }
.rp-perday + .rp-more { margin-left: .5rem; }
.rp-foot .rp-more:first-child, .rp-cat + .rp-more { margin-left: auto; }
.rp-empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.rp-empty i { font-size: 1.8rem; display: block; margin-bottom: .4rem; }
@media (max-width: 575.98px) {
  .rp-list { grid-template-columns: 1fr; }
  .rp-sort { min-width: 0; width: 100%; margin-left: 0; }
  .rp-price { font-size: 1.45rem; }
}
@media print {
  .rp-tabs { position: static; }
  .rp-card { break-inside: avoid; }
  .rp-desc { -webkit-line-clamp: unset; display: block; }
}
[data-bs-theme="dark"] .rp-perday { color: #34d399; }
