@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: bold;
}

body { font-family: 'Vazirmatn', sans-serif; background: #f3f4f6; margin: 0; color: #374151; }
* { box-sizing: border-box; }

/* ساختار کلی */
.crm-wrapper { padding-bottom: 2rem; min-height: 100vh; }
.crm-container { max-width: 1000px; margin: 0 auto; padding: 0 1rem; }
.crm-header { background: #1e293b; color: #fff; padding: 1.5rem 0 3rem; margin-bottom: -2rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.crm-flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }

/* کارت‌ها */
.crm-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); padding: 1.5rem; margin-bottom: 1rem; border: 1px solid #e5e7eb; }
.crm-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; position: relative; z-index: 2; }
.stat-value { font-size: 1.5rem; font-weight: bold; display: block; }
.stat-label { font-size: 0.8rem; color: #6b7280; }
.border-blue { border-bottom: 4px solid #3b82f6; }
.border-indigo { border-bottom: 4px solid #6366f1; }
.crm-actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.crm-action-card { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: inherit; transition: transform 0.2s; border-bottom: 2px solid transparent; }
.crm-action-card:hover { transform: translateY(-3px); }
.action-icon { font-size: 1.5rem; margin-bottom: 0.5rem; background: #f3f4f6; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }

/* دکمه‌ها */
.crm-btn { padding: 0.5rem 1rem; border-radius: 6px; text-decoration: none; border: none; cursor: pointer; color: #fff; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 0.5rem; transition: background 0.2s; }
.crm-btn-primary { background: #C5A059; color: #fff; }
.crm-btn-primary:hover { background: #b08d4b; }
.crm-btn-danger { background: #ef4444; }
.crm-btn-light { background: #e5e7eb; color: #333; }
.crm-btn-sm { font-size: 0.75rem; padding: 0.3rem 0.6rem; }

/* فرم‌ها و ورودی‌ها */
.crm-input, .crm-select { padding: 0.75rem; border: 1px solid #d1d5db; border-radius: 6px; width: 100%; transition: border 0.2s; font-family: inherit; }
.crm-input:focus, .crm-select:focus { border-color: #C5A059; outline: none; background: #fff; }

/* استایل‌های اختصاصی ACF (بازنویسی استایل پیش‌فرض) */
.acf-fields { display: grid; grid-template-columns: 1fr; gap: 1rem; border: none !important; background: transparent !important; }
.acf-field { border: none !important; padding: 0 !important; width: 100% !important; }
.acf-label { margin-bottom: 0.3rem; }
.acf-label label { font-weight: bold; color: #374151; font-size: 0.9rem; }
.acf-input input, .acf-input textarea, .acf-input select {
    width: 100%; padding: 0.75rem; border: 1px solid #d1d5db; border-radius: 6px; font-family: 'Vazirmatn'; background: #f9fafb;
}
.acf-input input:focus, .acf-input textarea:focus, .acf-input select:focus {
    border-color: #C5A059; outline: none; background: #fff;
}
/* دکمه آپلود مدیا وردپرس */
.acf-image-uploader .button { background: #e5e7eb !important; border: none !important; color: #333 !important; }

/* استایل جدول نتایج */
.crm-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.crm-table th { background: #f9fafb; padding: 0.8rem; text-align: right; color: #6b7280; font-size: 0.8rem; }
.crm-table td { padding: 0.8rem; border-bottom: 1px solid #f3f4f6; }
.crm-loading { text-align: center; padding: 2rem; color: #9ca3af; }

/* ریسپانسیو */
@media(min-width: 600px) {
    .acf-fields { grid-template-columns: 1fr 1fr; }
    .acf-field[data-type="textarea"], .acf-field[data-type="wysiwyg"], .acf-field[data-name="contact_tags_text"], .acf-field[data-name="business_tags_text"] { grid-column: span 2; }
}

/* --- اضافه شده برای فاز ۳ (پروفایل‌ها) --- */

.crm-profile-header { padding-bottom: 4rem; }
.profile-title-box { display: flex; align-items: center; gap: 1rem; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; border: 3px solid #C5A059; object-fit: cover; background: #fff; }
.business-avatar { border-radius: 12px; border-color: #fff; object-fit: contain; padding: 5px; }
.profile-name { font-size: 1.8rem; font-weight: bold; margin: 0; line-height: 1.2; }
.profile-job { font-size: 0.9rem; opacity: 0.9; font-weight: 300; }
.header-actions { display: flex; gap: 0.5rem; }

.profile-container { margin-top: -3rem; position: relative; z-index: 10; }
.profile-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 1.5rem; }

/* المان‌های داخل کارت */
.card-title { margin-top: 0; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid #f3f4f6; font-size: 1rem; color: #374151; }
.text-gold { color: #C5A059; }
.text-indigo { color: #4f46e5; }
.mb-1 { margin-bottom: 1rem; }

.info-row { margin-bottom: 1rem; font-size: 0.9rem; }
.info-row .label { color: #9ca3af; display: block; font-size: 0.8rem; margin-bottom: 2px; }
.info-row .value { color: #374151; font-weight: 500; }
.info-row .link { text-decoration: none; color: #1f2937; }
.info-row .link:hover { color: #C5A059; }
.info-row .link-blue { color: #3b82f6; text-decoration: none; }
.border-top { border-top: 1px dashed #e5e7eb; padding-top: 1rem; margin-top: 1rem; }

.social-row { display: flex; gap: 0.5rem; margin-top: 1.5rem; }
.social-btn { font-size: 0.75rem; background: #f3f4f6; color: #6b7280; padding: 4px 8px; border-radius: 4px; text-decoration: none; border: 1px solid #e5e7eb; transition: 0.2s; }
.social-btn:hover { background: #e5e7eb; color: #374151; border-color: #d1d5db; }

.bio-content { line-height: 1.8; color: #4b5563; font-size: 0.95rem; text-align: justify; }

/* لیست فعالیت‌ها */
.activity-list { display: flex; flex-direction: column; gap: 0.75rem; }
.activity-item { background: #f9fafb; border: 1px solid #f3f4f6; padding: 0.75rem; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; transition: 0.2s; }
.activity-item:hover { border-color: #C5A059; background: #fff; }
.act-info { display: flex; align-items: center; gap: 0.5rem; }
.act-title { font-weight: bold; font-size: 0.9rem; color: #374151; }
.act-date { font-size: 0.75rem; color: #9ca3af; }

.badge { font-size: 0.7rem; padding: 2px 8px; border-radius: 99px; font-weight: bold; }
.badge-gray { background: #e5e7eb; color: #374151; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-green { background: #dcfce7; color: #166534; }
.crm-btn-success { background: #16a34a; color: white; }

/* گرید کارمندان */
.employees-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; }
.emp-card { display: flex; align-items: center; gap: 0.75rem; border: 1px solid #f3f4f6; padding: 0.75rem; border-radius: 8px; text-decoration: none; color: inherit; transition: 0.2s; }
.emp-card:hover { border-color: #C5A059; background: #f9fafb; }
.emp-card img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.emp-name { font-weight: bold; font-size: 0.9rem; }
.emp-job { font-size: 0.75rem; color: #9ca3af; }

.no-data { color: #9ca3af; font-style: italic; text-align: center; margin-top: 1rem; }

/* موبایل پروفایل */
@media (max-width: 768px) {
    .profile-grid { grid-template-columns: 1fr; }
    .crm-profile-header { padding-bottom: 2rem; margin-bottom: -1rem; }
    .profile-container { margin-top: 0; }
    .profile-title-box { flex-direction: column; text-align: center; }
    .crm-flex-between { justify-content: center; }
}