/* ============================================
   OneMore Plugin - Main Styles
   ============================================ */

:root {
    --om-primary: #1a237e;
    --om-primary-light: #283593;
    --om-primary-dark: #0d1456;
    --om-accent: #1565c0;
    --om-accent-light: #1e88e5;
    --om-bg: #f0f2f8;
    --om-surface: #ffffff;
    --om-surface2: #f8f9fd;
    --om-border: #e2e8f0;
    --om-text: #1a202c;
    --om-text-muted: #718096;
    --om-success: #22c55e;
    --om-success-bg: #f0fdf4;
    --om-error: #ef4444;
    --om-error-bg: #fef2f2;
    --om-warning: #f59e0b;
    --om-warning-bg: #fffbeb;
    --om-sidebar-width: 260px;
    --om-topbar-height: 64px;
    --om-radius: 12px;
    --om-radius-sm: 8px;
    --om-shadow: 0 2px 16px rgba(26,35,126,0.08);
    --om-shadow-md: 0 4px 24px rgba(26,35,126,0.12);
    --om-transition: all 0.2s ease;
}

/* Base */
#om-app, #om-app * {
    box-sizing: border-box;
    font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', 'Segoe UI', Arial, sans-serif;
    direction: rtl;
    text-align: right;
}

#om-app {
    display: flex;
    min-height: 100vh;
    background: var(--om-bg);
    position: relative;
    overflow-x: hidden;
    /* فرار از محدودیت max-width تم وردپرس */
    width: 100vw;
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);
}

/* ============================================
   AUTH PAGE
   ============================================ */
/* ── Welcome / Disclaimer Screen ─────────────── */
.om-welcome-card {
    max-width: 600px !important;
}

.om-welcome-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    max-height: 340px;
    overflow-y: auto;
    padding-left: 4px;
}

.om-welcome-sections::-webkit-scrollbar { width: 4px; }
.om-welcome-sections::-webkit-scrollbar-track { background: var(--om-bg); border-radius: 4px; }
.om-welcome-sections::-webkit-scrollbar-thumb { background: var(--om-border); border-radius: 4px; }

.om-welcome-section {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--om-bg);
    border-radius: var(--om-radius-sm);
    padding: 14px 16px;
    border-right: 3px solid var(--om-primary);
}

.om-welcome-section-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: #e8eaf6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.om-welcome-section strong {
    display: block;
    font-size: 14px;
    color: var(--om-primary);
    margin-bottom: 6px;
}

.om-welcome-section p {
    font-size: 13px;
    color: var(--om-text);
    line-height: 1.7;
    margin: 0;
}

.om-welcome-list {
    margin: 4px 0 0 0;
    padding-right: 18px;
    font-size: 13px;
    color: var(--om-text);
    line-height: 1.9;
}

.om-welcome-list li::marker {
    color: var(--om-primary);
}

/* تیک تأیید */
.om-welcome-agree {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: var(--om-warning-bg);
    border: 1px solid #fde68a;
    border-radius: var(--om-radius-sm);
    font-size: 13px;
    color: var(--om-text);
    line-height: 1.6;
    user-select: none;
}

.om-welcome-agree input[type="checkbox"] {
    display: none;
}

.om-welcome-agree-box {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--om-border);
    border-radius: 5px;
    background: var(--om-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    transition: var(--om-transition);
    font-size: 13px;
    color: transparent;
}

.om-welcome-agree input[type="checkbox"]:checked ~ .om-welcome-agree-box {
    background: var(--om-primary);
    border-color: var(--om-primary);
}

.om-welcome-agree input[type="checkbox"]:checked ~ .om-welcome-agree-box::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translate(-1px, -1px);
}

#om-welcome-continue:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* انیمیشن انتقال */
@keyframes om-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.om-auth-card { animation: om-fade-in 0.3s ease; }
.om-auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, var(--om-primary-dark) 0%, var(--om-accent) 100%);
    padding: 20px;
}

.om-auth-card {
    background: var(--om-surface);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--om-shadow-md);
}

.om-auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.om-auth-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 12px;
}

.om-auth-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--om-primary);
    margin: 0;
}

.om-auth-tabs {
    display: flex;
    background: var(--om-bg);
    border-radius: var(--om-radius-sm);
    padding: 4px;
    margin-bottom: 24px;
}

.om-auth-tabs .om-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--om-text-muted);
    transition: var(--om-transition);
}

.om-auth-tabs .om-tab.active {
    background: var(--om-surface);
    color: var(--om-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ============================================
   SIDEBAR
   ============================================ */
.om-sidebar {
    width: var(--om-sidebar-width);
    background: linear-gradient(180deg, var(--om-primary-dark) 0%, var(--om-primary) 100%);
    min-height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.om-sidebar-logo {
    padding: 24px 20px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.om-sidebar-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.om-sidebar-logo span {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.om-sidebar-user {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.om-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.om-avatar-admin {
    background: rgba(255,215,0,0.3);
}

.om-username {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.om-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
    margin-top: 4px;
}

.om-badge-admin {
    background: rgba(255,215,0,0.3);
    color: #ffd700;
}

.om-badge-info {
    background: rgba(30,136,229,0.15);
    color: var(--om-accent-light);
    border: 1px solid rgba(30,136,229,0.3);
}

.om-nav {
    flex: 1;
    padding: 12px 0;
}

.om-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--om-transition);
    border-right: 3px solid transparent;
}

.om-nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.om-nav-item.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-right-color: #fff;
}

.om-nav-icon {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.om-sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.om-btn-logout {
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--om-radius-sm);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    font-size: 13px;
    transition: var(--om-transition);
}

.om-btn-logout:hover {
    background: rgba(239,68,68,0.3);
    border-color: rgba(239,68,68,0.5);
    color: #fff;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.om-main {
    flex: 1;
    margin-right: var(--om-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.om-topbar {
    height: var(--om-topbar-height);
    background: var(--om-surface);
    border-bottom: 1px solid var(--om-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.om-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--om-text);
    padding: 4px;
}

.om-topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--om-primary);
    flex: 1;
}

.om-qv-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--om-primary), var(--om-accent));
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.om-content {
    flex: 1;
    padding: 24px;
}

/* ============================================
   PAGES
   ============================================ */
.om-page {
    display: none;
}
.om-page.active {
    display: block;
}

.om-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.om-page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--om-text);
    margin: 0;
}

.om-page-desc {
    color: var(--om-text-muted);
    margin-bottom: 20px;
    font-size: 14px;
}

/* ============================================
   STAT CARDS
   ============================================ */
.om-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.om-stat-card {
    background: var(--om-surface);
    border-radius: var(--om-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--om-shadow);
    border-top: 4px solid transparent;
    transition: var(--om-transition);
}

.om-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--om-shadow-md);
}

.om-stat-blue  { border-top-color: #3b82f6; }
.om-stat-green { border-top-color: #22c55e; }
.om-stat-purple{ border-top-color: #a855f7; }
.om-stat-orange{ border-top-color: #f97316; }
.om-stat-gold  { border-top-color: #f59e0b; }

.om-stat-icon  { font-size: 28px; margin-bottom: 8px; }
.om-stat-value { font-size: 28px; font-weight: 800; color: var(--om-primary); }
.om-stat-label { font-size: 12px; color: var(--om-text-muted); margin-top: 4px; font-weight: 500; }

/* ============================================
   CARDS
   ============================================ */
.om-card {
    background: var(--om-surface);
    border-radius: var(--om-radius);
    box-shadow: var(--om-shadow);
    overflow: hidden;
}

.om-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--om-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.om-card-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--om-text);
}

.om-form-card {
    padding: 24px;
}

.om-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.om-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ============================================
   FORMS
   ============================================ */
.om-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.om-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.om-field-hint {
    font-size: 12px;
    color: var(--om-text-muted);
    line-height: 1.5;
    display: block;
}

.om-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--om-text);
}

.om-field input,
.om-field textarea,
.om-field select {
    padding: 10px 14px;
    border: 1.5px solid var(--om-border);
    border-radius: var(--om-radius-sm);
    font-size: 14px;
    color: var(--om-text);
    background: var(--om-surface);
    transition: var(--om-transition);
    outline: none;
    width: 100%;
    font-family: inherit;
}

.om-field input:focus,
.om-field textarea:focus,
.om-field select:focus {
    border-color: var(--om-accent);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}

.om-readonly {
    background: var(--om-bg) !important;
    color: var(--om-text-muted) !important;
    cursor: not-allowed;
}

.om-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.om-input {
    padding: 10px 14px;
    border: 1.5px solid var(--om-border);
    border-radius: var(--om-radius-sm);
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.om-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.6;
}

.om-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--om-primary);
}

.om-radio-group {
    display: flex;
    gap: 16px;
}

.om-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    padding: 10px 16px;
    border: 2px solid var(--om-border);
    border-radius: var(--om-radius-sm);
    transition: var(--om-transition);
    flex: 1;
    justify-content: center;
}

.om-radio-label:has(input:checked) {
    border-color: var(--om-accent);
    background: rgba(21,101,192,0.05);
    color: var(--om-accent);
}

.om-radio-label input[type="radio"] {
    accent-color: var(--om-accent);
}

.om-form-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--om-primary);
    border-bottom: 2px solid var(--om-border);
    padding-bottom: 8px;
    margin-bottom: 4px;
}

/* ============================================
   BUTTONS
   ============================================ */
.om-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--om-radius-sm);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: var(--om-transition);
    text-decoration: none;
    white-space: nowrap;
}

.om-btn-primary {
    background: linear-gradient(135deg, var(--om-primary), var(--om-accent));
    color: #fff;
}
.om-btn-primary:hover {
    background: linear-gradient(135deg, var(--om-primary-dark), var(--om-primary));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26,35,126,0.25);
}
.om-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.om-btn-ghost {
    background: transparent;
    color: var(--om-text);
    border: 1.5px solid var(--om-border);
}
.om-btn-ghost:hover {
    background: var(--om-bg);
    color: var(--om-primary);
    border-color: var(--om-primary);
}
.om-btn-ghost:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.om-btn-success {
    background: var(--om-success);
    color: #fff;
}
.om-btn-success:hover { background: #16a34a; }

.om-btn-danger {
    background: var(--om-error);
    color: #fff;
}
.om-btn-danger:hover { background: #dc2626; }

.om-btn-full { width: 100%; }

/* ============================================
   ALERTS
   ============================================ */
.om-alert {
    padding: 12px 16px;
    border-radius: var(--om-radius-sm);
    font-size: 13px;
    font-weight: 500;
}

.om-alert-error {
    background: var(--om-error-bg);
    color: var(--om-error);
    border: 1px solid #fca5a5;
}

.om-alert-success {
    background: var(--om-success-bg);
    color: #16a34a;
    border: 1px solid #86efac;
}

/* ============================================
   COUNTRY SELECTION
   ============================================ */
.om-country-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.om-country-card {
    background: var(--om-surface);
    border: 2px solid var(--om-border);
    border-radius: var(--om-radius);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--om-transition);
    box-shadow: var(--om-shadow);
}

.om-country-card:hover {
    border-color: var(--om-accent);
    transform: translateY(-4px);
    box-shadow: var(--om-shadow-md);
}

.om-country-flag { font-size: 48px; margin-bottom: 12px; }
.om-country-card h3 { margin: 0 0 6px; color: var(--om-primary); font-size: 17px; }
.om-country-card p  { margin: 0; font-size: 12px; color: var(--om-text-muted); }

/* ============================================
   PRODUCTS GRID
   ============================================ */
.om-orders-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}

.om-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.om-product-card {
    background: var(--om-surface);
    border: 2px solid var(--om-border);
    border-radius: var(--om-radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--om-transition);
    box-shadow: var(--om-shadow);
    position: relative;
}

.om-product-card:hover {
    border-color: var(--om-accent);
    box-shadow: var(--om-shadow-md);
    transform: translateY(-2px);
}

.om-product-card.in-cart {
    border-color: var(--om-success);
    background: var(--om-success-bg);
}

.om-product-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    background: var(--om-bg);
    display: block;
}

.om-product-img-placeholder {
    width: 100%;
    height: 130px;
    background: var(--om-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.om-product-info {
    padding: 12px;
}

.om-product-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--om-text);
    margin-bottom: 6px;
}

.om-product-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--om-primary);
}

.om-product-price-local {
    font-size: 12px;
    color: var(--om-text-muted);
    font-weight: 500;
    margin-bottom: 2px;
}

.om-product-qv {
    font-size: 11px;
    color: var(--om-warning);
    font-weight: 600;
    margin-top: 4px;
}

.om-product-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.om-qty-btn {
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--om-border);
    border-radius: 6px;
    background: var(--om-bg);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--om-transition);
    font-weight: 700;
}

.om-qty-btn:hover { background: var(--om-accent); color: #fff; border-color: var(--om-accent); }
.om-qty-display { font-size: 14px; font-weight: 700; min-width: 24px; text-align: center; }

/* Cart */
.om-cart-card {
    background: var(--om-surface);
    border-radius: var(--om-radius);
    padding: 20px;
    box-shadow: var(--om-shadow);
    position: sticky;
    top: 80px;
}

.om-cart-card h3 { margin: 0 0 16px; font-size: 16px; color: var(--om-text); }

.om-cart-empty {
    text-align: center;
    padding: 24px;
    color: var(--om-text-muted);
    font-size: 13px;
}

.om-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid var(--om-border);
    font-size: 13px;
    gap: 8px;
}

.om-cart-item-name { color: var(--om-text); font-weight: 500; flex: 1; }
.om-cart-item-price { color: var(--om-primary); font-weight: 700; white-space: nowrap; }

.om-cart-totals {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--om-border);
}

.om-cart-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.om-cart-row strong { color: var(--om-primary); }

/* ============================================
   ACADEMY
   ============================================ */
.om-academy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.om-academy-card {
    background: var(--om-surface);
    border-radius: var(--om-radius);
    box-shadow: var(--om-shadow);
    overflow: hidden;
    transition: var(--om-transition);
}

.om-academy-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--om-shadow-md);
}

.om-academy-thumb {
    height: 140px;
    background: linear-gradient(135deg, var(--om-primary-dark), var(--om-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.om-academy-body {
    padding: 16px;
}

.om-academy-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--om-text);
    margin-bottom: 6px;
}

.om-academy-desc {
    font-size: 12px;
    color: var(--om-text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.om-academy-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.om-file-type-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(21,101,192,0.1);
    color: var(--om-accent);
}

/* ============================================
   AI CHAT
   ============================================ */
.om-chat-container {
    background: var(--om-surface);
    border-radius: var(--om-radius);
    box-shadow: var(--om-shadow);
    display: flex;
    flex-direction: column;
    height: 550px;
    overflow: hidden;
}

.om-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.om-chat-welcome {
    text-align: center;
    padding: 32px 20px;
    color: var(--om-text-muted);
}

.om-chat-bot-avatar {
    font-size: 48px;
    margin-bottom: 12px;
}

.om-chat-message {
    display: flex;
    gap: 10px;
    max-width: 80%;
}

.om-chat-message.user {
    flex-direction: row-reverse;
    align-self: flex-start;
}

.om-chat-message.bot {
    align-self: flex-end;
}

.om-chat-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.7;
}

.om-chat-message.user .om-chat-bubble {
    background: linear-gradient(135deg, var(--om-primary), var(--om-accent));
    color: #fff;
    border-top-right-radius: 4px;
}

.om-chat-message.bot .om-chat-bubble {
    background: var(--om-bg);
    color: var(--om-text);
    border-top-left-radius: 4px;
}

.om-chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--om-border);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.om-chat-input-area textarea {
    flex: 1;
    padding: 12px 14px;
    border: 1.5px solid var(--om-border);
    border-radius: var(--om-radius-sm);
    resize: none;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--om-transition);
}

.om-chat-input-area textarea:focus {
    border-color: var(--om-accent);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}

/* ============================================
   TABLES
   ============================================ */
.om-table-wrapper {
    background: var(--om-surface);
    border-radius: var(--om-radius);
    box-shadow: var(--om-shadow);
    overflow: auto;
}

.om-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.om-table thead th {
    background: var(--om-primary);
    color: #fff;
    padding: 14px 16px;
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

.om-table tbody tr {
    border-bottom: 1px solid var(--om-border);
    transition: var(--om-transition);
}

.om-table tbody tr:hover {
    background: var(--om-surface2);
}

.om-table td {
    padding: 12px 16px;
    color: var(--om-text);
    vertical-align: middle;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.om-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.om-status-pending  { background: #fef3c7; color: #d97706; }
.om-status-approved { background: #dcfce7; color: #16a34a; }
.om-status-rejected { background: #fee2e2; color: #dc2626; }
.om-status-paid     { background: #dbeafe; color: #2563eb; }

/* ============================================
   FILE UPLOAD
   ============================================ */
.om-file-upload {
    border: 2px dashed var(--om-border);
    border-radius: var(--om-radius-sm);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--om-transition);
    background: var(--om-bg);
}

.om-file-upload:hover {
    border-color: var(--om-accent);
    background: rgba(21,101,192,0.04);
}

.om-file-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--om-text-muted);
    font-size: 13px;
}

.om-file-placeholder span:first-child { font-size: 28px; }

/* ============================================
   MODALS
   ============================================ */
.om-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.om-modal-content {
    background: var(--om-surface);
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.om-modal-lg { max-width: 640px; }

.om-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--om-border);
}

.om-modal-header h3 { margin: 0; font-size: 18px; color: var(--om-text); }

.om-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--om-text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--om-transition);
}

.om-modal-close:hover { background: var(--om-bg); color: var(--om-text); }

.om-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--om-border);
    flex-wrap: wrap;
}

/* ============================================
   MISC
   ============================================ */
.om-loading { text-align: center; padding: 32px; color: var(--om-text-muted); font-size: 14px; }
.om-empty   { text-align: center; padding: 24px; color: var(--om-text-muted); font-size: 13px; }
.om-list-container { padding: 8px 0; }
.om-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--om-border);
    font-size: 13px;
    gap: 8px;
}
.om-list-item:last-child { border-bottom: none; }

.om-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
}

.om-count-badge {
    display: inline-block;
    background: var(--om-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-right: 4px;
}

.om-tabs-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.om-tabs-bar .om-tab {
    padding: 8px 20px;
    border: 1.5px solid var(--om-border);
    border-radius: var(--om-radius-sm);
    background: var(--om-surface);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--om-text-muted);
    transition: var(--om-transition);
}

.om-tabs-bar .om-tab.active {
    background: var(--om-primary);
    border-color: var(--om-primary);
    color: #fff;
}

.om-filters-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.om-search-input {
    padding: 10px 14px;
    border: 1.5px solid var(--om-border);
    border-radius: var(--om-radius-sm);
    font-size: 13px;
    outline: none;
    font-family: inherit;
    min-width: 200px;
    transition: var(--om-transition);
}
.om-search-input:focus { border-color: var(--om-accent); }

.om-filter-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.om-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.om-section-header h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--om-text); }

.om-qv-info {
    font-size: 14px;
    color: var(--om-text-muted);
}

.om-qv-info strong { color: var(--om-warning); font-size: 18px; }

/* Spinner */
.om-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: om-spin 0.6s linear infinite;
    display: inline-block;
}

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

/* ============================================
   ORDER STATUS BADGES
   ============================================ */
.om-order-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.om-os-pending_review { background: #dbeafe; color: #1d4ed8; }
.om-os-pending        { background: #dbeafe; color: #1d4ed8; }
.om-os-confirmed      { background: #d1fae5; color: #065f46; }
.om-os-shipped        { background: #e0e7ff; color: #3730a3; }
.om-os-rejected       { background: #fee2e2; color: #991b1b; }


/* ============================================
   TICKETS / SUPPORT
   ============================================ */
.om-ticket-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 120px;
    max-height: 360px;
    overflow-y: auto;
    padding: 16px;
    background: var(--om-bg);
    border-radius: var(--om-radius-sm);
    margin-bottom: 16px;
    scroll-behavior: smooth;
}

.om-ticket-msg {
    display: flex;
    flex-direction: column;
    max-width: 78%;
}
.om-ticket-msg.user  { align-self: flex-start; }
.om-ticket-msg.admin { align-self: flex-end; }

.om-ticket-msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.7;
    word-break: break-word;
}
.om-ticket-msg.user  .om-ticket-msg-bubble {
    background: #fff;
    border: 1px solid var(--om-border);
    color: var(--om-text);
    border-bottom-right-radius: 4px;
}
.om-ticket-msg.admin .om-ticket-msg-bubble {
    background: linear-gradient(135deg, var(--om-primary), var(--om-accent));
    color: #fff;
    border-bottom-left-radius: 4px;
}
.om-ticket-msg-meta {
    font-size: 11px;
    color: var(--om-text-muted);
    margin-top: 4px;
    padding: 0 4px;
}
.om-ticket-msg.admin .om-ticket-msg-meta { text-align: left; color: rgba(255,255,255,0.6); }

.om-ticket-reply-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.om-ticket-reply-area textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--om-border);
    border-radius: var(--om-radius-sm);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    resize: none;
    transition: var(--om-transition);
}
.om-ticket-reply-area textarea:focus {
    border-color: var(--om-accent);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}

/* Status badges for tickets */
.om-ticket-status-open     { background: #dbeafe; color: #1d4ed8; }
.om-ticket-status-answered { background: #dcfce7; color: #16a34a; }
.om-ticket-status-closed   { background: #f3f4f6; color: #6b7280; }

/* Unread row highlight */
.om-row-unread { background: #fffbeb !important; }
.om-row-unread:hover { background: #fef3c7 !important; }

/* Nav unread badge */
.om-nav-unread-badge {
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: auto;
    min-width: 20px;
    text-align: center;
    display: inline-block;
}
/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .om-orders-layout { grid-template-columns: 1fr; }
    .om-grid-2 { grid-template-columns: 1fr; }
    .om-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .om-currency-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 700px) {
    .om-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* Sidebar: slide out to the right, hidden by default */
    .om-sidebar {
        position: fixed;
        top: 0; right: 0; bottom: 0;
        width: 260px;
        transform: translateX(100%);
        z-index: 200;
        overflow-y: auto;
        transition: transform 0.3s ease;
    }
    .om-sidebar.open {
        transform: translateX(0);
        box-shadow: -4px 0 24px rgba(0,0,0,0.3);
    }
    /* Main: full width, no right margin */
    .om-main {
        margin-right: 0 !important;
        width: 100%;
        min-width: 0;
    }
    #om-app {
        flex-direction: column;
        width: 100%;
        overflow-x: hidden;
    }
    .om-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    .om-overlay.active { display: block; }
    .om-topbar {
        padding: 0 12px;
        gap: 10px;
        position: sticky;
        top: 0;
        z-index: 150;
    }
    .om-topbar-title { font-size: 15px; }
    .om-qv-badge { padding: 5px 10px; font-size: 12px; }
    .om-content { padding: 14px 12px; width: 100%; overflow-x: hidden; }
    .om-page-header { flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
    .om-page-header h2 { font-size: 18px; }
    .om-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .om-stat-card  { padding: 14px 10px; }
    .om-stat-icon  { font-size: 22px; }
    .om-stat-value { font-size: 22px; }
    .om-stat-label { font-size: 11px; }
    .om-fields-row { grid-template-columns: 1fr; gap: 12px; }
    .om-grid-2     { grid-template-columns: 1fr; gap: 14px; }
    .om-country-grid { grid-template-columns: 1fr 1fr; max-width: 100%; gap: 12px; }
    .om-country-flag { font-size: 36px; }
    .om-country-card { padding: 20px 12px; }
    .om-country-card h3 { font-size: 14px; }
    .om-products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .om-product-img, .om-product-img-placeholder { height: 100px; }
    .om-product-info { padding: 8px; }
    .om-product-name { font-size: 12px; }
    .om-orders-layout { grid-template-columns: 1fr; gap: 14px; }
    .om-cart-card { position: static; }
    .om-academy-grid { grid-template-columns: 1fr; }
    .om-chat-container { height: 420px; }
    .om-chat-input-area { flex-direction: column; gap: 8px; }
    .om-chat-input-area .om-btn { width: 100%; }
    .om-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .om-table { min-width: 550px; }
    .om-table th, .om-table td { padding: 10px; font-size: 12px; }
    .om-filters-bar { flex-direction: column; align-items: stretch; gap: 8px; }
    .om-search-input { width: 100%; }
    .om-filter-btns { flex-wrap: wrap; }
    .om-auth-card { padding: 24px 20px; }
    .om-auth-logo img { width: 60px; height: 60px; }
    .om-auth-logo h1 { font-size: 20px; }
    .om-modal { padding: 12px; align-items: flex-end; }
    .om-modal-content {
        padding: 20px 16px;
        max-width: 100%; width: 100%;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
    }
    .om-modal-actions { justify-content: stretch; flex-wrap: wrap; }
    .om-modal-actions .om-btn { flex: 1; min-width: 120px; }
    .om-form-card { padding: 16px; }
    .om-radio-group { gap: 8px; }
    .om-tabs-bar { flex-wrap: wrap; }
    .om-ticket-messages { max-height: 260px; }
    .om-ticket-msg { max-width: 88%; }
}

@media (max-width: 480px) {
    .om-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .om-country-grid { grid-template-columns: 1fr; }
    .om-products-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .om-chat-container { height: 380px; }
    .om-content { padding: 12px 10px; }
    .om-card-header h3 { font-size: 13px; }
}


a.om-nav-item :not([href]):not([tabindex]), a.om-nav-item :not([href]):not([tabindex]):focus, a.om-nav-item :not([href]):not([tabindex]):hover {
    color: #ffffff;
    text-decoration: none;
}
[type=button], [type=submit], button {
    border: 1px solid #1a318c;
    color: #f6f6f6;
}
/* ── نرخ روز ارز (داشبورد) ──────────────────────────── */
.om-exchange-rates-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
}
.om-rate-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    background: var(--om-card);
    border: 1px solid var(--om-border);
    border-radius: var(--om-radius);
    padding: 16px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    position: relative;
    overflow: hidden;
}
.om-rate-item::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 4px;
    height: 100%;
    background: var(--om-primary);
    border-radius: 0 var(--om-radius) var(--om-radius) 0;
}
.om-rate-item:last-child::before { background: #f59e0b; }
.om-rate-flag { font-size: 24px; }
.om-rate-label {
    font-size: 12px;
    color: var(--om-text-muted);
    white-space: nowrap;
}
.om-rate-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--om-primary);
    direction: ltr;
}
.om-rate-item:last-child .om-rate-value { color: #d97706; }
.om-rate-divider { display: none; }
@media (max-width: 480px) {
    .om-exchange-rates-bar { grid-template-columns: 1fr 1fr; gap: 10px; }
    .om-rate-item { padding: 12px 14px; }
    .om-rate-value { font-size: 15px; }
}

/* ── Advantage Package badge (overlay روی تصویر) ─────── */
.om-product-img-wrap {
    position: relative;
    width: 100%;
    flex-shrink: 0;
}
.om-product-img-wrap .om-product-img,
.om-product-img-wrap .om-product-img-placeholder {
    display: block;
    width: 100%;
}
.om-advantage-badge {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.6px;
    padding: 6px 10px;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0,0,0,.3);
    z-index: 2;
    border-radius: var(--om-radius) var(--om-radius) 0 0;
}

/* ── صفحه تنظیمات حساب ──────────────────────────────── */
.om-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 20px;
    align-items: start;
    width: 100%;
}
.om-settings-card {
    width: 100%;
    box-sizing: border-box;
}
.om-settings-card .om-card-header { padding: 14px 18px; }
.om-settings-card .om-form { padding: 14px 18px 18px; }
.om-settings-card .om-field { margin-bottom: 14px; }
.om-settings-card .om-field input {
    width: 100%;
    box-sizing: border-box;
}
.om-settings-card .om-modal-actions { padding-top: 4px; }
