/* پنل مدیریت پرسنل - استایل‌های اصلی */

:root {
    --primary-navy: #1e3a8a;
    --primary-navy-dark: #1e40af;
    --primary-navy-light: #3b82f6;
    --white: #ffffff;
    --light-gray: #f8fafc;
    --medium-gray: #e2e8f0;
    --dark-gray: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --border-radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazir', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--light-gray);
    color: #334155;
    direction: rtl;
}

/* کانتینر اصلی */
.staff-management-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* هدر */
.staff-header {
    background: linear-gradient(135deg, var(--primary-navy) 0%, var(--primary-navy-light) 100%);
    color: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
}

.staff-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.staff-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* کارت‌ها */
.staff-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--medium-gray);
    transition: all 0.3s ease;
}

.staff-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.staff-card h2 {
    color: var(--primary-navy);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--medium-gray);
}

/* Grid سیستم */
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.staff-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.staff-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* فرم‌ها */
.staff-form {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.staff-form-group {
    margin-bottom: 1.5rem;
}

.staff-form-group label {
    display: block;
    color: var(--primary-navy);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.staff-form-group input,
.staff-form-group select,
.staff-form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.staff-form-group input:focus,
.staff-form-group select:focus,
.staff-form-group textarea:focus {
    outline: none;
    border-color: var(--primary-navy-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.staff-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* دکمه‌ها */
.staff-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 0.5rem;
}

.staff-btn-primary {
    background: var(--primary-navy);
    color: var(--white);
}

.staff-btn-primary:hover {
    background: var(--primary-navy-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.staff-btn-secondary {
    background: var(--white);
    color: var(--primary-navy);
    border: 2px solid var(--primary-navy);
}

.staff-btn-secondary:hover {
    background: var(--primary-navy);
    color: var(--white);
}

.staff-btn-success {
    background: var(--success);
    color: var(--white);
}

.staff-btn-success:hover {
    background: #059669;
}

.staff-btn-warning {
    background: var(--warning);
    color: var(--white);
}

.staff-btn-warning:hover {
    background: #d97706;
}

.staff-btn-danger {
    background: var(--error);
    color: var(--white);
}

.staff-btn-danger:hover {
    background: #dc2626;
}

.staff-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.staff-btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* جدول‌ها */
.staff-table {
    width: 100%;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.staff-table table {
    width: 100%;
    border-collapse: collapse;
}

.staff-table th,
.staff-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--medium-gray);
}

.staff-table th {
    background: var(--primary-navy);
    color: var(--white);
    font-weight: 600;
    font-size: 0.95rem;
}

.staff-table tr:nth-child(even) {
    background: var(--light-gray);
}

.staff-table tr:hover {
    background: #e0f2fe;
}

/* تب‌ها */
.staff-tabs {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.staff-tabs-nav {
    display: flex;
    background: var(--light-gray);
    border-bottom: 1px solid var(--medium-gray);
}

.staff-tab-button {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--dark-gray);
    transition: all 0.3s ease;
}

.staff-tab-button.active {
    background: var(--primary-navy);
    color: var(--white);
}

.staff-tab-button:hover:not(.active) {
    background: var(--medium-gray);
}

.staff-tab-content {
    padding: 2rem;
}

/* بج‌ها */
.staff-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.staff-badge-success {
    background: #dcfce7;
    color: #166534;
}

.staff-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.staff-badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.staff-badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* آمارها */
.staff-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.staff-stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    border-top: 4px solid var(--primary-navy);
}

.staff-stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-navy);
    margin-bottom: 0.5rem;
}

.staff-stat-label {
    color: var(--dark-gray);
    font-weight: 600;
}

/* Modal */
.staff-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.staff-modal.active {
    display: flex;
}

.staff-modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.staff-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--medium-gray);
}

.staff-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-navy);
    margin: 0;
}

.staff-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-gray);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.staff-modal-close:hover {
    background: var(--medium-gray);
}

/* نوتیفیکیشن */
.staff-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    color: var(--white);
    font-weight: 600;
    z-index: 1001;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 300px;
    box-shadow: var(--shadow-lg);
}

.staff-notification.show {
    transform: translateX(0);
}

.staff-notification-success {
    background: var(--success);
}

.staff-notification-error {
    background: var(--error);
}

.staff-notification-warning {
    background: var(--warning);
}

.staff-notification-info {
    background: var(--primary-navy-light);
}

/* پروگرس بار */
.staff-progress {
    width: 100%;
    height: 8px;
    background: var(--medium-gray);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.staff-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-navy), var(--primary-navy-light));
    transition: width 0.3s ease;
}

/* کارت پروفایل */
.staff-profile-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 2rem;
}

.staff-profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--primary-navy);
    margin: 0 auto 1rem;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-navy);
}

.staff-profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-navy);
    margin-bottom: 0.5rem;
}

.staff-profile-job {
    color: var(--dark-gray);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* نمودار */
.staff-chart {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.staff-chart h3 {
    color: var(--primary-navy);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Timeline */
.staff-timeline {
    position: relative;
    padding: 1rem 0;
}

.staff-timeline::before {
    content: '';
    position: absolute;
    right: 20px;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--primary-navy-light);
}

.staff-timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-right: 60px;
}

.staff-timeline-item::before {
    content: '';
    position: absolute;
    right: 11px;
    top: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-navy);
    border: 4px solid var(--white);
    box-shadow: 0 0 0 2px var(--primary-navy-light);
}

.staff-timeline-content {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.staff-timeline-date {
    color: var(--dark-gray);
    font-size: 0.875rem;
    font-weight: 600;
}

.staff-timeline-title {
    color: var(--primary-navy);
    font-weight: 700;
    margin: 0.5rem 0;
}

/* سیستم Grid مخصوص داشبورد */
.staff-dashboard-grid {
    display: grid;
    grid-template-areas: 
        "profile stats stats"
        "kpi kpi leaves"
        "videos protocols protocols";
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.staff-dashboard-profile { grid-area: profile; }
.staff-dashboard-stats { grid-area: stats; }
.staff-dashboard-kpi { grid-area: kpi; }
.staff-dashboard-leaves { grid-area: leaves; }
.staff-dashboard-videos { grid-area: videos; }
.staff-dashboard-protocols { grid-area: protocols; }

/* Loading */
.staff-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.staff-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--medium-gray);
    border-top: 4px solid var(--primary-navy);
    border-radius: 50%;
    animation: staff-spin 1s linear infinite;
}

@keyframes staff-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* رسپانسیو */
@media (max-width: 768px) {
    .staff-management-container {
        padding: 10px;
    }
    
    .staff-header {
        padding: 1.5rem;
        text-align: center;
    }
    
    .staff-header h1 {
        font-size: 2rem;
    }
    
    .staff-grid {
        grid-template-columns: 1fr;
    }
    
    .staff-dashboard-grid {
        grid-template-areas: 
            "profile"
            "stats"
            "kpi"
            "leaves"
            "videos"
            "protocols";
        grid-template-columns: 1fr;
    }
    
    .staff-tabs-nav {
        flex-direction: column;
    }
    
    .staff-table {
        font-size: 0.875rem;
    }
    
    .staff-table th,
    .staff-table td {
        padding: 0.5rem;
    }
    
    .staff-modal-content {
        padding: 1rem;
        margin: 1rem;
    }
    
    .staff-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .staff-stats {
        grid-template-columns: 1fr;
    }
    
    .staff-btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .staff-form {
        padding: 1rem;
    }
}