/* =========================================================================
   BD PaySync v3.0 — Bespoke Aurora Fintech & Multi-Wallet Design System
   5 Live Color Palettes · Dark/Light Mode · Wallet Deck · Bento & Stream UI
   ========================================================================= */

:root,
[data-accent="emerald"] {
    --primary: #059669;
    --primary-bright: #10b981;
    --primary-hover: #047857;
    --primary-soft: rgba(16, 185, 129, 0.10);
    --primary-line: rgba(16, 185, 129, 0.26);
    --primary-grad: linear-gradient(135deg, #10b981 0%, #047857 100%);
    --vault-bg: radial-gradient(120% 140% at 100% 0%, rgba(16, 185, 129, 0.34) 0%, rgba(6, 78, 59, 0.2) 45%, transparent 75%),
                linear-gradient(145deg, #0b1320 0%, #071917 100%);
}

[data-accent="indigo"] {
    --primary: #4f46e5;
    --primary-bright: #6366f1;
    --primary-hover: #4338ca;
    --primary-soft: rgba(99, 102, 241, 0.10);
    --primary-line: rgba(99, 102, 241, 0.26);
    --primary-grad: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    --vault-bg: radial-gradient(120% 140% at 100% 0%, rgba(99, 102, 241, 0.38) 0%, rgba(49, 46, 129, 0.22) 45%, transparent 75%),
                linear-gradient(145deg, #0b1024 0%, #131129 100%);
}

[data-accent="ocean"] {
    --primary: #0284c7;
    --primary-bright: #0ea5e9;
    --primary-hover: #0369a1;
    --primary-soft: rgba(14, 165, 233, 0.10);
    --primary-line: rgba(14, 165, 233, 0.26);
    --primary-grad: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    --vault-bg: radial-gradient(120% 140% at 100% 0%, rgba(14, 165, 233, 0.36) 0%, rgba(12, 74, 110, 0.22) 45%, transparent 75%),
                linear-gradient(145deg, #081426 0%, #0a1929 100%);
}

[data-accent="rose"] {
    --primary: #e11d48;
    --primary-bright: #f43f5e;
    --primary-hover: #be123c;
    --primary-soft: rgba(244, 63, 94, 0.10);
    --primary-line: rgba(244, 63, 94, 0.26);
    --primary-grad: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
    --vault-bg: radial-gradient(120% 140% at 100% 0%, rgba(244, 63, 94, 0.34) 0%, rgba(136, 19, 55, 0.22) 45%, transparent 75%),
                linear-gradient(145deg, #160c18 0%, #1f0c16 100%);
}

[data-accent="amber"] {
    --primary: #d97706;
    --primary-bright: #f59e0b;
    --primary-hover: #b45309;
    --primary-soft: rgba(245, 158, 11, 0.11);
    --primary-line: rgba(245, 158, 11, 0.28);
    --primary-grad: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
    --vault-bg: radial-gradient(120% 140% at 100% 0%, rgba(245, 158, 11, 0.32) 0%, rgba(120, 53, 15, 0.2) 45%, transparent 75%),
                linear-gradient(145deg, #16120b 0%, #1c150c 100%);
}

:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-muted: #f3f6fa;
    --sunk: #ebf0f5;
    --border: #e3e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-muted: #64748b;
    --faint: #94a3b8;

    --info: #2563eb;
    --info-soft: rgba(37, 99, 235, 0.10);
    --violet: #7c3aed;
    --violet-soft: rgba(124, 58, 237, 0.10);
    --warning: #d97706;
    --warning-soft: rgba(217, 119, 6, 0.11);
    --danger: #e11d48;
    --danger-soft: rgba(225, 29, 72, 0.10);

    --bkash: #e2136e;
    --bkash-soft: rgba(226, 19, 110, 0.09);
    --bkash-line: rgba(226, 19, 110, 0.22);
    --nagad: #ea580c;
    --nagad-soft: rgba(234, 88, 12, 0.10);
    --nagad-line: rgba(234, 88, 12, 0.22);
    --rocket: #7e22ce;
    --rocket-soft: rgba(126, 34, 206, 0.10);
    --rocket-line: rgba(126, 34, 206, 0.22);
    --upay: #0284c7;
    --upay-soft: rgba(2, 132, 199, 0.10);
    --upay-line: rgba(2, 132, 199, 0.22);
    --bank: #0d9488;
    --bank-soft: rgba(13, 148, 136, 0.10);
    --bank-line: rgba(13, 148, 136, 0.22);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.03), 0 6px 16px -6px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 16px 36px -10px rgba(15, 23, 42, 0.11), 0 4px 12px -4px rgba(15, 23, 42, 0.05);

    --font-ui: 'Plus Jakarta Sans', 'Inter', 'Hind Siliguri', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #080a0f;
    --surface: #10141d;
    --surface-muted: #161b27;
    --sunk: #0c0f17;
    --border: #1e2536;
    --border-strong: #2d384f;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --faint: #64748b;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px -10px rgba(0, 0, 0, 0.65);
    --shadow-md: 0 24px 60px -12px rgba(0, 0, 0, 0.82);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-ui);
    background:
        radial-gradient(680px 300px at 85% -5%, var(--primary-soft), transparent 70%),
        var(--bg);
    color: var(--text);
    font-size: 13.8px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
}

a {
    color: var(--primary);
    text-decoration: none;
}

button, input, select, textarea {
    font-family: inherit;
    color: inherit;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--sunk);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 6px;
}

/* Privacy Blur Helper */
body.blur-balances .priv-val {
    filter: blur(6px);
    user-select: none;
    transition: filter 0.2s ease;
}

body.blur-balances .priv-val:hover {
    filter: blur(0);
}

/* =========================================================================
   App Shell & Sleek Glass Sidebar
   ========================================================================= */

.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 262px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 50;
    transition: transform 0.22s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px 16px;
    text-decoration: none !important;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--primary-grad);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 19px;
    flex-shrink: 0;
    box-shadow: 0 6px 16px -4px var(--primary-line);
}

.brand-meta b {
    display: block;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.35px;
    color: var(--text);
    line-height: 1.2;
}

.brand-meta small {
    display: block;
    font-size: 11.2px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}

.side-nav {
    flex: 1;
    padding: 2px 12px 14px;
    display: flex;
    flex-direction: column;
}

.nav-section {
    font-size: 10.2px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--faint);
    padding: 16px 10px 6px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin: 1.5px 0;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 13.3px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.side-link i {
    font-size: 17px;
    opacity: 0.85;
    flex-shrink: 0;
}

.side-link:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.side-link.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px var(--primary-line);
}

.side-link.active i {
    color: var(--primary);
    opacity: 1;
}

.nav-pill {
    margin-left: auto;
    font-size: 10.5px;
    font-weight: 800;
    padding: 1.5px 8px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.side-link.active .nav-pill,
.nav-pill.emerald {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary-line);
}

.prov-dot {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}

.prov-dot svg {
    width: 14px;
    height: 14px;
}

.side-footer {
    border-top: 1px solid var(--border);
    padding: 12px;
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--danger);
    font-size: 13.3px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.14s;
}

.logout-link:hover {
    background: var(--danger-soft);
}

.sidebar-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    z-index: 45;
}

/* =========================================================================
   Topbar & Unified Floating Glass Telemetry Capsule
   ========================================================================= */

.main-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.topbar-saas {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 28px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

[data-theme="dark"] .topbar-saas {
    background: rgba(16, 20, 29, 0.82);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-title {
    font-size: 16.5px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text);
    white-space: nowrap;
}

/* Unified Floating Telemetry Capsule */
.telemetry-capsule {
    display: inline-flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 6px;
    box-shadow: var(--shadow-sm);
    gap: 4px;
    flex-wrap: wrap;
}

.cap-seg {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    text-decoration: none !important;
    border: none;
    background: transparent;
    transition: all 0.15s ease;
}

.cap-seg b {
    color: var(--text);
    font-weight: 800;
}

.cap-seg i {
    font-size: 14px;
    color: var(--primary);
}

.cap-divider {
    width: 1px;
    height: 18px;
    background: var(--border);
}

.cap-seg.scan-active {
    background: var(--primary-soft);
    color: var(--primary);
    cursor: pointer;
}

.cap-seg.scan-active b {
    color: var(--primary);
}

.cap-seg.scan-paused {
    background: var(--warning-soft);
    color: var(--warning);
    cursor: pointer;
}

.cap-seg.trx-seg:hover {
    background: var(--surface-muted);
}

.cap-seg.trx-seg b {
    color: var(--primary);
}

.scan-radar {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-bright);
    display: inline-block;
    flex-shrink: 0;
}

.scan-radar::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--primary-bright);
    opacity: 0;
    animation: radarPulse 2s infinite ease-out;
}

.scan-radar.paused {
    background: var(--warning);
}

.scan-radar.paused::after {
    display: none;
}

.scan-radar.checking::after {
    animation-duration: 0.65s;
}

@keyframes radarPulse {
    0%   { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(2.0); opacity: 0; }
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

/* Color Swatch Popover */
.palette-pop {
    display: none;
    position: absolute;
    top: 46px;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: var(--shadow-md);
    z-index: 90;
    min-width: 210px;
}

.palette-pop.open {
    display: block;
}

.swatch-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.swatch-btn {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s;
}

.swatch-btn:hover {
    transform: scale(1.12);
}

.swatch-btn.active {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--surface);
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 16.5px;
    transition: all 0.14s;
}

.icon-btn:hover {
    background: var(--surface-muted);
    color: var(--text);
    border-color: var(--border-strong);
}

.mobile-menu-btn {
    display: none;
}

.avatar-badge {
    width: 35px;
    height: 35px;
    border-radius: 11px;
    background: var(--primary-grad);
    color: #fff;
    font-weight: 800;
    font-size: 12.5px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

/* =========================================================================
   Signature Command Center: Master Vault Card + Multi-Wallet Live Deck
   ========================================================================= */

.page-wrap {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 28px 56px;
}

.command-deck {
    display: grid;
    grid-template-columns: 1.25fr 1.75fr;
    gap: 18px;
    margin-bottom: 20px;
}

.vault-card {
    background: var(--vault-bg);
    color: #ffffff;
    border-radius: 22px;
    padding: 24px 26px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px -15px rgba(8, 15, 28, 0.45);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 215px;
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.vault-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1px);
    background-size: 18px 18px;
    opacity: 0.35;
    pointer-events: none;
}

.vault-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.vault-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    padding: 4.5px 12px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    color: #e2e8f0;
}

.vault-amount {
    position: relative;
    margin: 18px 0 16px;
}

.vault-amount span.lbl {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.72);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.vault-amount b.big {
    display: block;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.8px;
    margin-top: 3px;
    color: #ffffff;
}

.vault-foot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    flex-wrap: wrap;
}

.vault-mini-kpis {
    display: flex;
    gap: 20px;
}

.vault-mini-kpis small {
    display: block;
    font-size: 11px;
    color: rgba(226, 232, 240, 0.65);
}

.vault-mini-kpis strong {
    font-size: 14.5px;
    font-weight: 800;
    color: #fff;
}

/* Right Side of Command Deck: 4 Live Wallet Account Cards */
.wallet-deck {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.wallet-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.wallet-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.wallet-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.wallet-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wallet-bal-lbl {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.wallet-bal-val {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--text);
    margin-top: 1px;
}

.wallet-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11.8px;
    color: var(--text-muted);
}

/* =========================================================================
   Analytics & Distribution 2-Column Row
   ========================================================================= */

.analytics-grid {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 18px;
    margin-bottom: 20px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.analytics-grid .card {
    margin-bottom: 0;
}

.eyebrow {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.card-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text);
}

.card-subtitle {
    font-size: 12.8px;
    color: var(--text-muted);
    margin-top: 2px;
}

.mini-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.mini-stat {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 11px 14px;
}

.mini-stat span {
    display: block;
    font-size: 11.2px;
    color: var(--text-muted);
    font-weight: 600;
}

.mini-stat b {
    display: block;
    font-size: 15.5px;
    font-weight: 800;
    margin-top: 3px;
}

.bar-chart {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    align-items: end;
    height: 132px;
    padding: 16px 14px 8px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    gap: 6px;
}

.bar-fill {
    width: 100%;
    max-width: 34px;
    min-height: 6px;
    border-radius: 8px 8px 4px 4px;
    background: var(--primary-grad);
    box-shadow: 0 4px 12px -3px var(--primary-line);
    transition: height 0.35s ease, filter 0.15s;
}

.bar-col:hover .bar-fill {
    filter: brightness(1.12);
}

.bar-col small {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.dist-layout {
    display: flex;
    align-items: center;
    gap: 18px;
}

.donut-box {
    position: relative;
    width: 116px;
    height: 116px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}

.donut-center {
    position: absolute;
    text-align: center;
}

.donut-center b {
    display: block;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
}

.donut-center small {
    font-size: 10.5px;
    color: var(--text-muted);
    font-weight: 700;
}

.dist-list {
    flex: 1;
    display: grid;
    gap: 8px;
}

.dist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    padding: 8.5px 12px;
    border-radius: 11px;
    font-size: 12.8px;
    transition: border-color 0.14s;
}

.dist-item:hover {
    border-color: var(--primary-line);
}

.dist-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
}

/* =========================================================================
   Bespoke Digital Receipt + iOS/macOS SMS Bubble Cards
   Supports Both 1-Col Stream & 2-Col Bento Grid!
   ========================================================================= */

.trx-feed {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.trx-feed.bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trx-card-bespoke {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.025);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.trx-card-bespoke:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.trx-head-v3 {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.trx-brand-side {
    display: flex;
    align-items: center;
    gap: 12px;
}

.prov-avatar {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.prov-avatar.badge-bkash  { background: var(--bkash-soft); color: var(--bkash); border: 1px solid var(--bkash-line); }
.prov-avatar.badge-nagad  { background: var(--nagad-soft); color: var(--nagad); border: 1px solid var(--nagad-line); }
.prov-avatar.badge-rocket { background: var(--rocket-soft); color: var(--rocket); border: 1px solid var(--rocket-line); }
.prov-avatar.badge-upay   { background: var(--upay-soft); color: var(--upay); border: 1px solid var(--upay-line); }
.prov-avatar.badge-bank   { background: var(--bank-soft); color: var(--bank); border: 1px solid var(--bank-line); }

.trx-right-side {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.amount-chip {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid var(--primary-line);
    padding: 4.5px 13px;
    border-radius: 11px;
    white-space: nowrap;
}

/* Pill Metadata Ribbon */
.receipt-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 13px;
}

.r-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    padding: 5px 11px;
    border-radius: 9px;
    font-size: 12.2px;
    color: var(--text-muted);
}

.r-chip i {
    font-size: 13.5px;
    color: var(--primary);
}

.r-chip b {
    color: var(--text);
    font-weight: 700;
}

.r-chip.trx-copy {
    cursor: pointer;
    transition: border-color 0.14s, background 0.14s;
}

.r-chip.trx-copy:hover {
    border-color: var(--primary-line);
    background: var(--primary-soft);
}

.r-chip.trx-copy b {
    font-family: var(--font-mono);
    letter-spacing: -0.2px;
}

/* Sleek Modern Phone SMS Bubble */
.sms-device-frame {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.sms-device-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 13px;
    border-bottom: 1px solid var(--border);
    font-size: 11.2px;
    font-weight: 700;
    color: var(--text-muted);
}

.sms-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 6px;
}

.sms-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    background: var(--border-strong);
}

.sms-copy-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.14s;
}

.sms-copy-chip:hover {
    color: var(--primary);
    border-color: var(--primary-line);
}

.sms-device-body {
    padding: 13px 15px;
    font-size: 13.6px;
    line-height: 1.68;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

.sms-hl-amt {
    font-weight: 800;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 1px 6px;
    border-radius: 5px;
}

.sms-hl-trx {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.92em;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 5px;
}

/* Badges & Shared Controls */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3.5px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-bkash  { background: var(--bkash-soft); color: var(--bkash); border: 1px solid var(--bkash-line); }
.badge-nagad  { background: var(--nagad-soft); color: var(--nagad); border: 1px solid var(--nagad-line); }
.badge-rocket { background: var(--rocket-soft); color: var(--rocket); border: 1px solid var(--rocket-line); }
.badge-upay   { background: var(--upay-soft); color: var(--upay); border: 1px solid var(--upay-line); }
.badge-bank   { background: var(--bank-soft); color: var(--bank); border: 1px solid var(--bank-line); }

.status-verified { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-line); }
.status-used     { background: var(--info-soft); color: var(--info); border: 1px solid rgba(37, 99, 235, 0.25); }
.status-pending  { background: var(--warning-soft); color: var(--warning); border: 1px solid rgba(217, 119, 6, 0.28); }

.kpi-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.kpi-tag.emerald { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-line); }

.trx-code {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 12.5px;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.amount-pos {
    font-weight: 800;
    color: var(--primary);
    font-size: 16.5px;
    white-space: nowrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8.5px 15px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-grad);
    color: #ffffff;
    box-shadow: 0 4px 14px -4px var(--primary-line);
}

.btn-primary:hover { filter: brightness(1.06); }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--surface-muted);
    border-color: var(--border-strong);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.22);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(225, 29, 72, 0.22);
}

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-block { width: 100%; border-radius: 10px; }

.tab-pills {
    display: inline-flex;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    padding: 3px;
    border-radius: 10px;
    gap: 3px;
}

.tab-pills a,
.tab-pills button {
    padding: 5px 11px;
    border-radius: 7px;
    font-size: 12.2px;
    font-weight: 700;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none !important;
}

.tab-pills a.active,
.tab-pills button.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 12px;
    align-items: end;
}

.form-group { margin-bottom: 14px; }
.form-grid .form-group { margin-bottom: 0; }

label {
    display: block;
    font-size: 12.3px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 5px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13.5px;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.14s, box-shadow 0.14s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}

table { width: 100%; border-collapse: collapse; background: var(--surface); }
th {
    background: var(--surface-muted);
    text-align: left;
    padding: 11px 14px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 13.3px;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-muted); }

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 13.5px;
    font-weight: 600;
}
.alert-success { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-line); }
.alert-error   { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(225, 29, 72, 0.25); }
.alert-info    { background: var(--info-soft); color: var(--info); border: 1px solid rgba(37, 99, 235, 0.25); }

code.copy-box, pre.code-block {
    display: block;
    background: #0d1117;
    color: #e6edf3;
    padding: 13px 16px;
    border-radius: 11px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.6;
    overflow-x: auto;
    border: 1px solid #21262d;
}
code.copy-box { cursor: pointer; word-break: break-all; }

.public-topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 22px; }
.public-topbar-inner { max-width: 1160px; margin: 0 auto; min-height: 64px; display: flex; align-items: center; justify-content: space-between; }
.container-narrow { max-width: 520px; margin: 48px auto; padding: 0 18px; }

.receipt-box { border: 1px solid var(--primary-line); background: var(--surface-muted); border-radius: 14px; padding: 20px; margin-top: 18px; }
.receipt-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.receipt-row:last-child { border-bottom: none; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(5px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    max-width: 580px;
    width: 100%;
    padding: 24px;
    box-shadow: var(--shadow-md);
}

#toast {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #0f172a;
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 980;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================================
   Bottom-Right Floating Live New SMS Alert Stack
   ========================================================================= */

#liveSmsFloatStack {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 392px;
    max-width: calc(100vw - 32px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 950;
    pointer-events: none;
}

.live-sms-float {
    pointer-events: auto;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: 0 24px 56px -12px rgba(15, 23, 42, 0.24), 0 8px 20px -6px rgba(15, 23, 42, 0.10);
    animation: floatSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

[data-theme="dark"] .live-sms-float {
    box-shadow: 0 24px 56px -10px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.live-sms-float.closing {
    opacity: 0;
    transform: translateX(30px) scale(0.96);
}

@keyframes floatSlideIn {
    0%   { opacity: 0; transform: translateY(24px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.float-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.float-live-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--primary-soft);
    border: 1px solid var(--primary-line);
    color: var(--primary);
    padding: 3.5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.float-close-btn {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--text-muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 15px;
}

.float-close-btn:hover {
    color: var(--danger);
    border-color: rgba(225, 29, 72, 0.28);
}

.float-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.float-sms-box {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 10px 12px;
    font-size: 12.8px;
    line-height: 1.58;
    color: var(--text);
    max-height: 115px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 11px;
}

.float-foot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

@keyframes newCardHighlight {
    0%   { box-shadow: 0 0 0 3px var(--primary-line), var(--shadow-md); }
    100% { box-shadow: 0 2px 6px rgba(15, 23, 42, 0.025); }
}

.trx-card-bespoke.just-arrived {
    animation: newCardHighlight 3.5s ease forwards;
}

/* =========================================================================
   Remote Web Dial Pad & Live USSD Console
   ========================================================================= */

.dialer-layout {
    display: grid;
    grid-template-columns: 390px 1fr;
    gap: 20px;
    align-items: start;
}

.phone-chassis {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 20px 22px 24px;
    box-shadow: var(--shadow-md);
}

.sim-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    padding: 5px;
    border-radius: 14px;
    margin-bottom: 16px;
}

.sim-btn {
    border: 1px solid transparent;
    background: transparent;
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.sim-btn i {
    font-size: 18px;
    color: var(--text-muted);
}

.sim-btn small {
    display: block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sim-btn b {
    display: block;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sim-btn.active {
    background: var(--surface);
    border-color: var(--primary-line);
    box-shadow: var(--shadow-sm);
}

.sim-btn.active i,
.sim-btn.active small {
    color: var(--primary);
}

.dial-screen {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.dial-screen input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 4px 2px;
    text-align: center;
    color: var(--text);
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 11px;
    margin-bottom: 18px;
}

.key-btn {
    height: 62px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.08s ease, background 0.14s, border-color 0.14s;
    user-select: none;
}

.key-btn:hover {
    background: var(--primary-soft);
    border-color: var(--primary-line);
}

.key-btn:active {
    transform: scale(0.95);
}

.key-btn b {
    font-size: 21px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
}

.key-btn small {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-top: 2px;
}

.call-actions-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.btn-call-green {
    height: 52px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 20px -6px rgba(16, 185, 129, 0.55);
    transition: filter 0.15s, transform 0.1s;
}

.btn-call-green:hover { filter: brightness(1.06); }
.btn-call-green:active { transform: scale(0.98); }

.btn-hangup-red {
    height: 52px;
    padding: 0 18px;
    border-radius: 16px;
    border: 1px solid rgba(225, 29, 72, 0.28);
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.15s;
}

.btn-hangup-red:hover {
    background: #e11d48;
    color: #fff;
}

/* Live USSD Screen Mirror */
.ussd-terminal {
    background: #0b101b;
    color: #e2e8f0;
    border: 1px solid #1e293b;
    border-radius: 16px;
    padding: 18px 20px;
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ussd-screen-text {
    font-family: var(--font-mono);
    font-size: 13.8px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    color: #f1f5f9;
    padding: 6px 0 14px;
}

.ussd-reply-bar {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #1e293b;
    flex-wrap: wrap;
}

.ussd-reply-bar input {
    flex: 1;
    min-width: 160px;
    background: #141c2e !important;
    border-color: #2d3b55 !important;
    color: #fff !important;
    font-family: var(--font-mono);
    font-weight: 700;
}

.ussd-Preset-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 1024px) {
    .dialer-layout {
        grid-template-columns: 1fr;
    }
    .phone-chassis {
        max-width: 420px;
        margin: 0 auto;
        width: 100%;
    }
}

/* Responsive */
@media (max-width: 1180px) {
    .command-deck { grid-template-columns: 1fr; }
    .analytics-grid { grid-template-columns: 1fr; }
    .trx-feed.bento-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .sidebar { position: fixed; top: 0; bottom: 0; left: 0; transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-scrim.open { display: block; }
    .mobile-menu-btn { display: grid; }
    .topbar-saas { padding: 10px 16px; }
    .page-wrap { padding: 18px 16px 42px; }
}

@media (max-width: 580px) {
    .wallet-deck { grid-template-columns: 1fr; }
    .mini-stats { grid-template-columns: repeat(2, 1fr); }
    .dist-layout { flex-direction: column; }
    .cap-divider { display: none; }
}
