/* ============================================================
   v1.0.0: Beautiful UI Refresh - Buttons, Modals, Loading States
   ============================================================ */

/* ---------- Universal Button System ---------- */
.farasync-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: var(--farasync-radius);
    font-family: var(--farasync-font);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    background: var(--farasync-surface);
    color: var(--farasync-text);
    min-height: 38px;
    position: relative;
    overflow: hidden;
}

.farasync-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.farasync-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.farasync-btn .dashicons::before {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.farasync-btn:hover .dashicons::before {
    transform: scale(1.1);
}

/* Button variants */
.farasync-btn-primary {
    background: linear-gradient(135deg, var(--farasync-primary) 0%, #1a5f9e 100%);
    color: #fff;
    border-color: var(--farasync-primary);
    box-shadow: 0 2px 6px rgba(34, 113, 177, 0.25);
}

.farasync-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--farasync-primary-hover) 0%, #144b7e 100%);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.35);
    transform: translateY(-1px);
}

.farasync-btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(34, 113, 177, 0.2);
}

.farasync-btn-ghost {
    background: var(--farasync-surface);
    color: var(--farasync-text-muted);
    border-color: var(--farasync-border-strong);
}

.farasync-btn-ghost:hover:not(:disabled) {
    background: var(--farasync-bg);
    color: var(--farasync-text);
    border-color: var(--farasync-text-light);
}

.farasync-btn-accent {
    background: linear-gradient(135deg, #6c4ab8 0%, #5a3a9c 100%);
    color: #fff;
    border-color: #6c4ab8;
    box-shadow: 0 2px 6px rgba(108, 74, 184, 0.25);
}

.farasync-btn-accent:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a3a9c 0%, #4a2f80 100%);
    box-shadow: 0 4px 12px rgba(108, 74, 184, 0.35);
    transform: translateY(-1px);
}

.farasync-btn-danger {
    background: linear-gradient(135deg, var(--farasync-danger) 0%, #b02a2c 100%);
    color: #fff;
    border-color: var(--farasync-danger);
    box-shadow: 0 2px 6px rgba(214, 54, 56, 0.25);
}

.farasync-btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #b02a2c 0%, #8e2123 100%);
    box-shadow: 0 4px 12px rgba(214, 54, 56, 0.35);
    transform: translateY(-1px);
}

/* Button sizes */
.farasync-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
}

.farasync-btn-sm .dashicons::before {
    font-size: 14px;
}

.farasync-btn-lg {
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    min-height: 44px;
}

.farasync-btn-lg .dashicons::before {
    font-size: 18px;
}

/* ---------- Loading State ---------- */
/* v1.0.0: Centered with Vazirmatn font. */
.farasync-sm-loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    padding: 32px 16px;
    color: var(--farasync-text-muted);
    font-size: 14px;
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

.farasync-sm-loading-state-large {
    padding: 60px 20px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 18px;
    font-size: 15px;
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

.farasync-sm-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--farasync-bg);
    border-top-color: var(--farasync-primary);
    border-radius: 50%;
    animation: farasync-sm-spin 0.8s linear infinite;
    flex-shrink: 0;
}

.farasync-sm-spinner-lg {
    width: 48px;
    height: 48px;
    border-width: 4px;
    border-top-color: var(--farasync-primary);
    border-right-color: #6c4ab8;
    animation: farasync-sm-spin 1s linear infinite;
}

@keyframes farasync-sm-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Sync Manager Modal Redesign ---------- */
.farasync-sm-modal {
    max-width: 1320px !important;
    padding: 32px 36px;
}

.farasync-sm-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 24px 0;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--farasync-bg);
    font-size: 20px;
    font-weight: 700;
}

.farasync-sm-title-icon {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: var(--farasync-primary);
    background: var(--farasync-primary-light);
    border-radius: var(--farasync-radius);
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.farasync-sm-title-icon::before {
    font-size: 18px;
}

/* ---------- Section Title ---------- */
.farasync-sm-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--farasync-primary-light) 0%, #fff 100%);
    border-inline-start: 4px solid var(--farasync-primary);
    border-radius: var(--farasync-radius);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

.farasync-sm-section-title .dashicons {
    color: var(--farasync-primary);
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ---------- Filters Redesign ---------- */
.farasync-sync-manager-filters {
    background: linear-gradient(135deg, #fafbfc 0%, #fff 100%);
    border: 1px solid var(--farasync-border);
    border-radius: var(--farasync-radius-lg);
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.farasync-sm-filter-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.farasync-sm-filter-row:last-child {
    margin-bottom: 0;
}

.farasync-sm-filter-search {
    position: relative;
    flex: 2 1 auto !important;
    min-width: 220px !important;
    max-width: 400px !important;
    display: flex;
    align-items: center;
}

/* v1.0.0: Search button (magnifier icon) — positioned at the END (right in LTR, left in RTL) of the search field. */
.farasync-sm-search-btn {
    position: absolute;
    inset-inline-end: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--farasync-radius-sm);
    color: var(--farasync-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.farasync-sm-search-btn:hover {
    color: var(--farasync-primary);
    background: var(--farasync-primary-light);
}

.farasync-sm-search-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.farasync-sm-filter-icon {
    position: absolute;
    inset-inline-start: 12px;
    color: var(--farasync-text-light);
    font-size: 16px;
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.farasync-sm-filter-search input {
    width: 100%;
    /* v1.0.0: Vazirmatn font for search input. */
    padding: 5px 36px 5px 10px !important;
    border: 1px solid var(--farasync-border) !important;
    border-radius: var(--farasync-radius) !important;
    font-family: 'Vazirmatn', var(--farasync-font) !important;
    font-size: 13px !important;
    background: #fff !important;
    transition: all 0.2s ease;
    height: 34px !important;
}

/* v1.0.0: Hide the native browser X clear button on search inputs. */
.farasync-sm-filter-search input::-webkit-search-cancel-button,
.farasync-sm-filter-search input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none !important;
}

html[dir="rtl"] .farasync-sm-filter-search input {
    padding: 5px 10px 5px 36px;
}

.farasync-sm-filter-search input:focus {
    outline: none;
    border-color: var(--farasync-primary);
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.12);
}

.farasync-sm-filter-select {
    flex: 1 1 0 !important;
    min-width: 180px !important;
    /* v1.0.0: Increased min-width to 180px for full text visibility. */
    padding: 5px 28px 5px 10px !important;
    border: 1px solid var(--farasync-border) !important;
    border-radius: var(--farasync-radius) !important;
    background: #fff !important;
    font-family: 'Vazirmatn', var(--farasync-font) !important;
    font-size: 13px !important;
    color: var(--farasync-text) !important;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    height: 34px !important;
    display: flex !important;
    align-items: center !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23646970' d='M6 8.825L1.175 4 2.05 3.125 6 7.075 9.95 3.125 10.825 4z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: left 10px center !important;
}

html[dir="rtl"] .farasync-sm-filter-select {
    background-position: right 10px center;
    padding: 5px 10px 5px 28px;
}

.farasync-sm-filter-select:focus {
    outline: none;
    border-color: var(--farasync-primary);
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.12);
}

.farasync-sm-filter-actions {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px dashed var(--farasync-border);
}

/* ---------- Selection Bar Redesign ---------- */
.farasync-sync-manager-selection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fff8e5 0%, #fffaf0 100%);
    border: 1px solid #ffe2a3;
    border-radius: var(--farasync-radius);
    box-shadow: 0 1px 3px rgba(255, 185, 0, 0.1);
}

.farasync-sm-selection-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #b58000;
    font-weight: 600;
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

.farasync-sm-selection-info .dashicons {
    color: #dba617;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.farasync-sm-selected-count {
    font-weight: 700;
    color: #b58000;
}

.farasync-sm-selection-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ---------- Product Grid Redesign ---------- */
.farasync-sync-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    max-height: 480px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--farasync-border);
    border-radius: var(--farasync-radius-lg);
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.farasync-sm-product-card {
    border: 2px solid var(--farasync-border);
    border-radius: var(--farasync-radius);
    padding: 12px;
    background: #fff;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.farasync-sm-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--farasync-primary), transparent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.farasync-sm-product-card:hover {
    border-color: var(--farasync-primary);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.15);
    transform: translateY(-2px);
}

.farasync-sm-product-card:hover::before {
    transform: scaleX(1);
}

.farasync-sm-product-card.is-selected {
    border-color: var(--farasync-primary);
    background: linear-gradient(180deg, #f0f7ff 0%, #fff 100%);
    box-shadow: 0 4px 14px rgba(34, 113, 177, 0.18);
}

.farasync-sm-product-card.is-selected::before {
    transform: scaleX(1);
    background: linear-gradient(90deg, var(--farasync-primary), #6c4ab8);
}

.farasync-sm-product-card.is-imported {
    border-inline-start-width: 4px;
    border-inline-start-color: #46b450;
}

.farasync-sm-product-card.is-needs-update {
    border-inline-start-width: 4px;
    border-inline-start-color: #ffb900;
}

.farasync-sm-product-image {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: var(--farasync-radius);
    margin-bottom: 10px;
    background: var(--farasync-bg);
}

.farasync-sm-product-image-placeholder {
    width: 100%;
    height: 130px;
    border-radius: var(--farasync-radius);
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--farasync-bg) 0%, #e8e9ea 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--farasync-text-light);
    font-size: 28px;
}

.farasync-sm-product-checkbox {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--farasync-primary);
    z-index: 2;
}

/* ---------- Pagination Redesign ---------- */
.farasync-sync-manager-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 18px 0;
    padding: 14px;
    background: var(--farasync-bg);
    border-radius: var(--farasync-radius);
}

.farasync-sm-page-info {
    font-size: 13px;
    color: var(--farasync-text-muted);
    font-weight: 500;
    padding: 4px 12px;
    background: #fff;
    border-radius: var(--farasync-radius);
    border: 1px solid var(--farasync-border);
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

/* ---------- Import Options Panel ---------- */
/* v1.0.0: Vazirmatn font for all Import Options text. */
.farasync-sm-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

.farasync-sm-option-group h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--farasync-text);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

.farasync-sm-option-group .description {
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

.farasync-sm-radio {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: var(--farasync-radius);
    background: #fff;
    border: 1px solid var(--farasync-border);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

.farasync-sm-radio:hover {
    border-color: var(--farasync-primary);
    background: var(--farasync-primary-light);
}

.farasync-sm-radio input[type="radio"] {
    accent-color: var(--farasync-primary);
    cursor: pointer;
}

/* ---------- Progress Panel Redesign ---------- */
.farasync-sm-progress-container {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #fafbfc 0%, #fff 100%);
    border-radius: var(--farasync-radius-lg);
    margin-bottom: 14px;
}

.farasync-sm-progress-circle {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.farasync-sm-progress-circle-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.farasync-sm-progress-circle-bg {
    fill: none;
    stroke: var(--farasync-bg);
    stroke-width: 3;
}

.farasync-sm-progress-circle-fill {
    fill: none;
    stroke: url(#farasync-progress-gradient);
    stroke: var(--farasync-primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 100.53;
    stroke-dashoffset: 100.53;
    transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.farasync-sm-progress-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    font-weight: 700;
    color: var(--farasync-primary);
}

.farasync-sm-progress-info {
    flex: 1;
    min-width: 0;
}

.farasync-sm-progress-bar {
    width: 100%;
    height: 12px;
    background: var(--farasync-bg);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.farasync-sm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--farasync-primary) 0%, #6c4ab8 50%, var(--farasync-primary) 100%);
    background-size: 200% 100%;
    border-radius: 6px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: farasync-progress-shimmer 2s linear infinite;
    position: relative;
    width: 0%;
}

.farasync-sm-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    animation: farasync-progress-shine 1.5s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes farasync-progress-shimmer {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

@keyframes farasync-progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.farasync-sm-progress-text {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--farasync-text);
    margin-top: 10px;
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

.farasync-sm-progress-status {
    text-align: center;
    font-size: 12px;
    color: var(--farasync-text-muted);
    margin-top: 4px;
    font-style: italic;
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

.farasync-sm-progress-log {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--farasync-border);
    border-radius: var(--farasync-radius);
    padding: 10px 12px;
    margin-top: 12px;
    font-size: 12px;
    background: #fff;
    font-family: 'Vazirmatn', var(--farasync-font) !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.farasync-sm-progress-log-item {
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f1;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    animation: farasync-log-fade-in 0.3s ease;
}

@keyframes farasync-log-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.farasync-sm-progress-log-item:last-child {
    border-bottom: none;
}

.farasync-sm-progress-log-item.status-created { color: #155724; }
.farasync-sm-progress-log-item.status-updated { color: #0c5460; }
.farasync-sm-progress-log-item.status-skipped { color: #6c757d; }
.farasync-sm-progress-log-item.status-failed { color: #721c24; }

/* ---------- Summary Panel Redesign ---------- */
.farasync-sm-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

/* v1.0.0: Scope stat styles to summary grid only — do NOT override dashboard .farasync-stat */
.farasync-sm-summary-grid .farasync-stat {
    text-align: center;
    padding: 18px 12px;
    border-radius: var(--farasync-radius-lg);
    background: #fff;
    border: 2px solid currentColor;
    border-color: transparent;
    transition: transform 0.2s ease;
}

.farasync-sm-summary-grid .farasync-stat:hover {
    transform: translateY(-2px);
}

.farasync-sm-summary-grid .farasync-stat-success {
    background: linear-gradient(135deg, #edfaef 0%, #fff 100%);
    border-color: var(--farasync-success);
    color: var(--farasync-success);
}

.farasync-sm-summary-grid .farasync-stat-primary {
    background: linear-gradient(135deg, #f0f7ff 0%, #fff 100%);
    border-color: var(--farasync-primary);
    color: var(--farasync-primary);
}

.farasync-sm-summary-grid .farasync-stat-neutral {
    background: linear-gradient(135deg, #f6f7f9 0%, #fff 100%);
    border-color: var(--farasync-text-light);
    color: var(--farasync-text-light);
}

.farasync-sm-summary-grid .farasync-stat-danger {
    background: linear-gradient(135deg, #fcf0f1 0%, #fff 100%);
    border-color: var(--farasync-danger);
    color: var(--farasync-danger);
}

.farasync-stat-num {
    display: block;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

.farasync-stat-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
    opacity: 0.85;
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

.farasync-sm-item-results {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--farasync-border);
    border-radius: var(--farasync-radius);
    padding: 8px 12px;
    font-size: 12px;
    background: var(--farasync-bg);
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

.farasync-sm-item-result {
    padding: 6px 0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

.farasync-sm-item-result:last-child {
    border-bottom: none;
}

/* ---------- Action Buttons Container ---------- */
.farasync-sm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 0 70px;
    margin-top: 16px;
    border-top: 2px solid var(--farasync-bg);
}

/* ---------- Modal Title with Icon (Universal) ---------- */
.farasync-modal-content h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.farasync-modal-content h2 .dashicons {
    color: var(--farasync-primary);
    font-size: 22px;
    width: 22px;
    height: 22px;
    background: var(--farasync-primary-light);
    padding: 6px;
    border-radius: var(--farasync-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.farasync-modal-content h2 .dashicons::before {
    font-size: 18px;
}

/* v1.0.0 (Round Y21) GLYPH-VISIBILITY FIX: the icon glyph is painted by the
   command-center SVG mask as `background: currentColor`, but that sheet's
   late `.farasync-modal-content > h2 > span:not(.farasync-modal-close)`
   (#f8fafc !important) repainted EVERY modal-header icon near-white — a white
   glyph on this near-white pill = invisible design (the «همگام‌سازی سراسری»
   header icon was a solid white blob). This rule is (0,3,2)+!important, so it
   beats the (0,3,1) span rule deterministically: blue glyph on the light-blue
   pill, for every modal header. */
.farasync-modal .farasync-modal-content > h2 .dashicons,
.farasync-modal .farasync-modal-content > h3 .dashicons,
.farasync-price-rules-title .dashicons,
.farasync-sm-title .dashicons {
    color: var(--farasync-primary, #2271b1) !important;
}

/* ---------- Responsive ---------- */
@media screen and (max-width: 782px) {
    .farasync-sm-options-grid {
        grid-template-columns: 1fr;
    }
    .farasync-sm-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .farasync-sm-filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    .farasync-sm-filter-search,
    .farasync-sm-filter-select {
        width: 100%;
        max-width: 100%;
    }
    .farasync-sm-progress-container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    .farasync-sm-actions {
        flex-direction: column-reverse;
    }
    .farasync-sm-actions .farasync-btn {
        width: 100%;
    }
    .farasync-sm-selection-actions {
        width: 100%;
        justify-content: stretch;
    }
    .farasync-sm-selection-actions .farasync-btn {
        flex: 1;
    }
}

/* ---------- Scrollbar styling ---------- */
.farasync-sync-manager-grid::-webkit-scrollbar,
.farasync-sm-progress-log::-webkit-scrollbar,
.farasync-sm-item-results::-webkit-scrollbar {
    width: 8px;
}

.farasync-sync-manager-grid::-webkit-scrollbar-track,
.farasync-sm-progress-log::-webkit-scrollbar-track,
.farasync-sm-item-results::-webkit-scrollbar-track {
    background: var(--farasync-bg);
    border-radius: 4px;
}

.farasync-sync-manager-grid::-webkit-scrollbar-thumb,
.farasync-sm-progress-log::-webkit-scrollbar-thumb,
.farasync-sm-item-results::-webkit-scrollbar-thumb {
    background: var(--farasync-text-light);
    border-radius: 4px;
}

.farasync-sync-manager-grid::-webkit-scrollbar-thumb:hover,
.farasync-sm-progress-log::-webkit-scrollbar-thumb:hover,
.farasync-sm-item-results::-webkit-scrollbar-thumb:hover {
    background: var(--farasync-text-muted);
}

/* ---------- Select All Pages Button Active State ---------- */
.farasync-btn-accent.is-active {
    background: linear-gradient(135deg, #5a3a9c 0%, #4a2f80 100%) !important;
    box-shadow: 0 0 0 3px rgba(108, 74, 184, 0.25), 0 4px 12px rgba(108, 74, 184, 0.35) !important;
    color: #fff !important;
}

.farasync-btn-accent.is-active::before {
    content: '✓';
    font-weight: bold;
    margin-inline-end: 2px;
}

/* ---------- SVG Gradient Definition (for progress circle) ---------- */
.farasync-sm-progress-circle-svg defs {
    /* fallback - using stroke color directly */
}

/* ---------- Modal Header Enhancement ---------- */
.farasync-sm-modal .farasync-modal-content {
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}

/* ---------- Smaller spacing between filter selects on mobile ---------- */
@media screen and (max-width: 600px) {
    .farasync-sm-filter-select {
        min-width: 100%;
    }
    .farasync-sync-manager-selection {
        flex-direction: column;
        align-items: stretch;
    }
    .farasync-sm-selection-info {
        justify-content: center;
    }
    .farasync-sm-selection-actions {
        justify-content: center;
    }
    .farasync-sm-selection-actions .farasync-btn {
        flex: 1;
        min-width: 0;
    }
}

/* ---------- Fields Toolbar (Select All / Deselect All) ---------- */
.farasync-fields-toolbar {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    padding: 8px;
    background: var(--farasync-bg);
    border-radius: 5px;
    border: 1px dashed var(--farasync-border);
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

.farasync-fields-toolbar .farasync-btn {
    flex: 0 0 auto;
}

/* v1.0.0: Import fields grid is now handled in admin-luxury.css with responsive breakpoints. */

/* ---------- Sync Manager Stock Filter Hidden State ---------- */
.farasync-sm-filter-select[style*="display: none"],
#farasync-sm-stock-filter[style*="display: none"] {
    display: none !important;
}

/* ---------- Invoices Representative Cell ---------- */
.farasync-invoices-table td a[title] {
    transition: color 0.15s ease;
}

.farasync-invoices-table td a[title]:hover {
    color: var(--farasync-primary-hover) !important;
    text-decoration: underline !important;
}
