:root {
  --rh-primary: #4f46e5;
  --rh-primary-rgb: 79, 70, 229;
  --rh-accent: #0ea5a4;
  --rh-bg: #f5f6fb;
  --rh-sidebar-w: 256px;
  --bs-primary: var(--rh-primary);
  --bs-primary-rgb: var(--rh-primary-rgb);
  --bs-link-color: var(--rh-primary);
  --bs-link-color-rgb: var(--rh-primary-rgb);
  --bs-link-hover-color: #3730a3;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", "Helvetica Neue", Arial, sans-serif;
  --bs-border-radius: .6rem;
  --bs-border-radius-lg: .9rem;
}
.btn-primary { --bs-btn-bg: var(--rh-primary); --bs-btn-border-color: var(--rh-primary); --bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca; --bs-btn-active-bg: #3730a3; --bs-btn-disabled-bg: #a5b4fc; --bs-btn-disabled-border-color: #a5b4fc; }
.btn-outline-primary { --bs-btn-color: var(--rh-primary); --bs-btn-border-color: var(--rh-primary); --bs-btn-hover-bg: var(--rh-primary); --bs-btn-hover-border-color: var(--rh-primary); --bs-btn-active-bg: #4338ca; }
.text-primary { color: var(--rh-primary) !important; }
.bg-primary { background-color: var(--rh-primary) !important; }
.page-link.active, .active > .page-link { background-color: var(--rh-primary); border-color: var(--rh-primary); }
.form-check-input:checked { background-color: var(--rh-primary); border-color: var(--rh-primary); }
.nav-pills .nav-link.active { background-color: var(--rh-primary); }

html, body { min-height: 100%; }
body { background: var(--rh-bg); }
.public-body { display: flex; flex-direction: column; min-height: 100vh; }
.auth-body { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, rgba(79,70,229,.15), transparent), radial-gradient(900px 500px at 110% 110%, rgba(14,165,164,.15), transparent), var(--rh-bg); }

.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: #fff; background: linear-gradient(135deg, var(--rh-primary), var(--rh-accent)); }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(var(--rh-primary-rgb), .12); color: var(--rh-primary); font-weight: 700; font-size: .85rem; }

/* App shell */
.app-topbar { z-index: 1030; height: 60px; }
.app-shell { display: flex; min-height: calc(100vh - 60px); }
.app-sidebar { width: var(--rh-sidebar-w); flex: 0 0 var(--rh-sidebar-w); background: #fff; border-right: 1px solid var(--bs-border-color); padding: 1rem .75rem; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.app-main { flex: 1 1 auto; min-width: 0; }
.app-nav .nav-link { display: flex; align-items: center; gap: .7rem; color: #475569; border-radius: .55rem; padding: .55rem .75rem; font-weight: 500; }
.app-nav .nav-link i { font-size: 1.05rem; }
.app-nav .nav-link:hover { background: #f1f5f9; color: #0f172a; }
.app-nav .nav-link.active { background: rgba(var(--rh-primary-rgb), .1); color: var(--rh-primary); }
.admin-nav .nav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; padding: 1rem .75rem .35rem; font-weight: 700; }
.admin-nav .nav-group:first-child { padding-top: 0; }

/* Cards & stats */
.card { border: 1px solid #e8eaf3; border-radius: var(--bs-border-radius-lg); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.card-header { background: transparent; border-bottom: 1px solid #eef0f6; font-weight: 600; padding: .9rem 1.1rem; }
.stat-card .stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; }
.stat-card .stat-value { font-size: 1.55rem; font-weight: 700; line-height: 1.2; }
.stat-card .stat-label { color: #64748b; font-size: .85rem; font-weight: 500; }
.tone-primary { background: rgba(79,70,229,.1); color: #4f46e5; }
.tone-success { background: rgba(22,163,74,.1); color: #16a34a; }
.tone-warning { background: rgba(234,179,8,.15); color: #a16207; }
.tone-danger  { background: rgba(220,38,38,.1); color: #dc2626; }
.tone-info    { background: rgba(14,165,164,.12); color: #0e7490; }
.tone-dark    { background: rgba(15,23,42,.08); color: #0f172a; }

.balance-hero { background: linear-gradient(135deg, #4f46e5 0%, #6366f1 45%, #0ea5a4 100%); color: #fff; border: 0; }
.balance-hero .text-muted, .balance-hero .small { color: rgba(255,255,255,.8) !important; }
.balance-pill { background: rgba(255,255,255,.15); border-radius: .75rem; padding: .75rem 1rem; }

.table > :not(caption) > * > * { padding: .7rem .8rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; font-weight: 600; background: #f8fafc; white-space: nowrap; }
.table-card .table { margin-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.amount-pos { color: #16a34a; font-weight: 600; }
.amount-neg { color: #dc2626; font-weight: 600; }

.claim-orb { width: 168px; height: 168px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; background: radial-gradient(circle at 30% 30%, #818cf8, #4f46e5 60%, #3730a3); color: #fff; box-shadow: 0 20px 45px rgba(79,70,229,.35); }
.claim-orb.done { background: radial-gradient(circle at 30% 30%, #5eead4, #0ea5a4 60%, #0f766e); box-shadow: 0 20px 45px rgba(14,165,164,.3); }
.claim-orb .num { font-size: 2.75rem; font-weight: 800; line-height: 1; }

.hero { background: radial-gradient(1000px 500px at 0% 0%, rgba(79,70,229,.18), transparent), radial-gradient(800px 400px at 100% 100%, rgba(14,165,164,.18), transparent), #fff; }
.feature-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; }
.step-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--rh-primary); color: #fff; font-weight: 700; flex: 0 0 34px; }

.timeline { list-style: none; padding-left: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.5rem; border-left: 2px solid #e2e8f0; margin-left: .4rem; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--rh-primary); border: 2px solid #fff; box-shadow: 0 0 0 2px #c7d2fe; }

.legal-text { white-space: pre-line; line-height: 1.7; }
.notif-unread { background: rgba(var(--rh-primary-rgb), .05); }
.kyc-doc { max-height: 420px; object-fit: contain; background: #f1f5f9; }
.quote-box { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: .75rem; }
.progress { height: .55rem; }

@media (max-width: 575.98px) {
  .stat-card .stat-value { font-size: 1.3rem; }
  .claim-orb { width: 140px; height: 140px; }
  .table-responsive-stack td { white-space: nowrap; }
}
.audit-details { max-width: 420px; }
@media (min-width: 992px) {
  .app-shell { background: linear-gradient(90deg, #fff calc(var(--rh-sidebar-w) - 1px), var(--bs-border-color) calc(var(--rh-sidebar-w) - 1px), var(--bs-border-color) var(--rh-sidebar-w), transparent var(--rh-sidebar-w)); }
  .app-sidebar { border-right: 0; }
}
