/* ================================================================
   Farasync Luxury UI Refresh (v1.0.0)
   - Comprehensive Vazirmatn font application:
     * Bold (700)   → all titles, headings, tab labels, stat numbers
     * Medium (500) → buttons, labels, prominent UI text
     * Regular (400)→ body text, descriptions, muted text
   - Modern, luxurious redesign for:
     * Tabs (glassmorphism, gradient underline)
     * Modals (depth, gradient headers, smooth animations)
     * Module cards (4-column dashboard, premium shadows)
     * Stat cards (gradient backgrounds, colored accents)
     * Form inputs (modern focus states, soft shadows)
   - 4-column stat card layout for Dashboard + Sales Report tabs.
   ================================================================ */

/* ---------- Font tokens (single source of truth) ---------- */
:root {
    --farasync-font-regular: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
    --farasync-font-medium:  'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
    --farasync-font-bold:    'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
    --farasync-weight-regular: 400;
    --farasync-weight-medium:  500;
    --farasync-weight-bold:    700;
    /* Premium palette additions. */
    --farasync-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --farasync-gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --farasync-gradient-warning: linear-gradient(135deg, #f09819 0%, #ff5858 100%);
    --farasync-gradient-danger:  linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    --farasync-gradient-card:    linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    --farasync-shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    --farasync-shadow-card-hover: 0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
    --farasync-shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.24), 0 8px 16px rgba(0, 0, 0, 0.12);
    --farasync-radius-xl: 5px;
    --farasync-radius-2xl: 5px;
}

/* ================================================================
   1. FONT APPLICATION — Vazirmatn everywhere with proper weights
   ================================================================ */

/* Body / general text → Regular (400). */
.farasync-wrap,
.farasync-wrap p,
.farasync-wrap span,
.farasync-wrap td,
.farasync-wrap th,
.farasync-wrap li,
.farasync-wrap code,
.farasync-wrap .description,
.farasync-wrap .farasync-subtitle,
.farasync-wrap .farasync-stat-label,
.farasync-wrap .farasync-info-item strong,
.farasync-wrap .farasync-module-info p,
.farasync-wrap .farasync-keys-desc,
.farasync-wrap .farasync-source-name + small,
.farasync-wrap .farasync-source-url {
    font-family: var(--farasync-font-regular);
    font-weight: var(--farasync-weight-regular);
}

/* Headings → Bold (700). */
.farasync-wrap h1,
.farasync-wrap h2,
.farasync-wrap h3,
.farasync-wrap h4,
.farasync-wrap h5,
.farasync-wrap h6,
.farasync-header-title h1,
.farasync-modal-content h2,
.farasync-modal-content h3,
.farasync-modal-content h4,
.farasync-module-info h3,
.farasync-dashboard-info h3,
.farasync-health-section h3,
.farasync-section-title,
.farasync-sm-title,
.farasync-price-rules-title,
.farasync-price-rule-form-title {
    font-family: var(--farasync-font-bold);
    font-weight: var(--farasync-weight-bold) !important;
    letter-spacing: -0.3px;
}

/* Tab labels → Bold (700) when active, Medium (500) when inactive. */
.farasync-tab {
    font-family: var(--farasync-font-medium);
    font-weight: var(--farasync-weight-medium);
}
.farasync-tab.is-active {
    font-family: var(--farasync-font-bold);
    font-weight: var(--farasync-weight-bold) !important;
}

/* Stat numbers → Bold (700). */
.farasync-stat-num,
.farasync-sm-summary-value,
.farasync-sm-stat-num {
    font-family: var(--farasync-font-bold);
    font-weight: var(--farasync-weight-bold) !important;
}

/* Buttons & form labels → Medium (500). */
.farasync-wrap .button,
.farasync-wrap .button-primary,
.farasync-wrap .button-secondary,
.farasync-wrap .farasync-btn,
.farasync-wrap label,
.farasync-wrap .form-table th,
.farasync-wrap .farasync-field-label-text,
.farasync-wrap .farasync-source-name,
.farasync-wrap .farasync-source-action-btn,
.farasync-wrap .farasync-tab-label {
    font-family: var(--farasync-font-medium);
    font-weight: var(--farasync-weight-medium);
}

/* Source name → Bold (it's the primary identifier). */
.farasync-source-name {
    font-family: var(--farasync-font-bold) !important;
    font-weight: var(--farasync-weight-bold) !important;
}

/* ================================================================
   2. TABS — Modern glassmorphism with gradient underline
   ================================================================ */
.farasync-tabs {
    background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
    border: 1px solid var(--farasync-border);
    border-radius: var(--farasync-radius-2xl) var(--farasync-radius-2xl) 0 0;
    padding: 6px 8px 0;
    margin-bottom: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    gap: 4px;
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}
.farasync-tab {
    padding: 12px 20px !important;
    border-radius: var(--farasync-radius) var(--farasync-radius) 0 0 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 13.5px !important;
    border: none !important;
    background: transparent !important;
    color: var(--farasync-text-muted) !important;
    position: relative;
    white-space: nowrap;
}
.farasync-tab:hover {
    background: var(--farasync-primary-light) !important;
    color: var(--farasync-primary) !important;
    transform: translateY(-1px);
}
.farasync-tab.is-active {
    background: linear-gradient(180deg, var(--farasync-primary-light) 0%, #ffffff 100%) !important;
    color: var(--farasync-primary) !important;
    box-shadow: 0 -2px 6px rgba(34, 113, 177, 0.08);
}
.farasync-tab.is-active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 12px;
    right: 12px;
    height: 3px;
    background: var(--farasync-gradient-primary);
    border-radius: 3px 3px 0 0;
}
.farasync-tab .dashicons {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
}

/* Tab panels — soft background. */
.farasync-tab-panels {
    background: var(--farasync-bg);
    border: 1px solid var(--farasync-border);
    border-top: none;
    border-radius: 0 0 var(--farasync-radius-2xl) var(--farasync-radius-2xl);
    padding: 24px !important;
    min-height: 400px;
}
.farasync-tab-panel {
    animation: farasync-fade-in 0.3s ease-out;
}
@keyframes farasync-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   3. MODALS — Luxurious depth with gradient headers
   ================================================================ */
.farasync-modal {
    background-color: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    /* v1.0.0: Increased bottom padding to 200px so action buttons at the
       bottom of the Sync Manager popup are fully visible and scrollable past. */
    padding: 32px 16px 200px 16px !important;
    animation: farasync-modal-fade-in 0.25s ease-out;
}
@keyframes farasync-modal-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.farasync-modal-content {
    background: var(--farasync-surface) !important;
    padding: 0 !important;
    border-radius: var(--farasync-radius-2xl) !important;
    box-shadow: var(--farasync-shadow-modal) !important;
    overflow: visible;
    animation: farasync-modal-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    margin: auto !important;
    /* v1.0.0: Force Vazirmatn on ALL elements inside modals. */
    font-family: 'Vazirmatn', sans-serif !important;
}
/* v1.0.0: Override WordPress default fonts (Tahoma etc.) inside modals. */
.farasync-modal-content *,
.farasync-modal-content .description,
.farasync-modal-content .form-table th,
.farasync-modal-content .form-table td,
.farasync-modal-content p,
.farasync-modal-content label,
.farasync-modal-content code,
.farasync-modal-content span,
.farasync-modal-content h2,
.farasync-modal-content h3,
.farasync-modal-content h4,
.farasync-modal-content input,
.farasync-modal-content select,
.farasync-modal-content textarea,
.farasync-modal-content button,
.farasync-modal-content .button,
.farasync-modal-content .button-primary {
    font-family: 'Vazirmatn', sans-serif !important;
}
@keyframes farasync-modal-slide-up {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.farasync-modal-content > h2,
.farasync-modal-content > h3,
.farasync-price-rules-title,
.farasync-sm-title {
    padding: 2% 2% !important;
    margin: 1% 5% !important;
    background: linear-gradient(135deg, #f8f9fc 0%, #f0f4ff 100%);
    border-bottom: 1px solid var(--farasync-border);
    font-size: 17px !important;
    color: var(--farasync-text) !important;
    position: relative;
}
.farasync-modal-content > h2::before,
.farasync-price-rules-title::before,
.farasync-sm-title::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--farasync-gradient-primary);
}
.farasync-modal-content > .description,
.farasync-modal-content > p.description {
    padding: 2% 2% !important;
    margin: 1% 5% !important;
    color: var(--farasync-text-muted) !important;
    font-size: 12.5px;
}
/* Body of modal — user-specified margin/padding (v1.0.0). */
.farasync-modal-content .form-table,
.farasync-modal-content .farasync-price-rules-list,
.farasync-modal-content .farasync-price-rule-form-wrap,
.farasync-modal-content .farasync-webhook-destinations-list,
.farasync-modal-content .farasync-webhook-diagnostics,
.farasync-modal-content > div,
.farasync-modal-content > fieldset,
.farasync-modal-content > hr,
.farasync-modal-content > .notice,
.farasync-modal-content > .farasync-info-grid,
.farasync-modal-content > .farasync-keys-toolbar,
.farasync-modal-content > table,
.farasync-modal-content > #farasync-source-form,
.farasync-modal-content > #farasync-source-list,
.farasync-modal-content > #farasync-price-rules-list,
.farasync-modal-content > #farasync-key-form,
.farasync-modal-content > #farasync-preview-content,
.farasync-modal-content > #farasync-sync-manager-summary,
.farasync-modal-content > #farasync-sync-manager-filters,
.farasync-modal-content > #farasync-sync-manager-selection,
.farasync-modal-content > #farasync-sm-products-grid,
.farasync-modal-content > #farasync-sm-progress-panel,
.farasync-modal-content > #farasync-import-fields-wrap,
.farasync-modal-content > #farasync-health-grid,
.farasync-modal-content > #farasync-stats-section,
.farasync-modal-content > #farasync-sales-stats,
.farasync-modal-content > .farasync-source-card,
.farasync-modal-content > .farasync-source-card-list,
.farasync-modal-content > #farasync-sync-manager-options,
.farasync-modal-content > #farasync-sync-manager-progress,
.farasync-modal-content > #farasync-sync-manager-summary-result,
.farasync-modal-content > #farasync-sync-manager-actions {
    padding-inline-start: 2% !important; /* v1.0.0: was physical left/right */
    padding-inline-end: 0% !important;
    margin: 0% 3%;
}
.farasync-modal-content .form-table {
    margin-top: 16px !important;
}
.farasync-modal-content .submit,
.farasync-modal-content p.submit {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 1% 3% !important;
    margin: 2% !important;
    margin-bottom: 7% !important;
    background: linear-gradient(180deg, #fafbff 0%, #f5f7fc 100%);
    border-top: 1px solid var(--farasync-border);
}

/* v1.0.0: WordPress primary button margin (user-specified). */
.wp-core-ui .button-primary {
    margin: 0% 9%;
}
.farasync-modal-close {
    top: 14px !important;
    inset-inline-end: 18px !important;
    width: 36px !important;
    height: 36px !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid var(--farasync-border) !important;
    color: var(--farasync-text-muted) !important;
    font-size: 24px !important;
    transition: all 0.2s ease !important;
    z-index: 2;
}
.farasync-modal-close:hover {
    background: var(--farasync-danger) !important;
    color: #fff !important;
    border-color: var(--farasync-danger) !important;
    transform: rotate(90deg);
}
.farasync-modal-wide {
    max-width: 760px !important;
}
.farasync-modal-xwide {
    max-width: 1320px !important;
}

/* ================================================================
   4. DASHBOARD & SALES REPORT — 4-column stat cards in one row
   ================================================================ */

/* Dashboard tab: 2-column module cards (per user request v1.0.0). */
.farasync-tab-panel[data-panel="dashboard"] .farasync-modules-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 18px !important;
}
/* Sales Report tab: 4-column stat cards (stays 4 per row). */
.farasync-tab-panel[data-panel="sales"] .farasync-modules-grid,
#farasync-sales-stats.farasync-modules-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 18px !important;
}

/* Premium module card redesign. */
.farasync-module-card {
    background: var(--farasync-gradient-card) !important;
    border: 1px solid var(--farasync-border) !important;
    border-radius: var(--farasync-radius-xl) !important;
    padding: 22px !important;
    box-shadow: var(--farasync-shadow-card) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}
.farasync-module-card::before {
    height: 4px !important;
    background: var(--farasync-gradient-primary) !important;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.farasync-module-card.is-enabled::before {
    opacity: 1;
}
.farasync-module-card:hover {
    box-shadow: var(--farasync-shadow-card-hover) !important;
    transform: translateY(-3px);
    border-color: var(--farasync-primary) !important;
}
.farasync-module-card.is-disabled {
    opacity: 0.7;
    background: var(--farasync-bg) !important;
}

/* Module icon — gradient circle. */
.farasync-module-icon {
    width: 44px !important;
    height: 44px !important;
    border-radius: var(--farasync-radius) !important;
    background: var(--farasync-gradient-primary) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.farasync-module-card.is-disabled .farasync-module-icon {
    background: linear-gradient(135deg, #b0b8c4 0%, #8b94a3 100%) !important;
    box-shadow: none;
}
.farasync-module-icon .dashicons {
    color: #fff !important;
    font-size: 22px !important;
    width: 22px !important;
    height: 22px !important;
}

/* Module stats — 2-column grid within card. */
.farasync-module-stats {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-top: 16px;
}
.farasync-stat {
    text-align: center;
    padding: 12px 8px !important;
    background: linear-gradient(180deg, #f8f9fc 0%, #f0f4ff 100%) !important;
    border: 1px solid var(--farasync-border) !important;
    border-radius: var(--farasync-radius) !important;
    transition: all 0.2s ease;
}
.farasync-stat:hover {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%) !important;
    border-color: var(--farasync-primary) !important;
    transform: translateY(-1px);
}
.farasync-stat-num {
    font-size: 20px !important;
    background: var(--farasync-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.farasync-stat-label {
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px !important;
}

/* Sales Report 4-card stats — bigger, more luxurious. */
#farasync-sales-stats .farasync-stat {
    padding: 20px 12px !important;
    text-align: center;
}
#farasync-sales-stats .farasync-stat-num {
    font-size: 26px !important;
    display: block;
    margin-bottom: 4px;
}
#farasync-sales-stats .farasync-stat-label {
    font-size: 12px !important;
}
/* Color-coded stat cards for Sales Report. */
#farasync-sales-stats .farasync-stat:nth-child(1) {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%) !important;
    border-color: #c7d2fe !important;
}
#farasync-sales-stats .farasync-stat:nth-child(1) .farasync-stat-num {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
#farasync-sales-stats .farasync-stat:nth-child(2) {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
    border-color: #a7f3d0 !important;
}
#farasync-sales-stats .farasync-stat:nth-child(2) .farasync-stat-num {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
#farasync-sales-stats .farasync-stat:nth-child(3) {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    border-color: #93c5fd !important;
}
#farasync-sales-stats .farasync-stat:nth-child(3) .farasync-stat-num {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
#farasync-sales-stats .farasync-stat:nth-child(4) {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
    border-color: #fcd34d !important;
}
#farasync-sales-stats .farasync-stat:nth-child(4) .farasync-stat-num {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ================================================================
   5. BUTTONS — Modern, premium feel
   ================================================================ */
.farasync-wrap .button,
.farasync-wrap .button-primary,
.farasync-wrap .button-secondary,
.farasync-wrap .farasync-btn {
    border-radius: var(--farasync-radius) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 13px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}
/* v1.0.0: Hover for secondary/ghost buttons only — NOT primary/accent/success/danger. */
.farasync-wrap .button:not(.button-primary):hover,
.farasync-wrap .button-secondary:hover,
.farasync-wrap .farasync-btn-ghost:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08) !important;
}
/* v1.0.0: Primary button — blue gradient with darker blue hover (matches Import Products button). */
.farasync-wrap .button-primary,
.farasync-wrap .farasync-btn-primary {
    background: linear-gradient(135deg, var(--farasync-primary) 0%, #1a5f9e 100%) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(34, 113, 177, 0.25) !important;
}
.farasync-wrap .button-primary:hover:not(:disabled),
.farasync-wrap .farasync-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--farasync-primary-hover) 0%, #144b7e 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.35) !important;
    transform: translateY(-1px);
}
/* v1.0.0: Accent button — purple gradient with darker purple hover. */
.farasync-wrap .farasync-btn-accent:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a3a9c 0%, #4a2f80 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(108, 74, 184, 0.35) !important;
    transform: translateY(-1px);
}
/* v1.0.0: Danger button — red gradient with darker red hover. */
.farasync-wrap .farasync-btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #b02a2c 0%, #8e1f21 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(214, 54, 56, 0.35) !important;
    transform: translateY(-1px);
}
.farasync-wrap .button:active,
.farasync-wrap .button-primary:active {
    transform: translateY(0);
}

/* ================================================================
   6. SOURCE CARDS — Premium look
   ================================================================ */
.farasync-source-card {
    background: var(--farasync-gradient-card) !important;
    border: 1px solid var(--farasync-border) !important;
    border-radius: var(--farasync-radius-xl) !important;
    padding: 20px !important;
    box-shadow: var(--farasync-shadow-card) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}
.farasync-source-card::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 4px;
    background: var(--farasync-gradient-primary);
    opacity: 0.85;
}
.farasync-source-card:hover {
    box-shadow: var(--farasync-shadow-card-hover) !important;
    transform: translateY(-2px);
    border-color: var(--farasync-primary) !important;
}

/* Source action buttons — soft, modern. */
.farasync-source-action-btn {
    border-radius: var(--farasync-radius) !important;
    padding: 2px 15px !important;
    transition: all 0.2s ease !important;
    background: var(--farasync-surface) !important;
    border: 1px solid var(--farasync-border) !important;
}
.farasync-source-action-btn:hover {
    background: var(--farasync-primary-light) !important;
    border-color: var(--farasync-primary) !important;
    color: var(--farasync-primary) !important;
    transform: translateY(-1px);
}

/* ================================================================
   7. FORM INPUTS — Soft, modern focus states
   ================================================================ */
.farasync-wrap input[type="text"],
.farasync-wrap input[type="number"],
.farasync-wrap input[type="url"],
.farasync-wrap input[type="search"],
.farasync-wrap input[type="email"],
.farasync-wrap input[type="password"],
.farasync-wrap select,
.farasync-wrap textarea {
    border-radius: var(--farasync-radius) !important;
    border: 1px solid var(--farasync-border-strong) !important;
    transition: all 0.2s ease !important;
    background: var(--farasync-surface) !important;
}
.farasync-wrap input[type="text"]:focus,
.farasync-wrap input[type="number"]:focus,
.farasync-wrap input[type="url"]:focus,
.farasync-wrap input[type="search"]:focus,
.farasync-wrap input[type="email"]:focus,
.farasync-wrap input[type="password"]:focus,
.farasync-wrap select:focus,
.farasync-wrap textarea:focus {
    border-color: var(--farasync-primary) !important;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.12) !important;
    outline: none !important;
}

/* ================================================================
   8. BADGES — Modern pill design
   ================================================================ */
.farasync-sm-product-badge {
    border-radius: 999px !important;
    padding: 4px 10px !important;
    font-size: 11px !important;
    font-weight: var(--farasync-weight-medium) !important;
    font-family: var(--farasync-font-medium) !important;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
}
.farasync-sm-badge-instock {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
    color: #065f46 !important;
    border: 1px solid #a7f3d0 !important;
}
.farasync-sm-badge-imported {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    color: #1e40af !important;
    border: 1px solid #93c5fd !important;
}
.farasync-sm-badge-not-imported {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%) !important;
    color: #6b7280 !important;
    border: 1px solid #e5e7eb !important;
}
.farasync-sm-badge-outofstock {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
    color: #991b1b !important;
    border: 1px solid #fca5a5 !important;
}

/* ================================================================
   9. TABLES — Modern header design
   ================================================================ */
.farasync-wrap .wp-list-table {
    border-radius: var(--farasync-radius) !important;
    overflow: hidden;
    box-shadow: var(--farasync-shadow-card) !important;
    border: 1px solid var(--farasync-border) !important;
}
.farasync-wrap .wp-list-table thead th,
.farasync-wrap .wp-list-table tfoot th {
    background: linear-gradient(180deg, #f8f9fc 0%, #f0f4ff 100%) !important;
    color: var(--farasync-text) !important;
    font-family: var(--farasync-font-bold) !important;
    font-weight: var(--farasync-weight-bold) !important;
    border-bottom: 2px solid var(--farasync-primary) !important;
    padding: 12px 10px !important;
    font-size: 12.5px !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.farasync-wrap .wp-list-table tbody tr {
    transition: background 0.15s ease;
}
.farasync-wrap .wp-list-table tbody tr:hover {
    background: var(--farasync-primary-light) !important;
}

/* ================================================================
   10. RESPONSIVE — Stack on small screens
   ================================================================ */
@media (max-width: 1280px) {
    .farasync-tab-panel[data-panel="dashboard"] .farasync-modules-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .farasync-tab-panel[data-panel="sales"] .farasync-modules-grid,
    #farasync-sales-stats.farasync-modules-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 640px) {
    .farasync-tab-panel[data-panel="dashboard"] .farasync-modules-grid,
    .farasync-tab-panel[data-panel="sales"] .farasync-modules-grid,
    #farasync-sales-stats.farasync-modules-grid {
        grid-template-columns: 1fr !important;
    }
    .farasync-modal-content {
        max-width: 100% !important;
        margin: 8px !important;
    }
}

/* ================================================================
   11. TOASTS / NOTICES — Modern
   ================================================================ */
.farasync-toast,
.farasync-wrap .notice {
    border-radius: var(--farasync-radius) !important;
    box-shadow: var(--farasync-shadow-card) !important;
    border-inline-start: 4px solid !important;
}

/* ================================================================
   12. SCROLLBAR — Modern thin scrollbar
   ================================================================ */
.farasync-wrap ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.farasync-wrap ::-webkit-scrollbar-track {
    background: var(--farasync-bg);
    border-radius: 4px;
}
.farasync-wrap ::-webkit-scrollbar-thumb {
    background: var(--farasync-border-strong);
    border-radius: 4px;
}
.farasync-wrap ::-webkit-scrollbar-thumb:hover {
    background: var(--farasync-primary);
}

/* ================================================================
   13. MODAL BUTTONS & FORM FIELDS — Override WordPress defaults
   ================================================================ */

/* --- Buttons inside modals --- */
.farasync-modal-content .button,
.farasync-modal-content .button-secondary,
.farasync-modal-content .farasync-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px !important;
    min-height: 38px;
    border-radius: var(--farasync-radius) !important;
    border: 1px solid var(--farasync-border-strong) !important;
    background: var(--farasync-surface) !important;
    color: var(--farasync-text) !important;
    font-family: var(--farasync-font-medium) !important;
    font-weight: var(--farasync-weight-medium) !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    text-decoration: none !important;
    vertical-align: middle;
}

/* v1.0.0: Hover for secondary/ghost buttons only — does NOT affect primary/accent/success/danger. */
.farasync-modal-content .button:not(.button-primary):not(.farasync-btn-primary):not(.farasync-btn-accent):not(.farasync-btn-danger):hover,
.farasync-modal-content .button-secondary:hover,
.farasync-modal-content .farasync-btn-ghost:hover,
.farasync-modal-content .farasync-btn:not(.farasync-btn-primary):not(.farasync-btn-accent):not(.farasync-btn-danger):hover {
    background: var(--farasync-primary-light) !important;
    border-color: var(--farasync-primary) !important;
    color: var(--farasync-primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08) !important;
}

.farasync-modal-content .button:active,
.farasync-modal-content .button-secondary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

/* Primary button (Save, Submit, Add) — gradient with proper darker hover. */
.farasync-modal-content .button-primary,
.farasync-modal-content .farasync-btn-primary,
.farasync-modal-content #farasync-pr-submit,
.farasync-modal-content #farasync-key-submit,
.farasync-modal-content #farasync-source-submit,
.farasync-modal-content #farasync-wh-add-submit {
    background: linear-gradient(135deg, var(--farasync-primary) 0%, #1a5f9e 100%) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(34, 113, 177, 0.25) !important;
    font-family: var(--farasync-font-medium) !important;
    font-weight: var(--farasync-weight-medium) !important;
}

/* v1.0.0: Primary button hover — darker blue gradient, keeps white text. */
.farasync-modal-content .button-primary:hover:not(:disabled),
.farasync-modal-content .farasync-btn-primary:hover:not(:disabled),
.farasync-modal-content #farasync-pr-submit:hover:not(:disabled),
.farasync-modal-content #farasync-key-submit:hover:not(:disabled),
.farasync-modal-content #farasync-source-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--farasync-primary-hover) 0%, #144b7e 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.35) !important;
    transform: translateY(-1px);
}

/* v1.0.0: Accent button hover — darker purple gradient, keeps white text. */
.farasync-modal-content .farasync-btn-accent:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a3a9c 0%, #4a2f80 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(108, 74, 184, 0.35) !important;
    transform: translateY(-1px);
}


/* v1.0.0: Danger button hover — darker red gradient, keeps white text. */
.farasync-modal-content .farasync-btn-danger:hover:not(:disabled),
.farasync-modal-content .button-link-delete:hover:not(:disabled) {
    background: linear-gradient(135deg, #b02a2c 0%, #8e1f21 100%) !important;
    color: #fff !important;
    border-color: #b02a2c !important;
    box-shadow: 0 4px 12px rgba(214, 54, 56, 0.35) !important;
    transform: translateY(-1px);
}

/* Small buttons inside modals (source action buttons, etc.). */
.farasync-modal-content .button-small,
.farasync-modal-content .farasync-btn-sm {
    padding: 5px 12px !important;
    min-height: 30px;
    font-size: 12px !important;
    border-radius: var(--farasync-radius-sm) !important;
}

/* Delete/danger buttons. */
.farasync-modal-content .button-link-delete,
.farasync-modal-content .farasync-btn-danger {
    color: var(--farasync-danger) !important;
    border-color: var(--farasync-danger-border) !important;
    background: var(--farasync-danger-bg) !important;
}

.farasync-modal-content .button-link-delete:hover,
.farasync-modal-content .farasync-btn-danger:hover {
    background: var(--farasync-danger) !important;
    color: #fff !important;
    border-color: var(--farasync-danger) !important;
}

/* Submit row at bottom of modal. */
.farasync-modal-content .submit,
.farasync-modal-content p.submit {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 1% 5% !important;
    margin: 0 !important;
    background: linear-gradient(180deg, #fafbff 0%, #f5f7fc 100%);
    border-top: 1px solid var(--farasync-border);
}

/* --- Form inputs inside modals --- */
.farasync-modal-content input[type="text"],
.farasync-modal-content input[type="number"],
.farasync-modal-content input[type="url"],
.farasync-modal-content input[type="email"],
.farasync-modal-content input[type="password"],
.farasync-modal-content input[type="search"],
.farasync-modal-content textarea,
.farasync-modal-content select {
    border-radius: var(--farasync-radius) !important;
    border: 1px solid var(--farasync-border-strong) !important;
    padding: 1px 12px !important;
    min-height: 38px;
    font-family: var(--farasync-font-regular) !important;
    font-size: 13.5px !important;
    color: var(--farasync-text) !important;
    background: var(--farasync-surface) !important;
    transition: all 0.2s ease !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.farasync-modal-content input[type="text"]:focus,
.farasync-modal-content input[type="number"]:focus,
.farasync-modal-content input[type="url"]:focus,
.farasync-modal-content input[type="email"]:focus,
.farasync-modal-content input[type="password"]:focus,
.farasync-modal-content input[type="search"]:focus,
.farasync-modal-content textarea:focus,
.farasync-modal-content select:focus {
    border-color: var(--farasync-primary) !important;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.12) !important;
    outline: none !important;
    background: #fff !important;
}

/* Select dropdowns — custom arrow. */
.farasync-modal-content select {
    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' width='12' height='12' viewBox='0 0 12 12'%3e%3cpath fill='%23646970' d='M6 8L2 4h8z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: left 12px center !important;
    background-size: 12px !important;
    padding-left: 32px !important;
    cursor: pointer;
}

html[dir="rtl"] .farasync-modal-content select {
    background-position: right 12px center !important;
    padding-left: 12px !important;
    padding-right: 32px !important;
}

/* Checkbox styling. */
.farasync-modal-content input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    border-radius: 4px !important;
    border: 2px solid var(--farasync-border-strong) !important;
    cursor: pointer;
    accent-color: var(--farasync-primary);
    transition: all 0.2s ease;
}

.farasync-modal-content input[type="checkbox"]:checked {
    border-color: var(--farasync-primary) !important;
}

/* --- Form table inside modals --- */
.farasync-modal-content .form-table {
    margin-top: 8px !important;
    margin-bottom: 8px !important;
}

.farasync-modal-content .form-table th {
    width: 180px !important;
    padding: 14px 10px 14px 0 !important;
    font-family: var(--farasync-font-medium) !important;
    font-weight: var(--farasync-weight-medium) !important;
    font-size: 13px !important;
    color: var(--farasync-text) !important;
    text-align: start;
    vertical-align: middle;
}

.farasync-modal-content .form-table td {
    padding: 10px 10px !important;
    font-size: 13px !important;
}

.farasync-modal-content .form-table .description {
    font-size: 12px !important;
    color: var(--farasync-text-muted) !important;
    margin-top: 4px !important;
    line-height: 1.5;
}

/* --- Regular-text inputs (WordPress class) --- */
.farasync-modal-content .regular-text {
    width: 100% !important;
    max-width: 400px !important;
}

/* --- Small-text inputs (WordPress class) --- */
.farasync-modal-content .small-text {
    width: 80px !important;
}

/* --- Field labels (checkbox labels in modal) --- */
.farasync-modal-content .farasync-field-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 12px !important;
    background: linear-gradient(180deg, #f8f9fc 0%, #f0f4ff 100%) !important;
    border: 1px solid var(--farasync-border) !important;
    border-radius: var(--farasync-radius) !important;
    margin-bottom: 6px;
    font-size: 12.5px !important;
    transition: all 0.2s ease;
    cursor: pointer;
}

.farasync-modal-content .farasync-field-label:hover {
    border-color: var(--farasync-primary) !important;
    background: var(--farasync-primary-light) !important;
}

.farasync-modal-content .farasync-field-label.farasync-not-global {
    opacity: 0.5;
    background: var(--farasync-bg) !important;
}

/* --- Select All / Deselect All buttons --- */
.farasync-modal-content .farasync-select-all-btn,
.farasync-modal-content .farasync-deselect-all-btn {
    font-size: 11.5px !important;
    padding: 4px 10px !important;
    min-height: 26px;
}

/* --- Notice boxes inside modals --- */
.farasync-modal-content .notice,
.farasync-modal-content .notice-info,
.farasync-modal-content .notice-warning,
.farasync-modal-content .notice-error {
    border-radius: var(--farasync-radius) !important;
    margin: 12px 0 !important;
    padding: 12px 16px !important;
    font-size: 12.5px !important;
    line-height: 1.6;
}

.farasync-modal-content .notice-info {
    background: linear-gradient(135deg, #f0f6fc 0%, #e8f0fe 100%) !important;
    border-inline-start: 4px solid var(--farasync-primary) !important;
}

.farasync-modal-content .notice-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
    border-inline-start: 4px solid var(--farasync-warning) !important;
}

.farasync-modal-content .notice-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
    border-inline-start: 4px solid var(--farasync-danger) !important;
}

/* --- HR separators inside modals --- */
.farasync-modal-content hr {
    border: none !important;
    border-top: 1px solid var(--farasync-border) !important;
    margin: 16px 0 !important;
}

/* --- Code blocks inside modals --- */
.farasync-modal-content code {
    font-family: var(--farasync-mono) !important;
    font-size: 12px !important;
    background: var(--farasync-bg) !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    color: var(--farasync-primary) !important;
}

/* --- Price rule form specific --- */
.farasync-price-rule-form-wrap {
    padding: 0 5% 8% !important;
}

.farasync-price-rule-form-wrap .form-table th {
    width: 160px !important;
}

/* --- Key warning box --- */
.farasync-key-warning {
    border-radius: var(--farasync-radius) !important;
    padding: 12px 16px !important;
    font-size: 12.5px !important;
    margin: 12px 0 !important;
}

/* --- Table inside modals (widefat) --- */
.farasync-modal-content .wp-list-table {
    border-radius: var(--farasync-radius) !important;
    overflow: hidden;
    margin: 12px 0 !important;
}

.farasync-modal-content .wp-list-table thead th {
    background: linear-gradient(180deg, #f8f9fc 0%, #f0f4ff 100%) !important;
    font-family: var(--farasync-font-medium) !important;
    font-weight: var(--farasync-weight-medium) !important;
    font-size: 12px !important;
    padding: 10px 8px !important;
}

/* --- Number input fix: remove spinner inside modals --- */
.farasync-modal-content input[type="number"]::-webkit-outer-spin-button,
.farasync-modal-content input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.farasync-modal-content input[type="number"] {
    -moz-appearance: textfield;
}

/* ================================================================
   14. IMPORTED PRODUCTS TAB — Inline field checkboxes
   ================================================================ */

/* v1.0.0: Inline field checkboxes with visible labels in the Sync Fields column. */
.farasync-imported-fields-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.farasync-imported-field-label {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 4px 8px !important;
    background: linear-gradient(180deg, #f8f9fc 0%, #f0f4ff 100%) !important;
    border: 1px solid var(--farasync-border) !important;
    border-radius: var(--farasync-radius-sm) !important;
    font-size: 11.5px !important;
    font-family: var(--farasync-font-medium) !important;
    color: var(--farasync-text) !important;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin: 0 !important;
    width: auto !important;
}

.farasync-imported-field-label:hover {
    border-color: var(--farasync-primary) !important;
    background: var(--farasync-primary-light) !important;
}

.farasync-imported-field-label input[type="checkbox"] {
    width: 14px !important;
    height: 14px !important;
    margin: 0 !important;
    accent-color: var(--farasync-primary);
    cursor: pointer;
}

.farasync-imported-field-name {
    font-size: 11.5px;
    line-height: 1.2;
    user-select: none;
}

/* The sync button is icon-only — make it a nice square icon button.
   v1.0.0: unified to the plugin-wide 30×30 canon. */
.farasync-imported-sync-now {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    min-height: 30px;
    border-radius: var(--farasync-radius-sm) !important;
}

.farasync-imported-sync-now .dashicons {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
}

/* The Sync Fields cell should have enough padding. */
.farasync-imported-fields-cell {
    padding: 8px 10px !important;
}

/* Product name cell — bold link. */
.farasync-imported-name-cell a {
    font-weight: 600;
    text-decoration: none;
}

.farasync-imported-name-cell a:hover {
    text-decoration: underline;
}

/* v1.0.0: Actions column — left aligned, narrow. */
.farasync-imported-actions-col,
.farasync-imported-actions-cell {
    text-align: left !important;
    padding-left: 8px !important;
}

/* ================================================================
   17. v1.0.0: INLINE SUMMARY ITEMS + IMPORT OPTIONS GRID
   ================================================================ */

/* v1.0.0: Summary items displayed inline (horizontal) with separator. */
.farasync-sync-manager-summary {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 4px 12px !important;
    padding: 10px 16px !important;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #f8f9fc 0%, #f0f4ff 100%) !important;
    border: 1px solid var(--farasync-border) !important;
    border-radius: 5px !important;
    font-family: 'Vazirmatn', var(--farasync-font) !important;
}

.farasync-sync-manager-summary .farasync-sm-summary-item {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 13px !important;
}

.farasync-sync-manager-summary .farasync-sm-summary-item::after {
    content: '|';
    color: var(--farasync-text-light);
    margin-inline-start: 12px;
    font-weight: 300;
}

.farasync-sync-manager-summary .farasync-sm-summary-item:last-child::after {
    display: none;
}

.farasync-sync-manager-summary .farasync-sm-summary-label {
    font-size: 12px !important;
    font-weight: 500;
    color: var(--farasync-text-muted);
    text-transform: none !important;
}

.farasync-sync-manager-summary .farasync-sm-summary-value {
    font-weight: 600 !important;
    font-size: 13px !important;
    color: var(--farasync-text);
}

/* v1.0.0: Import Options grid: 65% / 35% split. */
.farasync-sm-options-grid {
    grid-template-columns: 65% 35% !important;
    gap: 20px !important;
}

/* v1.0.0: API Key modal + Source modal — max-width 1000px. */
#farasync-key-modal .farasync-modal-content,
#farasync-source-modal .farasync-modal-content {
    max-width: 1000px !important;
}

/* v1.0.0: Responsive field grids — 3 columns by default, 2 at ≤900px, 1 at ≤600px. */
#farasync-key-fields-list,
#farasync-source-fields-list,
.farasync-fields-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
}

@media (max-width: 900px) {
    #farasync-key-fields-list,
    #farasync-source-fields-list,
    .farasync-fields-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 600px) {
    #farasync-key-fields-list,
    #farasync-source-fields-list,
    .farasync-fields-grid {
        grid-template-columns: 1fr !important;
    }
}

/* v1.0.0: Global modal border-radius = 5px. */
.farasync-modal-content {
    border-radius: 5px !important;
}

.farasync-modal-content > h2,
.farasync-modal-content > h3,
.farasync-price-rules-title,
.farasync-sm-title {
    border-radius: 5px 5px 0 0 !important;
}

.farasync-modal-content > p.submit,
.farasync-modal-content > .submit,
.farasync-modal-content > p:last-child {
    border-radius: 0 0 5px 5px !important;
}

/* v1.0.0: Duplicate removed — padding rules are now at the top (lines 255-291). */

/* ================================================================
   15. v1.0.0: VERTICAL FIELD HEADERS + GRID CHECKBOXES
   ================================================================ */

/* Header grid: vertical field names + master checkboxes in columns. */
.farasync-imported-master-grid {
    display: grid !important;
    gap: 0 !important;
    align-items: end;
    justify-items: center;
    padding: 4px 0;
}

/* v1.0.0: Master column = vertical label on top, checkbox at bottom. */
.farasync-master-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
    height: 100%;
    justify-content: flex-end;
}

/* v1.0.0: Master checkbox at the bottom of the header column. */
.farasync-master-col input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    accent-color: var(--farasync-primary);
    cursor: pointer;
    margin: 0 !important;
    flex-shrink: 0;
}

/* Vertical label: rotated -90deg so text reads bottom-to-top. */
.farasync-vertical-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 11px !important;
    font-weight: 600 !important;
    font-family: var(--farasync-font-medium) !important;
    color: var(--farasync-text) !important;
    white-space: nowrap;
    line-height: 1.2;
    max-height: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
    cursor: help;
}

/* Body grid: bare checkboxes aligned in same columns as header. */
.farasync-imported-fields-grid {
    display: grid !important;
    gap: 0 !important;
    align-items: center;
    justify-items: center;
    padding: 2px 0;
}

.farasync-imported-fields-grid input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    accent-color: var(--farasync-primary);
    cursor: pointer;
    margin: 0 !important;
    padding: 0 !important;
}

.farasync-imported-fields-grid input[type="checkbox"]:hover {
    transform: scale(1.2);
}

/* Header cell styling. */
.farasync-imported-fields-header {
    text-align: center !important;
    padding: 8px 4px !important;
    vertical-align: bottom !important;
}

.farasync-imported-header-loading {
    font-size: 12px;
    color: var(--farasync-text-muted);
    padding: 20px 0;
    text-align: center;
}

/* Sync fields cell in body. */
.farasync-imported-fields-cell {
    padding: 4px 4px !important;
    text-align: center;
}

/* ================================================================
   16. v1.0.0: RESPONSIVE — Mobile & Tablet
   ================================================================ */

/* Tablet: reduce checkbox size and font size. */
@media screen and (max-width: 1024px) {
    .farasync-vertical-label {
        font-size: 9px !important;
        max-height: 90px;
    }
    .farasync-master-col input[type="checkbox"],
    .farasync-imported-fields-grid input[type="checkbox"] {
        width: 16px !important;  /* v1.0.0: 14px was untappable */
        height: 16px !important;
    }
    .farasync-imported-master-grid,
    .farasync-imported-fields-grid {
        gap: 0 !important;
    }
    .farasync-imported-fields-header,
    .farasync-imported-fields-cell {
        padding: 4px 2px !important;
    }
}

/* Mobile: make table horizontally scrollable. */
@media screen and (max-width: 768px) {
    /* Allow the table to scroll horizontally so all 15 checkbox columns are visible. */
    .farasync-imported-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    .farasync-imported-table thead,
    .farasync-imported-table tbody,
    .farasync-imported-table tr {
        display: table;
        table-layout: fixed;
        width: max-content;
        min-width: 100%;
    }
    .farasync-imported-table th,
    .farasync-imported-table td {
        white-space: normal;
    }
    /* Make name and source columns narrower on mobile. */
    .farasync-imported-table th[width="15%"],
    .farasync-imported-table td.farasync-imported-name-cell {
        width: 120px !important;
        max-width: 120px;
    }
    .farasync-imported-table th[width="6%"] {
        width: 80px !important;
    }
    .farasync-imported-table th[width="4%"],
    .farasync-imported-table td.farasync-imported-actions-cell {
        width: 40px !important;
    }
    /* The sync fields column gets the remaining width. */
    .farasync-imported-table th.farasync-imported-fields-header,
    .farasync-imported-table td.farasync-imported-fields-cell {
        width: 480px !important;
        min-width: 480px;
    }
    .farasync-vertical-label {
        font-size: 9.5px !important;  /* v1.0.0: 8px was unreadable */
        max-height: 70px;
    }
    .farasync-master-col input[type="checkbox"],
    .farasync-imported-fields-grid input[type="checkbox"] {
        width: 18px !important;  /* v1.0.0: 12px was untappable on phones */
        height: 18px !important;
    }
}

/* ================================================================
   v1.0.0 — Global Sync button + progress modal
   ================================================================ */

/* The Global Sync button in the imported-products table header. */
.farasync-imported-actions-header {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.farasync-imported-actions-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}
.farasync-global-sync-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    font-size: 11px !important;
    padding: 2px 10px !important;
    height: 28px !important;
    line-height: 1 !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #2271b1 0%, #1a5f9e 100%) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.25) !important;
    transition: all 0.2s ease;
    cursor: pointer;
}
.farasync-global-sync-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1a5f9e 0%, #135e96 100%) !important;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.35) !important;
    transform: translateY(-1px);
}
.farasync-global-sync-btn:disabled,
.farasync-global-sync-btn.is-loading {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}
.farasync-global-sync-btn .dashicons {
    width: 14px;
    height: 14px;
    font-size: 14px;
    line-height: 14px;
}
.farasync-global-sync-btn.is-loading .dashicons {
    animation: farasync-spin 1s linear infinite;
}
@keyframes farasync-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.farasync-spin {
    animation: farasync-spin 1s linear infinite;
}

/* The progress modal — reuses .farasync-modal / .farasync-modal-content
   base styles but adds the global-sync-specific layout. */
#farasync-global-sync-modal .farasync-global-sync-content {
    max-width: 640px;
    width: calc(100% - 32px);
    background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#farasync-global-sync-modal h2#farasync-global-sync-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 18px 24px;
    background: linear-gradient(135deg, #f8f9fc 0%, #f0f4ff 100%);
    border-bottom: 1px solid #e2e8f0;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}
#farasync-global-sync-title .dashicons {
    /* v1.0.0 (Round Y21): BLUE — user request. The glyph (SVG-masked
       background:currentColor) was repainted near-white by command-center's
       (0,3,1) span rule, melting it into the light icon pill. The theme's
       own primary blue wins here with ID+!important. */
    color: var(--farasync-primary, #2271b1) !important;
    font-size: 22px;
    width: 22px;
    height: 22px;
}
#farasync-global-sync-title .farasync-global-sync-title-text {
    font-family: 'Vazirmatn', sans-serif;
}
#farasync-global-sync-close-x {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 24px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}
#farasync-global-sync-close-x:hover {
    color: #ef4444;
    transform: rotate(90deg);
}

/* Body */
.farasync-global-sync-body {
    padding: 22px 24px 8px;
    overflow-y: auto;
    max-height: calc(80vh - 140px);
}

/* Status text */
#farasync-global-sync-status {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 18px;
    min-height: 22px;
}

/* Circular progress */
.farasync-global-sync-circular-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 18px;
}
.farasync-global-sync-circle {
    width: 96px;
    height: 96px;
    transform: rotate(-90deg);
}
.farasync-global-sync-circle-track {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 4;
}
.farasync-global-sync-circle-fill {
    fill: none;
    stroke: #2271b1;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.farasync-global-sync-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Vazirmatn', sans-serif;
}

/* Linear progress bar */
.farasync-global-sync-bar-wrap {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 18px;
}
.farasync-global-sync-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2271b1 0%, #6c4ab8 100%);
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Counts grid */
.farasync-global-sync-counts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 18px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}
.farasync-global-sync-count-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}
.farasync-global-sync-count-label {
    color: #64748b;
    font-weight: 500;
}
.farasync-global-sync-count-value {
    font-weight: 700;
    color: #1e293b;
    font-family: 'Vazirmatn', sans-serif;
    min-width: 32px;
    text-align: right;
}
.farasync-global-sync-count-created { color: #16a34a !important; }
.farasync-global-sync-count-updated { color: #2563eb !important; }
.farasync-global-sync-count-skipped { color: #d97706 !important; }
.farasync-global-sync-count-failed { color: #dc2626 !important; }

/* Log */
.farasync-global-sync-log {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    padding: 6px 10px;
    font-size: 12px;
    scroll-behavior: smooth;
}
.farasync-global-sync-log:empty {
    display: none;
}
.farasync-global-sync-log-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
}
.farasync-global-sync-log-item:last-child {
    border-bottom: none;
}
.farasync-global-sync-log-item .dashicons {
    width: 14px;
    height: 14px;
    font-size: 14px;
    line-height: 14px;
    flex-shrink: 0;
}
.farasync-global-sync-log-item.is-created .dashicons { color: #16a34a; }
.farasync-global-sync-log-item.is-updated .dashicons { color: #2563eb; }
.farasync-global-sync-log-item.is-skipped .dashicons { color: #d97706; }
.farasync-global-sync-log-item.is-failed .dashicons { color: #dc2626; }
.farasync-global-sync-log-item.is-info .dashicons { color: #64748b; }

.farasync-global-sync-log-status {
    font-weight: 600;
    flex-shrink: 0;
    min-width: 60px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.farasync-global-sync-log-item.is-created .farasync-global-sync-log-status { color: #16a34a; }
.farasync-global-sync-log-item.is-updated .farasync-global-sync-log-status { color: #2563eb; }
.farasync-global-sync-log-item.is-skipped .farasync-global-sync-log-status { color: #d97706; }
.farasync-global-sync-log-item.is-failed .farasync-global-sync-log-status { color: #dc2626; }
.farasync-global-sync-log-item.is-info .farasync-global-sync-log-status { color: #64748b; }

.farasync-global-sync-log-name {
    color: #1e293b;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.farasync-global-sync-log-msg {
    color: #94a3b8;
    font-size: 11px;
    font-style: italic;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Footer */
.farasync-global-sync-footer {
    padding: 14px 24px;
    background: linear-gradient(180deg, #f8f9fc 0%, #f0f4ff 100%);
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.farasync-global-sync-footer .button {
    min-width: 88px;
    border-radius: 8px;
    font-weight: 500;
}

/* Scrollbar styling for the log area. */
.farasync-global-sync-log::-webkit-scrollbar {
    width: 6px;
}
.farasync-global-sync-log::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}
.farasync-global-sync-log::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.farasync-global-sync-log::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile: make the modal full-width and shrink the circle. */
@media (max-width: 640px) {
    #farasync-global-sync-modal .farasync-global-sync-content {
        max-width: 100%;
        width: calc(100% - 16px);
        border-radius: 12px;
    }
    .farasync-global-sync-circular-wrap {
        width: 80px;
        height: 80px;
    }
    .farasync-global-sync-circle {
        width: 80px;
        height: 80px;
    }
    .farasync-global-sync-circle-text {
        font-size: 16px;
    }
    .farasync-global-sync-body {
        padding: 16px 14px 4px;
    }
    .farasync-global-sync-footer {
        padding: 12px 14px;
    }
    .farasync-global-sync-btn-label {
        display: none;
    }
}

/* ================================================================
   v1.0.0 — Price Rule card redesign + Multi-select widget
   ================================================================ */

/* Rule card — improved design with type icon, value, status badge */
.farasync-price-rule-item {
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 16px !important;
    background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%) !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    margin-bottom: 8px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}
.farasync-price-rule-item:hover {
    border-color: #2271b1 !important;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.1) !important;
    transform: translateY(-1px) !important;
}
.farasync-price-rule-item.is-inactive {
    opacity: 0.6 !important;
    background: #f8fafc !important;
}
.farasync-price-rule-info {
    flex: 1 !important;
    min-width: 0 !important;
}
.farasync-price-rule-header {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}
.farasync-pr-type-icon {
    color: #64748b !important;
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
}
.farasync-price-rule-value {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
}
.farasync-price-rule-type {
    font-size: 11px !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    padding: 2px 8px !important;
    background: #f1f5f9 !important;
    border-radius: 999px !important;
}
.farasync-pr-status-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 2px 8px !important;
    border-radius: 999px !important;
}
.farasync-pr-status-badge .dashicons {
    font-size: 12px !important;
    width: 12px !important;
    height: 12px !important;
}
.farasync-pr-status-badge.is-active {
    background: #dcfce7 !important;
    color: #16a34a !important;
}
.farasync-pr-status-badge.is-inactive {
    background: #f1f5f9 !important;
    color: #64748b !important;
}
.farasync-price-rule-desc {
    font-size: 12px !important;
    color: #64748b !important;
    margin-top: 4px !important;
    line-height: 1.6 !important;
}
.farasync-price-rule-actions {
    display: flex !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
}
.farasync-pr-toggle-btn .dashicons,
.farasync-pr-edit-btn .dashicons,
.farasync-pr-delete-btn .dashicons {
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
}
.farasync-pr-toggle-btn.is-active {
    color: #16a34a !important;
}

/* Multi-select widget */
.farasync-pr-multiselect {
    position: relative;
    max-width: 500px;
}
.farasync-pr-multiselect-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.farasync-pr-multiselect-search-wrap .dashicons {
    position: absolute;
    /* v1.0.0: Use inset-inline-end so the icon appears on the LEFT side
       in RTL (Persian) layouts, and on the RIGHT side in LTR (English). */
    inset-inline-end: 10px;
    color: #94a3b8;
    font-size: 16px;
    width: 16px;
    height: 16px;
    pointer-events: none;
}
.farasync-pr-multiselect-search {
    width: 100%;
    height: 38px;
    /* v1.0.0: In RTL, padding-end = left padding (where the icon is).
       In LTR, padding-start = left padding (where the icon is).
       Using logical properties so it works in both directions. */
    padding-block: 0;
    padding-inline-start: 12px;
    padding-inline-end: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.farasync-pr-multiselect-search:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.12);
}
.farasync-pr-multiselect-selected {
    min-height: 32px;
    padding: 6px 8px;
    margin-top: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.farasync-pr-multiselect-placeholder {
    color: #94a3b8;
    font-size: 12px;
    font-style: italic;
}
.farasync-pr-multiselect-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: linear-gradient(135deg, #2271b1 0%, #1a5f9e 100%);
    color: #ffffff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    cursor: default;
}
.farasync-pr-multiselect-chip-remove {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.15s;
}
.farasync-pr-multiselect-chip-remove:hover {
    opacity: 1;
}
.farasync-pr-multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    z-index: 1000;
    display: none;
    margin-top: 4px;
}
.farasync-pr-multiselect-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f1f5f9;
}
.farasync-pr-multiselect-option:last-child {
    border-bottom: none;
}
.farasync-pr-multiselect-option:hover {
    background: #f0f7ff;
}
.farasync-pr-multiselect-option .dashicons {
    color: #64748b;
    font-size: 14px;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.farasync-pr-multiselect-option-name {
    flex: 1;
    font-size: 13px;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.farasync-pr-multiselect-option-id {
    font-size: 11px;
    color: #94a3b8;
    font-family: monospace;
}

/* Profit suffix (currency unit) */
.farasync-pr-profit-suffix {
    font-size: 12px;
    color: #64748b;
    margin-inline-start: 4px;
    font-weight: 500;
}
.farasync-pr-round-suffix {
    font-weight: 600 !important;
    color: #2271b1 !important;
}

/* ================================================================
   v1.0.0 — Debug panel styling
   ================================================================ */
.farasync-debug-panel {
    max-width: 1000px;
}
.farasync-debug-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}
.farasync-debug-info h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}
.farasync-debug-info h3 .dashicons {
    color: #6c4ab6;
    font-size: 20px;
    width: 20px;
    height: 20px;
}
.farasync-debug-info .description {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 8px;
}
.farasync-debug-path {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}
.farasync-debug-path code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #2271b1;
}
.farasync-debug-path .dashicons {
    font-size: 14px;
    color: #94a3b8;
}
.farasync-debug-actions {
    flex-shrink: 0;
}
.farasync-debug-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}
.farasync-debug-status.is-enabled {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #16a34a;
    border: 1px solid #86efac;
}
.farasync-debug-status.is-disabled {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}
.farasync-debug-status .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}
.farasync-debug-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.farasync-debug-toolbar .button .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}
/* v1.0.0: Spacer pushes the toggle button to the left and Clear/Refresh/Download
   buttons to the right of the toolbar (per user request — toggle next to Clear Logs). */
.farasync-debug-toolbar-spacer {
    flex: 1;
}
.farasync-debug-toggle-label {
    font-weight: 700;
    margin-inline-start: 2px;
}
/* v1.0.0: Server info bar (inside debug header) */
.farasync-debug-server-info {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f0f0f1;
    border-radius: 6px;
    font-size: 12px;
    color: #646970;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.farasync-debug-server-info .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #2271b1;
}
.farasync-debug-server-info code {
    background: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #1d2327;
}
.farasync-debug-count {
    font-size: 12px;
    color: #64748b;
    margin-inline-start: auto;
}
.farasync-debug-log-container {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #0f172a;
    color: #e2e8f0;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 12px;
    line-height: 1.8;
    padding: 16px;
}
.farasync-debug-log-container::-webkit-scrollbar {
    width: 8px;
}
.farasync-debug-log-container::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 4px;
}
.farasync-debug-log-container::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}
.farasync-debug-log-container::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}
.farasync-debug-placeholder {
    color: #64748b;
    text-align: center;
    padding: 40px 0;
}
.farasync-debug-log-entry {
    display: flex;
    gap: 8px;
    padding: 3px 0;
    border-bottom: 1px solid #1e293b;
    word-break: break-word;
}
.farasync-debug-log-entry:last-child {
    border-bottom: none;
}
.farasync-debug-log-time {
    color: #64748b;
    flex-shrink: 0;
    white-space: nowrap;
}
.farasync-debug-log-level {
    font-weight: 700;
    flex-shrink: 0;
    min-width: 60px;
}
.farasync-debug-log-level.debug { color: #94a3b8; }
.farasync-debug-log-level.info { color: #60a5fa; }
.farasync-debug-log-level.warning { color: #fbbf24; }
.farasync-debug-log-level.error { color: #f87171; }
.farasync-debug-log-type {
    color: #fbbf24;
    flex-shrink: 0;
    min-width: 100px;
}
.farasync-debug-log-msg {
    color: #e2e8f0;
    flex: 1;
}
.farasync-debug-log-details {
    color: #64748b;
    font-size: 11px;
}
/* v1.0.0: the muted technical line under a plain-language debug row —
   the friendly sentence leads, the raw jargon (REQUEST KILLED…, FATAL…)
   stays available for support without scaring the beginner. */
.farasync-debug-log-raw {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
    direction: ltr;
    unicode-bidi: embed;
    word-break: break-word;
}

/* v1.0.0: Debug panel — Vazirmatn font + translation styling */
.farasync-debug-panel,
.farasync-debug-panel *,
.farasync-debug-panel h3,
.farasync-debug-panel p,
.farasync-debug-panel .description,
.farasync-debug-panel code,
.farasync-debug-panel .button,
.farasync-debug-panel .farasync-debug-status,
.farasync-debug-panel .farasync-debug-count {
    font-family: 'Vazirmatn', sans-serif !important;
}
.farasync-debug-log-container,
.farasync-debug-log-container * {
    font-family: 'SF Mono', 'Monaco', 'Vazirmatn', monospace !important;
}

/* v1.0.0: Small debug toggle button — v1.0.0: always visible, toggles ON/OFF */
.farasync-debug-mini-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    padding: 4px 8px;
    opacity: 0.55;
    transition: opacity 0.2s;
}
.farasync-debug-mini-toggle:hover {
    opacity: 1;
}
.farasync-debug-mini-toggle .button-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 13px;
    color: #64748b;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
}
.farasync-debug-mini-toggle .button-link:hover {
    background: #f0f0f1;
    border-color: #c0c4c8;
}
.farasync-debug-mini-toggle .button-link.is-on {
    color: #16a34a;
    background: #ecfdf5;
    border-color: #16a34a;
}
.farasync-debug-mini-toggle .button-link.is-on:hover {
    background: #d1fae5;
}
.farasync-debug-mini-toggle .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* v1.0.0: Debug log container — 100% width */
.farasync-debug-log-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
.farasync-debug-panel {
    max-width: 100% !important;
}

/* ================================================================
 * v1.0.0 — Price Rule Tester UI
 * ================================================================ */

.farasync-price-rule-tester {
    margin-top: 16px;
    padding: 12px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}
.farasync-price-rule-tester h3 {
    margin: 0 0 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.farasync-price-rule-trace {
    margin-top: 4px;
    padding: 8px;
    background: #f0f0f1;
    border-radius: 4px;
}
.farasync-price-rule-trace-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}
.farasync-price-rule-trace-row:last-child {
    margin-bottom: 0;
}
.farasync-price-rule-trace-row .farasync-prt-rule-id {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    min-width: 50px;
    text-align: center;
}
.farasync-price-rule-trace-row .farasync-prt-status {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}
.farasync-prt-status-matched { background: #46b450; color: #fff; }
.farasync-prt-status-skipped { background: #c0c4c8; color: #fff; }
.farasync-prt-status-final   { background: #2271b1; color: #fff; }
.farasync-prt-status-reason  { color: #646970; font-style: italic; }

/* =====================================================================
   v1.0.0 (user requests)
   ===================================================================== */

/* — task 3: the sales-report auto-sync banner. Sits right above the
   table while the rate-limited entry pull talks to the source site;
   removed the moment the flow settles. — */
.farasync-sales-autosync {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 8px 14px;
    border: 1px solid #c7d2fe;
    border-inline-start: 4px solid #4f46e5;
    border-radius: 8px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12.5px;
    font-weight: 600;
}
.farasync-sales-autosync .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #4f46e5;
}

/* — task 4: the «پرداخت» column of the representative invoices list.
   Green locked tick = registered (read-only); gray tick button = not
   registered (opens the quick-confirm modal). v1.0.0 (user request):
   the whole icon set went ~30% SMALLER (26→18px chip, 20→14px glyph)
   so the column stays compact. — */
.farasync-inv-col-payreg {
    text-align: center;
}
.farasync-payreg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
}
.farasync-payreg .dashicons,
.farasync-payreg-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}
.farasync-payreg.is-yes {
    color: #16a34a;
    background: #dcfce7;
}
.farasync-payreg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    border: 1px dashed #cbd5e1;
    border-radius: 50%;
    background: #f8fafc;
    color: #94a3b8;
    cursor: pointer;
    transition: color 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.farasync-payreg-btn:hover,
.farasync-payreg-btn:focus-visible {
    color: #16a34a;
    border-color: #16a34a;
    background: #f0fdf4;
    box-shadow: 0 1px 4px rgba(22, 163, 74, 0.25);
}
.farasync-payreg-btn.is-busy {
    pointer-events: none;
    opacity: 0.55;
}
.farasync-payreg-btn.is-busy .dashicons {
    animation: farasync-spin 0.8s linear infinite;
}
