/* کانتینر اصلی و تایپوگرافی */
.pts-container {
    direction: rtl;
    text-align: right;
    font-family: inherit;
    color: #1e293b;
    margin: 20px 0;
    max-width: 100%;
}

/* داشبورد آماری شیک */
.pts-front-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}
.pts-fstat-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #edf2f7;
    position: relative;
    overflow: hidden;
}
.pts-fstat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
}
.fstat-all::after { background: linear-gradient(180deg, #6366f1, #4f46e5); }
.fstat-open::after { background: linear-gradient(180deg, #3b82f6, #2563eb); }
.fstat-ans::after { background: linear-gradient(180deg, #10b981, #059669); }
.fstat-closed::after { background: linear-gradient(180deg, #94a3b8, #64748b); }

.pts-fstat-num { display: block; font-size: 26px; font-weight: 800; color: #0f172a; line-height: 1.2; }
.pts-fstat-lbl { font-size: 13px; color: #64748b; font-weight: 500; }
.pts-fstat-icon { font-size: 28px; opacity: 0.85; }

/* هدر تیکت‌ها */
.pts-header-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #edf2f7;
}
.pts-main-title { margin: 0; font-size: 20px; font-weight: 800; }
.pts-sub-title { margin: 4px 0 0; font-size: 13px; color: #64748b; }

/* کارت‌ها */
.pts-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    padding: 24px;
}
.pts-card-header {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 20px;
}
.pts-card-header h3 { margin: 0; font-size: 17px; font-weight: 700; color: #1e293b; }

/* فرم‌ها */
.pts-form-group { margin-bottom: 18px; }
.pts-form-group label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 600; color: #334155; }
.pts-req { color: #ef4444; }
.pts-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
    background: #f8fafc;
}
.pts-input:focus {
    outline: none;
    border-color: #4f46e5;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.pts-file-input {
    font-size: 13px;
    display: block;
    margin-top: 5px;
}
.pts-help-text { display: block; font-size: 12px; color: #94a3b8; margin-top: 4px; }
.pts-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* دکمه‌ها */
.pts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: inherit;
}
.pts-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.pts-btn:active { transform: translateY(0); }
.pts-btn-primary { background: #4f46e5; color: #ffffff; }
.pts-btn-success { background: #10b981; color: #ffffff; }
.pts-btn-danger { background: #ef4444; color: #ffffff; }
.pts-btn-secondary { background: #64748b; color: #ffffff; }
.pts-btn-lg { padding: 12px 24px; font-size: 15px; }
.pts-btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }

/* جدول */
.pts-table-responsive { overflow-x: auto; }
.pts-table { width: 100%; border-collapse: collapse; text-align: right; }
.pts-table th { background: #f8fafc; padding: 14px 16px; font-weight: 700; color: #475569; font-size: 13px; border-bottom: 1px solid #e2e8f0; }
.pts-table td { padding: 14px 16px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }

/* بج‌ها (Badges) */
.pts-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
}
.pts-badge.status-open { background: #e0f2fe; color: #0369a1; }
.pts-badge.status-in_progress { background: #f5f3ff; color: #7c3aed; }
.pts-badge.status-on_hold { background: #f1f5f9; color: #475569; }
.pts-badge.status-waiting_user { background: #fef9c3; color: #a16207; }
.pts-badge.status-answered { background: #dcfce7; color: #15803d; }
.pts-badge.status-closed { background: #f3f4f6; color: #6b7280; }

.pts-badge.priority-urgent { background: #fee2e2; color: #b91c1c; }
.pts-badge.priority-high { background: #ffedd5; color: #c2410c; }
.pts-badge.priority-medium { background: #fef9c3; color: #a16207; }
.pts-badge.priority-normal { background: #f1f5f9; color: #475569; }
.pts-badge.priority-low { background: #f3f4f6; color: #6b7280; }

/* ناحیه گفتگو */
.pts-thread-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
}
.pts-bubble-box {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.pts-user-bubble { background: #ffffff; border: 1px solid #e2e8f0; }
.pts-admin-bubble { background: #eef2ff; border: 1px solid #c7d2fe; }
.pts-b-head { display: flex; justify-content: space-between; font-size: 12px; color: #64748b; margin-bottom: 8px; }
.pts-b-content { font-size: 14px; line-height: 1.7; color: #1e293b; }
.pts-b-attach { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #cbd5e1; }
.pts-b-attach a { color: #4f46e5; text-decoration: none; font-size: 13px; font-weight: 600; }
.pts-tag-admin { background: #4f46e5; color: #fff; padding: 2px 7px; border-radius: 4px; font-size: 11px; margin-right: 5px; }

/* هشدارها */
.pts-alert { padding: 14px; border-radius: 8px; font-size: 14px; margin: 15px 0; }
.pts-alert-warning { background: #fffbeb; color: #b45309; border: 1px solid #fef3c7; }
.pts-alert-info { background: #f0f9ff; color: #0369a1; border: 1px solid #e0f2fe; }
.pts-empty-state { text-align: center; padding: 40px 20px; color: #94a3b8; }

/* دکمه شناور پشتیبانی - Floating Button */
.pts-floating-btn {
    position: fixed;
    z-index: 99999;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.45);
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    direction: rtl;
}
.pts-floating-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.55);
    color: #fff !important;
}
.pts-float-icon {
    font-size: 18px;
    line-height: 1;
}
.pts-float-text {
    line-height: 1;
}
.pts-float-bottom-left {
    bottom: 24px;
    left: 24px;
}
.pts-float-bottom-right {
    bottom: 24px;
    right: 24px;
}
.pts-float-top-left {
    top: 24px;
    left: 24px;
}
.pts-float-top-right {
    top: 24px;
    right: 24px;
}
@media (max-width: 480px) {
    .pts-floating-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    .pts-float-bottom-left, .pts-float-bottom-right {
        bottom: 16px;
    }
    .pts-float-bottom-left, .pts-float-top-left {
        left: 16px;
    }
    .pts-float-bottom-right, .pts-float-top-right {
        right: 16px;
    }
}

/* ========== بهبودهای بصری و هاور ========== */
.pts-hover-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pts-hover-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08) !important;
}
.pts-hover-btn {
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.pts-hover-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.pts-stats-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}
.pts-stat-box {
    padding: 15px;
    border: 1px solid;
    border-top-width: 3px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}
.pts-stat-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}
.pts-stat-title {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}
.pts-stat-num {
    font-size: 20px;
    font-weight: bold;
    margin-top: 4px;
    line-height: 1.2;
}

.pts-header-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.pts-header-box h2 {
    margin: 0;
}

.pts-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
@media (max-width: 600px) {
    .pts-grid-2 { grid-template-columns: 1fr; }
}

.pts-hint {
    color: #64748b;
    font-size: 12px;
    display: block;
    margin-top: 4px;
}
.pts-empty {
    padding: 15px;
    color: #64748b;
}
.pts-table-wrap {
    overflow-x: auto;
}

.pts-product-tag {
    font-size: 12px;
    margin-bottom: 10px;
    color: #0284c7;
    background: #e0f2fe;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
}
.pts-attach-link {
    margin-top: 8px;
}
.pts-attach-link a {
    color: #0284c7;
    text-decoration: underline;
}

.pts-alert-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
}

/* نوتیفیکیشن داخلی */
.pts-notif-bar {
    position: relative;
    margin-bottom: 18px;
    display: flex;
    justify-content: flex-start;
}
.pts-notif-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.pts-notif-toggle .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #3b82f6;
}
.pts-notif-badge {
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
.pts-notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-width: 95vw;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    z-index: 1000;
    overflow: hidden;
}
.pts-notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}
.pts-notif-list {
    max-height: 280px;
    overflow-y: auto;
}
.pts-notif-item {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
}
.pts-notif-item:hover {
    background: #f8fafc;
}
.pts-notif-item.unread {
    background: #eff6ff;
}
.pts-notif-item.unread .pts-notif-msg {
    font-weight: 600;
}
.pts-notif-msg {
    font-size: 13px;
    color: #1e293b;
    margin-bottom: 4px;
}
.pts-notif-time {
    font-size: 11px;
    color: #94a3b8;
}
.pts-notif-empty {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    margin: 0;
}

/* امتیاز رضایت */
.pts-rating-box {
    margin-top: 16px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;
}
.pts-rating-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
    flex-wrap: wrap;
}
.pts-rate-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.pts-rate-like:hover {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #047857;
}
.pts-rate-dislike:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}
.pts-rated-msg {
    margin-top: 10px;
    color: #475569;
    font-size: 14px;
}
