.taknema-settings-wrap {
    max-width: 1200px;
    margin: 20px auto;
  
}

.taknema-settings-wrap h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #1d2327;
}

.taknema-settings-wrap .description {
    font-size: 14px;
    color: #646970;
    margin-bottom: 20px;
}

.taknema-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 15px 0 25px 0;
}

.taknema-stat-box {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 15px 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.taknema-stat-box:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.taknema-stat-box .number {
    font-size: 28px;
    font-weight: 700;
    color: #2271b1;
    line-height: 1.2;

}

.taknema-stat-box .label {
    color: #646970;
    font-size: 13px;
    margin-top: 5px;
}

.taknema-settings-container {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.taknema-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.taknema-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #a7aaad;
}

.taknema-card.changed {
    border-left: 4px solid #f0c33c;
    background: #fefbf3;
}

.taknema-card h2 {
    font-size: 20px;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f1;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 8px;
}

.taknema-card h3 {
    font-size: 16px;
    margin: 15px 0 10px 0;
    color: #1d2327;
}

.taknema-card .description {
    margin-bottom: 15px;
    color: #646970;
}

.taknema-card hr {
    margin: 20px 0;
    border: none;
    border-top: 1px solid #dcdcde;
}

.taknema-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.taknema-checkbox-grid label {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.taknema-checkbox-grid label:hover {
    background: #e5e9f2;
    border-color: #2271b1;
}

.taknema-checkbox-grid label.has-checked {
    background: #eef5ff;
    border-color: #2271b1;
}

.taknema-checkbox-grid input[type="checkbox"] {
    margin: 0 8px 0 0;
    cursor: pointer;
    flex-shrink: 0;
}

.taknema-checkbox-grid input[type="checkbox"]:checked {
    accent-color: #2271b1;
}

.taknema-exception-group {
    margin-bottom: 25px;
    padding: 15px;
    background: #f6f7f7;
    border-radius: 6px;
    border: 1px solid #dcdcde;
}

.taknema-exception-group:last-child {
    margin-bottom: 0;
}

.taknema-exception-group h3 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #1d2327;
    font-size: 15px;
}

.taknema-exception-group .description {
    margin-bottom: 12px;
    color: #646970;
    font-size: 13px;
}

.taknema-accordion {
    margin-bottom: 15px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    overflow: hidden;
}

.taknema-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f6f7f7;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.taknema-accordion-header:hover {
    background: #e5e9f2;
}

.taknema-accordion-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.taknema-accordion-toggle {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: #646970;
}

.taknema-accordion.active .taknema-accordion-toggle {
    transform: rotate(180deg);
}

.taknema-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 15px;
}

.taknema-accordion.active .taknema-accordion-content {
    max-height: 1000px;
    padding: 15px;
}

.taknema-system-info {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 20px;
}

.taknema-system-info table {
    width: 100%;
    border-collapse: collapse;
}

.taknema-system-info table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f1;
}

.taknema-system-info table tr:last-child td {
    border-bottom: none;
}

.taknema-system-info table td:first-child {
    width: 35%;
    font-weight: 500;
    color: #1d2327;
}

.taknema-system-info table td:last-child {
    color: #50575e;
}

.taknema-footer {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    padding: 15px 20px;
    text-align: center;
    margin-top: 20px;
}

.taknema-footer p {
    margin: 0;
    color: #646970;
    font-size: 14px;
}

.taknema-footer a {
    color: #2271b1;
    text-decoration: none;
    margin: 0 5px;
    transition: color 0.2s ease;
}

.taknema-footer a:hover {
    color: #135e96;
    text-decoration: underline;
}

.taknema-submit-section {
    text-align: center;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 6px;
    margin-top: 20px;
}

.button-hero {
    font-size: 16px !important;
    padding: 10px 30px !important;
    height: auto !important;
    line-height: 1.5 !important;
}

.button-hero:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

input[type="text"].regular-text {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"].regular-text:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    width: 120px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -moz-appearance: textfield;
}

input[type="number"]:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

select {
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    min-width: 200px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

input[type="radio"] {
    margin-right: 8px;
}

input[type="checkbox"] {
    margin-right: 8px;
}

.taknema-help-tip {
    display: inline-block;
    cursor: help;
    color: #646970;
    margin-left: 5px;
    font-size: 14px;
}

.taknema-help-tip:hover {
    color: #2271b1;
}

.taknema-card .form-table th {
    width: 30%;
    padding: 15px 10px 15px 0;
    font-weight: 500;
    color: #1d2327;
}

.taknema-card .form-table td {
    padding: 15px 10px;
}

.taknema-card .form-table label {
    display: block;
    margin-bottom: 8px;
}

.taknema-card .form-table label strong {
    font-weight: 600;
}

.notice.is-dismissible {
    border-left-width: 4px;
    border-radius: 4px;
    margin: 15px 0 20px 0;
}

.taknema-help-box {
    background: #fffbea;
    border: 1px solid #f0c36d;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
}

.taknema-help-box h3 {
    margin-top: 0;
    color: #8a6d3b;
}

.taknema-help-box ul {
    margin: 10px 0;
    padding-right: 20px;
    list-style: disc;
}

.taknema-help-box li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #50575e;
}

.taknema-help-box li strong {
    color: #1d2327;
}

@media (max-width: 768px) {
    .taknema-checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .taknema-settings-wrap h1 {
        font-size: 24px;
    }
    
    .taknema-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .taknema-stat-box .number {
        font-size: 22px;
    }
    
    .taknema-stat-box {
        padding: 12px 15px;
    }
    
    .taknema-card {
        padding: 15px;
    }
    
    .taknema-card .form-table th {
        width: 100%;
        display: block;
        padding: 10px 0 5px 0;
    }
    
    .taknema-card .form-table td {
        display: block;
        padding: 5px 0 15px 0;
    }
    
    input[type="text"].regular-text {
        max-width: 100%;
    }
    
    select {
        max-width: 100%;
    }
    
    .taknema-exception-group {
        padding: 12px;
    }
    
    .taknema-settings-wrap .select2-container {
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .taknema-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .taknema-stat-box .number {
        font-size: 20px;
    }
    
    .taknema-settings-wrap h1 {
        font-size: 20px;
    }
    
    .button-hero {
        font-size: 14px !important;
        padding: 8px 20px !important;
        width: 100%;
    }
    
    .taknema-footer p {
        font-size: 12px;
    }
}

.select2-container {
    max-width: 600px;
}

.select2-container--default .select2-selection--multiple {
    border-color: #8c8f94;
    border-radius: 4px;
    min-height: 38px;
    padding: 2px 5px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.select2-container--default .select2-selection--multiple:hover {
    border-color: #2271b1;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 2px 8px;
    margin: 3px 4px 3px 0;
    font-size: 13px;
    line-height: 1.4;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff;
    opacity: 0.8;
    margin-right: 4px;
    font-size: 14px;
    transition: opacity 0.2s ease;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fff;
    opacity: 1;
}

.select2-container--default .select2-search--inline .select2-search__field {
    margin-top: 4px;
    font-size: 14px;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.select2-dropdown {
    border-color: #8c8f94;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.select2-results__option--highlighted[aria-selected] {
    background: #2271b1;
}

.select2-results__option[aria-selected=true] {
    background: #e5e9f2;
}

.select2-results__option--highlighted[aria-selected=true] {
    background: #2271b1;
    color: #fff;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding: 2px 0;
}

.select2-container--default .select2-selection--multiple .select2-selection__clear {
    margin-top: 4px;
    font-size: 16px;
    color: #646970;
}

.select2-container--default .select2-selection--multiple .select2-selection__clear:hover {
    color: #d63638;
}

.select2-container--default .select2-results__option--loading {
    color: #646970;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered .select2-selection__choice.taknema-disabled {
    background: #dcdcde;
    color: #646970;
}

.select2-results__options::-webkit-scrollbar {
    width: 6px;
}

.select2-results__options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.select2-results__options::-webkit-scrollbar-thumb {
    background: #c1c7cd;
    border-radius: 3px;
}

.select2-results__options::-webkit-scrollbar-thumb:hover {
    background: #a7aaad;
}

.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    color: #8c8f94;
    font-size: 13px;
}

.taknema-settings-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 2px 8px;
    margin: 3px 4px 3px 0;
    font-size: 13px;
}

.taknema-settings-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff;
    opacity: 0.8;
    margin-right: 4px;
    font-size: 14px;
}

.taknema-settings-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fff;
    opacity: 1;
}

.taknema-settings-wrap .select2-container {
    max-width: 600px;
}

.taknema-settings-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding: 2px 0;
}

.taknema-settings-wrap .select2-container--default .select2-selection--multiple .select2-selection__clear {
    margin-top: 4px;
    font-size: 16px;
}

.taknema-settings-wrap .select2-container--default .select2-results__option--loading {
    color: #646970;
}

.taknema-settings-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered .select2-selection__choice.taknema-disabled {
    background: #dcdcde;
    color: #646970;
}

/* ============================================= */
/* 🔥 پشتیبانی کامل از RTL برای زبان‌های راست‌چین */
/* ============================================= */

body.rtl .taknema-settings-wrap {
    direction: rtl;
}

body.rtl .taknema-card h2 {
    text-align: right;
    justify-content: flex-start;
}

body.rtl .taknema-card h2 .emoji,
body.rtl .taknema-card h2 img.emoji {
    margin-left: 8px;
    margin-right: 0;
    display: inline-block;
    order: -1;
}

body.rtl .taknema-card h3 {
    text-align: right;
}

body.rtl .taknema-card .description {
    text-align: right;
}

body.rtl .taknema-checkbox-grid input[type="checkbox"] {
    margin: 0 0 0 8px;
}

body.rtl .taknema-checkbox-grid input[type="radio"] {
    margin: 0 0 0 8px;
}

body.rtl .taknema-card.changed {
    border-left: none;
    border-right: 4px solid #f0c33c;
}

body.rtl .taknema-card .form-table th {
    text-align: right;
    padding: 15px 0 15px 10px;
}

body.rtl .taknema-card .form-table td {
    text-align: right;
}

body.rtl .select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin: 3px 0 3px 4px;
}

body.rtl .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    margin-right: 0;
    margin-left: 4px;
}

body.rtl .taknema-accordion-toggle {
    transform: rotate(180deg);
}

body.rtl .taknema-accordion.active .taknema-accordion-toggle {
    transform: rotate(0deg);
}

body.rtl .notice.is-dismissible {
    border-left: none;
    border-right: 4px solid;
}

body.rtl .taknema-help-box ul {
    padding-right: 0;
    padding-left: 20px;
}

body.rtl .taknema-help-box {
    text-align: right;
}

body.rtl .taknema-system-info table td:first-child {
    text-align: right;
}

body.rtl .taknema-system-info table td:last-child {
    text-align: right;
}

body.rtl .taknema-stats-grid .taknema-stat-box .number {
    direction: ltr;
    display: inline-block;
}

body.rtl .taknema-stats-grid .taknema-stat-box .label {
    text-align: center;
}

body.rtl .taknema-stat-box {
    direction: rtl;
}

body.rtl .button-hero {
    direction: rtl;
}

body.rtl input[type="text"].regular-text {
    text-align: right;
}

body.rtl input[type="number"] {
    text-align: right;
}

body.rtl select {
    text-align: right;
}

body.rtl .taknema-card h2 {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

body.rtl .taknema-card h2 .emoji,
body.rtl .taknema-card h2 img.emoji {
    order: -1;
    float: none;
    margin-left: 8px;
    margin-right: 0;
    vertical-align: middle;
}

/* Firefox Support for Stats */
@-moz-document url-prefix() {
    .taknema-stat-box .number {

    }
    body.rtl .taknema-stat-box .number {

    }
}

@media (max-width: 768px) {
    body.rtl .taknema-card .form-table th {
        padding: 10px 0 5px 0;
        text-align: right;
    }
    
    body.rtl .taknema-card .form-table td {
        text-align: right;
    }
    
    body.rtl .taknema-card h2 {
        font-size: 18px;
    }
}