    /* ============ استایل‌های پایه ============ */
    .org-chart-page {
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
        min-height: 100vh;
        padding: 40px 0;
    }
    
    .org-chart-container {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 20px;
        box-shadow: 0 20px 60px rgba(0,0,0,0.15);
        padding: 40px;
        backdrop-filter: blur(10px);
    }
    
    /* ============ هدر چارت ============ */
    .org-header {
        text-align: center;
        margin-bottom: 40px;
        padding-bottom: 30px;
        border-bottom: 3px solid #e9ecef;
        position: relative;
    }
    
    .org-header::after {
        content: '';
        position: absolute;
        bottom: -3px;
        left: 50%;
        transform: translateX(-50%);
        width: 100px;
        height: 3px;
        background: linear-gradient(90deg, #667eea, #764ba2);
        border-radius: 3px;
    }
    
    .org-header h1 {
        font-size: 2.5rem;
        font-weight: 700;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        margin-bottom: 10px;
    }
    
    .org-header p {
        color: #6c757d;
        font-size: 1.1rem;
    }
    
    /* ============ کارت آمار ============ */
    .stats-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
        margin-bottom: 40px;
    }
    
    .stat-card {
        background: white;
        padding: 20px 25px;
        border-radius: 15px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.08);
        text-align: center;
        transition: all 0.3s ease;
        border: 1px solid rgba(102, 126, 234, 0.1);
    }
    
    .stat-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.2);
    }
    
    .stat-card .stat-icon {
        font-size: 30px;
        color: #667eea;
        margin-bottom: 10px;
        display: block;
    }
    
    .stat-card .stat-number {
        font-size: 28px;
        font-weight: 700;
        color: #2d3436;
        display: block;
    }
    
    .stat-card .stat-label {
        color: #6c757d;
        font-size: 14px;
        margin-top: 5px;
        display: block;
    }
    
    /* ============ چارت درختی ============ */
    .tree {
        position: relative;
        padding: 20px 0;
    }
    
    .tree ul {
        padding-top: 20px;
        position: relative;
        transition: all 0.5s ease;
        list-style: none;
        padding-left: 0;
    }
    
    .tree ul::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        border-left: 2px solid #dce1e8;
        height: 20px;
    }
    
    .tree ul:first-child::before {
        display: none;
    }
    
    .tree li {
        float: none;
        display: inline-block;
        vertical-align: top;
        text-align: center;
        list-style: none;
        padding: 20px 15px 0 15px;
        position: relative;
        transition: all 0.5s ease;
    }
    
    /* خطوط اتصال */
    .tree li::before, .tree li::after {
        content: '';
        position: absolute;
        top: 0;
        right: 50%;
        border-top: 2px solid #dce1e8;
        width: 50%;
        height: 20px;
    }
    
    .tree li::after {
        right: auto;
        left: 50%;
        border-left: 2px solid #dce1e8;
    }
    
    .tree li:only-child::after, .tree li:only-child::before {
        display: none;
    }
    
    .tree li:only-child {
        padding-top: 0;
    }
    
    .tree li:first-child::before, .tree li:last-child::after {
        border: 0 none;
    }
    
    .tree li:last-child::before {
        border-right: 2px solid #dce1e8;
        border-radius: 0 5px 0 0;
    }
    
    .tree li:first-child::after {
        border-radius: 5px 0 0 0;
    }
    
    .tree ul ul::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        border-left: 2px solid #dce1e8;
        width: 0;
        height: 20px;
    }
    
    /* ============ کارت دپارتمان ============ */
    .department-card {
        background: white;
        border-radius: 16px;
        padding: 20px;
        min-width: 220px;
        max-width: 280px;
        box-shadow: 0 5px 25px rgba(0,0,0,0.08);
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        cursor: pointer;
        position: relative;
        border: 2px solid transparent;
        margin: 0 auto;
    }
    
    .department-card:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 15px 45px rgba(102, 126, 234, 0.25);
        border-color: #667eea;
    }
    
    .department-card .dept-icon {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: linear-gradient(135deg, #667eea, #764ba2);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        margin: 0 auto 15px;
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
        transition: all 0.3s ease;
    }
    
    .department-card:hover .dept-icon {
        transform: rotate(10deg) scale(1.1);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    }
    
    .department-card .dept-name {
        font-size: 16px;
        font-weight: 700;
        color: #2d3436;
        margin-bottom: 5px;
    }
    
    .department-card .dept-code {
        font-size: 12px;
        color: #adb5bd;
        font-weight: 600;
        letter-spacing: 1px;
        text-transform: uppercase;
    }
    
    .department-card .dept-stats {
        display: flex;
        justify-content: center;
        gap: 15px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #f1f3f5;
    }
    
    .department-card .dept-stats span {
        font-size: 12px;
        color: #6c757d;
    }
    
    .department-card .dept-stats i {
        color: #667eea;
        margin-right: 4px;
    }
    
    /* ============ کارت مدیر ============ */
    .manager-card {
        background: linear-gradient(135deg, #667eea, #764ba2);
        border-radius: 12px;
        padding: 15px;
        margin: 15px auto 10px;
        max-width: 220px;
        box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
        transition: all 0.3s ease;
    }
    
    .manager-card:hover {
        transform: scale(1.05);
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
    }
    
    .manager-card .manager-avatar {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        border: 3px solid rgba(255,255,255,0.4);
        margin: 0 auto 8px;
        overflow: hidden;
        background: rgba(255,255,255,0.2);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .manager-card .manager-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .manager-card .manager-avatar i {
        font-size: 24px;
        color: rgba(255,255,255,0.7);
    }
    
    .manager-card .manager-name {
        color: white;
        font-weight: 600;
        font-size: 14px;
        margin-bottom: 2px;
    }
    
    .manager-card .manager-position {
        color: rgba(255,255,255,0.8);
        font-size: 12px;
    }
    
    .manager-badge {
        display: inline-block;
        background: rgba(255,255,255,0.2);
        color: white;
        padding: 2px 10px;
        border-radius: 20px;
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        margin-top: 5px;
    }
    
    /* ============ کارمندان ============ */
    .employees-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        margin-top: 10px;
    }
    
    .employee-mini {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #f1f3f5;
        border: 2px solid #e9ecef;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 600;
        color: #495057;
        transition: all 0.3s ease;
        cursor: pointer;
        position: relative;
    }
    
    .employee-mini:hover {
        transform: scale(1.2);
        border-color: #667eea;
        background: #667eea;
        color: white;
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
        z-index: 10;
    }
    
    .employee-mini img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
    }
    
    .employee-mini .tooltip-text {
        display: none;
        position: absolute;
        bottom: calc(100% + 10px);
        left: 50%;
        transform: translateX(-50%);
        background: #2d3436;
        color: white;
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 12px;
        white-space: nowrap;
        font-weight: 400;
        box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    }
    
    .employee-mini:hover .tooltip-text {
        display: block;
    }
    
    .employee-mini .tooltip-text::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: 6px solid transparent;
        border-top-color: #2d3436;
    }
    
    .more-employees {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #e9ecef;
        border: 2px dashed #adb5bd;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: 700;
        color: #6c757d;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .more-employees:hover {
        background: #667eea;
        color: white;
        border-color: #667eea;
        transform: scale(1.1);
    }
    
    /* ============ دکمه بزرگنمایی ============ */
    .zoom-controls {
        position: fixed;
        bottom: 30px;
        right: 30px;
        display: flex;
        gap: 10px;
        z-index: 1000;
    }
    
    .zoom-controls button {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        border: none;
        background: white;
        box-shadow: 0 5px 25px rgba(0,0,0,0.15);
        font-size: 20px;
        cursor: pointer;
        transition: all 0.3s ease;
        color: #2d3436;
    }
    
    .zoom-controls button:hover {
        transform: scale(1.1);
        background: #667eea;
        color: white;
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
    }
    
    /* ============ حالت موبایل ============ */
    @media (max-width: 768px) {
        .org-chart-container {
            padding: 20px 15px;
        }
        
        .org-header h1 {
            font-size: 1.8rem;
        }
        
        .tree li {
            padding: 15px 8px 0 8px;
        }
        
        .department-card {
            min-width: 160px;
            padding: 15px;
        }
        
        .department-card .dept-icon {
            width: 45px;
            height: 45px;
            font-size: 18px;
        }
        
        .manager-card {
            max-width: 160px;
            padding: 12px;
        }
        
        .manager-card .manager-avatar {
            width: 40px;
            height: 40px;
        }
        
        .employee-mini {
            width: 32px;
            height: 32px;
            font-size: 11px;
        }
        
        .stats-row {
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }
        
        .stat-card {
            padding: 15px;
        }
        
        .stat-card .stat-number {
            font-size: 22px;
        }
    }
    
    @media (max-width: 480px) {
        .tree li {
            padding: 10px 5px 0 5px;
        }
        
        .department-card {
            min-width: 130px;
            padding: 12px;
        }
        
        .department-card .dept-name {
            font-size: 13px;
        }
        
        .stats-row {
            grid-template-columns: 1fr 1fr;
        }
    }
    
    /* ============ انیمیشن‌ها ============ */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .tree li {
        animation: fadeInUp 0.6s ease forwards;
        opacity: 0;
    }
    
    .tree li:nth-child(1) { animation-delay: 0.1s; }
    .tree li:nth-child(2) { animation-delay: 0.2s; }
    .tree li:nth-child(3) { animation-delay: 0.3s; }
    .tree li:nth-child(4) { animation-delay: 0.4s; }
    .tree li:nth-child(5) { animation-delay: 0.5s; }
    
    /* ============ تم تاریک (اختیاری) ============ */
    .dark-theme .org-chart-page {
        background: linear-gradient(135deg, #1a1a2e, #16213e);
    }
    
    .dark-theme .org-chart-container {
        background: rgba(30, 30, 60, 0.95);
    }
    
    .dark-theme .org-header h1 {
        background: linear-gradient(135deg, #a8c0ff, #3f2b96);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    
    .dark-theme .stat-card {
        background: rgba(255,255,255,0.05);
        border-color: rgba(255,255,255,0.1);
    }
    
    .dark-theme .stat-card .stat-number {
        color: white;
    }
    
    .dark-theme .department-card {
        background: rgba(255,255,255,0.05);
        border-color: rgba(255,255,255,0.1);
    }
    
    .dark-theme .department-card .dept-name {
        color: white;
    }
   .department-card {
        background: white;
        border-radius: 16px;
        padding: 25px 20px;
        min-width: 250px;
        max-width: 320px;
        box-shadow: 0 5px 25px rgba(0,0,0,0.08);
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        cursor: pointer;
        position: relative;
        border: 2px solid transparent;
        margin: 0 auto;
    }
    
    .department-card:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 15px 45px rgba(102, 126, 234, 0.25);
        border-color: #667eea;
    }
    
    .dept-icon {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: linear-gradient(135deg, #667eea, #764ba2);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        margin: 0 auto 15px;
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
        transition: all 0.3s ease;
    }
    
    .department-card:hover .dept-icon {
        transform: rotate(10deg) scale(1.1);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    }
    
    .dept-name {
        font-size: 18px;
        font-weight: 700;
        color: #2d3436;
        margin-bottom: 3px;
        text-align: center;
    }
    
    .dept-code {
        font-size: 12px;
        color: #adb5bd;
        font-weight: 600;
        letter-spacing: 1px;
        text-transform: uppercase;
        text-align: center;
    }
    
    .dept-stats {
        display: flex;
        justify-content: center;
        gap: 15px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #f1f3f5;
    }
    
    .dept-stats span {
        font-size: 13px;
        color: #6c757d;
    }
    
    .dept-stats i {
        color: #667eea;
        margin-right: 4px;
    }
    
    /* ============ کارت مدیر ============ */
    .manager-card {
        background: linear-gradient(135deg, #667eea, #764ba2);
        border-radius: 16px;
        padding: 20px;
        margin: 15px auto 10px;
        max-width: 260px;
        box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
        transition: all 0.3s ease;
        text-align: center;
    }
    
    .manager-card:hover {
        transform: scale(1.03);
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
    }
    
    .manager-avatar {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        border: 4px solid rgba(255,255,255,0.4);
        margin: 0 auto 12px;
        overflow: hidden;
        background: rgba(255,255,255,0.2);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .manager-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .manager-avatar i {
        font-size: 48px;
        color: rgba(255,255,255,0.7);
    }
    
    .manager-name {
        color: white;
        font-weight: 700;
        font-size: 18px;
        margin-bottom: 4px;
    }
    
    .manager-position {
        color: rgba(255,255,255,0.85);
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .manager-email {
        color: rgba(255,255,255,0.7);
        font-size: 12px;
        margin-bottom: 4px;
        word-break: break-all;
    }
    
    .manager-email i {
        margin-right: 5px;
    }
    
    .manager-phone {
        color: rgba(255,255,255,0.7);
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .manager-phone i {
        margin-right: 5px;
    }
    
    .manager-badge {
        display: inline-block;
        background: rgba(255,255,255,0.2);
        color: white;
        padding: 4px 14px;
        border-radius: 20px;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        margin-top: 5px;
    }
    
    /* ============ کارمندان ============ */
    .employees-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 15px;
        max-height: 400px;
        overflow-y: auto;
        padding-right: 5px;
    }
    
    /* اسکرول بار سفارشی */
    .employees-grid::-webkit-scrollbar {
        width: 4px;
    }
    
    .employees-grid::-webkit-scrollbar-track {
        background: #f1f3f5;
        border-radius: 10px;
    }
    
    .employees-grid::-webkit-scrollbar-thumb {
        background: #667eea;
        border-radius: 10px;
    }
    
    .employee-item {
        display: flex;
        align-items: center;
        gap: 14px;
        background: #f8f9fa;
        padding: 12px 14px;
        border-radius: 12px;
        transition: all 0.3s ease;
        border: 1px solid transparent;
    }
    
    .employee-item:hover {
        background: #e9ecef;
        border-color: #667eea;
        transform: translateX(5px);
    }
    
    .employee-avatar {
        width: 55px;
        height: 55px;
        border-radius: 50%;
        overflow: hidden;
        flex-shrink: 0;
        background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
        border: 2px solid #e9ecef;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .employee-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .employee-initials {
        font-size: 20px;
        font-weight: 700;
        color: #4f46e5;
    }
    
    .employee-info {
        flex: 1;
        min-width: 0;
    }
    
    .employee-name {
        font-weight: 600;
        font-size: 15px;
        color: #2d3436;
        margin-bottom: 2px;
    }
    
    .employee-position {
        font-size: 13px;
        color: #6c757d;
        margin-bottom: 3px;
    }
    
    .employee-email {
        font-size: 12px;
        color: #adb5bd;
        margin-bottom: 2px;
        word-break: break-all;
    }
    
    .employee-email i {
        color: #667eea;
        margin-right: 4px;
        font-size: 11px;
    }
    
    .employee-phone {
        font-size: 12px;
        color: #adb5bd;
    }
    
    .employee-phone i {
        color: #667eea;
        margin-right: 4px;
        font-size: 11px;
    }
    
    /* ============ حالت موبایل ============ */
    @media (max-width: 768px) {
        .department-card {
            min-width: 200px;
            padding: 15px;
        }
        
        .employee-item {
            padding: 10px 12px;
        }
        
        .employee-avatar {
            width: 45px;
            height: 45px;
        }
        
        .employee-name {
            font-size: 13px;
        }
        
        .employee-position {
            font-size: 11px;
        }
        
        .manager-avatar {
            width: 60px;
            height: 60px;
        }
        
        .manager-name {
            font-size: 15px;
        }
        
        .employees-grid {
            max-height: 300px;
        }
    }
    
    @media (max-width: 480px) {
        .department-card {
            min-width: 160px;
            padding: 12px;
        }
        
        .employee-avatar {
            width: 38px;
            height: 38px;
        }
        
        .employee-name {
            font-size: 12px;
        }
        
        .employee-email,
        .employee-phone {
            font-size: 10px;
        }
    }