:root {
    --mf-shell-bg: #07101f;
    --mf-shell-bg-soft: rgba(10, 20, 38, 0.78);
    --mf-shell-card: rgba(15, 28, 49, 0.72);
    --mf-shell-border: rgba(154, 210, 255, 0.16);
    --mf-shell-border-strong: rgba(154, 210, 255, 0.28);
    --mf-shell-text: #edf6ff;
    --mf-shell-muted: #9ab7d2;
    --mf-shell-accent: #8fdcff;
    --mf-shell-accent-strong: #4fc3ff;
    --mf-shell-shadow: 0 18px 42px rgba(3, 10, 22, 0.38);
}

body {
    background:
        radial-gradient(circle at top left, rgba(79, 195, 255, 0.14), transparent 32%),
        radial-gradient(circle at top right, rgba(113, 200, 255, 0.10), transparent 28%),
        linear-gradient(180deg, #07101f 0%, #091426 52%, #07101f 100%);
    color: var(--mf-shell-text);
}

.dashboard-shell {
    position: relative;
}

.dashboard-topbar.navbar {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.dashboard-header-shell,
.dashboard-surface-shell,
.nav-tabs-ecosystem.nav,
#dashboard-tab-panel {
    background: var(--mf-shell-card);
    border: 1px solid var(--mf-shell-border);
    border-radius: 24px;
    box-shadow: var(--mf-shell-shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.dashboard-shell .glass-card,
.dashboard-shell .card.bg-black,
.dashboard-shell .card.bg-dark,
.dashboard-shell .card[class*="bg-opacity"],
.dashboard-shell .card {
    background: linear-gradient(180deg, rgba(13, 25, 44, 0.92), rgba(9, 18, 34, 0.88)) !important;
    border: 1px solid var(--mf-shell-border) !important;
    border-radius: 20px !important;
    box-shadow: 0 18px 34px rgba(3, 10, 22, 0.24) !important;
    color: var(--mf-shell-text) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.dashboard-shell .glass-card::before,
.dashboard-shell .card::before {
    display: none !important;
}

.dashboard-shell .card-body,
.dashboard-shell .card-header,
.dashboard-shell .card-footer {
    background: transparent !important;
    color: var(--mf-shell-text) !important;
}

.dashboard-shell .text-muted,
.dashboard-shell small.text-muted,
.dashboard-shell .small.text-muted,
.dashboard-shell .text-secondary {
    color: var(--mf-shell-muted) !important;
}

.dashboard-shell .text-light,
.dashboard-shell .text-white,
.dashboard-shell .fw-bold,
.dashboard-shell .fw-semibold {
    color: var(--mf-shell-text) !important;
}

.dashboard-shell .text-info {
    color: var(--mf-shell-accent) !important;
}

.dashboard-shell .table,
.dashboard-shell .table td,
.dashboard-shell .table th {
    color: var(--mf-shell-text) !important;
    border-color: rgba(154, 210, 255, 0.10) !important;
}

.dashboard-shell .table thead th {
    background: rgba(10, 20, 38, 0.84) !important;
    color: var(--mf-shell-muted) !important;
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dashboard-shell .table tbody tr:hover {
    background: rgba(79, 195, 255, 0.06) !important;
}

.dashboard-shell .dash-table-container .dash-spreadsheet-container,
.dashboard-shell .dash-table-container .dash-spreadsheet-inner {
    border-radius: 18px !important;
    overflow: hidden;
}

.dashboard-shell .dash-table-container .dash-header,
.dashboard-shell .dash-table-container th {
    background: rgba(10, 20, 38, 0.84) !important;
    color: var(--mf-shell-muted) !important;
    border-color: rgba(154, 210, 255, 0.10) !important;
}

.dashboard-shell .dash-table-container td {
    background: rgba(9, 18, 34, 0.76) !important;
    color: var(--mf-shell-text) !important;
    border-color: rgba(154, 210, 255, 0.08) !important;
}

.dashboard-shell .btn-outline-light,
.dashboard-shell .btn-outline-secondary,
.dashboard-shell .btn-dark,
.dashboard-shell .btn-secondary {
    border-color: var(--mf-shell-border) !important;
    color: var(--mf-shell-text) !important;
    background: rgba(9, 18, 34, 0.72) !important;
}

.dashboard-shell .btn-outline-light:hover,
.dashboard-shell .btn-outline-secondary:hover,
.dashboard-shell .btn-dark:hover,
.dashboard-shell .btn-secondary:hover {
    border-color: var(--mf-shell-border-strong) !important;
    color: var(--mf-shell-accent) !important;
}

.dashboard-header-shell {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 18px 22px;
}

.dashboard-header-main,
.dashboard-header-side,
.dashboard-brand-block,
.dashboard-status-cluster,
.dashboard-header-actions-left,
.dashboard-header-actions-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dashboard-header-main {
    flex: 1 1 auto;
    justify-content: space-between;
    min-width: 0;
}

.dashboard-header-side {
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #04111f;
    background: linear-gradient(135deg, #b8ebff 0%, #74d4ff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 12px 24px rgba(79, 195, 255, 0.20);
}

.dashboard-brand-copy {
    min-width: 0;
}

.dashboard-brand-title {
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--mf-shell-text);
}

.dashboard-brand-subtitle {
    font-size: 0.86rem;
    color: var(--mf-shell-muted);
    max-width: 640px;
}

.dashboard-live-pill,
.dashboard-header-chip,
.dashboard-version-badge {
    border-radius: 999px !important;
    border: 1px solid var(--mf-shell-border) !important;
    background: rgba(9, 18, 34, 0.72) !important;
    color: var(--mf-shell-text) !important;
    padding: 0.42rem 0.78rem !important;
    box-shadow: none !important;
}

.dashboard-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dashboard-live-dot {
    color: #6fe3a2;
    font-size: 1rem;
    line-height: 1;
}

.dashboard-live-label {
    color: #6fe3a2;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.dashboard-streams-status {
    color: var(--mf-shell-muted);
    font-size: 0.76rem;
}

.dashboard-header-time {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--mf-shell-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.dashboard-header-chip {
    text-decoration: none;
    font-size: 0.75rem;
}

.dashboard-header-chip:hover,
.dashboard-surface-link:hover {
    color: var(--mf-shell-accent) !important;
    border-color: var(--mf-shell-border-strong) !important;
}

.dashboard-header-btn.btn {
    color: var(--mf-shell-text) !important;
}

.dashboard-version-badge {
    color: var(--mf-shell-accent) !important;
    font-weight: 700;
}

.dashboard-surface-wrap {
    margin: 0 0 16px;
}

.dashboard-surface-shell {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 18px 22px;
}

.dashboard-surface-kicker {
    color: var(--mf-shell-accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.dashboard-surface-title {
    font-size: clamp(1.15rem, 2vw, 1.7rem);
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--mf-shell-text);
}

.dashboard-surface-copy {
    margin: 0;
    color: var(--mf-shell-muted);
    max-width: 780px;
}

.dashboard-surface-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.dashboard-surface-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--mf-shell-border);
    color: var(--mf-shell-text);
    text-decoration: none;
    background: rgba(9, 18, 34, 0.72);
}

.dashboard-surface-link.primary {
    background: linear-gradient(135deg, #a4e6ff 0%, #73d1ff 100%);
    color: #06111f;
    border-color: transparent;
    font-weight: 700;
}

.nav-tabs-ecosystem.nav {
    gap: 8px;
    padding: 10px;
    margin-bottom: 16px !important;
}

.nav-tabs-ecosystem .nav-item {
    margin: 0;
}

.nav-tabs-ecosystem .nav-link {
    border-radius: 16px !important;
    border: 1px solid transparent !important;
    color: var(--mf-shell-muted) !important;
    background: transparent !important;
    font-weight: 600;
    padding: 10px 16px !important;
}

.nav-tabs-ecosystem .nav-link.active,
.nav-tabs-ecosystem .nav-link:hover {
    color: var(--mf-shell-text) !important;
    background: rgba(13, 25, 44, 0.82) !important;
    border-color: var(--mf-shell-border-strong) !important;
}

#dashboard-tab-panel {
    padding: 8px 8px 18px;
}

#cookie-consent-banner {
    background: rgba(10, 20, 38, 0.96) !important;
    border: 1px solid var(--mf-shell-border) !important;
    border-radius: 20px !important;
    box-shadow: var(--mf-shell-shadow) !important;
}

#disclaimer-banner {
    background: rgba(7, 13, 24, 0.92) !important;
    border-top: 1px solid var(--mf-shell-border) !important;
    color: var(--mf-shell-muted) !important;
    backdrop-filter: blur(14px);
}

.trading-live-shell .glass-card {
    min-height: 100%;
}

.trading-live-card {
    border-radius: 24px !important;
    overflow: hidden;
}

.trading-live-card .progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}

.trading-live-grid {
    align-items: stretch;
}

.trading-live-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.trading-live-meta-cell {
    min-width: 0;
}

.trading-live-meta-label {
    color: var(--mf-shell-muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.trading-live-meta-value {
    color: var(--mf-shell-text);
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 2px;
    word-break: break-word;
}

.trading-live-feed-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 680px;
    overflow: auto;
}

.trading-live-feed-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.trading-live-feed-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.bot-monitor-card {
    border-color: rgba(143, 220, 255, 0.26) !important;
}

.bot-monitor-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.bot-monitor-badges {
    flex: 0 0 auto;
}

.bot-monitor-metric {
    min-height: 86px;
    padding: 13px 14px;
    border: 1px solid rgba(154, 210, 255, 0.12);
    border-radius: 18px;
    background: rgba(6, 14, 27, 0.46);
}

.bot-monitor-metric-label {
    color: var(--mf-shell-muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bot-monitor-metric-value {
    margin-top: 6px;
    font-size: 1.45rem;
    font-weight: 850;
    line-height: 1;
}

.bot-monitor-panel {
    height: 100%;
    padding: 14px;
    border: 1px solid rgba(154, 210, 255, 0.12);
    border-radius: 18px;
    background: rgba(6, 14, 27, 0.38);
}

.bot-monitor-section-title {
    margin-bottom: 10px;
    color: var(--mf-shell-accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bot-monitor-row {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bot-monitor-row:last-child {
    border-bottom: 0;
}

@media (max-width: 980px) {
    .dashboard-header-shell,
    .dashboard-surface-shell {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-header-main,
    .dashboard-header-side,
    .dashboard-status-cluster,
    .dashboard-surface-links {
        width: 100%;
    }

    .dashboard-header-main,
    .dashboard-header-side {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-surface-links {
        justify-content: flex-start;
    }

    .trading-live-meta {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .trading-live-feed-card {
        max-height: none;
    }

    .bot-monitor-head {
        flex-direction: column;
    }
}
