/* 한글 웹폰트 - Pretendard */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

/* CSS 변수 (다크모드 대응) */
:root {
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e9ecef;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
}

/* 다크모드 */
[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-secondary: #1e1e2e;
    --bg-card: #2d2d44;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border-color: #3f3f46;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --accent-primary: #818cf8;
    --accent-secondary: #a78bfa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 20px 60px var(--shadow-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

header {
    background: var(--bg-primary);
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* 다크모드 토글 버튼 */
.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

h1 {
    font-size: 2rem;
}

.current-time {
    font-size: 1.2rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 10px;
}

.main-content {
    padding: 30px;
}

/* 대시보드 탭 레이아웃 */
#dashboardTab {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 30px;
}

/* ===== 야근 관리 스타일 (새 폴더 UI) ===== */
.overtime-section{max-width:1200px;margin:0 auto}
.overtime-header{display:flex;justify-content:space-between;align-items:center;background:linear-gradient(135deg,#ff6b6b 0%,#c92a2a 100%);color:#fff;padding:20px;border-radius:10px;margin-bottom:30px}
.month-selector{display:flex;align-items:center;gap:20px}
.month-selector button{background:rgba(255,255,255,.2);border:none;color:#fff;padding:8px 12px;border-radius:5px;cursor:pointer;font-size:18px;transition:background .3s}
.month-selector button:hover{background:rgba(255,255,255,.3)}
#currentOvertimeMonth{font-size:1.3rem;font-weight:bold}
.overtime-stats{display:flex;gap:30px}
.stat-item{text-align:center}
.stat-label{font-size:.9rem;opacity:.9;display:block}
.stat-value{font-size:1.5rem;font-weight:bold;display:block;margin-top:5px}
.overtime-form-section{background:#fff;border-radius:15px;padding:30px;margin-bottom:30px;box-shadow:0 5px 15px rgba(0,0,0,.08);border:1px solid #e9ecef}
.overtime-form-section h3{color:#495057;margin-bottom:20px;font-size:1.3rem;border-bottom:2px solid #ff6b6b;padding-bottom:10px}
.overtime-form{display:flex;flex-direction:column;gap:20px}
.overtime-buttons{display:flex;justify-content:flex-end;margin-top:20px;padding-top:20px;border-top:1px solid #e9ecef}
.overtime-buttons button{background:linear-gradient(135deg,#ff6b6b 0%,#c92a2a 100%);color:#fff;border:none;padding:12px 25px;border-radius:8px;font-size:1rem;font-weight:600;cursor:pointer;transition:all .3s}
.overtime-buttons button:hover{transform:translateY(-2px);box-shadow:0 5px 15px rgba(255,107,107,.3)}
.overtime-calendar-section{background:#fff;border-radius:15px;padding:30px;margin-bottom:30px;box-shadow:0 5px 15px rgba(0,0,0,.08)}
.overtime-calendar-section h3{color:#495057;margin-bottom:20px;font-size:1.3rem;border-bottom:2px solid #ff6b6b;padding-bottom:10px}
.overtime-calendar{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}
.overtime-day{cursor:pointer;transition:all .3s}
.overtime-day:hover{background:#ffe3e3!important;transform:scale(1.05)}
.overtime-day.has-overtime{background:#fff5f5;border:2px solid #ff6b6b}
.overtime-info{display:flex;justify-content:space-around;margin-top:5px;font-size:11px}
.overtime-count{background:#ff6b6b;color:#fff;padding:2px 6px;border-radius:3px;font-weight:bold}
.overtime-hours{background:#ffa94d;color:#fff;padding:2px 6px;border-radius:3px;font-weight:bold}
.overtime-list-section{background:#fff;border-radius:15px;padding:30px;margin-bottom:30px;box-shadow:0 5px 15px rgba(0,0,0,.08)}
.overtime-list-section h3{color:#495057;margin-bottom:20px;font-size:1.3rem;border-bottom:2px solid #ff6b6b;padding-bottom:10px}
.overtime-filters{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;padding:15px;background:#f8f9fa;border-radius:8px}
.overtime-filters select{padding:10px 15px;border:2px solid #e9ecef;border-radius:5px;font-size:1rem;background:#fff;cursor:pointer}
.export-btn{background:#20c997;color:#fff;border:none;padding:10px 20px;border-radius:5px;cursor:pointer;font-weight:600;transition:all .3s}
.export-btn:hover{background:#12b886;transform:translateY(-2px)}
.overtime-list{max-height:500px;overflow-y:auto}
.overtime-item{background:#f8f9fa;border:1px solid #e9ecef;border-radius:10px;padding:20px;margin-bottom:15px;transition:all .3s}
.overtime-item:hover{background:#e9ecef;transform:translateX(5px)}
.overtime-item-header{display:flex;justify-content:space-between;margin-bottom:10px}
.overtime-item-date{font-weight:bold;color:#495057;font-size:1.1rem}
.overtime-item-employee{background:#ff6b6b;color:#fff;padding:4px 12px;border-radius:15px;font-weight:600}
.overtime-item-details{display:flex;gap:20px;margin-bottom:10px}
.overtime-time{color:#6c757d;font-size:.95rem}
.overtime-duration{background:#ffa94d;color:#fff;padding:4px 10px;border-radius:5px;font-weight:bold;font-size:.9rem}
.overtime-reason{color:#6c757d;font-style:italic;margin-top:10px;padding:10px;background:#fff;border-radius:5px}
.overtime-item-actions{display:flex;gap:10px;margin-top:15px;justify-content:flex-end}
.btn-edit,.btn-delete{padding:6px 15px;border:none;border-radius:5px;cursor:pointer;font-size:.9rem}
.btn-edit{background:#51cf66;color:#fff}
.btn-delete{background:#ff6b6b;color:#fff}

/* HR 탭은 전체 너비 사용 */
#hrTab {
    width: 100%;
}

/* 직원 관리 섹션 */
.employee-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.add-employee {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.add-employee input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.add-employee button, .leave-form button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.2s;
}

.add-employee button:hover, .leave-form button:hover {
    transform: translateY(-2px);
}

.employee-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.employee-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.employee-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.employee-name {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
}

.employee-info {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.leave-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    font-size: 13px;
}

.leave-item {
    padding: 5px 8px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

.leave-item.annual {
    background: #d4edda;
    color: #155724;
}

.leave-item.monthly {
    background: #cce5ff;
    color: #004085;
}

.leave-item.sick {
    background: #f8d7da;
    color: #721c24;
}

.leave-item.official {
    background: #fff3cd;
    color: #856404;
}

.leave-item.education {
    background: #e2d5f1;
    color: #4a235a;
}

.leave-item.reward {
    background: #fff0d4;
    color: #b8860b;
}

.leave-item.vacation {
    background: #d1ecf1;
    color: #0c5460;
}

.delete-employee {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #dc3545;
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

/* 달력 섹션 */
.calendar-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-controls button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
}

#currentMonth {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-header {
    background: #667eea;
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: bold;
}

.selected-info {
    background: #e3f2fd;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #1976d2;
    text-align: center;
}

.calendar-day {
    background: white;
    border: 1px solid #ddd;
    padding: 8px;
    min-height: 80px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.calendar-day:hover {
    background-color: #f0f0f0;
    transform: scale(1.02);
}

.calendar-day.selected {
    background: #bbdefb !important;
    border: 2px solid #2196f3;
}

.calendar-day.selecting {
    background: #e3f2fd !important;
    border: 2px solid #64b5f6;
}

.calendar-day.today {
    background: #fff3cd;
    border: 2px solid #ffc107;
}

.calendar-day.other-month {
    background: #f8f9fa;
    color: #999;
}

.day-number {
    font-weight: bold;
    margin-bottom: 5px;
}

.leave-indicator {
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
    margin-top: 2px;
    display: inline-block;
    cursor: pointer;
    transition: transform 0.2s;
}

.leave-indicator:hover {
    transform: scale(1.1);
}

.leave-indicator.annual {
    background: #d4edda;
    color: #155724;
}

.leave-indicator.monthly {
    background: #cce5ff;
    color: #004085;
}

.leave-indicator.sick {
    background: #f8d7da;
    color: #721c24;
}

.leave-indicator.official {
    background: #fff3cd;
    color: #856404;
}

.leave-indicator.education {
    background: #e2d5f1;
    color: #4a235a;
}

.leave-indicator.reward {
    background: #fff0d4;
    color: #b8860b;
}

.leave-indicator.vacation {
    background: #d1ecf1;
    color: #0c5460;
}

.calendar-day.holiday {
    background: #ffebee;
    border: 2px solid #f44336;
}

.holiday-indicator {
    font-size: 9px;
    padding: 1px 3px;
    border-radius: 3px;
    margin-top: 2px;
    background: #f44336;
    color: white;
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #333;
}

.modal h3 {
    margin-bottom: 20px;
    color: #333;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: bold;
    color: #333;
}

.form-group select,
.form-group input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

.modal-buttons button:first-child {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-buttons button:last-child {
    background: #6c757d;
    color: white;
}

/* 직원 상세 모달 스타일 */
.employee-detail-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.employee-detail-info h4 {
    color: #333;
    margin-bottom: 10px;
}

.employee-detail-info p {
    margin: 5px 0;
    color: #666;
}

.employee-leave-history {
    max-height: 400px;
    overflow-y: auto;
}

.employee-leave-history h4 {
    color: #333;
    margin-bottom: 15px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.leave-history-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leave-history-info {
    flex: 1;
}

.leave-history-date {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.leave-history-details {
    font-size: 12px;
    color: #666;
}

.leave-history-type {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
}

.leave-history-type.annual {
    background: #d4edda;
    color: #155724;
}

.leave-history-type.monthly {
    background: #cce5ff;
    color: #004085;
}

.leave-history-type.sick {
    background: #f8d7da;
    color: #721c24;
}

.leave-history-type.official {
    background: #fff3cd;
    color: #856404;
}

.leave-history-type.education {
    background: #e2d5f1;
    color: #4a235a;
}

.leave-history-type.reward {
    background: #fff0d4;
    color: #b8860b;
}

.leave-history-type.vacation {
    background: #d1ecf1;
    color: #0c5460;
}

/* 휴가 취소 모달 스타일 */
#leaveCancelInfo {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

#leaveCancelInfo h4 {
    color: #856404;
    margin-bottom: 10px;
}

#leaveCancelInfo p {
    color: #856404;
    margin: 5px 0;
}

/* 모바일 최적화 반응형 디자인 */
@media (max-width: 768px) {
    body {
        padding: 5px;
        margin: 0;
        min-height: 100vh;
        overflow-x: hidden; /* 가로 스크롤 방지 */
    }
    
    .container {
        border-radius: 8px;
        margin: 0;
        min-height: calc(100vh - 10px);
        max-width: 100%;
        overflow: hidden;
    }
    
    header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    h1 {
        font-size: 1.3rem;
        text-align: center;
    }
    
    .current-time {
        font-size: 0.9rem;
        padding: 8px 15px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }
    
    /* 달력 모바일 최적화 */
    .calendar {
        gap: 1px;
        font-size: 12px;
    }
    
    .calendar-day {
        min-height: 50px;
        padding: 2px;
        font-size: 11px;
        overflow: hidden;
    }
    
    .day-number {
        font-size: 14px;
        margin-bottom: 3px;
    }
    
    .leave-indicator {
        font-size: 9px;
        padding: 1px 3px;
        margin-top: 1px;
        display: block;
        width: 100%;
        text-align: center;
    }
    
    .holiday-indicator {
        font-size: 8px;
        padding: 1px 2px;
    }
    
    /* 직원 카드 모바일 최적화 */
    .employee-card {
        padding: 12px;
    }
    
    .employee-name {
        font-size: 14px;
    }
    
    .employee-info {
        font-size: 11px;
    }
    
    .leave-summary {
        grid-template-columns: 1fr;
        gap: 3px;
    }
    
    .leave-item {
        font-size: 11px;
        padding: 4px 6px;
    }
    
    /* 모달 모바일 최적화 */
    .modal-content {
        margin: 5% auto;
        padding: 20px;
        width: 95%;
        max-width: none;
        border-radius: 10px;
    }
    
    .modal h3 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .form-group input,
    .form-group select {
        padding: 12px;
        font-size: 16px; /* iOS 줌 방지 */
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-buttons button {
        padding: 12px 20px;
        font-size: 16px;
        width: 100%;
    }
    
    /* 버튼 터치 최적화 */
    .add-employee button,
    .calendar-controls button {
        padding: 12px 20px;
        font-size: 16px;
        min-height: 44px; /* 터치 최적화 */
    }
    
    .delete-employee {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 32px;
    }
    
    /* 달력 컨트롤 모바일 최적화 */
    .calendar-controls {
        margin-bottom: 15px;
    }
    
    .calendar-controls button {
        padding: 10px 15px;
        font-size: 16px;
    }
    
    #currentMonth {
        font-size: 16px;
    }
    
    .selected-info {
        padding: 8px;
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    /* 직원 요약 모바일 최적화 */
    .employee-summary {
        max-height: 300px;
    }
    
    /* 터치 피드백 개선 */
    .calendar-day:active,
    .employee-card:active,
    .leave-indicator:active {
        transform: scale(0.95);
    }
}

/* 작은 모바일 화면 (480px 이하) 추가 최적화 */
@media (max-width: 480px) {
    body {
        padding: 2px;
    }
    
    .container {
        border-radius: 5px;
        min-height: calc(100vh - 4px);
    }
    
    header {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.1rem;
    }
    
    .main-content {
        padding: 10px;
        gap: 15px;
    }
    
    /* 달력 더 작게 */
    .calendar-day {
        min-height: 45px;
        padding: 1px;
        font-size: 10px;
    }
    
    .day-number {
        font-size: 12px;
        margin-bottom: 2px;
    }
    
    .leave-indicator {
        font-size: 8px;
        padding: 1px 2px;
    }
    
    /* 직원 카드 더 작게 */
    .employee-card {
        padding: 8px;
    }
    
    .employee-name {
        font-size: 13px;
    }
    
    .employee-info {
        font-size: 10px;
    }
    
    /* 모달 더 최적화 */
    .modal-content {
        margin: 2% auto;
        padding: 15px;
        width: 98%;
    }
    
    .modal h3 {
        font-size: 1.1rem;
    }
}

/* ===== 탭 네비게이션 스타일 ===== */
.tab-navigation {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 0 30px;
}

.tab-button {
    background: none;
    border: none;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button:hover {
    color: #495057;
    background: rgba(102, 126, 234, 0.1);
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

/* 탭 콘텐츠: 기본적으로 숨김 */
#dashboardTab:not(.active),
#overtimeTab:not(.active),
#apikeyTab:not(.active),
#hrTab:not(.active) {
    display: none !important;
}

/* 활성화된 탭만 표시 - dashboardTab은 grid 유지 */
#dashboardTab.active {
    display: grid !important;
}

#overtimeTab.active,
#apikeyTab.active,
#hrTab.active {
    display: block !important;
}

/* ===== HR 관리 스타일 ===== */
.hr-section {
    max-width: 1200px;
    margin: 0 auto;
}

.hr-form-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.hr-form-section h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.hr-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
}

.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);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.hr-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.hr-buttons button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hr-buttons button:first-child {
    background: #667eea;
    color: white;
}

.hr-buttons button:first-child:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.hr-buttons button:nth-child(2) {
    background: #6c757d;
    color: white;
}

.hr-buttons button:nth-child(2):hover {
    background: #5a6268;
}

.hr-buttons button.delete-btn {
    background: #dc3545;
    color: white;
}

.hr-buttons button.delete-btn:hover {
    background: #c82333;
}

/* HR 직원 목록 스타일 */
.hr-list-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.hr-list-section h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.hr-search {
    margin-bottom: 20px;
}

.hr-search input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.hr-employee-list {
    display: grid;
    gap: 15px;
}

.hr-employee-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.hr-employee-card:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.hr-employee-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 10px;
}

.hr-employee-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    font-size: 0.9rem;
    color: #6c757d;
}

.hr-info-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.hr-info-label {
    font-weight: 600;
    min-width: 60px;
}

/* 반응형 디자인 - HR 탭 */
@media (max-width: 768px) {
    .tab-navigation {
        padding: 0 15px;
    }
    
    .tab-button {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .hr-buttons {
        flex-direction: column;
    }
    
    .hr-employee-info {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* ===== 토스트 알림 시스템 ===== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    background: var(--bg-card);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-left: 4px solid;
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s ease;
}

.toast.success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.toast.error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.toast.warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.toast.info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

[data-theme="dark"] .toast {
    background: var(--bg-card);
}

[data-theme="dark"] .toast.success { background: linear-gradient(135deg, #064e3b 0%, #065f46 100%); }
[data-theme="dark"] .toast.error { background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%); }
[data-theme="dark"] .toast.warning { background: linear-gradient(135deg, #78350f 0%, #92400e 100%); }
[data-theme="dark"] .toast.info { background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%); }

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    font-size: 18px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

.toast.hide {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===== 연차/월차 진행바 ===== */
.leave-progress-container {
    margin-top: 8px;
}

.leave-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.leave-progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.leave-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.leave-progress-fill.annual {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.leave-progress-fill.monthly {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.leave-progress-fill.warning {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.leave-progress-fill.danger {
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

/* 진행바 빛 효과 */
.leave-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== 페이지 전환 애니메이션 ===== */
.tab-content.active {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 모달 애니메이션 (기존 .modal 스타일 유지) =====
   주의: .modal 기본 스타일은 414번 줄에 정의됨
   여기서는 애니메이션만 추가 */

.modal-content {
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 추가 모달 스타일 */
.modal .modal-content.enhanced {
    transform: translateY(0);
    opacity: 1;
}

/* ===== 버튼 리플 효과 ===== */
.ripple-btn {
    position: relative;
    overflow: hidden;
}

.ripple-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.ripple-btn:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* ===== 오늘 날짜 강조 (펄스 애니메이션) ===== */
.calendar-day.today {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    position: relative;
}

.calendar-day.today::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #f59e0b;
    border-radius: inherit;
    animation: pulse-border 2s infinite;
    pointer-events: none; /* 클릭 이벤트 통과 */
}

@keyframes pulse-border {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.02);
    }
}

/* ===== 직원 카드 호버 개선 ===== */
.employee-card {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow-color);
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-color);
}

.employee-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
    border-color: var(--accent-primary);
}

/* ===== 로딩 스피너 ===== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 스켈레톤 로딩 ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== 다크모드 추가 스타일 ===== */
[data-theme="dark"] .employee-section,
[data-theme="dark"] .calendar-section {
    background: var(--bg-secondary);
}

[data-theme="dark"] .calendar-day {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .calendar-day:hover {
    background: var(--bg-secondary);
}

[data-theme="dark"] .calendar-header {
    background: var(--accent-primary);
}

[data-theme="dark"] .tab-navigation {
    background: var(--bg-secondary);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .tab-button {
    color: var(--text-secondary);
}

[data-theme="dark"] .tab-button.active {
    color: var(--accent-primary);
    background: var(--bg-card);
}

[data-theme="dark"] .main-content {
    background: var(--bg-card);
}

[data-theme="dark"] h2, 
[data-theme="dark"] h3,
[data-theme="dark"] .employee-name {
    color: var(--text-primary);
}

[data-theme="dark"] .employee-info {
    color: var(--text-secondary);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .add-employee input {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* 모바일 토스트 */
@media (max-width: 768px) {
    .toast-container {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }
    
    .toast {
        padding: 12px 16px;
    }
}

/* ===== 직원 순서 편집 모드 ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h2 {
    margin: 0;
}

.edit-mode-controls {
    display: flex;
    gap: 8px;
}

.edit-mode-btn,
.edit-done-btn,
.edit-cancel-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.edit-mode-btn {
    background: linear-gradient(135deg, #e0e5ec 0%, #d0d5dc 100%);
    color: #495057;
}

.edit-mode-btn:hover {
    background: linear-gradient(135deg, #d0d5dc 0%, #c0c5cc 100%);
    transform: translateY(-2px);
}

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

.edit-done-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
}

.edit-cancel-btn {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.edit-cancel-btn:hover {
    background: #e5e7eb;
}

/* 편집 모드 활성화 시 */
.employee-summary.edit-mode {
    background: #fefce8;
    border: 2px dashed #f59e0b;
    border-radius: 12px;
    padding: 10px;
}

.employee-summary.edit-mode .employee-card {
    cursor: grab;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.employee-summary.edit-mode .employee-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.employee-summary.edit-mode .employee-card:active {
    cursor: grabbing;
}

/* SortableJS 드래그 스타일 */
.sortable-ghost {
    opacity: 0.4;
    background: #c7d2fe !important;
    border: 2px dashed #6366f1 !important;
}

.sortable-chosen {
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4) !important;
    transform: scale(1.02);
}

.sortable-drag {
    opacity: 1 !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2) !important;
}

/* 편집 모드 안내 텍스트 */
.employee-summary.edit-mode::before {
    content: '🔀 드래그하여 순서 변경';
    display: block;
    text-align: center;
    padding: 10px;
    color: #92400e;
    font-weight: 600;
    background: #fef3c7;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* ===== 야근 통계 카드 스타일 ===== */
#overtimeSummary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.overtime-summary-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.overtime-summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.summary-rank {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
    background: #e5e7eb;
    color: #374151;
}

.summary-rank.rank-gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.summary-rank.rank-silver {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    color: white;
}

.summary-rank.rank-bronze {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
}

.summary-employee {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.summary-stats {
    display: flex;
    gap: 15px;
    justify-content: space-between;
}

.stat-box {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.stat-box .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-box .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.no-records {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== 휴가 기록 내보내기 ===== */

.leave-export-section {
    margin-top: 20px;
    padding: 18px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 10px;
}

.leave-export-section h3 {
    margin-bottom: 12px;
    font-size: 15px;
}

.export-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.export-controls .form-group {
    flex: 1;
    min-width: 140px;
}

.export-controls .form-group label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-color, #555);
}

.export-controls .form-group select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    font-size: 13px;
    background: var(--input-bg, #fff);
    color: var(--text-color, #333);
}

.btn-export-csv {
    padding: 8px 18px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    height: 36px;
}

.btn-export-csv:hover {
    background: #218838;
}

.btn-import-csv {
    padding: 8px 18px;
    background: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    height: 36px;
}

.btn-import-csv:hover {
    background: #0b5ed7;
}

.btn-sync-sheet {
    padding: 8px 18px;
    background: #4285f4;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    height: 36px;
}

.btn-sync-sheet:hover {
    background: #3367d6;
}

@media (max-width: 768px) {
    .export-controls {
        flex-direction: column;
    }
    .export-controls .form-group {
        min-width: 100%;
    }
}

/* ===== API Key 관리 탭 ===== */

.apikey-section h2 {
    margin-bottom: 20px;
}

.apikey-request-form,
.apikey-admin-register {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.apikey-request-form h3,
.apikey-admin-register h3,
.apikey-list-section h3 {
    margin-bottom: 15px;
    font-size: 16px;
    color: var(--text-color, #333);
}

.apikey-form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.apikey-form-grid .form-group {
    flex: 1;
    min-width: 180px;
}

.apikey-form-grid .form-group label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-color, #555);
}

.apikey-form-grid .form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    background: var(--input-bg, #fff);
    color: var(--text-color, #333);
}

.btn-request-apikey,
.btn-register-apikey {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    height: 38px;
}

.btn-request-apikey {
    background: #4a90d9;
    color: #fff;
}

.btn-request-apikey:hover {
    background: #357abd;
}

.btn-register-apikey {
    background: #28a745;
    color: #fff;
}

.btn-register-apikey:hover {
    background: #218838;
}

/* API Key 카드 목록 */

.apikey-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.apikey-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 10px;
    padding: 16px;
    transition: box-shadow 0.2s;
}

.apikey-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.apikey-card.pending {
    border-left: 4px solid #ffc107;
}

.apikey-card.approved {
    border-left: 4px solid #28a745;
}

.apikey-card.rejected {
    border-left: 4px solid #dc3545;
    opacity: 0.7;
}

.apikey-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.apikey-card-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-color, #333);
}

.apikey-status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.apikey-status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.apikey-status-badge.approved {
    background: #d4edda;
    color: #155724;
}

.apikey-status-badge.rejected {
    background: #f8d7da;
    color: #721c24;
}

.apikey-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.apikey-info-row {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--text-color, #555);
}

.apikey-label {
    font-weight: bold;
    min-width: 80px;
    color: var(--text-color, #666);
}

.apikey-key-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 10px;
    background: var(--code-bg, #f8f9fa);
    border-radius: 6px;
    flex-wrap: wrap;
}

.apikey-value {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: var(--text-color, #333);
    word-break: break-all;
    flex: 1;
    min-width: 100px;
}

.btn-apikey-action {
    padding: 4px 10px;
    border: 1px solid var(--border-color, #ccc);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    background: var(--card-bg, #fff);
    color: var(--text-color, #333);
    white-space: nowrap;
}

.btn-apikey-action:hover {
    background: #e9ecef;
}

.btn-apikey-action.btn-copy {
    background: #4a90d9;
    color: #fff;
    border-color: #4a90d9;
}

.btn-apikey-action.btn-copy:hover {
    background: #357abd;
}

.apikey-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
}

.btn-approve {
    padding: 6px 14px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    font-weight: bold;
}

.btn-approve:hover {
    background: #218838;
}

.btn-delete-apikey {
    padding: 6px 14px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    font-weight: bold;
}

.btn-delete-apikey:hover {
    background: #c82333;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .apikey-form-grid {
        flex-direction: column;
    }

    .apikey-form-grid .form-group {
        min-width: 100%;
    }

    .apikey-key-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .apikey-card-actions {
        flex-direction: column;
    }

    .apikey-card-actions button {
        width: 100%;
    }
}

/* ================================================================
   [2026-04-20 Redesign] Linear / Notion 미니멀 스타일 오버라이드
   기존 구조 유지하면서 시각적 요소만 현대적으로 교체
   ================================================================ */

/* 1. 컬러 토큰 재정의 */
:root {
    --bg-primary: #FAFAFA;
    --bg-secondary: #F4F4F5;
    --bg-card: #FFFFFF;
    --text-primary: #18181B;
    --text-secondary: #52525B;
    --text-muted: #A1A1AA;
    --border-color: #E4E4E7;
    --border-strong: #D4D4D8;
    --shadow-color: rgba(0, 0, 0, 0.04);
    --accent-primary: #6366F1;
    --accent-secondary: #4F46E5;
    --accent-soft: #EEF2FF;
    --success-color: #10B981;
    --success-soft: #D1FAE5;
    --warning-color: #F59E0B;
    --warning-soft: #FEF3C7;
    --danger-color: #EF4444;
    --danger-soft: #FEE2E2;
    --info-color: #3B82F6;
    --info-soft: #DBEAFE;
}

[data-theme="dark"] {
    --bg-primary: #09090B;
    --bg-secondary: #18181B;
    --bg-card: #18181B;
    --text-primary: #FAFAFA;
    --text-secondary: #D4D4D8;
    --text-muted: #71717A;
    --border-color: #27272A;
    --border-strong: #3F3F46;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --accent-primary: #818CF8;
    --accent-secondary: #6366F1;
    --accent-soft: #1E1B4B;
    --success-color: #34D399;
    --success-soft: #064E3B;
    --warning-color: #FBBF24;
    --warning-soft: #78350F;
    --danger-color: #F87171;
    --danger-soft: #7F1D1D;
    --info-color: #60A5FA;
    --info-soft: #1E3A8A;
}

/* 2. Body / 기본 배경 */
body {
    background: var(--bg-primary) !important;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    min-height: 100vh;
}

/* 3. 컨테이너 — 그라데이션 배경 제거 */
.container {
    background: var(--bg-primary) !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    max-width: 1440px !important;
    margin: 0 auto !important;
    padding: 24px !important;
}

/* 4. 헤더 — 그라데이션 제거 */
header {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
    border-radius: 12px !important;
    padding: 16px 22px !important;
    box-shadow: none !important;
    margin-bottom: 16px;
}
header h1 {
    color: var(--text-primary) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-shadow: none !important;
}
header .current-time {
    color: var(--text-secondary) !important;
    background: var(--bg-secondary) !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border: 1px solid var(--border-color);
}
.theme-toggle, #logoutBtn, header button {
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.15s !important;
    box-shadow: none !important;
}
.theme-toggle:hover, #logoutBtn:hover, header button:hover {
    background: var(--border-color) !important;
    transform: none !important;
}

/* 5. 탭 버튼 — Notion 스타일 */
.tab-navigation {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color);
    border-radius: 12px !important;
    padding: 6px !important;
    display: inline-flex !important;
    gap: 2px !important;
    box-shadow: none !important;
    margin-bottom: 16px !important;
    width: fit-content !important;
}
.tab-button {
    background: transparent !important;
    color: var(--text-secondary) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    transition: all 0.15s !important;
}
.tab-button:hover { background: var(--bg-secondary) !important; color: var(--text-primary) !important; }
.tab-button.active {
    background: var(--text-primary) !important;
    color: var(--bg-card) !important;
    box-shadow: none !important;
}

/* 6. 메인 컨텐츠 카드 */
.main-content,
.tab-content,
.employee-section,
.calendar-section,
.overtime-section,
.overtime-form-section,
.overtime-list-section,
.overtime-calendar-section,
.overtime-summary-section,
.hr-section,
.hr-form-section,
.hr-list-section,
.apikey-section,
.apikey-request-form,
.apikey-admin-register,
.apikey-list-section,
.leave-export-section {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    padding: 22px !important;
}

/* 7. 섹션 헤더 */
.section-header, h2, h3 {
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding-bottom: 10px !important;
    margin-bottom: 16px !important;
}
h2 { font-size: 16px !important; font-weight: 600 !important; }
h3 { font-size: 14px !important; font-weight: 600 !important; }

/* 8. 야근 관리 빨간 배너 → 심플하게 */
.overtime-header {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 16px 20px !important;
    box-shadow: none !important;
}
.overtime-header h2 { color: var(--text-primary) !important; border: none !important; }
.overtime-stats {
    color: var(--text-secondary) !important;
}
.overtime-stats .stat-value { color: var(--accent-primary) !important; font-weight: 700 !important; }

/* 9. 입력 필드 */
input[type="text"], input[type="date"], input[type="time"],
input[type="email"], input[type="password"], input[type="number"],
select, textarea {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
    color: var(--text-primary) !important;
    transition: all 0.15s !important;
    font-family: inherit !important;
}
input:focus, select:focus, textarea:focus {
    outline: none !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}
label { font-size: 13px !important; color: var(--text-secondary) !important; font-weight: 500 !important; }

/* 10. 기본 버튼 */
button:not(.tab-button):not(.theme-toggle):not(.close):not(.delete-btn):not(.cal-btn) {
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 9px 16px !important;
    transition: all 0.15s !important;
    cursor: pointer;
    border: 1px solid transparent;
}

/* 주요(primary) 버튼 — 검정 배경
   주의: .add-employee 는 컨테이너 div, 실제 버튼은 .add-employee button 임 */
.add-employee button, .leave-form button,
.edit-mode-btn, .edit-done-btn,
button[type="submit"],
.btn-register-apikey, .btn-request-apikey {
    background: var(--text-primary) !important;
    color: var(--bg-card) !important;
    border: 1px solid var(--text-primary) !important;
    box-shadow: none !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 10px 16px !important;
    border-radius: 8px !important;
    transition: background 0.15s !important;
}
.add-employee button:hover, .leave-form button:hover,
.edit-mode-btn:hover, .edit-done-btn:hover,
button[type="submit"]:hover,
.btn-register-apikey:hover, .btn-request-apikey:hover {
    background: #000 !important;
    transform: none !important;
}

/* 직원 추가 컨테이너 내부 input 정리 */
.add-employee {
    background: transparent !important;
    color: inherit !important;
    border: none !important;
}
.add-employee input {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
    color: var(--text-primary) !important;
}
.add-employee input::placeholder { color: var(--text-muted) !important; }
.add-employee input:focus {
    outline: none !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

/* 삭제 X 버튼 (직원 카드 내부) */
.delete-employee {
    background: transparent !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    width: 26px !important;
    height: 26px !important;
    padding: 0 !important;
    font-size: 14px !important;
    line-height: 1 !important;
    font-weight: 400 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: all 0.15s !important;
    box-shadow: none !important;
}
.delete-employee:hover {
    background: var(--danger-soft) !important;
    color: var(--danger-color) !important;
    border-color: var(--danger-color) !important;
}

/* 유틸/보조 버튼 */
.edit-cancel-btn, .btn-export-csv, .btn-import-csv, .btn-sync-sheet,
.export-btn {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
}
.edit-cancel-btn:hover, .btn-export-csv:hover, .btn-import-csv:hover,
.btn-sync-sheet:hover, .export-btn:hover {
    background: var(--bg-secondary) !important;
    border-color: var(--border-strong) !important;
    transform: none !important;
}

/* 삭제 버튼 */
.delete-btn, .btn-delete-apikey {
    background: transparent !important;
    color: var(--danger-color) !important;
    border: 1px solid var(--danger-soft) !important;
    border-radius: 6px !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}
.delete-btn:hover, .btn-delete-apikey:hover {
    background: var(--danger-soft) !important;
}

/* 11. 직원 카드 (employee-summary 안의 각 직원 항목) */
.employee-summary {
    border-radius: 10px !important;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-card) !important;
    box-shadow: none !important;
    padding: 14px !important;
    margin-bottom: 8px !important;
    transition: all 0.15s !important;
}
.employee-summary:hover {
    border-color: var(--border-strong) !important;
    background: var(--bg-secondary) !important;
}

/* 12. 달력 */
.calendar, .overtime-calendar {
    border-radius: 10px !important;
    border: 1px solid var(--border-color) !important;
    overflow: hidden;
    gap: 1px !important;
    background: var(--border-color) !important;
}
.calendar > div, .overtime-calendar > div {
    background: var(--bg-card) !important;
}
.calendar .day-header,
.overtime-calendar .day-header {
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px !important;
}
.calendar .day,
.overtime-calendar .day {
    background: var(--bg-card) !important;
    padding: 8px !important;
    min-height: 80px !important;
    border: none !important;
}
.calendar .day:hover,
.overtime-calendar .day:hover { background: var(--bg-secondary) !important; }
.calendar .day.other-month,
.overtime-calendar .day.other-month {
    background: var(--bg-secondary) !important;
    opacity: 0.5;
}
.calendar .day.today,
.overtime-calendar .day.today {
    background: var(--warning-soft) !important;
    box-shadow: inset 0 0 0 1px var(--warning-color) !important;
}
.calendar .day.selected,
.overtime-calendar .day.selected {
    background: var(--accent-soft) !important;
    box-shadow: inset 0 0 0 1px var(--accent-primary) !important;
}

/* 휴가 배지 */
.calendar .leave-badge,
.calendar .leave-item,
.overtime-calendar .overtime-badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* 13. 모달 */
.modal, .modal-overlay {
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(4px) !important;
}
.modal-content {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12) !important;
    padding: 28px !important;
}
.modal-content h2, .modal-content h3 {
    border: none !important;
    padding-bottom: 0 !important;
}
.close {
    background: transparent !important;
    color: var(--text-muted) !important;
    border: none !important;
    font-size: 20px !important;
    line-height: 1 !important;
}
.close:hover { color: var(--text-primary) !important; }

/* 14. 통계 카드 */
.stat-item {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    padding: 14px !important;
    box-shadow: none !important;
}
.stat-label {
    color: var(--text-secondary) !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.stat-value {
    color: var(--text-primary) !important;
    font-size: 20px !important;
    font-weight: 700 !important;
}

/* 15. 달력 네비게이션(월 이동) */
.month-selector, .calendar-controls {
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}
.month-selector button, .calendar-controls button {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    width: 32px !important; height: 32px !important;
    padding: 0 !important;
    border-radius: 8px !important;
}
.month-selector button:hover, .calendar-controls button:hover {
    background: var(--bg-secondary) !important;
}

/* 16. 선택 정보 표시 */
.selected-info {
    background: var(--accent-soft) !important;
    color: var(--accent-secondary) !important;
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
    border-radius: 10px !important;
    padding: 12px !important;
    font-size: 13px !important;
}

/* 17. 전체 폰트 가독성 */
body, button, input, select, textarea {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* 18. 스크롤바 미니멀 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* 19. 토스트 알림 */
.toast-container > div {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
}

/* 20. 유지 — 본래 기능 보호 */
.hidden { display: none !important; }

/* ================================================================
   [2026-04-20 추가] 야근 관리 색상 정리
   기존 빨강/주황/초록 컬러풀한 배지 → 미니멀 톤으로
   ================================================================ */

/* 야근 달력 */
.overtime-calendar-section h3,
.overtime-list-section h3 {
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}
.overtime-day:hover { background: var(--bg-secondary) !important; transform: none !important; }
.overtime-day.has-overtime {
    background: var(--bg-card) !important;
    border: 1px solid var(--accent-primary) !important;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.1) !important;
}

/* 야근 달력 배지 ("N명" / "X.Xh") */
.overtime-count {
    background: var(--accent-soft) !important;
    color: var(--accent-primary) !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    padding: 2px 7px !important;
    border-radius: 5px !important;
}
.overtime-hours {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    padding: 2px 7px !important;
    border-radius: 5px !important;
}

/* 야근 필터 바 */
.overtime-filters {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
}
.overtime-filters select {
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
}

/* 엑셀 내보내기 버튼 */
.export-btn {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 8px 14px !important;
    box-shadow: none !important;
    transition: background 0.15s !important;
}
.export-btn:hover {
    background: var(--bg-secondary) !important;
    transform: none !important;
}

/* 야근 기록 카드 */
.overtime-item {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    padding: 16px !important;
    transition: border-color 0.15s !important;
    margin-bottom: 8px !important;
}
.overtime-item:hover {
    background: var(--bg-card) !important;
    border-color: var(--border-strong) !important;
    transform: none !important;
}
.overtime-item-date {
    color: var(--text-primary) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

/* 직원 이름 뱃지 */
.overtime-item-employee {
    background: var(--accent-soft) !important;
    color: var(--accent-primary) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
}

/* 시간 뱃지 (0.7시간 등) */
.overtime-duration {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 3px 10px !important;
    border-radius: 6px !important;
}
.overtime-time {
    color: var(--text-secondary) !important;
    font-size: 13px !important;
}

/* 사유 박스 */
.overtime-reason {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    font-style: normal !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
}

/* 수정/삭제 버튼 */
.btn-edit, .btn-delete {
    border-radius: 8px !important;
    padding: 7px 14px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    border: 1px solid transparent !important;
    cursor: pointer;
    transition: all 0.15s !important;
    box-shadow: none !important;
}
.btn-edit {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}
.btn-edit:hover {
    background: var(--bg-secondary) !important;
    border-color: var(--border-strong) !important;
}
.btn-delete {
    background: transparent !important;
    color: var(--danger-color) !important;
    border-color: var(--danger-soft) !important;
}
.btn-delete:hover {
    background: var(--danger-soft) !important;
}

/* ================================================================
   [2026-04-20] 커스텀 모달 (야근 상세 등)
   브라우저 기본 alert 대체용 예쁜 모달
   ================================================================ */
.custom-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.15s ease;
    padding: 20px;
}
.custom-modal-overlay.open { opacity: 1; }
.custom-modal-overlay.closing { opacity: 0; }

.custom-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96) translateY(8px);
    transition: transform 0.15s ease;
}
.custom-modal-overlay.open .custom-modal { transform: scale(1) translateY(0); }

.custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color);
}
.custom-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.custom-modal-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}
.custom-modal-close {
    background: transparent !important;
    border: none !important;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    font-size: 20px !important;
    line-height: 1 !important;
    color: var(--text-muted) !important;
    cursor: pointer;
    border-radius: 6px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s !important;
    box-shadow: none !important;
}
.custom-modal-close:hover {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

.custom-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    color: var(--text-primary);
}

.custom-modal-footer {
    padding: 14px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}
.custom-modal-btn {
    background: var(--text-primary) !important;
    color: var(--bg-card) !important;
    border: 1px solid var(--text-primary) !important;
    border-radius: 8px !important;
    padding: 8px 20px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: background 0.15s !important;
    box-shadow: none !important;
}
.custom-modal-btn:hover { background: #000 !important; }

/* 야근 상세 모달 전용 스타일 */
.ot-modal-summary {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
.ot-modal-stat {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
}
.ot-modal-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    margin-bottom: 4px;
}
.ot-modal-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}
.ot-modal-stat-value span {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 3px;
}

.ot-modal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ot-modal-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    transition: border-color 0.15s;
}
.ot-modal-item:hover { border-color: var(--border-strong); }
.ot-modal-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.ot-modal-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.ot-modal-hours {
    background: var(--accent-soft);
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}
.ot-modal-time {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.ot-modal-reason {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px dashed var(--border-color);
}