/* ============================================================
   Pacifica Whale Watcher — Matching Pacifica Trade UI
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- Pacifica Design Tokens ---- */
:root {
    /* Background layers — matches app.pacifica.fi */
    --bg-primary: #0a121c;
    --bg-secondary: #0c1520;
    --bg-tertiary: #1a263a;
    --bg-card: #111a28;
    --bg-card-hover: #162032;
    --bg-input: #0e1724;

    /* Borders — Pacifica uses very subtle borders */
    --border-primary: rgba(255, 255, 255, 0.08);
    --border-secondary: rgba(255, 255, 255, 0.04);

    /* Text — Pacifica palette */
    --text-primary: #ffffff;
    --text-secondary: #8898a8;
    --text-muted: #5c7080;
    --text-dim: #3d5060;

    /* Accents — exact Pacifica colors */
    --primary: #55c3e9;
    --primary-dim: rgba(85, 195, 233, 0.12);
    --primary-hover: #7edcfa;
    --green: #02c77b;
    --green-dim: rgba(2, 199, 123, 0.12);
    --green-bg: rgba(2, 199, 123, 0.08);
    --red: #eb365a;
    --red-dim: rgba(235, 54, 90, 0.12);
    --red-bg: rgba(235, 54, 90, 0.08);
    --amber: #f59e0b;
    --amber-dim: rgba(245, 158, 11, 0.12);
    --purple: #a78bfa;
    --purple-dim: rgba(167, 139, 250, 0.12);

    /* Legacy aliases for compatibility */
    --cyan: var(--primary);
    --cyan-dim: var(--primary-dim);
    --cyan-glow: rgba(85, 195, 233, 0.3);
    --magenta: var(--red);

    /* Shadows — minimal, Pacifica is flat */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-glow-cyan: none;
    --shadow-glow-magenta: none;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Inter', monospace;

    /* Sizing — compact like Pacifica */
    --header-height: 50px;
    --sidebar-width: 240px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* ===============================================
   HEADER — Pacifica style top bar
   =============================================== */
.header {
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: relative;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 20px;
}

.logo-text {
    color: var(--text-primary);
    font-weight: 700;
}

.logo-sub {
    font-size: 10px;
    font-weight: 500;
    color: var(--primary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-pill .label {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-pill .value {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 12px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Connection Status — Pacifica green dot style */
.ws-status {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ws-status.connected {
    color: var(--green);
}

.ws-status.connecting {
    color: var(--amber);
}

.ws-status.disconnected,
.ws-status.error {
    color: var(--red);
}

.ws-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.ws-status.connected .ws-dot {
    animation: pulse-dot 2s ease-in-out infinite;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 15px;
    transition: all 0.15s;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon.active {
    color: var(--primary);
}

/* ===============================================
   MAIN LAYOUT — Pacifica grid style
   =============================================== */
.main {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: 1fr;
    gap: 1px;
    height: calc(100vh - var(--header-height));
    background: var(--border-primary);
}

.panels-column {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
    background: var(--border-primary);
}

/* ===============================================
   SIDEBAR — Pacifica market selector
   =============================================== */
.sidebar {
    grid-row: 1 / 2;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s;
}

.search-input:focus {
    border-color: var(--primary);
}

.search-input::placeholder {
    color: var(--text-dim);
}

.market-list {
    flex: 1;
    overflow-y: auto;
    padding: 2px 0;
}

.market-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.1s;
    border-left: 2px solid transparent;
}

.market-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.market-item.active {
    background: rgba(85, 195, 233, 0.05);
    border-left-color: var(--primary);
}

.market-item .symbol {
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.market-item .price {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
}

.market-item .change {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-align: right;
    min-width: 50px;
    padding: 1px 5px;
    border-radius: 3px;
}

.market-item .change.positive {
    color: var(--green);
}

.market-item .change.negative {
    color: var(--red);
}

/* ===============================================
   PANEL BASE — Pacifica clean panels
   =============================================== */
.panel {
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-primary);
    min-height: 38px;
}

.panel-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.panel-title .icon {
    font-size: 13px;
}

.panel-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 8px;
    background: var(--primary-dim);
    color: var(--primary);
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
}

/* ===============================================
   TRADE FEED — Pacifica trade list style
   =============================================== */
.trade-entry {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 8px;
    align-items: center;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 1px;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.trade-entry:hover {
    background: rgba(255, 255, 255, 0.02);
}

.trade-entry.tier-whale {
    background: rgba(85, 195, 233, 0.04);
    border-color: rgba(85, 195, 233, 0.12);
}

.trade-entry.tier-mega {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.15);
}

.trade-entry.tier-large {
    background: rgba(167, 139, 250, 0.03);
    border-color: rgba(167, 139, 250, 0.08);
}

.trade-entry.liquidation {
    background: rgba(235, 54, 90, 0.04);
    border-color: rgba(235, 54, 90, 0.12);
}

.trade-symbol {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
    min-width: 50px;
}

.trade-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.trade-side {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.trade-side.bullish {
    color: var(--green);
}

.trade-side.bearish {
    color: var(--red);
}

.trade-meta {
    font-size: 10px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    gap: 4px;
}

.trade-value {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
    text-align: right;
}

.trade-value.bullish {
    color: var(--green);
}

.trade-value.bearish {
    color: var(--red);
}

.trade-time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    text-align: right;
    min-width: 50px;
}

.trade-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.badge-liquidation {
    background: var(--red-dim);
    color: var(--red);
}

.badge-backstop {
    background: var(--amber-dim);
    color: var(--amber);
}

.badge-settlement {
    background: var(--purple-dim);
    color: var(--purple);
}

.badge-whale {
    background: var(--primary-dim);
    color: var(--primary);
}

.badge-mega {
    background: var(--amber-dim);
    color: var(--amber);
}

/* ===============================================
   OI TRACKER
   =============================================== */
.oi-entry {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 6px;
    align-items: center;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 1px;
}

.oi-entry:hover {
    background: rgba(255, 255, 255, 0.02);
}

.oi-symbol {
    font-weight: 700;
    font-size: 12px;
    min-width: 48px;
}

.oi-bar-wrapper {
    height: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.oi-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.oi-bar.positive {
    background: var(--green);
    opacity: 0.6;
}

.oi-bar.negative {
    background: var(--red);
    opacity: 0.6;
    float: right;
}

.oi-value {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
    min-width: 65px;
}

.oi-change {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-align: right;
    min-width: 55px;
}

.oi-change.positive {
    color: var(--green);
}

.oi-change.negative {
    color: var(--red);
}

/* ===============================================
   ALERT LOG — card layout with type header
   =============================================== */
.alert-entry {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    border-left: 3px solid transparent;
    background: rgba(255, 255, 255, 0.015);
    transition: background 0.15s;
}

.alert-entry:hover {
    background: rgba(255, 255, 255, 0.03);
}

.alert-entry.whale_trade {
    border-left-color: var(--primary);
}

.alert-entry.liquidation {
    border-left-color: var(--red);
}

.alert-entry.oi_spike {
    border-left-color: var(--amber);
}

.alert-type-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
}

.alert-icon {
    font-size: 13px;
    flex-shrink: 0;
}

.alert-type-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 1px 5px;
    border-radius: 3px;
}

.alert-entry.whale_trade .alert-type-label {
    background: var(--primary-dim);
    color: var(--primary);
}

.alert-entry.liquidation .alert-type-label {
    background: var(--red-dim);
    color: var(--red);
}

.alert-entry.oi_spike .alert-type-label {
    background: var(--amber-dim);
    color: var(--amber);
}

.alert-message {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-word;
}

.alert-time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    margin-left: auto;
}

/* ===============================================
   FLOW PANEL
   =============================================== */
.flow-entry {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 6px;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 1px;
}

.flow-entry:hover {
    background: rgba(255, 255, 255, 0.02);
}

.flow-symbol {
    font-weight: 700;
    font-size: 12px;
}

.flow-bar-wrapper {
    display: flex;
    height: 14px;
    border-radius: 2px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

.flow-bar-long {
    height: 100%;
    background: var(--green);
    opacity: 0.7;
    transition: width 0.5s ease;
}

.flow-bar-short {
    height: 100%;
    background: var(--red);
    opacity: 0.7;
    transition: width 0.5s ease;
}

.flow-net {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

.flow-net.positive {
    color: var(--green);
}

.flow-net.negative {
    color: var(--red);
}

/* ===============================================
   SETTINGS MODAL — Pacifica style
   =============================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 20px;
    width: 360px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
}

.modal h2 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.modal-field {
    margin-bottom: 10px;
}

.modal-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.modal-field input {
    width: 100%;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    outline: none;
}

.modal-field input:focus {
    border-color: var(--primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
    color: var(--text-primary);
}

/* ===============================================
   EMPTY STATE
   =============================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-dim);
    gap: 6px;
    padding: 20px;
    text-align: center;
}

.empty-state .icon {
    font-size: 28px;
    opacity: 0.4;
}

.empty-state .text {
    font-size: 12px;
    font-weight: 500;
}

/* ===============================================
   TAB BAR — Pacifica underline style
   =============================================== */
.tab-bar {
    display: flex;
    gap: 0;
}

.tab-btn {
    padding: 6px 14px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary); /* Increased from text-dim */
    background: transparent;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--primary-dim);
}

/* ===============================================
   FILTER BAR
   =============================================== */
.filter-bar {
    display: flex;
    gap: 3px;
}

.filter-btn {
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted); /* Increased from text-dim */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-secondary);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--primary);
    color: var(--bg-primary);
    border-color: var(--primary);
    font-weight: 800;
    box-shadow: 0 0 12px rgba(85, 195, 233, 0.4);
}

/* ===============================================
   ANIMATIONS — subtle, Pacifica style
   =============================================== */
@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

@keyframes whale-glow {
    0% {
        border-color: rgba(85, 195, 233, 0.3);
    }

    100% {
        border-color: rgba(85, 195, 233, 0.1);
    }
}

@keyframes mega-glow {
    0% {
        border-color: rgba(245, 158, 11, 0.3);
    }

    100% {
        border-color: rgba(245, 158, 11, 0.1);
    }
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(-6px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fade-in-up 0.2s ease-out;
}

/* ===============================================
   RESPONSIVE
   =============================================== */
@media (max-width: 1200px) {
    .main {
        grid-template-columns: 200px 1fr 1fr;
    }

    :root {
        --sidebar-width: 200px;
    }
}

@media (max-width: 900px) {
    .main {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .sidebar {
        grid-row: auto;
        max-height: 180px;
    }

    .header-center {
        display: none;
    }
}

/* ===============================================
   BRANDING
   =============================================== */
.powered-by {
    padding: 6px 12px;
    border-top: 1px solid var(--border-primary);
    font-size: 10px;
    color: var(--text-dim);
    text-align: center;
}

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

.powered-by a:hover {
    text-decoration: underline;
}

/* ===============================================
   TIER INDICATORS
   =============================================== */
.tier-indicator {
    width: 3px;
    border-radius: 2px;
    align-self: stretch;
    flex-shrink: 0;
}

.tier-indicator.medium {
    background: var(--text-dim);
}

.tier-indicator.large {
    background: var(--purple);
}

.tier-indicator.whale {
    background: var(--primary);
}

.tier-indicator.mega {
    background: var(--amber);
}

/* ============================================================
   VIEW TABS — Pacifica navigation tab style
   ============================================================ */

.view-tabs {
    display: flex;
    gap: 0;
    margin-left: 16px;
}

.view-tab {
    padding: 0 16px;
    height: var(--header-height);
    font-size: 13px;
    font-weight: 600; /* Increased from 500 */
    color: var(--text-secondary); /* Increased from text-muted */
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.view-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.view-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary);
    background: linear-gradient(to bottom, transparent, rgba(85, 195, 233, 0.05));
    text-shadow: 0 0 10px rgba(85, 195, 233, 0.3);
}

.view-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    right: 15%;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    border-radius: 2px 2px 0 0;
}

.view-content {
    display: none;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

.view-content.active {
    display: grid;
}

#view-heatmap.active,
#view-funding.active,
#view-smartmoney.active {
    display: flex;
    flex-direction: column;
}

/* ============================================================
   HEATMAP VIEW
   ============================================================ */

.heatmap-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-primary);
}

.heatmap-toolbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.heatmap-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--text-muted);
}

.legend-bar {
    width: 100px;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg,
            var(--red) 0%,
            #1a263a 50%,
            var(--green) 100%);
}

.legend-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 9px;
}

.heatmap-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 4px;
    padding: 8px;
    overflow-y: auto;
    align-content: start;
}

.heatmap-cell {
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.04);
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.heatmap-cell:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.heatmap-cell .cell-symbol {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.heatmap-cell .cell-price {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    margin-top: 2px;
    opacity: 0.8;
}

.heatmap-cell .cell-metric {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    margin-top: 6px;
}

.heatmap-cell .cell-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.6;
    margin-top: 1px;
}

.heatmap-cell .cell-sub {
    font-size: 10px;
    font-family: var(--font-mono);
    opacity: 0.5;
    margin-top: 2px;
}

/* ============================================================
   FUNDING RATE VIEW
   ============================================================ */

.funding-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-primary);
}

.funding-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.funding-grid {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.funding-table {
    width: 100%;
    border-collapse: collapse;
}

.funding-table th {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    padding: 8px 12px;
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-primary);
    z-index: 5;
}

.funding-table th.right {
    text-align: right;
}

.funding-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-secondary);
    font-size: 12px;
    vertical-align: middle;
}

.funding-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.funding-symbol {
    font-weight: 700;
    letter-spacing: 0.3px;
    font-size: 13px;
}

.funding-rate {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
    text-align: right;
}

.funding-rate.positive {
    color: var(--green);
}

.funding-rate.negative {
    color: var(--red);
}

.funding-annualized {
    font-family: var(--font-mono);
    font-size: 12px;
    text-align: right;
    color: var(--text-secondary);
}

.funding-annualized.extreme-positive {
    color: var(--green);
    font-weight: 700;
}

.funding-annualized.extreme-negative {
    color: var(--red);
    font-weight: 700;
}

.funding-bar-cell {
    width: 180px;
}

.funding-bar-wrapper {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.funding-bar-center {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--text-dim);
}

.funding-bar {
    height: 100%;
    position: absolute;
    top: 0;
    border-radius: 6px;
    transition: all 0.5s ease;
}

.funding-bar.positive {
    left: 50%;
    background: var(--green);
    opacity: 0.6;
}

.funding-bar.negative {
    right: 50%;
    background: var(--red);
    opacity: 0.6;
}

.funding-squeeze-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 4px;
}

.squeeze-long {
    background: var(--red-dim);
    color: var(--red);
}

.squeeze-short {
    background: var(--green-dim);
    color: var(--green);
}

.funding-next {
    font-family: var(--font-mono);
    font-size: 11px;
    text-align: right;
    color: var(--text-muted);
}

.funding-next .arrow-up {
    color: var(--green);
}

.funding-next .arrow-down {
    color: var(--red);
}

/* ============================================================
   SMART MONEY SCORE VIEW
   ============================================================ */

.sm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-primary);
}

.sm-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.sm-description {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-primary);
}

.sm-description p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.sm-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 6px;
    padding: 8px;
    overflow-y: auto;
    align-content: start;
}

.sm-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: all 0.2s;
}

.sm-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.sm-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.sm-card-symbol {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.sm-score-badge {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    min-width: 55px;
    text-align: center;
}

.sm-score-badge.strong-bull {
    background: var(--green-dim);
    color: var(--green);
}

.sm-score-badge.bull {
    background: var(--green-bg);
    color: var(--green);
}

.sm-score-badge.neutral {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.sm-score-badge.bear {
    background: var(--red-bg);
    color: var(--red);
}

.sm-score-badge.strong-bear {
    background: var(--red-dim);
    color: var(--red);
}

.sm-signal-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 2px;
    text-align: center;
}

.sm-components {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.sm-component {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
}

.sm-component-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-dim);
    margin-bottom: 2px;
}

.sm-component-value {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
}

.sm-component-value.positive {
    color: var(--green);
}

.sm-component-value.negative {
    color: var(--red);
}

.sm-component-value.neutral {
    color: var(--text-muted);
}

.sm-gauge {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
    position: relative;
}

.sm-gauge-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
    position: absolute;
}

.sm-gauge-fill.bullish {
    left: 50%;
    background: var(--green);
    opacity: 0.7;
}

.sm-gauge-fill.bearish {
    right: 50%;
    background: var(--red);
    opacity: 0.7;
}

.sm-gauge-center {
    position: absolute;
    left: 50%;
    top: -1px;
    bottom: -1px;
    width: 2px;
    background: var(--text-dim);
    border-radius: 1px;
}
/* ===============================================
   WALLET TRACKER — Pacifica style wallet view
   =============================================== */
#view-wallet {
    padding: 24px;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    background: var(--bg-primary);
    display: none;
    flex-direction: column;
    gap: 24px;
}

#view-wallet.active {
    display: flex;
}

.wallet-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.wallet-input-group {
    display: flex;
    gap: 8px;
    flex: 1;
    max-width: 600px;
}

.wallet-input-group input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.wallet-input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-dim);
}

.tracked-wallet-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
}

.wallet-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.wallet-address {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
}

.wallet-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.wallet-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wallet-stat-card .label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.wallet-stat-card .value {
    font-size: 24px;
    font-weight: 800;
    font-family: var(--font-mono);
}

.wallet-panels {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
    flex: 1;
}

@media (max-width: 1200px) {
    .wallet-panels {
        grid-template-columns: 1fr;
    }
}

.empty-state-large {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.icon-large {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state-large h2 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.empty-state-large p {
    max-width: 400px;
    line-height: 1.6;
}

/* Button styles */
.btn {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}
