.dmt-dashboard {
    direction: rtl;
    text-align: right;
    font-family: inherit;
    background-color: #f9fafb;
    /*min-height: 600px;*/
    padding: 24px;
    border-radius: 15px;
    box-sizing: border-box;
    line-height: 1.6;
    color: #374151;
}

.woocommerce-MyAccount-content-wrapper {
    min-height: 600px;
}

.dmt-dashboard * {
    box-sizing: border-box;
}

.dmt-hidden {
    display: none !important;
}

.dmt-relative {
    position: relative;
}

.dmt-tabs-header {
    display: flex;
    gap: 12px;
    background: #fff;
    padding: 8px;
    border-radius: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 0 auto 24px auto;
    max-width: 900px;
}

.dmt-tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: bold;
    color: #6b7280;
    border-radius: 12px;
    transition: all 0.2s;
    font-size: 14px;
    position: relative;
}

.dmt-tab-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.dmt-tab-btn.active {
    background: #eff6ff;
    color: #2563eb;
}

.dmt-tab-btn.active-alt {
    background: #f0fdf4;
    color: #16a34a;
}

.dmt-badge-count {
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    position: absolute;
    top: 5px;
    left: 10px;
}

/* Main Content Box */
.dmt-box {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.dmt-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.dmt-header-title {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #111827 !important;
    margin: 0 0 12px 0 !important;
    position: relative;
    padding-right: 10px;
}

.dmt-header-title::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    border-radius: 15px;
    width: 3px;
    height: 100%;
    background-color: #c36;
}

.dmt-text-muted {
    font-size: 13px;
    color: #6b7280;
}

/* Form Grid & Elements */
.dmt-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.dmt-form-group {
    margin-bottom: 16px;
}

.dmt-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.dmt-input, .dmt-select, .dmt-textarea {
    width: 100% !important;
    padding: 10px 14px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    color: #1f2937 !important;
    background: #f9fafb !important;
    transition: all 0.2s !important;
    outline: none !important;
}

.dmt-input:focus, .dmt-select:focus, .dmt-textarea:focus {
    border-color: #3b82f6 !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.dmt-textarea {
    min-height: 140px;
    resize: vertical;
}

/* Uploader Section */
.dmt-form-footer-row {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 24px;
    border-top: 1px solid #e5e7eb;
    padding-top: 24px;
}

.dmt-uploader {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    background: #f9fafb;
    transition: all 0.2s;
    cursor: pointer;
}

.dmt-uploader:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

/* Stats Cards */
.dmt-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin: 0 auto 24px auto;
    max-width: 900px;
}

.dmt-stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.dmt-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 4px;
}

/* Table Wrapper */
.dmt-table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.dmt-table th {
    background: #f9fafb;
    padding: 16px;
    font-size: 12px;
    color: #6b7280;
    text-align: right;
    border-bottom: 1px solid #e5e7eb;
}

.dmt-table td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    color: #1f2937;
}

/* FAQ & Details */
.dmt-details {
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.dmt-summary {
    padding: 14px 16px;
    background: #f9fafb;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.dmt-faq-content {
    padding: 16px;
    font-size: 13px;
    color: #4b5563;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

/* Chat Box */
.dmt-chat-box {
    background: #f3f4f6;
    border-radius: 15px;
    padding: 20px;
    height: 400px;
    overflow-y: auto;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
}

.dmt-msg-bubble {
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.6;
}

/* Buttons */
.dmt-btn-submit, .dmt-link-toggle {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 32px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    height: 44px;
}

.dmt-btn-submit:hover {
    background: #1d4ed8;
}

/* Responsive Cleanup */
@media (max-width: 768px) {
    .dmt-form-grid {
        grid-template-columns: 1fr;
    }

    .dmt-form-footer-row {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    .dmt-btn-submit {
        width: 100%;
    }

    .dmt-tabs-header {
        gap: 8px;
        padding: 6px;
    }

    .dmt-tab-btn {
        padding: 10px 8px;
        font-size: 13px;
    }

    .dmt-btn-submit, .dmt-uploader-wrapper, .dmt-submit-container, .dmt-link-toggle {
        width: 100% !important;
    }
}

.dmt-btn-submit {
    width: 100% !important;
}

.dmt-empty-text {
    padding: 10px;
}

.dmt-uploader-wrapper, .dmt-submit-container {
    flex-grow: 1;
    width: 100%;
}

.dmt-submit-container {
    text-align: end;
}

.dmt-btn-submit {
    border-radius: 15px !important;
}

/*stats start*/

/* Stats Grid Layout */
.dmt-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin: 0 auto 24px auto;
    max-width: 900px;
}

/* Base Stat Card Style */
.dmt-stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 15px; /* Consistent with your panel tabs */
    text-align: center;
    border: 1px solid #e5e7eb;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.dmt-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

/* Stat Typography */
.dmt-stat-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

.dmt-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.dmt-stat-card.green {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}
.dmt-stat-card.green .dmt-stat-label { color: #15803d; }

.dmt-stat-card.yellow {
    background-color: #fffbeb;
    border-color: #fef08a;
    color: #854d0e;
}
.dmt-stat-card.yellow .dmt-stat-label { color: #a16207; }

.dmt-stat-card.blue {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}
.dmt-stat-card.blue .dmt-stat-label { color: #1d4ed8; }

.dmt-stat-card.gray {
    background-color: #f9fafb;
    border-color: #e5e7eb;
    color: #374151;
}
.dmt-stat-card.gray .dmt-stat-label { color: #6b7280; }

@media (max-width: 480px) {
    .dmt-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .dmt-stat-card {
        padding: 16px 10px;
    }
}

.dm-alert {
    background: #fff9eb;
    border: 1px solid #fef08a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

/* Table Container & Wrapper */
.dmt-table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 15px; /* Consistent with panel radius */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    margin-top: 20px;
}

/* Base Table Styles */
.dmt-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px; /* Ensures layout doesn't break on small screens */
    text-align: right;
}

/* Header Styling */
.dmt-table thead th {
    background-color: #f9fafb;
    padding: 16px;
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
    border-bottom: 2px solid #f3f4f6;
    white-space: nowrap;
}

/* Body Cell Styling */
.dmt-table tbody td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
    color: #1f2937;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

/* Row Hover Action */
.dmt-table tbody tr:hover td {
    background-color: #fcfdfe;
}

/* Last Row Border Removal */
.dmt-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.dmt-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.dmt-badge-answered {
    background-color: #eff6ff;
    color: #2563eb;
}

.dmt-badge-open {
    background-color: #f0fdf4;
    color: #16a34a;
}

.dmt-badge-progress {
    background-color: #fffbeb;
    color: #b45309;
}

.dmt-badge-closed {
    background-color: #f3f4f6;
    color: #4b5563;
}

/* Priority Badges */
.dmt-priority-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    margin-top: 6px;
}

.dmt-priority-badge.critical {
    background-color: #fee2e2;
    color: #dc2626;
}

.dmt-priority-badge.high {
    background-color: #ffedd5;
    color: #ea580c;
}

/* Date Column */
.dmt-date-col {
    color: #6b7280;
    font-size: 12px;
    font-feature-settings: "tnum"; /* Tabular numbers for better alignment */
}

/* View Button / Action Link */
.dmt-action-link {
    display: inline-flex;
    padding: 6px 16px;
    background-color: #f3f4f6;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.dmt-action-link:hover {
    background-color: #e5e7eb;
    color: #111827;
}


/* Responsive Handling */
@media (max-width: 640px) {
    .dmt-table-wrapper {
        border-radius: 12px;
        margin: 0 -4px;
    }
}

.dmt-table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid #eef0f2;
    margin-top: 24px;
    padding: 12px;
}

.dmt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    min-width: 700px;
    text-align: right;
    margin-bottom: 0;
}

.dmt-table thead th {
    background-color: transparent;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 800;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
    border: none !important;
}

.dmt-table tbody td {
    padding: 18px 20px;
    vertical-align: middle;
    background-color: #fff;
    border-top: 1px solid #f8fafc;
    border-bottom: 1px solid #f8fafc;
    color: #334155;
    font-size: 14px;
    transition: all 0.2s ease;
    border: none !important;
}

.dmt-table tbody td:first-child {
    border-right: 1px solid #f8fafc;
    border-radius: 0 12px 12px 0;
}

.dmt-table tbody td:last-child {
    border-left: 1px solid #f8fafc;
    border-radius: 12px 0 0 12px;
}

.dmt-table tbody tr:hover td {
    background-color: #f8fbff;
    border-color: #e0eefe;
}

.dmt-date-col {
    color: #64748b;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.dmt-meta-info {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.dmt-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.dmt-badge-answered {
    background-color: #eff6ff;
    color: #2563eb;
}

.dmt-badge-open {
    background-color: #f0fdf4;
    color: #16a34a;
}

.dmt-priority-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    margin-top: 6px;
}

.dmt-priority-badge.critical {
    background-color: #fee2e2;
    color: #dc2626;
}

.dmt-priority-badge.high {
    background-color: #ffedd5;
    color: #ea580c;
}

.dmt-action-link {
    display: inline-flex;
    padding: 8px 18px;
    background-color: #f1f5f9;
    color: #475569;
    text-decoration: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.dmt-action-link:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

@media (max-width: 640px) {
    .dmt-table-wrapper {
        padding: 8px;
        margin-top: 16px;
    }
}

/*show ticket styles*/

.dmt-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.dmt-back-btn {
    flex: none !important;
    width: auto !important;
    padding: 6px 20px !important;
    height: 36px !important;
    font-size: 13px !important;
    background: #f3f4f6 !important;
    color: #4b5563 !important;
    border-radius: 10px !important;
}

.dmt-back-btn:hover {
    background: #e5e7eb !important;
    color: #111827 !important;
}

.dmt-chat-box {
    padding: 24px !important;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background-color: #f8fafc !important;
}

.dmt-msg-row {
    display: flex;
    gap: 12px;
    max-width: 85%;
}

.dmt-msg-me {
    flex-direction: row;
    align-self: flex-start;
}

.dmt-msg-agent {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.dmt-msg-avatar img {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    border: 2px solid #fff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

.dmt-msg-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dmt-msg-bubble {
    padding: 12px 18px !important;
    font-size: 14px;
    line-height: 1.6;
    border-radius: 15px !important;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.dmt-msg-me .dmt-msg-bubble {
    background-color: #eff6ff !important;
    color: #1e40af !important;
    border-top-right-radius: 4px !important;
}

.dmt-msg-agent .dmt-msg-bubble {
    background-color: #fff !important;
    color: #374151 !important;
    border: 1px solid #e5e7eb;
    border-top-left-radius: 4px !important;
}

.dmt-msg-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.dmt-msg-files {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dmt-file-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    text-decoration: none !important;
    color: #2563eb !important;
    font-size: 12px;
    transition: all 0.2s;
}

.dmt-file-link:hover {
    border-color: #3b82f6;
    background-color: #f0f7ff;
}

.dmt-file-link img.emoji {
    width: 14px;
    height: 14px;
}

.dmt-reply-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.dmt-reply-upload-wrapper {
    flex: 1;
}

.dmt-file-input-sm {
    font-size: 12px;
    color: #64748b;
}

@media (max-width: 640px) {
    .dmt-msg-row {
        max-width: 95%;
    }
}

/*new modifications*/

.dmt-dashboard .dmt-no-products-msg {
    padding: 12px 14px;
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    font-size: 13px;
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dmt-dashboard .dmt-no-products-msg a {
    color: #dc2626;
    font-weight: bold;
    text-decoration: underline;
    transition: color 0.2s;
}

.dmt-dashboard .dmt-no-products-msg a:hover {
    color: #991b1b;
}

.dmt-dashboard .dmt-uploader {
    position: relative;
    overflow: hidden;
}

.dmt-dashboard #dmt-upload-input,
.dmt-dashboard #dmt-reply-upload-input {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.dmt-dashboard .dmt-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.dmt-dashboard .dmt-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
}

.dmt-dashboard .dmt-file-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.dmt-dashboard .dmt-file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dmt-dashboard .dmt-file-name {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 75%;
}

.dmt-dashboard .dmt-progress-text {
    font-size: 11px;
    font-weight: 700;
}

.dmt-dashboard .dmt-progress-bg {
    width: 100%;
    height: 4px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.dmt-dashboard .dmt-progress-bar {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.dmt-dashboard .dmt-remove-file {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    background-color: #fff;
    border: 1px solid #fca5a5;
    color: #ef4444;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s ease;
}

.dmt-dashboard .dmt-remove-file:hover {
    background-color: #fee2e2;
    border-color: #ef4444;
}

@media (min-width: 992px) {
    .dmt-dashboard .dmt-form-footer-row {
        padding-left: 0;
        padding-right: 0;
    }
}

.dmt-dashboard .dmt-reply-upload-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.dmt-dashboard .dmt-reply-upload-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background-color: #f3f4f6;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    color: #4b5563;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.dmt-dashboard .dmt-reply-upload-wrapper:hover .dmt-reply-upload-trigger {
    background-color: #e5e7eb;
    border-color: #9ca3af;
    color: #1f2937;
}

.dmt-dashboard .dmt-system-log-row {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 16px 0;
}

.dmt-dashboard .dmt-system-log-text {
    background-color: #f3f4f6;
    color: #6b7280;
    font-size: 11px;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    text-align: center;
}

/* Unread Row Styling */
.dmt-table-wrapper .dmt-table tbody tr.dmt-row-unread td {
    background-color: #f0f7ff;
    font-weight: 700;
    color: #1e3a8a;
}

.dmt-table-wrapper .dmt-table tbody tr.dmt-row-unread td:first-child {
    border-right: 3px solid #2563eb;
}

/* Ensure the action link stands out on the tinted background */
.dmt-table-wrapper .dmt-table tbody tr.dmt-row-unread .dmt-action-link {
    background-color: #3b82f6;
    color: #ffffff;
}

.dmt-table-wrapper .dmt-table tbody tr.dmt-row-unread .dmt-action-link:hover {
    background-color: #2563eb;
}