/* ============================================================
   WiseOwl Trades — Professional Dark Theme
   Single source of truth for the full application dark palette
   ============================================================ */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
    /* Backgrounds */
    --wot-bg:           #141414;
    --wot-bg-raised:    #1a1f3a;
    --wot-bg-card:      #1c2347;
    --wot-bg-elevated:  #222b52;
    --wot-bg-hover:     #2a3460;
    --wot-bg-input:     #1e2545;

    /* Borders */
    --wot-border:       #2a2d3e;
    --wot-border-light: #363a52;

    /* Text */
    --wot-text:         #e8ecf0;
    --wot-text-sub:     #9aa5b4;
    --wot-text-muted:   #5c6578;

    /* Accent – purple gradient */
    --wot-accent:       #1c285b;
    --wot-accent-end:   #141414;
    --wot-accent-glow:  rgba(28,40,91,0.35);
    --wot-grad:         linear-gradient(135deg, #1c285b 0%, #141414 100%);

    /* Status */
    --wot-green:        #10b981;
    --wot-green-bg:     rgba(16,185,129,0.12);
    --wot-red:          #f43f5e;
    --wot-red-bg:       rgba(244,63,94,0.12);
    --wot-amber:        #f59e0b;
    --wot-amber-bg:     rgba(245,158,11,0.12);
    --wot-blue:         #3b82f6;
    --wot-blue-bg:      rgba(59,130,246,0.12);

    /* Shadows */
    --wot-shadow-sm:    0 2px 8px rgba(0,0,0,0.6);
    --wot-shadow:       0 8px 24px rgba(0,0,0,0.7);
    --wot-shadow-lg:    0 20px 50px rgba(0,0,0,0.8);

    /* Transitions */
    --wot-transition:   all 0.25s cubic-bezier(.4,0,.2,1);
}

/* ── Global Reset ───────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, #1c285b 0%, #141414 100%) fixed !important;
    color: var(--wot-text) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    color: var(--wot-text) !important;
    font-weight: 600;
}

p, li, dt, dd, span:not(.badge):not(.navbar-toggler-icon):not(.input-group-text) {
    color: var(--wot-text-sub);
}

label {
    color: var(--wot-text-sub) !important;
    font-weight: 500;
}

a {
    color: #a78bfa;
    transition: var(--wot-transition);
}

a:hover {
    color: #c4b5fd;
    text-decoration: none;
}

small, .text-muted {
    color: var(--wot-text-muted) !important;
}

hr {
    border: none;
    border-top: 1px solid var(--wot-border) !important;
    margin: 24px 0;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--wot-bg); }
::-webkit-scrollbar-thumb { background: var(--wot-border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--wot-accent); }

/* ── Page Container ─────────────────────────────────────────── */
.body-content {
    background-color: var(--wot-bg);
    padding-top: 0;
    min-height: calc(100vh - 70px);
}

.container,
.container-fluid {
    background-color: transparent !important;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background-color: var(--wot-bg-card) !important;
    border: 1px solid var(--wot-border) !important;
    border-radius: 14px !important;
    box-shadow: var(--wot-shadow) !important;
    color: var(--wot-text) !important;
    transition: var(--wot-transition);
}

.card:hover {
    border-color: var(--wot-border-light) !important;
    box-shadow: var(--wot-shadow-lg) !important;
    transform: translateY(-2px);
}

.card-header {
    background-color: var(--wot-bg-elevated) !important;
    border-bottom: 1px solid var(--wot-border) !important;
    color: var(--wot-text) !important;
    border-radius: 14px 14px 0 0 !important;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
    color: var(--wot-text) !important;
}

.card-body {
    background-color: transparent !important;
    color: var(--wot-text) !important;
}

.card-footer {
    background-color: var(--wot-bg-elevated) !important;
    border-top: 1px solid var(--wot-border) !important;
    border-radius: 0 0 14px 14px !important;
}

/* white bg card variants */
.card.bg-white,
.card.bg-light,
.scanner-card,
.rules-card,
.config-card,
.oi-analysis-card {
    background-color: var(--wot-bg-card) !important;
    border-color: var(--wot-border) !important;
    color: var(--wot-text) !important;
}

.card.bg-light h4,
.card.bg-light h5,
.card.bg-light h6,
.card.bg-light p,
.card.bg-light span {
    color: var(--wot-text) !important;
}

/* ── Page Header Card (strategy page) ──────────────────────── */
.page-header-card {
    background: var(--wot-bg-elevated) !important;
    border: 1px solid var(--wot-border) !important;
    box-shadow: var(--wot-shadow) !important;
    color: var(--wot-text) !important;
}

.page-header-card:hover {
    border-color: var(--wot-accent) !important;
}

/* ── Strategy Page Container ────────────────────────────────── */
.strategy-page.container-fluid {
    background: var(--wot-bg) !important;
}

/* ── Panels (Bootstrap 3) ───────────────────────────────────── */
.panel {
    background-color: var(--wot-bg-card) !important;
    border-color: var(--wot-border) !important;
    border-radius: 12px !important;
}

.panel-heading,
.panel-default > .panel-heading {
    background-color: var(--wot-bg-elevated) !important;
    border-color: var(--wot-border) !important;
    color: var(--wot-text) !important;
    border-radius: 12px 12px 0 0 !important;
}

.panel-body {
    color: var(--wot-text) !important;
}

.panel-footer {
    background-color: var(--wot-bg-elevated) !important;
    border-color: var(--wot-border) !important;
}

/* ── Wells ──────────────────────────────────────────────────── */
.well {
    background-color: var(--wot-bg-elevated) !important;
    border-color: var(--wot-border) !important;
    color: var(--wot-text) !important;
    box-shadow: none !important;
}

/* ── Tables ─────────────────────────────────────────────────── */
/* Override Bootstrap's --bs-table-bg variable so td cells inherit dark bg */
.table {
    --bs-table-bg: #16171f;
    --bs-table-accent-bg: transparent;
    --bs-table-striped-bg: #111219;
    --bs-table-hover-bg: #22253a;
    --bs-table-color: #e8ecf0;
    color: var(--wot-text) !important;
    border-color: var(--wot-border) !important;
    border-radius: 12px;
    overflow: hidden;
}

/* Explicitly dark all td/th so Bootstrap can't re-apply white via variable */
.table td,
.table th {
    background-color: var(--wot-bg-card) !important;
    color: var(--wot-text) !important;
    border-color: var(--wot-border) !important;
}

.table thead th {
    background: var(--wot-bg-elevated) !important;
    color: var(--wot-text) !important;
    border-color: var(--wot-border) !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
    padding: 14px 12px;
}

.table tbody tr {
    background-color: var(--wot-bg-card) !important;
    transition: var(--wot-transition);
}

.table tbody tr:hover {
    background-color: var(--wot-bg-hover) !important;
    transform: none;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--wot-bg-raised) !important;
}

.table-striped tbody tr:nth-of-type(odd) td,
.table-striped tbody tr:nth-of-type(odd) th {
    background-color: var(--wot-bg-raised) !important;
}

.table-bordered {
    border-color: var(--wot-border) !important;
}

.table-hover tbody tr:hover {
    background-color: var(--wot-bg-hover) !important;
}

.table-hover tbody tr:hover td,
.table-hover tbody tr:hover th {
    background-color: var(--wot-bg-hover) !important;
}

.thead-dark th {
    background: var(--wot-bg-elevated) !important;
    color: var(--wot-text) !important;
    border-color: var(--wot-border) !important;
}

.table-responsive {
    border-radius: 12px;
    border: 1px solid var(--wot-border);
}

.table-responsive::-webkit-scrollbar-track { background: var(--wot-bg-raised); }

/* ── Forms ──────────────────────────────────────────────────── */
.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="tel"],
input[type="url"],
textarea,
select {
    background-color: var(--wot-bg-input) !important;
    border: 1px solid var(--wot-border) !important;
    color: var(--wot-text) !important;
    border-radius: 10px !important;
    transition: var(--wot-transition);
}

.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus {
    background-color: var(--wot-bg-input) !important;
    border-color: var(--wot-accent) !important;
    color: var(--wot-text) !important;
    box-shadow: 0 0 0 3px var(--wot-accent-glow) !important;
    outline: none;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--wot-text-muted) !important;
}

.form-control:disabled,
.form-control[readonly],
input:disabled,
input[readonly] {
    background-color: var(--wot-bg-raised) !important;
    color: var(--wot-text-muted) !important;
    border-color: var(--wot-border) !important;
    cursor: not-allowed;
}

select option {
    background-color: var(--wot-bg-input) !important;
    color: var(--wot-text) !important;
}

.input-group-text {
    background-color: var(--wot-bg-elevated) !important;
    border-color: var(--wot-border) !important;
    color: var(--wot-text-sub) !important;
    font-weight: 600;
}

.form-group label,
.form-label {
    color: var(--wot-text-sub) !important;
    font-weight: 500;
    margin-bottom: 6px;
}

/* Validation */
.field-validation-error,
.text-danger {
    color: var(--wot-red) !important;
}

.validation-summary-errors ul {
    color: var(--wot-red) !important;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: var(--wot-transition);
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--wot-grad) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 14px var(--wot-accent-glow);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #243170 0%, #1a1a1a 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--wot-accent-glow) !important;
    color: #fff !important;
}

.btn-secondary {
    background-color: var(--wot-bg-elevated) !important;
    border: 1px solid var(--wot-border-light) !important;
    color: var(--wot-text) !important;
}

.btn-secondary:hover {
    background-color: var(--wot-bg-hover) !important;
    border-color: var(--wot-accent) !important;
    color: var(--wot-text) !important;
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    border: none !important;
    color: #fff !important;
}

.btn-danger {
    background: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%) !important;
    border: none !important;
    color: #fff !important;
}

.btn-warning {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
    border: none !important;
    color: #fff !important;
}

.btn-info {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
    border: none !important;
    color: #fff !important;
}

.btn-light {
    background-color: var(--wot-bg-elevated) !important;
    border: 1px solid var(--wot-border) !important;
    color: var(--wot-text) !important;
}

.btn-light:hover {
    background-color: var(--wot-bg-hover) !important;
    color: var(--wot-text) !important;
}

.btn-dark {
    background-color: var(--wot-bg-hover) !important;
    border: 1px solid var(--wot-border-light) !important;
    color: var(--wot-text) !important;
}

.btn-outline-primary {
    border: 1px solid var(--wot-accent) !important;
    color: #a78bfa !important;
    background: transparent !important;
}

.btn-outline-primary:hover {
    background: var(--wot-grad) !important;
    color: #fff !important;
}

.btn-outline-secondary {
    border: 1px solid var(--wot-border-light) !important;
    color: var(--wot-text-sub) !important;
    background: transparent !important;
}

.btn-outline-secondary:hover {
    background-color: var(--wot-bg-hover) !important;
    color: var(--wot-text) !important;
}

.btn-outline-light {
    border: 1px solid rgba(255,255,255,0.25) !important;
    color: var(--wot-text) !important;
    background: transparent !important;
}

.btn-outline-light:hover {
    background-color: rgba(255,255,255,0.08) !important;
    color: #fff !important;
}

/* ── Dropdowns ───────────────────────────────────────────────── */
.dropdown-menu {
    background-color: var(--wot-bg-elevated) !important;
    border: 1px solid var(--wot-border) !important;
    box-shadow: var(--wot-shadow-lg) !important;
    border-radius: 12px !important;
}

.dropdown-item {
    color: var(--wot-text-sub) !important;
    font-weight: 500;
    border-radius: 8px;
    transition: var(--wot-transition);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--wot-grad) !important;
    color: #fff !important;
}

.dropdown-divider {
    border-color: var(--wot-border) !important;
}

.dropdown-header {
    color: var(--wot-text-muted) !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

/* ── Modals ─────────────────────────────────────────────────── */
.modal-content {
    background-color: var(--wot-bg-card) !important;
    border: 1px solid var(--wot-border) !important;
    border-radius: 16px !important;
    box-shadow: var(--wot-shadow-lg) !important;
    color: var(--wot-text) !important;
}

.modal-header {
    background-color: var(--wot-bg-elevated) !important;
    border-bottom: 1px solid var(--wot-border) !important;
    border-radius: 16px 16px 0 0 !important;
}

.modal-title {
    color: var(--wot-text) !important;
    font-weight: 700;
}

.modal-body {
    background-color: transparent !important;
    color: var(--wot-text) !important;
}

.modal-footer {
    background-color: var(--wot-bg-elevated) !important;
    border-top: 1px solid var(--wot-border) !important;
    border-radius: 0 0 16px 16px !important;
}

.close {
    color: var(--wot-text-sub) !important;
    text-shadow: none;
    opacity: 0.8;
    font-size: 1.4rem;
}

.close:hover {
    color: var(--wot-text) !important;
    opacity: 1;
}

.modal-backdrop {
    background-color: rgba(0,0,0,0.8) !important;
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
    border: none !important;
    border-radius: 12px !important;
    font-weight: 500;
}

.alert-success {
    background-color: var(--wot-green-bg) !important;
    color: var(--wot-green) !important;
    border-left: 4px solid var(--wot-green) !important;
}

.alert-danger {
    background-color: var(--wot-red-bg) !important;
    color: var(--wot-red) !important;
    border-left: 4px solid var(--wot-red) !important;
}

.alert-warning {
    background-color: var(--wot-amber-bg) !important;
    color: var(--wot-amber) !important;
    border-left: 4px solid var(--wot-amber) !important;
}

.alert-info {
    background-color: var(--wot-blue-bg) !important;
    color: var(--wot-blue) !important;
    border-left: 4px solid var(--wot-blue) !important;
}

.alert .close {
    color: currentColor !important;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge,
.badge-pill {
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    font-size: 0.75rem;
}

.badge-success, .bg-success { background-color: var(--wot-green-bg) !important; color: var(--wot-green) !important; }
.badge-danger,  .bg-danger  { background-color: var(--wot-red-bg)   !important; color: var(--wot-red)   !important; }
.badge-warning, .bg-warning { background-color: var(--wot-amber-bg) !important; color: var(--wot-amber) !important; }
.badge-info,    .bg-info    { background-color: var(--wot-blue-bg)  !important; color: var(--wot-blue)  !important; }
.badge-primary              { background: var(--wot-grad) !important;            color: #fff !important; }
.badge-secondary            { background-color: var(--wot-bg-hover) !important; color: var(--wot-text-sub) !important; }
.badge-dark                 { background-color: var(--wot-bg-elevated) !important; color: var(--wot-text) !important; }
.badge-light                { background-color: var(--wot-bg-elevated) !important; color: var(--wot-text) !important; }

/* ── List Groups ────────────────────────────────────────────── */
.list-group-item {
    background-color: var(--wot-bg-card) !important;
    border-color: var(--wot-border) !important;
    color: var(--wot-text) !important;
    transition: var(--wot-transition);
}

.list-group-item:hover {
    background-color: var(--wot-bg-hover) !important;
}

.list-group-item.active {
    background: var(--wot-grad) !important;
    border-color: var(--wot-accent) !important;
    color: #fff !important;
}

.list-group-item-action:focus {
    background-color: var(--wot-bg-hover) !important;
    color: var(--wot-text) !important;
}

/* ── Nav Tabs & Pills ───────────────────────────────────────── */
.nav-tabs {
    border-bottom: 2px solid var(--wot-border) !important;
}

.nav-tabs .nav-link {
    color: var(--wot-text-sub) !important;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent !important;
    border-radius: 0;
    font-weight: 500;
    transition: var(--wot-transition);
    margin-bottom: -2px;
}

.nav-tabs .nav-link:hover {
    color: var(--wot-text) !important;
    border-bottom-color: var(--wot-border-light);
}

.nav-tabs .nav-link.active {
    background-color: transparent !important;
    color: #a78bfa !important;
    border-bottom: 2px solid var(--wot-accent) !important;
    font-weight: 700;
}

.nav-pills .nav-link {
    color: var(--wot-text-sub) !important;
    background: transparent !important;
    border-radius: 10px;
    font-weight: 500;
    transition: var(--wot-transition);
}

.nav-pills .nav-link:hover {
    color: var(--wot-text) !important;
    background-color: var(--wot-bg-hover) !important;
}

.nav-pills .nav-link.active {
    background: var(--wot-grad) !important;
    color: #fff !important;
}

.tab-content {
    background-color: var(--wot-bg-card) !important;
    border: 1px solid var(--wot-border) !important;
    border-top: none !important;
    border-radius: 0 0 12px 12px !important;
    color: var(--wot-text) !important;
    padding: 20px !important;
}

/* ── Pagination ─────────────────────────────────────────────── */
.page-link {
    background-color: var(--wot-bg-card) !important;
    border-color: var(--wot-border) !important;
    color: #a78bfa !important;
    transition: var(--wot-transition);
}

.page-link:hover {
    background-color: var(--wot-bg-hover) !important;
    border-color: var(--wot-accent) !important;
    color: #c4b5fd !important;
}

.page-item.active .page-link {
    background: var(--wot-grad) !important;
    border-color: var(--wot-accent) !important;
    color: #fff !important;
}

.page-item.disabled .page-link {
    background-color: var(--wot-bg-raised) !important;
    border-color: var(--wot-border) !important;
    color: var(--wot-text-muted) !important;
}

/* ── Progress ────────────────────────────────────────────────── */
.progress {
    background-color: var(--wot-bg-elevated) !important;
    border-radius: 999px;
    height: 8px;
}

.progress-bar {
    background: var(--wot-grad) !important;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
    background-color: var(--wot-bg-elevated) !important;
    border-radius: 10px;
    padding: 10px 16px;
}

.breadcrumb-item a { color: #a78bfa; }
.breadcrumb-item.active { color: var(--wot-text-muted) !important; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--wot-text-muted); }

/* ── Accordion ──────────────────────────────────────────────── */
.accordion .card {
    border-bottom: 1px solid var(--wot-border) !important;
}

.accordion .card-header {
    background-color: var(--wot-bg-elevated) !important;
    cursor: pointer;
}

.accordion .card-header:hover {
    background-color: var(--wot-bg-hover) !important;
}

/* ── Tooltips ───────────────────────────────────────────────── */
.tooltip-inner {
    background-color: var(--wot-bg-elevated) !important;
    color: var(--wot-text) !important;
    border: 1px solid var(--wot-border) !important;
    border-radius: 8px;
    font-size: 0.82rem;
    padding: 6px 12px;
}

.bs-tooltip-top .arrow::before { border-top-color: var(--wot-bg-elevated) !important; }
.bs-tooltip-bottom .arrow::before { border-bottom-color: var(--wot-bg-elevated) !important; }
.bs-tooltip-left .arrow::before { border-left-color: var(--wot-bg-elevated) !important; }
.bs-tooltip-right .arrow::before { border-right-color: var(--wot-bg-elevated) !important; }

/* ── Popovers ───────────────────────────────────────────────── */
.popover {
    background-color: var(--wot-bg-elevated) !important;
    border-color: var(--wot-border) !important;
}

.popover-header {
    background-color: var(--wot-bg-hover) !important;
    border-bottom-color: var(--wot-border) !important;
    color: var(--wot-text) !important;
}

.popover-body { color: var(--wot-text-sub) !important; }

/* ── Display Utility Text Colors ────────────────────────────── */
.text-primary { color: #a78bfa !important; }
.text-success { color: var(--wot-green) !important; }
.text-danger  { color: var(--wot-red)   !important; }
.text-warning { color: var(--wot-amber) !important; }
.text-info    { color: var(--wot-blue)  !important; }
.text-dark    { color: var(--wot-text)  !important; }
.text-light   { color: var(--wot-text-sub) !important; }
.text-white   { color: #fff !important; }
.text-body    { color: var(--wot-text-sub) !important; }

/* Background Utilities */
.bg-white   { background-color: var(--wot-bg-card)     !important; }
.bg-light   { background-color: var(--wot-bg-elevated) !important; }
.bg-dark    { background-color: var(--wot-bg-raised)   !important; }
.bg-body    { background-color: var(--wot-bg)          !important; }

/* Gradient backgrounds — keep vibrant, just more subdued */
.bg-gradient-primary,
.bg-primary    { background: linear-gradient(135deg, #1c285b 0%, #141414 100%) !important; }
.bg-secondary  { background: linear-gradient(135deg, #1c285b 0%, #141414 100%) !important; }
.bg-success  { background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important; }
.bg-danger   { background: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%) !important; }
.bg-warning  { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important; }
.bg-info     { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important; }

/* Border Utilities */
.border         { border-color: var(--wot-border) !important; }
.border-top     { border-top-color: var(--wot-border) !important; }
.border-bottom  { border-bottom-color: var(--wot-border) !important; }

/* ── Navbar (kept from _Layout, ensuring consistency) ────────── */
.navbar {
    background: linear-gradient(135deg, #1c285b 0%, #141414 100%) !important;
    border-bottom: 1px solid var(--wot-border);
    box-shadow: 0 2px 20px rgba(0,0,0,0.7);
}

/* ── Footer ─────────────────────────────────────────────────── */
.body-content footer {
    background: linear-gradient(135deg, #1c285b 0%, #141414 100%) !important;
    border-top: 1px solid var(--wot-border) !important;
    color: var(--wot-text-sub) !important;
}

.body-content footer p {
    color: var(--wot-text-sub) !important;
}

/* ── Strategy Page Specific ─────────────────────────────────── */
.display-4 {
    background: linear-gradient(135deg, #a78bfa 0%, #c4b5fd 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.display-4 i {
    -webkit-text-fill-color: #a78bfa !important;
}

.lead {
    color: var(--wot-text-sub) !important;
}

#filterStatus {
    background: var(--wot-bg-elevated) !important;
    border-left: 4px solid var(--wot-accent) !important;
    color: var(--wot-text-sub) !important;
    border-radius: 10px;
}

.mt-3 small.text-muted {
    background: var(--wot-bg-elevated) !important;
    color: var(--wot-text-muted) !important;
    border-left: 4px solid var(--wot-text-muted) !important;
    border-radius: 8px;
    display: block;
    padding: 12px 16px;
}

.stock-link { color: #a78bfa !important; }
.stock-link:hover { color: #c4b5fd !important; }

/* ── Loading / Skeleton ─────────────────────────────────────── */
.skeleton,
.loading-shimmer {
    background: linear-gradient(90deg, var(--wot-bg-raised) 25%, var(--wot-bg-elevated) 50%, var(--wot-bg-raised) 75%) !important;
    background-size: 200% 100% !important;
    animation: wot-loading 1.5s infinite !important;
}

@keyframes wot-loading {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Gradient Text Utility ──────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, #a78bfa 0%, #c4b5fd 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* ── Glass Morphism (updated for dark) ─────────────────────── */
.glass-effect {
    background: rgba(28, 30, 42, 0.85) !important;
    backdrop-filter: blur(12px);
    border: 1px solid var(--wot-border-light) !important;
}

/* ── Neon Glow ──────────────────────────────────────────────── */
.neon-glow {
    box-shadow:
        0 0 10px rgba(124,58,237,0.5),
        0 0 20px rgba(124,58,237,0.3),
        0 0 35px rgba(124,58,237,0.15) !important;
}

/* ── Row Selection ──────────────────────────────────────────── */
.row-selected {
    background: rgba(124,58,237,0.12) !important;
    border-left: 3px solid var(--wot-accent) !important;
}

/* ── Profile Page ───────────────────────────────────────────── */
.profile-section,
.profile-card {
    background-color: var(--wot-bg-card) !important;
    border-color: var(--wot-border) !important;
    color: var(--wot-text) !important;
}

/* ── Error Page ─────────────────────────────────────────────── */
.error-page h1,
.error-page h2,
.error-page p {
    color: var(--wot-text) !important;
}

/* ── Telegram & PriceAlert Pages ────────────────────────────── */
section, article, aside, main {
    color: var(--wot-text);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .card {
        border-radius: 10px !important;
    }
    .modal-content {
        border-radius: 12px !important;
    }
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
    body { background: #fff !important; color: #000 !important; }
    .card { border: 1px solid #ccc !important; background: #fff !important; }
}

/* ================================================================
   PAGE-SPECIFIC DARK OVERRIDES
   Covers inline/scoped styles on PerformanceAnalytics, PlaceOrder,
   PriceAlert and other views that hardcode white/light values
   ================================================================ */

/* ── PlaceOrder: main containers ─────────────────────────────── */
.order-form-section,
.market-depth-section,
.chart-container,
.subscribed-stocks-panel {
    background: var(--wot-bg-card) !important;
    border: 1px solid var(--wot-border) !important;
    box-shadow: var(--wot-shadow) !important;
    color: var(--wot-text) !important;
}

/* ── PlaceOrder: tabs bar ─────────────────────────────────────── */
.order-panel-tabs,
.stock-tabs {
    background: var(--wot-bg-raised) !important;
}

.order-tab-button {
    background: transparent !important;
    color: var(--wot-text-sub) !important;
    border: none;
}

.order-tab-button:hover {
    background: rgba(124,58,237,0.1) !important;
    color: #a78bfa !important;
}

.order-tab-button.active {
    background: var(--wot-bg-card) !important;
    color: #a78bfa !important;
}

.tab-button {
    background: transparent !important;
    color: var(--wot-text-sub) !important;
}

.tab-button.active {
    background: var(--wot-bg-card) !important;
}

.tab-content:not(.nav-tabs ~ .tab-content) {
    background: var(--wot-bg-card) !important;
    border: none !important;
}

/* ── PlaceOrder: stock list ──────────────────────────────────── */
.stock-item.buy-item {
    background: rgba(16,185,129,0.06) !important;
    border-color: rgba(16,185,129,0.15) !important;
}

.stock-item.buy-item:hover {
    background: rgba(16,185,129,0.12) !important;
    border-color: var(--wot-green) !important;
}

.stock-item.sell-item {
    background: rgba(244,63,94,0.06) !important;
    border-color: rgba(244,63,94,0.15) !important;
}

.stock-item.sell-item:hover {
    background: rgba(244,63,94,0.12) !important;
    border-color: var(--wot-red) !important;
}

.stock-item.buy-item .stock-symbol { color: var(--wot-green) !important; }
.stock-item.sell-item .stock-symbol { color: var(--wot-red) !important; }

.stock-exchange,
.ltp-label,
.info-text {
    color: var(--wot-text-muted) !important;
}

.ltp-value.live { color: var(--wot-blue) !important; }

.info-text {
    background: var(--wot-bg-raised) !important;
}

/* ── PlaceOrder: market depth ────────────────────────────────── */
.depth-side-table.bid-side   { border-color: rgba(59,130,246,0.3) !important; }
.depth-side-table.offer-side { border-color: rgba(244,63,94,0.3)  !important; }

.depth-side-header.bid-header {
    background: rgba(59,130,246,0.12) !important;
    color: var(--wot-blue) !important;
}

.depth-side-header.offer-header {
    background: rgba(244,63,94,0.12) !important;
    color: var(--wot-red) !important;
}

.depth-table th {
    background: var(--wot-bg-elevated) !important;
    border-color: var(--wot-border) !important;
    color: var(--wot-text-sub) !important;
}

.depth-table td {
    border-color: var(--wot-border) !important;
    color: var(--wot-text) !important;
}

.depth-table tbody tr:hover { background: var(--wot-bg-hover) !important; }

.depth-total-row {
    background: var(--wot-bg-elevated) !important;
    border-top-color: var(--wot-border) !important;
}

.market-stats-grid {
    background: var(--wot-bg-elevated) !important;
}

.stat-label,
.info-label { color: var(--wot-text-muted) !important; }
.stat-value,
.info-value { color: var(--wot-text) !important; }

.ohlc-item {
    background: var(--wot-bg-elevated) !important;
    border-color: var(--wot-border) !important;
}

.ohlc-label { color: var(--wot-text-muted) !important; }
.ohlc-value { color: var(--wot-text) !important; }

/* ── PlaceOrder: chart ───────────────────────────────────────── */
.chart-header { border-color: var(--wot-border) !important; }
.chart-header h4 { color: var(--wot-text) !important; }

.chart-controls select {
    background: var(--wot-bg-input) !important;
    border-color: var(--wot-border) !important;
    color: var(--wot-text) !important;
}

.chart-controls select:hover,
.chart-controls select:focus {
    border-color: var(--wot-accent) !important;
}

#tv-chart, #tv-volume-chart, #tv-rsi-chart {
    border-color: var(--wot-border) !important;
    background: var(--wot-bg-raised) !important;
}

.indicator-controls {
    background: var(--wot-bg-elevated) !important;
    border: 1px solid var(--wot-border) !important;
}

.indicator-toggle {
    background: var(--wot-bg-input) !important;
    border-color: var(--wot-border) !important;
    color: var(--wot-text-sub) !important;
}

.indicator-toggle:hover {
    border-color: var(--wot-accent) !important;
    color: #a78bfa !important;
}

.indicator-toggle.active {
    background: var(--wot-grad) !important;
    border-color: var(--wot-accent) !important;
    color: #fff !important;
}

/* ── PlaceOrder: instrument selector ────────────────────────── */
.instrument-selector-section .card-header {
    background: rgba(59,130,246,0.1) !important;
    border-color: rgba(59,130,246,0.3) !important;
}

.instrument-selector-section .card-header h5,
.instrument-selector-section .card-header .collapse-icon { color: var(--wot-blue) !important; }

.instrument-selector-section .form-label { color: var(--wot-text-sub) !important; }

#selectedInstrumentDisplay {
    background: rgba(16,185,129,0.1) !important;
    border-left-color: var(--wot-green) !important;
    color: var(--wot-text) !important;
}

#selectedInstrumentDisplay code {
    background: var(--wot-bg-elevated) !important;
    color: var(--wot-text) !important;
}

#instrumentLoadingIndicator {
    background: var(--wot-bg-elevated) !important;
    color: var(--wot-text-sub) !important;
}

/* ── PlaceOrder: quick template / price fields ───────────────── */
.quick-template-card {
    background: var(--wot-bg-elevated) !important;
    border-color: var(--wot-border) !important;
}

.quick-template-card:hover { border-color: var(--wot-accent) !important; }

#priceFields {
    background: var(--wot-bg-elevated) !important;
    border-color: var(--wot-border) !important;
}

/* ── PlaceOrder + PerformanceAnalytics: .table-modern dark rows ── */
.table-modern {
    background: var(--wot-bg-card) !important;
    --bs-table-bg: #16171f;
    --bs-table-accent-bg: transparent;
    --bs-table-hover-bg: #22253a;
}

.table-modern thead th {
    background: var(--wot-bg-elevated) !important;
    color: var(--wot-text-sub) !important;
}

/* Override Bootstrap td-level background so row gaps stay dark */
.table-modern tbody tr  { background: var(--wot-bg-card) !important; }
.table-modern tbody td,
.table-modern tbody th  {
    background: var(--wot-bg-card) !important;
    color: var(--wot-text) !important;
}

.table-modern tbody tr:hover            { background: var(--wot-bg-hover) !important; }
.table-modern tbody tr:hover td,
.table-modern tbody tr:hover th         { background: var(--wot-bg-hover) !important; }

.table-modern tfoot tr                  { background: var(--wot-bg-elevated) !important; }
.table-modern tfoot td                  { background: var(--wot-bg-elevated) !important; color: var(--wot-text) !important; }

/* ── PlaceOrder: scrollbars ──────────────────────────────────── */
.left-panel::-webkit-scrollbar-track,
.tab-content::-webkit-scrollbar-track,
.oi-table-container::-webkit-scrollbar-track {
    background: var(--wot-bg-raised) !important;
}

.left-panel::-webkit-scrollbar-thumb,
.tab-content::-webkit-scrollbar-thumb,
.oi-table-container::-webkit-scrollbar-thumb {
    background: var(--wot-border-light) !important;
}

/* ── PlaceOrder: UI Autocomplete ─────────────────────────────── */
.ui-autocomplete { background: var(--wot-bg-elevated) !important; border-color: var(--wot-border) !important; }
.ui-menu-item { border-color: var(--wot-border) !important; color: var(--wot-text) !important; }
.ui-menu-item:hover { background: rgba(124,58,237,0.1) !important; }
.ui-widget-content { background: var(--wot-bg-elevated) !important; color: var(--wot-text) !important; }
.ui-widget-header { background: var(--wot-bg-hover) !important; color: var(--wot-text) !important; border-color: var(--wot-border) !important; }

/* ── PlaceOrder: Journal modals (inline styled) ──────────────── */
#editJournalModal > div,
#exitJournalModal > div {
    background: var(--wot-bg-card) !important;
    border: 1px solid var(--wot-border) !important;
    color: var(--wot-text) !important;
}

#editJournalModal input,
#editJournalModal select,
#editJournalModal textarea,
#exitJournalModal input,
#exitJournalModal select,
#exitJournalModal textarea {
    background: var(--wot-bg-input) !important;
    border-color: var(--wot-border) !important;
    color: var(--wot-text) !important;
}

#editJournalModal label,
#exitJournalModal label {
    color: var(--wot-text-sub) !important;
}

/* Exit Journal info section */
#exitJournalModal div[style*="background:#f8f9fa"],
#exitJournalModal div[style*="background: #f8f9fa"] {
    background: var(--wot-bg-elevated) !important;
    border-left-color: var(--wot-accent) !important;
}

/* Cancel button in modals */
#editJournalModal button[onclick*="close"],
#exitJournalModal button[onclick*="close"] {
    background: var(--wot-bg-elevated) !important;
    border-color: var(--wot-border) !important;
    color: var(--wot-text-sub) !important;
}

/* Divider inside modal forms */
#editJournalModal div[style*="border-top"],
#exitJournalModal div[style*="border-top"] {
    border-top-color: var(--wot-border) !important;
}

/* ── PriceAlert / Watchdog page ──────────────────────────────── */
.alert-card,
.watchdog-card,
.price-alert-card {
    background: var(--wot-bg-card) !important;
    border-color: var(--wot-border) !important;
    color: var(--wot-text) !important;
}

/* info-section with inline orange/yellow backgrounds */
.info-section {
    background: rgba(245,158,11,0.1) !important;
    border-color: var(--wot-amber) !important;
    color: var(--wot-text) !important;
}

/* ── PerformanceAnalytics: inline style overrides ────────────── */

/* The "position total" footer row */
tfoot tr[style*="background: #f7fafc"],
tfoot tr[style*="background:#f7fafc"] {
    background: var(--wot-bg-elevated) !important;
}

/* Summary strip navigator already dark via inline styles — ensure text is light */
#tradebookSummary h5,
#calMonthTitle { color: #fff !important; }

/* ── General: any remaining inline white backgrounds ─────────── */
/* Covers <div style="background:white..."> and similar patterns */
[style*="background:white"],
[style*="background: white"],
[style*="background:#ffffff"],
[style*="background: #ffffff"],
[style*="background:#fff"],
[style*="background: #fff"] {
    background-color: var(--wot-bg-card) !important;
}

[style*="background:#f8f9fa"],
[style*="background: #f8f9fa"],
[style*="background:#f9fafb"],
[style*="background: #f9fafb"],
[style*="background:#f5f5f5"],
[style*="background: #f5f5f5"],
[style*="background:#edf2f7"],
[style*="background: #edf2f7"],
[style*="background:#f7fafc"],
[style*="background: #f7fafc"] {
    background-color: var(--wot-bg-elevated) !important;
}

/* Inline text colors that look bad on dark */
[style*="color:#2d3748"],
[style*="color: #2d3748"],
[style*="color:#2c3e50"],
[style*="color: #2c3e50"],
[style*="color:#333"],
[style*="color: #333"],
[style*="color:#444"],
[style*="color: #444"],
[style*="color:#555"],
[style*="color: #555"] {
    color: var(--wot-text) !important;
}

[style*="color:#666"],
[style*="color: #666"],
[style*="color:#718096"],
[style*="color: #718096"],
[style*="color:#888"],
[style*="color: #888"] {
    color: var(--wot-text-sub) !important;
}

[style*="color:#999"],
[style*="color: #999"],
[style*="color:#a0aec0"],
[style*="color: #a0aec0"] {
    color: var(--wot-text-muted) !important;
}

/* Inline border colors */
[style*="border:2px solid #e0e0e0"],
[style*="border: 2px solid #e0e0e0"],
[style*="border-top:2px solid #f0f0f0"],
[style*="border-top: 2px solid #f0f0f0"] {
    border-color: var(--wot-border) !important;
}

