/* ===========================================
   فرانت‌اند - پیام‌های کاربر
   =========================================== */
.cm-frontend-wrap {
    direction: rtl;
    font-family: 'Tahoma', 'Vazir', sans-serif;
}

/* هدر صفحه */
.cm-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #eee;
}

.cm-page-title {
    margin: 0;
    font-size: 22px;
    color: #333;
}

.cm-unread-badge {
    background: #dc3545;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
}

.cm-btn-outline {
    background: transparent;
    border: 1px solid #007cba;
    color: #007cba;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.cm-btn-outline:hover {
    background: #007cba;
    color: #fff;
}

/* ===========================================
   حالت خالی
   =========================================== */
.cm-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.cm-empty-icon {
    font-size: 60px;
    margin-bottom: 16px;
}

/* ===========================================
   آیتم پیام
   =========================================== */
.cm-messages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cm-message-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.cm-message-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cm-message-item.cm-unread {
    border-right: 4px solid #007cba;
    background: #f8fbff;
}

/* هدر پیام */
.cm-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.cm-message-header:hover {
    background: #f5f5f5;
}

.cm-message-item.cm-open .cm-message-header {
    background: #f0f7ff;
    border-bottom: 1px solid #ddd;
}

.cm-message-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cm-new-badge {
    background: #007cba;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.cm-message-subject {
    font-weight: bold;
    font-size: 15px;
    color: #333;
}

/* اکشن‌ها */
.cm-message-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cm-message-date {
    font-size: 12px;
    color: #999;
}

.cm-btn-read {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
}

.cm-btn-read:hover {
    background: #218838;
}

.cm-btn-delete {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
    
}

.cm-btn-delete:hover {
    background: #dc3545;
    color: #fff;
}

/* بدنه پیام */
.cm-message-body {
    display: none;
    padding: 16px;
    font-size: 14px;
    line-height: 1.8;
    color: #444;
    border-top: 1px solid #eee;
}

.cm-message-item.cm-open .cm-message-body {
    display: block;
}

/* محصول مرتبط */
.cm-message-product {
    display: none;
    padding: 10px 16px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #666;
}

.cm-message-item.cm-open .cm-message-product {
    display: block;
}

.cm-message-product a {
    color: #007cba;
    text-decoration: none;
}

.cm-message-product a:hover {
    text-decoration: underline;
}

/* ===========================================
   Badge در منو
   =========================================== */
.cm-badge {
    display: inline-block;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    margin-right: 4px;
    vertical-align: middle;
}
