/* style.css — Bot Crypto AI Dashboard — Thème sombre */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #0d1117;
    --surface:   #161b22;
    --border:    #30363d;
    --text:      #c9d1d9;
    --text-dim:  #8b949e;
    --accent:    #58a6ff;
    --positive:  #3fb950;
    --negative:  #f85149;
    --warning:   #d29922;
    --danger:    #da3633;
    --radius:    8px;
    --font:      'Segoe UI', system-ui, sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

/* ── HEADER ── */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left  { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 10px; }

.logo { font-size: 22px; }
h1    { font-size: 18px; font-weight: 600; color: var(--text); }

.uptime { font-size: 13px; color: var(--text-dim); }

/* ── BADGES ── */
.badge {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.badge-test  { background: #1f3a5f; color: var(--accent); }
.badge-live  { background: #3d1a1a; color: var(--negative); }
.badge-danger{ background: var(--danger); color: #fff; }
.badge-small {
    display: inline-block;
    background: var(--border);
    color: var(--text-dim);
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
}
.hidden { display: none !important; }

/* ── STATUS DOT ── */
.dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    display: inline-block;
}
.dot-online  { background: var(--positive); box-shadow: 0 0 6px var(--positive); }
.dot-offline { background: var(--text-dim); }
.dot-safety  { background: var(--warning);  box-shadow: 0 0 6px var(--warning); }

/* ── LAYOUT ── */
main { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ── CARDS ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.card-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.card-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.card-sub {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 12px;
}
.card-sub.positive { color: var(--positive); }
.card-sub.negative { color: var(--negative); }

.card-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 12px;
    color: var(--text-dim);
}
.card-detail b { color: var(--text); }

/* ── PROGRESS BAR (drawdown) ── */
.progress-wrap {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--positive);
    border-radius: 3px;
    transition: width .4s ease, background .4s ease;
}
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger  { background: var(--negative); }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
thead th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}
tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(88, 166, 255, 0.04); }

.empty {
    text-align: center;
    color: var(--text-dim);
    padding: 20px !important;
    font-style: italic;
}

/* ── LOGS ── */
.card-logs { padding-bottom: 0; }

#log-container {
    height: 320px;
    overflow-y: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    padding: 4px 0 12px;
}

.log-line {
    padding: 1px 4px;
    border-radius: 3px;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-dim);
}
.log-line:hover     { background: rgba(255,255,255,.03); }
.log-line.log-error { color: var(--negative); }
.log-line.log-warn  { color: var(--warning); }
.log-line.log-trade { color: var(--positive); }

/* scrollbar logs */
#log-container::-webkit-scrollbar       { width: 6px; }
#log-container::-webkit-scrollbar-track { background: transparent; }
#log-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── BOUTON ── */
.btn-small {
    background: var(--border);
    color: var(--text-dim);
    border: none;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 11px;
    cursor: pointer;
    transition: background .15s;
}
.btn-small:hover { background: #3a4149; color: var(--text); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .grid-3 { grid-template-columns: 1fr; }
    main { padding: 12px; }
    header { padding: 12px 16px; }
}
