/* ============================================================
   نرم‌افزار حسابداری بوتیک لباس - استایل اصلی
   ============================================================ */

:root {
    /* رنگ‌های اصلی */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;

    /* رنگ‌های سایدبار */
    --sidebar-bg: #0f172a;
    --sidebar-bg-gradient: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    --sidebar-hover: rgba(99, 102, 241, 0.12);
    --sidebar-active: rgba(99, 102, 241, 0.18);
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #e2e8f0;
    --sidebar-text-active: #ffffff;
    --sidebar-border: rgba(148, 163, 184, 0.1);
    --sidebar-width: 280px;
    --sidebar-collapsed: 78px;

    /* رنگ‌های محتوا */
    --main-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;

    /* سایه‌ها */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);

    /* شعاع گوشه‌ها */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
}

/* ============================================================
   تنظیمات پایه
   ============================================================ */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--main-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    font-size: 0.9rem;
}

/* اسکرول‌بار سفارشی */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================================
   ساختار اصلی Layout
   ============================================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ============================================================
   سایدبار (سمت راست)
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg-gradient);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border-left: 1px solid rgba(148, 163, 184, 0.08);
}

/* برند / لوگو */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1.5rem 1.25rem;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-title {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    letter-spacing: -0.3px;
}

.brand-subtitle {
    font-size: 0.7rem;
    color: var(--sidebar-text);
    margin-top: 2px;
}

/* بدنه سایدبار (منو) */
.sidebar-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0.85rem 1rem;
}

.sidebar-body::-webkit-scrollbar {
    width: 4px;
}
.sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
}

/* عنوان بخش */
.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    padding: 0.85rem 0.85rem 0.4rem;
    margin-top: 0.5rem;
    opacity: 0.9;
}

.nav-section-title:first-child {
    margin-top: 0;
}

/* لیست منو */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav .nav-item {
    width: 100%;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.85rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-hover);
}

.sidebar-nav .nav-link:hover .nav-icon {
    color: var(--primary-light);
    transform: scale(1.05);
}

/* آیکون */
.nav-icon {
    font-size: 1.15rem;
    width: 24px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.2s, transform 0.2s;
}

.nav-text {
    flex: 1;
    transition: opacity 0.2s;
}

/* حالت فعال */
.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    font-weight: 600;
}

.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    right: -0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    background: var(--primary);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
}

.sidebar-nav .nav-link.active .nav-icon {
    color: var(--primary-light);
}

/* نشان (Badge) */
.nav-badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    min-width: 22px;
    text-align: center;
    line-height: 1.4;
}

.nav-badge.danger {
    background: #ef4444;
}

.nav-badge.success {
    background: #10b981;
}

/* فلش زیرمنو */
.nav-arrow {
    font-size: 0.7rem;
    color: #64748b;
    transition: transform 0.25s ease;
    margin-right: auto;
}

.sidebar-nav .nav-link[aria-expanded="true"] .nav-arrow {
    transform: rotate(180deg);
}

/* زیرمنو */
.submenu {
    list-style: none;
    padding: 0.25rem 0 0.25rem 0;
    margin: 0.15rem 0 0.4rem 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.submenu .nav-link {
    padding: 0.5rem 0.85rem 0.5rem 2.5rem;
    font-size: 0.82rem;
    font-weight: 400;
    color: #94a3b8;
    border-radius: var(--radius-sm);
}

.submenu .nav-link::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #475569;
    margin-left: 0.65rem;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.submenu .nav-link:hover::before,
.submenu .nav-link.active::before {
    background: var(--primary-light);
    transform: scale(1.4);
}

.submenu .nav-link.active {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

/* ============================================================
   بخش پروفایل کاربر در پایین سایدبار
   ============================================================ */
.sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    padding: 0.9rem;
    flex-shrink: 0;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.7rem;
    border-radius: var(--radius-md);
    background: rgba(148, 163, 184, 0.06);
    transition: background 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.user-card:hover {
    background: rgba(148, 163, 184, 0.12);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.user-info {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.user-name {
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    color: var(--sidebar-text);
    font-size: 0.7rem;
}

.user-more {
    color: #64748b;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.user-card:hover .user-more {
    color: var(--primary-light);
}

/* ============================================================
   ناحیه محتوای اصلی
   ============================================================ */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--main-bg);
}

/* نوار بالا */
.topbar {
    background: #fff;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--shadow-sm);
}

.topbar-right,
.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.topbar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.topbar-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

.sidebar-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.15rem;
}

.sidebar-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-size: 1.05rem;
}

.icon-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.icon-btn .badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #fff;
}

.date-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: #f1f5f9;
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* محتوای صفحه */
.page-content {
    padding: 1.5rem;
    flex: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    color: var(--text-primary);
}

.page-header p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ============================================================
   کارت‌های آماری
   ============================================================ */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.25s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-color, var(--primary));
    opacity: 0;
    transition: opacity 0.25s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.85rem;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.stat-change {
    font-size: 0.72rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.5rem;
}

.stat-change.up {
    color: #10b981;
}

.stat-change.down {
    color: #ef4444;
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.stat-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-icon.info {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}

/* ============================================================
   کارت‌های عمومی
   ============================================================ */
.card-modern {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-modern .card-header-modern {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.card-modern .card-header-modern h6 {
    margin: 0;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.card-modern .card-body-modern {
    padding: 1.25rem;
    flex: 1;
}

/* جدول مدرن */
.table-modern {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 0.83rem;
}

.table-modern thead th {
    background: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table-modern tbody td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-primary);
    vertical-align: middle;
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

.table-modern tbody tr:hover {
    background: #f8fafc;
}

/* نشان وضعیت */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.status-badge.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.status-badge.info {
    background: rgba(14, 165, 233, 0.1);
    color: #0284c7;
}

/* دکمه‌ها */
.btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 0.83rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.btn-modern.primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-modern.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    color: #fff;
}

.btn-modern.ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-modern.ghost:hover {
    background: #f1f5f9;
    color: var(--primary);
    border-color: var(--primary);
}

/* لیست اقدامات سریع */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.quick-action-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #fff;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.83rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.quick-action-item:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.04);
    transform: translateX(-3px);
    color: var(--primary);
}

.quick-action-item .qa-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.quick-action-item .qa-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.quick-action-item .qa-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.quick-action-item .qa-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.quick-action-item .qa-icon.info {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}

/* لیست هشدار موجودی */
.stock-alert-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stock-alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    gap: 0.75rem;
}

.stock-alert-item:last-child {
    border-bottom: none;
}

.stock-alert-info {
    min-width: 0;
    flex: 1;
}

.stock-alert-title {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stock-alert-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin: 0;
}

.stock-alert-count {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.stock-alert-count.low {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.stock-alert-count.critical {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

/* ============================================================
   حالت جمع‌شونده سایدبار (فقط دسکتاپ)
   ============================================================ */
@media (min-width: 992px) {
    body.sidebar-collapsed .sidebar {
        width: var(--sidebar-collapsed);
    }

    body.sidebar-collapsed .main-content {
        margin-right: var(--sidebar-collapsed);
    }

    body.sidebar-collapsed .brand-text,
    body.sidebar-collapsed .nav-text,
    body.sidebar-collapsed .nav-section-title,
    body.sidebar-collapsed .nav-badge,
    body.sidebar-collapsed .nav-arrow,
    body.sidebar-collapsed .user-info,
    body.sidebar-collapsed .user-more,
    body.sidebar-collapsed .submenu {
        display: none !important;
    }

    body.sidebar-collapsed .sidebar-brand {
        justify-content: center;
        padding: 1.5rem 0.5rem 1.25rem;
    }

    body.sidebar-collapsed .sidebar-nav .nav-link {
        justify-content: center;
        padding: 0.7rem 0.5rem;
    }

    body.sidebar-collapsed .sidebar-nav .nav-link.active::before {
        right: -0.5rem;
    }

    body.sidebar-collapsed .user-card {
        justify-content: center;
        padding: 0.5rem;
    }
}

/* ============================================================
   موبایل - سایدبار به صورت کشویی
   ============================================================ */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1035;
    opacity: 0;
    transition: opacity 0.3s;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(100%);
        box-shadow: -10px 0 30px rgba(15, 23, 42, 0.15);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
        opacity: 1;
    }

    .main-content {
        margin-right: 0;
    }

    .page-content {
        padding: 1rem;
    }

    .topbar {
        padding: 0.75rem 1rem;
    }

    .topbar-subtitle {
        display: none;
    }

    .date-chip {
        display: none;
    }
}

/* ============================================================
   کلاس‌های کمکی
   ============================================================ */
.text-muted-sm {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.mb-0 { margin-bottom: 0 !important; }

/* انیمیشن ورود کارت‌ها */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.4s ease both;
}

.fade-in-up:nth-child(1) { animation-delay: 0.05s; }
.fade-in-up:nth-child(2) { animation-delay: 0.1s; }
.fade-in-up:nth-child(3) { animation-delay: 0.15s; }
.fade-in-up:nth-child(4) { animation-delay: 0.2s; }


/* ============================================================
   صفحه ثبت فروش جدید
   ============================================================ */

/* گرید اصلی صفحه فروش */
.sale-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 1199.98px) {
    .sale-layout {
        grid-template-columns: 1fr;
    }
}

/* ستون خلاصه چسبان */
.sale-summary-col {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* فرم‌های مدرن */
.form-group-modern {
    margin-bottom: 1rem;
}

.form-label-modern {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.form-label-modern .required {
    color: #ef4444;
    margin-right: 2px;
}

.form-control-modern,
.form-select-modern {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: #fff;
    transition: all 0.2s;
    outline: none;
}

.form-control-modern:focus,
.form-select-modern:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control-modern::placeholder {
    color: #94a3b8;
}

textarea.form-control-modern {
    resize: vertical;
    min-height: 80px;
}

/* جستجوی محصول */
.product-search-wrapper {
    position: relative;
}

.product-search-wrapper .search-icon {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 1.05rem;
}

.product-search-wrapper .form-control-modern {
    padding-right: 2.75rem;
    height: 48px;
    font-size: 0.9rem;
}

/* ردیف افزودن کالا */
.add-product-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 0.6rem;
    align-items: end;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
    margin-bottom: 1rem;
}

@media (max-width: 767.98px) {
    .add-product-row {
        grid-template-columns: 1fr;
    }
}

.add-product-row .form-group-modern {
    margin-bottom: 0;
}

.btn-add-item {
    height: 42px;
    padding: 0 1.1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-add-item:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

/* جدول اقلام فاکتور */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}

.cart-table thead th {
    background: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0.7rem 0.9rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.cart-table tbody td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.cart-table tbody tr:last-child td {
    border-bottom: none;
}

.cart-table tbody tr:hover {
    background: #f8fafc;
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.product-thumb {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
}

.product-info-cell {
    min-width: 0;
}

.product-name-cell {
    font-weight: 600;
    font-size: 0.83rem;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-meta-cell {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin: 0;
}

/* کنترل تعداد */
.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.qty-control button {
    width: 28px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.qty-control button:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.qty-control input {
    width: 36px;
    height: 30px;
    border: none;
    text-align: center;
    font-family: inherit;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    outline: none;
    -moz-appearance: textfield;
}

.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* دکمه حذف */
.btn-remove-item {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.15s;
}

.btn-remove-item:hover {
    background: #ef4444;
    color: #fff;
}

/* حالت خالی سبد */
.cart-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.cart-empty i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 0.75rem;
    display: block;
}

.cart-empty p {
    margin: 0;
    font-size: 0.85rem;
}

/* خلاصه فاکتور */
.summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    font-size: 0.83rem;
    color: var(--text-secondary);
}

.summary-row + .summary-row {
    border-top: 1px dashed #f1f5f9;
}

.summary-row .value {
    font-weight: 600;
    color: var(--text-primary);
}

.summary-row.discount .value {
    color: #ef4444;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0.04) 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.summary-total .label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-total .amount {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

/* انتخاب روش پرداخت */
.payment-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.payment-option {
    cursor: pointer;
    position: relative;
}

.payment-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.payment-option .option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.7rem 0.5rem;
    background: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    text-align: center;
}

.payment-option .option-content i {
    font-size: 1.2rem;
}

.payment-option input:checked + .option-content {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    color: var(--primary);
    font-weight: 600;
}

.payment-option:hover .option-content {
    border-color: var(--primary);
}

/* دکمه‌های عملیات */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 1rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-modern.danger {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.15);
}

.btn-modern.danger:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

.btn-modern.success {
    background: #10b981;
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-modern.success:hover {
    background: #059669;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* عرضه‌گر مشتری */
.customer-search-box {
    position: relative;
    margin-bottom: 0.75rem;
}

.customer-search-box .form-control-modern {
    padding-right: 2.75rem;
}

.customer-search-box .search-icon {
    position: absolute;
    top: 50%;
    right: 0.9rem;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.customer-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

.customer-chip .avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.customer-chip .info {
    flex: 1;
    min-width: 0;
}

.customer-chip .name {
    font-weight: 600;
    font-size: 0.83rem;
    color: var(--text-primary);
    margin: 0;
}

.customer-chip .phone {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin: 0;
}

.customer-chip .btn-change {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.customer-chip .btn-change:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* هدر مینی صفحه */
.page-header-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-header-compact .breadcrumb-modern {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.page-header-compact .breadcrumb-modern a {
    color: var(--text-secondary);
    text-decoration: none;
}

.page-header-compact .breadcrumb-modern a:hover {
    color: var(--primary);
}

.page-header-compact .breadcrumb-modern i {
    font-size: 0.7rem;
}
/* ============================================================
   صفحه لیست فروش‌ها و فاکتورها
   ============================================================ */

/* نوار فیلتر */
.filter-bar {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.filter-group.grow {
    flex: 1;
    min-width: 200px;
}

.filter-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.filter-input {
    height: 40px;
    padding: 0 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.83rem;
    color: var(--text-primary);
    background: #fff;
    outline: none;
    transition: all 0.2s;
    width: 100%;
}

.filter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-input.icon-right {
    padding-right: 2.5rem;
}

.filter-search-wrapper {
    position: relative;
    width: 100%;
}

.filter-search-wrapper i {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.btn-filter {
    height: 40px;
    padding: 0 1rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.83rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-filter.primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-filter.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.btn-filter.ghost {
    background: #fff;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-filter.ghost:hover {
    background: #f8fafc;
    color: var(--primary);
    border-color: var(--primary);
}

/* تب‌های وضعیت */
.status-tabs {
    display: flex;
    gap: 0.25rem;
    background: #fff;
    padding: 0.3rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
}

.status-tabs::-webkit-scrollbar {
    height: 0;
}

.status-tab {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.status-tab:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.status-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.status-tab .tab-count {
    background: rgba(255, 255, 255, 0.25);
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.status-tab:not(.active) .tab-count {
    background: #e2e8f0;
    color: var(--text-secondary);
}

/* جدول فاکتورها */
.invoice-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}

.invoice-table thead th {
    background: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0.85rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.invoice-table tbody td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: var(--text-primary);
}

.invoice-table tbody tr:last-child td {
    border-bottom: none;
}

.invoice-table tbody tr:hover {
    background: #f8fafc;
}

.invoice-number {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.83rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.invoice-number:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* سلول مشتری */
.customer-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.customer-cell .avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.customer-cell .info {
    min-width: 0;
}

.customer-cell .name {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-cell .meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ستون مبلغ */
.amount-cell {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.85rem;
    white-space: nowrap;
}

.amount-cell .unit {
    font-weight: 400;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* دکمه اکشن */
.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
}

.action-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.action-btn.danger:hover {
    background: #ef4444;
    border-color: #ef4444;
}

.action-group {
    display: inline-flex;
    gap: 0.3rem;
}

/* صفحه‌بندی */
.pagination-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pagination-info {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    text-decoration: none;
}

.page-btn:hover:not(:disabled):not(.active) {
    background: #f1f5f9;
    color: var(--primary);
    border-color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* حالت خالی */
.empty-state {
    padding: 3.5rem 1rem;
    text-align: center;
}

.empty-state i {
    font-size: 3.5rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
    display: block;
}

.empty-state h5 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.4rem;
}

.empty-state p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
}

/* کارت‌های آماری کوچک بالای جدول */
.mini-stat {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
}

.mini-stat:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.mini-stat .icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.mini-stat .info {
    min-width: 0;
}

.mini-stat .label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin: 0;
}

.mini-stat .value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

/* ============================================================
   موبایل
   ============================================================ */
@media (max-width: 767.98px) {
    .filter-bar {
        padding: 0.85rem;
    }

    .filter-group,
    .filter-group.grow {
        min-width: 100%;
    }

    .filter-actions {
        width: 100%;
    }

    .filter-actions .btn-filter {
        flex: 1;
        justify-content: center;
    }

    .invoice-table thead th,
    .invoice-table tbody td {
        padding: 0.7rem 0.6rem;
        font-size: 0.78rem;
    }

    .hide-mobile {
        display: none !important;
    }

    .pagination-modern {
        flex-direction: column;
        align-items: stretch;
    }
}
/* ============================================================
   صفحه لیست محصولات
   ============================================================ */

/* سوییچ نمایش گرید/جدول */
.view-toggle {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 2px;
}

.view-toggle button {
    width: 36px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
}

.view-toggle button:hover {
    color: var(--primary);
}

.view-toggle button.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* تب‌های دسته‌بندی (رنگی) */
.category-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar {
    height: 0;
}

.category-tab {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.category-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.category-tab .tab-count {
    background: rgba(148, 163, 184, 0.15);
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
}

.category-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
}

/* ============================================================
   گرید محصولات
   ============================================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
}

@media (max-width: 575.98px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.75rem;
    }
}

/* کارت محصول */
.product-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

/* بخش تصویر */
.product-image {
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image i {
    font-size: 3.5rem;
    color: #94a3b8;
    transition: transform 0.3s;
}

.product-card:hover .product-image i {
    transform: scale(1.1);
}

/* نشان‌های روی تصویر */
.product-badge {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.product-badge.new {
    background: rgba(16, 185, 129, 0.95);
    color: #fff;
}

.product-badge.sale {
    background: rgba(239, 68, 68, 0.95);
    color: #fff;
}

.product-badge.low {
    background: rgba(245, 158, 11, 0.95);
    color: #fff;
}

.product-badge.out {
    background: rgba(100, 116, 139, 0.95);
    color: #fff;
}

/* دکمه‌های شناور روی تصویر */
.product-actions {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.25s;
    z-index: 2;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.product-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.15s;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.product-action-btn:hover {
    background: var(--primary);
    color: #fff;
}

.product-action-btn.danger:hover {
    background: #ef4444;
}

/* محتوای کارت */
.product-body {
    padding: 0.85rem 0.9rem 0.95rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0 0 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.product-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

/* ویژگی‌ها (سایز/رنگ) */
.product-attrs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.attr-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px #e2e8f0;
}

/* فوتر کارت */
.product-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0.5rem;
    padding-top: 0.6rem;
    border-top: 1px dashed #f1f5f9;
}

.product-price {
    display: flex;
    flex-direction: column;
}

.product-price .price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.product-price .old-price {
    font-size: 0.72rem;
    color: #94a3b8;
    text-decoration: line-through;
}

.product-price .unit {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-right: 2px;
}

.stock-indicator {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
}

.stock-count {
    font-size: 0.72rem;
    font-weight: 700;
}

.stock-count.good { color: #10b981; }
.stock-count.low { color: #f59e0b; }
.stock-count.out { color: #ef4444; }

.stock-bar {
    width: 50px;
    height: 4px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}

.stock-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s;
}

.stock-bar-fill.good { background: #10b981; }
.stock-bar-fill.low { background: #f59e0b; }
.stock-bar-fill.out { background: #ef4444; }

/* ============================================================
   نمایش جدولی محصولات
   ============================================================ */
.products-table-view {
    display: none;
}

.products-table-view.active {
    display: block;
}

.products-grid-view {
    display: block;
}

.products-grid-view.hidden {
    display: none;
}

/* ردیف محصول در حالت جدول */
.product-row-thumb {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.product-name-cell-table {
    font-weight: 600;
    font-size: 0.83rem;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-sku-cell {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
}

/* وضعیت موجودی (نشان) */
.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.stock-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.stock-badge.good {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.stock-badge.low {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.stock-badge.out {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* ============================================================
   پنل فیلتر کناری (اختیاری)
   ============================================================ */
.products-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 991.98px) {
    .products-layout {
        grid-template-columns: 1fr;
    }

    .filters-panel {
        display: none;
    }

    .filters-panel.mobile-open {
        display: block;
    }
}

.filters-panel {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.1rem;
    position: sticky;
    top: 90px;
}

.filters-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.filters-panel-header h6 {
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-block {
    margin-bottom: 1.1rem;
}

.filter-block:last-child {
    margin-bottom: 0;
}

.filter-block-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.55rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* چک‌باکس و رادیو سفارشی */
.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: color 0.15s;
}

.filter-option:hover {
    color: var(--primary);
}

.filter-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.filter-option .count {
    margin-right: auto;
    font-size: 0.7rem;
    color: #94a3b8;
}

/* رنگ‌ها */
.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.color-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s;
    position: relative;
    box-shadow: 0 0 0 1px #e2e8f0;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* اسلایدر قیمت */
.price-range-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.price-range-inputs input {
    width: 100%;
    height: 36px;
    padding: 0 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.78rem;
    color: var(--text-primary);
    outline: none;
    text-align: center;
}

.price-range-inputs input:focus {
    border-color: var(--primary);
}

.price-range-inputs span {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* دکمه فیلتر موبایل */
.btn-filter-mobile {
    display: none;
}

@media (max-width: 991.98px) {
    .btn-filter-mobile {
        display: inline-flex;
    }
}

/* حالت خالی */
.products-empty {
    padding: 4rem 1rem;
    text-align: center;
    background: #fff;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
}

.products-empty i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
    display: block;
}

.products-empty h5 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.4rem;
}

.products-empty p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0 0 1.25rem;
}
/* ============================================================
   صفحه افزودن / ویرایش محصول
   ============================================================ */

.product-form-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 991.98px) {
    .product-form-layout {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   آپلود تصویر
   ============================================================ */
.image-uploader {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    background: #f8fafc;
    position: relative;
}

.image-uploader:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.04);
}

.image-uploader.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    transform: scale(1.01);
}

.image-uploader input[type="file"] {
    display: none;
}

.uploader-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
}

.image-uploader h6 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 0.3rem;
    color: var(--text-primary);
}

.image-uploader p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

.image-uploader .hint {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-top: 0.5rem;
    display: block;
}

/* پیش‌نمایش تصاویر */
.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.6rem;
    margin-top: 1rem;
}

.image-preview-item {
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 1.5rem;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.image-preview-item .remove-img {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.95);
    color: #fff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-preview-item:hover .remove-img {
    opacity: 1;
}

.image-preview-item .cover-tag {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 0.6rem;
    background: var(--primary);
    color: #fff;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

/* ============================================================
   انتخاب سایز / رنگ (چیپ چندانتخابی)
   ============================================================ */
.chip-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip-option {
    cursor: pointer;
    position: relative;
}

.chip-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip-option .chip-content {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.95rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: #fff;
    transition: all 0.2s;
    white-space: nowrap;
}

.chip-option:hover .chip-content {
    border-color: var(--primary);
    color: var(--primary);
}

.chip-option input:checked + .chip-content {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* انتخاب رنگ */
.color-chip-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.color-chip-option {
    cursor: pointer;
    position: relative;
}

.color-chip-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.color-chip-option .color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    box-shadow: 0 0 0 1px #e2e8f0;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-chip-option:hover .color-swatch {
    transform: scale(1.08);
}

.color-chip-option input:checked + .color-swatch {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--primary), 0 4px 10px rgba(99, 102, 241, 0.3);
}

.color-chip-option input:checked + .color-swatch::after {
    content: '\F26E';
    font-family: 'bootstrap-icons';
    color: #fff;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* برای رنگ سفید تیک مشکی */
.color-chip-option input:checked + .color-swatch.light::after {
    color: #0f172a;
    text-shadow: none;
}

/* ============================================================
   بخش‌بندی فرم
   ============================================================ */
.form-section {
    margin-bottom: 1.25rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section-title i {
    color: var(--primary);
    font-size: 1rem;
}

/* گرید فرم */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
}

.form-grid.three {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 767.98px) {
    .form-grid,
    .form-grid.three {
        grid-template-columns: 1fr;
    }
}

.form-grid .form-group-modern {
    margin-bottom: 0;
}

.form-grid .full {
    grid-column: 1 / -1;
}

/* ============================================================
   ورودی قیمت با واحد
   ============================================================ */
.input-with-unit {
    position: relative;
}

.input-with-unit .form-control-modern {
    padding-left: 4rem;
}

.input-with-unit .unit-label {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
    pointer-events: none;
    background: #fff;
    padding: 0 0.3rem;
}

/* نمایش درصد تخفیف */
.price-hint {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.price-hint .discount-tag {
    color: #10b981;
    font-weight: 700;
}

/* ============================================================
   اطلاعات موجودی
   ============================================================ */
.stock-info-box {
    padding: 0.75rem 0.9rem;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-top: 0.6rem;
}

.stock-info-box i {
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.stock-info-box p {
    margin: 0;
    font-size: 0.73rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================================
   سوییچ‌های وضعیت
   ============================================================ */
.switch-group {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.9rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.switch-row:hover {
    border-color: var(--primary);
}

.switch-row-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.switch-row-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.switch-row-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* سوییچ سفارشی */
.switch-modern {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.switch-modern input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-modern .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: 0.25s;
}

.switch-modern .slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    right: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.25s;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
}

.switch-modern input:checked + .slider {
    background: var(--primary);
}

.switch-modern input:checked + .slider::before {
    transform: translateX(-18px);
}

/* ============================================================
   دکمه‌های عملیات
   ============================================================ */
.form-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: #fafbfc;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin: 1rem -1.25rem -1.25rem;
    flex-wrap: wrap;
}

@media (max-width: 575.98px) {
    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn-modern {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   ستون کناری (پیش‌نمایش زنده)
   ============================================================ */
.preview-col {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* پیش‌نمایش کارت محصول */
.product-preview {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.product-preview-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.product-preview-header i {
    color: var(--primary);
}

.product-preview-body {
    padding: 1rem;
}

/* ============================================================
   چک‌لیست تکمیل
   ============================================================ */
.checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.checklist-item.done {
    color: #10b981;
}

.checklist-item i {
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* اسلایدر پیشرفت */
.progress-modern {
    height: 6px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-modern .bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 999px;
    transition: width 0.4s ease;
}
/* ============================================================
   صفحه مدیریت دسته‌بندی‌ها
   ============================================================ */

/* گرید دسته‌بندی‌ها */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

@media (max-width: 575.98px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
}

/* کارت دسته‌بندی */
.category-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    transition: all 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--cat-color, var(--primary));
    transition: height 0.25s;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.category-card:hover::before {
    height: 6px;
}

.cat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.cat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    background: var(--cat-color, var(--primary));
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
    flex-shrink: 0;
    transition: transform 0.3s;
}

.category-card:hover .cat-icon {
    transform: scale(1.08) rotate(-3deg);
}

.cat-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.25s;
}

.category-card:hover .cat-actions {
    opacity: 1;
}

.cat-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.15s;
}

.cat-action-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.cat-action-btn.danger:hover {
    background: #ef4444;
    border-color: #ef4444;
}

.cat-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.3rem;
}

.cat-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0 0 0.85rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.cat-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px dashed #f1f5f9;
    margin-top: auto;
}

.cat-stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.cat-stat .value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cat-stat .label {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.cat-progress {
    flex: 1;
    margin-right: 1rem;
    max-width: 80px;
}

.cat-progress .bar-bg {
    height: 5px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}

.cat-progress .bar-fill {
    height: 100%;
    background: var(--cat-color, var(--primary));
    border-radius: 999px;
    transition: width 0.3s;
}

/* زیردسته‌ها روی کارت */
.cat-children {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px dashed #f1f5f9;
}

.cat-child-tag {
    padding: 0.15rem 0.5rem;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================================
   ساختار درختی (نمای جدولی)
   ============================================================ */
.tree-view {
    padding: 0.5rem 0;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    transition: background 0.15s;
    cursor: pointer;
    border-bottom: 1px solid #f8fafc;
}

.tree-item:hover {
    background: #f8fafc;
}

.tree-item.child {
    padding-right: 3rem;
    background: #fafbfc;
    font-size: 0.85rem;
}

.tree-item.child:hover {
    background: #f1f5f9;
}

.tree-toggle {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: none;
    background: #f1f5f9;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tree-toggle:hover {
    background: var(--primary);
    color: #fff;
}

.tree-toggle.expanded i {
    transform: rotate(180deg);
}

.tree-toggle i {
    transition: transform 0.2s;
}

.tree-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: #fff;
    flex-shrink: 0;
}

.tree-icon.small {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
    border-radius: 7px;
}

.tree-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-item.child .tree-name {
    font-weight: 500;
    font-size: 0.83rem;
}

.tree-count {
    font-size: 0.72rem;
    color: var(--text-secondary);
    background: #f1f5f9;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 600;
}

.tree-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.15s;
}

.tree-item:hover .tree-actions {
    opacity: 1;
}

/* ============================================================
   انتخاب آیکون و رنگ (مودال)
   ============================================================ */
.icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
    gap: 0.4rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.icon-picker-item {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    border: 1.5px solid transparent;
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.15s;
}

.icon-picker-item:hover {
    color: var(--primary);
    transform: scale(1.05);
}

.icon-picker-item.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.color-picker-item {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 0 0 1px #e2e8f0;
    transition: all 0.15s;
    position: relative;
}

.color-picker-item:hover {
    transform: scale(1.1);
}

.color-picker-item.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--primary), 0 4px 10px rgba(99, 102, 241, 0.3);
}

.color-picker-item.active::after {
    content: '\F26E';
    font-family: 'bootstrap-icons';
    color: #fff;
    font-size: 0.85rem;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.color-picker-item.active.light::after {
    color: #0f172a;
    text-shadow: none;
}

/* ============================================================
   مودال سفارشی
   ============================================================ */
.modal-modern .modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
    overflow: hidden;
}

.modal-modern .modal-header {
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid var(--border-color);
    background: #fafbfc;
}

.modal-modern .modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-modern .modal-title i {
    color: var(--primary);
}

.modal-modern .btn-close {
    opacity: 0.5;
}

.modal-modern .modal-body {
    padding: 1.35rem;
}

.modal-modern .modal-footer {
    padding: 1rem 1.35rem;
    border-top: 1px solid var(--border-color);
    background: #fafbfc;
    gap: 0.5rem;
}
/* ============================================================
   صفحه مدیریت موجودی انبار
   ============================================================ */

/* نوار هشدار بالای صفحه */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.alert-banner.warning {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.02) 100%);
    border-color: rgba(245, 158, 11, 0.25);
}

.alert-banner.danger {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.02) 100%);
    border-color: rgba(239, 68, 68, 0.25);
}

.alert-banner .alert-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.alert-banner.warning .alert-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.alert-banner.danger .alert-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.alert-banner .alert-text {
    flex: 1;
    min-width: 0;
}

.alert-banner .alert-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.15rem;
}

.alert-banner .alert-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0;
}

.alert-banner .alert-action {
    flex-shrink: 0;
}

/* ============================================================
   نوار موجودی در جدول
   ============================================================ */
.stock-level {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 110px;
}

.stock-level-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

.stock-level-text .current {
    font-weight: 700;
    color: var(--text-primary);
}

.stock-level-text .max {
    font-size: 0.7rem;
    color: #94a3b8;
}

.stock-level-bar {
    height: 6px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.stock-level-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.stock-level-fill.good {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.stock-level-fill.low {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.stock-level-fill.critical {
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

.stock-level-fill.out {
    background: #cbd5e1;
}

/* ============================================================
   نشان‌های موجودی
   ============================================================ */
.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.stock-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.stock-status.good {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.stock-status.low {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.stock-status.critical {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.stock-status.out {
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
}

/* ============================================================
   مودال تنظیم موجودی
   ============================================================ */
.stock-adjust-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-md);
    gap: 3px;
    margin-bottom: 1rem;
}

.stock-adjust-toggle button {
    flex: 1;
    padding: 0.6rem 0.85rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.stock-adjust-toggle button:hover {
    color: var(--primary);
}

.stock-adjust-toggle button.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
    font-weight: 600;
}

.stock-adjust-toggle button.active.increase {
    color: #10b981;
}

.stock-adjust-toggle button.active.decrease {
    color: #ef4444;
}

.stock-adjust-toggle button.active.set {
    color: #6366f1;
}

/* نمایش موجودی فعلی در مودال */
.current-stock-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0.03) 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.15);
    margin-bottom: 1rem;
}

.current-stock-display .info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.current-stock-display .label {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.current-stock-display .product {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.current-stock-display .stock-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.current-stock-display .stock-num small {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 0.2rem;
}

/* ============================================================
   تاریخچه حرکات
   ============================================================ */
.movement-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.movement-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.movement-item:hover {
    background: #f8fafc;
}

.movement-item:last-child {
    border-bottom: none;
}

.movement-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.movement-icon.in {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.movement-icon.out {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.movement-icon.adjust {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.movement-info {
    flex: 1;
    min-width: 0;
}

.movement-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movement-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.movement-meta .separator {
    color: #cbd5e1;
}

.movement-qty {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.movement-qty.in {
    color: #10b981;
}

.movement-qty.out {
    color: #ef4444;
}

.movement-qty.adjust {
    color: #6366f1;
}

/* ============================================================
   کارت ارزش‌گذاری انبار
   ============================================================ */
.valuation-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.valuation-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 60%);
    pointer-events: none;
}

.valuation-card .vc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    position: relative;
}

.valuation-card .vc-title {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 0;
}

.valuation-card .vc-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
    font-size: 1.05rem;
}

.valuation-card .vc-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.35rem;
    letter-spacing: -0.5px;
    position: relative;
}

.valuation-card .vc-value small {
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    margin-right: 0.25rem;
}

.valuation-card .vc-change {
    font-size: 0.72rem;
    color: #34d399;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    position: relative;
}

.valuation-card .vc-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    display: flex;
    justify-content: space-between;
    position: relative;
}

.valuation-card .vc-footer .label {
    font-size: 0.7rem;
    color: #94a3b8;
}

.valuation-card .vc-footer .val {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

/* ============================================================
   فیلترهای سریع (چیپ)
   ============================================================ */
.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.quick-filter-chip {
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.quick-filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.quick-filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.quick-filter-chip .chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.quick-filter-chip.active .chip-dot {
    background: #fff !important;
}

/* هدر جدول چسبان */
.inventory-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

@media (max-width: 991.98px) {
    .inventory-table thead th {
        position: static;
    }
}
/* ============================================================
   صفحه لیست مشتریان
   ============================================================ */

/* سلول مشتری با آواتار رنگی */
.customer-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.1);
}

/* نشان سطح مشتری */
.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.tier-badge.vip {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.tier-badge.gold {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    color: #78350f;
}

.tier-badge.silver {
    background: #e2e8f0;
    color: #475569;
}

.tier-badge.bronze {
    background: #fed7aa;
    color: #9a3412;
}

.tier-badge.new {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
}

/* بدهی مشتری */
.debt-cell {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.debt-amount {
    font-weight: 700;
    font-size: 0.85rem;
}

.debt-amount.zero {
    color: #10b981;
}

.debt-amount.pending {
    color: #f59e0b;
}

.debt-amount.overdue {
    color: #ef4444;
}

.debt-label {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

/* امتیاز مشتری */
.customer-rating {
    display: inline-flex;
    gap: 0.1rem;
    color: #fbbf24;
    font-size: 0.7rem;
}

/* ============================================================
   پنل جزئیات مشتری (Drawer)
   ============================================================ */
.customer-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.customer-drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.customer-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 480px;
    max-width: 100%;
    background: #fff;
    z-index: 1051;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 40px rgba(15, 23, 42, 0.15);
}

.customer-drawer.open {
    transform: translateX(0);
}

@media (max-width: 575.98px) {
    .customer-drawer {
        width: 100%;
    }
}

.drawer-header {
    padding: 1.25rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.drawer-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.drawer-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.2s;
    z-index: 2;
}

.drawer-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.drawer-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.drawer-avatar {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.drawer-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
}

.drawer-phone {
    font-size: 0.82rem;
    opacity: 0.9;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

.drawer-body::-webkit-scrollbar {
    width: 5px;
}

.drawer-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* آمار داخل Drawer */
.drawer-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.drawer-stat {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.6rem;
    text-align: center;
}

.drawer-stat .value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    display: block;
    line-height: 1.2;
}

.drawer-stat .label {
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    display: block;
}

/* بخش داخل Drawer */
.drawer-section {
    margin-bottom: 1.35rem;
}

.drawer-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-color);
}

.drawer-section-title i {
    color: var(--primary);
}

/* اطلاعات تماس */
.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.75rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: var(--text-primary);
}

.info-item i {
    color: var(--primary);
    font-size: 0.95rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* تاریخچه خرید */
.purchase-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.purchase-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
    transition: all 0.15s;
    cursor: pointer;
}

.purchase-item:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
}

.purchase-item .info {
    min-width: 0;
    flex: 1;
}

.purchase-item .id {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 0.15rem;
}

.purchase-item .date {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
}

.purchase-item .amount {
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.drawer-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: #fafbfc;
    display: flex;
    gap: 0.5rem;
}

.drawer-footer .btn-modern {
    flex: 1;
    justify-content: center;
}

/* ============================================================
   تب‌های مشتریان
   ============================================================ */
.customer-tabs {
    display: flex;
    gap: 0.25rem;
    background: #fff;
    padding: 0.3rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.customer-tabs::-webkit-scrollbar {
    height: 0;
}

.customer-tab {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.customer-tab:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.customer-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.customer-tab .tab-count {
    background: rgba(255, 255, 255, 0.25);
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.customer-tab:not(.active) .tab-count {
    background: #e2e8f0;
    color: var(--text-secondary);
}
/* ============================================================
   صفحه افزودن / ویرایش مشتری
   ============================================================ */

.customer-form-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 991.98px) {
    .customer-form-layout {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   آواتار انتخابی مشتری
   ============================================================ */
.avatar-picker {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.avatar-preview {
    width: 84px;
    height: 84px;
    border-radius: 22px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2.2rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    position: relative;
    transition: all 0.3s;
}

.avatar-preview.has-image {
    background: #f1f5f9;
    overflow: hidden;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-info {
    flex: 1;
    min-width: 0;
}

.avatar-info h6 {
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--text-primary);
}

.avatar-info p {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin: 0 0 0.65rem;
    line-height: 1.5;
}

.avatar-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.avatar-colors {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.avatar-color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 0 0 1px #e2e8f0;
    transition: all 0.15s;
}

.avatar-color-dot:hover {
    transform: scale(1.15);
}

.avatar-color-dot.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--primary);
}

/* ============================================================
   انتخابگر جنسیت
   ============================================================ */
.gender-picker {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.gender-option {
    cursor: pointer;
    position: relative;
}

.gender-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gender-option .content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 0.75rem;
    background: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.gender-option .content i {
    font-size: 1.15rem;
}

.gender-option:hover .content {
    border-color: var(--primary);
    color: var(--primary);
}

.gender-option input:checked + .content {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

/* ============================================================
   انتخاب سطح مشتری
   ============================================================ */
.tier-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.55rem;
}

.tier-option {
    cursor: pointer;
    position: relative;
}

.tier-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tier-option .content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem;
    background: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tier-option .content::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--tier-color, #94a3b8);
}

.tier-option .tier-icon {
    font-size: 1.35rem;
    color: var(--tier-color, #94a3b8);
    margin: 0 auto;
}

.tier-option .tier-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tier-option .tier-desc {
    font-size: 0.68rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.tier-option:hover .content {
    border-color: var(--tier-color, var(--primary));
    transform: translateY(-2px);
}

.tier-option input:checked + .content {
    border-color: var(--tier-color, var(--primary));
    background: color-mix(in srgb, var(--tier-color, #6366f1) 6%, white);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--tier-color, #6366f1) 20%, transparent);
}

.tier-option input:checked + .content::after {
    content: '\F26E';
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--tier-color, var(--primary));
    color: #fff;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ============================================================
   برچسب‌های قابل انتخاب (Tags)
   ============================================================ */
.tags-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag-chip {
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1.5px solid var(--border-color);
    background: #fff;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-family: inherit;
}

.tag-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tag-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.25);
}

/* ============================================================
   پیش‌نمایش کارت مشتری
   ============================================================ */
.customer-preview-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.customer-preview-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 80px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    z-index: 0;
}

.customer-preview-avatar {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 4px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.9rem;
    font-weight: 800;
    margin: 0.5rem auto 0.75rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.customer-preview-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.3rem;
    position: relative;
    z-index: 1;
    min-height: 1.3em;
}

.customer-preview-phone {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
    position: relative;
    z-index: 1;
}

.customer-preview-tier {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #f1f5f9;
    color: var(--text-secondary);
    margin-bottom: 0.85rem;
}

.customer-preview-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    padding-top: 0.85rem;
    border-top: 1px dashed #f1f5f9;
}

.customer-preview-stats .stat {
    text-align: center;
}

.customer-preview-stats .stat .val {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    line-height: 1.2;
}

.customer-preview-stats .stat .lbl {
    font-size: 0.65rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.15rem;
}

/* ============================================================
   بخش اطلاعات تماس اضافه
   ============================================================ */
.contact-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

@media (max-width: 575.98px) {
    .contact-methods {
        grid-template-columns: 1fr;
    }
}

.contact-method-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.contact-method-item:focus-within {
    border-color: var(--primary);
    background: #fff;
}

.contact-method-item .icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: #fff;
    flex-shrink: 0;
}

.contact-method-item .icon.whatsapp { background: #25d366; }
.contact-method-item .icon.telegram { background: #0088cc; }
.contact-method-item .icon.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}
.contact-method-item .icon.email { background: #ef4444; }

.contact-method-item input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text-primary);
    outline: none;
    min-width: 0;
}

.contact-method-item input::placeholder {
    color: #94a3b8;
}

/* ============================================================
   کلید تنظیمات مشتری
   ============================================================ */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0.9rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.setting-row:hover {
    border-color: var(--primary);
}

.setting-row + .setting-row {
    margin-top: 0.5rem;
}

.setting-row-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding-left: 0.75rem;
    min-width: 0;
}

.setting-row-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.setting-row-label i {
    color: var(--primary);
    font-size: 0.9rem;
}

.setting-row-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
/* ============================================================
   صفحه پروفایل مشتری
   ============================================================ */

/* کارت هیرو پروفایل */
.profile-hero {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 60%, #4338ca 100%);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
}

.profile-hero::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 65%);
    pointer-events: none;
}

.profile-hero::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 65%);
    pointer-events: none;
}

.profile-hero-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.profile-hero-avatar {
    width: 100px;
    height: 100px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.profile-hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-hero-info {
    flex: 1;
    min-width: 220px;
}

.profile-hero-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.profile-hero-name .tier-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
}

.profile-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 0.85rem;
    font-size: 0.82rem;
    opacity: 0.95;
}

.profile-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.profile-hero-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.profile-hero-tag {
    padding: 0.25rem 0.7rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.profile-hero-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.profile-hero-actions .btn-modern {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.profile-hero-actions .btn-modern:hover {
    background: #fff;
    color: var(--primary);
    border-color: #fff;
}

.profile-hero-actions .btn-modern.solid {
    background: #fff;
    color: var(--primary);
    border-color: #fff;
}

.profile-hero-actions .btn-modern.solid:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-dark);
    transform: translateY(-1px);
}

/* ============================================================
   آمار پروفایل
   ============================================================ */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.profile-stat {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    transition: all 0.25s;
    cursor: default;
}

.profile-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.profile-stat .ps-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.profile-stat .ps-info {
    min-width: 0;
    flex: 1;
}

.profile-stat .ps-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin: 0 0 0.15rem;
    font-weight: 500;
}

.profile-stat .ps-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.profile-stat .ps-value small {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 0.15rem;
}

.profile-stat .ps-change {
    font-size: 0.68rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    margin-top: 0.2rem;
}

.profile-stat .ps-change.up { color: #10b981; }
.profile-stat .ps-change.down { color: #ef4444; }

/* ============================================================
   چیدمان دو ستونی پروفایل
   ============================================================ */
.profile-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 991.98px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
}

.profile-main-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.profile-side-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 90px;
}

@media (max-width: 991.98px) {
    .profile-side-col {
        position: static;
    }
}

/* ============================================================
   اطلاعات تماس در ستون کناری
   ============================================================ */
.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-list-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.contact-list-item:hover {
    border-color: var(--primary);
    background: #fff;
}

.contact-list-item .cl-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
}

.contact-list-item .cl-info {
    flex: 1;
    min-width: 0;
}

.contact-list-item .cl-label {
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin: 0;
}

.contact-list-item .cl-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: ltr;
    text-align: right;
}

.contact-list-item .cl-action {
    color: #94a3b8;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: color 0.2s;
}

.contact-list-item:hover .cl-action {
    color: var(--primary);
}

/* ============================================================
   تب‌های پروفایل
   ============================================================ */
.profile-tabs {
    display: flex;
    gap: 0.25rem;
    background: #fff;
    padding: 0.3rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    flex-wrap: nowrap;
    margin-bottom: 0;
}

.profile-tabs::-webkit-scrollbar {
    height: 0;
}

.profile-tab {
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.profile-tab:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.profile-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.profile-tab .tab-count {
    background: rgba(255, 255, 255, 0.25);
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

.profile-tab:not(.active) .tab-count {
    background: #e2e8f0;
    color: var(--text-secondary);
}

.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: block;
}

/* ============================================================
   تایم‌لاین فعالیت
   ============================================================ */
.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 15px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(180deg, #e2e8f0 0%, #f1f5f9 100%);
}

.timeline-item {
    display: flex;
    gap: 0.85rem;
    padding-bottom: 1.1rem;
    position: relative;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    flex-shrink: 0;
    background: #fff;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #e2e8f0;
    position: relative;
    z-index: 1;
}

.timeline-icon.sale {
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25);
}

.timeline-icon.payment {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
}

.timeline-icon.note {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25);
}

.timeline-icon.contact {
    background: rgba(14, 165, 233, 0.12);
    color: #0ea5e9;
    box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.25);
}

.timeline-content {
    flex: 1;
    min-width: 0;
    padding-top: 0.15rem;
}

.timeline-title {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.15rem;
}

.timeline-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.timeline-time {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.25rem;
    display: block;
}

/* ============================================================
   یادداشت‌ها (Notes)
   ============================================================ */
.notes-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.note-item {
    padding: 0.85rem 0.9rem;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 158, 11, 0.15);
    position: relative;
}

.note-item .note-text {
    font-size: 0.8rem;
    color: #78350f;
    margin: 0 0 0.4rem;
    line-height: 1.6;
}

.note-item .note-meta {
    font-size: 0.68rem;
    color: #a16207;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.note-item .note-actions {
    display: flex;
    gap: 0.25rem;
}

.note-item .note-action-btn {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: none;
    background: rgba(245, 158, 11, 0.15);
    color: #92400e;
    cursor: pointer;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.note-item .note-action-btn:hover {
    background: #f59e0b;
    color: #fff;
}

/* ============================================================
   برچسب‌های قابل حذف
   ============================================================ */
.tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag-display-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.15);
    transition: all 0.15s;
}

.tag-display-item .remove-tag {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.15s;
    display: inline-flex;
    align-items: center;
}

.tag-display-item .remove-tag:hover {
    opacity: 1;
}

.tag-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    background: transparent;
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.tag-add-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    border-style: solid;
}

/* ============================================================
   نمودار در پروفایل
   ============================================================ */
.chart-container-profile {
    height: 240px;
    position: relative;
}

@media (max-width: 575.98px) {
    .chart-container-profile {
        height: 200px;
    }
}
/* ============================================================
   صفحه مدیریت هزینه‌ها
   ============================================================ */

/* کارت دسته‌بندی هزینه */
.expense-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.expense-category-badge .cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* آیکون هزینه در جدول */
.expense-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ============================================================
   کارت دسته‌بندی‌های هزینه
   ============================================================ */
.expense-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.85rem;
}

.expense-cat-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition: all 0.25s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.expense-cat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--cat-color, var(--primary));
    opacity: 0;
    transition: opacity 0.25s;
}

.expense-cat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.expense-cat-card:hover::before {
    opacity: 1;
}

.expense-cat-card .ec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.expense-cat-card .ec-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    background: var(--cat-color, var(--primary));
}

.expense-cat-card .ec-percent {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: #f1f5f9;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.expense-cat-card .ec-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.35rem;
}

.expense-cat-card .ec-amount {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.6rem;
    letter-spacing: -0.3px;
}

.expense-cat-card .ec-amount small {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 0.15rem;
}

.expense-cat-card .ec-bar {
    height: 4px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}

.expense-cat-card .ec-bar-fill {
    height: 100%;
    background: var(--cat-color, var(--primary));
    border-radius: 999px;
    transition: width 0.4s;
}

/* ============================================================
   لیست ساده هزینه‌ها (نمای کارتی موبایل)
   ============================================================ */
.expense-list-mobile {
    display: none;
}

@media (max-width: 767.98px) {
    .expense-list-mobile {
        display: block;
    }

    .expense-table-wrapper {
        display: none;
    }
}

.expense-item-mobile {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.expense-item-mobile:last-child {
    border-bottom: none;
}

.expense-item-mobile .info {
    flex: 1;
    min-width: 0;
}

.expense-item-mobile .title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.2rem;
}

.expense-item-mobile .meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.expense-item-mobile .amount {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
}

/* ============================================================
   مودال هزینه
   ============================================================ */
.expense-type-toggle {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.expense-type-option {
    cursor: pointer;
    position: relative;
}

.expense-type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.expense-type-option .content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.85rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    background: #fff;
    text-align: center;
}

.expense-type-option .content i {
    font-size: 1.35rem;
}

.expense-type-option:hover .content {
    border-color: var(--primary);
    color: var(--primary);
}

.expense-type-option input:checked + .content {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

/* دسته‌بندی انتخاب سریع */
.category-quick-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.5rem;
}

.category-quick-item {
    cursor: pointer;
    position: relative;
}

.category-quick-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.category-quick-item .content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    background: #fff;
    white-space: nowrap;
}

.category-quick-item .content i {
    font-size: 0.95rem;
    flex-shrink: 0;
}

.category-quick-item:hover .content {
    border-color: var(--cat-color, var(--primary));
    color: var(--cat-color, var(--primary));
}

.category-quick-item input:checked + .content {
    border-color: var(--cat-color, var(--primary));
    color: var(--cat-color, var(--primary));
    font-weight: 600;
    background: color-mix(in srgb, var(--cat-color, #6366f1) 8%, white);
}

/* آپلود فاکتور */
.receipt-uploader {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
}

.receipt-uploader:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.04);
}

.receipt-uploader .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.receipt-uploader .info {
    flex: 1;
    min-width: 0;
}

.receipt-uploader .info h6 {
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0 0 0.15rem;
    color: var(--text-primary);
}

.receipt-uploader .info p {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================================
   نمودار هزینه در کنار
   ============================================================ */
.chart-container-expense {
    height: 220px;
    position: relative;
}

/* کارت خلاصه در ستون کناری */
.expense-summary-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.expense-summary-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.expense-summary-card .esc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    position: relative;
}

.expense-summary-card .esc-title {
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0;
}

.expense-summary-card .esc-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}

.expense-summary-card .esc-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.3rem;
    letter-spacing: -0.5px;
    position: relative;
}

.expense-summary-card .esc-value small {
    font-size: 0.72rem;
    font-weight: 500;
    color: #94a3b8;
    margin-right: 0.25rem;
}

.expense-summary-card .esc-change {
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    position: relative;
}

.expense-summary-card .esc-change.down {
    color: #34d399;
}

.expense-summary-card .esc-change.up {
    color: #f87171;
}

/* لیست کوچک هزینه‌های اخیر */
.recent-expenses-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-expense-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0;
    border-bottom: 1px dashed #f1f5f9;
}

.recent-expense-item:last-child {
    border-bottom: none;
}

.recent-expense-item .info {
    flex: 1;
    min-width: 0;
}

.recent-expense-item .title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-expense-item .date {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
}

.recent-expense-item .amount {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}
/* ============================================================
   صفحه دریافت و پرداخت (خزانه‌داری)
   ============================================================ */

/* کارت موجودی خزانه */
.treasury-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #334155 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.treasury-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 65%);
    pointer-events: none;
}

.treasury-card::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -15%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 65%);
    pointer-events: none;
}

.treasury-card .tc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.treasury-card .tc-title {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.treasury-card .tc-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.25);
    border: 1px solid rgba(165, 180, 252, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #a5b4fc;
}

.treasury-card .tc-value {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.35rem;
    letter-spacing: -1px;
    line-height: 1.1;
    position: relative;
    z-index: 1;
}

.treasury-card .tc-value small {
    font-size: 0.82rem;
    font-weight: 500;
    color: #94a3b8;
    margin-right: 0.3rem;
}

.treasury-card .tc-change {
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    position: relative;
    z-index: 1;
}

.treasury-card .tc-change.up { color: #34d399; }
.treasury-card .tc-change.down { color: #f87171; }

.treasury-card .tc-footer {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.treasury-card .tc-footer .item .label {
    font-size: 0.7rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.25rem;
}

.treasury-card .tc-footer .item .value {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.treasury-card .tc-footer .item.in .value { color: #34d399; }
.treasury-card .tc-footer .item.out .value { color: #f87171; }

/* ============================================================
   تب‌های دریافت / پرداخت
   ============================================================ */
.payment-type-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.payment-type-tab {
    cursor: pointer;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--border-color);
    background: #fff;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.payment-type-tab .pt-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.payment-type-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.payment-type-tab.active {
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
    border-color: transparent;
}

.payment-type-tab.active.in {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.payment-type-tab.active.out {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.payment-type-tab.active.all {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.payment-type-tab.active .pt-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.payment-type-tab.active .pt-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.payment-type-tab .pt-count {
    background: #f1f5f9;
    color: var(--text-secondary);
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
    transition: all 0.2s;
}

/* ============================================================
   آیکون تراکنش (دریافت/پرداخت)
   ============================================================ */
.transaction-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    font-weight: 700;
}

.transaction-icon.in {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.08) 100%);
    color: #10b981;
}

.transaction-icon.out {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.08) 100%);
    color: #ef4444;
}

/* مبلغ تراکنش */
.transaction-amount {
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

.transaction-amount.in { color: #10b981; }
.transaction-amount.out { color: #ef4444; }

.transaction-amount::before {
    content: '';
    display: inline-block;
    width: 0;
}

.transaction-amount.in::before { content: '+ '; }
.transaction-amount.out::before { content: '− '; }

/* ============================================================
   روش‌های پرداخت سریع
   ============================================================ */
.payment-method-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #f1f5f9;
    color: var(--text-secondary);
    white-space: nowrap;
}

.payment-method-badge i {
    font-size: 0.85rem;
}

.payment-method-badge.cash { background: rgba(16, 185, 129, 0.1); color: #059669; }
.payment-method-badge.card { background: rgba(99, 102, 241, 0.1); color: #4f46e5; }
.payment-method-badge.transfer { background: rgba(14, 165, 233, 0.1); color: #0284c7; }
.payment-method-badge.cheque { background: rgba(245, 158, 11, 0.1); color: #d97706; }

/* ============================================================
   کارت‌های تفکیک صندوق
   ============================================================ */
.cash-boxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.85rem;
}

.cash-box-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    transition: all 0.2s;
}

.cash-box-card:hover {
    border-color: var(--box-color, var(--primary));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cash-box-card .cb-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    background: var(--box-color, var(--primary));
    flex-shrink: 0;
}

.cash-box-card .cb-info {
    min-width: 0;
    flex: 1;
}

.cash-box-card .cb-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin: 0 0 0.2rem;
}

.cash-box-card .cb-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
}

.cash-box-card .cb-value small {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ============================================================
   مودال ثبت تراکنش
   ============================================================ */
.transaction-toggle-large {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.transaction-toggle-option {
    cursor: pointer;
    position: relative;
}

.transaction-toggle-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.transaction-toggle-option .content {
    padding: 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    background: #fff;
    text-align: center;
}

.transaction-toggle-option .content .t-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.25s;
}

.transaction-toggle-option.in .content .t-icon {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.transaction-toggle-option.out .content .t-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.transaction-toggle-option .content .t-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.transaction-toggle-option .content .t-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.transaction-toggle-option:hover .content {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.transaction-toggle-option.in input:checked + .content {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.04);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.15);
}

.transaction-toggle-option.out input:checked + .content {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.04);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.15);
}

/* ============================================================
   مبلغ در مودال
   ============================================================ */
.amount-input-large {
    position: relative;
}

.amount-input-large input {
    width: 100%;
    padding: 1rem 1.15rem 1rem 5rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    text-align: left;
    direction: ltr;
    outline: none;
    transition: all 0.2s;
    background: #f8fafc;
    letter-spacing: -0.5px;
}

.amount-input-large input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.amount-input-large .unit {
    position: absolute;
    left: 1.15rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    pointer-events: none;
}

.amount-input-large .clear-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: none;
    background: #e2e8f0;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.15s;
}

.amount-input-large .clear-btn:hover {
    background: #cbd5e1;
    color: #0f172a;
}

/* مبلغ سریع */
.quick-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.6rem;
}

.quick-amount-btn {
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.quick-amount-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.04);
}

/* ============================================================
   خلاصه صندوق در کنار مودال
   ============================================================ */
.box-balance-info {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(99, 102, 241, 0.02) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.box-balance-info .info-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0 0 0.15rem;
}

.box-balance-info .info-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.box-balance-info .info-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

/* ============================================================
   نمودار جریان نقدی
   ============================================================ */
.chart-container-payments {
    height: 260px;
    position: relative;
}

@media (max-width: 575.98px) {
    .chart-container-payments {
        height: 200px;
    }
}

/* ============================================================
   لیست موبایل
   ============================================================ */
.transactions-list-mobile {
    display: none;
}

@media (max-width: 767.98px) {
    .transactions-list-mobile { display: block; }
    .transactions-table-wrapper { display: none; }
}

.transaction-item-mobile {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.transaction-item-mobile:last-child {
    border-bottom: none;
}

.transaction-item-mobile .info {
    flex: 1;
    min-width: 0;
}

.transaction-item-mobile .title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.2rem;
}

.transaction-item-mobile .meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
/* ============================================================
   صفحه گزارش فروش
   ============================================================ */

/* نوار بازه زمانی */
.date-range-bar {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: flex-end;
    justify-content: space-between;
}

.date-range-presets {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.date-preset-btn {
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #fff;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.date-preset-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.date-preset-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.date-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

/* کارت آماری اصلی گزارش */
.report-kpi {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.report-kpi::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--kpi-color, var(--primary));
}

.report-kpi:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.report-kpi .kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.report-kpi .kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    background: var(--kpi-color, var(--primary));
    flex-shrink: 0;
}

.report-kpi .kpi-change {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.report-kpi .kpi-change.up {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.report-kpi .kpi-change.down {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.report-kpi .kpi-label {
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

.report-kpi .kpi-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.report-kpi .kpi-value small {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 0.2rem;
}

.report-kpi .kpi-footer {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #f1f5f9;
    margin-top: auto;
}

/* ============================================================
   کارت نمودار بزرگ
   ============================================================ */
.chart-card-large {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.chart-card-large .card-header-modern {
    padding: 1rem 1.25rem;
}

.chart-container-large {
    height: 320px;
    position: relative;
    padding: 0 1.25rem 1.25rem;
}

@media (max-width: 575.98px) {
    .chart-container-large {
        height: 220px;
        padding: 0 0.75rem 0.75rem;
    }
}

.chart-tabs-mini {
    display: flex;
    gap: 0.2rem;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
}

.chart-tab-mini {
    padding: 0.35rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.chart-tab-mini.active {
    background: #fff;
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* ============================================================
   کارت‌های نمودار کوچک (دو ستونی)
   ============================================================ */
.chart-container-small {
    height: 240px;
    position: relative;
}

@media (max-width: 575.98px) {
    .chart-container-small {
        height: 200px;
    }
}

/* ============================================================
   لیست پرفروش‌ترین محصولات
   ============================================================ */
.top-products-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.top-product-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px dashed #f1f5f9;
    transition: all 0.15s;
}

.top-product-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.top-product-item:first-child {
    padding-top: 0;
}

.top-product-rank {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    flex-shrink: 0;
    background: #f1f5f9;
    color: var(--text-secondary);
}

.top-product-rank.gold {
    background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%);
    color: #78350f;
    box-shadow: 0 3px 8px rgba(251, 191, 36, 0.35);
}

.top-product-rank.silver {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #475569;
}

.top-product-rank.bronze {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    color: #9a3412;
}

.top-product-thumb {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 1.05rem;
    flex-shrink: 0;
}

.top-product-info {
    flex: 1;
    min-width: 0;
}

.top-product-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-product-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.top-product-stats {
    text-align: left;
    flex-shrink: 0;
}

.top-product-sales {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.top-product-sales small {
    font-size: 0.66rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 0.15rem;
}

.top-product-qty {
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================================
   عملکرد فروشندگان
   ============================================================ */
.sellers-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.seller-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.seller-item:hover {
    border-color: var(--primary);
    background: #fff;
}

.seller-avatar {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}

.seller-info {
    flex: 1;
    min-width: 0;
}

.seller-name {
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.2rem;
}

.seller-progress {
    height: 5px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.seller-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 999px;
    transition: width 0.5s;
}

.seller-meta {
    font-size: 0.68rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    margin: 0;
}

.seller-amount {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-primary);
    flex-shrink: 0;
    text-align: left;
    white-space: nowrap;
}

.seller-amount small {
    display: block;
    font-size: 0.62rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* ============================================================
   هیت‌مپ ساعت فروش
   ============================================================ */
.hour-heatmap {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
    margin-top: 0.5rem;
}

.hour-cell {
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.hour-cell:hover {
    transform: scale(1.15);
    z-index: 2;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

.hour-cell[data-level="1"] { background: rgba(99, 102, 241, 0.15); color: var(--primary-dark); }
.hour-cell[data-level="2"] { background: rgba(99, 102, 241, 0.3); color: var(--primary-dark); }
.hour-cell[data-level="3"] { background: rgba(99, 102, 241, 0.55); color: #fff; }
.hour-cell[data-level="4"] { background: rgba(99, 102, 241, 0.8); color: #fff; }
.hour-cell[data-level="5"] { background: var(--primary); color: #fff; box-shadow: 0 0 10px rgba(99, 102, 241, 0.4); }

.hour-heatmap-legend {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    justify-content: flex-end;
}

.heatmap-legend-box {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

/* ============================================================
   جدول گزارش روزانه
   ============================================================ */
.daily-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}

.daily-report-table thead th {
    background: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0.75rem 0.85rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.daily-report-table tbody td {
    padding: 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-primary);
    vertical-align: middle;
}

.daily-report-table tbody tr:last-child td {
    border-bottom: none;
}

.daily-report-table tbody tr:hover {
    background: #f8fafc;
}

.daily-report-table tfoot td {
    padding: 0.85rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(99, 102, 241, 0.02) 100%);
    font-weight: 800;
    color: var(--text-primary);
    border-top: 2px solid rgba(99, 102, 241, 0.15);
    font-size: 0.85rem;
}

/* نشانگر رشد روزانه */
.daily-growth {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
}

.daily-growth.up {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.daily-growth.down {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.daily-growth.flat {
    background: #f1f5f9;
    color: var(--text-secondary);
}

/* ============================================================
   دکمه‌های خروجی
   ============================================================ */
.export-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.export-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.35rem;
    z-index: 100;
    display: none;
}

.export-dropdown.open {
    display: block;
    animation: fadeInUp 0.2s ease;
}

.export-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    font-family: inherit;
    text-align: right;
}

.export-dropdown-item:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.export-dropdown-item i {
    color: var(--primary);
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
}

.export-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 0.3rem 0;
}
/* ============================================================
   صفحه گزارش سود و زیان
   ============================================================ */

/* کارت KPI سود */
.profit-kpi {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.profit-kpi::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--pk-color, var(--primary));
}

.profit-kpi:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.profit-kpi.primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border-color: transparent;
}

.profit-kpi.primary::before {
    display: none;
}

.profit-kpi.primary .pk-label,
.profit-kpi.primary .pk-footer {
    color: rgba(255, 255, 255, 0.85);
}

.profit-kpi.primary .pk-value {
    color: #fff;
}

.profit-kpi .pk-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.profit-kpi .pk-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    background: var(--pk-color, var(--primary));
    flex-shrink: 0;
}

.profit-kpi.primary .pk-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.profit-kpi .pk-change {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.profit-kpi .pk-change.up {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.profit-kpi .pk-change.down {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.profit-kpi.primary .pk-change {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.profit-kpi .pk-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

.profit-kpi .pk-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.profit-kpi .pk-value small {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 0.2rem;
}

.profit-kpi.primary .pk-value small {
    color: rgba(255, 255, 255, 0.75);
}

.profit-kpi .pk-footer {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #f1f5f9;
    margin-top: auto;
}

.profit-kpi.primary .pk-footer {
    border-color: rgba(255, 255, 255, 0.2);
}

/* ============================================================
   نمودار سود و زیان
   ============================================================ */
.chart-card-profit {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.chart-container-profit {
    height: 340px;
    position: relative;
    padding: 0 1.25rem 1.25rem;
}

@media (max-width: 575.98px) {
    .chart-container-profit {
        height: 240px;
        padding: 0 0.75rem 0.75rem;
    }
}

/* ============================================================
   تحلیل حاشیه سود
   ============================================================ */
.margin-analysis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.margin-block {
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #f8fafc;
    position: relative;
}

.margin-block.best {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(16, 185, 129, 0.02) 100%);
    border-color: rgba(16, 185, 129, 0.2);
}

.margin-block.worst {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.06) 0%, rgba(239, 68, 68, 0.02) 100%);
    border-color: rgba(239, 68, 68, 0.2);
}

.margin-block .mb-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.margin-block.best .mb-label { color: #059669; }
.margin-block.worst .mb-label { color: #dc2626; }

.margin-block .mb-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.4rem;
}

.margin-block .mb-value {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
}

.margin-block.best .mb-value { color: #10b981; }
.margin-block.worst .mb-value { color: #ef4444; }

.margin-block .mb-hint {
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0;
}

/* ============================================================
   بخش‌های صورت سود و زیان
   ============================================================ */
.pl-statement {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.pl-statement-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.pl-statement-header h6 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pl-statement-header .period {
    font-size: 0.72rem;
    color: #94a3b8;
    padding: 0.25rem 0.6rem;
    background: rgba(148, 163, 184, 0.15);
    border-radius: 999px;
}

.pl-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    gap: 0.75rem;
    transition: background 0.15s;
    font-size: 0.85rem;
}

.pl-row:hover {
    background: #f8fafc;
}

.pl-row:last-child {
    border-bottom: none;
}

.pl-row.section-header {
    background: #f8fafc;
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0.6rem 1.25rem;
}

.pl-row.section-header:hover {
    background: #f8fafc;
}

.pl-row .pr-label {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.pl-row .pr-label i {
    color: var(--primary);
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.pl-row .pr-amount {
    font-weight: 700;
    white-space: nowrap;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.pl-row .pr-amount.positive { color: #10b981; }
.pl-row .pr-amount.negative { color: #ef4444; }

.pl-row .pr-percent {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-right: 0.5rem;
    font-weight: 500;
}

.pl-row.subtotal {
    background: #f8fafc;
    font-weight: 700;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
}

.pl-row.subtotal .pr-label {
    font-weight: 700;
    color: var(--text-primary);
}

.pl-row.total {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0.03) 100%);
    padding: 1.1rem 1.25rem;
    font-weight: 800;
    font-size: 0.95rem;
}

.pl-row.total .pr-label {
    color: var(--text-primary);
    font-weight: 800;
}

.pl-row.total .pr-label i {
    color: var(--primary);
    font-size: 1.05rem;
}

.pl-row.total .pr-amount {
    color: var(--primary);
    font-size: 1.1rem;
    letter-spacing: -0.3px;
}

/* نشانگر سود/زیان */
.pl-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    margin-right: 0.35rem;
}

.pl-status-badge.profit {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.pl-status-badge.loss {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

/* ============================================================
   سودآورترین محصولات
   ============================================================ */
.profit-products-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profit-product-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px dashed #f1f5f9;
}

.profit-product-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.profit-product-item:first-child {
    padding-top: 0;
}

.profit-product-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #047857;
}

.profit-product-info {
    flex: 1;
    min-width: 0;
}

.profit-product-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profit-product-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.profit-product-stats {
    text-align: left;
    flex-shrink: 0;
}

.profit-product-profit {
    font-size: 0.85rem;
    font-weight: 800;
    color: #10b981;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.profit-product-profit small {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 0.15rem;
}

.profit-product-margin {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0.15rem 0 0;
    padding: 0.1rem 0.4rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 5px;
    display: inline-block;
}

/* ============================================================
   جدول مقایسه ماهانه
   ============================================================ */
.monthly-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}

.monthly-compare-table thead th {
    background: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0.75rem 0.85rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.monthly-compare-table tbody td {
    padding: 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-primary);
    vertical-align: middle;
}

.monthly-compare-table tbody tr:hover {
    background: #f8fafc;
}

.monthly-compare-table tbody tr:last-child td {
    border-bottom: none;
}

.monthly-compare-table tfoot td {
    padding: 0.85rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(99, 102, 241, 0.02) 100%);
    font-weight: 800;
    color: var(--text-primary);
    border-top: 2px solid rgba(99, 102, 241, 0.15);
    font-size: 0.85rem;
}

/* نوار پیشرفت ماهانه */
.month-bar {
    height: 5px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.35rem;
    width: 100%;
    max-width: 120px;
}

.month-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    border-radius: 999px;
    transition: width 0.5s;
}

/* ============================================================
   نمودار تفکیک هزینه
   ============================================================ */
.chart-container-expense-split {
    height: 260px;
    position: relative;
}

/* ============================================================
   نوار نسبت‌ها
   ============================================================ */
.ratio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}

.ratio-card {
    padding: 0.9rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.ratio-card:hover {
    border-color: var(--primary);
    background: #fff;
}

.ratio-card .rc-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0 0 0.35rem;
    font-weight: 500;
}

.ratio-card .rc-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.3px;
}

.ratio-card .rc-value.pos { color: #10b981; }
.ratio-card .rc-value.neg { color: #ef4444; }

.ratio-card .rc-hint {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin: 0.2rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
