/* =========================
   GLOBAL
========================= */

body{
    color:#e6edf3;
    font-family:system-ui,-apple-system,Segoe UI,Roboto;
    margin:0;

    background:
        radial-gradient(circle at 20% 20%, #11161c 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, #11161c 0%, transparent 50%),
        #0b0f14;

    animation:dashboardGlow 25s ease infinite alternate;
}

h1,h2,h3,h4{
    color:#f0f6fc;
}

a{
    color:#58a6ff;
}

a:hover{
    color:#79c0ff;
}

/* =========================
   LAYOUT
========================= */

.layout{
    display:flex;
    height:100vh;
}

/* =========================
   SIDEBAR
========================= */

.sidebar{
    position:relative;
    z-index:1000;
    top:0;
    height:100vh;
    width:220px;
    min-width:220px;
    background:#11161c;
    border-right:1px solid #2d333b;
    padding:20px;
	transition:all 0.25s ease;
}

.sidebar h4{
    color:#ffffff;
    margin-bottom:25px;
}

.sidebar a{
    display:block;
    padding:10px 12px;
    border-radius:6px;
    text-decoration:none;
    color:#c9d1d9;
    margin-bottom:6px;
}

.sidebar a:hover{
    background:#1f2933;
    color:#ffffff;
}

.sidebar a.active{
    background:#1f2933;
    border-left:3px solid #3b82f6;
    color:#ffffff;
    padding-left:9px;
}

/* sidebar collapse */

.sidebar.collapsed{
    width:60px;
    min-width:60px;
}

/* скрываем текст */

.sidebar.collapsed a{
    font-size:0;
	padding-left:0;
}

.sidebar.collapsed .logo{
    font-size:0;
}

/* кнопка */

.sidebar-toggle{
    cursor:pointer;
    margin-bottom:15px;
    font-size:18px;
}

/* nav items */

.nav-item{
    display:flex;
    align-items:center;
    gap:10px;
}

/* icon */

.icon{
    width:22px;
    text-align:center;
    font-size:16px;
}

/* collapsed */

.sidebar.collapsed .label{
    display:none;
}

.sidebar.collapsed .nav-item{
    position:relative;
}

.sidebar.collapsed .nav-item:hover::after{

    content:attr(data-title);

    position:absolute;
    left:60px;

    background:#11161c;
    border:1px solid #2d333b;
    padding:4px 8px;
    border-radius:4px;

    white-space:nowrap;

    font-size:12px;
	z-index:2000;
}



/* =========================
   MAIN
========================= */

.main{
    flex:1;
    display:flex;
    flex-direction:column;
}

/* =========================
   TOPBAR
========================= */

.topbar{
    height:50px;
    background:#11161c;
    border-bottom:1px solid #2d333b;
    display:flex;
    align-items:center;
    padding-left:20px;
    position:sticky;
    top:0;
    z-index:100;
}

.title{
    font-weight:600;
    color:#ffffff;
}


/* =========================
   CONTENT
========================= */

.content{
    padding:20px;
    overflow:auto;
}

/* =========================
   CARDS
========================= */

.card{
    background:#11161c;
    border:1px solid #2d333b;
    border-radius:10px;
    padding:10px;
    transition:all 0.2s ease;
}

.card:hover{
    border-color:#3b82f6;
    transform:translateY(-2px);
}

.card h4{
    color:#c9d1d9;
}

/* =========================
   TABLE
========================= */

.table{
    --bs-table-bg:#0b0f14;
    --bs-table-color:#e6edf3;
    --bs-table-border-color:#2d333b;
    --bs-table-striped-bg:#0e141b;
    --bs-table-hover-bg:#1c2630;

    background:#0b0f14;
    color:#e6edf3;
}

.table thead{
    background:#11161c;
}

.table thead th{
    color:#e6edf3;
}

.table tbody tr{
    transition:background 0.15s ease;
}

/* =========================
   TABLE CONTAINER
========================= */

.table-container{
    max-height:800px;
    overflow-y:auto;
    border:1px solid #2d333b;
    border-radius:6px;
    background:#0b0f14;
}


/* =========================
   SORT ICON
========================= */

th.sortable{
    cursor:pointer;
}

th.sortable span{
    margin-left:5px;
}

/* =========================
   PROFIT / LOSS
========================= */

.table td.price-up{
    color:#16c784 !important;
    font-weight:600;
}

.table td.price-down{
    color:#ea3943 !important;
    font-weight:600;
}

/* =========================
   ORDER SIZE COLORS
========================= */

.table tr.order-100{
    font-weight:700;
}

.table tr.order-300{
    font-weight:800;
}

.table tr.order-500{
    font-weight:900;
}

.table tr.tf2h{
    --bs-table-bg:#2e2500;
    --bs-table-striped-bg:#2e2500;
}

.table tr.tf15m{
    --bs-table-bg:#3a2f00;
    --bs-table-striped-bg:#3a2f00;
}

.table tr.tf5m{
    --bs-table-bg:#5c3c00;
    --bs-table-striped-bg:#5c3c00;
}

.table tr.tf3m{
    --bs-table-bg:#6a1b1b;
    --bs-table-striped-bg:#6a1b1b;
}

.table a{
    color:#B0E0E6;
    text-decoration:none;
    font-weight:600;
}

.table a:hover{
    color:#79c0ff;
    text-decoration:underline;
}

/* =========================
   FLASH UPDATE
========================= */

.flash-green{
    animation:flashgreen 0.6s ease-out;
}

.flash-red{
    animation:flashred 0.6s ease-out;
}

@keyframes flashgreen{
    0%{background:#163b2a;}
    100%{background:transparent;}
}

@keyframes flashred{
    0%{background:#3b1f23;}
    100%{background:transparent;}
}

/* =========================
   BALANCE BAR
========================= */

.balance-bar{
    height:6px;
    background:#2d333b;
    border-radius:4px;
    margin-top:3px;
}

.balance-fill{
    height:6px;
    background:#3b82f6;
    border-radius:4px;
}

/* =========================
   CHART
========================= */

canvas{
    background:#11161c;
    border:1px solid #2d333b;
    border-radius:8px;
    padding:10px;
}

/* =========================
   SCROLLBAR
========================= */

::-webkit-scrollbar{
    width:8px;
}

::-webkit-scrollbar-track{
    background:#0b0f14;
}

::-webkit-scrollbar-thumb{
    background:#2d333b;
    border-radius:4px;
}

::-webkit-scrollbar-thumb:hover{
    background:#444c56;
}

.coin-icon{
    width:18px;
    height:18px;
    margin-right:7px;
    border-radius:50%;
    vertical-align:-3px;
}


/* =========================
   sudo journalctl -u binbot -f
========================= */

.log-header{
    cursor:pointer;
    font-weight:600;
    margin-top:10px;
    margin-bottom:5px;
}

.log-container{
    display:none;
    width:50%;
}

.log-box{
    background:#0b0f14;
    border:1px solid #2d333b;
    border-radius:6px;

    max-height:800px;
    overflow-y:auto;

    font-family:monospace;
    font-size:12px;

    padding:10px;
    white-space:pre-wrap;
}

/* цвета */

.log-debug{color:#8b949e;}
.log-info{color:#c9d1d9;}
.log-buy{color:#16c784;}
.log-sell{color:#58a6ff;}
.log-error{color:#ea3943;}

/* =========================
   DEBUG PAGE
========================= */

.debug-layout{
    display:flex;
    gap:20px;
}

.debug-left{
    width:50%;
}

.debug-right{
    width:50%;
}

.log-filters{
    margin-bottom:8px;
}

.log-filters label{
    margin-right:10px;
    font-size:12px;
}

@keyframes dashboardGlow{

    0%{
        background-position:0% 0%,100% 100%;
    }

    50%{
        background-position:30% 20%,70% 80%;
    }

    100%{
        background-position:60% 40%,40% 60%;
    }

}

/* analytics loader */
.analytics-loader{

    width:22px;
    height:22px;

    border:3px solid #2d333b;
    border-top:3px solid #3b82f6;

    border-radius:50%;

    animation:spin 0.8s linear infinite;

    display:inline-block;
    margin-left:10px;
}

@keyframes spin{
    from{transform:rotate(0deg)}
    to{transform:rotate(360deg)}
}

.table td.metric {
    font-weight: 600;
}

.table td.metric-good {
    color: #16c784;
}

.table td.metric-bad {
    color: #ea3943;
}

.table td.metric-mid {
    --bs-table-color: #f3ba2f;   /* жёлтый */
}

.tf-off {
    background: #2c2f36;
    color: #888;
}

.tf-clear {
    background: #3a3a1f;
    color: #00FFFF;
}

.tf-green {
    background: #1f3a2b;
    color: #16c784;
}

.row-active {
    border-left: 3px solid #16c784;
}

td input[type="radio"]{
    cursor:pointer;
}

.tf-selected {
    background-color: #d0ebff;
    border: 2px solid #f59f00;
}

.tf-best {
    border: 2px solid #70ffa5;
}