/* ============================================================
   STYLE.CSS - استایل جامع سامانه جامع مهدی
   ============================================================
   نسخه 4.1
   - یکپارچه‌سازی CSS از تمام صفحات
   - اضافه کردن Modal Overlay
   - اضافه کردن استایل‌های Sidebar
   ============================================================ */

/* ============================================================
   1. FONT - فونت وزیرمتن
   ============================================================ */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

/* ============================================================
   2. ROOT VARIABLES
   ============================================================ */
:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --success: #10B981;
    --success-light: #34D399;
    --warning: #F59E0B;
    --warning-light: #FBBF24;
    --danger: #EF4444;
    --danger-light: #F87171;
    --info: #06B6D4;
    --info-light: #67E8F9;
    --purple: #8B5CF6;
    --purple-light: #A78BFA;
    
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 16px 60px rgba(0, 0, 0, 0.10);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Vazirmatn', 'Tahoma', sans-serif;
}

/* ============================================================
   3. RESET و BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    background-color: #F1F5F9;
    color: var(--gray-800);
    line-height: 1.7;
}

a {
    text-decoration: none;
}

/* ============================================================
   4. NAVBAR - نوار ناوبری (برای حالت غیر لاگین)
   ============================================================ */
.navbar {
    background: #ffffff !important;
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 0;
    box-shadow: none;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--gray-900) !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand i {
    color: var(--primary);
    margin-left: 4px;
}

.nav-link {
    color: var(--gray-600) !important;
    font-weight: 500;
    padding: 8px 16px !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.9rem;
}

.nav-link i {
    margin-left: 6px;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-900) !important;
}

.nav-link.text-danger:hover {
    background: #FEF2F2 !important;
    color: #DC2626 !important;
}

/* ============================================================
   5. CARDS - کارت‌ها
   ============================================================ */
.card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    margin-bottom: 20px;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: #ffffff;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--gray-900);
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

.card-body {
    padding: 20px;
}

/* ============================================================
   6. BUTTONS - دکمه‌های عمومی
   ============================================================ */
.btn {
    font-weight: 500;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    border: none;
    transition: var(--transition);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: var(--font-family);
}

.btn-pastel {
    background: var(--primary);
    color: #ffffff;
}

.btn-pastel:hover {
    background: var(--primary-dark);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.8rem;
}

/* ============================================================
   7. TABLES - جدول‌های عمومی
   ============================================================ */
.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 0.9rem;
}

.table th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* ============================================================
   8. FORMS - فرم‌ها
   ============================================================ */
.form-control, .form-select {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.9rem;
    transition: var(--transition);
    background: #ffffff;
    font-family: var(--font-family);
    width: 100%;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-bottom: 4px;
    display: block;
}

/* ============================================================
   9. BADGES - بج‌ها
   ============================================================ */
.badge {
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.bg-primary { background: var(--primary) !important; color: #fff; }
.bg-success { background: var(--success) !important; color: #fff; }
.bg-danger { background: var(--danger) !important; color: #fff; }
.bg-warning { background: var(--warning) !important; color: #fff; }
.bg-info { background: var(--info) !important; color: #fff; }
.bg-secondary { background: var(--gray-400) !important; color: #fff; }

/* ============================================================
   10. STATS GRID - شبکه آماری
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card-modern {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 20px 22px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon-wrap {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    transition: var(--transition);
}

.stat-card-modern:hover .stat-icon-wrap {
    transform: scale(1.05) rotate(2deg);
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-800);
    display: block;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray-500);
    font-weight: 500;
}

.stat-change {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 30px;
    display: inline-block;
    margin-top: 2px;
}

.stat-change.up {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-change.down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ============================================================
   11. FILTER SECTION - بخش فیلتر
   ============================================================ */
.filter-section {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    transition: var(--transition);
}

.filter-section:hover {
    box-shadow: var(--shadow-md);
}

.filter-section .form-control,
.filter-section .form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-200);
    padding: 8px 14px;
    font-size: 0.9rem;
    height: 42px;
}

.filter-section .form-control:focus,
.filter-section .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.06);
}

/* ============================================================
   12. BUTTONS PREMIUM - دکمه‌های حرفه‌ای
   ============================================================ */
.btn-premium-primary,
.btn-premium-info,
.btn-premium-success,
.btn-premium-danger,
.btn-premium-secondary {
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 20px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
    cursor: pointer;
    font-family: var(--font-family);
    height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-premium-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.2);
}

.btn-premium-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(79, 70, 229, 0.25);
    color: #fff;
}

.btn-premium-info {
    background: linear-gradient(135deg, var(--info), var(--info-light));
    color: #fff;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.2);
}

.btn-premium-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(6, 182, 212, 0.25);
    color: #fff;
}

.btn-premium-success {
    background: linear-gradient(135deg, var(--success), var(--success-light));
    color: #fff;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
}

.btn-premium-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.25);
    color: #fff;
}

.btn-premium-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-light));
    color: #fff;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

.btn-premium-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.25);
    color: #fff;
}

.btn-premium-secondary {
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
}

.btn-premium-secondary:hover {
    transform: translateY(-2px);
    background: var(--gray-200);
    color: var(--gray-800);
}

/* ============================================================
   13. TABLE MODERN - جدول مدرن
   ============================================================ */
.table-wrapper {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.table-wrapper:hover {
    box-shadow: var(--shadow-md);
}

.table-wrapper .table-header {
    padding: 16px 20px;
    background: rgba(249, 250, 251, 0.6);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.table-wrapper .table-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 0;
}

.table-modern thead th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    border-bottom: 2px solid var(--gray-200);
    text-align: right;
    white-space: nowrap;
}

.table-modern tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    color: var(--gray-700);
}

.table-modern tbody tr:hover {
    background: rgba(79, 70, 229, 0.03);
}

.table-modern tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5);
}

/* ============================================================
   14. BADGE STATUS - بج وضعیت
   ============================================================ */
.badge-status {
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-status.active { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.badge-status.completed { background: rgba(79, 70, 229, 0.12); color: var(--primary); }
.badge-status.pending { background: rgba(245, 158, 11, 0.12); color: #D97706; }
.badge-status.withdrawn { background: rgba(239, 68, 68, 0.12); color: #DC2626; }
.badge-status.contact-called { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.badge-status.contact-not-called { background: rgba(156, 163, 175, 0.12); color: #6B7280; }
.badge-status.contact-waiting { background: rgba(245, 158, 11, 0.12); color: #D97706; }
.badge-status.contact-no-answer { background: rgba(239, 68, 68, 0.12); color: #DC2626; }
.badge-status.docs-completed { background: rgba(59, 130, 246, 0.12); color: #2563EB; }
.badge-status.docs-approved { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.badge-status.docs-pending { background: rgba(245, 158, 11, 0.12); color: #D97706; }
.badge-status.docs-withdrawn { background: rgba(239, 68, 68, 0.12); color: #DC2626; }
.badge-status.payment-paid { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.badge-status.payment-unpaid { background: rgba(239, 68, 68, 0.12); color: #DC2626; }
.badge-status.payment-waiting { background: rgba(245, 158, 11, 0.12); color: #D97706; }
.badge-status.payment-refund { background: rgba(139, 92, 246, 0.12); color: #7C3AED; }

/* ============================================================
   15. UPLOAD BOX - باکس آپلود
   ============================================================ */
.upload-box {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-md);
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: #FAFAFA;
    position: relative;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-box:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

.upload-box.drag-over {
    border-color: var(--primary);
    background: #EEF2FF;
}

.upload-box .file-input {
    display: none;
}

.upload-box .upload-placeholder i {
    font-size: 2.5rem;
    color: var(--gray-400);
    display: block;
    margin-bottom: 6px;
}

.upload-box .upload-placeholder span {
    font-weight: 500;
    color: var(--gray-700);
    display: block;
    font-size: 0.85rem;
}

.upload-box .upload-placeholder small {
    font-size: 0.7rem;
    color: var(--gray-400);
}

.upload-box .upload-preview {
    display: none;
    width: 100%;
    position: relative;
}

.upload-box .upload-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.upload-box .upload-preview .remove-file {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    font-size: 0.8rem;
}

.upload-box .upload-status {
    margin-top: 8px;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 6px;
    display: inline-block;
}

/* ============================================================
   16. TOAST - اعلان
   ============================================================ */
.toast-container-custom {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: 100%;
}

.toast-custom {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--success);
    animation: slideInRight 0.4s ease;
}

.toast-custom.error {
    border-left-color: var(--danger);
}

.toast-custom.warning {
    border-left-color: var(--warning);
}

@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   17. WELCOME BANNER - بنر خوش‌آمد
   ============================================================ */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 24px;
}

.welcome-banner h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
}

.welcome-banner p {
    margin: 8px 0 0;
    opacity: 0.9;
}

/* ============================================================
   18. QUICK ACTIONS - اقدامات سریع
   ============================================================ */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.quick-action-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 24px 20px 20px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
}

.quick-action-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
}

.quick-action-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.quick-action-card .qa-number {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 4px;
    display: block;
}

.quick-action-card .qa-label {
    font-size: 1rem;
    color: var(--gray-600);
    font-weight: 500;
}

.quick-action-card .qa-icon {
    position: absolute;
    left: 16px;
    top: 16px;
    font-size: 2rem;
    opacity: 0.08;
    color: var(--gray-800);
}

.quick-action-card.pending::before {
    background: linear-gradient(135deg, #EF4444, #F87171);
}
.quick-action-card.pending .qa-number {
    color: #EF4444;
}
.quick-action-card.docs::before {
    background: linear-gradient(135deg, #F59E0B, #FBBF24);
}
.quick-action-card.docs .qa-number {
    color: #F59E0B;
}
.quick-action-card.payment::before {
    background: linear-gradient(135deg, #8B5CF6, #A78BFA);
}
.quick-action-card.payment .qa-number {
    color: #8B5CF6;
}
.quick-action-card.referral::before {
    background: linear-gradient(135deg, #10B981, #34D399);
}
.quick-action-card.referral .qa-number {
    color: #10B981;
}

/* ============================================================
   19. STATS ROW - ردیف‌های آمار
   ============================================================ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.stats-col {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 18px 20px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.stats-col .col-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-col .col-title i {
    font-size: 0.9rem;
    color: var(--primary);
}

.stats-col .col-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.95rem;
}

.stats-col .col-item:last-child {
    border-bottom: none;
}

.stats-col .col-item .item-label {
    color: var(--gray-600);
}

.stats-col .col-item .item-value {
    font-weight: 600;
    color: var(--gray-800);
    background: var(--gray-50);
    padding: 0 14px;
    border-radius: 30px;
    font-size: 0.85rem;
}

/* ============================================================
   20. QUICK LISTS - لیست‌های سریع
   ============================================================ */
.quick-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.quick-list-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.quick-list-card .ql-header {
    background: var(--gray-50);
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quick-list-card .ql-header h6 {
    margin: 0;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-list-card .ql-body {
    padding: 10px 16px;
    max-height: 260px;
    overflow-y: auto;
}

.ql-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: var(--gray-800);
    transition: var(--transition);
}

.ql-item:last-child {
    border-bottom: none;
}

.ql-item:hover {
    background: var(--gray-50);
    padding-right: 6px;
    border-radius: var(--radius-sm);
}

.ql-item .ql-name {
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ql-item .ql-name small {
    font-weight: 400;
    color: var(--gray-500);
    font-size: 0.75rem;
}

/* ============================================================
   21. SEARCH SECTION - بخش جستجو
   ============================================================ */
.search-section {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 18px 22px;
    border: 1px solid var(--gray-200);
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}

.search-section .search-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-section .search-form input {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-200);
    padding: 10px 16px;
    font-size: 1rem;
    flex: 1;
    min-width: 200px;
    font-family: var(--font-family);
}

.search-section .search-form button {
    background: linear-gradient(135deg, var(--primary), var(--success));
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
}

/* ============================================================
   22. CALENDAR - تقویم
   ============================================================ */
.calendar-wrapper {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 20px 24px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.calendar-header h5 {
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
    color: var(--gray-800);
}

.calendar-header .nav-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.calendar-header .nav-buttons button {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 4px 14px;
    color: var(--gray-600);
    cursor: pointer;
}

.calendar-header .nav-buttons button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--gray-400);
    padding: 8px 0;
}

.calendar-day {
    text-align: center;
    padding: 12px 0;
    border-radius: var(--radius-sm);
    background: var(--gray-50);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-600);
    border: 2px solid transparent;
    transition: var(--transition);
}

.calendar-day.has-member {
    background: rgba(79, 70, 229, 0.06);
    color: var(--primary);
    cursor: pointer;
    border-color: rgba(79, 70, 229, 0.12);
}

.calendar-day.has-member:hover {
    background: rgba(79, 70, 229, 0.12);
    transform: scale(1.05);
    border-color: var(--primary);
}

.calendar-day.today {
    border-color: var(--primary);
    font-weight: 700;
}

.calendar-day .day-count {
    font-size: 0.55rem;
    opacity: 0.6;
    display: block;
    margin-top: 2px;
}

/* ============================================================
   23. DASHBOARD CARD - کارت‌های داشبورد قدیمی
   ============================================================ */
.dashboard-card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.dashboard-card h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.dashboard-card .label {
    color: var(--gray-400);
    font-size: 0.85rem;
}

/* ============================================================
   24. FOOTER
   ============================================================ */
.footer {
    margin-top: auto;
    padding: 20px 0;
    color: var(--gray-400);
    font-size: 0.85rem;
    border-top: 1px solid var(--gray-200);
    background: #ffffff;
}

.footer a {
    color: var(--gray-500);
    transition: var(--transition);
}

.footer a:hover {
    color: var(--primary);
}

/* ============================================================
   25. RIPPLE EFFECT
   ============================================================ */
.ripple {
    position: relative;
    overflow: hidden;
}

@keyframes rippleAnim {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(4); opacity: 0; }
}

/* ============================================================
   26. ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-load {
    animation: fadeInUp 0.5s ease forwards;
}

/* ============================================================
   27. MODAL OVERLAY
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInModal 0.2s ease;
}

.modal-overlay.show {
    display: flex !important;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-box {
    background: #ffffff;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUpModal 0.3s ease;
    overflow: hidden;
}

@keyframes slideUpModal {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header-custom {
    padding: 18px 24px;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #F8FAFC;
}

.modal-body-custom {
    padding: 24px;
}

.modal-footer-custom {
    padding: 16px 24px;
    border-top: 1px solid #E2E8F0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #F8FAFC;
}

/* ============================================================
   28. RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    .quick-actions-grid,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .stats-row {
        grid-template-columns: 1fr 1fr;
    }
    .quick-lists {
        grid-template-columns: 1fr;
    }
    .stats-grid,
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        font-size: 0.95rem;
    }
    .navbar-brand {
        font-size: 1rem;
    }
    .card-header {
        font-size: 1rem;
        padding: 12px 16px;
    }
    .stats-grid,
    .quick-actions-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .stats-row {
        grid-template-columns: 1fr;
    }
    .stat-card-modern {
        padding: 14px 16px;
    }
    .stat-card-modern .stat-info .stat-number {
        font-size: 1.5rem;
    }
    .quick-action-card .qa-number {
        font-size: 2.6rem;
    }
    .table-modern {
        font-size: 0.8rem;
    }
    .table-modern thead th,
    .table-modern tbody td {
        padding: 6px 10px;
    }
    .filter-section {
        padding: 14px 16px;
    }
    .filter-section .row > [class*="col-"] {
        margin-bottom: 8px;
    }
    .btn-premium-primary,
    .btn-premium-info,
    .btn-premium-success,
    .btn-premium-danger,
    .btn-premium-secondary {
        width: 100%;
        justify-content: center;
        font-size: 0.8rem;
        padding: 6px 14px;
        height: 36px;
    }
    .calendar-grid {
        gap: 4px;
    }
    .calendar-day {
        padding: 8px 0;
        font-size: 0.85rem;
    }
    .search-section .search-form {
        flex-direction: column;
    }
    .search-section .search-form input {
        min-width: auto;
    }
    .table {
        font-size: 0.8rem;
    }
    .table th, .table td {
        padding: 8px 10px;
    }
    .dashboard-card h3 {
        font-size: 1.5rem;
    }
    .modal-box {
        max-width: 100%;
    }
    .modal-body-custom {
        padding: 18px;
    }
}

@media (max-width: 576px) {
    .stats-grid,
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    .calendar-wrapper {
        padding: 14px 16px;
    }
    .calendar-day {
        padding: 6px 0;
        font-size: 0.75rem;
    }
    .calendar-weekday {
        font-size: 0.65rem;
        padding: 4px 0;
    }
    .toast-container-custom {
        max-width: 320px;
        left: 10px;
        right: 10px;
        top: 10px;
    }
}

/* ============================================================
   29. SIDEBAR LAYOUT - استایل‌های جدید سایدبار
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    background: #ffffff;
    border-left: 1px solid var(--gray-200);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid var(--gray-100);
}

.sidebar-brand a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--gray-800);
}

.sidebar-brand i { font-size: 1.8rem; color: var(--primary); }
.sidebar-brand div { display: flex; flex-direction: column; }
.sidebar-brand span { font-weight: 700; font-size: 1.1rem; }
.sidebar-brand small { font-size: 0.75rem; color: var(--gray-400); }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 15px 10px;
}

.sidebar-section {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 20px 15px 8px 15px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.sidebar-link i { font-size: 1.1rem; width: 22px; text-align: center; }
.sidebar-link:hover { background: var(--gray-50); color: var(--primary); }
.sidebar-link.active { background: #EEF2FF; color: var(--primary); font-weight: 600; }
.sidebar-link.text-danger:hover { background: #FEF2F2; color: #DC2626 !important; }

.sidebar-badge {
    margin-right: auto;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
}

/* Main Content Layout */
.main-content {
    transition: margin-right 0.3s ease;
    min-height: 100vh;
    background: #F1F5F9;
}
.main-content.has-sidebar { margin-right: 260px; }

/* Mobile Toggle */
.sidebar-toggle-mobile {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1060;
    background: var(--primary);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}

@media (max-width: 992px) {
    .sidebar { transform: translateX(100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content.has-sidebar { margin-right: 0; }
    .sidebar-toggle-mobile { display: flex; align-items: center; justify-content: center; }
    .sidebar-overlay.show { display: block; }
}

/* ============================================================
   PORTAL UI REFRESH — نسخه بازطراحی رابط کاربری
   لایه ظاهری مشترک؛ بدون تغییر منطق فرم‌ها و عملیات موجود
   ============================================================ */
:root {
  --primary: #3157D5;
  --primary-light: #6F8DF0;
  --primary-dark: #2444B3;
  --app-ink: #17233B;
  --app-muted: #71809A;
  --app-line: #E5EAF2;
  --app-canvas: #F4F6FA;
  --app-sidebar: #14213D;
  --app-sidebar-muted: #A8B5CC;
  --shadow-sm: 0 2px 8px rgba(20,33,61,.045);
  --shadow-md: 0 12px 32px rgba(20,33,61,.075);
  --radius-md: 14px;
  --radius-lg: 19px;
}
html { background: var(--app-canvas); }
body { background: var(--app-canvas); color: var(--app-ink); }
.sidebar {
  width: 276px; background: var(--app-sidebar); border: 0; color: #fff;
  box-shadow: 8px 0 32px rgba(15,27,52,.10);
}
.sidebar-brand { padding: 24px 20px 21px; border-bottom: 1px solid rgba(255,255,255,.09); }
.sidebar-brand a { color: #fff; gap: 13px; }
.sidebar-brand i { width: 44px; height: 44px; display:flex; align-items:center; justify-content:center;
  border-radius: 14px; color: #fff; font-size: 1.45rem;
  background: linear-gradient(145deg,#5277ED,#3157D5); box-shadow: 0 8px 20px rgba(49,87,213,.28); }
.sidebar-brand span { font-size: .98rem; letter-spacing: -.2px; }
.sidebar-brand small { color: #A8B5CC; margin-top: 3px; }
.sidebar-nav { padding: 17px 12px 24px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.sidebar-section { color: #8292AF; margin: 22px 13px 9px; font-size: .68rem; letter-spacing: .2px; }
.sidebar-link { color: var(--app-sidebar-muted); padding: 11px 13px; border-radius: 11px; margin: 3px 0; font-size: .84rem; gap: 12px; }
.sidebar-link i { color: #93A6C8; font-size: 1.05rem; }
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.075); }
.sidebar-link:hover i { color: #fff; }
.sidebar-link.active { color: #fff; background: linear-gradient(100deg,rgba(75,112,225,.30),rgba(75,112,225,.12)); box-shadow: inset -3px 0 #7F9BFF; }
.sidebar-link.active i { color: #AFC1FF; }
.sidebar-link.text-danger { color: #FFB5B5 !important; }
.sidebar-link.text-danger i { color: #FFB5B5; }
.sidebar-link.text-danger:hover { background: rgba(239,68,68,.13); }
.sidebar-badge { background: #E05252; }
.main-content { background: var(--app-canvas); min-height: 100vh; }
.main-content.has-sidebar { margin-right: 276px; }
.main-content > .container-fluid { max-width: 1700px; padding: 26px 30px 38px !important; }
.app-topbar { min-height: 86px; padding: 15px 30px; display:flex; align-items:center; justify-content:space-between; gap:20px;
  background: rgba(255,255,255,.94); border-bottom:1px solid var(--app-line); box-shadow: 0 2px 10px rgba(20,33,61,.025); }
.app-topbar-title { min-width:0; }
.app-eyebrow { display:block; color:#8A97AD; font-size:.69rem; font-weight:600; margin-bottom:2px; }
.app-topbar h1 { color:var(--app-ink); font-size:1.13rem; font-weight:800; margin:0; }
.app-topbar-meta { display:flex; align-items:center; gap:20px; }
.app-date { display:flex; align-items:center; gap:8px; color:#78869D; font-size:.78rem; white-space:nowrap; }
.app-user-chip { display:flex; align-items:center; gap:9px; padding:6px 11px 6px 13px; border:1px solid var(--app-line); border-radius:13px; background:#fff; }
.app-user-chip b { display:block; color:#25334D; font-size:.76rem; font-weight:700; }
.app-user-chip small { display:block; color:#8A97AD; font-size:.67rem; margin-top:1px; }
.app-user-avatar { width:34px; height:34px; display:flex; align-items:center; justify-content:center; border-radius:10px; background:#EEF2FF; color:#3157D5; }
.card, .filter-section, .table-wrapper, .quick-list-card { border-color:var(--app-line); border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); }
.card:hover, .filter-section:hover, .table-wrapper:hover { box-shadow:var(--shadow-md); }
.card-header { border-color:var(--app-line); }
.form-control, .form-select { min-height:42px; border-color:#DCE3EE; border-radius:11px; }
.form-control:focus, .form-select:focus { border-color:#7892EA; box-shadow:0 0 0 3px rgba(49,87,213,.11); }
.btn { border-radius:10px; }
.btn-primary, .btn-pastel, .btn-premium-primary { background:linear-gradient(135deg,#4168E0,#3157D5); }
.table-wrapper { overflow-x:auto; }
.table-modern thead th, .table th { background:#F7F9FC; color:#66758E; }
.footer { background:transparent !important; border-top:1px solid var(--app-line) !important; color:#9AA5B7 !important; }
.sidebar-toggle-mobile { background:#3157D5; box-shadow:0 8px 22px rgba(49,87,213,.28); border-radius:13px; }
@media (max-width: 1200px) {
  .main-content.has-sidebar { margin-right:276px; }
  .main-content > .container-fluid { padding-right:22px !important; padding-left:22px !important; }
}
@media (max-width: 992px) {
  .main-content.has-sidebar { margin-right:0; }
  .sidebar { width:286px; transform:translateX(100%); }
  .sidebar.show { transform:translateX(0); }
  .app-topbar { padding:15px 76px 15px 18px; min-height:76px; }
  .app-topbar-meta { gap:8px; }
  .app-date { display:none; }
  .main-content > .container-fluid { padding:20px 16px 30px !important; }
  .sidebar-toggle-mobile { top:17px; right:17px; }
}
@media (max-width: 576px) {
  .app-topbar { align-items:flex-start; flex-direction:column; gap:9px; padding-top:15px; padding-bottom:13px; }
  .app-topbar h1 { font-size:1rem; }
  .app-user-chip { padding:4px 8px; }
  .main-content > .container-fluid { padding:15px 12px 25px !important; }
  .card-body { padding:15px; }
  .filter-section { padding:15px; }
  .table { min-width:650px; }
}
