body {
    background-color: #222d32;
    user-select: none;
}

.skin-blue .main-header .logo {
    background-color: #111;
}

.skin-blue .main-header .logo:hover {
    background-color: #666;
}

.skin-blue .main-header .navbar {
    background-color: #000;
}

.skin-blue .main-header .navbar .sidebar-toggle:hover {
    background-color: #666;
}

.box-header>.fa, .box-header>.glyphicon, .box-header>.ion, .box-header .box-title {
    line-height: 1.8;
}

.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
    padding: 5px;
    font-size: 12px;
}

.table.trade-table>tbody>tr>td, .table.trade-table>tbody>tr>th, .table.trade-table>tfoot>tr>td, .table.trade-table>tfoot>tr>th, .table.trade-table>thead>tr>td, .table.trade-table>thead>tr>th {
    padding: 0 2px;
    font-size: 11px;
    line-height: 21px;
}

.trade-table.table-hover>tbody>tr:hover {
    background-color: #ddd;
}

.col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9 {
    padding-left: 3px;
    padding-right: 3px;
}

.content {
    padding-top: 5px;
    padding-bottom: 5px;
}

.content-header {
    padding-top: 10px;
}

.content-header>h1 {
    font-size: 18px;
}

.box {
    margin-bottom: 8px;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.table {
    margin-bottom: 0;
}

.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {
    white-space: nowrap;
}

.btn-group-sm>.btn, .btn-sm {
    font-size: 10px;
    padding: 3px 7px;
}

.box-header>.fa, .box-header>.glyphicon, .box-header>.ion, .box-header .box-title {
    font-size: 15px;
    line-height: 1;
}

.box-header {
    padding: 4px 7px;
}

.form-control {
    height: 24px;
    padding: 3px 7px;
}

.content-header>.breadcrumb.dashboard-filter {
    top: 3px;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.monospace {
    font-family: "Atkinson Hyperlegible Mono", monospace;
    letter-spacing: 1px;
}

.legend {
    position: absolute;
    display: none;
    left: 12px;
    top: 52px;
    font-size: 12px;
    font-family: sans-serif;
    font-weight: 300;
    z-index: 1000;
    background-color: #fffc;
    padding: 3px 5px;
    border-radius: 2px;
}

.chart-container {
    width: 100%;
    height: 305px;
    overflow: hidden;
    background-color: #111;
}

.chart-tooltip {
    width: 150px;
    position: absolute;
    display: none;
    padding: 8px;
    box-sizing: border-box;
    font-size: 12px;
    text-align: left;
    z-index: 1000;
    top: 12px;
    left: 12px;
    pointer-events: none;
    border: 1px solid;
    border-radius: 2px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.stock-info h3.box-title {
    top: 6px;
    position: relative;
    left: 3px;
}

.broker {
    cursor: pointer;
    text-align: center;
}

.broker.in-chart {
    background-color: #444;
}

.broker span.pemerintah {
    color: #3a83f9;
}

.broker span.asing {
    color: #df1401;
}

.broker span.lokal {
    color: #e7a710;
}

.broker.PD,
.broker.XC,
.broker.KK,
.broker.NI,
.broker.XL,
.broker.YP
{
    box-shadow: inset 0 0 5px 2px #f005;
    border: 1px solid #F004;
}

.form-control.broker-summary-date {
    width: 110px;
    display: inline-block;
}

.checkbox.inline-block {
    display: inline-block;
    margin-left: 10px;
}

.bar-wrapper {
    position: relative;
}

#broker-flow-table .bar-wrapper {
    color: #000;
}

td.lot.bid {
    background-color: rgba(0, 166, 90, 0.1);
}

td.lot.offer {
    background-color: rgba(255, 130, 130, 0.1);
}

.bar-percentage {
    position: absolute;
    height: 100%;
    bottom: 0;
    opacity: 0.5;
    z-index: 1;
}

.bar-percentage.buyer {
    right: 0;
    background-color: #025b00;
}

.bar-percentage.seller {
    left: 0;
    background-color: #510000;
}

.broker-flow-row .bar-percentage {
    opacity: 1;
}

.broker-flow-bar {
    text-align: right;
    overflow: hidden;
    width: 100%;
    font-size: 0;
}

.broker-flow-bar.buyer {
    text-align: right;
    width: 45%;
}

.broker-flow-bar.seller {
    width: 45%;
    text-align: left;
}

.broker-flow-bar span {
    display: inline-block;
    text-align: center;
    margin: 0;
    padding: 0 2px;
    white-space: nowrap;
    overflow: hidden;
    font-size: 12px;
    vertical-align: middle;
    z-index: 2;
    position: relative;
}

.price-history-legend {
    font-size: 13px;
    font-family: sans-serif;
    font-weight: 300;
    color: #999;
    padding-top: 5px;
}

.magnitude {
    font-style: normal;
}

.magnitude.B {
    color: #aaa;
}

.magnitude.M {
    color: #bbb;
}

.magnitude.K {
    color: #ccc;
}

.text-green {
    color: #009688;
}

.text-red {
    color: #ff8282;
}

@keyframes websocket-status-disconnected {
    0%,
    100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

#websocket-status.text-danger {
    animation: websocket-status-disconnected 1s ease-in-out infinite;
}

.text-right {
    text-align: right;
}
.table>tbody>tr>td.low {
    border-bottom: 2px dashed #009688;
}
.table>tbody>tr>td.high {
    border-top: 2px dashed #ff8282;
}
.table>tbody>tr>td.avg {
    position: relative;
    text-decoration: none;
}
.table>tbody>tr>td.avg::before {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: #f39c12;
}
#ihsg-chart {
    height: 46px;
    width: 100px;
    position: relative;
    top: 4px;
}

#menu-portfolio {
    width: 450px;
    padding: 3px 0;
    box-shadow: 0px 5px 20px 0px rgb(0 0 0 / 53%);
    border: none;
}

#menu-portfolio table.table.table-bordered {
    margin-bottom: 0;
}

#broker-summary-stock-code {
    position: relative;
    top: 7px;
}

.table>tbody>tr.portfolio-summary>td {
    background-color: hsl(0, 0%, 96%);
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
}

.matched-orders-toggle {
    cursor: pointer;
}

.trade-btn {
    width: 100%;
    border-radius: 0;
    border: none;
    color: #0027ff;
}

.trade-btn.btn-success {
    background-color: #ccedde !important;
}

.trade-btn.btn-danger {
    background-color: #f3d6d2 !important;
}

.trade-btn.btn-success:hover {
    background-color: #00a65a !important;
}

.trade-btn.btn-danger:hover {
    background-color: #dd4b39 !important;
}

tr.trade-row td {
    font-family: monospace;
}

.select-lot {
    cursor: pointer;
    border: none;
    width: 60px;
    font-size: 10px;
    text-align: center;
    padding: 5px 8px;
}

.select-lot.selected {
    background-color: #009688;
    color: #fff;
}

.badge.order-queue-status {
    font-size: 10px;
    border-radius: 2px;
    font-weight: normal;
    opacity: .6;
}

.trade-row.danger {
    background-color: #f3d6d2;
}

.trade-row.success {
    background-color: #ccedde;
}

#stockCode {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    line-height: 18px;
}

#bookmark-btn {
    top: -4px;
    position: relative;
}

#dashboard-date {
    top: -5px;
    position: relative;
}
.flow-other {
    background-color: #666;
}

/* DARK THEME */
body.dark-mode {
    color: #968981;

    .content-wrapper {
        background-color: #222;
    }

    .main-header {
        background-color: #111;

        .navbar {
            background-color: #111;
        }
    }

    .h1,
    .h2,
    .h3,
    .h4,
    .h5,
    .h6,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        color: #ddd;
    }

    td.freq > span, td.done-col > span {
        color: #555;
    }

    .box {
        background-color: #272727;
        border-top: 3px solid #555;
    }

    .table-striped>tbody>tr:nth-of-type(odd) {
        background-color: #1f1f1f;
    }

    .table-hover {
        >tbody>tr:hover {
            background-color: #111;
        }

        >thead>tr>th {
            background-color: #111;
        }
    }

    .table {
        >thead>tr>th,
        >tbody>tr>th,
        >tfoot>tr>th,
        >thead>tr>td,
        >tbody>tr>td,
        >tfoot>tr>td {
            border-top: none;
            border-bottom: none;
        }

        .table {
            background-color: #333;
        }

        >tbody>tr {
            &.success {
                >td,
                >th {
                    background-color: #004030 !important;
                    color: #00d200;
                }
            }

            &.danger {
                >td,
                >th {
                    background-color: #3b1313ee !important;
                    color: #F00;
                }
            }

            >td,
            >th {
                &.success {
                    background-color: #004030 !important;
                    color: #00d200;
                }

                &.danger {
                    background-color: #3b1313ee !important;
                    color: #a20000;
                }

                &.iep {
                    background-color: #7b551a !important;
                    color: #f39c12;
                }

                &.iev {
                    background-color: #653e00 !important;
                }

                &.current-price {
                    background-color: #264282;
                    color: #ddd;
                }
            }
        }

        >tfoot>tr {
            &.success {
                >td,
                >th {
                    background-color: #004030 !important;
                    color: #00d200;
                }
            }

            &.danger {
                >td,
                >th {
                    background-color: #3b1313ee !important;
                    color: #a20000;
                }
            }

            >td,
            >th {
                &.success {
                    background-color: #004030 !important;
                    color: #00d200;
                }

                &.danger {
                    background-color: #3b1313ee !important;
                    color: #a20000;
                }
            }
        }

        >thead>tr {
            &.success {
                >td,
                >th {
                    background-color: #004030 !important;
                    color: #00d200;
                }
            }

            &.danger {
                >td,
                >th {
                    background-color: #3b1313ee !important;
                    color: #a20000;
                }
            }

            >td,
            >th {
                &.success {
                    background-color: #004030 !important;
                    color: #00d200;
                }

                &.danger {
                    background-color: #3b1313ee !important;
                    color: #a20000;
                }
            }
        }
    }

    .btn {
        &.active.focus,
        &.active:focus,
        &.focus,
        &:active.focus,
        &:active:focus,
        &:focus {
            outline: none;
        }
    }


    .btn-default {
        background-color: #3d2020;
        color: #b5b5b5;
        border: none;

        &:hover {
            background-color: #286560;
        }

        &.active {
            background-color: #286560;
            color: #fff;
        }
    }

    .select-lot.selected {
        background-color: #004c45;
    }

    .dropdown-menu {
        background-color: #111111;
    }

    .table>tbody>tr.portfolio-summary>td {
        background-color: #222;
        border-top: 1px solid #ccc;
        border-bottom: 1px solid #ccc;
    }

    .trade-btn {
        color: #ffc800;

        &.btn-success {
            background-color: #004030 !important;

            &.sending {
                background-color: #7e4b00 !important;
            }

            &.droppable-hover {
                background-color: #00655a !important;
            }

            &:hover {
                background-color: #00655a !important;
            }
        }

        &.btn-danger {
            background-color: #400000 !important;

            &.sending {
                background-color: #7e4b00 !important;
            }

            &.droppable-hover {
                background-color: #650000 !important;
            }

            &:hover {
                background-color: #650000 !important;
            }
        }
    }

    .table>tbody>tr>td.high {
        border-top: 1px dashed #ff0000;
    }

    .table>tbody>tr>td.low {
        border-bottom: 1px dashed #00ffe7;
    }
    tr.matched-order {
        opacity: 0.5;
        background-color: #444;
    }
    .modal-content {
        background-color: #222;
        border: none;
        color: #ddd;

        .modal-header {
            background-color: #111;
            border-bottom: none;

            .close {
                color: rgb(123, 0, 0);
                text-shadow: none;
                opacity: 1;
            }
        }

        .modal-footer {
            background-color: #111;
            border-top: none;
        }
    }

    .form-control {
        background-color: #303030;
        color: #ddd;
        border: none;

        &:focus {
            background-color: #333;
            color: #ddd;
            border: none;
        }
    }

    &.login-page, &.register-page {
        background-color: #222;
        .login-box, .register-box {
            background-color: #222;
            border: none;
            color: #ddd;
        }
        .login-box-body, .register-box-body {
            background-color: #333;
            border: none;
            color: #ddd;
        }
        .form-control-feedback {
            top: -4px;
        }
    }

    .login-logo a, .register-logo a {
        color: #ddd;
    }
}

/* Dashboard layout: heatmap fills remaining viewport height */
.content-wrapper:has(> .dashboard-layout) {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 50px) !important;
    min-height: 0 !important;
    overflow: hidden;
}
.dashboard-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.dashboard-layout > .heatmap-layout-row {
    flex: 1;
    min-height: 0;
    display: flex;
}
.heatmap-layout-row > .heatmap-primary,
.heatmap-layout-row > .heatmap-secondary {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.dashboard-layout > .content:not(.heatmap-content) {
    flex-shrink: 1;
    overflow-y: auto;
    min-height: 0;
}
.content.heatmap-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}
.heatmap-row {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
}
.heatmap-row > .col-lg-12 {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    flex: 1;
}
.heatmap-box .box-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    flex: 1;
}
#ihsg-intraday-chart {
    width: 100%;
    flex: 1;
    min-height: 0;
    min-width: 0;
    align-self: stretch;
    position: relative;
    background: #000;
    overflow: hidden;
}
.ihsg-box {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}
.ihsg-box .box-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    flex: 1;
}
#heatmap-treemap {
    width: 100%;
    flex: 1;
    min-height: 0;
    min-width: 0;
    align-self: stretch;
    position: relative;
    background: #000;
    overflow: hidden;
}
.heatmap-box {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}
#heatmap-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    display: none;
    background: #222d32;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    font-size: 12px;
    color: #fff;
}
#heatmap-tooltip table {
    border-collapse: collapse;
}
#heatmap-tooltip th, #heatmap-tooltip td {
    padding: 4px 10px;
    text-align: right;
}
#heatmap-tooltip th:first-child, #heatmap-tooltip td:first-child {
    text-align: left;
}
#heatmap-tooltip .heatmap-tooltip-code {
    font-weight: bold;
    margin-bottom: 6px;
}
.heatmap-stock-block {
    position: absolute;
    border: 1px solid #000;
    display: flex;
    text-decoration: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
    box-sizing: border-box;
    padding: 5px;
}
.heatmap-stock-block:hover {
    opacity: 0.9;
    border: 2px solid #fff;
    color: white;
}
.heatmap-stock-block.heatmap-stock-alert .heatmap-stock-symbol,
.heatmap-stock-block.heatmap-stock-alert .heatmap-stock-change,
.heatmap-stock-block.heatmap-stock-alert:hover .heatmap-stock-symbol,
.heatmap-stock-block.heatmap-stock-alert:hover .heatmap-stock-change {
    color: #ffeb3b;
}
.heatmap-stock-symbol {
    font-size: 14px;
    margin-bottom: 2px;
}
.heatmap-stock-change {
    font-size: 12px;
}
.heatmap-level-neg-high { background-color: #b91c1c; }
.heatmap-level-neg-low { background-color: #ff6c6c; }
.heatmap-level-neutral { background-color: #6b7280; }
.heatmap-level-pos-low { background-color: #509369; }
.heatmap-level-pos-high { background-color: #006b28; }
.heatmap-control {
    margin-right: 8px;
    position: relative;
    bottom: 5px;
}

/* Trade page */
@keyframes fadeGreen {
    0%   { background-color: rgba(0, 255, 0, 0.3); }
    100% { background-color: transparent; }
}

@keyframes fadeRed {
    0%   { background-color: rgba(255, 0, 0, 0.3); }
    100% { background-color: transparent; }
}

.fade-green-disabled { animation: fadeGreen 1s ease-out; }
.fade-red-disabled   { animation: fadeRed 1s ease-out; }

.draggable { cursor: move; }
.droppable { cursor: pointer; }

.trade-btn {
    &.sending, &.sending:hover {
        background-color: #ff9800 !important;
        color: #fff;
    }

    &.btn-success.droppable-hover {
        background-color: #009688 !important;
        color: #fff;
    }

    &.btn-danger.droppable-hover {
        background-color: #ff8282 !important;
        color: #fff;
    }
}

.lot .bar-percentage {
    &.buyer, &.seller {
        left: 0;
        right: auto;
    }
}

.freq-bar.bar-percentage {
    background-color: #44f5;

    &.buyer, &.seller {
        right: 0;
        left: auto;
    }
}

.done-col {
    position: relative;

    .stacked-bar {
        position: absolute;
        bottom: 0;
        left: 0;
        height: 2px;
        display: flex;
        width: 0%;
    }

    .bar-buy {
        height: 100%;
        background-color: #00a65a88;
    }

    .bar-sell {
        height: 100%;
        background-color: #dd4b3988;
    }
}

td.bid > span.lot-value {
    color: #00b300;
    position: relative;
    z-index: 2;
}

td.offer > span.lot-value {
    color: #f00;
    position: relative;
    z-index: 2;
}

tr.broker-summary-row span {
    z-index: 2;
    position: relative;
}

tr.my-order td {
    color: #ffeb3b;
}

/* Price alert */
.price-alert-highlight {
    background-color: #303 !important;
    position: relative;

    &::before {
        content: attr(data-alert-op);
        position: absolute;
        left: 2px;
        top: 0;
        font-size: 9px;
        color: #f0f;
    }

    &::after {
        content: '\f0f3';
        font-family: FontAwesome;
        position: absolute;
        right: 2px;
        top: 0;
        font-size: 9px;
        color: #f0f;
    }
}

#price-alert-menu {
    display: none;
    position: fixed;
    z-index: 10000;
    background: #222d32;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 10px;
    width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);

    label {
        color: #b8c7ce;
        font-size: 12px;
        margin-bottom: 2px;
    }

    select, input {
        width: 100%;
        margin-bottom: 6px;
        background: #1a2226;
        color: #fff;
        border: 1px solid #555;
        border-radius: 3px;
        padding: 4px 6px;
        font-size: 13px;
    }

    .btn-row {
        display: flex;
        gap: 6px;

        .btn {
            flex: 1;
            font-size: 12px;
        }
    }
}

td.safe-value::before {
    content: '\25CF';
    color: #00a65a;
    margin-right: 4px;
}
