:root {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-content: #f7fafc;
    --text-light: #e2e8f0;
    --text-dark: #2d3748;
    --accent-color: #4299e1;
    --border-color: #4a5568;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-content);
    color: var(--text-dark);
    font-size: 16px;
}

.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--bg-primary);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.sidebar-header i {
    margin-right: 10px;
}

.menu ul {
    list-style-type: none;
    padding: 0;
    margin: 20px 0;
}

.menu ul li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--text-light);
    text-decoration: none;
    transition: background-color 0.2s;
}

.menu ul li a:hover {
    background-color: var(--bg-secondary);
}

.menu ul li.active a {
    background-color: var(--accent-color);
    font-weight: bold;
}

.menu ul li a i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
}

h1, h2 {
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
}
/* Card Styling */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    margin: 0;
    font-size: 1.1rem;
    border: none;
    padding: 0;
}

.card-body {
    padding: 20px;
}

/* Table Styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

table thead th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #4a5568;
}

table tbody tr:hover {
    background-color: #f9fafb;
}

/* Status & Signal Colors */
.pnl-profit {
    color: #10b981;
    font-weight: bold;
}
.pnl-loss {
    color: #ef4444;
    font-weight: bold;
}
.signal-long {
    color: #10b981;
    font-weight: bold;
}
.signal-short {
    color: #ef4444;
    font-weight: bold;
}

/* Alert Boxes */
.alert {
    padding: 15px;
    border-radius: 6px;
    border: 1px solid transparent;
}
.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}
.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

/* Log Box */
.log-box {
    width: 100%;
    height: 400px;
    background-color: #1a202c;
    color: #e2e8f0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    border: 1px solid #4a5568;
    border-radius: 6px;
    padding: 10px;
    box-sizing: border-box;
}

/* Button Styling */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.2s;
}
.btn:hover {
    opacity: 0.85;
}
.btn-danger {
    background-color: #ef4444;
    color: white;
}
/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card .card-body {
    display: flex;
    align-items: center;
    padding: 20px;
}

.summary-icon {
    font-size: 2rem;
    color: var(--accent-color);
    margin-right: 20px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e0f2fe;
    border-radius: 50%;
}

.summary-content h3 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: #6b7280;
}

.summary-content p {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
}
/* Settings Form */
.settings-form {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 20px;
}

.settings-column fieldset {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.settings-column legend {
    padding: 0 10px;
    font-weight: 600;
    color: var(--accent-color);
}

.input-group {
    margin-bottom: 15px;
}

.input-group label, .settings-form label {
    display: block;
    font-size: 0.9rem;
    color: #4a5568;
    margin-bottom: 5px;
}

.input-group input[type="text"],
.input-group input[type="number"],
.input-group input[type="password"],
.settings-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1rem;
}

.settings-form textarea {
    resize: vertical;
    font-family: 'Courier New', Courier, monospace;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.schedule-item input { width: 100px; }

.form-actions {
    padding: 20px;
    text-align: right;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}
.alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}
/* Top Performers List */
.top-performers-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.top-performers-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 5px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 1rem;
}

.top-performers-list li:last-child {
    border-bottom: none;
}

.top-performers-list li .performer-symbol {
    font-weight: 600;
}

.top-performers-list li .performer-pnl {
    font-family: 'Courier New', Courier, monospace;
}
/* Styling untuk sel ROI di tabel posisi aktif */
.roi-cell span {
    font-weight: bold;
    font-size: 1.1em;
}
/* --- Tampilan Mobile (Responsif) --- */
/* Terapkan style ini hanya jika lebar layar 768px atau kurang */
@media screen and (max-width: 768px) {
    
    .container {
        /* Biarkan sidebar keluar dari alur normal */
        flex-direction: row; 
    }

    /* 1. Sembunyikan sidebar di luar layar secara default */
    .sidebar {
        position: fixed; /* Tetap di layar saat scroll */
        left: 0;
        top: 0;
        width: 100%; /* Lebar menu sekarang penuh */
        height: auto; /* Tinggi menu menyesuaikan kontennya */
        z-index: 1000; /* Pastikan di atas konten */
        transform: translateY(-100%); /* Sembunyikan ke ATAS sejauh tingginya sendiri */
        transition: transform 0.3s ease-in-out;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Bayangan sekarang di bawah */
    }
    
    .sidebar.show {
        transform: translateY(0); /* Geser turun ke posisi normal */
    }

    /* 3. Atur konten utama agar memenuhi layar */
    .content {
        width: 100%;
        padding: 20px 15px; /* Kurangi padding di mobile */
    }

    
    
    h1 {
        padding-left: 45px; /* Beri ruang agar tidak tertutup tombol hamburger */
    }

    /* 5. Buat grid menjadi 1 kolom */
    .summary-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        padding: 10px;
    }

    /* 6. Overlay untuk latar belakang gelap saat menu terbuka */
    #overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    }

    #overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

/* --- Tombol Menu Mobile Baru (Bulat Merah) --- */

/* Sembunyikan di Desktop */
.mobile-menu-button {
    display: none;
}

@media screen and (max-width: 768px) {
    /* Tampilkan dan atur gaya tombol di Mobile */
    .mobile-menu-button {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed; /* Tetap di pojok layar */
        top: 15px;
        right: 15px; /* Pindah ke pojok KANAN */
        width: 50px;
        height: 50px;
        background-color: #ef4444; /* Warna merah */
        color: white;
        border: none;
        border-radius: 50%; /* Membuatnya menjadi bulat */
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        font-size: 20px;
        z-index: 1001; /* Pastikan di atas segalanya */
        cursor: pointer;
        transition: transform 0.2s;
    }

    .mobile-menu-button:hover {
        transform: scale(1.1);
    }
}
/* --- Styling untuk Log Real-time --- */
.log-container {
    background-color: #1a202c;
    border: 1px solid #4a5568;
    border-radius: 6px;
    height: 400px;
    overflow-y: auto; /* Aktifkan scroll vertikal */
    padding: 10px;
}

.log-box-realtime {
    color: #e2e8f0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    margin: 0;
    white-space: pre-wrap; /* Agar baris panjang otomatis pindah ke bawah */
    word-wrap: break-word;
}

.log-box-realtime .new-line {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Styling untuk sub-teks di kartu ringkasan */
.summary-subtext {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 4px;
}
.summary-subtext.pnl-profit {
    color: #166534; /* hijau lebih gelap */
}
.summary-subtext.pnl-loss {
    color: #991b1b; /* merah lebih gelap */
}

/* Styling untuk Kontrol Paginasi */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}