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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 1.8rem;
}

.badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.badge.ACTIVE {
    background: #00c853;
}

.badge.STOPPED {
    background: #ff5252;
}

.badge.PAUSED {
    background: #ffc107;
    color: #000;
}

.badge.ERROR {
    background: #ff1744;
}

.badge.COOLDOWN {
    background: #ff9800;
}

.status-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.realtime-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    background: #0f1729;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #2196f3;
}

.realtime-panel .stat {
    background: transparent;
    padding: 10px;
}

.realtime-panel .stat span {
    font-size: 1.2rem;
    color: #2196f3;
}

.stat {
    background: #16213e;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat label {
    display: block;
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.stat span {
    font-size: 1.5rem;
    font-weight: bold;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

.btn-success {
    background: #00c853;
    color: #fff;
}

.btn-warning {
    background: #ffc107;
    color: #000;
}

.btn-danger {
    background: #ff5252;
    color: #fff;
}

.btn-secondary {
    background: #455a64;
    color: #fff;
}

.btn:hover {
    opacity: 0.9;
}

.trades {
    background: #16213e;
    border-radius: 10px;
    padding: 20px;
}

.trades h2 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.strategy {
    background: #16213e;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.strategy h2 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.setting {
    display: flex;
    flex-direction: column;
}

.setting label {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.setting input {
    padding: 10px;
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    background: #1a1a2e;
    color: #fff;
    font-size: 1rem;
}

.btn-primary {
    background: #2196f3;
    color: #fff;
}

#settings-status {
    margin-left: 10px;
    color: #00c853;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #2a2a4a;
}

th {
    color: #888;
    font-weight: 500;
}

.pnl-positive {
    color: #00c853;
}

.pnl-negative {
    color: #ff5252;
}

@media (max-width: 600px) {
    .status-panel {
        grid-template-columns: 1fr 1fr;
    }

    .controls {
        flex-direction: column;
    }
}


.logs {
    background: #16213e;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.logs h2 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

#logs-container {
    background: #0a0a15;
    border-radius: 6px;
    padding: 15px;
    font-family: monospace;
    font-size: 0.85rem;
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.6;
}

#logs-container div {
    color: #aaa;
}


.log-success {
    color: #00c853;
}

.log-error {
    color: #ff5252;
}

.log-warning {
    color: #ffc107;
}

.log-info {
    color: #aaa;
}