/* 부서별 통계 스타일 */

/* 부서 통계 그리드 */
.dept-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* 부서 통계 카드 */
.dept-stat-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s;
}

.dept-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 부서 카드 헤더 */
.dept-stat-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dept-stat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.dept-stat-header h3 i {
    margin-right: 8px;
}

.dept-employee-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

/* 부서 카드 본문 */
.dept-stat-body {
    padding: 20px;
}

.dept-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.dept-stat-item:last-child {
    border-bottom: none;
}

.dept-stat-item .stat-label {
    color: #6b7280;
    font-size: 14px;
}

.dept-stat-item .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.dept-stat-item .stat-value.used {
    color: #f59e0b;
}

.dept-stat-item .stat-value.remaining {
    color: #10b981;
}

/* 진행률 바 */
.dept-stat-progress {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #3b82f6 50%, #f59e0b 100%);
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 14px;
    color: #6b7280;
    font-weight: 600;
}

/* 대기중 표시 */
.dept-stat-pending {
    margin-top: 12px;
    padding: 8px 12px;
    background: #fef3c7;
    border-radius: 6px;
    color: #92400e;
    font-size: 13px;
    text-align: center;
}

.dept-stat-pending i {
    margin-right: 5px;
}

/* 부서 카드 푸터 */
.dept-stat-footer {
    padding: 15px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.btn-link {
    background: none;
    border: none;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.btn-link i {
    margin-right: 5px;
}

/* 부서별 상세 테이블 */
.usage-rate {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rate-bar {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.rate-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #3b82f6 50%, #f59e0b 100%);
    transition: width 0.5s ease;
}

.usage-rate span {
    font-weight: 600;
    color: #6b7280;
    min-width: 45px;
    text-align: right;
}

/* 합계 행 */
.total-row {
    background: #f9fafb;
    font-weight: 700;
}

.total-row td {
    border-top: 2px solid #667eea;
}

/* 부서 직원 목록 모달 */
.dept-employee-list {
    max-height: 400px;
    overflow-y: auto;
}

.dept-employee-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s;
}

.dept-employee-item:hover {
    background: #f9fafb;
}

.dept-employee-item:last-child {
    border-bottom: none;
}

.employee-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.employee-name {
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
}

.employee-id {
    font-size: 13px;
    color: #6b7280;
}

.employee-leave {
    font-size: 14px;
    color: #6b7280;
}

/* 배지 스타일 */
.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* 로딩 및 에러 메시지 */
.loading-message,
.error-message {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 16px;
}

.loading-message i,
.error-message i {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
    color: #667eea;
}

.error-message i {
    color: #ef4444;
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .dept-stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .dept-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dept-stat-header {
        padding: 15px;
    }
    
    .dept-stat-header h3 {
        font-size: 16px;
    }
    
    .dept-stat-body {
        padding: 15px;
    }
    
    .dept-stat-item .stat-value {
        font-size: 16px;
    }
    
    .usage-rate {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .rate-bar {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .dept-employee-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .employee-leave {
        width: 100%;
        text-align: left;
    }
}
