* {
    font-family: 'Vazirmatn', sans-serif;
}

body {
    background-color: #f4f6f9;
    margin: 0;
}

/* ---------- Layout with sidebar ---------- */
.sidebar {
    width: 240px;
    min-height: 100vh;
    background: linear-gradient(180deg, #1e2a4a 0%, #16213e 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1rem;
    position: sticky;
    top: 0;
}

.sidebar-brand {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.sidebar .nav-link {
    color: #c9d2e3;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: 0.15s;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar .nav-link.active {
    background: #3b5bdb;
    color: #fff;
}

.logout-form {
    margin-top: auto;
}

.sidebar-login-info {
    font-size: 0.78rem;
    color: #8f9bc2;
    padding: 0.5rem 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 0.5rem;
}

.sidebar-login-info a {
    color: #b9c6f5;
    text-decoration: none;
}

.sidebar-login-info a:hover {
    color: #fff;
    text-decoration: underline;
}

.content {
    min-height: 100vh;
}

.topbar {
    background: #fff;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e6e9f0;
    font-weight: 600;
}

/* ---------- Auth pages (login / forgot password) — split screen layout ---------- */
:root {
    --auth-accent: #6a5cf0;
    --auth-accent-dark: #5646d6;
}

.auth-split {
    min-height: 100vh;
    display: flex;
}

.auth-illustration {
    flex: 1 1 50%;
    background: linear-gradient(160deg, #f3f1ff 0%, #eef0fb 60%, #f7f8fd 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}

.auth-illustration svg {
    max-width: 380px;
    width: 100%;
    height: auto;
    margin-bottom: 2rem;
}

.auth-illustration h2 {
    font-weight: 800;
    font-size: 2rem;
    color: #232852;
    margin-bottom: 0.5rem;
}

.auth-illustration p {
    color: #6b7290;
    max-width: 380px;
}

.auth-form-panel {
    flex: 1 1 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-form-inner {
    width: 100%;
    max-width: 380px;
}

.auth-logo-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--auth-accent) 0%, var(--auth-accent-dark) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
}

.auth-logo-icon svg {
    width: 26px;
    height: 26px;
}

.auth-form-inner h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #232852;
    margin-bottom: 0.35rem;
}

.auth-form-inner p.subtitle {
    color: #8a93a6;
    margin-bottom: 1.75rem;
    font-size: 0.9rem;
    text-align: start;
}

.auth-form-inner label.form-label {
    font-size: 0.9rem;
    color: #444a63;
    font-weight: 600;
}

.auth-form-inner .form-control {
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    border-color: #e3e6f0;
}

.auth-form-inner .form-control:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 0.2rem rgba(106, 92, 240, 0.15);
}

.auth-password-wrapper {
    position: relative;
}

.auth-password-wrapper .form-control {
    padding-left: 2.5rem;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #8a93a6;
    cursor: pointer;
    padding: 0;
}

.btn-captcha-refresh {
    background: none;
    border: none;
    color: var(--auth-accent);
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
}

.btn-captcha-refresh:disabled {
    opacity: 0.5;
    cursor: default;
}

.btn-captcha-refresh:hover:not(:disabled) {
    color: var(--auth-accent-dark);
}

.auth-links-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.5rem 0 1.25rem;
    font-size: 0.85rem;
}

.auth-links-row a {
    color: var(--auth-accent);
    text-decoration: none;
}

.auth-links-row a:hover {
    text-decoration: underline;
}

.btn-auth-primary {
    background: linear-gradient(135deg, var(--auth-accent) 0%, var(--auth-accent-dark) 100%);
    border: none;
    padding: 0.7rem;
    font-weight: 600;
    border-radius: 10px;
    color: #fff;
    width: 100%;
}

.btn-auth-primary:hover {
    color: #fff;
    filter: brightness(1.05);
}

.auth-bottom-link {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.85rem;
}

.auth-bottom-link a {
    color: var(--auth-accent);
    text-decoration: none;
}

/* لوگوی سفارشی در صفحه ورود — محدودیت یکدست: حداکثر 150x200 پیکسل */
.auth-logo-image-container {
    max-width: 150px;
    max-height: 200px;
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
    border-radius: 18px;
    background: #f3f0ff;
    padding: 8px;
    box-shadow: 0 6px 18px rgba(106, 93, 255, 0.18);
    overflow: hidden;
}

.auth-logo-login-image {
    max-width: 150px;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* کلاس‌های قدیمی لوگو — نگهداری برای سازگاری */
.auth-logo-image-box {
    overflow: hidden;
    padding: 4px;
}

.auth-logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

@media (max-width: 900px) {
    .auth-illustration {
        display: none;
    }
}

/* ---------- Cards & tables ---------- */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

/* بلوک اخبار: رنگ‌بندی متمایز از بلوک‌های نامه‌های دریافتی/ارسالی (که با کارت سفید معمولی نمایش داده می‌شوند) */
.news-card {
    background: #fffaf0;
    border-inline-start: 4px solid #f0a500;
}

.news-card .card-header {
    background: #fff3d9;
    border-bottom: 1px solid #f5e0a8;
}

.stat-card {
    border-radius: 14px;
    padding: 1.5rem;
    color: #fff;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.stat-card span {
    opacity: 0.85;
    font-size: 0.9rem;
}

.table thead {
    background-color: #f0f2f7;
}

.table thead th {
    text-align: center;
}

.table tbody td {
    text-align: center;
}

/* رنگ متناوب واضح برای ردیف‌ها: هر ردیف یک‌دست، بدون تفاوت رنگ بین ستون‌های همان ردیف */
.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: #eef1f9;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #ffffff;
}

/* جداکننده‌ی نازک عمودی بین فیلدهای هر ردیف، به‌جای رنگ متفاوت */
.table > :not(caption) > * > * {
    border-inline-end: 1px solid #e3e6f0;
}

.table > :not(caption) > * > *:last-child {
    border-inline-end: none;
}

/* ---------- Utility classes (replace inline styles for strict CSP) ---------- */
.search-input {
    width: 280px;
}

.pre-line {
    white-space: pre-line;
}

.col-letter-number {
    width: 120px;
    white-space: nowrap;
    text-align: center;
    padding-inline-end: 1.5rem;
}

.stat-card-blue {
    background: #3b5bdb;
}

.stat-card-green {
    background: #0f9d58;
}

.stat-card-orange {
    background: #e67e22;
}

/* ---------- Required field marker ---------- */
.required-label::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* ---------- Customer/user avatar ---------- */
.avatar-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
}

.avatar-icon-lg {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    font-size: 2rem;
}

/* آواتار کوچک کنار نام مشتری در نوار بالای صفحه (پس‌زمینه‌ی روشن) */
.avatar-icon-nav {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e3e6f0;
}

.avatar-icon-nav-default {
    background: #eef0fb;
    color: #4b5170;
}

.stat-card-purple {
    background: #6c5ce7;
}

.stat-card-red {
    background: #e74c3c;
}

.narrow-card {
    max-width: 480px;
}

/* ---------- Centered utility pages (change password, etc.) ---------- */
.center-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #f3f1ff 0%, #eef0fb 60%, #f7f8fd 100%);
    padding: 2rem 1rem;
}

.center-page-card {
    background: #fff;
    border-radius: 18px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(35, 40, 82, 0.08);
    text-align: center;
}

.center-page-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--auth-accent) 0%, var(--auth-accent-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.center-page-card h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #232852;
    margin-bottom: 0.35rem;
}

.center-page-card p.subtitle {
    color: #8a93a6;
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.center-page-card form {
    text-align: start;
}

.center-page-card .btn-cancel {
    display: block;
    text-align: center;
    margin-top: 0.75rem;
    color: #8a93a6;
    text-decoration: none;
    font-size: 0.9rem;
}

.center-page-card .btn-cancel:hover {
    color: #444a63;
    text-decoration: underline;
}

/* ---------- Chat/conversation bubbles ---------- */
.msg-bubble-staff {
    border-right: 4px solid #3b5bdb;
    background: #f4f6ff;
}

.msg-bubble-customer {
    border-right: 4px solid #0f9d58;
    background: #f2fbf5;
}

/* ---------- صفحه‌بندی مشترک همه‌ی لیست‌ها ---------- */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pagination-summary {
    font-size: 0.85rem;
    color: #6c757d;
}

.pagination .page-link {
    cursor: pointer;
    border-color: #e3e6f0;
    color: #444a63;
}

.pagination .page-item.active .page-link {
    background: #3b5bdb;
    border-color: #3b5bdb;
}

.pagination .page-item.disabled .page-link {
    cursor: not-allowed;
    opacity: 0.55;
}

/* ---------- رمز موقت کاربر (پس از بازنشانی رمز) ---------- */
.temporary-password-box {
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px dashed #e2c9a0;
    border-radius: 8px;
    display: inline-block;
}

.temporary-password {
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    direction: ltr;
    display: inline-block;
    background: transparent;
    padding: 0;
    color: #b0401c;
    font-weight: 700;
}
