/* =========================================================================
   ELITE DESIGN SYSTEM v5 — COMPACT BENTO GRID LAYOUT
   Pacific Institutional Banking Platform
   ========================================================================= */

:root {
    --sb-width: 260px; /* Slightly wider for premium feel */
    --sb-collapsed-width: 72px;
    --header-height: 60px;
    --ticker-height: 24px;
    --total-header-height: calc(var(--header-height) + var(--ticker-height));
    --content-max: 1280px;
    --r-sm:  8px;
    --r-md: 12px;
    --r-lg: 20px;
    --card-pad: 20px 24px;
    --card-gap: 16px;
    --border: 1px solid rgba(255,255,255,0.06);
    --card-bg: rgba(255,255,255,0.022);
    --accent-glow-soft: rgba(var(--accent-rgb), 0.08);
}

/* =========================================================================
   SIDEBAR v5 — COMPACT
   ========================================================================= */
.fixed-sidebar {
    width: var(--sb-width) !important;
    position: sticky !important;
    top: var(--total-header-height) !important;
    height: calc(100vh - var(--total-header-height)) !important;
    background: var(--bg-deep) !important;
    border-right: var(--border) !important;
    display: flex !important; flex-direction: column !important;
    flex-shrink: 0 !important; overflow-y: auto !important;
    overflow-x: hidden !important; scrollbar-width: none !important;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 100 !important;
    backdrop-filter: blur(10px);
}
.fixed-sidebar::-webkit-scrollbar { display: none; }
.fixed-sidebar.collapsed { width: var(--sb-collapsed-width) !important; }

.sb-root { display: flex; flex-direction: column; height: 100%; padding: 16px 0 12px; }

.sb-identity {
    display: flex; align-items: center; gap: 12px;
    padding: 0 16px 18px; border-bottom: var(--border); margin-bottom: 12px;
}
.sb-avatar-wrap { position: relative; flex-shrink: 0; }
.sb-avatar {
    width: 40px; height: 40px; border-radius: 12px;
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    object-fit: cover; background: var(--bg-elevated); padding: 2px; display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.sb-link:hover .sb-avatar { transform: scale(1.05); }
.sb-online-dot {
    position: absolute; bottom: -2px; right: -2px;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--success); border: 2.5px solid var(--bg-deep);
    box-shadow: 0 0 8px var(--success);
}
.sb-id-info { display: flex; flex-direction: column; overflow: hidden; }
.sb-name {
    font-size: 0.85rem; font-weight: 700; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.2px;
}
.sb-tier { font-size: 0.6rem; font-weight: 800; color: var(--accent); letter-spacing: 1.2px; margin-top: 2px; opacity: 0.9; text-transform: uppercase; }

.sb-balance-pill {
    margin: 0 12px 16px;
    background: linear-gradient(to right, rgba(var(--accent-rgb), 0.08), rgba(var(--accent-rgb), 0.02));
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    border-radius: var(--r-md); padding: 10px 14px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: inset 0 0 20px rgba(var(--accent-rgb), 0.03);
}
.sbp-label { font-size: 0.58rem; font-weight: 800; color: var(--text-muted); letter-spacing: 1.2px; text-transform: uppercase; }
.sbp-status { display: flex; align-items: center; gap: 6px; font-size: 0.6rem; font-weight: 800; color: var(--success); }
.sbp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); animation: sbp-blink 2s ease infinite; }
@keyframes sbp-blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

.sb-nav { flex: 1; display: flex; flex-direction: column; padding: 0 10px; overflow-y: auto; scrollbar-width: none; }
.sb-nav::-webkit-scrollbar { display: none; }
.sb-section { margin-bottom: 8px; }
.sb-section-label { display: block; font-size: 0.6rem; font-weight: 900; letter-spacing: 2px; color: var(--text-muted); opacity: 0.35; padding: 12px 10px 6px; text-transform: uppercase; }
.sb-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: var(--r-md); text-decoration: none; color: rgba(255,255,255,0.5);
    font-size: 0.82rem; font-weight: 500; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); position: relative;
    margin-bottom: 2px;
}
.sb-link:hover { color: #fff; background: rgba(255,255,255,0.05); transform: translateX(4px); }
.sb-link.is-active { color: var(--accent) !important; background: rgba(var(--accent-rgb), 0.12) !important; font-weight: 600; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.sb-link-icon {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; flex-shrink: 0; transition: all 0.2s; color: inherit;
    background: rgba(255,255,255,0.03);
}
.sb-link:hover .sb-link-icon { background: rgba(255,255,255,0.08); color: #fff; }
.sb-link.is-active .sb-link-icon { background: var(--accent); color: #000; box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.4); }
.sb-link-label { flex: 1; white-space: nowrap; }
.sb-active-pip { width: 4px; height: 16px; border-radius: 20px; background: var(--accent); box-shadow: 0 0 10px var(--accent); flex-shrink: 0; position: absolute; right: 0; }

.sb-footer { margin-top: auto; padding: 12px 12px 0; border-top: var(--border); }
.sb-compliance { display: flex; align-items: center; gap: 4px; font-size: 0.53rem; font-weight: 700; color: var(--text-muted); opacity: 0.28; letter-spacing: 0.4px; margin-bottom: 8px; }
.sb-signout {
    display: flex; align-items: center; gap: 7px; font-size: 0.72rem; font-weight: 600;
    color: rgba(239,68,68,0.5); text-decoration: none;
    padding: 7px 5px; border-radius: var(--r-sm); transition: all 0.18s;
}
.sb-signout:hover { color: #ef4444; background: rgba(239,68,68,0.07); }

/* Collapsed */
.fixed-sidebar.collapsed .sb-identity { flex-direction: column; padding: 0 7px 12px; }
.fixed-sidebar.collapsed .sb-id-info,
.fixed-sidebar.collapsed .sb-balance-pill,
.fixed-sidebar.collapsed .sb-section-label,
.fixed-sidebar.collapsed .sb-link-label,
.fixed-sidebar.collapsed .sb-active-pip,
.fixed-sidebar.collapsed .sb-compliance,
.fixed-sidebar.collapsed .sb-signout span { display: none !important; }
.fixed-sidebar.collapsed .sb-link { justify-content: center; padding: 9px 0; }
.fixed-sidebar.collapsed .sb-link-icon { width: 34px; height: 34px; border-radius: 8px; }
.fixed-sidebar.collapsed .sb-footer { padding: 10px 7px 0; display: flex; justify-content: center; }
.fixed-sidebar.collapsed .sb-signout { padding: 8px; justify-content: center; }

@media (max-width: 768px) {
    .fixed-sidebar {
        position: fixed !important; left: calc(-1 * var(--sb-width)) !important;
        top: var(--header-height) !important; width: var(--sb-width) !important;
        height: calc(100vh - var(--header-height)) !important;
        z-index: 9000 !important; transition: left 0.28s cubic-bezier(0.4,0,0.2,1) !important;
    }
    .fixed-sidebar.mobile-open { left: 0 !important; box-shadow: 6px 0 30px rgba(0,0,0,0.55); }
}

/* =========================================================================
   LAYOUT v5
   ========================================================================= */
.app-viewport { 
    min-height: 100vh; 
    padding-top: var(--total-header-height); 
    display: flex; 
    flex-direction: column; 
    background: var(--bg-deep);
}
.app-body { 
    display: flex; 
    flex: 1; 
    min-height: calc(100vh - var(--total-header-height)); 
}
.main-scroll-area {
    flex: 1;
    padding: 24px 32px;
    background: var(--bg-main);
    min-height: calc(100vh - var(--total-header-height));
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;    /* IE/Edge */
    position: relative;
}
.main-scroll-area::-webkit-scrollbar { display: none; } /* Chrome/Safari */

/* Hide body scrollbar on authenticated dashboard pages */
body.is-logged-in {
    scrollbar-width: none;
    -ms-overflow-style: none;
    overflow-y: auto;
}
body.is-logged-in::-webkit-scrollbar { display: none; }

@media (max-width: 1024px) { .main-scroll-area { padding: 16px; } }
@media (max-width: 768px)  { .main-scroll-area { padding: 12px; } }

/* =========================================================================
   GLASS CARD BASE
   ========================================================================= */
.glass-panel-v4 {
    background: var(--card-bg);
    border: var(--border);
    border-radius: var(--r-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.glass-panel-v4:hover {
    border-color: rgba(var(--accent-rgb), 0.14);
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}

/* =========================================================================
   DASHBOARD — COMPACT BENTO GRID
   ========================================================================= */
.command-center-v5 { max-width: var(--content-max); margin: 0 auto; width: 100%; }

/* Top Bar */
.cc-top-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 16px;
}
.universal-input-wrap {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.03); border: var(--border);
    border-radius: var(--r-md); padding: 0 12px;
    flex: 1; max-width: 400px; height: 36px;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.universal-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.1); }
.universal-input-wrap svg { color: var(--text-muted); flex-shrink: 0; transition: color 0.18s; }
.universal-input-wrap:focus-within svg { color: var(--accent); }
#universal-command-input { background: none; border: none; color: #fff; font-size: 0.8rem; width: 100%; outline: none; }
#universal-command-input::placeholder { color: rgba(255,255,255,0.2); }
.uiw-hint { font-size: 0.58rem; font-weight: 700; color: var(--text-muted); background: rgba(255,255,255,0.04); border: var(--border); padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.security-health-indicator { display: flex; align-items: center; gap: 10px; }
.focus-switcher { display: flex; background: rgba(255,255,255,0.03); border: var(--border); border-radius: var(--r-sm); overflow: hidden; }
.fs-btn { background: none; border: none; color: var(--text-muted); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.8px; padding: 6px 11px; cursor: pointer; transition: all 0.18s; }
.fs-btn:hover { color: #fff; }
.fs-btn.active { background: var(--accent); color: #000; }
.shi-status { display: flex; align-items: center; gap: 6px; font-size: 0.6rem; font-weight: 700; letter-spacing: 1px; }
.shi-status.safe { color: var(--success); }
.shi-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 6px var(--success); animation: shi-pulse 2.5s ease infinite; }
@keyframes shi-pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.45;transform:scale(0.75)} }

/* -----------------------------------------------------------------------
   BENTO GRID — 12-column base, auto rows, all cards fixed proportions
   ----------------------------------------------------------------------- */
.cc-grid-v5 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(0, auto);
    gap: var(--card-gap);
}

/* Card base */
.cc-card-v5 { padding: var(--card-pad); }

/* --- ROW 1 --- */
/* Balance: spans 7 cols, fixed height */
.area-balance {
    grid-column: span 7;
    display: flex; flex-direction: column;
    overflow: hidden; height: 168px;
}

/* Quick Stats: spans 5 cols, same height as balance, 2×2 inner grid */
.area-stats {
    grid-column: span 5;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    height: 168px;
}

/* --- ROW 2: Actions strip --- */
.area-actions-v5 {
    grid-column: span 12;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--card-gap);
}

/* --- ROW 3 --- */
/* Ledger: 7 cols */
.area-ledger {
    grid-column: span 7;
    display: flex; flex-direction: column;
    height: 320px;
}

/* Insights: 5 cols */
.area-insights {
    grid-column: span 5;
    display: flex; flex-direction: column;
    height: 320px;
}

/* -----------------------------------------------------------------------
   BALANCE CARD INTERNALS
   ----------------------------------------------------------------------- */
.ambient-glow {
    position: absolute; right: -20px; top: -20px; width: 150px; height: 150px;
    background: radial-gradient(circle, rgba(var(--accent-rgb),0.1) 0%, transparent 70%);
    pointer-events: none;
}
.cc-context-alert {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(var(--accent-rgb),0.07); border: 1px solid rgba(var(--accent-rgb),0.15);
    color: var(--accent); padding: 4px 10px; border-radius: 50px;
    font-size: 0.67rem; font-weight: 600; margin-bottom: 10px;
    align-self: flex-start; position: relative; z-index: 1;
}
.imm-label-v5 { font-size: 0.58rem; font-weight: 800; letter-spacing: 1.6px; color: var(--text-muted); opacity: 0.6; display: block; z-index: 1; position: relative; }
.imm-label-v5.pull-right { text-align: right; }
.lt-balance-v5 {
    font-size: clamp(1.7rem, 2.8vw, 2.3rem);
    font-weight: 800; letter-spacing: -1px; margin: 6px 0 auto;
    position: relative; z-index: 1; line-height: 1.05;
    background: linear-gradient(135deg, #fff 30%, rgba(255,255,255,0.48));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.balance-meta {
    display: flex; justify-content: space-between; align-items: flex-end;
    position: relative; z-index: 1;
    border-top: 1px solid rgba(255,255,255,0.055); padding-top: 10px; margin-top: 10px;
}
.bm-info span { display: block; font-size: 0.55rem; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 2px; }
.bm-info strong { font-family: 'JetBrains Mono','Courier New',monospace; font-size: 0.8rem; font-weight: 600; color: #fff; }
.bm-status { font-size: 0.55rem; }

/* -----------------------------------------------------------------------
   STAT MINI-CARDS (area-stats inner items)
   ----------------------------------------------------------------------- */
.stat-mini {
    background: var(--card-bg);
    border: var(--border);
    border-radius: var(--r-md);
    padding: 12px 14px;
    display: flex; flex-direction: column; justify-content: space-between;
    transition: border-color 0.2s;
}
.stat-mini:hover { border-color: rgba(var(--accent-rgb),0.18); }
.sm-label { font-size: 0.56rem; font-weight: 800; letter-spacing: 1px; color: var(--text-muted); opacity: 0.6; text-transform: uppercase; margin-bottom: 4px; }
.sm-value { font-size: 1.05rem; font-family: 'JetBrains Mono','Courier New',monospace; font-weight: 700; color: #fff; letter-spacing: -0.3px; }
.sm-value.up { color: var(--success); }
.sm-value.dn { color: var(--danger); }
.sm-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 0.55rem; font-weight: 700; padding: 2px 6px; border-radius: 50px; margin-top: 4px; }
.sm-chip.up { background: rgba(16,185,129,0.1); color: var(--success); }
.sm-chip.dn { background: rgba(239,68,68,0.1); color: var(--danger); }
.sm-chip.neutral { background: rgba(255,255,255,0.05); color: var(--text-muted); }

/* -----------------------------------------------------------------------
   ACTION BUTTONS
   ----------------------------------------------------------------------- */
.action-btn-v5 {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-radius: var(--r-md); text-decoration: none;
    color: rgba(255,255,255,0.65); background: var(--card-bg); border: var(--border);
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.2px;
    transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
}
.action-btn-v5:hover { background: rgba(255,255,255,0.048); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.18); }
.action-btn-v5.primary-action {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary, var(--accent)));
    border-color: transparent; color: #000; font-weight: 700;
}
.action-btn-v5.primary-action:hover { box-shadow: 0 6px 20px rgba(var(--accent-rgb),0.3); transform: translateY(-1px); }
.action-btn-v5.primary-action .ab-icon { background: rgba(0,0,0,0.1); color: #000; }
.ab-icon {
    width: 30px; height: 30px; border-radius: 7px;
    background: rgba(255,255,255,0.04); display: flex; align-items: center; justify-content: center;
    color: var(--accent); flex-shrink: 0;
}

/* -----------------------------------------------------------------------
   LEDGER PANEL
   ----------------------------------------------------------------------- */
.area-ledger { overflow: hidden; }
.ledger-v5-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ledger-v5-header h3 { font-size: 0.7rem; font-weight: 800; letter-spacing: 1.2px; margin: 0; color: rgba(255,255,255,0.88); }
.btn-text-accent { font-size: 0.62rem; font-weight: 700; color: var(--accent); text-decoration: none; opacity: 0.7; transition: opacity 0.18s; }
.btn-text-accent:hover { opacity: 1; }
.ledger-v5-stream { flex: 1; overflow-y: auto; scrollbar-width: thin; }
.ledger-v5-stream::-webkit-scrollbar { width: 3px; }
.ledger-v5-stream::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 3px; }
.empty-state-v5 { text-align: center; padding: 24px 0; color: var(--text-muted); font-size: 0.74rem; font-weight: 500; }
.empty-state-v5 svg { margin: 0 auto 8px; display: block; }
.ledger-group-label { font-size: 0.55rem; font-weight: 800; color: var(--text-muted); opacity: 0.4; letter-spacing: 1.2px; margin: 12px 0 6px; text-transform: uppercase; }
.ledger-group-label:first-child { margin-top: 0; }
.ledger-row-v5 {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.032); transition: all 0.14s;
}
.ledger-row-v5:last-child { border-bottom: none; }
.ledger-row-v5:hover { background: rgba(255,255,255,0.022); padding-left: 7px; padding-right: 7px; border-radius: 7px; border-color: transparent; }
.lr-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ledger-row-v5.credit .lr-icon { background: rgba(16,185,129,0.1); color: var(--success); }
.ledger-row-v5.debit  .lr-icon { background: rgba(239,68,68,0.1);  color: var(--danger); }
.lr-info { flex: 1; min-width: 0; }
.lr-info strong { display: block; font-size: 0.76rem; font-weight: 600; color: #fff; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-info span { font-size: 0.59rem; color: var(--text-muted); }
.lr-amount { font-family: 'JetBrains Mono','Courier New',monospace; font-size: 0.82rem; font-weight: 600; text-align: right; white-space: nowrap; color: rgba(255,255,255,0.78); }
.ledger-row-v5.credit .lr-amount { color: var(--success); }

/* -----------------------------------------------------------------------
   INSIGHTS / TELEMETRY PANEL
   ----------------------------------------------------------------------- */
.panel-title-v5 { font-size: 0.7rem; font-weight: 800; letter-spacing: 1.2px; margin: 0 0 14px; color: rgba(255,255,255,0.88); }
.metric-block-v5 { margin-bottom: 14px; }
.mb-label { display: block; font-size: 0.55rem; font-weight: 800; letter-spacing: 1px; color: var(--text-muted); opacity: 0.55; margin-bottom: 3px; text-transform: uppercase; }
.mb-val { display: block; font-size: 1rem; font-family: 'JetBrains Mono','Courier New',monospace; font-weight: 700; color: #fff; margin-bottom: 6px; letter-spacing: -0.3px; }
.mb-val.text-success { color: var(--success); }
.progress-bar-v5 { width: 100%; height: 2px; background: rgba(255,255,255,0.06); border-radius: 10px; overflow: hidden; }
.pb-fill { height: 100%; background: rgba(255,255,255,0.18); border-radius: 10px; transition: width 1s ease; }
.pb-fill.fill-success { background: var(--success); }
.telemetry-graph-v5 { margin-top: auto; padding-top: 12px; }
.telemetry-graph-v5 p { font-size: 0.55rem; font-weight: 800; letter-spacing: 1px; color: var(--text-muted); opacity: 0.4; text-align: center; margin-bottom: 8px; text-transform: uppercase; }
.tg-bars { display: flex; align-items: flex-end; justify-content: space-between; height: 38px; gap: 2px; }
.tg-bar { flex: 1; background: rgba(var(--accent-rgb),0.16); border-radius: 2px 2px 0 0; transition: background 0.18s; cursor: pointer; position: relative; }
.tg-bar:hover { background: var(--accent); }
.tg-bar:hover::after {
    content: attr(data-tooltip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.85); color: #fff; font-size: 0.53rem; padding: 2px 5px; border-radius: 4px;
    white-space: nowrap; pointer-events: none; z-index: 10;
}
.security-seal-v5 {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    padding-top: 12px; margin-top: 12px; border-top: 1px solid rgba(255,255,255,0.045);
    font-size: 0.56rem; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); opacity: 0.32;
}

/* Toast */
#cc-feedback-toast-v5 {
    position: fixed; bottom: -70px; left: 50%; transform: translateX(-50%);
    background: var(--bg-elevated); border: var(--border);
    padding: 10px 18px; border-radius: 50px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.45); z-index: 99999;
    transition: bottom 0.38s cubic-bezier(0.175,0.885,0.32,1.275);
    font-size: 0.78rem; font-weight: 600; white-space: nowrap;
}
#cc-feedback-toast-v5.show { bottom: 24px; }

/* =========================================================================
   COMPACT APP FOOTER — Authenticated Users
   ========================================================================= */

.app-footer-compact {
    width: 100%;
    background: var(--bg-deep);
    border-top: 1px solid rgba(255,255,255,0.045);
    padding: 0;
    margin-top: auto;
    flex-shrink: 0;
}

.afc-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 24px;
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
}

/* Left: brand + copyright */
.afc-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.afc-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: rgba(255,255,255,0.55);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    transition: color 0.2s;
}
.afc-brand:hover { color: #fff; }

.afc-logo {
    height: 18px;
    width: auto;
    object-fit: contain;
    opacity: 0.6;
    filter: brightness(0) invert(1);
}

.afc-divider {
    color: rgba(255,255,255,0.15);
    font-size: 0.7rem;
}

.afc-copy {
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.45;
    white-space: nowrap;
}

/* Center: compliance badges */
.afc-center {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

.afc-cert {
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    opacity: 0.3;
    padding: 2px 7px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 50px;
    white-space: nowrap;
}

/* Right: legal links */
.afc-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.afc-right a {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    opacity: 0.45;
    transition: opacity 0.18s, color 0.18s;
}
.afc-right a:hover { opacity: 1; color: #fff; }

@media (max-width: 700px) {
    .afc-inner { flex-direction: column; gap: 8px; padding: 10px 16px; text-align: center; }
    .afc-center { flex-wrap: wrap; justify-content: center; }
    .afc-right { gap: 10px; }
    .afc-copy { display: none; }
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 1024px) {
    .area-balance  { grid-column: span 12; height: 150px; }
    .area-stats    { grid-column: span 12; height: auto; grid-template-columns: repeat(4,1fr); grid-template-rows: 1fr; }
    .area-ledger   { grid-column: span 12; height: 290px; }
    .area-insights { grid-column: span 12; height: auto; }
    .area-actions-v5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
    .cc-top-bar { flex-direction: column; align-items: flex-start; }
    .universal-input-wrap { max-width: 100%; width: 100%; }
    .area-stats { grid-template-columns: repeat(2,1fr); grid-template-rows: 1fr 1fr; }
    .area-actions-v5 { grid-template-columns: repeat(2,1fr); }
    .lt-balance-v5 { font-size: 1.7rem; }
}
@media (max-width: 420px) {
    .area-actions-v5 { grid-template-columns: 1fr; }
}

/* =========================================================================
   FADE-IN
   ========================================================================= */
.fade-in { animation: elite-fade-in 0.4s cubic-bezier(0.16,1,0.3,1) both; }
@keyframes elite-fade-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

/* =========================================================================
   NOTIFICATION DROPDOWN v5
   ========================================================================= */
.notify-bell-container { position: relative; cursor: pointer; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; transition: 0.2s; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); color: rgba(255,255,255,0.6); }
.notify-bell-container:hover { background: rgba(255,255,255,0.08); color: #fff; }
.notify-dot-nav { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; border-radius: 50px; background: var(--accent); color: #000; font-size: 0.58rem; font-weight: 900; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg-deep); box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.4); }

.notify-dropdown-v5 { position: absolute; top: calc(100% + 12px); right: -10px; width: 320px; background: var(--bg-elevated) !important; border: var(--border); border-radius: 12px; box-shadow: 0 15px 50px rgba(0,0,0,0.6); display: none; flex-direction: column; z-index: 10000; overflow: hidden; pointer-events: all; }
.notify-dropdown-v5.show { display: flex; animation: udm-reveal 0.25s cubic-bezier(0.16,1,0.3,1); }

.nd-header { padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05); background: rgba(0,0,0,0.2); }
.nd-header span { font-size: 0.6rem; font-weight: 800; letter-spacing: 1.5px; color: var(--text-muted); }
.nd-header a { font-size: 0.6rem; font-weight: 700; color: var(--accent); text-decoration: none; opacity: 0.8; }
.nd-header a:hover { opacity: 1; text-decoration: underline; }

.nd-body { max-height: 380px; overflow-y: auto; scrollbar-width: none; }
.nd-body::-webkit-scrollbar { display: none; }
.nd-empty { padding: 30px 20px; text-align: center; font-size: 0.75rem; color: var(--text-muted); opacity: 0.6; }

.nd-item { display: flex; gap: 14px; padding: 14px 18px; text-decoration: none; color: inherit; border-bottom: 1px solid rgba(255,255,255,0.035); transition: 0.15s; }
.nd-item:hover { background: rgba(255,255,255,0.03); }
.nd-item.unread { background: rgba(var(--accent-rgb), 0.035); }
.ni-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; opacity: 0; }
.nd-item.unread .ni-dot { opacity: 1; box-shadow: 0 0 6px var(--accent); }

.ni-main { flex: 1; min-width: 0; }
.ni-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.ni-tag { font-size: 0.5rem; font-weight: 900; letter-spacing: 0.8px; color: var(--accent); background: rgba(var(--accent-rgb), 0.1); padding: 1px 5px; border-radius: 3px; }
.ni-time { font-size: 0.6rem; color: var(--text-muted); opacity: 0.6; }
.ni-title { font-size: 0.75rem; font-weight: 700; color: #fff; margin-bottom: 2px; }
.ni-msg { font-size: 0.68rem; color: rgba(255,255,255,0.4); line-height: 1.3; font-weight: 400; }

.nd-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,0.05); text-align: center; background: rgba(0,0,0,0.1); }
.nd-footer a { display: block; font-size: 0.58rem; font-weight: 800; letter-spacing: 1.2px; color: var(--text-muted); text-decoration: none; transition: 0.2s; }
.nd-footer a:hover { color: var(--accent); letter-spacing: 1.8px; }

@keyframes udm-reveal {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
