/* ============================================
   پلاگین تیکت پشتیبانی - استایل فرانت‌اند یکپارچه
   نسخه: 4.2.2 - نسخه تمیز و نهایی
   ============================================ */

/* --------------------------------------------
   0. تنظیمات فونت پایه
   -------------------------------------------- */
.ts-frontend-wrap,
.ts-frontend-wrap * {
    font-family: inherit !important;
}

.ts-frontend-wrap input:not(.dashicons),
.ts-frontend-wrap textarea:not(.dashicons),
.ts-frontend-wrap select:not(.dashicons),
.ts-frontend-wrap button:not(.dashicons),
.ts-frontend-wrap .ts-form-control:not(.dashicons),
.ts-frontend-wrap .ts-sidebar-select:not(.dashicons) {
    font-family: inherit !important;
    font-size: 13px;
}

.ts-frontend-wrap select,
.ts-frontend-wrap select.ts-form-control,
.ts-frontend-wrap .ts-sidebar-select {
    font-family: inherit !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    color: #1e293b !important;
}

.ts-frontend-wrap .dashicons,
.ts-frontend-wrap .dashicons-before:before,
.ts-frontend-wrap [class^="dashicons-"]:before {
    font-family: dashicons !important;
    font-size: 20px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.ts-frontend-wrap .dashicons-paperclip {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.ts-btn .dashicons,
.ts-filter-icon-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* --------------------------------------------
   1. استایل پایه
   -------------------------------------------- */
.ts-frontend-wrap {
    background: #f0f2f5;
    min-height: 100vh;
    padding: 20px;
}

.ts-frontend-container {
    max-width: 1400px;
    margin: 0 auto;
}

.ts-frontend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    background: #fff;
    padding: 12px 20px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.ts-frontend-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ts-frontend-header-title h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.ts-frontend-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ts-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    line-height: 1.4;
}

.ts-btn-primary {
    background: #0d6efd;
    color: #fff;
}

.ts-btn-primary:hover,
.ts-btn-primary:focus,
.ts-btn-primary:active {
    background: #0b5ed7;
    color: #fff;
    outline: none;
    box-shadow: none;
}

.ts-btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.ts-btn-secondary:hover {
    background: #dee2e6;
    color: #495057;
}

.ts-btn-outline {
    background: transparent;
    border: 1px solid #dee2e6;
    color: #495057;
}

.ts-btn-outline:hover {
    background: #f8f9fa;
    border-color: #0d6efd;
    color: #0d6efd;
}

.ts-btn-success {
    background: #10b981;
    color: #fff;
    border-radius: 30px;
}

.ts-btn-success:hover {
    background: #059669;
    color: #fff;
}

.ts-btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.ts-filter-icon-btn {
    background: transparent !important;
    border: none !important;
    padding: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 10px;
    box-shadow: none !important;
}

.ts-filter-icon-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #495057;
}

.ts-filter-icon-btn:hover {
    background: rgba(0,0,0,0.05) !important;
}

.ts-filter-icon-btn:hover .dashicons {
    color: #0d6efd;
}

.ts-filters-card {
    display: none;
    margin-bottom: 20px;
}

.ts-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
    border: none;
}

.ts-card-header {
    padding: 12px 18px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: #fafbfc;
}

.ts-card-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}

.ts-card-header-title .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #0d6efd;
}

.ts-card-header-count {
    font-size: 12px;
    color: #6c757d;
    background: #e9ecef;
    padding: 3px 10px;
    border-radius: 30px;
}

.ts-card-body {
    padding: 0;
    background: #fff;
}

/* --------------------------------------------
   2. جدول تیکت‌ها
   -------------------------------------------- */
.table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    cursor: grab;
}

.table-wrapper:active {
    cursor: grabbing;
}

.ts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border: none;
    margin: 0;
    min-width: 800px;
}

.ts-table thead th {
    background: #f8f9fa;
    padding: 12px 16px;
    text-align: right;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
}

.ts-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
    font-size: 13px;
}

.ts-table tbody tr:last-child td {
    border-bottom: none;
}

.ts-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ts-table tbody tr:hover {
    background: #f8f9fa;
}

.ts-table tbody tr.is-unread-row {
    background: #fff8e7;
}

.ts-title-cell {
    white-space: normal;
    word-break: break-word;
    font-size: 13px;
}

.ts-title-cell.is-unread {
    font-weight: 700;
    color: #0d6efd;
}

.ts-date-cell {
    white-space: nowrap;
    font-size: 13px;
}

.ts-date-main {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.4;
}

.ts-date-update {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ts-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    color: #fff;
    white-space: nowrap;
}

/* --------------------------------------------
   3. فیلترها
   -------------------------------------------- */
.ts-filter-search-full {
    margin-bottom: 16px;
    padding: 16px 16px 0 16px;
}

.ts-filter-search-full .ts-form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    border: 1px solid #dee2e6;
    border-radius: 12px;
}

.ts-filter-status-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 0;
    padding: 12px 16px;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.ts-filter-status-label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    min-width: 50px;
}

.ts-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    flex: 1;
}

.ts-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #495057;
    transition: color 0.2s ease;
}

.ts-checkbox-label:hover {
    color: #0d6efd;
}

.ts-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #0d6efd;
}

.ts-filter-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 0;
    padding: 16px;
}

/* --------------------------------------------
   4. صفحه ثبت تیکت جدید
   -------------------------------------------- */
.ts-new-ticket-layout {
    display: flex;
    gap: 24px;
    margin-top: 20px;
    flex-direction: row;
}

.ts-new-ticket-form--large {
    flex: 2;
    min-width: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

.ts-new-ticket-sidebar--small {
    flex: 1;
    min-width: 280px;
    max-width: 320px;
}

.ts-form-header {
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ts-form-body {
    padding: 24px;
    background: #fff;
}

.ts-form-field {
    margin-bottom: 20px;
}

.ts-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ts-form-col {
    flex: 1;
    min-width: calc(50% - 10px);
}

.ts-form-field,
.ts-custom-fields .ts-form-field {
    margin-bottom: 20px;
}

.ts-form-control,
input.ts-form-control,
select.ts-form-control,
textarea.ts-form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 12px !important;
    font-size: 13px;
    font-family: inherit !important;
    background: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
    color: #1e293b;
}

select.ts-form-control,
.ts-frontend-wrap select.ts-form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' 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 12px center;
    background-size: 16px;
    padding-left: 36px;
    font-family: inherit !important;
    font-size: 13px !important;
    color: #1e293b !important;
    cursor: pointer;
}

select.ts-form-control option,
.ts-frontend-wrap select.ts-form-control option {
    font-family: inherit !important;
    font-size: 13px !important;
    color: #1e293b !important;
    padding: 8px;
}

.ts-form-control:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13,110,253,0.1);
}

.ts-form-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
    color: #1e293b;
}

.ts-required {
    color: #dc2626;
}

.ts-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.ts-attachment-upload-area {
    border: 1px dashed #dee2e6;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    background: #f8fafc;
}

.ts-attachment-list {
    margin-top: 8px;
}

.ts-attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 5px;
    border: 1px solid #e9ecef;
}

.ts-attachment-item-success {
    border-color: #28a745;
    background: #f0fff4;
}

.ts-attachment-name {
    flex: 1;
    font-size: 12px;
}

.ts-attachment-state {
    font-size: 11px;
    color: #6c757d;
}

.ts-attachment-remove {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
}

.ts-attachment-remove:hover {
    background: #fee2e2;
}

.ts-form-hint {
    font-size: 11px;
    color: #6c757d;
    margin-top: 8px;
}

.ts-sidebar-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e9ecef;
}

.ts-sidebar-card-header {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1e293b;
}

.ts-sidebar-card-header .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #0d6efd;
}

.ts-sidebar-card-body {
    padding: 16px;
}

.ts-sidebar-list {
    margin: 0;
    padding-right: 0;
    list-style: none;
}

.ts-sidebar-list li {
    font-size: 12px;
    color: #475569;
    margin-bottom: 8px;
    line-height: 1.5;
    position: relative;
    padding-right: 18px;
}

.ts-sidebar-list li:before {
    content: "•";
    position: absolute;
    right: 0;
    color: #0d6efd;
    font-weight: bold;
}

.ts-sidebar-spacer {
    height: 20px;
}

.ts-banner-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e9ecef;
}

.ts-banner-card .ts-sidebar-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 150px;
}

.ts-banner-card .ts-banner-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #8b9cb0;
}

.ts-banner-card .ts-banner-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #cbd5e1;
}

.ts-banner-card .ts-banner-placeholder p {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
}

.ts-faq-section {
    margin-top: 20px;
    padding: 16px 20px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e9ecef;
    min-height: 180px;
}

.ts-faq-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.ts-faq-header .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #0d6efd;
}

.ts-faq-content {
    max-height: 300px;
    overflow-y: auto;
}

.ts-faq-question {
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
    margin-bottom: 6px;
}

.ts-faq-answer {
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
}

.ts-faq-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 20px;
}

.ts-faq-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.ts-faq-placeholder p {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
}

/* --------------------------------------------
   5. صفحه مشاهده تیکت
   -------------------------------------------- */
.ts-view-ticket-layout {
    display: flex;
    gap: 24px;
    margin-top: 20px;
}

.ts-view-conversation {
    flex: 1;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ts-view-conversation-header {
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ts-view-conversation-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    max-height: 550px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8fafc;
}

.ts-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
}

.ts-message-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ts-message-support {
    align-self: flex-start;
}

.ts-message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ts-message-user .ts-message-avatar {
    background: #e3f2fd;
}

.ts-message-support .ts-message-avatar {
    background: #e8eaf6;
}

.ts-message-content {
    flex: 1;
    background: #fff;
    border-radius: 18px;
    padding: 10px 14px;
    border: 1px solid #e9ecef;
}

.ts-message-user .ts-message-content {
    background: #e3f2fd;
    border: 1px solid #d0e4ff;
}

.ts-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.ts-message-sender {
    font-weight: 600;
    font-size: 12px;
    color: #1e293b;
}

.ts-message-time {
    font-size: 10px;
    color: #8b9cb0;
}

.ts-message-body {
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
    color: #1e293b;
}

.ts-message-attachments {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(0,0,0,0.06);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ts-attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 16px;
    font-size: 11px;
    text-decoration: none;
    color: #495057;
}

.ts-view-reply-form {
    padding: 16px 20px;
    border-top: 1px solid #e9ecef;
    background: #fff;
}

.ts-view-reply-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 14px;
    font-size: 13px;
    resize: vertical;
}

.ts-view-reply-disabled {
    padding: 20px;
    text-align: center;
    background: #fef2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #991b1b;
}

.ts-view-details {
    flex: 0 0 360px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ts-details-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.ts-details-card-header {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.ts-details-card-body {
    padding: 12px 16px;
    background: #fff;
}

.ts-details-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 10px;
    flex-wrap: wrap;
}

.ts-details-label {
    font-size: 11px;
    color: #8b9cb0;
    min-width: 80px;
}

.ts-details-value {
    font-size: 12px;
    font-weight: 500;
    color: #1e293b;
    text-align: left;
    flex: 1;
    word-break: break-word;
}

.ts-rating-options-material {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: nowrap;
}

.ts-rating-option-material {
    cursor: pointer;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background: #fff;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    flex: 1;
    transition: all 0.2s ease;
}

.ts-rating-option-material:hover {
    border-color: #0d6efd;
    background: #f0f7ff;
}

.ts-rating-option-material.is-selected {
    border-color: #0d6efd;
    background: #eef3ff;
}

.ts-rating-face-material {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #8b9cb0;
}

.ts-rating-text-material {
    font-size: 9px;
    color: #8b9cb0;
    white-space: nowrap;
}

.ts-rating-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent !important;
    border: 1px solid #dee2e6 !important;
    color: #495057 !important;
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
}

.ts-rating-submit:hover {
    background: #f8f9fa !important;
    border-color: #0d6efd !important;
    color: #0d6efd !important;
}

.ts-form-submit-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.ts-close-ticket-btn {
    background: #10b981 !important;
    border: none !important;
    color: #fff !important;
    border-radius: 30px !important;
    padding: 8px 20px !important;
}

.ts-close-ticket-btn:hover {
    background: #059669 !important;
}

.ts-upload-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6c757d;
}

.ts-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: ts-spin 0.6s linear infinite;
}

@keyframes ts-spin {
    to { transform: rotate(360deg); }
}

/* --------------------------------------------
   6. دکمه‌های استپ
   -------------------------------------------- */
.ts-step-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.ts-step-actions .ts-btn {
    min-width: 160px;
    justify-content: center;
}

/* --------------------------------------------
   7. کلاس‌های کمکی
   -------------------------------------------- */
.ts-upload-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ts-hidden {
    display: none !important;
}

.text-center { text-align: center; }
.text-muted { color: #8b9cb0; }
.text-danger { color: #dc2626; }
.text-success { color: #10b981; }

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.w-100 { width: 100%; }

/* --------------------------------------------
   8. ریسپانسیو
   -------------------------------------------- */
@media (max-width: 992px) {
    .ts-new-ticket-layout {
        flex-direction: column;
    }
    .ts-new-ticket-sidebar--small {
        max-width: 100%;
    }
    .ts-view-details {
        flex: auto;
    }
}

@media (max-width: 768px) {
    .ts-frontend-wrap {
        padding: 12px;
    }
    
    .ts-frontend-header {
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 16px;
    }
    
    .ts-frontend-header-title h1 {
        font-size: 16px;
    }
    
    .ts-view-ticket-layout {
        flex-direction: column;
    }
    
    .ts-view-conversation-messages {
        max-height: 400px;
        padding: 12px;
    }
    
    .ts-message {
        max-width: 95%;
    }
    
    .ts-message-avatar {
        width: 28px;
        height: 28px;
    }
    
    .ts-form-body {
        padding: 16px;
    }
    
    .ts-form-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .ts-form-col {
        min-width: 100%;
    }
    
    .ts-form-actions {
        flex-direction: column;
    }
    
    .ts-form-actions .ts-btn {
        width: 100%;
        justify-content: center;
    }
    
    .ts-form-submit-actions {
        flex-direction: column;
    }
    
    .ts-form-submit-actions .ts-btn {
        width: 100%;
        justify-content: center;
    }
    
    .ts-rating-options-material {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .ts-rating-option-material {
        flex: 1 0 calc(33% - 6px);
        min-width: 65px;
        padding: 6px 2px;
    }
    
    .ts-rating-text-material {
        white-space: normal;
        font-size: 8px;
    }
    
    .ts-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ts-filter-status-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ts-checkbox-group {
        gap: 10px;
    }
    
    .ts-filter-actions {
        justify-content: center;
    }
    
    .ts-filter-actions .ts-btn {
        flex: 1;
        justify-content: center;
    }
    
    .ts-step-actions {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .ts-step-actions .ts-btn {
        width: auto;
        min-width: 200px;
    }
}

@media (max-width: 576px) {
    .ts-frontend-wrap {
        padding: 8px;
    }
    
    .ts-frontend-header {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .ts-frontend-header-title h1 {
        font-size: 14px;
    }
    
    .ts-frontend-header-actions .ts-btn {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    .ts-table {
        min-width: 700px;
    }
    
    .ts-table tbody td {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .ts-title-cell {
        min-width: 160px;
    }
    
    .ts-message {
        max-width: 100%;
    }
    
    .ts-attachment-item {
        flex-wrap: wrap;
    }
    
    .ts-attachment-name {
        width: 100%;
        margin-bottom: 4px;
    }
    
    .ts-rating-option-material {
        flex: 1 0 calc(50% - 6px);
    }
    
    .ts-step-actions .ts-btn {
        min-width: 160px;
    }
}

@media (max-width: 480px) {
    .ts-frontend-header-title h1 {
        font-size: 12px;
    }
    
    .ts-frontend-header-actions .ts-btn {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .ts-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .ts-form-label {
        font-size: 12px;
    }
    
    .ts-table {
        min-width: 600px;
    }
    
    .ts-title-cell {
        min-width: 140px;
    }
    
    .ts-step-actions .ts-btn {
        min-width: 140px;
    }
}

/* ============================================
   9. استایل صفحه ورود (Auth)
   ============================================ */

.ts-auth-page-wrap {
    background: #f0f2f5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.ts-auth-center-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ts-auth-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.ts-auth-card {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    min-height: 600px;
}

.ts-auth-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 600px;
    direction: ltr;
    align-items: stretch;
}

.ts-auth-media {
    position: relative;
    padding: 1rem;
    background: #fff;
    overflow: hidden;
    display: flex;
    height: 100%;
    min-height: 600px;
    align-self: stretch;
}

.ts-auth-media picture,
.ts-auth-media .ts-auth-media-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    min-height: 100%;
    border-radius: 16px;
    overflow: hidden;
}

.ts-auth-media img {
    width: 100%;
    height: 100% !important;
    min-height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.ts-auth-media.is-placeholder .ts-auth-media-placeholder {
    background: radial-gradient(circle at 20% 20%, #93c5fd 0%, #dbeafe 35%, #eff6ff 100%);
}

.ts-auth-content {
    padding: 2rem;
    background: #fff;
    direction: rtl;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 600px;
}

.ts-auth-content-inner {
    width: 100%;
    max-width: 430px;
    margin-right: auto;
    margin-left: auto;
}

.ts-auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 1.5rem;
    color: #1e293b;
}

.ts-auth-form .form-control,
.ts-auth-form .form-select,
.ts-auth-mobile-input,
.ts-auth-text-input,
.ts-auth-client-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 12px !important;
    font-size: 13px;
    font-family: inherit !important;
    background: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
    height: 46px;
    line-height: 1.4;
}

.ts-auth-form .form-control:focus,
.ts-auth-form .form-select:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13,110,253,0.1);
}

.ts-auth-form .ts-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.ts-auth-form .ts-form-col {
    flex: 1;
}

.ts-auth-submit,
.ts-auth-outline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    height: 46px !important;
    font-size: 14px;
    font-weight: 600;
    border-radius: 30px;
    transition: all 0.2s ease;
}

.ts-auth-outline-btn {
    border-color: #1f6feb;
    color: #1f6feb;
    background: transparent;
}

.ts-auth-outline-btn:hover,
.ts-auth-outline-btn:focus {
    color: #fff !important;
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.ts-btn-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ts-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ts-spin 0.6s linear infinite;
}

.ts-auth-outline-btn .ts-spinner {
    border: 2px solid rgba(13, 110, 253, 0.3);
    border-top-color: #0d6efd;
}

.ts-otp-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    direction: ltr;
}

.ts-otp-input {
    width: 60px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    font-family: monospace;
    border: 1px solid #dee2e6;
    border-radius: 12px !important;
    background: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.ts-otp-input:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13,110,253,0.1);
}

.ts-auth-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ts-auth-form [data-ts-otp-actions],
.ts-auth-form [data-ts-otp-wrap] {
    display: none !important;
}

.ts-auth-form.is-otp-active [data-ts-otp-wrap] {
    display: block !important;
}

.ts-auth-form.is-otp-active [data-ts-otp-actions] {
    display: flex !important;
}

.ts-auth-inline-link,
.ts-auth-bottom-row .text-muted {
    font-size: 0.75rem;
    font-weight: 700;
}

.ts-auth-inline-link {
    color: #1f6feb;
    text-decoration: none;
}

.ts-auth-inline-link:hover,
.ts-auth-inline-link:focus {
    color: #0b5ed7;
}

.ts-auth-code-sent {
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 500;
    color: #1f6feb !important;
    background: transparent;
    padding: 4px 0;
    border-radius: 0;
    display: block;
}

.ts-auth-code-sent.ts-hidden {
    display: none;
}

.ts-auth-message {
    min-height: 1.75rem;
    font-size: 0.82rem;
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
    text-align: center;
}

.ts-auth-message:empty {
    display: none;
}

.ts-auth-message.is-error {
    background: #fde8e8;
    color: #b42318;
}

.ts-auth-message.is-success {
    background: #e8f5e9;
    color: #1e7e34;
}

.ts-auth-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    color: #1f6feb;
}

.ts-auth-back-link:hover,
.ts-auth-back-link:focus {
    color: #0b5ed7;
}

.ts-auth-register-prompt {
    margin-top: 1rem !important;
    text-align: center;
}

.ts-auth-register-prompt p {
    margin-bottom: 0.3rem !important;
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
}

.ts-auth-client-select {
    background-position: left 0.75rem center;
    padding-left: 2rem;
    padding-right: 0.75rem;
}

.ts-auth-footer {
    text-align: center;
    margin-top: 24px;
    padding: 12px;
}

.ts-auth-credit {
    font-size: 11px;
    color: #94a3b8;
    margin: 0;
    direction: ltr;
}

.ts-auth-credit strong {
    font-weight: 600;
    color: #64748b;
}

.ts-client-hint {
    font-size: 11px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.ts-client-hint .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #6c757d;
}

.ts-client-request-link {
    color: #1f6feb;
    text-decoration: none;
    font-weight: 500;
}

.ts-client-request-link:hover {
    color: #0b5ed7;
    text-decoration: underline;
}

@media (max-width: 991px) {
    .ts-auth-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .ts-auth-media {
        min-height: 220px;
    }
    .ts-auth-content-inner {
        max-width: 100%;
    }
    .ts-auth-card {
        min-height: auto;
    }
    .ts-auth-content {
        min-height: auto;
        padding: 1.5rem;
    }
    .ts-auth-page-wrap {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .ts-auth-form .ts-form-row {
        flex-direction: column;
        gap: 16px;
    }
    .ts-auth-page-wrap {
        padding: 12px;
    }
    .ts-auth-content {
        padding: 1.5rem;
    }
    .ts-otp-input {
        width: 45px;
        height: 45px;
        font-size: 20px;
        border-radius: 10px !important;
    }
    .ts-otp-container {
        gap: 8px;
    }
}


/* تنظیمات دکمه‌های هدر برای موبایل */
.ts-frontend-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    line-height: 1.4;
    min-height: 38px;
    height: auto;
    box-sizing: border-box;
}

/* دکمه بازگشت و دکمه بستن تیکت - ارتفاع یکسان */
.ts-back-btn,
.ts-close-btn {
    min-height: 38px;
    height: auto;
    padding: 8px 16px;
}

/* موبایل */
@media (max-width: 768px) {
    .ts-btn {
        min-height: 34px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .ts-back-btn,
    .ts-close-btn {
        min-height: 34px;
        padding: 6px 12px;
    }
    
    .ts-frontend-header-actions {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .ts-btn {
        min-height: 32px;
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .ts-back-btn,
    .ts-close-btn {
        min-height: 32px;
        padding: 5px 10px;
    }
}


