
    /* ========== Support Chat Styles (نسخه نهایی) ========== */
    .support-chat-layout {
        display: flex;
        position: relative;
        gap: 1rem;
        margin-top: 0.5rem;
    }

    /* دکمه جمع‌کننده سایدبار */
    .sidebar-toggle {
        position: absolute;
        left: 10px;
        top: 10px;
        z-index: 10;
        background: var(--card-bg, #ffffff);
        border: 1px solid var(--border, #e2e8f0);
        border-radius: 8px;
        padding: 6px 10px;
        cursor: pointer;
        font-size: 1.2rem;
        transition: 0.2s;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        color: var(--text-primary);
    }
    .sidebar-toggle:hover {
        background: var(--hover-bg, #f1f5f9);
    }

    /* سایدبار */
    .chat-sidebar {
        width: 480px;
        position: relative;
        transition: width 0.3s ease, opacity 0.2s;
        overflow: hidden;
        flex-shrink: 0;
        background: var(--card-bg, #ffffff);
        border-radius: 12px;
        border: 1px solid var(--border, #e2e8f0);
        padding: 1rem;
    }

    .chat-sidebar.collapsed {
        width: 45px;
        padding: 1rem 0.5rem;
    }

    .chat-sidebar.collapsed .sidebar-toggle {
        left: 5px;     /* فاصله از لبه چپ - میتونی صفر یا خیلی کم بدی */
        top: 10px;
        /* هیچ transform یا جابه‌جایی دیگه‌ای نداشته باشه */
    }

    .chat-sidebar.collapsed .tabs-container,
    .chat-sidebar.collapsed .conv-list {
        display: none;
    }

    /* تب‌ها */
    .sidebar-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--border);
    }


    .tabs-container {
        display: flex;
        padding-left: 50px;
        gap: 0.5rem;
        margin-bottom: 1rem;
        border-bottom: 1px solid var(--border, #e2e8f0);
        padding-bottom: 0.5rem;
    }
    .tab-btn {
        background: none;
        border: none;
        padding: 6px 12px;
        cursor: pointer;
        font-weight: 500;
        color: #64748b;
        border-radius: 20px;
        transition: 0.2s;
        font-size: 0.85rem;
    }
    .tab-btn.active {
        background: #3b82f6;
        color: white;
    }

    /* ===== نمای جدول (ردیفی) در سایدبار ===== */
    .conv-table-header {
        display: grid;
        grid-template-columns: 110px 1fr 60px 70px 120px;  /* 5 ستون */
        gap: 0.7rem;
        background: var(--bg-secondary, #f1f5f9);
        padding: 0.5rem 0.75rem;
        border-radius: 10px;
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--text-primary);
        border-bottom: 1px solid var(--border);
        margin-bottom: 0.5rem;
        direction: ltr;
        text-align: left;
    }

    .conv-list {
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
        max-height: 450px;
        overflow-y: auto;
    }

    /* هر ردیف تیکت */
    .conv-item {
        display: grid;
        grid-template-columns: 110px 1fr 60px 70px 120px;  /* 5 ستون */
        gap: 0.7rem;
        align-items: center;
        padding: 0.5rem 0.75rem;
        border-radius: 10px;
        cursor: pointer;
        transition: 0.1s;
        font-size: 0.8rem;
        background: var(--card-bg);
        border: 1px solid transparent;
        direction: ltr;
        text-align: left;
    }
    .conv-item:hover {
        background: var(--hover-bg, #f8fafc);
        border-color: var(--border);
    }

    .conv-item.active {
        background: var(--primary-light, #e0f2fe);
        border-color: var(--primary, #3b82f6);
    }

    /* ستون‌ها */
    .col-ticket-id {
        font-family: monospace;
        font-size: 0.75rem;
        font-weight: 500;
        direction: ltr;
    }
    .col-subject {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 500;
    }
    .col-related {
        text-align: center;
        font-size: 0.7rem;
    }
    .col-reply {
        text-align: center;
    }

    .replied-badge, .pending-badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
        border-radius: 20px;
        display: inline-block;
        font-weight: 500;
    }
    .replied-badge {
        background: var(--success, #10b981);
        color: white;
    }
    .pending-badge {
        background: var(--badge-pending-bg, #f59e0b);
        color: var(--badge-pending-text, #fff);
    }
    .col-last {
        font-size: 0.7rem;
        white-space: nowrap;
        direction: ltr;
    }

    /* مخفی کردن هدر در حالت بسته */
    .chat-sidebar.collapsed .conv-table-header {
        display: none;
    }
    .chat-sidebar.collapsed .conv-item {
        display: flex;
        justify-content: center;
        padding: 0.5rem 0;
    }
    .chat-sidebar.collapsed .conv-item > div:not(.col-ticket-id) {
        display: none;
    }
    .chat-sidebar.collapsed .col-ticket-id {
        text-align: center;
        font-size: 0.7rem;
    }

    .last-msg {
        font-size: 0.75rem;
        color: #64748b;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* بج پاسخ ادمین در لیست تیکت‌ها */
    /* .replied-badge {
        background: var(--success, #10b981);
        color: white;
        font-size: 0.7rem;
        padding: 2px 8px;
        border-radius: 12px;
        display: inline-block;
    }
    .pending-badge {
        background: var(--text-secondary, #94a3b8);
        color: white;
        font-size: 0.7rem;
        padding: 2px 8px;
        border-radius: 12px;
        display: inline-block;
    } */
    .ticket-id {
        font-size: 0.7rem;
        font-family: monospace;
        color: var(--text-secondary);
        margin: 4px 0;
        direction: ltr;
        text-align: left;
    }
    .reply-status {
        margin: 4px 0;
    }

    /* ناحیه چت اصلی */
    .chat-main {
        flex: 1;
        background: var(--card-bg, #ffffff);
        border-radius: 12px;
        border: 1px solid var(--border, #e2e8f0);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* هدر چت (با دکمه بستن در راست) */
    .chat-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        border-bottom: 1px solid var(--border, #e2e8f0);
        background: var(--card-bg, #ffffff);
        font-weight: 600;
    }
    .close-ticket-btn {
        background: var(--danger, #ef4444);  /* استفاده از متغیر danger */
        color: white;
        border: none;
        border-radius: 20px;
        padding: 4px 12px;
        font-size: 0.8rem;
        cursor: pointer;
        transition: 0.2s;
    }
    .close-ticket-btn:hover {
        background: #dc2626;
    }

    /* ناحیه پیام‌ها */
    .chat-messages {
        flex: 1;
        padding: 1rem;
        overflow-y: auto;
        min-height: 300px;
        max-height: 500px;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .message {
        max-width: 80%;
        padding: 8px 12px;
        border-radius: 16px;
        word-wrap: break-word;
    }
    .message.user {
        background: #3b82f6;
        color: white;
        align-self: flex-end;
        border-bottom-right-radius: 4px;
    }
    .message.admin {
        background: #f1f5f9;
        color: #1e293b;
        align-self: flex-start;
        border-bottom-left-radius: 4px;
    }
    .msg-date {
        font-size: 0.65rem;
        margin-top: 4px;
        opacity: 0.7;
    }

    /* ========== ناحیه ورودی یکپارچه (مثل تلگرام) ========== */
    .chat-input-area {
        padding: 0.75rem 1rem;
        border-top: 1px solid var(--border, #e2e8f0);
        background: var(--card-bg, #ffffff);
    }

    .input-container {
        display: flex;
        align-items: flex-end;
        gap: 8px;
        background: var(--chat-input-bg, #f1f5f9);
        border: 1px solid var(--border, #cbd5e1);
        border-radius: 28px;
        padding: 6px 12px;
        transition: all 0.2s ease;
    }

    .input-container:focus-within {
        border-color: var(--accent-primary, #3b82f6);
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    }

    /* Textarea داخل کادر */

    .input-container textarea {
        flex: 1;
        border: none;
        background: transparent;
        padding: 6px 0;          /* کم شد از 8px به 6px */
        font-family: inherit;
        font-size: 0.95rem;
        resize: none;
        color: var(--text-primary);
        outline: none;
        max-height: 120px;
        overflow-y: auto;
        line-height: 1.4;        /* اضافه شد برای کنترل ارتفاع خط */
        min-height: 28px;        /* ارتفاع اولیه خیلی کم (حدود یک خط) */
        height: 28px;            /* شروع با یک خط */
    }

    /* دکمه‌های داخل کادر */
    .input-actions {
        display: flex;
        gap: 4px;
        align-items: center;
    }

    .icon-btn {
        background: none;
        border: none;
        cursor: pointer;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        font-size: 1.3rem;
        color: var(--text-secondary);
    }

    .icon-btn:hover {
        background: var(--hover-bg, #e2e8f0);
    }

    /* دکمه پیوست همیشه */
    .attach-btn {
        color: var(--text-secondary);
    }

    /* دکمه ارسال (شبیه تلگرام) */
    .send-btn {
        background: #2aabee;
        color: white;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
        width: 36px;
        height: 36px;
    }

    .send-btn:hover {
        background: #1f8bcb;
        transform: scale(1.02);
    }

    .send-btn:active {
        transform: scale(0.96);
    }

    .send-btn svg {
        width: 18px;
        height: 18px;
        fill: white;
    }

    .reopen-btn {
        background: #f59e0b;
        color: white;
    }
    .reopen-btn:hover {
        background: #d97706;
    }


    /* placeholders */
    .loading-placeholder, .empty-placeholder, .error-placeholder {
        text-align: center;
        padding: 2rem;
        color: #64748b;
    }


    /* ========== استایل‌های جدید پیوست فایل (مثل مسنجر) ========== */
    .pending-attachments {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 10px;
        padding: 8px;
        background: var(--bg-secondary, #f8fafc);
        border-radius: 16px;
    }

    .attach-badge {
        display: flex;
        align-items: center;
        gap: 10px;
        background: var(--card-bg, #ffffff);
        border-radius: 12px;
        padding: 8px 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        border: 1px solid var(--border, #e2e8f0);
        transition: all 0.2s;
    }

    .attach-thumb {
        width: 48px;
        height: 48px;
        object-fit: cover;
        border-radius: 8px;
        background: #f1f5f9;
    }

    .attach-icon {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 32px;
        background: #f1f5f9;
        border-radius: 8px;
    }

    .attach-info {
        display: flex;
        flex-direction: column;
        max-width: 160px;
    }

    .attach-name {
        font-size: 0.85rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: var(--text-primary);
    }

    .attach-size {
        font-size: 0.7rem;
        color: #64748b;
    }

    .remove-attach {
        background: none;
        border: none;
        cursor: pointer;
        font-size: 18px;
        padding: 4px;
        color: #94a3b8;
        border-radius: 50%;
        transition: all 0.2s;
    }

    .remove-attach:hover {
        color: #ef4444;
        background: #fee2e2;
    }

    /* استایل فایل‌های داخل پیام */
    .msg-attachments {
        margin-top: 8px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }

    .attachment-image {
        max-width: 150px;
        max-height: 150px;
        border-radius: 8px;
        border: 1px solid var(--border);
        cursor: pointer;
    }

    .attachment-file {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: var(--bg-secondary);
        padding: 4px 12px;
        border-radius: 20px;
        text-decoration: none;
        font-size: 0.8rem;
        color: var(--accent-primary);
    }

    .attachment-file:hover {
        background: var(--hover-bg);
        text-decoration: underline;
    }

    /* attachments container */
    .msg-attachments {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 8px;
    }

    /* image style */
    .attachment-image-card {
        cursor: pointer;
        max-width: 200px;
        border-radius: 12px;
        overflow: hidden;
        background: #f0f0f0;
        transition: transform 0.2s;
    }
    .attachment-image-card:hover {
        transform: scale(1.02);
    }
    .attachment-image {
        width: 100%;
        height: auto;
        display: block;
        border-radius: 12px;
    }

    /* file card style (non-image) */
    .attachment-file-card {
        display: flex;
        align-items: center;
        gap: 12px;
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        border-radius: 12px;
        padding: 10px 16px;
        cursor: pointer;
        transition: all 0.2s;
        max-width: 260px;
    }
    .attachment-file-card:hover {
        background: #e9ecef;
        border-color: #ced4da;
    }
    .attachment-file-card .file-icon {
        font-size: 28px;
    }
    .attachment-file-card .file-info {
        overflow: hidden;
    }
    .attachment-file-card .file-name {
        font-weight: 500;
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .attachment-file-card .file-size {
        font-size: 0.7rem;
        color: #6c757d;
    }

    .telegram-file-card {
        position: relative;
        min-width: 210px;
    }

    .file-type-badge {
        width: 42px;
        height: 42px;
        border-radius: 10px;
        background: var(--accent-primary, #2aabee);
        color: #ffffff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.62rem;
        font-weight: 700;
        letter-spacing: 0;
        flex: 0 0 auto;
    }

    .transfer-progress {
        position: absolute;
        left: 10px;
        right: 10px;
        bottom: 5px;
        height: 4px;
        background: rgba(15, 23, 42, 0.12);
        border-radius: 999px;
        opacity: 0;
        pointer-events: none;
        overflow: hidden;
    }

    .transfer-progress.active {
        opacity: 1;
    }

    .transfer-progress-bar {
        width: 0;
        height: 100%;
        background: var(--accent-primary, #2aabee);
        transition: width 0.15s ease;
    }

    .transfer-progress-text {
        position: absolute;
        right: 0;
        bottom: 5px;
        font-size: 0.62rem;
        color: var(--text-secondary, #64748b);
        background: var(--card-bg, #ffffff);
        border-radius: 6px;
        padding: 0 4px;
    }

    .transfer-btn {
        width: 24px;
        height: 24px;
        border: none;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(15, 23, 42, 0.72);
        color: #ffffff;
        cursor: pointer;
        font-size: 0.85rem;
        line-height: 1;
    }

    .transfer-cancel {
        position: absolute;
        top: 6px;
        right: 6px;
        display: none;
    }

    .transfer-pause {
        position: absolute;
        top: 6px;
        right: 36px;
        display: none;
    }

    .transfer-actions {
        display: flex;
        gap: 6px;
        align-items: center;
    }

    /* ===== RTL Support for Support Chat (اصلاح شده) ===== */
    html[dir="rtl"] .chat-sidebar {
        border-left: none;
        border-right: 1px solid var(--border, #e2e8f0);
        padding-left: 0;
        padding-right: 1rem;
    }

    /* تنظیم تب‌ها در RTL */
    html[dir="rtl"] .tabs-container {
        padding-left: 0;
        padding-right: 50px;   /* معادل padding-left در حالت LTR */
        direction: rtl;
    }

    /* دکمه جمع‌کننده سایدبار در RTL - اصلاح موقعیت */
    html[dir="rtl"] .sidebar-toggle {
        left: auto;
        right: 10px;          /* به جای -10px */
        top: 10px;
    }

    /* حالت جمع شده سایدبار در RTL */
    html[dir="rtl"] .chat-sidebar.collapsed {
        padding: 1rem 0.5rem;
    }
    html[dir="rtl"] .chat-sidebar.collapsed .sidebar-toggle {
        left: auto;
        right: 5px;           /* فاصله مناسب در حالت بسته */
    }

    /* حذف direction:rtl از جدول ستون‌ها - صرفاً راست‌چین می‌کنیم */
    html[dir="rtl"] .conv-table-header {
        direction: ltr;       /* جهت چیدمان ستون‌ها به همان ترتیب LTR بماند */
        text-align: right;
    }
    html[dir="rtl"] .conv-item {
        direction: ltr;
        text-align: right;
    }
    /* تنظیم راست‌چینی برای سلول‌های متنی */
    html[dir="rtl"] .col-ticket-id,
    html[dir="rtl"] .col-subject,
    html[dir="rtl"] .col-related,
    html[dir="rtl"] .col-reply,
    html[dir="rtl"] .col-last {
        text-align: right;
    }
    /* تاریخ همچنان LTR بماند */
    html[dir="rtl"] .col-last {
        direction: ltr;
        text-align: right;
    }

    /* پیام‌ها: جابجایی راست و چپ (درست است) */
    html[dir="rtl"] .message.user {
        align-self: flex-start;
        border-bottom-right-radius: 4px;
        border-bottom-left-radius: 16px;
    }
    html[dir="rtl"] .message.admin {
        align-self: flex-end;
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 16px;
    }

    /* ناحیه ورودی در RTL - بدون معکوس کردن آیکون‌ها */
    html[dir="rtl"] .chat-input-area {
        direction: rtl;
    }
    /* حذف transform scaleX(-1) برای همه دکمه‌های آیکونی */
    html[dir="rtl"] .icon-btn {
        transform: none;      /* معکوس نشود */
    }
    /* در صورت نیاز می‌توانید فقط آیکون attach را معکوس کنید (اختیاری) */
    /* html[dir="rtl"] #attachFileBtn { transform: scaleX(-1); } */

    /* دکمه‌های مودال در RTL - راست‌چین */
    html[dir="rtl"] .modal-content {
        direction: rtl;
    }
    html[dir="rtl"] .modal-header {
        direction: rtl;
    }
    html[dir="rtl"] .modal-buttons {
        justify-content: flex-end;   /* دکمه‌ها در سمت راست مودال */
    }
    html[dir="rtl"] .modal-buttons button:first-child {
        order: 2;                    /* در صورت نیاز ترتیب دکمه‌ها را جابجا کنید */
    }
    html[dir="rtl"] .modal-buttons button:last-child {
        order: 1;
    }


    /* file upload modal */
    .file-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10000;
        direction: ltr; /* or rtl, depending on your site's default */
    }
    .file-modal-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(3px);
    }
    .file-modal-container {
        position: relative;
        background: var(--card-bg);
        width: 90%;
        max-width: 450px;
        border-radius: 24px;
        box-shadow: 0 20px 35px rgba(0, 0, 0, 0.2);
        overflow: hidden;
        animation: modalFadeIn 0.2s ease;
    }
    @keyframes modalFadeIn {
        from { opacity: 0; transform: scale(0.95); }
        to { opacity: 1; transform: scale(1); }
    }
    .file-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border);   /* جایگزین #eee */
        background: var(--bg-secondary);           /* جایگزین #fafafa */

    }
    .file-modal-title {
        font-size: 1.2rem;
        font-weight: bold;
        color: var(--text-primary);
    }
    .file-modal-close {
        background: none;
        border: none;
        font-size: 28px;
        cursor: pointer;
        color: var(--text-secondary);
    }

    .file-modal-close:hover { 
        color: var(--danger);        
    }

    .file-modal-body { padding: 20px; }
    .file-preview-area {
        display: flex;
        gap: 15px;
        align-items: center;
        background: var(--bg-secondary); 
        border-radius: 16px;
        padding: 12px;
        margin-bottom: 20px;
    }
    #modalPreviewThumb img {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 12px;
    }
    #modalPreviewThumb .file-icon {
        font-size: 48px;
        text-align: center;
    }
    .file-preview-details {
        flex: 1;
    }
    .file-name {
        font-weight: 600;
        color: var(--text-primary);
        word-break: break-word;
        margin-bottom: 4px;
    }
    .file-size {
        font-size: 0.75rem;
        color: var(--text-primary);
    }
    .file-description-area label {
        display: block;
        font-size: 0.85rem;
        font-weight: 600;
        margin-bottom: 8px;
        color: var(--text-primary);
    }
    #modalFileDesc {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: 16px;
        font-family: inherit;
        font-size: 0.9rem;
        resize: vertical;
        box-sizing: border-box;  
        background: var(--card-bg);               
        color: var(--text-primary);                     

    }
    #modalFileDesc:focus {
        outline: none;
        border-color: var(--accent-primary);
    }
    .file-modal-footer {
        display: flex;
        justify-content: flex-end;
        gap: 12px;
        padding: 16px 20px;
        border-top: 1px solid var(--border);       /* جایگزین #eee */
        background: var(--bg-secondary);           /* جایگزین #fafafa */
    }
    .file-modal-cancel,
    .file-modal-send {
        padding: 8px 20px;
        border-radius: 40px;
        font-size: 0.9rem;
        font-weight: 500;
        border: none;
        cursor: pointer;
        transition: all 0.2s;
    }
    .file-modal-cancel {
        background: var(--chip-bg);                /* جایگزین #f1f5f9 */
        color: var(--text-primary);                /* جایگزین #475569 */
    }
    .file-modal-cancel:hover {
        background: var(--hover-bg);
    }
    .file-modal-send {
        background: var(--accent-primary);         /* جایگزین #3b82f6 */
        color: white;
    }
    .file-modal-send:hover {
        background: var(--accent-secondary);
    }
    /* RTL Support (if needed) */
    [dir="rtl"] .file-modal-container {
        direction: rtl;
    }
    [dir="rtl"] .file-modal-footer {
        justify-content: flex-start;
    }
    [dir="rtl"] .file-preview-area {
        flex-direction: row-reverse;
    }

    /* ========================================= */
    /* Modal Styles (support new conversation)  */
    /* ========================================= */
    .modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 10000;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: inherit;
    }

    .modal-content {
        background: var(--card-bg);
        border-radius: 1.25rem;
        width: 90%;
        max-width: 500px;
        box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.3);
        direction: ltr;
        padding: 0;
        overflow: hidden;
        border: 1px solid var(--border);
    }

    /* هدر مودال (اختیاری - بهتر از float) */
    .modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1.2rem 1.5rem;
        border-bottom: 1px solid var(--border);
        background: var(--bg-secondary);
    }

    .modal-header h3 {
        margin: 0;
        font-size: 1.35rem;
        font-weight: 600;
        color: var(--text-primary);
    }

    .modal-close {
        font-size: 1.8rem;
        cursor: pointer;
        line-height: 1;
        color: var(--text-secondary);
        transition: color 0.2s;
    }

    .modal-close:hover {
        color: var(--danger);
    }

    /* بدنه مودال */
    .modal-body {
        padding: 1.5rem;
    }

    .modal-field {
        margin-bottom: 1.4rem;
    }

    .modal-field label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 600;
        font-size: 0.9rem;
        color: var(--text-primary);
    }

    .modal-field input,
    .modal-field select {
        width: 100%;
        padding: 0.75rem 0.9rem;
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        border-radius: 0.75rem;
        font-size: 0.95rem;
        color: var(--text-primary);
        transition: all 0.2s ease;
        box-sizing: border-box;
    }

    .modal-field input:focus,
    .modal-field select:focus {
        outline: none;
        border-color: var(--accent-primary);
        box-shadow: 0 0 0 2px var(--accent-glow);
    }

    .modal-field input::placeholder {
        color: var(--text-secondary);
        opacity: 0.7;
    }

    /* دکمه‌ها */
    .modal-buttons {
        display: flex;
        justify-content: flex-end;
        gap: 1rem;
        margin-top: 1.8rem;
    }

    .modal-buttons button {
        padding: 0.6rem 1.4rem;
        border-radius: 2rem;
        font-weight: 500;
        font-size: 0.9rem;
        cursor: pointer;
        transition: all 0.2s;
        border: none;
    }

    .secondary-btn {
        background: var(--chip-bg);
        color: var(--text-primary);
        border: 1px solid var(--border);
    }

    .secondary-btn:hover {
        background: var(--hover-bg);
    }

    .primary-btn {
        background: var(--accent-primary);
        color: white;
        box-shadow: 0 2px 6px var(--accent-glow);
    }

    .primary-btn:hover {
        filter: brightness(1.05);
        transform: translateY(-1px);
    }

    .primary-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

    .required {
        color: var(--danger);
        margin-left: 0.2rem;
    }

    .optional {
        color: var(--text-secondary);
        font-weight: normal;
        font-size: 0.8rem;
        margin-left: 0.5rem;
    }

    /* هماهنگی عرض فیلدها (قبلاً width:100% بود، اینجام هست) */
    #modalSubject, #modalRelatedType, #modalRelatedId {
        box-sizing: border-box;
    }

    /* ======================================== */
    .upload-progress-circle {
        position: relative;
        width: 40px;
        height: 40px;
        margin-left: 10px;
    }
    .circular-chart {
        display: block;
        width: 100%;
        height: 100%;
    }
    .circle-bg {
        fill: none;
        stroke: #eee;
        stroke-width: 3;
    }
    .circle {
        fill: none;
        stroke: #4caf50;
        stroke-width: 3;
        stroke-linecap: round;
        transition: stroke-dasharray 0.2s;
    }
    .progress-percent {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 10px;
        font-weight: bold;
    }
    
/* ===== Responsive for Chat (موبایل) ===== */
@media (max-width: 700px) {
    .support-chat-layout {
        flex-direction: column;
    }
    .chat-sidebar, .chat-main {
        width: 100%;
    }
    .chat-sidebar {
        border-left: none;
        padding-left: 0;
        margin-bottom: 1rem;
    }
}
