/* 연차 관리 페이지 전용 스타일 */

/* 연도 선택 필터 */
.year-selector-container {
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.year-buttons button {
    padding: 8px 16px;
    border: 2px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.year-buttons button:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
}

.year-buttons button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 탭 네비게이션 */
.leave-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.leave-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.leave-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.leave-tab:hover:not(.active) {
    background: var(--gray-100);
    color: var(--gray-900);
}

/* 통계 카드 그리드 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card:nth-child(1)::before {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card:nth-child(2)::before {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card:nth-child(3)::before {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card:nth-child(4)::before {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-card:nth-child(5)::before {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-icon.gray {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.stat-icon.green {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.stat-icon.purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-icon.teal {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.stat-icon.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.stat-icon.red {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.stat-details {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 500;
    line-height: 1.4;
}

/* 섹션 스타일 */
.section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: #667eea;
}

/* 승인 대기 배지 */
.pending-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin-left: 8px;
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-group input[type="date"],
.form-group input[type="month"],
.form-group input[type="number"],
.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

/* month input과 select, number input의 높이를 동일하게 맞추기 */
.form-group input[type="month"],
.form-group input[type="number"],
.form-group select {
    height: 48px !important;
    min-height: 48px;
    line-height: 24px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

/* month input 특별 스타일 */
.form-group input[type="month"] {
    cursor: pointer;
}

.form-group input[type="month"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23667eea" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') center no-repeat;
    width: 24px;
    height: 24px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 라디오 버튼 그룹 */
.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.radio-label:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.radio-label input[type="radio"]:checked + span,
.radio-label:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* 연차 요약 */
.leave-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.summary-row span {
    font-size: 14px;
    opacity: 0.9;
}

.summary-row strong {
    font-size: 18px;
    font-weight: 700;
}

/* 제출 버튼 스타일 */
.btn-submit-leave,
.btn-submit-earn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-submit-leave {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-submit-leave:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-submit-leave:active {
    transform: translateY(0);
}

.btn-submit-earn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-submit-earn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-submit-earn:active {
    transform: translateY(0);
}

.btn-submit-leave:disabled,
.btn-submit-earn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 테이블 컨테이너 */
.table-container {
    overflow-x: auto;
    margin-top: 16px;
}

.employees-table {
    width: 100%;
    border-collapse: collapse;
}

.employees-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.employees-table thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.employees-table thead th:first-child {
    border-top-left-radius: 8px;
}

.employees-table thead th:last-child {
    border-top-right-radius: 8px;
}

.employees-table tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.2s;
}

.employees-table tbody tr:hover {
    background: var(--gray-50);
}

.employees-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--gray-700);
    text-align: left;  /* 좌측 정렬 명시 */
}

.employees-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.employees-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

/* 상태 배지 */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;  /* 12px → 13px (다른 텍스트와 동일) */
    font-weight: 500;  /* 600 → 500 (다른 텍스트와 동일) */
    text-transform: none;  /* uppercase 제거 */
}

/* 상태 배지가 포함된 셀 좌측 정렬 강제 */
.employees-table tbody td:has(.status-badge),
.employees-table tbody td:nth-child(7) {
    text-align: left !important;
}

.status-badge.pending,
.status-badge.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.approved,
.status-badge.status-approved {
    background: #d1fae5;
    color: #059669;
}

.status-badge.rejected,
.status-badge.status-rejected {
    background: #fee2e2;
    color: #dc2626;
}

/* 액션 버튼 */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-approve,
.btn-reject {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-approve {
    background: #10b981;
    color: white;
}

.btn-approve:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-reject {
    background: #ef4444;
    color: white;
}

.btn-reject:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* 알림 박스 */
.alert-box {
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.alert-box i {
    font-size: 20px;
    margin-top: 2px;
}

.alert-box.warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-box.danger {
    background: #fee2e2;
    color: #7f1d1d;
    border-left: 4px solid #ef4444;
}

.alert-box strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-body {
    padding: 28px;
}

.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 하단 통계 카드 */
.bottom-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.bottom-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border-top: 4px solid;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bottom-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.bottom-stat-card:nth-child(1) {
    border-top-color: #667eea;
}

.bottom-stat-card:nth-child(2) {
    border-top-color: #f093fb;
}

.bottom-stat-card:nth-child(3) {
    border-top-color: #43e97b;
}

.bottom-stat-card:nth-child(4) {
    border-top-color: #f59e0b;
}

.bottom-stat-card:nth-child(5) {
    border-top-color: #ef4444;
}

.bottom-stat-label {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 8px;
    font-weight: 500;
}

.bottom-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
}

.bottom-stat-unit {
    font-size: 14px;
    color: var(--gray-500);
    margin-left: 4px;
}

/* CSV 내보내기 버튼 */
.btn-csv-export {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-csv-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-csv-export:active {
    transform: translateY(0);
}

.btn-csv-export i {
    font-size: 14px;
}

/* 반응형 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .leave-tabs {
        flex-wrap: wrap;
    }
    
    /* 테이블 가로 스크롤 활성화 */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .employees-table {
        min-width: 800px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .bottom-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .section {
        padding: 16px;
    }
    
    .bottom-stats {
        grid-template-columns: 1fr;
    }
}
