
:root {
    --color-text-muted: #a0a0a0;
    --merged-status-color: #aaa;
    --positive-text-color: #080;
    --positive-bg-color: #ded;
    --neutral-bg-color: #f8f9fa;
    --negative-text-color: #a00;
    --negative-bg-color: #edd;
    --menu-second-border-color: rgba(0, 0, 0, 0.2);
    --modal-bg-color: #fff;
    --curtain-background: rgba(230, 230, 230, 0.8);
    --curtain-foreground: #999;
    --table-head-bg-color: #cfe2ff;
    --table-head-text-color: #333;
    --table-head-border-color: #a6b5cc;
    --table-section-bg-color: #e2e3e5;
    --table-striped-bg-color: #f8f9fa;
    --table-embedded-head-color: var(--table-striped-bg-color);
    --table-embedded-section-color: #fcfcfc;
    --table-status-head-color: #888;
    --table-status-value-color: #ccc;
    --status-favorite-color: #6c757d;
    --order-bought-color: #088;
    --order-sold-color: #909;
    --number-color-weight: rgba(150, 150, 50, 0.9);
    --number-color-score: rgba(150, 50, 150, 0.9);
    --bar-color-weight: rgba(150, 150, 50, 0.2);
    --bar-color-score: rgba(150, 50, 150, 0.2);
    --stacked-symbol-bg: rgba(120, 120, 120, 0.2);
    --stacked-symbol-fg: #999;
}

html[data-bs-theme="dark"] {
    --positive-text-color: #8c8;
    --positive-bg-color: #006000;
    --neutral-bg-color: #3b4045;
    --negative-text-color: #e88;
    --negative-bg-color: #800;
    --modal-bg-color: #212529;
    --curtain-background: rgba(50, 50, 50, 0.8);
    --curtain-foreground: #bbb;
    --table-head-bg-color: #486270;
    --table-head-text-color: #ccc;
    --table-head-border-color: #66758c;
    --table-section-bg-color: #424345;
    --table-striped-bg-color: #2b3035;
    --table-embedded-head-color: #3b4045;
    --table-embedded-section-color: var(--table-striped-bg-color);
    --table-status-head-color: #ccc;
    --table-status-value-color: #888;
    --status-favorite-color: #e4e4e4;
    --order-bought-color: #0bb;
    --order-sold-color: #c0c;
    --number-color-weight: rgb(170, 170, 70);
    --number-color-score: rgb(200, 100, 200);
    --bar-color-weight: rgba(250, 250, 150, 0.2);
    --bar-color-score: rgba(250, 150, 250, 0.2);
    --stacked-symbol-bg: rgba(180, 180, 180, 0.3);
    --stacked-symbol-fg: #aaa;
}

/*
 *  layout elements
 */

.navbar-nav .nav-link.active {
    background-color: var(--bs-tertiary-bg);
}

.block-striped:nth-of-type(even) {
    background-color: var(--bs-tertiary-bg);
}

.auth-main .user-id {
    color: var(--color-text-muted);
}

.chat-sequence .waiting {
    background-color: var(--curtain-background);
}

.chat-sequence .waiting i.fa {
    color: var(--curtain-foreground);
}

/*
 *  table cells / simple elements
 */

.table th.order-type-buy, .table td.order-type-buy,
.table tr.order-type-buy td {
    color: var(--order-bought-color);
}

.table th.order-type-sell, .table td.order-type-sell,
.table tr.order-type-sell td,
.table td.locked {
    color: var(--order-sold-color);
}

.label,
.fa-bookmark.merged {
    color: var(--merged-status-color);
}

.table td.status {
    color: var(--status-favorite-color);
}

.table td.status .fa-lock,
.table td.status .fa-question-circle-o {
    color: var(--table-status-value-color);
}

.table th.head.merged {
    color: var(--table-status-head-color)
}

.number.up,
.table .positive,
.table td.price.up,
.table td .value.up {
    color: var(--positive-text-color);
}

.number.down,
.table .negative,
.table td.price.down,
.table td .value.down {
    color: var(--negative-text-color);
}

.number.rating-pp,
.analysts .positive,
.score.rating-pp,
.price.rating-pp,
.performance .value.rating-pp,
.div_fee .value.rating-pp,
.kgv .value.rating-pp,
td.rating-pp,
td.rating-pp,
td.advice-pp {
    color: var(--positive-text-color);
    background-color: var(--positive-bg-color);
}

.number.rating-p,
.score.rating-p,
.price.rating-p,
.performance .value.rating-p,
.div_fee .value.rating-p,
.kgv .value.rating-p,
.return.rating-p,
td.rating-p,
td.rating-p,
td.advice-p {
    font-weight: 500;
    color: var(--positive-text-color);
}

.number.rating-n,
.score.rating--n,
.price.rating--n,
.performance .value.rating-n,
.div_fee .value.rating-n,
.kgv .value.rating-n,
td.rating--n,
td.rating-n,
td.advice-n {
    color: var(--bs-tertiary-color);
}

.analysts .neutral {
    background-color: var(--neutral-bg-color);
}

.number.rating-m,
.label.rating-m,
.score.rating-m,
.price.rating-m,
.performance .value.rating-m,
.div_fee .value.rating-m,
.kgv .value.rating-m,
.return.rating-m,
td.rating-m,
td.rating-m,
td.advice-m {
    font-weight: 500;
    color: var(--negative-text-color);
}

.number.rating-mm,
.analysts .negative,
.score.rating-mm,
.price.rating-mm,
.performance .value.rating-mm,
.div_fee .value.rating-mm,
.kgv .value.rating-mm,
td.rating-mm,
td.rating-mm,
td.advice-mm {
    color: var(--negative-text-color);
    background-color: var(--negative-bg-color);
}

/*
 *  tables and table rows
 */

.table .table-primary th,
.table .table-primary td,
.table tr:nth-of-type(odd).table-primary th,
.table tr:nth-of-type(odd).table-primary td {
    background-color: var(--table-head-bg-color);
    --bs-table-bg-type: var(--table-head-bg-color);
    color: var(--table-head-text-color);
    --bs-table-color-type: var(--table-head-text-color);
    border-color: var(--table-head-border-color);
}

.table-fullscreen #depotTable td.depot,
.table-fullscreen .table th.head.table-secondary,
.table-fullscreen .table td.head.table-secondary,
.table-fullscreen .table tr.table-section td.head,
.table-fullscreen .table tr.table-section-n1 td.head,
.table-fullscreen .table tr.table-section-n2 td.head,
.table-fullscreen .table tr:nth-of-type(odd) th.head.table-secondary,
.table-fullscreen .table tr:nth-of-type(odd) td.head.table-secondary {
    background-color: var(--table-section-bg-color);
    --bs-table-bg-type: var(--table-section-bg-color);
    color: var(--table-head-text-color);
    --bs-table-color-type: var(--table-head-text-color);
    border-color: var(--table-head-border-color);
}

.table-embedded .table .head th,
.table-embedded .table .head td,
.table-embedded .table .foot th,
.table-embedded .table .foot td {
    background-color: var(--table-embedded-head-color);
    --bs-table-bg-type: var(--table-embedded-head-color);
    color: var(--table-head-text-color);
    --bs-table-color-type: var(--table-head-border-color);
    border-color: var(--table-head-border-color);
}

.table-embedded .table .table-section th.head,
.table-embedded .table .table-section td.head,
.table-embedded .table .table-section-n1 th.head,
.table-embedded .table .table-section-n1 td.head,
.table-embedded .table .table-section-n2 th.head,
.table-embedded .table .table-section-n2 td.head {
    --bs-table-bg-type: var(--table-embedded-section-color);
}

#depotTable .performance .days,
#portfolioTable.table th .isin,
#portfolioTable.table td .isin,
#portfolioTable.table th .wkn,
#portfolioTable.table td .wkn,
#portfolioTable.table th .days,
#portfolioTable.table td .days {
    color: var(--color-text-muted);
}

.table td .unit {
    color: var(--color-text-muted);
}

.table th .weight .fa.fa-pie-chart {
    color: var(--stacked-symbol-bg);
}

.table th .weight .fa.fa-percent {
    color: var(--stacked-symbol-fg);
}

.table td.head.number.weight,
td .number.weight {
    color: var(--number-color-weight) !important;
}

.table td.head.number.score-bar,
td .number.score-bar {
    color: var(--number-color-score) !important;
}

div.layers .background.weight-bar {
    background-color: var(--bar-color-weight);
}

div.layers .background.score-bar {
    background-color: var(--bar-color-score);
}