/**
 * Fluent Design System - Marketing Agency Panel v4.0
 * Internal Font + Lucide SVG Icons Support
 */

/* ═══════════════════════════════════════════════════════
   ۱. بارگذاری فونت وزیرمتن از مسیر داخلی
   ═══════════════════════════════════════════════════════ */
@import url('/public/assets/fonts/vazirmatn/vazirmatn.css');

:root {
    --primary: #2F7DEA;
    --primary-hover: #1E5FB8;
    --primary-light: #E6F0FA;
    --primary-dark: #154A8A;
    --primary-shadow: rgba(47, 125, 234, 0.25);
    --success: #10B981;
    --success-light: #D1FAE5;
    --success-dark: #065F46;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --warning-dark: #92400E;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --danger-dark: #991B1B;
    --info: #3B82F6;
    --info-light: #DBEAFE;
    --info-dark: #1E40AF;
    --purple: #8B5CF6;
    --purple-light: #EDE9FE;
    --bg-body: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-muted: #F1F5F9;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --border-color: #E2E8F0;
    --border-light: #F1F5F9;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    --shadow-primary: 0 4px 14px rgba(47, 125, 234, 0.35);
    --shadow-focus: 0 0 0 3px rgba(47, 125, 234, 0.2);
    --shadow-success: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
    --shadow-warning: 0 10px 25px -5px rgba(245, 158, 11, 0.4);
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 32px;
    --radius-full: 9999px;
    --font-family: 'Vazirmatn', Tahoma, system-ui, -apple-system, sans-serif;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 280px;
}

/* ═══════════════════════════════════════════════════════
   ۲. استایل‌های پایه آیکون‌های SVG (Lucide)
   ═══════════════════════════════════════════════════════ */
.lucide-icon {
    display: inline-block;
    vertical-align: middle;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* تطبیق آیکون‌ها با اجزای UI */
.nav-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-muted, #F1F5F9);
    color: var(--text-main);
    transition: all var(--transition-fast);
    flex-shrink: 0;
    font-size: 1.1rem;
}

.nav-icon .lucide-icon {
    width: 20px;
    height: 20px;
}

.nav-item:hover .nav-icon { 
    background: var(--primary-100, #DBEAFE); 
    color: var(--primary);
    transform: scale(1.05); 
}

.nav-item.active .nav-icon { 
    background: rgba(255, 255, 255, 0.2); 
    color: white;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal);
}

.stat-icon .lucide-icon {
    width: 28px;
    height: 28px;
}

.stat-card:hover .stat-icon { 
    transform: scale(1.1) rotate(-5deg); 
}

/* آیکون در بج‌ها و دکمه‌ها */
.badge, .btn, .card-title, .alert {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge .lucide-icon {
    width: 14px;
    height: 14px;
}

.btn .lucide-icon {
    width: 16px;
    height: 16px;
}

.card-title .lucide-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

/* ═══════════════════════════════════════════════════════
   ۳. Reset و استایل‌های عمومی
   ═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-family);
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(47, 125, 234, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-hover); }

h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

img { max-width: 100%; height: auto; }

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 20px 28px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

.page-title {
    font-size: 1.5rem;
    color: var(--text-main);
    margin: 0;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

.page-title::before {
    content: '';
    width: 6px;
    height: 28px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-full);
}

/* ═══════════════════════════════════════════════════════
   کارت‌ها
   ═══════════════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 28px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.card:hover { box-shadow: var(--shadow-lg); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--border-light);
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 1.15rem;
    color: var(--text-main);
    margin: 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ═══════════════════════════════════════════════════════
   کارت‌های آماری
   ═══════════════════════════════════════════════════════ */
.stat-card {
    background: var(--bg-card);
    padding: 26px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-shadow) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--duration-slow);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal);
}

.stat-card:hover .stat-icon { transform: scale(1.1) rotate(-5deg); }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-detail {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-top: 4px;
    line-height: 1.5;
}

.stat-card.pending {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    border-color: #FDE68A;
}
.stat-card.pending .stat-icon { background: var(--warning-gradient, linear-gradient(135deg, #F59E0B, #D97706)); color: white; box-shadow: var(--shadow-warning); }
.stat-card.pending .stat-label,
.stat-card.pending .stat-value { color: var(--warning-dark); }

.stat-card.receivable,
.stat-card.income {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border-color: #A7F3D0;
}
.stat-card.receivable .stat-icon,
.stat-card.income .stat-icon { background: linear-gradient(135deg, #10B981, #059669); color: white; box-shadow: var(--shadow-success); }
.stat-card.receivable .stat-label,
.stat-card.receivable .stat-value,
.stat-card.income .stat-label,
.stat-card.income .stat-value { color: var(--success-dark); }

/* ═══════════════════════════════════════════════════════
   دکمه‌ها
   ═══════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    font-family: var(--font-family);
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1.5;
    white-space: nowrap;
    user-select: none;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: linear-gradient(135deg, #3B82F6, #1D4ED8); color: white; box-shadow: var(--shadow-primary); }
.btn-primary:hover { color: white; filter: brightness(1.05); box-shadow: 0 15px 30px -5px rgba(47, 125, 234, 0.5); }

.btn-secondary { background: white; color: var(--primary); border-color: var(--primary); }
.btn-secondary:hover { background: var(--primary-light); color: var(--primary-hover); }

.btn-success { background: linear-gradient(135deg, #10B981, #059669); color: white; box-shadow: var(--shadow-success); }
.btn-warning { background: linear-gradient(135deg, #F59E0B, #D97706); color: white; box-shadow: var(--shadow-warning); }
.btn-danger { background: linear-gradient(135deg, #EF4444, #DC2626); color: white; box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.4); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-subtle, #F1F5F9); color: var(--text-main); }

.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-light { background: white; color: var(--primary); box-shadow: var(--shadow-sm); }

/* ═══════════════════════════════════════════════════════
   فرم‌ها
   ═══════════════════════════════════════════════════════ */
.form-group { margin-bottom: 22px; }

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-control {
    display: block;
    width: 100%;
    padding: 12px 12px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: white;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:hover { border-color: #CBD5E1; }
.form-control:focus { border-color: var(--primary); box-shadow: var(--shadow-focus); background-color: white; }
.form-control::placeholder { color: var(--text-light); }
.form-control[readonly] { background-color: var(--bg-subtle, #F1F5F9); cursor: not-allowed; }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-left: 44px;
    cursor: pointer;
}

textarea.form-control { resize: vertical; min-height: 100px; }

input[type="file"].form-control {
    padding: 10px;
    background: var(--bg-subtle, #F1F5F9);
    cursor: pointer;
    border-style: dashed;
}

input[type="file"].form-control::file-selector-button {
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    color: white;
    border: none;
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 600;
    margin-left: 12px;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════
   جداول
   ═══════════════════════════════════════════════════════ */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    text-align: right;
}

.table th, .table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    font-size: 0.92rem;
}

.table th {
    background: linear-gradient(180deg, #F9FAFB 0%, #F3F4F6 100%);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1;
}

.table tbody tr { transition: all var(--transition-fast); }
.table tbody tr:hover { background: linear-gradient(90deg, var(--primary-light) 0%, transparent 100%); }

/* ═══════════════════════════════════════════════════════
   بج‌ها
   ═══════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    line-height: 1;
   white-space: nowrap;
    overflow-x: auto;
}

.badge-success { background: var(--success-light); color: var(--success-dark); }
.badge-warning { background: var(--warning-light); color: var(--warning-dark); }
.badge-danger { background: var(--danger-light); color: var(--danger-dark); }
.badge-info { background: var(--info-light); color: var(--info-dark); }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-secondary { background: var(--bg-muted); color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════
   هشدارها
   ═══════════════════════════════════════════════════════ */
.alert {
    padding: 16px 22px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    border-right: 4px solid;
    font-size: 0.95rem;
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: var(--success-light); border-color: var(--success); color: var(--success-dark); 
margin-right: 21%;
    margin-top: 1%;
    margin-bottom: -2%;
}
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: var(--warning-dark); }
.alert-danger { background: var(--danger-light); border-color: var(--danger); color: var(--danger-dark); }
.alert-info { background: var(--info-light); border-color: var(--info); color: var(--info-dark); }

/* ═══════════════════════════════════════════════════════
   تب‌ها
   ═══════════════════════════════════════════════════════ */
.tab-btn {
    padding: 13px 28px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-card);
    cursor: pointer;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    font-weight: 700;
    font-family: var(--font-family);
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    margin-left: -1px;
}

.tab-btn:hover { background: var(--primary-light); color: var(--primary); }
.tab-btn.active {
    background: var(--bg-card);
    border-bottom-color: transparent;
    color: var(--primary);
    box-shadow: 0 -3px 0 var(--primary) inset;
    z-index: 2;
}

.tab-content {
    display: none;
    padding: 28px;
    border: 1.5px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: var(--bg-card);
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════
   سایدبار (با پشتیبانی از لوگو و آواتار تصویری)
   ═══════════════════════════════════════════════════════ */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-body);
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    box-shadow: -4px 0 20px rgba(15, 23, 42, 0.04);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: var(--radius-full); }

/* ✅ هدر سایدبار با پشتیبانی از لوگوی تصویری */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
    min-height: 80px;
}

/* ✅ لوگوی سایدبار - هم حرفی هم تصویری */
.sidebar-logo {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.3rem;
    box-shadow: var(--shadow-primary);
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: white;
}

.sidebar-logo.small {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 1rem;
}

.sidebar-header h3 {
    color: var(--text-main);
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.sidebar-header small {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 14px 6px;
    margin-top: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary, #334155);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    transition: all var(--transition-fast);
    font-weight: 600;
    font-size: 0.92rem;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: 0 3px 3px 0;
    transition: height var(--transition-fast);
}

.nav-item:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateX(-3px);
}

.nav-item.active {
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    color: white;
    box-shadow: var(--shadow-primary);
}

.nav-item.active::before { height: 70%; background: white; }
.nav-item.active:hover { transform: none; }

.nav-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: var(--bg-subtle, #F1F5F9);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.nav-item:hover .nav-icon { background: var(--primary-100, #DBEAFE); transform: scale(1.05); }
.nav-item.active .nav-icon { background: rgba(255, 255, 255, 0.2); }

.nav-title { font-size: 0.92rem; }

/* ✅ فوتر سایدبار با پشتیبانی از آواتار تصویری */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-subtle, #F1F5F9);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
}

/* ✅ آواتار کاربر - هم حرفی هم تصویری */
.user-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details { flex: 1; min-width: 0; }
.user-details strong {
    display: block;
    font-size: 0.88rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
}
.user-details small {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    padding: 32px;
    max-width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    animation: fadeIn 0.3s ease-out;
}

/* ═══════════════════════════════════════════════════════
   کارت پرسنلی
   ═══════════════════════════════════════════════════════ */
.id-card {
    background: linear-gradient(135deg, #1E3A8A 0%, #2F7DEA 100%);
    color: white;
    border-radius: var(--radius-2xl);
    padding: 0;
    box-shadow: 0 20px 40px -10px rgba(47, 125, 234, 0.5);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.id-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.id-card-header {
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
}

.id-card-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.id-card-info h2 {
    color: white;
    margin: 0 0 6px 0;
    font-size: 1.4rem;
    font-weight: 800;
}

.id-role {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.id-code {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.7;
    font-family: monospace;
    letter-spacing: 1px;
}

.id-card-details {
    padding: 24px 28px;
    background: rgba(0, 0, 0, 0.15);
}

.id-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
}

.id-row:last-child { border-bottom: none; }
.id-row span { opacity: 0.8; }
.id-row strong { font-weight: 700; letter-spacing: 0.5px; }

/* ═══════════════════════════════════════════════════════
   لیست فایل‌های ضمیمه
   ═══════════════════════════════════════════════════════ */
.attachment-list {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.attachment-list li {
    padding: 16px 18px;
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    flex-wrap: wrap;
}

.attachment-list li:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateX(-4px);
    background: linear-gradient(135deg, var(--primary-light) 0%, #F1F5F9 100%);
}

.attachment-info { flex: 1; min-width: 200px; }
.attachment-info strong { display: block; color: var(--text-main); margin-bottom: 4px; font-weight: 700; }
.attachment-info small { color: var(--text-muted); font-size: 0.82rem; }

/* ═══════════════════════════════════════════════════════
   کیف پول
   ═══════════════════════════════════════════════════════ */
.wallet-card {
    background: linear-gradient(135deg, #10B981 0%, #059669 50%, #047857 100%);
    color: white;
    text-align: center;
    padding: 40px 32px;
    border-radius: var(--radius-2xl);
    box-shadow: 0 20px 40px -10px rgba(16, 185, 129, 0.4);
    position: relative;
    overflow: hidden;
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.wallet-card h3 {
    color: white;
    opacity: 0.95;
    margin-bottom: 12px;
    font-size: 1.05rem;
    position: relative;
    font-weight: 600;
}

.wallet-card .amount {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
    position: relative;
    font-variant-numeric: tabular-nums;
}

.wallet-card .description {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-bottom: 28px;
    position: relative;
}

.wallet-form {
    text-align: right;
    background: rgba(255, 255, 255, 0.15);
    padding: 22px;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
background: #2f6de8 !important;
}

.wallet-form .form-label { color: white; }
.wallet-form .form-control { background: rgba(255, 255, 255, 0.98); border: none; font-weight: 700; font-size: 1.1rem; }
.wallet-form .btn { background: white; color: var(--success-dark); font-weight: 700; margin-top: 14px; }

/* ═══════════════════════════════════════════════════════
   امضای دیجیتال
   ═══════════════════════════════════════════════════════ */
.signature-box {
    background: linear-gradient(135deg, var(--primary-light) 0%, #DBEAFE 100%);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--primary);
    margin: 20px 0;
}

.signature-box label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════
   مودال
   ═══════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    padding: 20px;
    animation: fadeIn var(--transition-fast) ease-out;
}

.modal-content {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-color);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════════════════
   صفحه ورود
   ═══════════════════════════════════════════════════════ */
.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-card {
    padding: 48px 40px;
    text-align: center;
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
}

.login-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    color: white;
    border-radius: var(--radius-xl);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-primary);
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ═══════════════════════════════════════════════════════
   لودینگ
   ═══════════════════════════════════════════════════════ */
.page-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease-out;
}

.page-loader.hidden { opacity: 0; pointer-events: none; }

.loader-spinner {
    width: 60px;
    height: 60px;
    position: relative;
}

.loader-spinner::before,
.loader-spinner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid transparent;
}

.loader-spinner::before {
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

.loader-spinner::after {
    border-bottom-color: var(--primary-400, #60A5FA);
    animation: spin 1.5s linear infinite reverse;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loader-text {
    margin-top: 20px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════
   Utility Classes
   ═══════════════════════════════════════════════════════ */
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }

/* ═══════════════════════════════════════════════════════
   ریسپانسیو - تبلت
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════
   ریسپانسیو - موبایل (بهینه‌سازی کامل)
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Reset Layout */
    :root { --sidebar-width: 0px; }
    
    body {
        padding-bottom: 0;
    }

    .admin-layout {
        flex-direction: column;
    }

    /* سایدبار به صورت Drawer */
    .sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: right 0.3s ease;
        border-left: 1px solid var(--border-color);
        box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    }

    .sidebar.open {
        right: 0;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* محتوای اصلی */
    .main-content {
        margin-right: 0;
        max-width: 100%;
        padding: 16px;
        padding-top: 80px; /* فضای هدر موبایل */
        padding-bottom: 90px; /* فضای bottom nav */
    }

    /* Grid ها - تک ستونه */
    .grid-2, .grid-3, .grid-4 {
grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Page Header */
    .page-header {
        padding: 16px;
        margin-bottom: 16px;
        flex-direction: column;
        align-items: stretch;
    }

    .page-title {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .page-title::before {
        width: 4px;
        height: 22px;
    }

    /* کارت‌ها - تمام عرض */
    .card {
        padding: 16px;
        margin-bottom: 16px;
        width: 100%;
        border-radius: var(--radius-lg);
    }

    .card-title {
        font-size: 1rem;
    }

    .card-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    /* کارت‌های آماری - تمام عرض */
    .stat-card {
        padding: 16px;
        width: 100%;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }

    .stat-icon .lucide-icon {
        width: 24px;
        height: 24px;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    /* جداول - تبدیل به کارت */
    .table-responsive {
        border-radius: var(--radius-lg);
        overflow: visible;
    }

    .table {
        display: block;
        background: transparent;
    }

    .table thead {
        display: none;
    }

    .table tbody {
        display: block;
    }

    .table tbody tr {
        display: block;
        background: white;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        padding: 12px;
        margin-bottom: 12px;
        box-shadow: var(--shadow-sm);
    }

    .table tbody tr:hover {
        background: var(--primary-light);
    }

    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-light);
        font-size: 0.9rem;
    }

    .table tbody td:last-child {
        border-bottom: none;
        justify-content: flex-end;
        padding-top: 12px;
    }

    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.8rem;
        margin-left: 8px;
    }

    /* دکمه‌ها - بزرگ‌تر برای لمس */
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        min-height: 44px;
        border-radius: var(--radius-md);
    }

    .btn-sm {
        padding: 8px 14px;
        font-size: 0.85rem;
        min-height: 38px;
    }

    .btn-lg {
        padding: 14px 24px;
    }

    .btn-block {
        width: 100%;
    }

    .d-flex.gap-1 {
        flex-wrap: wrap;
    }

    .d-flex.gap-1 .btn {
        flex: 1 1 calc(50% - 8px);
        min-width: 120px;
    }

    /* فرم‌ها */
    .form-control {
        padding: 12px 14px;
        font-size: 0.95rem;
        min-height: 44px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-label {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }

    select.form-control {
        height: 44px;
    }

    textarea.form-control {
        min-height: 100px;
    }

    /* مودال - تمام صفحه */
    .modal-overlay {
        padding: 0;
    }

    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        padding: 20px;
        overflow-y: auto;
    }

    /* کیف پول */
    .wallet-card {
        padding: 28px 20px;
    }

    .wallet-card .amount {
        font-size: 2rem;
    }

    /* کارت پرسنلی */
    .id-card-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .id-card-avatar {
        width: 70px;
        height: 70px;
    }

    .id-card-details {
        padding: 20px;
    }

    .id-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* لیست فایل‌ها */
    .attachment-list li {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .attachment-list li .btn {
        align-self: flex-end;
    }

    /* تب‌ها */
    .tab-btn {
        padding: 10px 16px;
        font-size: 0.88rem;
        flex: 1;
    }

    .tab-content {
        padding: 20px;
    }

    /* Alert */
    .alert {
        padding: 12px 14px;
        font-size: 0.85rem;
    }

    /* Badge */
    .badge {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    /* فیلدهای سفارشی محصول */
    .custom-field-row {
        padding: 12px;
    }

    .custom-field-row .grid-2 {
        grid-template-columns: 1fr;
    }

    .custom-field-row .btn-danger {
        position: static;
        margin-bottom: 8px;
    }

    /* ویرایشگر قالب */
    #htmlEditor {
        font-size: 11px;
        min-height: 200px;
    }

    /* Sidebar Footer */
    .sidebar-footer .user-info {
        padding: 8px;
    }

    .sidebar .nav-section-title {
        font-size: 0.7rem;
        padding: 10px 12px 4px;
    }

    .sidebar .nav-item {
        padding: 10px 12px;
    }
}

/* ═══════════════════════════════════════════════════════
   ریسپانسیو - موبایل کوچک
   ═══════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .container {
        padding: 0 14px;
    }
    .stat-card {
        padding: 14px;
    }
    .stat-value {
        font-size: 1.3rem;
    }
    .wallet-card .amount {
        font-size: 1.7rem;
    }
    .login-card {
        padding: 32px 24px;
    }
    .card {
        padding: 14px;
    }
    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

/* ═══════════════════════════════════════════════════════
   مخفی کردن عناصر دسکتاپ در موبایل
   ═══════════════════════════════════════════════════════ */
@media (min-width: 769px) {
    .mobile-header,
    .mobile-bottom-nav,
    .sidebar-overlay {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════
   پرینت
   ═══════════════════════════════════════════════════════ */
@media print {
    body { background: white; }
    .no-print, .sidebar, .btn, .page-header, .page-loader { display: none !important; }
    .card { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
    .main-content { margin: 0; padding: 0; max-width: 100%; }
    @page { size: A4; margin: 1.5cm; }
}

/* ═══════════════════════════════════════════════════════
   اسکرول‌بار
   ═══════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-subtle, #F1F5F9); }
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-subtle, #F1F5F9);
}
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

::selection { background: var(--primary); color: white; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* چپ‌چین کردن المان‌های flex */
.justify-left {
    justify-content: flex-end !important; /* در RTL می‌شود چپ */
}

/* یا برای دکمه‌ها به صورت خاص */
.buttons-left {
    text-align: left !important;
}

.buttons-left .btn {
    margin-right: 0;
    margin-left: 8px; /* فاصله بین دکمه‌ها */
}

.buttons-left .btn:last-child {
    margin-left: 0;
}



/* ═══════════════════════════════════════════════════════
   Dark Mode Styles
   ═══════════════════════════════════════════════════════ */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-muted: #334155;
    --bg-subtle: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --border-color: #334155;
    --border-light: #1e293b;
    --primary-light: #1e3a8a; /* آبی تیره‌تر برای کنتراست بهتر */
}

/* اعمال تغییرات روی المان‌های خاص در حالت دارک */
[data-theme="dark"] .sidebar {
    background: #1e293b;
    border-left-color: #334155;
}

[data-theme="dark"] .table tbody tr {
    background: #1e293b;
}

[data-theme="dark"] .table tbody tr:hover {
    background: #334155;
}

[data-theme="dark"] .form-control {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .form-control:focus {
    background-color: #0f172a;
    border-color: var(--primary);
}

[data-theme="dark"] .modal-content {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .page-header {
    background: #1e293b;
    border-color: #334155;
}

/* انیمیشن نرم برای تغییر رنگ‌ها */
body, .card, .sidebar, .table tbody tr, .form-control, .modal-content, .page-header, .btn {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
/* ═══════════════════════════════════════════════════════
   DARK MODE COMPLETE SYSTEM (حالت شب کامل)
   ═══════════════════════════════════════════════════════ */
[data-theme="dark"] {
    /* متغیرهای اصلی تاریک */
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-muted: #334155;
    --bg-subtle: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --border-color: #334155;
    --border-light: #1e293b;
    --primary-light: #1e3a8a;
    
    /* سایه‌های متناسب با پس‌زمینه تیره */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.6);
}

/* انیمیشن نرم برای تمام تغییرات */
[data-theme="dark"] body, 
[data-theme="dark"] .card, 
[data-theme="dark"] .sidebar, 
[data-theme="dark"] .table tbody tr, 
[data-theme="dark"] .form-control, 
[data-theme="dark"] .modal-content, 
[data-theme="dark"] .page-header, 
[data-theme="dark"] .btn,
[data-theme="dark"] .nav-item,
[data-theme="dark"] .tab-btn {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ۱. سایدبار و ناوبری */
[data-theme="dark"] .sidebar {
    background: var(--bg-card);
    border-left-color: var(--border-color);
}
[data-theme="dark"] .sidebar-header {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-card) 100%);
    border-bottom-color: var(--border-color);
}
[data-theme="dark"] .sidebar-footer {
    background: var(--bg-muted);
    border-top-color: var(--border-color);
}
[data-theme="dark"] .user-info {
    background: var(--bg-card);
    box-shadow: var(--shadow-xs);
}
[data-theme="dark"] .nav-item {
    color: var(--text-muted);
}
[data-theme="dark"] .nav-item:hover {
    background: var(--primary-light);
    color: #60a5fa;
}
[data-theme="dark"] .nav-icon {
    background: var(--bg-muted);
}
[data-theme="dark"] .nav-item.active .nav-icon {
    background: rgba(255, 255, 255, 0.15);
}

/* ۲. هدر صفحات و کارت‌ها */
[data-theme="dark"] .page-header {
    background: var(--bg-card);
    border-color: var(--border-color);
}
[data-theme="dark"] .card {
    background: var(--bg-card);
    border-color: var(--border-color);
}
[data-theme="dark"] .card-header {
    border-bottom-color: var(--border-light);
}

/* ۳. جداول */
[data-theme="dark"] .table-responsive {
    background: var(--bg-card);
    border-color: var(--border-color);
}
[data-theme="dark"] .table {
    background: var(--bg-card);
}
[data-theme="dark"] .table th {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: var(--text-muted);
    border-bottom-color: var(--border-color);
}
[data-theme="dark"] .table td {
    color: var(--text-main);
    border-bottom-color: var(--border-light);
}
[data-theme="dark"] .table tbody tr {
    background: var(--bg-card);
}
[data-theme="dark"] .table tbody tr:hover {
    background: var(--primary-light);
}

/* ۴. فرم‌ها و ورودی‌ها */
[data-theme="dark"] .form-control {
    background-color: var(--bg-body);
    color: var(--text-main);
    border-color: var(--border-color);
}
[data-theme="dark"] .form-control:hover {
    border-color: var(--text-light);
}
[data-theme="dark"] .form-control:focus {
    background-color: var(--bg-body);
    border-color: var(--primary);
}
[data-theme="dark"] .form-control[readonly] {
    background-color: var(--bg-muted);
}
[data-theme="dark"] input[type="file"].form-control {
    background: var(--bg-muted);
}
[data-theme="dark"] input[type="file"].form-control::file-selector-button {
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    color: white;
}
/* تغییر رنگ فلش下拉 منو در حالت شب */
[data-theme="dark"] select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* ۵. مودال‌ها */
[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.8);
}
[data-theme="dark"] .modal-content {
    background: var(--bg-card);
    border-color: var(--border-color);
}

/* ۶. تب‌ها */
[data-theme="dark"] .tab-btn {
    background: var(--bg-muted);
    border-color: var(--border-color);
    color: var(--text-muted);
}
[data-theme="dark"] .tab-btn:hover {
    background: var(--primary-light);
    color: #60a5fa;
}
[data-theme="dark"] .tab-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    border-bottom-color: transparent;
}
[data-theme="dark"] .tab-content {
    background: var(--bg-card);
    border-color: var(--border-color);
}

/* ۷. اجزای خاص */
[data-theme="dark"] .attachment-list li {
    background: var(--bg-muted);
    border-color: var(--border-color);
}
[data-theme="dark"] .attachment-list li:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}
[data-theme="dark"] .wallet-form {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2);
}
[data-theme="dark"] .wallet-form .form-control {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
}

/* ۸. صفحه لودینگ (بسیار مهم برای جلوگیری از فلش سفید) */
[data-theme="dark"] .page-loader {
    background: rgba(15, 23, 42, 0.98);
}
[data-theme="dark"] .loader-text {
    color: #60a5fa;
}

/* ۹. اسکرول‌بارها */
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-body);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
    border: 2px solid var(--bg-body);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ۱۰. اصلاح بج‌ها و آلرت‌ها برای کنتراست بهتر در شب */
[data-theme="dark"] .badge-secondary {
    background: #334155;
    color: #cbd5e1;
}
[data-theme="dark"] .alert-info {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #93c5fd;
}