/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 페이지 전환 */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* 로그인 페이지 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 60px;
    color: #667eea;
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 28px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select,
.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.sample-info {
    margin-top: 25px;
    padding: 15px;
    background: #f5f7fa;
    border-radius: 8px;
    font-size: 13px;
}

.sample-info p {
    margin-bottom: 8px;
    color: #555;
}

.sample-info ul {
    list-style: none;
    padding-left: 0;
}

.sample-info li {
    padding: 4px 0;
    color: #666;
}

/* 버튼 */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-success {
    background: #10b981;
    color: white;
    padding: 8px 15px;
    font-size: 13px;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
    padding: 8px 15px;
    font-size: 13px;
    margin-left: 5px;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    padding: 8px 15px;
    font-size: 13px;
    margin-left: 5px;
}

.btn-warning:hover {
    background: #d97706;
}

/* 헤더 */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    color: #667eea;
}

.header i {
    margin-right: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-weight: 600;
    color: #555;
}

/* 컨테이너 */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* 통계 카드 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.card-icon {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
}

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

.card-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.card-icon.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.card-content h3 {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

/* 폼 카드 */
.form-card {
    display: block;
    margin-bottom: 30px;
}

.card-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: flex-start;  /* space-between → flex-start 변경 */
    flex-wrap: wrap;
    gap: 15px;
}

/* 다운로드 버튼 그룹 - 오른쪽 배치 */
.card .card-header .download-buttons-group {
    display: flex !important;
    gap: 8px !important;
    justify-content: flex-end !important;
    align-items: center !important;
    margin-left: auto !important;
    flex: 0 0 auto !important;
}

div.download-buttons-group {
    margin-left: auto !important;
}

.card-header h2 {
    flex: 0 1 auto;
    font-size: 20px;
    color: #333;
    margin: 0;
}
}

.card-header i {
    margin-right: 10px;
    color: #667eea;
}

.btn-success {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-success i {
    font-size: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-info {
    padding: 15px;
    background: #f0f9ff;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.form-info p {
    color: #555;
    font-size: 14px;
}

/* 테이블 */
.table-container {
    overflow-x: auto;
}

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

thead {
    background: #f8f9fa;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
}

td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
}

tbody tr:hover {
    background: #f8f9fa;
}

.no-data {
    text-align: center !important;
    color: #999 !important;
    padding: 30px !important;
}

/* 상태 배지 */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

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

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

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

.status-cancel-requested {
    background: #fef3c7;
    color: #ea580c;
}

.status-cancelled {
    background: #e5e7eb;
    color: #6b7280;
    text-decoration: line-through;
}

.btn-cancel {
    background: #f59e0b;
    color: white;
    padding: 8px 15px;
    font-size: 13px;
}

.btn-cancel:hover {
    background: #d97706;
}

/* 통계 프로그레스 바 */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 600;
}

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

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

.stats-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #dbeafe;
    color: #1e40af;
}

/* 연차 타입 배지 */
.leave-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.leave-type-full {
    background: #dbeafe;
    color: #1e40af;
}

.leave-type-half {
    background: #fef3c7;
    color: #d97706;
}

.leave-type-quarter {
    background: #fce7f3;
    color: #db2777;
}

.leave-type-birthday {
    background: #e9d5ff;
    color: #9333ea;
}

.leave-type-happy-quarter {
    background: #fef9c3;
    color: #ca8a04;
}

.leave-type-refresh {
    background: #dcfce7;
    color: #16a34a;
}

.leave-type-hourly {
    background: #e0e7ff;
    color: #4f46e5;
}

.leave-type-unpaid {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px dashed #9ca3af;
}

.leave-type-family {
    background: #fef2f2;
    color: #dc2626;
}

/* 알림 메시지 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transform: translateX(400px);
    transition: transform 0.3s;
    z-index: 1000;
    max-width: 350px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid #10b981;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

/* 알림 버튼 스타일 */
.btn-icon {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: #e5e7eb;
    transform: scale(1.05);
}

.btn-icon i {
    font-size: 18px;
    color: #4b5563;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* 알림 센터 모달 */
.notification-center-content {
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.notification-center-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notification-tabs {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-bottom: 2px solid #e5e7eb;
    background: #f9fafb;
}

.notification-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.notification-tab:hover {
    background: #e5e7eb;
    color: #374151;
}

.notification-tab.active {
    background: #667eea;
    color: white;
}

.tab-badge {
    display: inline-block;
    background: #ef4444;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    min-width: 18px;
    text-align: center;
}

.notification-tab.active .tab-badge {
    background: white;
    color: #667eea;
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.notification-item {
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.notification-item:hover {
    background: #f9fafb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notification-item.unread {
    background: #eff6ff;
    border-left: 4px solid #667eea;
}

.notification-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.notification-item-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
    flex: 1;
}

.notification-item-time {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
    margin-left: 10px;
}

.notification-item-message {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.notification-loading {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

.notification-empty {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

.notification-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.notification-center-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 15px;
    border-top: 2px solid #e5e7eb;
    background: #f9fafb;
}

/* 알림 설정 스타일 */
.notification-settings {
    padding: 20px 0;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 10px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.setting-item:hover {
    background: #f3f4f6;
}

.setting-info {
    flex: 1;
}

.setting-info h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #1f2937;
}

.setting-info h3 i {
    margin-right: 8px;
    color: #667eea;
}

.setting-info p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

/* 토글 스위치 */
.switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
    margin-left: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.4s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

input:focus + .slider {
    box-shadow: 0 0 1px #667eea;
}


/* 모달 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h2 {
    font-size: 20px;
    color: #333;
    margin: 0;
}

.modal-header i {
    margin-right: 10px;
    color: #667eea;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #333;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.modal-footer .btn {
    width: auto;
    min-width: 100px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .user-info {
        flex-direction: column;
        gap: 10px;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 13px;
    }

    th, td {
        padding: 10px;
    }

    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* 인쇄 스타일 */
@media print {
    /* 화면 요소 숨기기 */
    .header,
    .btn,
    button,
    .notification,
    .no-print {
        display: none !important;
    }
    
    /* 페이지 여백 */
    @page {
        margin: 20mm;
        size: A4;
    }
    
    body {
        background: white;
        padding: 0;
        margin: 0;
    }
    
    /* 인쇄용 헤더 */
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 30px;
        border-bottom: 3px solid #667eea;
        padding-bottom: 15px;
    }
    
    .print-header h1 {
        font-size: 28px;
        color: #333;
        margin: 0 0 10px 0;
    }
    
    .print-header p {
        font-size: 14px;
        color: #666;
        margin: 5px 0;
    }
    
    /* 신청서 카드 */
    .print-card {
        display: block !important;
        page-break-inside: avoid;
        border: 2px solid #333;
        padding: 20px;
        margin-bottom: 30px;
        background: white;
    }
    
    .print-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #667eea;
    }
    
    .print-card-title {
        font-size: 20px;
        font-weight: bold;
        color: #333;
    }
    
    .print-card-type {
        font-size: 16px;
        padding: 5px 15px;
        border: 2px solid #667eea;
        border-radius: 5px;
        color: #667eea;
        font-weight: bold;
    }
    
    .print-card-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .print-field {
        display: flex;
        align-items: baseline;
    }
    
    .print-field-label {
        font-weight: bold;
        color: #555;
        margin-right: 10px;
        min-width: 80px;
    }
    
    .print-field-value {
        color: #333;
        border-bottom: 1px solid #ccc;
        flex: 1;
        padding-bottom: 2px;
    }
    
    .print-field-full {
        grid-column: 1 / -1;
    }
    
    .print-reason {
        margin-top: 15px;
        padding: 15px;
        border: 1px solid #ddd;
        background: #f9f9f9;
        min-height: 80px;
    }
    
    .print-reason-label {
        font-weight: bold;
        color: #555;
        margin-bottom: 10px;
        display: block;
    }
    
    .print-reason-value {
        color: #333;
        line-height: 1.6;
        white-space: pre-wrap;
    }
    
    .print-footer {
        margin-top: 30px;
        padding-top: 15px;
        border-top: 1px solid #ddd;
        display: flex;
        justify-content: space-between;
    }
    
    .print-signature {
        text-align: center;
    }
    
    .print-signature-label {
        font-size: 12px;
        color: #666;
        margin-bottom: 30px;
    }
    
    .print-signature-line {
        border-top: 1px solid #333;
        width: 150px;
        margin: 0 auto;
        padding-top: 5px;
        font-size: 12px;
        color: #666;
    }
    
    /* 페이지 브레이크 */
    .page-break {
        page-break-after: always;
    }
    
    /* 인쇄 시 불필요한 여백 제거 */
    .container {
        margin: 0;
        padding: 0;
        max-width: 100%;
    }
}

/* 화면에서는 인쇄 요소 숨기기 */
.print-only {
    display: none;
}

@media print {
    .print-only {
        display: block !important;
    }
}

/* 마이페이지 스타일 */
.profile-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.profile-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.profile-label {
    font-weight: 600;
    color: #555;
    margin-right: 10px;
    min-width: 100px;
}

.profile-value {
    color: #333;
    font-size: 16px;
}

/* 시간 입력 필드 그룹 */
#timeInputGroup {
    transition: all 0.3s ease;
}

#timeInputGroup input[type="time"] {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
}

#timeInputGroup input[type="time"]:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 관리자 메뉴 네비게이션 */
.admin-menu {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.admin-menu-btn {
    flex: 1;
    min-width: 180px;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.admin-menu-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
    color: #667eea;
}

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

.admin-menu-btn i {
    font-size: 16px;
}

/* 관리자 컨텐츠 섹션 */
.admin-content {
    display: none;
}

.admin-content.active {
    display: block;
}

/* 자동 로그인 체크박스 */
.auto-login-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.auto-login-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.auto-login-label span {
    font-size: 14px;
    color: #555;
}

.auto-login-label:hover span {
    color: #667eea;
}
