/* FILE: static/css/crm-modern.css */
/* ═══════════════════════════════════════════════════════════
   HAKAN PAYLAR CRM — Modern Components
   کامپوننت‌های مشترک برای همه صفحات
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   ۱) PAGE HERO — سربرگ گرادیانت
   ═══════════════════════════════════════════════════════════ */
.modern-hero {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 30px 34px;
    margin-bottom: 26px;
    background: linear-gradient(120deg, #0f172a 0%, #1e3a8a 50%, #4f46e5 100%);
    box-shadow: 0 18px 45px rgba(30, 58, 138, 0.22);
    color: #fff;
}
.modern-hero::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -10%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.28), transparent 65%);
    border-radius: 50%;
    pointer-events: none;
}
.modern-hero::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: 8%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.22), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.modern-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 26px;
    flex-wrap: wrap;
}
.modern-hero-start {
    display: flex;
    align-items: center;
    gap: 20px;
}
.modern-hero-icon {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 32px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
.modern-hero-title {
    margin: 0 0 5px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: #fff;
}
.modern-hero-subtitle {
    margin: 0;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.75);
}
.modern-hero-kicker {
    display: block;
    font-size: 9px;
    color: rgba(165, 180, 252, 0.95);
    letter-spacing: 3.5px;
    font-weight: 800;
    margin-bottom: 6px;
}

/* ─── HERO STATS ─── */
.modern-hero-stats {
    display: flex;
    gap: 14px;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
}
.modern-stat {
    text-align: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    min-width: 110px;
    transition: all 0.22s ease;
}
.modern-stat:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
}
.modern-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}
.modern-stat-label {
    display: block;
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   ۲) MODERN GRID — گرید کارت‌ها
   ═══════════════════════════════════════════════════════════ */
.modern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}
.modern-grid.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}
.modern-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}
.modern-grid.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ═══════════════════════════════════════════════════════════
   ۳) MODERN CARD — کارت
   ═══════════════════════════════════════════════════════════ */
.modern-card {
    position: relative;
    background: #fff;
    border: 1px solid #e8edf4;
    border-radius: 20px;
    padding: 22px;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.modern-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--card-color, #4f46e5);
    opacity: 0;
    transition: opacity 0.28s ease;
}
.modern-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
    border-color: var(--card-color, #4f46e5);
}
.modern-card:hover::before { opacity: 1; }

.modern-card-icon {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 17px;
    font-size: 24px;
    margin-bottom: 16px;
    background: var(--card-bg, #eef2ff);
    color: var(--card-color, #4f46e5);
    transition: all 0.28s ease;
}
.modern-card:hover .modern-card-icon {
    transform: scale(1.1) rotate(-4deg);
}
.modern-card-title {
    margin: 0 0 7px;
    font-size: 16px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.3px;
}
.modern-card-desc {
    margin: 0 0 16px;
    font-size: 11.5px;
    color: #6b7280;
    line-height: 1.65;
    min-height: 34px;
}
.modern-card-actions {
    display: flex;
    gap: 8px;
}
.modern-card-actions .btn {
    flex: 1;
    padding: 9px 14px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    transition: all 0.18s ease;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    border: 1px solid transparent;
}
.modern-card-actions .btn-list {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}
.modern-card-actions .btn-list:hover {
    background: #e5e7eb;
    color: #111827;
    transform: translateY(-1px);
}
.modern-card-actions .btn-new {
    background: var(--card-color, #4f46e5);
    color: #fff;
}
.modern-card-actions .btn-new:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    color: #fff;
}

/* ─── COLOR VARIANTS ─── */
.modern-card.color-blue    { --card-color: #3b82f6; --card-bg: #dbeafe; }
.modern-card.color-green   { --card-color: #10b981; --card-bg: #d1fae5; }
.modern-card.color-orange  { --card-color: #f97316; --card-bg: #ffedd5; }
.modern-card.color-purple  { --card-color: #8b5cf6; --card-bg: #ede9fe; }
.modern-card.color-red     { --card-color: #ef4444; --card-bg: #fee2e2; }
.modern-card.color-teal    { --card-color: #14b8a6; --card-bg: #ccfbf1; }
.modern-card.color-emerald { --card-color: #059669; --card-bg: #d1fae5; }
.modern-card.color-yellow  { --card-color: #f59e0b; --card-bg: #fef3c7; }
.modern-card.color-cyan    { --card-color: #06b6d4; --card-bg: #cffafe; }
.modern-card.color-pink    { --card-color: #ec4899; --card-bg: #fce7f3; }
.modern-card.color-indigo  { --card-color: #6366f1; --card-bg: #e0e7ff; }
.modern-card.color-rose    { --card-color: #e11d48; --card-bg: #ffe4e6; }
.modern-card.color-slate   { --card-color: #64748b; --card-bg: #e2e8f0; }

/* ═══════════════════════════════════════════════════════════
   ۴) KPI CARD — کارت آماری (درون صفحه، نه هیرو)
   ═══════════════════════════════════════════════════════════ */
.modern-kpi {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e8edf4;
    border-radius: 18px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.25s ease;
}
.modern-kpi:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.09);
}
.modern-kpi-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 20px;
    background: var(--kpi-bg, #eef2ff);
    color: var(--kpi-color, #4f46e5);
}
.modern-kpi-info {
    min-width: 0;
    flex: 1;
}
.modern-kpi-info span {
    display: block;
    font-size: 10.5px;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 3px;
}
.modern-kpi-info h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    color: #111827;
    letter-spacing: -0.6px;
    line-height: 1.15;
    white-space: nowrap;
}
.modern-kpi-info small {
    display: block;
    font-size: 9.5px;
    color: #9ca3af;
    margin-top: 1px;
}
.modern-kpi-watermark {
    position: absolute;
    bottom: -14px;
    left: -8px;
    font-size: 60px;
    opacity: 0.05;
    color: var(--kpi-color, #4f46e5);
    pointer-events: none;
}

/* ─── KPI COLORS ─── */
.modern-kpi.kpi-primary { --kpi-color: #3b82f6; --kpi-bg: #dbeafe; }
.modern-kpi.kpi-success { --kpi-color: #10b981; --kpi-bg: #d1fae5; }
.modern-kpi.kpi-warning { --kpi-color: #f59e0b; --kpi-bg: #fef3c7; }
.modern-kpi.kpi-danger  { --kpi-color: #ef4444; --kpi-bg: #fee2e2; }
.modern-kpi.kpi-info    { --kpi-color: #06b6d4; --kpi-bg: #cffafe; }
.modern-kpi.kpi-purple  { --kpi-color: #8b5cf6; --kpi-bg: #ede9fe; }

/* ═══════════════════════════════════════════════════════════
   ۵) QUICK ACTIONS — دکمه‌های سریع
   ═══════════════════════════════════════════════════════════ */
.modern-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.modern-quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #fafbfc;
    border: 1px solid #edf1f6;
    border-radius: 14px;
    text-decoration: none;
    color: #111827;
    transition: all 0.2s ease;
}
.modern-quick-action:hover {
    background: #fff;
    border-color: var(--qa-color, #4f46e5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
    color: #111827;
}
.modern-quick-action-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 17px;
    background: var(--qa-bg, #eef2ff);
    color: var(--qa-color, #4f46e5);
}
.modern-quick-action-body {
    flex: 1;
    min-width: 0;
}
.modern-quick-action-body strong {
    display: block;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 2px;
}
.modern-quick-action-body small {
    display: block;
    font-size: 10.5px;
    color: #6b7280;
}
.modern-quick-action .arrow {
    color: #c7ccd6;
    font-size: 11px;
    transition: all 0.2s ease;
}
.modern-quick-action:hover .arrow {
    color: var(--qa-color, #4f46e5);
    transform: translateX(-3px);
}

/* ═══════════════════════════════════════════════════════════
   ۶) SECTION CARD — کارت با عنوان
   ═══════════════════════════════════════════════════════════ */
.modern-section {
    background: #fff;
    border: 1px solid #e8edf4;
    border-radius: 20px;
    padding: 22px;
    margin-bottom: 20px;
}
.modern-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f3f8;
}
.modern-section-header .kicker {
    display: block;
    font-size: 8.5px;
    color: #9aa6b8;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 3px;
}
.modern-section-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.3px;
}

/* ═══════════════════════════════════════════════════════════
   ۷) LIVE CHIP
   ═══════════════════════════════════════════════════════════ */
.modern-live-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #d1fae5;
    border-radius: 20px;
    font-size: 9.5px;
    font-weight: 800;
}
.modern-live-chip i {
    font-size: 6px;
}

/* ═══════════════════════════════════════════════════════════
   ۸) STATUS LIST — لیست وضعیت
   ═══════════════════════════════════════════════════════════ */
.modern-status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.modern-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fafbfd;
    border: 1px solid #f0f2f6;
    border-radius: 12px;
    font-size: 11.5px;
}
.modern-status-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-weight: 600;
}
.modern-status-label i {
    color: #94a3b8;
    width: 16px;
    text-align: center;
    font-size: 12px;
}
.modern-status-value {
    color: #111827;
    font-weight: 800;
    font-size: 11.5px;
}

/* ═══════════════════════════════════════════════════════════
   ۹) MOBILE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .modern-hero {
        padding: 22px;
        border-radius: 18px;
        margin-bottom: 18px;
    }
    .modern-hero-icon {
        width: 56px;
        height: 56px;
        font-size: 26px;
        border-radius: 17px;
    }
    .modern-hero-title {
        font-size: 22px;
    }
    .modern-hero-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .modern-hero-stats {
        width: 100%;
        gap: 8px;
    }
    .modern-stat {
        padding: 8px 12px;
        min-width: 75px;
        flex: 1;
    }
    .modern-stat-value {
        font-size: 18px;
    }
    .modern-stat-label {
        font-size: 9px;
    }
    .modern-grid,
    .modern-grid.grid-2,
    .modern-grid.grid-3,
    .modern-grid.grid-4 {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .modern-card {
        padding: 16px;
        border-radius: 16px;
    }
    .modern-card-icon {
        width: 46px;
        height: 46px;
        font-size: 20px;
        border-radius: 14px;
        margin-bottom: 12px;
    }
    .modern-card-title {
        font-size: 14px;
    }
    .modern-card-desc {
        font-size: 11px;
        min-height: 28px;
    }
    .modern-section {
        padding: 16px;
        border-radius: 16px;
    }
    .modern-kpi {
        padding: 14px;
    }
    .modern-kpi-info h3 {
        font-size: 18px;
    }
}

/* ═══════════════════════════════════════════════════════════
   ۱۰) FILTER BAR — نوار فیلتر
   ═══════════════════════════════════════════════════════════ */
.modern-filter-bar {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e8edf4;
    border-radius: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}
.modern-filter-search {
    flex: 1;
    min-width: 220px;
    position: relative;
}
.modern-filter-search i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa6b8;
    font-size: 13px;
    pointer-events: none;
}
.modern-filter-search input {
    width: 100%;
    height: 42px;
    padding: 0 40px 0 14px;
    border: 1px solid #e0e6ef;
    border-radius: 12px;
    background: #fafbfc;
    font-size: 12px;
    outline: none;
    transition: all 0.2s ease;
}
.modern-filter-search input:focus {
    background: #fff;
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79,70,229,0.08);
}
.modern-filter-select {
    height: 42px;
    min-width: 140px;
    padding: 0 14px;
    border: 1px solid #e0e6ef;
    border-radius: 12px;
    background: #fafbfc;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}
.modern-filter-select:focus {
    border-color: #4f46e5;
    background: #fff;
}
.modern-filter-submit {
    height: 42px;
    padding: 0 20px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 6px 15px rgba(79,70,229,0.22);
}
.modern-filter-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(79,70,229,0.32);
}
.modern-filter-reset {
    height: 42px;
    padding: 0 16px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s ease;
}
.modern-filter-reset:hover {
    background: #e5e7eb;
    color: #111827;
}

/* ═══════════════════════════════════════════════════════════
   ۱۱) MODERN TABLE — جدول مدرن
   ═══════════════════════════════════════════════════════════ */
.modern-table-wrap {
    background: #fff;
    border: 1px solid #e8edf4;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
}
.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.modern-table thead th {
    padding: 14px 16px;
    text-align: right;
    background: #f8fafc;
    color: #687589;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #e8edf4;
    white-space: nowrap;
}
.modern-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f3f8;
    vertical-align: middle;
    color: #1f2937;
}
.modern-table tbody tr {
    transition: background 0.15s ease;
}
.modern-table tbody tr:hover {
    background: #fafbff;
}
.modern-table tbody tr:last-child td {
    border-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════
   ۱۲) MODERN BADGE
   ═══════════════════════════════════════════════════════════ */
.modern-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
}
.modern-badge i { font-size: 9px; }
.modern-badge.badge-primary { background: #eef2ff; color: #4f46e5; }
.modern-badge.badge-success { background: #d1fae5; color: #059669; }
.modern-badge.badge-warning { background: #fef3c7; color: #d97706; }
.modern-badge.badge-danger  { background: #fee2e2; color: #dc2626; }
.modern-badge.badge-info    { background: #cffafe; color: #0891b2; }
.modern-badge.badge-purple  { background: #ede9fe; color: #7c3aed; }
.modern-badge.badge-slate   { background: #e2e8f0; color: #475569; }
.modern-badge.badge-gold    { background: #fef3c7; color: #b45309; }
.modern-badge.badge-silver  { background: #f1f5f9; color: #475569; }
.modern-badge.badge-bronze  { background: #fed7aa; color: #9a3412; }
.modern-badge.badge-new     { background: #cffafe; color: #0e7490; }

/* ═══════════════════════════════════════════════════════════
   ۱۳) CUSTOMER NAME
   ═══════════════════════════════════════════════════════════ */
.modern-customer-name {
    color: #111827;
    font-weight: 800;
    text-decoration: none;
    transition: color 0.15s ease;
}
.modern-customer-name:hover {
    color: #4f46e5;
}

/* ═══════════════════════════════════════════════════════════
   ۱۴) ACTION BUTTONS
   ═══════════════════════════════════════════════════════════ */
.modern-action-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.18s ease;
}
.modern-action-btn:hover {
    transform: translateY(-1px);
    color: #fff;
}
.modern-action-btn.view:hover { background: #4f46e5; border-color: #4f46e5; }
.modern-action-btn.edit:hover { background: #f59e0b; border-color: #f59e0b; }
.modern-action-btn.analyze:hover { background: #8b5cf6; border-color: #8b5cf6; }

/* ═══════════════════════════════════════════════════════════
   ۱۵) EMPTY STATE
   ═══════════════════════════════════════════════════════════ */
.modern-empty {
    padding: 60px 20px;
    text-align: center;
}
.modern-empty-icon {
    font-size: 50px;
    color: #cbd5e1;
    margin-bottom: 16px;
}
.modern-empty-title {
    font-size: 16px;
    font-weight: 800;
    color: #374151;
    margin-bottom: 6px;
}
.modern-empty-desc {
    color: #9aa6b8;
    font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════
   ۱۶) MOBILE FILTERS/TABLE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .modern-filter-bar {
        padding: 12px;
        gap: 8px;
    }
    .modern-filter-search {
        min-width: 100%;
    }
    .modern-filter-select {
        flex: 1;
        min-width: 0;
        height: 40px;
    }
    .modern-filter-submit,
    .modern-filter-reset {
        height: 40px;
        flex: 1;
        justify-content: center;
    }
    .modern-table thead th,
    .modern-table tbody td {
        padding: 10px 8px;
        font-size: 11px;
    }
}

/* ═══════════════════════════════════════════════════════════
   ۱۷) MOBILE BULLETPROOF — ضدگلوله برای موبایل
   ═══════════════════════════════════════════════════════════ */

/* ─── تبلت کوچیک و موبایل بزرگ ─── */
@media (max-width: 991.98px) {
    /* جلوگیری از overflow افقی */
    .modern-hero,
    .modern-filter-bar,
    .modern-table-wrap,
    .modern-section {
        max-width: 100%;
        overflow: hidden;
    }

    /* KPI های hero: wrap کنن و کوچیک‌تر */
    .modern-hero-stats {
        flex-wrap: wrap;
        gap: 8px;
    }
    .modern-stat {
        min-width: 90px;
    }
}

/* ─── موبایل ─── */
@media (max-width: 767px) {

    /* ═══ HERO ═══ */
    .modern-hero {
        padding: 20px 18px;
        border-radius: 16px;
        margin-bottom: 16px;
    }
    .modern-hero::before,
    .modern-hero::after {
        display: none; /* حذف گرادیانت‌های تزئینی که باعث overflow می‌شن */
    }
    .modern-hero-content {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .modern-hero-start {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .modern-hero-icon {
        width: 52px;
        height: 52px;
        font-size: 22px;
        border-radius: 15px;
    }
    .modern-hero-title {
        font-size: 20px;
        line-height: 1.2;
    }
    .modern-hero-subtitle {
        font-size: 11px;
        line-height: 1.5;
    }
    .modern-hero-kicker {
        font-size: 8px;
        letter-spacing: 2px;
    }

    /* KPI های hero: ۲x۲ grid */
    .modern-hero-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        width: 100%;
    }
    .modern-stat {
        min-width: 0;
        padding: 8px 10px;
        border-radius: 12px;
        text-align: center;
    }
    .modern-stat-value {
        font-size: 16px;
    }
    .modern-stat-label {
        font-size: 9px;
    }

    /* ═══ FILTER BAR ═══ */
    .modern-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px;
        border-radius: 14px;
    }
    .modern-filter-search {
        min-width: 0;
        width: 100%;
    }
    .modern-filter-search input {
        height: 40px;
        font-size: 13px; /* جلوگیری از zoom iOS */
    }
    .modern-filter-select {
        width: 100%;
        min-width: 0;
        height: 40px;
        font-size: 13px;
    }
    .modern-filter-submit,
    .modern-filter-reset {
        width: 100%;
        height: 40px;
        justify-content: center;
        font-size: 12px;
    }

    /* ═══ TABLE ═══ */
    .modern-table-wrap {
        border-radius: 14px;
        overflow: hidden;
    }
    /* جدول با scroll افقی روان */
    .modern-table-wrap .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .modern-table {
        min-width: 780px; /* اجبار به scroll افقی روی موبایل */
        font-size: 11px;
    }
    .modern-table thead th {
        padding: 10px 8px;
        font-size: 9.5px;
        white-space: nowrap;
    }
    .modern-table tbody td {
        padding: 10px 8px;
        font-size: 11px;
        white-space: nowrap;
    }
    /* ستون نام: با ellipsis */
    .modern-table tbody td:nth-child(2) {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .modern-customer-name {
        font-size: 12px;
    }

    /* Badge ها کوچیک‌تر */
    .modern-badge {
        padding: 3px 8px;
        font-size: 9.5px;
    }

    /* دکمه‌های عملیات */
    .modern-action-btn {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }

    /* ═══ BUTTONS ═══ */
    /* دکمه «ثبت مشتری جدید» — همون استایل inline رو override کن */
    .modern-hero + div[style*="justify-content:flex-end"] {
        margin-bottom: 12px !important;
    }
    .modern-hero + div[style*="justify-content:flex-end"] a {
        width: 100% !important;
        justify-content: center !important;
        padding: 12px 16px !important;
        font-size: 12px !important;
    }

    /* ═══ SECTION ═══ */
    .modern-section {
        padding: 16px;
        border-radius: 14px;
        margin-bottom: 14px;
    }
    .modern-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding-bottom: 12px;
    }
    .modern-section-header h3 {
        font-size: 14px;
    }

    /* ═══ EMPTY STATE ═══ */
    .modern-empty {
        padding: 40px 16px;
    }
    .modern-empty-icon {
        font-size: 40px;
    }
    .modern-empty-title {
        font-size: 14px;
    }
    .modern-empty-desc {
        font-size: 11px;
    }
}

/* ─── موبایل کوچیک ─── */
@media (max-width: 480px) {
    .modern-hero-stats {
        grid-template-columns: 1fr 1fr;
    }
    .modern-stat-value {
        font-size: 15px;
    }

    /* KPI های درون صفحه (نه hero) */
    .modern-kpi {
        padding: 12px;
        gap: 10px;
    }
    .modern-kpi-icon {
        width: 40px;
        height: 40px;
        font-size: 17px;
        border-radius: 12px;
    }
    .modern-kpi-info h3 {
        font-size: 17px;
    }
    .modern-kpi-info span {
        font-size: 9.5px;
    }
}

/* ═══════════════════════════════════════════════════════════
   ۱۸) SCROLL HINT — سایه کنار جدول برای اسکرول
   ═══════════════════════════════════════════════════════════ */
.modern-table-wrap {
    position: relative;
}
@media (max-width: 767px) {
    .modern-table-wrap::after {
        content: '← →';
        position: absolute;
        bottom: 6px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(79, 70, 229, 0.9);
        color: #fff;
        font-size: 9px;
        padding: 3px 10px;
        border-radius: 20px;
        pointer-events: none;
        opacity: 0.85;
        animation: fadeOutHint 3s forwards;
    }
    @keyframes fadeOutHint {
        0%, 70% { opacity: 0.85; }
        100% { opacity: 0; }
    }
}

/* ═══════════════════════════════════════════════════════════
   ۱۹) TOUCH IMPROVEMENTS
   ═══════════════════════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
    /* روی گوشی، hover رو غیرفعال کن (چون معنی نداره) */
    .modern-card:hover,
    .modern-kpi:hover,
    .modern-quick-action:hover,
    .modern-action-btn:hover {
        transform: none;
    }

    /* دکمه‌های عملیات همیشه رنگ داشته باشن (چون hover نداریم) */
    .modern-action-btn.view {
        background: #4f46e5;
        color: #fff;
        border-color: #4f46e5;
    }
    .modern-action-btn.analyze {
        background: #8b5cf6;
        color: #fff;
        border-color: #8b5cf6;
    }
    .modern-action-btn.edit {
        background: #f59e0b;
        color: #fff;
        border-color: #f59e0b;
    }

    /* اطمینان از حداقل اندازه‌ی touch target (۴۴px) */
    .modern-action-btn {
        min-width: 38px;
        min-height: 38px;
    }
    .modern-filter-select,
    .modern-filter-search input {
        min-height: 44px;
    }
    .modern-filter-submit,
    .modern-filter-reset {
        min-height: 44px;
    }
}

/* ═══════════════════════════════════════════════════════════
   ۲۰) ORDER STATUS BADGES — رنگ‌بندی وضعیت سفارش
   ═══════════════════════════════════════════════════════════ */
.order-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
}
.order-status i { font-size: 7px; }

.order-status.status-draft      { background: #f1f5f9; color: #475569; }
.order-status.status-submitted  { background: #dbeafe; color: #1e40af; }
.order-status.status-approved   { background: #ede9fe; color: #6d28d9; }
.order-status.status-preparing  { background: #fef3c7; color: #b45309; }
.order-status.status-out_for_delivery { background: #cffafe; color: #0e7490; }
.order-status.status-delivered  { background: #d1fae5; color: #065f46; }
.order-status.status-cancelled  { background: #fee2e2; color: #b91c1c; }

/* ═══════════════════════════════════════════════════════════
   ۲۱) AMOUNT CELL — نمایش مبلغ
   ═══════════════════════════════════════════════════════════ */
.order-amount {
    font-weight: 800;
    color: #059669;
    font-size: 12px;
    white-space: nowrap;
}
.order-amount small {
    color: #9ca3af;
    font-weight: 500;
    font-size: 9.5px;
    margin-right: 3px;
}

.order-number {
    font-weight: 800;
    color: #4f46e5;
    font-size: 12.5px;
    white-space: nowrap;
}

.order-time {
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   ۲۲) DATE FILTER — فیلتر تاریخ شمسی
   ═══════════════════════════════════════════════════════════ */
.modern-date-input {
    width: 140px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #e0e6ef;
    border-radius: 12px;
    background: #fafbfc;
    font-size: 13px;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: ltr;
    text-align: center;
    letter-spacing: 0.5px;
    outline: none;
    transition: all 0.2s ease;
}
.modern-date-input:focus {
    background: #fff;
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79,70,229,0.08);
}

/* ═══════════════════════════════════════════════════════════
   ۲۳) FULL-WIDTH ACTION BUTTON (responsive)
   ═══════════════════════════════════════════════════════════ */
.modern-new-btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(79,70,229,0.22);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}
.modern-new-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(79,70,229,0.32);
    color: #fff;
}
.modern-new-btn i { font-size: 13px; }

@media (max-width: 767px) {
    .modern-new-btn {
        width: 100%;
        justify-content: center;
    }
    .modern-date-input {
        width: 100% !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   ۲۴) STOCK PILL — نمایش موجودی
   ═══════════════════════════════════════════════════════════ */
.stock-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    background: #d1fae5;
    color: #065f46;
    white-space: nowrap;
}
.stock-pill.stock-low {
    background: #fef3c7;
    color: #b45309;
}
.stock-pill.stock-empty {
    background: #fee2e2;
    color: #b91c1c;
}

/* ═══════════════════════════════════════════════════════════
   ۲۵) PRODUCT NAME
   ═══════════════════════════════════════════════════════════ */
.product-name {
    color: #111827;
    font-weight: 800;
    text-decoration: none;
    font-size: 12.5px;
    transition: color 0.15s ease;
}
.product-name:hover {
    color: #4f46e5;
}
.product-code {
    display: inline-block;
    padding: 3px 9px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 8px;
    font-size: 10.5px;
    font-weight: 700;
    font-family: 'Vazirmatn', monospace;
}

/* ═══════════════════════════════════════════════════════════
   ۲۶) PRICE CELL
   ═══════════════════════════════════════════════════════════ */
.price-cell {
    font-weight: 800;
    color: #059669;
    font-size: 12px;
    white-space: nowrap;
}
.price-cell small {
    color: #9ca3af;
    font-weight: 500;
    font-size: 9.5px;
    margin-right: 3px;
}

/* ═══════════════════════════════════════════════════════════
   ۲۷) PAYMENT STATUS — وضعیت پرداخت
   ═══════════════════════════════════════════════════════════ */
.payment-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
}
.payment-status i { font-size: 7px; }

.payment-status.status-pending  { background: #fef3c7; color: #b45309; }
.payment-status.status-paid     { background: #d1fae5; color: #065f46; }
.payment-status.status-partial  { background: #dbeafe; color: #1e40af; }
.payment-status.status-failed   { background: #fee2e2; color: #b91c1c; }
.payment-status.status-refunded { background: #ede9fe; color: #6d28d9; }

/* ═══════════════════════════════════════════════════════════
   ۲۸) PAYMENT METHOD — روش پرداخت
   ═══════════════════════════════════════════════════════════ */
.payment-method {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
}
.payment-method i { font-size: 10px; }
.payment-method.method-cash     { background: #d1fae5; color: #065f46; }
.payment-method.method-card     { background: #dbeafe; color: #1e40af; }
.payment-method.method-transfer { background: #ede9fe; color: #6d28d9; }
.payment-method.method-check    { background: #fef3c7; color: #b45309; }
.payment-method.method-other    { background: #f1f5f9; color: #475569; }

/* ═══════════════════════════════════════════════════════════
   ۲۹) VISIT OUTCOME — رنگ‌بندی نتیجه ویزیت
   ═══════════════════════════════════════════════════════════ */
.visit-outcome {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
}
.visit-outcome i { font-size: 9px; }

.visit-outcome.outcome-order          { background: #d1fae5; color: #065f46; }
.visit-outcome.outcome-followup       { background: #dbeafe; color: #1e40af; }
.visit-outcome.outcome-not_interested { background: #fee2e2; color: #b91c1c; }
.visit-outcome.outcome-price_issue    { background: #fef3c7; color: #b45309; }
.visit-outcome.outcome-product_request { background: #ede9fe; color: #6d28d9; }
.visit-outcome.outcome-callback       { background: #cffafe; color: #0e7490; }
.visit-outcome.outcome-no_result      { background: #f1f5f9; color: #475569; }
.visit-outcome.outcome-other          { background: #f1f5f9; color: #475569; }

/* ═══════════════════════════════════════════════════════════
   ۳۰) FOLLOWUP STATUS — وضعیت پیگیری
   ═══════════════════════════════════════════════════════════ */
.followup-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
}
.followup-status i { font-size: 7px; }

.followup-status.status-pending     { background: #fef3c7; color: #b45309; }
.followup-status.status-in_progress { background: #dbeafe; color: #1e40af; }
.followup-status.status-completed   { background: #d1fae5; color: #065f46; }
.followup-status.status-cancelled   { background: #f1f5f9; color: #475569; }
.followup-status.status-overdue     { background: #fee2e2; color: #b91c1c; }

/* ═══════════════════════════════════════════════════════════
   ۳۱) DUE DATE — تاریخ سررسید
   ═══════════════════════════════════════════════════════════ */
.due-date {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
}
.due-date .date-part {
    font-weight: 700;
    color: #374151;
}
.due-date .time-part {
    font-size: 10px;
    color: #9ca3af;
}
.due-date.is-overdue .date-part {
    color: #b91c1c;
}

/* ═══════════════════════════════════════════════════════════
   ۳۲) TIME CHIP — نمایش ساعت
   ═══════════════════════════════════════════════════════════ */
.time-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.time-chip i { font-size: 10px; color: #94a3b8; }

/* ═══════════════════════════════════════════════════════════
   ۳۳) ROUTE CHIP — نمایش مسیر
   ═══════════════════════════════════════════════════════════ */
.route-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    background: #ede9fe;
    color: #6d28d9;
    border-radius: 8px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
}
.route-chip i { font-size: 9px; }

/* ═══════════════════════════════════════════════════════════
   ۳۴) ROLE BADGES — رنگ‌بندی نقش‌های کاربری
   ═══════════════════════════════════════════════════════════ */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}
.role-badge i { font-size: 9px; }

.role-badge.role-admin     { background: #fee2e2; color: #b91c1c; }
.role-badge.role-manager   { background: #ede9fe; color: #6d28d9; }
.role-badge.role-accountant { background: #cffafe; color: #0e7490; }
.role-badge.role-visitor   { background: #dbeafe; color: #1e40af; }
.role-badge.role-driver    { background: #d1fae5; color: #065f46; }
.role-badge.role-warehouse { background: #fef3c7; color: #b45309; }
.role-badge.role-other     { background: #f1f5f9; color: #475569; }

/* ═══════════════════════════════════════════════════════════
   ۳۵) USER AVATAR — آواتار کاربر در جدول
   ═══════════════════════════════════════════════════════════ */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.user-avatar-mini {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    box-shadow: 0 4px 10px rgba(79,70,229,0.22);
}
.user-avatar-mini.avatar-green {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 10px rgba(16,185,129,0.22);
}
.user-avatar-mini.avatar-orange {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 4px 10px rgba(249,115,22,0.22);
}
.user-avatar-mini.avatar-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 10px rgba(239,68,68,0.22);
}
.user-avatar-mini.avatar-cyan {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    box-shadow: 0 4px 10px rgba(6,182,212,0.22);
}
.user-avatar-mini.avatar-purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    box-shadow: 0 4px 10px rgba(139,92,246,0.22);
}
.user-cell-body {
    min-width: 0;
    flex: 1;
}
.user-cell-body strong {
    display: block;
    font-size: 12px;
    color: #111827;
    font-weight: 800;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-cell-body small {
    display: block;
    font-size: 10px;
    color: #9aa6b8;
}

/* ═══════════════════════════════════════════════════════════
   ۳۶) ROUTE CUSTOMER COUNT
   ═══════════════════════════════════════════════════════════ */
.route-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    background: #cffafe;
    color: #0e7490;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.route-count i { font-size: 10px; }

/* ═══════════════════════════════════════════════════════════
   ۳۷) ROUTE NUMBER CHIP
   ═══════════════════════════════════════════════════════════ */
.route-number-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    font-family: 'Vazirmatn', monospace;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(79,70,229,0.22);
}

/* ═══════════════════════════════════════════════════════════
   ۳۸) REGION CHIP
   ═══════════════════════════════════════════════════════════ */
.region-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    background: #ede9fe;
    color: #6d28d9;
    border-radius: 8px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   ۳۹) ACTION BUTTON GROUP
   ═══════════════════════════════════════════════════════════ */
.action-group {
    display: inline-flex;
    gap: 6px;
}

/* ═══════════════════════════════════════════════════════════
   ۴۰) DELIVERY CARD — کارت تحویل
   ═══════════════════════════════════════════════════════════ */
.delivery-card {
    position: relative;
    background: #fff;
    border: 1px solid #e8edf4;
    border-radius: 18px;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.delivery-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--delivery-color, #4f46e5);
    opacity: 0.9;
}
.delivery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    border-color: var(--delivery-color, #4f46e5);
}

/* ─── ردیف بالا: شماره + وضعیت ─── */
.delivery-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f3f8;
}
.delivery-card-order-num {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 900;
    color: #4f46e5;
    letter-spacing: -0.3px;
}

/* ─── بدنه ─── */
.delivery-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}
.delivery-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11.5px;
    line-height: 1.5;
}
.delivery-row i {
    color: #94a3b8;
    font-size: 12px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 2px;
}
.delivery-row-label {
    color: #6b7280;
    font-weight: 600;
    flex-shrink: 0;
}
.delivery-row-value {
    color: #111827;
    font-weight: 700;
    min-width: 0;
    word-break: break-word;
}
.delivery-row-value.customer-name {
    font-size: 13.5px;
    color: #111827;
    font-weight: 800;
}

/* ─── آدرس ─── */
.delivery-address {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.65;
    color: #4b5563;
}
.delivery-address i {
    color: #4f46e5;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ─── دکمه‌ها ─── */
.delivery-card-actions {
    display: flex;
    gap: 8px;
    flex-direction: column;
}
.delivery-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 14px;
    border-radius: 11px;
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 40px;
}
.delivery-btn-primary {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    box-shadow: 0 6px 15px rgba(79,70,229,0.22);
}
.delivery-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(79,70,229,0.32);
    color: #fff;
}
.delivery-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}
.delivery-btn-secondary:hover {
    background: #e5e7eb;
    color: #111827;
    transform: translateY(-1px);
}

/* ─── رنگ بر اساس وضعیت ─── */
.delivery-card.status-approved  { --delivery-color: #8b5cf6; }
.delivery-card.status-out_for_delivery { --delivery-color: #06b6d4; }

/* ─── GRID تحویل ─── */
.delivery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* ═══════════════════════════════════════════════════════════
   ۴۱) PIPELINE STAGE BADGE
   ═══════════════════════════════════════════════════════════ */
.pipeline-stage {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
    background: #ede9fe;
    color: #6d28d9;
}
.pipeline-stage i { font-size: 8px; }

/* ═══════════════════════════════════════════════════════════
   ۴۲) AMOUNT CHIP — نمایش مبلغ فرصت
   ═══════════════════════════════════════════════════════════ */
.opportunity-amount {
    font-weight: 900;
    color: #059669;
    font-size: 12.5px;
    white-space: nowrap;
}
.opportunity-amount small {
    color: #9ca3af;
    font-weight: 500;
    font-size: 9.5px;
    margin-right: 3px;
}

/* ═══════════════════════════════════════════════════════════
   ۴۳) OWNER AVATAR در جدول
   ═══════════════════════════════════════════════════════════ */
.owner-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}
.owner-avatar {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-weight: 800;
    font-size: 11px;
}

/* ═══════════════════════════════════════════════════════════
   ۴۴) MOBILE — تحویل و فرصت
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .delivery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .delivery-card {
        padding: 16px;
        border-radius: 14px;
    }
    .delivery-card-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }
    .delivery-card-order-num {
        font-size: 13px;
    }
    .delivery-card-body {
        gap: 8px;
        margin-bottom: 12px;
    }
    .delivery-row {
        font-size: 11px;
    }
    .delivery-row-value.customer-name {
        font-size: 12.5px;
    }
    .delivery-address {
        padding: 8px 10px;
        font-size: 10.5px;
    }
    .delivery-btn {
        min-height: 44px;
        font-size: 12px;
    }
}

/* ═══════════════════════════════════════════════════════════
   ۴۵) LOGIN PAGE — بهبود
   ═══════════════════════════════════════════════════════════ */
.login-visual-copy h1 {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════
   ۴۶) ORDER DETAIL — بهبود وضعیت
   ═══════════════════════════════════════════════════════════ */
.order-status-large {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    background: #ede9fe;
    color: #6d28d9;
}

/* ═══════════════════════════════════════════════════════════
   ۴۷) NOTIFICATION TABS — تب‌های فیلتر اعلان
   ═══════════════════════════════════════════════════════════ */
.notif-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 700;
    color: #6b7280;
    background: transparent;
    text-decoration: none;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.notif-tab:hover {
    background: #f3f4f6;
    color: #111827;
}
.notif-tab.active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    box-shadow: 0 6px 15px rgba(79,70,229,0.22);
}
.notif-tab-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ef4444;
    color: #fff;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.notif-tab.active .notif-tab-badge {
    background: rgba(255,255,255,0.25);
}

/* ═══════════════════════════════════════════════════════════
   ۴۸) NOTIFICATION LIST — لیست اعلان‌ها
   ═══════════════════════════════════════════════════════════ */
.notif-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notif-item {
    position: relative;
    display: flex;
    gap: 16px;
    padding: 18px;
    background: #fff;
    border: 1px solid #e8edf4;
    border-radius: 16px;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.notif-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--notif-color, #4f46e5);
    opacity: 0.7;
}
.notif-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.09);
    border-color: var(--notif-color, #4f46e5);
}

/* رنگ بر اساس اولویت */
.notif-priority-info      { --notif-color: #3b82f6; }
.notif-priority-important { --notif-color: #f59e0b; }
.notif-priority-warning   { --notif-color: #f97316; }
.notif-priority-critical  { --notif-color: #ef4444; }

/* حالت خوانده‌نشده */
.notif-item.notif-unread {
    background: linear-gradient(90deg, rgba(79,70,229,0.04) 0%, #fff 30%);
}

/* ─── آیکن ─── */
.notif-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    font-size: 18px;
    background: var(--notif-bg, #eef2ff);
    color: var(--notif-color, #4f46e5);
}
.notif-priority-info .notif-icon      { background: #dbeafe; }
.notif-priority-important .notif-icon { background: #fef3c7; }
.notif-priority-warning .notif-icon   { background: #ffedd5; }
.notif-priority-critical .notif-icon  { background: #fee2e2; }

/* ─── محتوا ─── */
.notif-body {
    flex: 1;
    min-width: 0;
}
.notif-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.notif-title {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: #111827;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.notif-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(239,68,68,0.15);
    animation: pulseDot 2s infinite;
    flex-shrink: 0;
}
@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 0 4px rgba(239,68,68,0.15); }
    50% { box-shadow: 0 0 0 8px rgba(239,68,68,0.05); }
}
.notif-time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    color: #9aa6b8;
    white-space: nowrap;
    flex-shrink: 0;
}
.notif-time i { font-size: 9px; }
.notif-message {
    margin: 0 0 12px;
    font-size: 12px;
    color: #4b5563;
    line-height: 1.65;
}
.notif-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.notif-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 13px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.18s ease;
    border: 1px solid transparent;
}
.notif-btn-primary {
    background: #4f46e5;
    color: #fff;
}
.notif-btn-primary:hover {
    background: #4338ca;
    color: #fff;
    transform: translateY(-1px);
}
.notif-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}
.notif-btn-secondary:hover {
    background: #e5e7eb;
    color: #111827;
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════
   ۴۹) MOBILE — اعلان‌ها و داشبورد
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    /* تب‌های اعلان */
    .notif-tab {
        flex: 1;
        justify-content: center;
        padding: 9px 12px;
        font-size: 10.5px;
        gap: 5px;
    }
    .notif-tab-badge {
        min-width: 18px;
        height: 18px;
        font-size: 9px;
    }

    /* آیتم اعلان */
    .notif-item {
        padding: 14px;
        gap: 12px;
        border-radius: 14px;
    }
    .notif-icon {
        width: 38px;
        height: 38px;
        font-size: 15px;
        border-radius: 11px;
    }
    .notif-title {
        font-size: 12.5px;
    }
    .notif-time {
        font-size: 9.5px;
    }
    .notif-message {
        font-size: 11px;
        margin-bottom: 10px;
    }
    .notif-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 10px;
        font-size: 10.5px;
    }

    /* داشبورد ماژول‌ها */
    .modern-grid.grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .modern-card {
        padding: 14px;
    }
    .modern-card-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    .modern-card-title {
        font-size: 13px;
    }
    .modern-card-desc {
        font-size: 10.5px;
        min-height: 28px;
    }
}

@media (max-width: 480px) {
    .modern-grid.grid-4 {
        grid-template-columns: 1fr;
    }
    .notif-tab span:not(.notif-tab-badge) {
        display: none;
    }
    .notif-tab i {
        font-size: 14px;
    }
}

/* ═══════════════════════════════════════════════════════════
   ۵۰) DASHBOARD CUSTOMIZATION
   ═══════════════════════════════════════════════════════════ */

.custom-section.card {
    border: 1px solid #e8edf4;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15,23,42,0.04);
}
.custom-section .card-header {
    background: linear-gradient(90deg, #f8fafc 0%, #fff 100%);
    padding: 12px 18px;
    border-bottom: 1px solid #e8edf4;
    font-size: 14px;
}
.custom-section .card-body { padding: 18px; }

.custom-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.custom-row label {
    min-width: 140px;
    font-size: 12.5px;
    color: #4b5563;
    font-weight: 600;
}

.custom-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px !important;
    background: #fafbfc;
    border-bottom: 1px solid #f0f3f8 !important;
}
.custom-item:last-child { border-bottom: 0 !important; }

.drag-handle {
    cursor: grab;
    color: #94a3b8;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
    user-select: none;
}
.drag-handle:hover {
    color: #4f46e5;
    background: rgba(79,70,229,0.08);
}
.drag-handle:active { cursor: grabbing; }

/* ─── Theme Grid ─── */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.theme-card {
    position: relative;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.22s ease;
    text-align: center;
    background: #fff;
}
.theme-card:hover {
    border-color: #c7d2fe;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15,23,42,0.08);
}
.theme-card.active {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}
.theme-card.active::after {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: #4f46e5;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
}
.theme-preview {
    height: 60px;
    border-radius: 8px;
    margin-bottom: 6px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
}
.theme-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #374151;
}

/* ─── Mobile ─── */
@media (max-width: 767px) {
    .custom-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    .custom-item .item-field,
    .custom-item .item-label {
        max-width: 100% !important;
        flex: 1 1 auto;
    }
    .custom-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .custom-row label {
        min-width: 0;
    }
    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .theme-preview { height: 50px; }
}

/* ═══════════════════════════════════════════════════════════
   ۵۱) DASHBOARD COLORS — متغیرها
   ═══════════════════════════════════════════════════════════ */

/* Quick Action colors */
.modern-quick-action[data-qa-color="primary"]  { --qa-color: #4f46e5; --qa-bg: #eef2ff; }
.modern-quick-action[data-qa-color="success"]  { --qa-color: #10b981; --qa-bg: #d1fae5; }
.modern-quick-action[data-qa-color="warning"]  { --qa-color: #f59e0b; --qa-bg: #fef3c7; }
.modern-quick-action[data-qa-color="danger"]   { --qa-color: #ef4444; --qa-bg: #fee2e2; }
.modern-quick-action[data-qa-color="info"]     { --qa-color: #06b6d4; --qa-bg: #cffafe; }
.modern-quick-action[data-qa-color="purple"]   { --qa-color: #8b5cf6; --qa-bg: #ede9fe; }
.modern-quick-action[data-qa-color="indigo"]   { --qa-color: #6366f1; --qa-bg: #e0e7ff; }
.modern-quick-action[data-qa-color="green"]    { --qa-color: #10b981; --qa-bg: #d1fae5; }
.modern-quick-action[data-qa-color="orange"]   { --qa-color: #f97316; --qa-bg: #ffedd5; }
.modern-quick-action[data-qa-color="emerald"]  { --qa-color: #059669; --qa-bg: #d1fae5; }
.modern-quick-action[data-qa-color="cyan"]     { --qa-color: #06b6d4; --qa-bg: #cffafe; }
.modern-quick-action[data-qa-color="teal"]     { --qa-color: #14b8a6; --qa-bg: #ccfbf1; }
.modern-quick-action[data-qa-color="rose"]     { --qa-color: #e11d48; --qa-bg: #ffe4e6; }

/* Modern card colors (اگه جدید اضافه شدن) */
.modern-card.color-emerald { --card-color: #059669; --card-bg: #d1fae5; }
.modern-card.color-teal    { --card-color: #14b8a6; --card-bg: #ccfbf1; }
.modern-card.color-cyan    { --card-color: #06b6d4; --card-bg: #cffafe; }
.modern-card.color-rose    { --card-color: #e11d48; --card-bg: #ffe4e6; }

/* Modern KPI colors */
.modern-kpi.kpi-purple { --kpi-color: #8b5cf6; --kpi-bg: #ede9fe; }
.modern-kpi.kpi-indigo { --kpi-color: #6366f1; --kpi-bg: #e0e7ff; }
.modern-kpi.kpi-green  { --kpi-color: #10b981; --kpi-bg: #d1fae5; }
.modern-kpi.kpi-orange { --kpi-color: #f97316; --kpi-bg: #ffedd5; }
.modern-kpi.kpi-emerald { --kpi-color: #059669; --kpi-bg: #d1fae5; }
.modern-kpi.kpi-cyan   { --kpi-color: #06b6d4; --kpi-bg: #cffafe; }
.modern-kpi.kpi-teal   { --kpi-color: #14b8a6; --kpi-bg: #ccfbf1; }
.modern-kpi.kpi-rose   { --kpi-color: #e11d48; --kpi-bg: #ffe4e6; }