
/* ========================================
   فونت و متغیرهای پایه
   ======================================== */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir.woff2') format('woff2');
    font-display: swap;
}

:root {
    --font-main: 'Vazir', Tahoma, sans-serif;
    
    /* رنگ‌های اصلی */
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-bg: rgba(37, 99, 235, 0.1);
    
    /* رنگ‌های ثانویه */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #06b6d4;
    --info-bg: rgba(6, 182, 212, 0.1);
    
    /* رنگ‌های پس‌زمینه */
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-sidebar-hover: #1e293b;
    --bg-input: #ffffff;
    
    /* رنگ‌های متن */
    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-sidebar: #cbd5e1;
    --text-sidebar-active: #ffffff;
    
    /* رنگ‌های حاشیه */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* سایه‌ها */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* گردی */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* انتقال */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

/* حالت تاریک */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #020617;
    --bg-sidebar-hover: #0f172a;
    --bg-input: #334155;
    --text-main: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --border-light: #1e293b;
}

/* حالت اقیانوسی */
[data-theme="ocean"] {
    --bg-body: #f0f9ff;
    --bg-card: #ffffff;
    --bg-sidebar: #0c4a6e;
    --bg-sidebar-hover: #075985;
    --primary: #0ea5e9;
    --primary-light: #38bdf8;
    --primary-dark: #0284c7;
    --text-main: #0c4a6e;
    --border: #bae6fd;
}

/* حالت جنگلی */
[data-theme="forest"] {
    --bg-body: #f0fdf4;
    --bg-card: #ffffff;
    --bg-sidebar: #14532d;
    --bg-sidebar-hover: #166534;
    --primary: #22c55e;
    --primary-light: #4ade80;
    --primary-dark: #16a34a;
    --text-main: #14532d;
    --border: #bbf7d0;
}

/* حالت غروب */
[data-theme="sunset"] {
    --bg-body: #fff7ed;
    --bg-card: #ffffff;
    --bg-sidebar: #7c2d12;
    --bg-sidebar-hover: #9a3412;
    --primary: #f97316;
    --primary-light: #fb923c;
    --primary-dark: #ea580c;
    --text-main: #7c2d12;
    --border: #fed7aa;
}

/* ========================================
   ریست و استایل‌های پایه
   ======================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* اسکرول‌بار سفارشی */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ========================================
   انیمیشن‌ها
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-in {
    animation: fadeInUp 0.5s ease-out forwards;
}

.animate-fade {
    animation: fadeIn 0.3s ease-out;
}

.animate-slide-right {
    animation: slideInRight 0.3s ease-out;
}

/* ========================================
   لودینگ
   ======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========================================
   کامپوننت‌های عمومی
   ======================================== */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* آیکون‌ها */
.icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    vertical-align: middle;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

.icon-xl {
    width: 32px;
    height: 32px;
}

/* ========================================
   دکمه‌ها
   ======================================== */
.btn {
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--bg-body);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--border);
    color: var(--text-main);
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-warning {
    background-color: var(--warning);
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
}

.btn-edit {
    background-color: var(--info-bg);
    color: var(--info);
}

.btn-edit:hover {
    background-color: var(--info);
    color: white;
}

.btn-delete {
    background-color: var(--danger-bg);
    color: var(--danger);
}

.btn-delete:hover {
    background-color: var(--danger);
    color: white;
}

/* ========================================
   فرم‌ها
   ======================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg-input);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check label {
    margin-bottom: 0;
    cursor: pointer;
}

.form-layout {
    max-width: 700px;
}

.form-inline {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.form-inline input[type="text"] {
    flex: 1;
    min-width: 200px;
}

/* ========================================
   هشدارها
   ======================================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeInDown 0.3s ease-out;
}

.alert-error {
    background-color: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-warning {
    background-color: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background-color: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* ========================================
   بج‌ها
   ======================================== */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success);
}

.badge-danger {
    background-color: var(--danger-bg);
    color: var(--danger);
}

.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.badge-info {
    background-color: var(--info-bg);
    color: var(--info);
}

.badge-primary {
    background-color: var(--primary-bg);
    color: var(--primary);
}

.badge.status-pending {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.badge.status-preparing {
    background-color: var(--info-bg);
    color: var(--info);
}

.badge.status-ready {
    background-color: var(--success-bg);
    color: var(--success);
}

.badge.status-delivered {
    background-color: var(--primary-bg);
    color: var(--primary);
}

.badge.status-cancelled {
    background-color: var(--danger-bg);
    color: var(--danger);
}

/* ========================================
   داشبورد و سایدبار
   ======================================== */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    transition: var(--transition-slow);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-brand {
    padding: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-sidebar-active);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand .icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.sidebar-menu {
    list-style: none;
    flex: 1;
    padding: 1rem 0;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-sidebar);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    border-right: 3px solid transparent;
}

.sidebar-menu a:hover {
    background-color: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}

.sidebar-menu a.active {
    background-color: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
    border-right-color: var(--primary);
}

.sidebar-menu a .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--text-sidebar);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 0.875rem;
}

.sidebar-footer a:hover {
    background-color: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}

.sidebar-footer a:last-child {
    color: var(--danger);
}

.sidebar-footer a:last-child:hover {
    background-color: var(--danger-bg);
}

.main-content {
    flex: 1;
    margin-right: 280px;
    padding: 2rem;
    min-height: 100vh;
}

/* ========================================
   نوار بالا
   ======================================== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.top-bar h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-selector {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-selector:hover {
    border-color: var(--primary);
}

/* ========================================
   کارت‌های آمار داشبورد
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon .icon {
    width: 32px;
    height: 32px;
}

.stat-icon.primary {
    background: var(--primary-bg);
    color: var(--primary);
}

.stat-icon.success {
    background: var(--success-bg);
    color: var(--success);
}

.stat-icon.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-icon.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-icon.info {
    background: var(--info-bg);
    color: var(--info);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-change {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* ========================================
   جداول
   ======================================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.data-table th {
    background-color: var(--bg-body);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.data-table tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background-color: var(--bg-body);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.table-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius);
}

.empty-table {
    text-align: center;
    padding: 3rem !important;
    color: var(--text-muted);
}

/* ========================================
   تنظیمات
   ======================================== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.settings-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
    display: block;
    box-shadow: var(--shadow);
}

.settings-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.settings-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.settings-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background-color: var(--primary-bg);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.settings-icon .icon {
    width: 32px;
    height: 32px;
}

.settings-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.settings-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ========================================
   سوئیچ toggle
   ======================================== */
.feature-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background-color: var(--bg-body);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.feature-toggle:hover {
    border-color: var(--primary);
}

.feature-info h3 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
    font-weight: 600;
}

.feature-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.3s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* ========================================
   دیکشنری
   ======================================== */
.dictionary-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.dictionary-item {
    background-color: var(--bg-body);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.dictionary-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.dictionary-item .key-name {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-family: monospace;
}

.dictionary-item input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-size: 0.875rem;
}

/* ========================================
   ماژول‌ها
   ======================================== */
.modules-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.module-item {
    background-color: var(--bg-body);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
}

.module-info h3 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
    font-weight: 600;
}

.module-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.module-toggles {
    display: flex;
    gap: 2rem;
}

.toggle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.toggle-item span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   صفحه ورود و نصب
   ======================================== */
.login-wrapper,
.auth-wrapper,
.install-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg-body) 0%, var(--border) 100%);
}

.login-card,
.auth-card,
.install-card {
    width: 100%;
    max-width: 420px;
    text-align: center;
    animation: fadeInUp 0.5s ease-out;
}

.login-header,
.auth-header,
.install-header {
    margin-bottom: 2rem;
}

.login-header img,
.auth-header img,
.install-header img {
    max-width: 100px;
    margin-bottom: 1rem;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

.footer-branding {
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-branding a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* ========================================
   منوی عمومی (مشتری)
   ======================================== */
.public-menu-body {
    padding-bottom: 2rem;
}

.public-header {
    background-color: var(--bg-card);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
}

.public-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-box {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 9999px;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.875rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.cart-btn {
    position: relative;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
}

.cart-btn:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--danger);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.public-main {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ========================================
   استوری‌ها
   ======================================== */
.stories-section {
    margin-bottom: 2rem;
}

.stories-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: none;
}

.stories-container::-webkit-scrollbar {
    display: none;
}

.story-item {
    flex-shrink: 0;
    width: 80px;
    text-align: center;
    cursor: pointer;
}

.story-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    padding: 3px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.story-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.story-title {
    font-size: 0.75rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   بنرها
   ======================================== */
.banners-section {
    margin-bottom: 2rem;
}

.banners-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}

.banners-container::-webkit-scrollbar {
    display: none;
}

.banner-item {
    flex-shrink: 0;
    width: 100%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    scroll-snap-align: center;
}

.banner-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* ========================================
   دسته‌بندی‌ها و محصولات
   ======================================== */
.category-section {
    margin-bottom: 2.5rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.category-title {
    font-size: 1.375rem;
    font-weight: 700;
    padding-right: 0.75rem;
    border-right: 4px solid var(--primary);
}

.category-view-all {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
}

.products-scroll-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0 1rem;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.products-scroll-container::-webkit-scrollbar {
    display: none;
}

.product-card {
    flex-shrink: 0;
    width: 220px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.product-info {
    padding: 1rem;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.product-view-more {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
}

.product-card .btn {
    width: calc(100% - 2rem);
    margin: 0 1rem 1rem;
}

.catalog-notice {
    background-color: var(--warning-bg);
    color: var(--warning);
    padding: 1rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* ========================================
   جزئیات محصول
   ======================================== */
.product-detail-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .product-detail-card {
        grid-template-columns: 1fr;
    }
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.product-thumbnails {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.product-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.product-thumbnail:hover {
    border-color: var(--primary);
}

.product-video video {
    width: 100%;
    border-radius: var(--radius-lg);
}

.product-detail-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.product-price-lg {
    font-size: 2rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.product-description {
    margin-bottom: 2rem;
    line-height: 1.8;
}

.product-description h3 {
    margin-bottom: 0.5rem;
}

/* ========================================
   نظرات
   ======================================== */
.reviews-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.reviews-section h3 {
    margin-bottom: 1.5rem;
}

.no-reviews {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-item {
    background-color: var(--bg-body);
    border-radius: var(--radius);
    padding: 1rem;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.review-text {
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.review-media {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}

.review-media-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius);
}

.review-media-video {
    width: 200px;
    height: 150px;
    border-radius: var(--radius);
}

.review-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.star {
    font-size: 1.25rem;
    color: var(--border);
}

.star.filled {
    color: #fbbf24;
}

.verified-badge {
    display: inline-block;
    background-color: var(--success-bg);
    color: var(--success);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.add-review-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.add-review-section h4 {
    margin-bottom: 1rem;
}

.review-form {
    background-color: var(--bg-body);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
}

.review-notice {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--bg-body);
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--text-muted);
}

.review-notice .btn {
    margin-top: 1rem;
    width: auto;
    display: inline-block;
}

.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.5rem;
}

.rating-input input[type="radio"] {
    display: none;
}

.star-label {
    font-size: 2rem;
    color: var(--border);
    cursor: pointer;
    transition: color 0.2s;
}

.rating-input input[type="radio"]:checked ~ .star-label,
.star-label:hover,
.star-label:hover ~ .star-label {
    color: #fbbf24;
}

/* ========================================
   سبد خرید
   ======================================== */
.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cart-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.cart-item-details {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.cart-item-total {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.125rem;
}

.cart-summary {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 1.25rem;
}

.cart-actions {
    display: flex;
    gap: 1rem;
}

.cart-actions .btn {
    flex: 1;
}

/* ========================================
   تسویه حساب
   ======================================== */
.checkout-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
}

.checkout-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border);
}

.checkout-total {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--border);
    font-size: 1.25rem;
    color: var(--primary);
}

/* ========================================
   موفقیت
   ======================================== */
.success-card {
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
    padding: 3rem 2rem;
}

.success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background-color: var(--success-bg);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-code {
    font-size: 1.25rem;
    margin: 1rem 0 2rem;
    color: var(--text-muted);
}

.order-code strong {
    color: var(--primary);
    font-size: 1.5rem;
}

.order-details {
    background-color: var(--bg-body);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: right;
}

.order-details h3 {
    margin-bottom: 1rem;
}

.order-item,
.order-total {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border);
}

.order-total {
    border-bottom: none;
    border-top: 2px solid var(--border);
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-size: 1.25rem;
    color: var(--primary);
}

.success-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.success-actions .btn {
    width: 100%;
}

.account-info {
    background-color: var(--bg-body);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: right;
    font-size: 0.875rem;
    line-height: 1.8;
}

.account-info strong {
    color: var(--primary);
}

.account-info a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.account-info a:hover {
    text-decoration: underline;
}

/* ========================================
   پنل سفارشات
   ======================================== */
.order-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .order-detail-grid {
        grid-template-columns: 1fr;
    }
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child {
    border-bottom: none;
}

.status-form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.status-select {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-main);
}

.total-row td {
    background-color: var(--bg-body);
    font-size: 1rem;
    font-weight: 600;
}

/* ========================================
   پیام‌ها
   ======================================== */
.messages-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.message-item {
    background-color: var(--bg-body);
    border-radius: var(--radius-lg);
    padding: 1rem;
    border-right: 4px solid var(--primary);
}

.message-item.customer-msg {
    border-right-color: var(--primary);
}

.message-item.admin-msg {
    border-right-color: var(--success);
    background-color: var(--success-bg);
}

.message-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.message-type {
    background-color: var(--primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.message-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-right: auto;
}

.message-text {
    font-size: 0.9375rem;
    line-height: 1.6;
}

.message-resolved {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--success);
    font-weight: 600;
}

.message-locked {
    background-color: var(--warning-bg);
    color: var(--warning);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 1rem;
}

.message-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-main);
    resize: vertical;
}

.admin-messages-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-message-item {
    background-color: var(--bg-body);
    border-radius: var(--radius);
    padding: 1rem;
    border-right: 4px solid var(--primary);
}

.admin-message-item.from-admin {
    border-right-color: var(--success);
    background-color: var(--success-bg);
}

.message-type-badge {
    background-color: var(--primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.admin-reply-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-main);
    resize: vertical;
}

/* ========================================
   آپلود فایل
   ======================================== */
.upload-section {
    background-color: var(--bg-body);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.upload-label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.upload-label:first-child {
    margin-top: 0;
}

.current-media {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.current-media label {
    display: block;
    margin-top: 0.5rem;
    cursor: pointer;
}

.current-gallery {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.gallery-item {
    background-color: var(--bg-card);
    padding: 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
}

.gallery-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.gallery-item label {
    display: block;
    font-size: 0.75rem;
    cursor: pointer;
}

/* ========================================
   مدیا در پنل ادمین
   ======================================== */
.admin-review-media {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-media-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid var(--border);
    transition: var(--transition);
}

.admin-media-thumb:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.media-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.media-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.media-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.media-modal-close:hover {
    color: var(--primary);
}

.media-modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.media-modal-video {
    max-width: 100%;
    max-height: 90vh;
}

/* ========================================
   Toast
   ======================================== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    font-weight: 600;
    font-size: 0.875rem;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background-color: var(--danger);
}

/* ========================================
   سفارشات من (مشتری)
   ======================================== */
.my-orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.my-order-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
    display: block;
}

.my-order-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.my-order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.my-order-header h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.my-order-date {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.my-order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-weight: 600;
}

.view-details {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
}

.order-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.badge-lg {
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

.order-info-section,
.order-items-section {
    margin-bottom: 2rem;
}

.order-info-section h3,
.order-items-section h3 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.item-quantity {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.order-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--border);
    font-size: 1.25rem;
    color: var(--primary);
}

/* ========================================
   پروفایل مشتری
   ======================================== */
.profile-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    text-align: center;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: white;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.profile-name {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.profile-phone {
    font-size: 1rem;
    opacity: 0.9;
}

.wallet-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.wallet-balance {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.wallet-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.profile-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-menu-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
}

.profile-menu-item:hover {
    border-color: var(--primary);
    transform: translateX(-4px);
}

.profile-menu-item .icon {
    color: var(--primary);
}

/* ========================================
   منوی تابلویی (TV)
   ======================================== */
.tv-menu-body {
    background-color: var(--bg-body);
    color: var(--text-main);
    padding: 2rem;
    min-height: 100vh;
}

.tv-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius-lg);
}

.tv-header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.tv-header p {
    font-size: 1.5rem;
    opacity: 0.9;
}

.tv-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.tv-category {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.tv-category-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary);
    color: var(--primary);
}

.tv-products {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tv-product {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-body);
    border-radius: var(--radius);
    transition: var(--transition);
}

.tv-product:hover {
    transform: scale(1.02);
}

.tv-product-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.tv-product-info {
    flex: 1;
}

.tv-product-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tv-product-description {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.tv-product-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

/* ========================================
   ریسپانسیو
   ======================================== */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-right: 240px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-right: 0;
        padding: 1rem;
    }
    
    .top-bar {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .dictionary-list {
        grid-template-columns: 1fr;
    }
    
    .product-detail-card {
        grid-template-columns: 1fr;
    }
    
    .checkout-layout {
        grid-template-columns: 1fr;
    }
    
    .order-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .cart-actions {
        flex-direction: column;
    }
    
    .tv-categories {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   چاپ
   ======================================== */
@media print {
    .sidebar,
    .top-bar,
    .btn {
        display: none;
    }
    
    .main-content {
        margin-right: 0;
    }
}

/* ========================================
صفحه لودینگ با لوگوی سایت
======================================== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--app-bg, #f8fafc);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-logo {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--app-primary, #2563eb) 0%, var(--app-primary-light, #3b82f6) 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 1.5rem;
    animation: logoPulse 1.5s ease-in-out infinite;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
    overflow: hidden;
    padding: 15px;
}

.loader-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 12px 32px rgba(37, 99, 235, 0.5);
    }
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--app-border, #e2e8f0);
    border-top-color: var(--app-primary, #2563eb);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

.loader-text {
    font-size: 0.9rem;
    color: var(--app-text-muted, #64748b);
    font-weight: 600;
    animation: fadeInOut 1.5s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

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

/* پشتیبانی از دارک مود */
[data-theme="dark"] .page-loader {
    background: var(--app-bg, #0f172a);
}

[data-theme="dark"] .loader-spinner {
    border-color: var(--app-border, #334155);
}

[data-theme="dark"] .loader-text {
    color: var(--app-text-muted, #94a3b8);
}
.sidebar-orders-badge {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    animation: pulse 2s infinite;
}