/* HR Module Specific Styles */

/* ---------------- Tabs Navigation ---------------- */
.hr-tabs-container {
    padding: 8px;
}

.hr-tabs {
    display: flex;
    list-style: none;
    gap: 8px;
}

.tab-btn {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}


/* ---------------- Personnel Grid ---------------- */
.personnel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.employee-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.employee-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

.emp-photo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    margin-bottom: 16px;
}

.emp-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.emp-id {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 4px;
}

.emp-dept {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.emp-role {
    display: inline-block;
    margin-bottom: 20px;
}

.emp-status {
    width: 100%;
    border-top: 1px dashed var(--border-color);
    padding-top: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.status-dot.online { background: var(--accent-green); box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }
.status-dot.offline { background: var(--accent-red); }

/* ---------------- Attendance Table ---------------- */
.time-stamp {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
    letter-spacing: 1px;
}
.late-stamp {
    color: var(--accent-red);
}

/* ---------------- Profile Modal ---------------- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-sidebar);
    width: 900px;
    max-width: 95%;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-close, .btn-pdf {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-close:hover { color: var(--accent-red); }
.btn-pdf:hover { color: var(--accent-blue); }

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    border: none;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--accent-blue);
    color: #fff;
}
.btn-primary:hover { background: #2563EB; }

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}
.btn-secondary:hover { background: rgba(255,255,255,0.15); }


/* Profile Grid Layout */
.profile-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
}

@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.profile-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.emp-photo-large img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--border-color);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}

.basic-tags {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.p-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.p-id {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
}
.p-job {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.p-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.info-item {
    background: rgba(0,0,0,0.1);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.info-item .label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.info-item .val {
    font-size: 1.05rem;
    font-weight: 600;
}

/* Timeline */
.p-timeline-section h4, .p-family h4 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}
.p-family { margin-bottom: 30px; }

.timeline {
    list-style: none;
    position: relative;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline li {
    margin-bottom: 20px;
    position: relative;
}

.timeline li::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-blue);
    border: 2px solid var(--bg-sidebar);
}

.t-date {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 4px;
}
.t-event {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ---------------- New Employee Form ---------------- */
.new-emp-form {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .new-emp-form {
        grid-template-columns: 1fr;
    }
}

.photo-group {
    text-align: center;
    padding: 20px;
    background: rgba(0,0,0,0.1);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
}

.photo-upload-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 16px;
}
.photo-upload-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    transition: var(--transition);
}
.photo-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--accent-blue);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 3px solid var(--bg-surface);
    transition: var(--transition);
}
.photo-upload-btn:hover { background: #2563EB; transform: scale(1.05); }
#empPhotoUpload { display: none; }

.photo-guide {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}
.photo-guide span { font-size: 0.75rem; color: var(--text-secondary); font-weight: 400; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-group.full-width { grid-column: span 2; }

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.styled-input {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}
.styled-input:focus {
    border-color: var(--accent-blue);
    background: rgba(0,0,0,0.4);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.input-with-icon { position: relative; display: flex; align-items: center; width: 100%; }
.input-with-icon i { position: absolute; left: 16px; color: var(--text-secondary); }
.styled-input.with-icon { padding-left: 40px; width: 100%; box-sizing: border-box; }

.permissions-section {
    grid-column: 1 / -1;
    margin-top: 10px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}
.permissions-section h3 { font-size: 1.1rem; margin-bottom: 4px; color: var(--text-primary); }
.permissions-section h3 i { color: var(--accent-indigo); margin-right: 8px; }
.section-desc { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 16px; }

.perm-table th { background: rgba(0,0,0,0.15); }
.text-center { text-align: center !important; }
.styled-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-blue);
}

/* ---------------- Print Styles ---------------- */
@media print {
    body * {
        visibility: hidden;
    }
    .printable-section, .printable-section * {
        visibility: visible;
    }
    .printable-section {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    /* Hide scrollbars, sidebar, header */
    .sidebar, .top-header, .hr-tabs-container {
        display: none !important;
    }
    .modal-overlay {
        background: transparent;
        position: static;
        display: block;
    }
    .modal-content {
        transform: none;
        max-height: none;
    }
    .btn-close, .modal-actions, .modal-footer {
        display: none !important;
    }
    .info-item .val.blur-if-no-auth {
        filter: none;
        color: #000;
    }
}

/* ─── Fix: Dropdown (select) 시인성 개선 ─── */
.styled-select option,
.styled-input option {
    background: #0F172A;
    color: #F8FAFC;
    padding: 8px;
}
.styled-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394A3B8'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 20px;
    padding-right: 32px;
    cursor: pointer;
    min-width: 140px;
    font-size: 0.88rem;
}

/* ─── Fix: 신규사원 등록폼 레이아웃 개선 ─── */
.new-emp-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.new-emp-form .photo-group {
    max-width: 200px;
    margin: 0 auto 24px;
}
.new-emp-form .form-grid {
    grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 900px) {
    .new-emp-form .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ─── 인사기록카드 수정/삭제 버튼 ─── */
.emp-card-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}
.employee-card:hover .emp-card-actions {
    opacity: 1;
}
.emp-card-actions button {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94A3B8;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    transition: all 0.2s;
}
.emp-card-actions button:hover {
    color: #F8FAFC;
    background: rgba(59,130,246,0.3);
    border-color: rgba(59,130,246,0.5);
}
.emp-card-actions button.btn-del:hover {
    background: rgba(239,68,68,0.3);
    border-color: rgba(239,68,68,0.5);
    color: #EF4444;
}

/* ─── 연차 수정 버튼 ─── */
.btn-edit-leave {
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.25);
    color: #60A5FA;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.btn-edit-leave:hover {
    background: rgba(59,130,246,0.25);
}

/* ─── 근태 - 출결 요약 카드 ─── */
.attendance-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.att-card {
    padding: 20px;
    border-radius: 14px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}
.att-card .att-value {
    font-size: 2rem;
    font-weight: 800;
    margin: 8px 0 4px;
}
.att-card .att-label {
    font-size: 0.82rem;
    color: #94A3B8;
}
.att-card.green .att-value { color: #10B981; }
.att-card.red .att-value { color: #EF4444; }
.att-card.orange .att-value { color: #F59E0B; }
.att-card.blue .att-value { color: #3B82F6; }

/* 출결 차트 영역 */
.att-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.att-chart-box {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 20px;
}
.att-chart-box h3 {
    font-size: 0.95rem;
    color: #F8FAFC;
    margin-bottom: 16px;
    font-weight: 600;
}

/* 도넛 차트 (CSS) */
.donut-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.donut-center {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #0F172A;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.donut-center .dc-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: #F8FAFC;
}
.donut-center .dc-label {
    font-size: 0.7rem;
    color: #94A3B8;
}

/* 월간 출결 캘린더 */
.monthly-attendance {
    margin-top: 16px;
}
.month-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.month-selector button {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94A3B8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.month-selector span {
    font-weight: 700;
    font-size: 1rem;
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.cal-header {
    text-align: center;
    font-size: 0.75rem;
    color: #64748B;
    font-weight: 600;
    padding: 6px 0;
}
.cal-day {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    position: relative;
}
.cal-day.present { background: rgba(16,185,129,0.15); color: #10B981; }
.cal-day.absent { background: rgba(239,68,68,0.15); color: #EF4444; }
.cal-day.late { background: rgba(245,158,11,0.15); color: #F59E0B; }
.cal-day.vacation { background: rgba(99,102,241,0.15); color: #6366F1; }
.cal-day.empty { opacity: 0.15; }
.cal-day.today { box-shadow: inset 0 0 0 2px #3B82F6; }

/* 출결 범례 */
.att-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.att-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #94A3B8;
}
.att-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* 직원별 월간 테이블 */
.emp-monthly-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.emp-monthly-table th {
    padding: 10px 12px;
    text-align: left;
    color: #94A3B8;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 0.8rem;
}
.emp-monthly-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mini-bar {
    display: flex;
    gap: 2px;
    align-items: center;
}
.mini-bar .mb {
    width: 8px;
    height: 16px;
    border-radius: 2px;
}
.mb.p { background: #10B981; }
.mb.a { background: #EF4444; }
.mb.l { background: #F59E0B; }
.mb.v { background: #6366F1; }
.mb.w { background: rgba(255,255,255,0.06); }

/* st-vacation status */
.st-vacation::before { background: var(--accent-indigo); }
