/* ================================================================
   Drawer + Tabs — глобальные dark-mode override'ы.
   Без ::deep, потому что DevExpress портит DxDrawer-панели в body
   и scoped CSS из Drawer.razor.css до них не дотягивается.
   ================================================================ */

/* ── Drawer panel (и левый, и правый) ───────────────────────── */
html.app-dark .dxbl-drawer .dxbl-drawer-panel,
html.app-dark .dxbl-drawer-panel {
    background-image: linear-gradient(180deg, #161b22 0%, #0d1117 100%) !important;
    color: #c9d1d9;
    border-right: 1px solid #21262d;
    border-left:  1px solid #21262d;
}

/* В light-теме: левый drawer (навигация) — сине-чёрный градиент и белый текст.
   Глобально (без ::deep): DevExpress рендерит панель в body, scoped CSS не дотягивается. */
.dxbl-drawer .dxbl-drawer-panel {
    background-image: linear-gradient(180deg, #14306e 0%, #0a0f1c 100%);
    color: #ffffff;
}
/* Правый drawer (баланс/курсы) — оставляем фиолетовый градиент как был
   (правит более конкретное правило ниже по источнику). */
.dxbl-drawer-panel.dxbl-drawer-position-right {
    background-image: linear-gradient(180deg, #3b2a6e 0%, #1a1035 100%);
    color: rgba(220, 210, 255, 0.92);
}

/* Навигационное меню левого drawer в light-теме — белый читаемый текст.
   html:not(.app-dark) — чтобы не трогать тёмную тему. */
html:not(.app-dark) .dxbl-drawer .dxbl-menu .dxbl-btn,
html:not(.app-dark) .dxbl-drawer .dxbl-menu .dxbl-btn span,
html:not(.app-dark) .dxbl-drawer .dxbl-menu .dxbl-menu-item-text {
    color: #ffffff !important;
}
html:not(.app-dark) .dxbl-drawer .dxbl-menu .dxbl-btn .dxbl-image,
html:not(.app-dark) .dxbl-drawer .dxbl-menu .dxbl-btn i {
    color: rgba(255, 255, 255, 0.85) !important;
}
html:not(.app-dark) .dxbl-drawer .dxbl-menu .dxbl-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}
html:not(.app-dark) .dxbl-drawer .dxbl-menu .dxbl-state-active .dxbl-btn,
html:not(.app-dark) .dxbl-drawer .dxbl-menu .dxbl-state-active .dxbl-btn span {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.16) !important;
}

/* Balance-panel содержимое — светлый текст */
.balance-panel,
.balance-card,
.balance-row { color: rgba(220, 210, 255, 0.92); }
.balance-amount { color: #ffffff; font-size: 1.5rem; font-weight: 700; }
.balance-currency { color: rgba(220, 210, 255, 0.75); font-size: 0.85rem; margin-left: 4px; }
.balance-row { font-size: 0.85rem; }
.balance-panel .text-muted { color: rgba(220, 210, 255, 0.55) !important; }
.balance-row .text-success { color: #4ade80 !important; }
.balance-row .text-danger  { color: #f87171 !important; }
.balance-row .text-warning { color: #fbbf24 !important; }
.wallet-addr { color: rgba(220, 210, 255, 0.75); }

/* Кнопка «Обновить» в balance-panel — поверх тёмной панели */
.balance-card .btn-outline-secondary {
    background: transparent;
    border-color: rgba(255,255,255,0.25);
    color: rgba(220, 210, 255, 0.92);
}
.balance-card .btn-outline-secondary:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.35);
    color: #ffffff;
}

html.app-dark .balance-panel,
html.app-dark .balance-card,
html.app-dark .balance-row { color: #c9d1d9; }
html.app-dark .balance-amount { color: #e6edf3; }
html.app-dark .balance-currency { color: #8b949e; }
html.app-dark .balance-panel .text-muted { color: #8b949e !important; }
html.app-dark .balance-card .btn-outline-secondary {
    border-color: #30363d;
    color: #c9d1d9;
}
html.app-dark .balance-card .btn-outline-secondary:hover {
    background: rgba(255,255,255,0.06);
    border-color: #484f58;
    color: #e6edf3;
}

/* ── DxTabs (Вход / Выход на дашборде) — dark mode ──────────── */
html.app-dark .dxbl-tabs {
    background-color: transparent;
}
html.app-dark .dxbl-tabs .dxbl-tabs-content {
    background-color: transparent;
}
html.app-dark .dxbl-tab,
html.app-dark .dxbl-tabs .dxbl-tab {
    background-color: transparent !important;
    color: #8b949e !important;
    border-color: transparent !important;
}
html.app-dark .dxbl-tab:hover,
html.app-dark .dxbl-tabs .dxbl-tab:hover {
    color: #c9d1d9 !important;
    background-color: rgba(255,255,255,0.04) !important;
}
html.app-dark .dxbl-tab.dxbl-active,
html.app-dark .dxbl-tabs .dxbl-tab.dxbl-active,
html.app-dark .dxbl-tab.dxbl-state-active {
    color: #e6edf3 !important;
    background-color: #161b22 !important;
    border-color: #30363d !important;
    border-bottom-color: #161b22 !important;
}

/* Картa под табами на дашборде */
html.app-dark .card,
html.app-dark .tabs-border-top-0 {
    background-color: #161b22 !important;
    border-color: #30363d !important;
    color: #c9d1d9;
}
html.app-dark .card-body { background-color: #161b22; color: #c9d1d9; }
html.app-dark .card-header,
html.app-dark .card-footer {
    background-color: #161b22 !important;
    border-color: #30363d !important;
    color: #c9d1d9;
}

/* DxTabs panel bar — закрываем подложку, которая остаётся белой */
html.app-dark .dxbl-tabs-panel,
html.app-dark .dxbl-tabs-container,
html.app-dark .dxbl-tabs-header,
html.app-dark .dxbl-tabs-headers,
html.app-dark .dxbl-tab-container,
html.app-dark .dxbl-tabs-content-container {
    background-color: transparent !important;
    border-color: #30363d !important;
}

/* Bootstrap-классы, которые часто оставляют белый фон в dark theme */
html.app-dark .bg-white,
html.app-dark .bg-light { background-color: #161b22 !important; color: #c9d1d9; }

html.app-dark .btn-outline-secondary {
    background-color: transparent;
    border-color: #30363d;
    color: #c9d1d9;
}
html.app-dark .btn-outline-secondary:hover {
    background-color: rgba(255,255,255,0.06);
    border-color: #484f58;
    color: #e6edf3;
}
html.app-dark .btn-outline-primary {
    background-color: transparent;
    border-color: #1f6feb;
    color: #58a6ff;
}
html.app-dark .btn-outline-primary:hover {
    background-color: #1f6feb;
    color: #ffffff;
}

/* «Личный кабинет» — табличные строки/labels */
html.app-dark .form-control,
html.app-dark .form-select {
    background-color: #0d1117 !important;
    border-color: #30363d !important;
    color: #c9d1d9 !important;
}
html.app-dark .form-control:focus,
html.app-dark .form-select:focus {
    border-color: #58a6ff !important;
    box-shadow: 0 0 0 3px rgba(88,166,255,0.12) !important;
}

/* Inputs/labels на «Личный кабинет» */
html.app-dark label,
html.app-dark .form-label,
html.app-dark .text-body { color: #c9d1d9; }

/* Контрольный фон страницы — если что-то нарисовалось белой плашкой
   и тащит вверх .bg-body-tertiary / .bg-secondary-subtle */
html.app-dark .bg-body-tertiary,
html.app-dark .bg-secondary-subtle,
html.app-dark .bg-light-subtle {
    background-color: #161b22 !important;
    color: #c9d1d9;
}
