/* theme.css – Dark/Light Mode RTL Professional Design */
:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --sidebar-bg: #212529;
    --sidebar-text: #f8f9fa;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --shadow: 0 .125rem .25rem rgba(0,0,0,.075);
}

[data-bs-theme="dark"] {
    --bg-primary: #1a1d21;
    --bg-secondary: #2c3034;
    --text-primary: #e9ecef;
    --text-secondary: #adb5bd;
    --sidebar-bg: #1e2125;
    --sidebar-text: #ced4da;
    --border-color: #495057;
    --card-bg: #2c3034;
    --shadow: 0 .125rem .25rem rgba(0,0,0,.3);
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color .3s, color .3s;
    margin: 0;
    padding: 0;
    direction: rtl;
    text-align: right;
}
html, body {
    height: 100%;
}

.ltr-number {
    unicode-bidi: isolate;
    direction: ltr;
    display: inline-block;
}
/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1000;
    transition: all 0.3s;
    padding: 1rem;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}
.sidebar .brand {
    font-size: 1.5rem;
    font-weight: bold;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
}
.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: background 0.2s;
}
.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background-color: rgba(255,255,255,0.15);
    color: #fff;
}
.sidebar .nav-link i {
    margin-left: 0.5rem; /* RTL: icon on right side, text after, margin-left pushes icon away */
}
/* Main content */
/* Main content */
.main-content {
    margin-right: 280px;
    padding: 2rem;
    transition: margin 0.3s;
}
/* Top bar */
.top-bar {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}
/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}
.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
}
/* Mode toggle */
.theme-toggle {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.theme-toggle:hover {
    background: var(--bg-primary);
}
/* Buttons */
.btn-primary {
    background-color: #0d6efd; /* Bootstrap default, can override */
    border-color: #0d6efd;
}
/* Hide base mobile nav when on chat page */
body.chat-page .mobile-nav {
    display: none !important;
}
/* Chat sidebar fine-tuning */
#chatSidebarDesktop {
    transition: transform 0.3s ease;
}

/* Forms */
.form-control, .form-select {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.form-control:focus {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}
/* Responsive sidebar collapse */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
        width: 100%;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-right: 0;
    }
}

