/* Trade pages — dark default, body.day-mode = light */
:root {
    --pw-trade-bg: #12151c;
    --pw-trade-surface: #1a1f2b;
    --pw-trade-border: rgba(255, 255, 255, 0.08);
    --pw-trade-border-soft: rgba(255, 255, 255, 0.05);
    --pw-trade-text: #eef2f7;
    --pw-trade-text-muted: #8b95a8;
    --pw-trade-table-border: rgba(255, 255, 255, 0.06);
    --pw-trade-inner-table-bg: #1a1f2b;
}

body.day-mode {
    --pw-trade-bg: #f4f7fc;
    --pw-trade-surface: #ffffff;
    --pw-trade-border: rgba(0, 0, 0, 0.08);
    --pw-trade-border-soft: #eaecef;
    --pw-trade-text: #1e2329;
    --pw-trade-text-muted: #848e9c;
    --pw-trade-table-border: rgba(0, 0, 0, 0.06);
    --pw-trade-inner-table-bg: #f5f5f5;
}

/* Page canvas — prowallet-body-bg fallback if class missing */
body.pw-trade-body {
    color: var(--pw-trade-text);
    min-height: 100vh;
}

body.pw-trade-body.day-mode {
    color: var(--pw-trade-text);
}

/* Bootstrap columns inside trade content only — transparent, not white slabs */
body.pw-trade-body .pw-fut-page [class*="col-"],
body.pw-trade-body .pw-copy-page [class*="col-"],
body.pw-trade-body .bord[class*="col-"],
body.pw-trade-body .row > [class*="col-"] {
    background: transparent;
}

/* Tables */
.table {
    width: 100%;
    max-width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
    border-bottom: none;
    color: var(--pw-trade-text);
}

.table td,
.table th {
    padding: 0.7rem;
    vertical-align: top;
    border-bottom: 1px solid var(--pw-trade-table-border);
    width: 10%;
    color: inherit;
}

.table thead th {
    color: var(--pw-trade-text-muted);
    font-weight: 700;
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(255, 255, 255, 0);
}

body.day-mode .table-striped tbody tr:nth-of-type(odd) {
    background: rgba(0, 0, 0, 0);
}

.table .table {
    display: table;
}

/* Select2 on trade forms */
.select2-container--default .select2-selection--single {
    background: var(--pw-trade-surface);
    border-color: var(--pw-trade-border);
    color: var(--pw-trade-text);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--pw-trade-text);
}

.select2-dropdown {
    background: var(--pw-trade-surface);
    border-color: var(--pw-trade-border);
    color: var(--pw-trade-text);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #3d7eff;
}

.select2-container--default .select2-results__option[aria-selected="true"] {
    background: rgba(91, 168, 255, 0.12);
    color: var(--pw-trade-text);
}

/* Trade alerts */
.alert.alert-success {
    position: fixed;
    bottom: 50px;
    background-color: #01cea2;
    color: #f7f7f7;
    right: 20px;
    z-index: 5;
}

.alert.alert-danger {
    position: fixed;
    bottom: 50px;
    background-color: #ff3245e3;
    color: #f7f7f7;
    right: 20px;
    z-index: 5;
}

/* Legacy trade wrappers */
.bord {
    background: transparent;
    border-color: var(--pw-trade-border);
}

.userdeskob .table,
.pw-fut-trades-wrap .table,
.pw-copy-page .table {
    color: var(--pw-trade-text);
}

/* Mobile tables */
@media only screen and (max-width: 767px) {
    .table td,
    .table th {
        padding: 0.7rem;
        vertical-align: top;
        width: 50%;
        display: flex;
        flex-wrap: wrap;
        flex-direction: column;
        float: left;
    }

    .table .table {
        background-color: var(--pw-trade-inner-table-bg);
        display: none;
    }

    .table {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
        background-color: transparent;
    }
}
