/* ============================================================
   ParsaKart Portal — Main Stylesheet
   Version: 1.1.0
   Theme: Dark + Gold
   ============================================================ */

/* ============ متغیرها ============ */
:root {
    /* رنگ‌ها */
    --bg:        #0a0a0a;
    --bg-2:      #0d0d0d;
    --surface:   #141414;
    --surface-2: #1c1c1c;
    --surface-3: #232323;
    --border:    #262626;
    --border-2:  #333;
    --border-3:  #404040;

    --gold:       #d4af37;
    --gold-lite:  #f5d76e;
    --gold-dark:  #8b6f1e;
    --gold-soft:  rgba(212, 175, 55, .12);

    --text:      #e8e8e8;
    --text-2:    #b8b8b8;
    --muted:     #8a8a8a;
    --muted-2:   #5a5a5a;

    --danger:    #ef4444;
    --success:   #22c55e;
    --warning:   #f59e0b;
    --info:      #3b82f6;

    /* ابعاد */
    --sidebar-w: 260px;
    --topbar-h:  68px;
    --radius:    12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    /* انیمیشن */
    --t-fast: .15s;
    --t:      .25s;
    --t-slow: .4s;
    --ease:   cubic-bezier(.4, 0, .2, 1);

    /* سایه */
    --shadow-sm: 0 2px 8px rgba(0,0,0,.25);
    --shadow:    0 6px 24px rgba(0,0,0,.35);
    --shadow-lg: 0 20px 60px rgba(0,0,0,.5);
    --shadow-gold: 0 8px 30px rgba(212,175,55,.25);
}

/* ============ ریست ============ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--t);
}

a:hover { color: var(--gold-lite); }

img, svg, video { max-width: 100%; display: block; }

button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

ul, ol { list-style: none; }

/* ============ اسکرول‌بار سفارشی ============ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb {
    background: var(--border-2);
    border-radius: 10px;
    border: 2px solid var(--bg-2);
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* ============ سایدبار ============ */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #111 0%, #0d0d0d 100%);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    z-index: 100;
    transition: transform var(--t-slow) var(--ease);
    overflow-y: auto;
    overflow-x: hidden;
}

/* برند */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    flex-shrink: 0;
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gold-lite), var(--gold-dark));
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.3rem;
    box-shadow: var(--shadow-gold);
    flex-shrink: 0;
}

.brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    line-height: 1.3;
}

.brand-sub {
    font-size: .75rem;
    color: var(--muted);
    line-height: 1.3;
}

/* ناوبری */
.nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: .93rem;
    font-weight: 500;
    transition: all var(--t) var(--ease);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--gold-soft), transparent);
    opacity: 0;
    transition: opacity var(--t);
    z-index: -1;
}

.nav-item:hover {
    background: var(--surface-2);
    color: var(--text);
}

.nav-item:hover .ico { transform: scale(1.15); }

.nav-item.active {
    background: linear-gradient(135deg, rgba(212,175,55,.14), rgba(212,175,55,.06));
    color: var(--gold-lite);
    font-weight: 600;
    border: 1px solid rgba(212,175,55,.25);
}

.nav-item.active::before { opacity: 1; }

.nav-item .ico {
    font-size: 1.15rem;
    line-height: 1;
    transition: transform var(--t) var(--ease);
    flex-shrink: 0;
}

/* فوتر سایدبار */
.sidebar-foot {
    border-top: 1px solid var(--border);
    padding-top: 18px;
    margin-top: 18px;
    flex-shrink: 0;
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-lite), var(--gold-dark));
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .95rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(212,175,55,.2);
}

.user-meta {
    min-width: 0;
    flex: 1;
}

.user-name {
    font-size: .88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-phone {
    font-size: .72rem;
    color: var(--muted);
    direction: ltr;
    text-align: right;
}

.logout-btn {
    display: block;
    text-align: center;
    padding: 9px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 10px;
    color: var(--muted);
    font-size: .85rem;
    transition: all var(--t);
    cursor: pointer;
}

.logout-btn:hover {
    background: rgba(239,68,68,.12);
    color: var(--danger);
    border-color: rgba(239,68,68,.3);
}

/* ============ تاپ‌بار ============ */
.topbar {
    position: fixed;
    top: 0;
    right: var(--sidebar-w);
    left: 0;
    height: var(--topbar-h);
    background: rgba(10, 10, 10, .85);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 90;
    transition: right var(--t-slow) var(--ease);
}

.page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    border-radius: 8px;
    transition: background var(--t);
}

.hamburger:hover { background: var(--surface-2); }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    transition: all var(--t);
    font-size: 1.05rem;
    cursor: pointer;
    position: relative;
}

.icon-btn:hover {
    background: var(--border-2);
    transform: translateY(-2px);
    border-color: var(--gold-dark);
}

.icon-btn .dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    border: 2px solid var(--surface-2);
}

/* ============ محتوا ============ */
.content {
    margin-right: var(--sidebar-w);
    padding: calc(var(--topbar-h) + 24px) 28px 60px;
    min-height: 100vh;
    transition: margin var(--t-slow) var(--ease);
    animation: contentFade .35s var(--ease);
}

@keyframes contentFade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ============ گرید ============ */
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* ============ کارت ============ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    transition: all var(--t) var(--ease);
    position: relative;
}

.card:hover {
    border-color: var(--border-2);
    transform: translateY(-2px);
}

.card-title {
    font-size: .92rem;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.card-value {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--gold-lite);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.card-sub {
    font-size: .78rem;
    color: var(--muted);
    margin-top: 4px;
}

/* ============ دکمه‌ها ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: .93rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--t) var(--ease);
    white-space: nowrap;
    line-height: 1.4;
    text-align: center;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-lite), var(--gold-dark));
    color: #111;
    box-shadow: 0 4px 20px rgba(212,175,55,.25);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(212,175,55,.35);
    color: #111;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-ghost {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border-2);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--border);
    border-color: var(--border-3);
    color: var(--text);
}

.btn-danger {
    background: rgba(239,68,68,.12);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,.3);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239,68,68,.2);
}

.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-lg { padding: 15px 30px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ============ فرم‌ها ============ */
.field { margin-bottom: 18px; }

.field label {
    display: block;
    font-size: .86rem;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 13px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: .98rem;
    outline: none;
    transition: all var(--t);
    direction: ltr;
    text-align: center;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,.12);
    background: var(--surface);
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--muted-2);
}

.field input[style*="rtl"],
.field textarea[style*="rtl"] {
    direction: rtl;
    text-align: right;
}

.field textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.7;
}

.field-hint {
    font-size: .78rem;
    color: var(--muted);
    margin-top: 6px;
}

/* ورودی OTP */
.otp-input {
    letter-spacing: 14px;
    font-size: 1.7rem !important;
    font-weight: 800;
    padding-left: 6px !important;
    text-align: center;
    direction: ltr;
    font-variant-numeric: tabular-nums;
}

/* ============ هشدارها ============ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: .9rem;
    margin-bottom: 18px;
    line-height: 1.7;
    animation: alertIn .3s var(--ease);
}

@keyframes alertIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

.alert-danger {
    background: rgba(239,68,68,.1);
    border: 1px solid rgba(239,68,68,.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34,197,94,.1);
    border: 1px solid rgba(34,197,94,.3);
    color: #86efac;
}

.alert-info {
    background: rgba(212,175,55,.08);
    border: 1px solid rgba(212,175,55,.25);
    color: var(--gold-lite);
}

.alert-warning {
    background: rgba(245,158,11,.1);
    border: 1px solid rgba(245,158,11,.3);
    color: #fcd34d;
}

.alert a {
    text-decoration: underline;
    font-weight: 600;
}

/* ============ Badge ============ */
.badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.5;
}

.badge.ok {
    background: rgba(34,197,94,.12);
    color: #86efac;
    border: 1px solid rgba(34,197,94,.3);
}

.badge.warn {
    background: rgba(245,158,11,.12);
    color: #fcd34d;
    border: 1px solid rgba(245,158,11,.3);
}

.badge.danger {
    background: rgba(239,68,68,.12);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,.3);
}

.badge.info {
    background: rgba(212,175,55,.12);
    color: var(--gold-lite);
    border: 1px solid rgba(212,175,55,.3);
}

.badge.muted {
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--border-2);
}

/* ============ صفحه‌های Auth ============ */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at 20% 10%, rgba(212,175,55,.07), transparent 45%),
        radial-gradient(circle at 80% 90%, rgba(212,175,55,.05), transparent 45%),
        var(--bg);
    position: relative;
    overflow: hidden;
}

.auth-wrap::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212,175,55,.06), transparent 70%);
    pointer-events: none;
    animation: floatBg 12s ease-in-out infinite;
}

@keyframes floatBg {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(-40px, 40px); }
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 42px 34px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    animation: authIn .5s var(--ease);
}

@keyframes authIn {
    from { opacity: 0; transform: translateY(20px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.auth-logo {
    width: 68px;
    height: 68px;
    margin: 0 auto 22px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--gold-lite), var(--gold-dark));
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.9rem;
    box-shadow: var(--shadow-gold);
}

.auth-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text);
}

.auth-sub {
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 28px;
    line-height: 1.7;
}

/* ============ Toast ============ */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text);
    padding: 13px 22px;
    border-radius: var(--radius);
    font-size: .9rem;
    opacity: 0;
    transition: all .35s var(--ease);
    z-index: 9999;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: rgba(34,197,94,.4);
    color: #86efac;
}

.toast.error {
    border-color: rgba(239,68,68,.4);
    color: #fca5a5;
}

/* ============ Empty State ============ */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 14px;
    opacity: .5;
    display: block;
}

.empty-title {
    font-size: 1.15rem;
    color: var(--text);
    margin-bottom: 8px;
    font-weight: 700;
}

.empty p {
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.8;
    max-width: 400px;
    margin: 0 auto;
}

/* ============ Product Card ============ */
.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    position: relative;
    transition: all var(--t) var(--ease);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--gold-dark);
    transform: translateY(-6px);
    box-shadow: var(--shadow);
}

.product-card.popular {
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
    background: linear-gradient(180deg, rgba(212,175,55,.04), var(--surface) 30%);
}

.product-card.popular:hover {
    box-shadow: 0 14px 50px rgba(212,175,55,.25);
    transform: translateY(-6px);
}

.product-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    background: linear-gradient(135deg, var(--gold-lite), var(--gold-dark));
    color: #111;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 700;
    box-shadow: var(--shadow-gold);
}

.product-icon {
    font-size: 2.6rem;
    margin-bottom: 12px;
    line-height: 1;
}

.product-name {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text);
}

.product-desc {
    color: var(--muted);
    font-size: .88rem;
    margin-bottom: 18px;
    line-height: 1.7;
}

.product-price {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--gold-lite);
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.product-old {
    font-size: .9rem;
    color: var(--muted);
    text-decoration: line-through;
    margin-bottom: 10px;
    font-variant-numeric: tabular-nums;
}

.product-features {
    list-style: none;
    padding: 0;
    margin: 18px 0 22px;
    font-size: .9rem;
    line-height: 2.1;
    flex: 1;
    color: var(--text-2);
}

.product-features li {
    padding-right: 0;
    position: relative;
}

.product-features li::before {
    content: '✓';
    color: var(--gold-lite);
    font-weight: 700;
    margin-left: 8px;
    display: inline-block;
}

/* ============ Progress Bar ============ */
.progress-bar {
    height: 8px;
    background: var(--surface-2);
    border-radius: 20px;
    overflow: hidden;
    margin: 10px 0;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-lite));
    border-radius: 20px;
    transition: width .8s var(--ease);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

/* ============ Steps ============ */
.step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 15px;
    top: calc(50% + 18px);
    bottom: -14px;
    width: 2px;
    background: var(--border);
    z-index: 0;
}

.step.done:not(:last-child)::after {
    background: linear-gradient(180deg, var(--gold), var(--gold-dark));
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 2px solid var(--border-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 700;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    color: var(--muted);
    transition: all var(--t);
}

.step.done .step-dot {
    background: linear-gradient(135deg, var(--gold-lite), var(--gold-dark));
    color: #111;
    border-color: var(--gold);
}

.step.active .step-dot {
    background: var(--gold);
    color: #111;
    border-color: var(--gold-lite);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,.4); }
    50%      { box-shadow: 0 0 0 10px rgba(212,175,55,0); }
}

/* ============ Chat ============ */
.chat-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.chat-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 220px);
    min-height: 400px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.chat-input {
    display: flex;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border-2);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: .95rem;
    outline: none;
    direction: rtl;
    text-align: right;
    transition: all var(--t);
}

.chat-input input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,.1);
}

.msg {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: .92rem;
    line-height: 1.7;
    word-break: break-word;
    animation: fadeIn .25s var(--ease);
    position: relative;
}

.msg.me {
    align-self: flex-start;
    background: linear-gradient(135deg, var(--gold-lite), var(--gold-dark));
    color: #111;
    border-bottom-right-radius: 4px;
}

.msg.them {
    align-self: flex-end;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.msg .time {
    display: block;
    font-size: .7rem;
    opacity: .65;
    margin-top: 5px;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* ============ ابزارهای کمکی ============ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }
.text-muted  { color: var(--muted); }
.text-gold   { color: var(--gold-lite); }
.text-danger { color: #fca5a5; }
.text-success{ color: #86efac; }

.mt-0  { margin-top: 0; }
.mt-1  { margin-top: 8px; }
.mt-2  { margin-top: 16px; }
.mt-3  { margin-top: 24px; }
.mt-4  { margin-top: 32px; }
.mb-0  { margin-bottom: 0; }
.mb-1  { margin-bottom: 8px; }
.mb-2  { margin-bottom: 16px; }
.mb-3  { margin-bottom: 24px; }

.flex     { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }

.w-100 { width: 100%; }
.hidden { display: none; }

/* ============ ریسپانسیو ============ */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(100%);
        box-shadow: -10px 0 40px rgba(0,0,0,.6);
    }

    .sidebar.open { transform: translateX(0); }

    .topbar {
        right: 0;
        padding: 0 16px;
    }

    .hamburger { display: block; }

    .content {
        margin-right: 0;
        padding: calc(var(--topbar-h) + 20px) 16px 40px;
    }

    .page-title { font-size: 1rem; }

    .card { padding: 18px; }
    .card-value { font-size: 1.6rem; }

    .grid { gap: 14px; }

    .chat-box { height: calc(100vh - 180px); }

    .auth-card { padding: 32px 24px; }
    .auth-title { font-size: 1.3rem; }

    .product-card { padding: 22px 18px; }
    .product-price { font-size: 1.4rem; }
}

@media (max-width: 500px) {
    :root {
        --topbar-h: 60px;
    }

    .content { padding: calc(var(--topbar-h) + 16px) 12px 32px; }

    .card { padding: 16px; border-radius: 14px; }

    .grid-4, .grid-3, .grid-2 {
        grid-template-columns: 1fr;
    }

    .card-value { font-size: 1.45rem; }

    .page-title { font-size: .95rem; }

    .icon-btn { width: 36px; height: 36px; font-size: .95rem; }

    .btn { padding: 11px 18px; font-size: .88rem; }
    .btn-lg { padding: 13px 24px; font-size: .95rem; }

    .chat-input { padding: 10px; gap: 8px; }
    .chat-input input { padding: 10px 12px; font-size: .9rem; }
    .chat-input .btn { padding: 10px 14px; font-size: .85rem; }

    .msg { max-width: 85%; }

    .auth-card { padding: 28px 20px; }
    .auth-logo { width: 58px; height: 58px; font-size: 1.6rem; }

    .otp-input { font-size: 1.4rem !important; letter-spacing: 10px; }
}

/* ============ حالت چاپ ============ */
@media print {
    .sidebar, .topbar, .logout-btn, .icon-btn, .btn { display: none !important; }
    .content { margin: 0; padding: 20px; }
    body { background: #fff; color: #000; }
    .card { border: 1px solid #ccc; }
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}