.table-responsive {
    max-height:300px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-overlay-box {
    min-width: 180px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    padding: 14px 16px;
    color: #e2e8f0;
    text-align: center;
}

.loading-overlay-text {
    margin-top: 10px;
    font-size: 0.9rem;
}

.chart-shell {
    position: relative;
    border-radius: 12px;
    border: 1px solid #334155;
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.35);
    overflow: hidden;
}

#chartbtc{
    height: 26rem;
    width: 100%;
    border-radius: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
}

.subcharts-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border-top: 1px solid #334155;
}

#chartbtc-rsi {
    height: 6.2rem;
    width: 100%;
    border-radius: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
}

#chartbtc-macd {
    height: 7rem;
    width: 100%;
    border-radius: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
    border-top: 1px solid #334155;
}

.chart-legend {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 170px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    color: #e2e8f0;
    font-size: 0.84rem;
    z-index: 5;
}

.chart-legend-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    line-height: 1.5;
}

.chart-legend-row span:first-child {
    color: #94a3b8;
}

.legend-signal {
    font-weight: 600;
    text-transform: uppercase;
}

.legend-signal--buy {
    color: #22c55e;
}

.legend-signal--sell {
    color: #ef4444;
}

.legend-signal--neutral {
    color: #fbbf24;
}

.condition-panel {
    background: #ffffff;
    border-color: #dbe3ef !important;
}

.condition-checklist {
    list-style: none;
    padding-left: 0;
}

.condition-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.88rem;
    margin-bottom: 6px;
}

.condition-item:last-child {
    margin-bottom: 0;
}

.condition-item--done {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.condition-item--waiting {
    background: rgba(251, 191, 36, 0.14);
    color: #92400e;
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.condition-state {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    font-weight: 700;
}

.trade-row-new-buy {
    animation: tradeRowFlashBuy 2s ease-out;
}

.trade-row-new-sell {
    animation: tradeRowFlashSell 2s ease-out;
}

@keyframes tradeRowFlashBuy {
    0% {
        background-color: rgba(34, 197, 94, 0.28);
    }
    100% {
        background-color: transparent;
    }
}

.panel-body.table-responsive table {
    min-width: 960px;
}

.trade-history-wrap {
    max-height: 420px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(2, 6, 23, 0.06);
}

.trade-history-table {
    margin-bottom: 0;
    min-width: 1250px;
    font-size: 0.92rem;
}

.trade-history-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #0f172a;
    color: #e2e8f0;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

.trade-history-table tbody tr:nth-child(odd) {
    background: #f8fafc;
}

.trade-history-table tbody td {
    vertical-align: middle;
}

.trade-side-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    background: #f1f5f9;
    color: #334155;
}

.trade-side-badge--buy {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
    border-color: rgba(34, 197, 94, 0.35);
}

.trade-side-badge--sell {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.35);
}

@media (max-width: 992px) {
    #chartbtc {
        height: 20rem;
    }

    #chartbtc-rsi {
        height: 5.5rem;
    }

    #chartbtc-macd {
        height: 6.2rem;
    }

    .chart-legend {
        min-width: 140px;
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    #btc-target .col-sm {
        margin-bottom: 12px;
    }
}

@media (max-width: 768px) {
    #chartbtc {
        height: 17rem;
    }

    #chartbtc-rsi {
        height: 5rem;
    }

    #chartbtc-macd {
        height: 5.4rem;
    }

    .chart-legend {
        position: static;
        display: inline-block;
        transform: none;
        margin-top: 8px;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .trade-history-wrap {
        max-height: 360px;
    }
}

@keyframes tradeRowFlashSell {
    0% {
        background-color: rgba(239, 68, 68, 0.28);
    }
    100% {
        background-color: transparent;
    }
}


