/* ==========================================================
   Unlimited Freedom - Core Stylesheet
   Colors come from CSS custom properties injected by PHP
   (see includes/settings.php -> theme_css_vars()) so the
   entire palette is swappable from the admin panel.
   ========================================================== */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--theme-bg);
    color: #241f12;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--theme-primary); color: #000; }

/* ---------- Layout shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: #060a10;
    border-right: 1px solid rgba(36,31,18,0.06);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 100vh;
    position: sticky;
    top: 0;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 10px 8px 24px; }
.brand .logo-badge {
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--theme-primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #06110d; font-size: 15px;
}
.brand .brand-name { font-weight: 800; font-size: 15px; line-height: 1.2; }
.brand .brand-name span { display: block; color: var(--theme-accent); font-weight: 700; }

.nav-section-label {
    font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
    color: #a89b7c; padding: 14px 10px 6px;
}

.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px; margin-bottom: 2px;
    color: #a5b0bd; font-size: 14px; font-weight: 500;
    border: 1px solid transparent;
}
.nav-link:hover { background: rgba(36,31,18,0.04); color: #fff; }
.nav-link.active {
    background: linear-gradient(135deg, color-mix(in srgb, var(--theme-primary) 18%, transparent), transparent);
    border-color: color-mix(in srgb, var(--theme-primary) 40%, transparent);
    color: var(--theme-primary);
}
.nav-link .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .6; }

.sidebar-footer { margin-top: auto; padding-top: 12px; font-size: 11px; color: #a89b7c; }

/* ---------- Main content ---------- */
.main { flex: 1; min-width: 0; }
.topbar {
    padding: 18px 32px; border-bottom: 1px solid rgba(36,31,18,0.06);
    background: rgba(10,14,20,0.6); backdrop-filter: blur(6px);
    position: sticky; top: 0; z-index: 5;
}
.breadcrumb { font-size: 12px; color: #9a8f72; margin-bottom: 4px; }
.breadcrumb b { color: var(--theme-primary); }
.page-title { font-size: 20px; font-weight: 800; }

.content { padding: 28px 32px 60px; max-width: 1200px; }

/* ---------- Cards ---------- */
.card {
    background: var(--theme-surface);
    border: 1px solid rgba(36,31,18,0.06);
    border-radius: 16px;
    padding: 22px;
}

.card-glow {
    background: linear-gradient(160deg, color-mix(in srgb, var(--theme-primary) 14%, var(--theme-surface)), var(--theme-surface) 60%);
    border: 1px solid color-mix(in srgb, var(--theme-primary) 30%, transparent);
}

.stat-card {
    background: rgba(36,31,18,0.03);
    border: 1px solid rgba(36,31,18,0.06);
    border-radius: 14px;
    padding: 16px 18px;
}
.stat-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #8c8163; margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 800; font-family: 'DM Mono', monospace; }
.stat-value.primary { color: var(--theme-primary); }
.stat-value.accent { color: var(--theme-accent); }
.stat-value.secondary { color: var(--theme-secondary); }

.grid { display: grid; gap: 18px; min-width: 0; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.balance-grid { grid-template-columns: 1fr auto auto; align-items: center; }
@media (max-width: 640px) { .balance-grid { grid-template-columns: 1fr; } .balance-grid .stat-card { width: 100%; } }

.heading-hero { font-size: 30px; font-weight: 800; margin: 0 0 4px; }
.heading-hero .accent { color: var(--theme-primary); }
.subtext { color: #6b6148; font-size: 14px; line-height: 1.5; }

/* ---------- Action tiles ---------- */
.action-tile {
    display: flex; align-items: center; gap: 14px;
    padding: 18px; border-radius: 14px; border: 1px solid rgba(36,31,18,0.08);
    background: var(--theme-surface);
    box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 6px 16px rgba(36,31,18,0.05);
    transition: transform .15s ease;
}
.action-tile:hover { transform: translateY(-2px); }
.action-tile .icon-box { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.action-tile .tile-title { font-weight: 700; font-size: 15px; }
.action-tile .tile-sub { font-size: 12.5px; color: #6b6148; }

.tile-green .icon-box { background: color-mix(in srgb, var(--theme-primary) 16%, var(--theme-surface)); border: 1px solid color-mix(in srgb, var(--theme-primary) 35%, transparent); }
.tile-green .tile-title { color: var(--theme-primary); }

.tile-blue .icon-box { background: color-mix(in srgb, var(--theme-accent) 16%, var(--theme-surface)); border: 1px solid color-mix(in srgb, var(--theme-accent) 35%, transparent); }
.tile-blue .tile-title { color: var(--theme-accent); }

.tile-amber .icon-box { background: color-mix(in srgb, var(--theme-secondary) 30%, var(--theme-surface)); border: 1px solid color-mix(in srgb, var(--theme-secondary) 45%, transparent); }
.tile-amber .tile-title { color: color-mix(in srgb, var(--theme-secondary) 65%, #6b4e00); }

/* ---------- Settings pill-tab bar ---------- */
.pill-tabs {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
    padding: 4px 2px 14px; margin: 0 0 4px;
}
.pill-tab { justify-content: center; text-align: center; }
.pill-tab {
    display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
    padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
    text-decoration: none; white-space: nowrap; transition: all .15s ease;
    background: var(--theme-surface); border: 1px solid rgba(36,31,18,0.10);
    color: #6b6148;
    box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset;
}
.pill-tab svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; flex-shrink: 0; }
.pill-tab:hover { border-color: color-mix(in srgb, var(--theme-primary) 40%, transparent); color: var(--theme-primary); }
.pill-tab.active {
    background: linear-gradient(150deg, var(--theme-primary), var(--theme-accent));
    border-color: transparent; color: #fff;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--theme-primary) 35%, transparent);
}

.gateway-detail-row { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; }
.bank-circle-btn {
    width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(150deg, var(--theme-primary), var(--theme-accent));
    border: none; color: #fff; font-size: 24px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--theme-primary) 35%, transparent);
    transition: transform 0.12s ease;
}
.bank-circle-btn:hover { transform: translateY(-2px) scale(1.04); }

/* ---------- Home page redesign: bento grid, progress ring, investment carousel ---------- */
.quick-icon-row { display: flex; justify-content: space-between; gap: 6px; margin: 22px 0 4px; }
.quick-icon-item { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; text-decoration: none; }
.quick-icon-item .circle {
    width: 52px; height: 52px; border-radius: 50%;
    background: linear-gradient(150deg, var(--theme-primary), var(--theme-accent));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--theme-primary) 35%, transparent);
    transition: transform 0.12s ease;
}
.quick-icon-item:hover .circle { transform: translateY(-2px); }
.quick-icon-item .circle svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 1.8; }
.quick-icon-item span { font-size: 11px; font-weight: 600; color: #241f12; text-align: center; }

.bento-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.bento-tile {
    background: var(--theme-surface); border: 1px solid rgba(36,31,18,0.08); border-radius: 18px;
    padding: 18px; box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 6px 16px rgba(36,31,18,0.05);
}
.bento-tile.span-2x2 { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.bento-tile.span-2x1 { grid-column: span 2; }
.bento-tile.span-1x1 { grid-column: span 1; }
@media (max-width: 560px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .bento-tile.span-2x2 { grid-column: span 2; }
    .bento-tile.span-2x1 { grid-column: span 2; }
}

.maturity-ring {
    position: relative; width: 108px; height: 108px; border-radius: 50%;
    background: conic-gradient(var(--theme-primary) calc(var(--ring-pct, 0) * 1%), rgba(36,31,18,0.08) 0);
    display: flex; align-items: center; justify-content: center; margin: 4px auto 10px;
}
.maturity-ring::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--theme-surface); }
.maturity-ring-text { position: relative; z-index: 1; }
.maturity-ring-text .num { font-size: 22px; font-weight: 800; color: #241f12; display: block; line-height: 1.1; }
.maturity-ring-text .lbl { font-size: 9.5px; color: #6b6148; text-transform: uppercase; letter-spacing: 0.05em; }

.invest-carousel { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; scrollbar-width: none; margin-top: 4px; }
.invest-carousel::-webkit-scrollbar { display: none; }
.invest-card {
    min-width: 210px; scroll-snap-align: start; flex-shrink: 0;
    background: var(--theme-surface); border: 1px solid rgba(36,31,18,0.08); border-radius: 16px; padding: 16px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 6px 16px rgba(36,31,18,0.05);
}
.invest-card .amt { font-size: 19px; font-weight: 800; color: #241f12; }
.bar-track { height: 6px; border-radius: 99px; background: rgba(36,31,18,0.08); overflow: hidden; margin: 10px 0 8px; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--theme-primary), var(--theme-accent)); }

/* ---------- Menu trigger button + icon-grid modal (replaces always-visible pill rows) ---------- */
.menu-trigger {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: 13.5px;
    background: var(--theme-surface); border: 1px solid rgba(36,31,18,0.12);
    color: #241f12; cursor: pointer; margin-bottom: 18px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 4px 12px rgba(36,31,18,0.05);
}
.menu-trigger svg { width: 17px; height: 17px; stroke: var(--theme-accent); fill: none; stroke-width: 1.9; }
.menu-trigger:hover { border-color: color-mix(in srgb, var(--theme-primary) 40%, transparent); }

.icon-menu-modal .modal-box { max-width: 460px; }
.icon-menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 10px; margin-top: 8px; }
.icon-menu-item { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; text-align: center; }
.icon-menu-item .circle {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--theme-surface); border: 1px solid rgba(36,31,18,0.1);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 4px 10px rgba(36,31,18,0.06);
    transition: transform 0.12s ease;
}
.icon-menu-item .circle svg { width: 22px; height: 22px; stroke: var(--theme-accent); fill: none; stroke-width: 1.7; }
.icon-menu-item span { font-size: 12px; font-weight: 600; color: #241f12; line-height: 1.25; }
.icon-menu-item:hover .circle { transform: translateY(-2px); }
.icon-menu-item.active .circle {
    background: linear-gradient(150deg, var(--theme-primary), var(--theme-accent)); border-color: transparent;
}
.icon-menu-item.active .circle svg { stroke: #fff; }
.icon-menu-item.active span { color: var(--theme-primary); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: 10px; font-weight: 700; font-size: 14px;
    border: 1px solid transparent;
}
.btn-primary { background: var(--theme-primary); color: #06110d; }
.btn-secondary { background: var(--theme-secondary); color: #1a0f00; }
.btn-outline { background: transparent; border-color: rgba(36,31,18,0.15); color: #241f12; }
.btn-outline:hover { border-color: var(--theme-primary); color: var(--theme-primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }
.btn-danger { background: #ef4444; color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 600; color: #5c5238; margin-bottom: 6px; }
input, select, textarea {
    width: 100%; padding: 11px 13px; border-radius: 10px;
    background: rgba(36,31,18,0.04); border: 1px solid rgba(36,31,18,0.1);
    color: #241f12; font-size: 14px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--theme-primary); }
.input-row { display: flex; gap: 8px; }
.input-row select { flex: 0 0 130px; }
.help-text { font-size: 12px; color: #9a8f72; margin-top: 5px; }

/* ---------- Tables ---------- */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive table { min-width: 540px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; padding: 10px 12px; color: #8c8163; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid rgba(36,31,18,0.08); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid rgba(36,31,18,0.05); }
tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.badge-pending { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-active, .badge-approved { background: rgba(20,184,166,0.15); color: #14b8a6; }
.badge-completed { background: rgba(56,189,248,0.15); color: #38bdf8; }
.badge-rejected, .badge-cancelled { background: rgba(239,68,68,0.15); color: #ef4444; }
.badge-reversed { background: rgba(168,85,247,0.15); color: #a855f7; }
.badge-reinvested { background: rgba(56,189,248,0.15); color: #38bdf8; }

/* ---------- Expandable table rows ---------- */
.row-expand-btn {
    width: 24px; height: 24px; border-radius: 999px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(36,31,18,0.06); border: 1px solid rgba(36,31,18,0.12);
    color: #4a4130; font-size: 15px; line-height: 1; font-weight: 700;
    cursor: pointer; transition: background 0.15s ease, transform 0.15s ease;
}
.row-expand-btn:hover { background: rgba(36,31,18,0.12); }
.row-expand-btn.open { background: var(--theme-primary); border-color: var(--theme-primary); color: #08130d; }
.row-detail td { padding: 4px 12px 16px; border-bottom: 1px solid rgba(36,31,18,0.05); }
.row-detail-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px 20px;
    background: rgba(36,31,18,0.03); border-radius: 10px; padding: 12px 14px;
}
.row-detail-grid .stat-label { margin-bottom: 2px; }

/* ---------- 3D referral tree ---------- */
.tree3d-wrap {
    background: linear-gradient(180deg, rgba(36,31,18,0.03), rgba(36,31,18,0.01));
    border: 1px solid rgba(36,31,18,0.08); border-radius: 14px; overflow: hidden; position: relative;
}
.tree3d-wrap canvas { display: block; cursor: grab; }
.tree3d-wrap canvas:active { cursor: grabbing; }
.tree3d-hint {
    position: absolute; bottom: 10px; left: 14px; font-size: 11.5px; color: #8c8163;
    background: rgba(10,14,20,0.6); padding: 5px 10px; border-radius: 999px; pointer-events: none;
}
.tree3d-fallback { padding: 40px 20px; text-align: center; color: #8c8163; font-size: 13.5px; }
.tree3d-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; font-size: 12px; color: #6b6148; }
.tree3d-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tree3d-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---------- Dashboard announcement popup ---------- */
.announcement-toast {
    position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 70;
    width: 92%; max-width: 480px;
    background: var(--theme-surface); border: 1px solid rgba(56,189,248,.3); border-radius: 14px;
    box-shadow: 0 16px 50px rgba(0,0,0,.45); overflow: hidden;
    animation: announcement-slide-in .3s ease;
}
@keyframes announcement-slide-in { from { transform: translateX(-50%) translateY(-16px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
.announcement-toast.closing { animation: announcement-slide-out .25s ease forwards; }
@keyframes announcement-slide-out { to { transform: translateX(-50%) translateY(-16px); opacity: 0; } }
.announcement-toast-body { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px 12px; }
.announcement-toast-icon {
    width: 32px; height: 32px; border-radius: 50%; background: rgba(56,189,248,.15); color: var(--theme-accent);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.announcement-toast-message { flex: 1; font-size: 13.5px; line-height: 1.5; white-space: pre-line; padding-top: 5px; }
.announcement-toast-close { background: none; border: none; color: #8c8163; font-size: 20px; line-height: 1; cursor: pointer; flex-shrink: 0; padding: 0 2px; }
.announcement-toast-close:hover { color: #241f12; }
.announcement-toast-progress-track { height: 3px; background: rgba(36,31,18,.06); }
.announcement-toast-progress-bar { height: 100%; width: 100%; background: var(--theme-accent); }
@media (max-width: 480px) { .announcement-toast { top: 8px; width: 94%; } }

/* ---------- Capital unlock countdown (wallet page) ---------- */
.unlock-card { border: 1px solid rgba(56,189,248,.25); background: linear-gradient(180deg, rgba(56,189,248,.06), transparent); }
.unlock-card-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.unlock-countdown-text { font-family: 'DM Mono', monospace; font-size: 15px; font-weight: 700; color: var(--theme-accent); }
.unlock-progress-track { height: 8px; border-radius: 999px; background: rgba(36,31,18,.06); overflow: hidden; }
.unlock-progress-bar { height: 100%; width: 100%; background: var(--theme-accent); border-radius: 999px; }

/* ---------- Confirm/success dialogs (replaces native confirm()/alert()) ---------- */
.dialog-overlay { z-index: 80; }
.dialog-box { text-align: center; max-width: 380px; }
.dialog-icon {
    width: 60px; height: 60px; border-radius: 50%; margin: 4px auto 16px;
    display: flex; align-items: center; justify-content: center;
}
.dialog-icon svg { width: 30px; height: 30px; }
.dialog-icon-danger { background: rgba(239,68,68,0.15); color: #ef4444; }
.dialog-icon-success { background: rgba(34,197,94,0.15); color: #22c55e; }
.dialog-title { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.dialog-message { font-size: 13.5px; color: #6b6148; line-height: 1.5; margin: 0 0 22px; }
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions .btn { flex: 1; }
.impersonation-banner {
    background: #a855f7; color: #fff; padding: 10px 20px;
    display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
    font-size: 13.5px; font-weight: 600; position: sticky; top: 0; z-index: 45;
}

/* ---------- Bank details icon + modal ---------- */
.bank-icon-btn {
    width: 26px; height: 26px; border-radius: 8px; padding: 0; margin-left: 8px;
    display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
    background: rgba(56,189,248,0.12); border: 1px solid rgba(56,189,248,0.3);
    color: var(--theme-accent); cursor: pointer; transition: background 0.15s ease;
}
.bank-icon-btn:hover { background: rgba(56,189,248,0.22); }
.bank-icon-btn svg { width: 14px; height: 14px; }

.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 50;
    background: rgba(5,8,14,0.72); backdrop-filter: blur(2px);
    align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    width: 100%; max-width: 420px;
    background: var(--theme-surface); border: 1px solid rgba(36,31,18,0.1);
    border-radius: 16px; padding: 24px; position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: modal-pop 0.15s ease;
}
@keyframes modal-pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-close {
    position: absolute; top: 16px; right: 16px; width: 28px; height: 28px; border-radius: 999px;
    background: rgba(36,31,18,0.06); border: 1px solid rgba(36,31,18,0.1);
    color: #4a4130; font-size: 16px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(36,31,18,0.12); }
.modal-box h3 { margin: 0 0 4px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.modal-box .modal-sub { margin-bottom: 16px; }
.modal-bank-details {
    background: rgba(36,31,18,0.03); border: 1px solid rgba(36,31,18,0.08);
    border-radius: 10px; padding: 14px 16px; white-space: pre-line; font-size: 13.5px; line-height: 1.7;
}
.modal-ref { margin-top: 14px; font-size: 12.5px; color: #8c8163; }
.modal-ref b { color: #241f12; font-family: 'DM Mono', monospace; }

/* ---------- Table search + pagination (datatable.js) ---------- */
.dt-controls { margin-bottom: 10px; }
.dt-search {
    width: 100%; max-width: 280px; padding: 9px 13px; border-radius: 10px;
    background: rgba(36,31,18,0.04); border: 1px solid rgba(36,31,18,0.12);
    color: #241f12; font-size: 13.5px; font-family: inherit;
}
.dt-search:focus { outline: none; border-color: var(--theme-primary); }
.dt-pager {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
    margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(36,31,18,0.06);
    font-size: 12.5px; color: #8c8163;
}
.dt-nav { display: flex; align-items: center; gap: 10px; }
.dt-nav button {
    padding: 6px 14px; border-radius: 8px; background: rgba(36,31,18,0.05);
    border: 1px solid rgba(36,31,18,0.12); color: #241f12; font-size: 12.5px;
    font-family: inherit; cursor: pointer;
}
.dt-nav button:hover:not(:disabled) { background: rgba(36,31,18,0.1); }
.dt-nav button:disabled { opacity: 0.4; cursor: not-allowed; }
.dt-page-label { white-space: nowrap; }
.dt-empty { font-style: italic; }

/* ---------- WhatsApp group join button ---------- */
.whatsapp-fab {
    position: fixed; bottom: 168px; right: 22px; width: 56px; height: 56px; border-radius: 50%;
    background: #25D366; color: #ffffff; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,.35);
    z-index: 55; transition: transform .15s ease;
}
.whatsapp-fab:hover { transform: scale(1.06); }
.whatsapp-fab svg { width: 28px; height: 28px; }
@media (max-width: 480px) { .whatsapp-fab { bottom: 158px; right: 16px; } }

.whatsapp-modal-box { text-align: center; max-width: 360px; }
.whatsapp-modal-icon {
    width: 66px; height: 66px; border-radius: 50%; margin: 4px auto 16px;
    background: #25D366; color: #ffffff; display: flex; align-items: center; justify-content: center;
}
.whatsapp-modal-icon svg { width: 34px; height: 34px; }
.whatsapp-join-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: #25D366; color: #ffffff; font-weight: 700; text-decoration: none;
    padding: 12px 20px; border-radius: 10px; margin-top: 6px; transition: background .15s ease;
}
.whatsapp-join-btn:hover { background: #1ebe5a; }
.whatsapp-join-btn svg { width: 20px; height: 20px; }
.oops-illustration { margin: 4px auto 12px; filter: drop-shadow(0 10px 16px rgba(0,0,0,0.35)); }

/* ---------- Top progress bar (page navigation loading feedback) ---------- */
#topProgressBar {
    position: fixed; top: 0; left: 0; height: 3px; width: 0%;
    background: linear-gradient(90deg, var(--theme-accent), var(--theme-primary), color-mix(in srgb, var(--theme-primary) 40%, #fff));
    box-shadow: 0 0 10px color-mix(in srgb, var(--theme-primary) 50%, transparent);
    z-index: 99999; transition: width .2s ease, opacity .3s ease;
    opacity: 0;
}
#topProgressBar.active { opacity: 1; }

/* ---------- PWA standalone-launch loading overlay ---------- */
.pwa-loading-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 9999;
    background: var(--theme-bg);
    flex-direction: column; align-items: center; justify-content: center;
    gap: 22px;
    opacity: 1;
    transition: opacity 0.4s ease;
}
.pwa-loading-overlay.visible { display: flex; }
.pwa-loading-overlay.fade-out { opacity: 0; }
.pwa-loading-logo-wrap {
    position: relative;
    width: 128px; height: 128px;
    display: flex; align-items: center; justify-content: center;
}
.pwa-loading-ring {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    transform: rotate(-90deg); /* start the fill at 12 o'clock, not 3 o'clock */
}
.pwa-loading-ring-track {
    fill: none;
    stroke: color-mix(in srgb, var(--theme-primary) 15%, transparent);
    stroke-width: 4;
}
.pwa-loading-ring-fill {
    fill: none;
    stroke: var(--theme-primary);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.15s linear;
}
.pwa-loading-logo {
    width: 96px; height: 96px; border-radius: 22px;
    box-shadow: 0 8px 28px color-mix(in srgb, var(--theme-primary) 35%, transparent);
    animation: pwaLoadingPulse 1.6s ease-in-out infinite;
}
@keyframes pwaLoadingPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.pwa-loading-bar-track {
    width: 200px; height: 6px; border-radius: 999px;
    background: color-mix(in srgb, var(--theme-primary) 15%, transparent);
    overflow: hidden;
}
.pwa-loading-bar-fill {
    height: 100%; width: 0%; border-radius: 999px;
    background: var(--theme-primary);
    transition: width 0.15s linear;
}
.pwa-loading-percent {
    font-family: 'DM Mono', monospace;
    font-size: 13px; color: var(--theme-primary); letter-spacing: 0.5px;
}

/* ---------- Biometric app-lock overlay ---------- */
.biometric-lock-overlay {
    z-index: 10000; /* above the loading overlay - if both are up at once, the lock prompt wins */
    padding: 0 32px;
    text-align: center;
}
.biometric-lock-text {
    font-size: 17px; font-weight: 700; color: #241f12;
}
.biometric-lock-error {
    font-size: 13px; color: #f87171; max-width: 280px;
}

/* ---------- Inline edit (pencil) button ---------- */
.inline-edit-btn {
    border: none; background: transparent; cursor: pointer; color: #8c8163;
    font-size: 12px; padding: 0 2px; vertical-align: middle;
}
.inline-edit-btn:hover { color: var(--theme-primary); }

/* ---------- Password show/hide toggle ---------- */
.password-field { position: relative; }
.password-field input { padding-right: 42px; }
.password-toggle {
    position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
    width: 34px; height: 34px; border: none; background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center; color: #8c8163; border-radius: 8px;
}
.password-toggle:hover { color: #4a4130; background: rgba(36,31,18,0.06); }
.password-toggle svg { width: 19px; height: 19px; }

.support-fab {
    position: fixed; bottom: 100px; right: 22px; width: 56px; height: 56px; border-radius: 50%;
    background: var(--theme-primary); color: #06110d; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,.35);
    z-index: 55; transition: transform .15s ease;
}
.support-fab:hover { transform: scale(1.06); }
.support-fab svg { width: 26px; height: 26px; }
.support-fab .unread-dot {
    position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%;
    background: #ef4444; border: 2px solid var(--theme-bg); display: none;
}
.support-fab.has-unread .unread-dot { display: block; }

.support-panel {
    position: fixed; bottom: 168px; right: 22px; width: 340px; max-width: calc(100vw - 32px);
    height: 460px; max-height: calc(100vh - 200px);
    background: var(--theme-surface); border: 1px solid rgba(36,31,18,.1); border-radius: 16px;
    display: none; flex-direction: column; overflow: hidden; z-index: 56;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.support-panel.open { display: flex; }
.support-panel-header {
    padding: 14px 16px; background: var(--theme-primary); color: #06110d; font-weight: 700;
    display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;
}
.support-panel-header button { background: none; border: none; color: #06110d; font-size: 18px; cursor: pointer; line-height: 1; }
.support-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.support-msg { max-width: 80%; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.support-msg.user { align-self: flex-end; background: var(--theme-primary); color: #06110d; border-bottom-right-radius: 3px; }
.support-msg.admin { align-self: flex-start; background: rgba(36,31,18,.07); border-bottom-left-radius: 3px; }
.support-msg-time { font-size: 10px; opacity: .6; margin-top: 3px; }
.support-empty { color: #9a8f72; font-size: 13px; text-align: center; margin-top: 30px; }
.support-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid rgba(36,31,18,.08); flex-shrink: 0; }
.support-input-row textarea {
    flex: 1; resize: none; height: 40px; padding: 9px 12px; border-radius: 10px;
    background: rgba(36,31,18,.04); border: 1px solid rgba(36,31,18,.1); color: #241f12; font-family: inherit; font-size: 13px;
}
.support-input-row button {
    width: 40px; height: 40px; border-radius: 10px; background: var(--theme-primary); border: none;
    color: #06110d; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.support-closed-note { padding: 8px 14px; font-size: 11.5px; color: #f59e0b; background: rgba(245,158,11,.1); text-align: center; display: none; flex-shrink: 0; }
@media (max-width: 480px) {
    .support-panel { right: 12px; left: 12px; width: auto; bottom: 92px; max-height: calc(100vh - 220px); }
    .support-fab { bottom: 92px; right: 16px; }
}

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-box { width: 100%; max-width: 440px; background: var(--theme-surface); border: 1px solid rgba(36,31,18,0.08); border-radius: 18px; padding: 36px; }
.auth-box h1 { font-size: 22px; margin: 0 0 6px; }
.auth-box .subtext { margin-bottom: 24px; }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; }
.alert-error { background: rgba(239,68,68,0.10); color: #b91c1c; border: 1px solid rgba(239,68,68,0.3); }
.alert-success { background: rgba(20,184,166,0.10); color: #0f766e; border: 1px solid rgba(20,184,166,0.3); }
.alert-info { background: rgba(56,189,248,0.10); color: #0369a1; border: 1px solid rgba(56,189,248,0.3); }

/* ---------- WhatsApp contact chips ---------- */
.wa-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 10px;
    background: rgba(37,211,102,0.12); border: 1px solid rgba(37,211,102,0.35);
    color: #25d366; font-weight: 700; font-size: 13px;
}

/* ---------- Color swatch picker (admin theme page) ---------- */
.swatch-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
    width: 42px; height: 42px; border-radius: 10px; border: 2px solid transparent;
    cursor: pointer; position: relative;
}
.swatch.selected { border-color: #fff; }
.swatch input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

/* ---------- Progress bar (investment maturity) ---------- */
.progress-track { height: 8px; border-radius: 99px; background: rgba(36,31,18,0.08); overflow: hidden; }
.progress-fill { height: 100%; background: var(--theme-primary); border-radius: 99px; }

/* ---------- Mobile nav toggle ---------- */
.mobile-nav-toggle {
    display: none;
    background: rgba(36,31,18,0.06);
    border: 1px solid rgba(36,31,18,0.1);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.mobile-nav-toggle span,
.mobile-nav-toggle span::before,
.mobile-nav-toggle span::after {
    display: block;
    width: 18px;
    height: 2px;
    background: #241f12;
    position: relative;
    transition: all 0.2s ease;
}
.mobile-nav-toggle span::before { content: ''; position: absolute; top: -6px; }
.mobile-nav-toggle span::after { content: ''; position: absolute; top: 6px; }
.sidebar.open ~ .main .mobile-nav-toggle span { background: transparent; }
.sidebar.open ~ .main .mobile-nav-toggle span::before { transform: rotate(45deg); top: 0; }
.sidebar.open ~ .main .mobile-nav-toggle span::after { transform: rotate(-45deg); top: 0; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 15;
}
.sidebar-overlay.open { display: block; }

@media (max-width: 900px) {
    .mobile-nav-toggle { display: flex; }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
        z-index: 20;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        display: flex;
    }
    .sidebar.open { transform: translateX(0); }
    .content { padding: 20px; }
    .topbar { padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
    .topbar .breadcrumb, .topbar .page-title { min-width: 0; }
}


/* ==========================================================
   Bridge One user-facing shell — hero + balance carousel +
   widget grid + flat bottom nav (approved design, replaces
   the sidebar/topbar layout on user/*.php pages only; admin
   keeps the sidebar above, just re-themed light).
   ========================================================== */
.bo-hero {
    position: relative;
    background: linear-gradient(160deg, var(--theme-accent), color-mix(in srgb, var(--theme-accent) 60%, #000));
    color: #fff;
    padding: 20px 18px 26px;
    border-radius: 0 0 26px 26px;
    overflow: hidden;
}
.bo-hero::after {
    content: ''; position: absolute; inset: 0; opacity: .10; pointer-events: none;
    background-image: repeating-linear-gradient(105deg, transparent 0 44px, #fff 44px 45px);
}
.bo-hero-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.bo-greet { display: flex; align-items: center; gap: 10px; }
.bo-greet-mark {
    width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,0.14);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
    border: 1px solid rgba(255,255,255,0.25); font-family: 'DM Mono', monospace;
}
.bo-greet-name { font-weight: 700; font-size: 16px; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.bo-hero-icons { display: flex; gap: 10px; }
.bo-icon-btn {
    width: 36px; height: 36px; border-radius: 11px; background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22); color: #fff;
    display: flex; align-items: center; justify-content: center; position: relative; text-decoration: none;
}
.bo-icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--theme-secondary); }

.bo-hero-title { display: flex; align-items: center; gap: 10px; margin: 22px 0 4px; position: relative; z-index: 1; }
.bo-hero-title h1 { margin: 0; font-size: 23px; font-weight: 700; color: #fff; }

.bo-bal-track { display: flex; gap: 26px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 14px 0 4px; position: relative; z-index: 1; scrollbar-width: none; }
.bo-bal-track::-webkit-scrollbar { display: none; }
.bo-bal-card { min-width: 220px; scroll-snap-align: start; }
.bo-bal-card .bo-label { font-size: 13px; color: rgba(255,255,255,0.75); }
.bo-bal-card .bo-amount { font-size: 26px; font-weight: 700; margin-top: 4px; font-family: 'DM Mono', monospace; color: #fff; }
.bo-dots { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; position: relative; z-index: 1; }
.bo-dots .d { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.35); }
.bo-dots .d.on { background: #fff; width: 16px; border-radius: 4px; }

.bo-content { padding: 16px 16px 108px; max-width: 760px; margin: 0 auto; }

.bo-section-title { font-size: 19px; font-weight: 700; margin: 0 0 12px; color: #241f12; }

.bo-widget-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
.bo-widget { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; position: relative; text-decoration: none; }
.bo-widget .box {
    width: 100%; aspect-ratio: 1; border-radius: 14px; background: var(--theme-surface);
    border: 1px solid rgba(36,31,18,0.10); display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset;
}
.bo-widget svg { width: 24px; height: 24px; stroke: var(--theme-accent); fill: none; stroke-width: 1.7; }
.bo-widget span { font-size: 11.5px; font-weight: 500; color: #241f12; line-height: 1.25; }

/* ---------- Bottom nav (flat, bold active state) ---------- */
.bo-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(251,246,234,0.94); backdrop-filter: blur(14px);
    border-top: 1px solid rgba(36,31,18,0.10);
    padding: 9px 4px calc(6px + env(safe-area-inset-bottom));
    display: flex; align-items: center; justify-content: space-around;
}
.bo-tab {
    background: none; border: none; color: #8c8163; text-decoration: none;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 600;
    padding: 4px 6px; width: 66px; border-radius: 10px;
}
.bo-tab svg { width: 22px; height: 22px; stroke: #8c8163; fill: none; stroke-width: 1.7; }
.bo-tab.active { color: #241f12; font-weight: 700; }
.bo-tab.active svg { stroke: var(--theme-accent); stroke-width: 2; }

@media (min-width: 640px) {
    .bo-hero { padding-left: 32px; padding-right: 32px; }
    .bo-content { padding-left: 32px; padding-right: 32px; }
}
