:root {
    --primary: #4361ee;
    --body-bg: #f0f2f5;
    --surface: #ffffff;
    --surface-2: #f8f9fa;
    --text: #1a1d23;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
}

[data-theme="dark"] {
    --body-bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #334155;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #676c74;
    --shadow: 0 1px 3px rgba(0,0,0,.3);
}

body {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    text-align: right;
    background: var(--body-bg);
    color: var(--text);
    margin: 0;
    transition: all .3s;
}

a { color: var(--primary); }

/* Cards */
.card { border: none; box-shadow: var(--shadow); border-radius: 12px; background: var(--surface); color: var(--text); }
.card-header { background: var(--surface); border-bottom: 1px solid var(--border); color: var(--text); }
.card-footer { background: var(--surface); border-top: 1px solid var(--border); }

/* Stat cards */
.stat-card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 24px 20px; text-align: center; transition: transform .2s, box-shadow .2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,.12); }
.stat-card .stat-icon { width: 56px; height: 56px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 16px; }
.stat-card .stat-number { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.stat-card .stat-label { color: var(--text-secondary); font-size: .85rem; margin-top: 8px; font-weight: 500; }

/* Tables */
.table { color: var(--text); border-color: var(--border); }
.table th { background: var(--surface-2); color: var(--text-secondary); border-color: var(--border); }
.table td { border-color: var(--border); color: var(--text); }
.table-hover tbody tr:hover { background: var(--surface-2); }
.table-striped > tbody > tr:nth-of-type(odd) > td { background-color: var(--surface); }
.table-striped > tbody > tr:nth-of-type(even) > td { background-color: var(--surface-2); }
tr { color: var(--text); }
td { color: var(--text); }
.pagination .page-item.active a{color:white}
/* Forms */
.form-control, .form-select { background: var(--surface); color: var(--text); border-color: var(--border); }
.form-control:focus, .form-select:focus { background: var(--surface); color: var(--text); border-color: var(--primary); }
.form-label { color: var(--text); }
.form-check-label { color: var(--text); }
.input-group-text { background: var(--surface-2); color: var(--text); border-color: var(--border); }

/* Bootstrap overrides for dark mode */
[data-theme="dark"] .bg-white { background-color: var(--surface) !important; }
[data-theme="dark"] .bg-light { background-color: var(--surface-2) !important; }
[data-theme="dark"] .text-dark { color: var(--text) !important; }
[data-theme="dark"] .text-muted { color: var(--text-secondary) !important; }
[data-theme="dark"] .border { border-color: var(--border) !important; }
[data-theme="dark"] .border-top { border-color: var(--border) !important; }
[data-theme="dark"] .border-bottom { border-color: var(--border) !important; }
[data-theme="dark"] .card-footer { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .page-link { color: var(--primary); background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
[data-theme="dark"] .alert-success { background: rgba(16,185,129,.15); color: #10b981; border-color: rgba(16,185,129,.3); }
[data-theme="dark"] .alert-danger { background: rgba(239,68,68,.15); color: #ef4444; border-color: rgba(239,68,68,.3); }
[data-theme="dark"] .table td { background: var(--surface-2); color: var(--text-secondary); border-color: var(--border); }
/* Signal types */
.signal-type-buy { color: #10b981; font-weight: 600; }
.signal-type-sell { color: #ef4444; font-weight: 600; }

/* Validation */
.validation-message { color: #ef4444; font-size: .82rem; }

/* Theme toggle */
.theme-toggle { cursor: pointer; width: 48px; height: 26px; border-radius: 13px; background: #475569; position: relative; border: none; padding: 0; }
.theme-toggle::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fbbf24; transition: transform .3s; }
[data-theme="dark"] .theme-toggle::after { transform: translateX(-22px); background: #818cf8; }
.theme-toggle .bi { position: absolute; top: 5px; font-size: .75rem; color: white; }
.theme-toggle .bi-brightness-high { left: 6px; }
.theme-toggle .bi-moon { right: 6px; display: none; }
[data-theme="dark"] .theme-toggle .bi-brightness-high { display: none; }
[data-theme="dark"] .theme-toggle .bi-moon { display: inline; }

/* Page header */
.page-header h2 { font-weight: 700; color: var(--text); }

/* Buttons */
.btn { border-radius: 8px; }

/* Badge */
.badge { border-radius: 6px; padding: 5px 10px; }

/* Toast */
.toast-container { position: fixed; top: 20px; left: 20px; z-index: 9999; }

/* Top navbar */
.top-navbar { background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }

/* Dropdown */
.dropdown-menu { background: var(--surface); border-color: var(--border); }
.dropdown-item { color: var(--text); }
.dropdown-item:hover { background: var(--surface-2); color: var(--text); }

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }

        .sidebar.show {
            width: 260px;
        }

    .main-content {
        margin-right: 0;
    }

    .navbar-nav {
        align-items: start !important
    }

}


