/* =====================================================
   vacationhistory.css
   휴가 내역 페이지

   PC     : 테이블
   Mobile : 카드형 목록
   ===================================================== */


/* =====================================================
   전체
   ===================================================== */

.history_page {

    width: 100%;
    min-height: 100vh;

    padding: 50px 30px;

    box-sizing: border-box;

}


/* =====================================================
   메인 박스
   ===================================================== */

.history_box {

    width: 100%;
    max-width: 1200px;

    margin: 0 auto;

    padding: 35px;

    background:
        rgba(
            255,
            255,
            255,
            0.92
        );

    border-radius: 14px;

    box-sizing: border-box;

}


/* =====================================================
   제목
   ===================================================== */

.history_title {

    width: 100%;

    margin-bottom: 30px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

}


/* =====================================================
   제목 왼쪽
   ===================================================== */

.history_title_left {

    min-width: 0;

}


.history_title h2 {

    margin: 0 0 8px;

    color: #222222;

    font-size: 30px;
    font-weight: 400;

}


.user_info {

    min-height: 22px;

    color: #666666;

    font-size: 15px;

}


/* =====================================================
   제목 오른쪽 버튼
   ===================================================== */

.history_title_buttons {

    flex-shrink: 0;

    display: flex;

    align-items: center;

    gap: 8px;

}


/* =====================================================
   새로고침 / 홈으로
   ===================================================== */

.refresh_button,
.home_button {

    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 90px;
    height: 40px;

    padding: 0 18px;

    border: 0;
    border-radius: 6px;

    background: #424242;

    color: #ffffff;

    text-decoration: none;

    font-size: 14px;
    font-family: inherit;
    font-weight: 400;

    line-height: 1;

    cursor: pointer;

    box-sizing: border-box;

    transition:
        background 0.2s;

}


.refresh_button:hover,
.home_button:hover {

    background: #212121;

    color: #ffffff;

}


/* =====================================================
   휴가 요약
   ===================================================== */

.history_summary {

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;

    margin-bottom: 40px;

}


.summary_card {

    padding: 25px 20px;

    background: #ffffff;

    border: 1px solid #dddddd;

    border-radius: 10px;

    text-align: center;

    box-sizing: border-box;

}


.summary_label {

    margin-bottom: 10px;

    color: #666666;

    font-size: 15px;

}


.summary_value {

    color: #222222;

    font-size: 28px;
    font-weight: 600;

}


/* =====================================================
   휴가 사용 내역 제목 / 연도 선택
   ===================================================== */

.history_list_title {

    margin-bottom: 15px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 15px;

}


.history_list_title h3 {

    margin: 0;

    color: #222222;

    font-size: 20px;
    font-weight: 500;

}


/* =====================================================
   연도 선택
   ===================================================== */

.history_year_wrap {

    display: flex;

    align-items: center;

    gap: 8px;

}


.history_year_label {

    color: #666666;

    font-size: 14px;

    white-space: nowrap;

}


.history_year_select {

    min-width: 105px;
    height: 38px;

    padding: 0 32px 0 12px;

    border: 1px solid #cccccc;
    border-radius: 6px;

    background: #ffffff;

    color: #222222;

    font-size: 14px;
    font-family: inherit;

    cursor: pointer;

    box-sizing: border-box;

    outline: none;

}


.history_year_select:hover {

    border-color: #999999;

}


.history_year_select:focus {

    border-color: #7b1fa2;

}


/* =====================================================
   테이블
   ===================================================== */

.table_wrap {

    width: 100%;

    overflow-x: auto;

}


.history_table {

    width: 100%;

    border-collapse: collapse;

    table-layout: fixed;

}


.history_table th,
.history_table td {

    padding: 16px 8px;

    border-bottom:
        1px solid
        #d8d8d8;

    text-align: center;

    font-size: 15px;

}


.history_table th {

    background:
        rgba(
            0,
            0,
            0,
            0.05
        );

    color: #333333;

    font-weight: 400;

}


.history_table td {

    color: #222222;

}


/* =====================================================
   비고 / 반려 사유
   ===================================================== */

.history_reason,
.history_reject_reason {

    word-break: break-word;

    overflow-wrap: anywhere;

}


/* =====================================================
   상태
   ===================================================== */

.status_badge {

    display: inline-block;

    min-width: 64px;

    padding:
        6px
        10px;

    border-radius: 20px;

    font-size: 13px;

    box-sizing: border-box;

}


/* 승인 */

.status_approved {

    background: #e8f1fb;

    color: #1565c0;

}


/* 승인 대기 */

.status_pending {

    background: #eeeeee;

    color: #222222;

}


/* 반려 */

.status_rejected {

    background: #fdeaea;

    color: #c62828;

}


/* 취소 */

.status_cancelled {

    background: #eeeeee;

    color: #666666;

}


/* =====================================================
   데이터 없음
   ===================================================== */

.empty_message {

    display: none;

    padding: 40px 10px;

    text-align: center;

    color: #666666;

    font-size: 17px;

}


/* =====================================================
   총 휴가 횟수 설정 팝업 배경
   ===================================================== */

.annual_leave_modal_overlay {

    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(
            0,
            0,
            0,
            0.55
        );

    box-sizing: border-box;

    z-index: 9999;

}


.annual_leave_modal_overlay.active {

    display: flex;

}


/* =====================================================
   총 휴가 횟수 설정 팝업
   ===================================================== */

.annual_leave_modal {

    width: 100%;
    max-width: 420px;

    padding: 28px;

    background: #ffffff;

    border-radius: 12px;

    box-shadow:
        0
        12px
        35px
        rgba(
            0,
            0,
            0,
            0.25
        );

    box-sizing: border-box;

}


/* =====================================================
   팝업 제목
   ===================================================== */

.annual_leave_modal_header {

    margin-bottom: 20px;

}


.annual_leave_modal_header h3 {

    margin: 0;

    color: #222222;

    font-size: 22px;
    font-weight: 500;

}


/* =====================================================
   팝업 내용
   ===================================================== */

.annual_leave_modal_body {

    width: 100%;

}


.annual_leave_modal_description {

    margin:
        0
        0
        22px;

    color: #555555;

    font-size: 15px;

    line-height: 1.6;

}


/* =====================================================
   팝업 입력
   ===================================================== */

.annual_leave_input_wrap {

    width: 100%;

}


.annual_leave_input_label {

    display: block;

    margin-bottom: 8px;

    color: #333333;

    font-size: 14px;

}


.annual_leave_input_group {

    width: 100%;

    display: flex;

    align-items: center;

    border: 1px solid #cccccc;
    border-radius: 7px;

    background: #ffffff;

    overflow: hidden;

    box-sizing: border-box;

    transition:
        border-color 0.2s,
        box-shadow 0.2s;

}


.annual_leave_input_group:focus-within {

    border-color: #7b1fa2;

    box-shadow:
        0
        0
        0
        2px
        rgba(
            123,
            31,
            162,
            0.10
        );

}


.annual_leave_input {

    width: 100%;
    height: 44px;

    padding: 0 12px;

    border: 0;
    outline: 0;

    background: transparent;

    color: #222222;

    font-size: 16px;
    font-family: inherit;

    box-sizing: border-box;

}


.annual_leave_input_unit {

    flex-shrink: 0;

    padding-right: 14px;

    color: #666666;

    font-size: 14px;

}


/* =====================================================
   팝업 오류 메시지
   ===================================================== */

.annual_leave_error_message {

    min-height: 20px;

    margin-top: 8px;

    color: #c62828;

    font-size: 13px;

    line-height: 1.5;

}


/* =====================================================
   팝업 버튼
   ===================================================== */

.annual_leave_modal_buttons {

    margin-top: 18px;

    display: flex;

    justify-content: flex-end;

}


.annual_leave_save_button {

    min-width: 90px;
    height: 40px;

    padding: 0 18px;

    border: 0;
    border-radius: 6px;

    background: #424242;

    color: #ffffff;

    font-size: 14px;
    font-family: inherit;

    cursor: pointer;

    box-sizing: border-box;

    transition:
        background 0.2s;

}


.annual_leave_save_button:hover {

    background: #212121;

}


.annual_leave_save_button:disabled {

    background: #999999;

    cursor: default;

}


/* =====================================================
   Tablet / Mobile
   767px 이하
   ===================================================== */

@media (max-width: 767px) {


    /* =================================================
       전체
       ================================================= */

    .history_page {

        padding:
            25px
            15px
            50px;

    }


    /* =================================================
       메인 박스
       ================================================= */

    .history_box {

        padding:
            25px
            18px;

    }


    /* =================================================
       제목
       ================================================= */

    .history_title {

        margin-bottom: 25px;

        gap: 12px;

    }


    .history_title_left {

        min-width: 0;

    }


    .history_title h2 {

        margin-bottom: 6px;

        font-size: 26px;

    }


    .user_info {

        font-size: 14px;

    }


    /* =================================================
       상단 버튼
       ================================================= */

    .history_title_buttons {

        gap: 6px;

    }


    .refresh_button,
    .home_button {

        min-width: 72px;
        height: 36px;

        padding: 0 12px;

        font-size: 13px;

    }


    /* =================================================
       요약
       ================================================= */

    .history_summary {

        gap: 10px;

        margin-bottom: 30px;

    }


    .summary_card {

        padding:
            20px
            10px;

    }


    .summary_label {

        font-size: 14px;

    }


    .summary_value {

        font-size: 24px;

    }


    /* =================================================
       내역 제목 / 연도
       ================================================= */

    .history_list_title {

        gap: 10px;

    }


    .history_list_title h3 {

        font-size: 18px;

    }


    .history_year_label {

        display: none;

    }


    .history_year_select {

        min-width: 95px;
        height: 36px;

        padding:
            0
            28px
            0
            10px;

        font-size: 13px;

    }


    /* =================================================
       테이블 외부
       ================================================= */

    .table_wrap {

        overflow: visible;

    }


    /* =================================================
       테이블 → 카드
       ================================================= */

    .history_table {

        display: block;

        width: 100%;
        min-width: 0;

        border-collapse: separate;

        table-layout: auto;

    }


    .history_table thead {

        display: none;

    }


    .history_table tbody {

        display: block;

        width: 100%;

    }


    /* =================================================
       휴가 한 건 = 카드 하나
       ================================================= */

    .history_table tbody tr {

        display: block;

        width: 100%;

        margin-bottom: 15px;

        padding: 18px;

        background: #ffffff;

        border:
            1px solid
            #dddddd;

        border-radius: 10px;

        box-sizing: border-box;

        box-shadow:
            0
            2px
            7px
            rgba(
                0,
                0,
                0,
                0.06
            );

    }


    .history_table tbody tr:last-child {

        margin-bottom: 0;

    }


    /* =================================================
       카드 데이터 한 줄
       ================================================= */

    .history_table tbody td {

        display: flex;

        width: 100%;
        min-height: 38px;

        padding:
            9px
            0;

        align-items: center;
        justify-content: space-between;

        gap: 15px;

        border: 0;

        border-bottom:
            1px solid
            #eeeeee;

        color: #222222;

        text-align: right;

        font-size: 15px;

        box-sizing: border-box;

    }


    .history_table tbody td:last-child {

        border-bottom: 0;

    }


    /* =================================================
       왼쪽 항목명
       ================================================= */

    .history_table tbody td::before {

        flex-shrink: 0;

        color: #666666;

        font-size: 14px;
        font-weight: 500;

        text-align: left;

    }


    /* =================================================
       모바일 항목명
       ================================================= */

    .history_table tbody td:nth-child(1)::before {

        content: "연차 구분";

    }


    .history_table tbody td:nth-child(2)::before {

        content: "시작일";

    }


    .history_table tbody td:nth-child(3)::before {

        content: "종료일";

    }


    .history_table tbody td:nth-child(4)::before {

        content: "일수";

    }


    .history_table tbody td:nth-child(5)::before {

        content: "비고";

    }


    .history_table tbody td:nth-child(6)::before {

        content: "상태";

    }


    .history_table tbody td:nth-child(7)::before {

        content: "반려 사유";

    }


    /* =================================================
       연차 구분 강조
       ================================================= */

    .history_table tbody td:nth-child(1) {

        padding-top: 0;

        font-size: 17px;
        font-weight: 600;

    }


    /* =================================================
       비고 / 반려 사유
       ================================================= */

    .history_table tbody td:nth-child(5),
    .history_table tbody td:nth-child(7) {

        align-items: flex-start;

    }


    .history_reason,
    .history_reject_reason {

        max-width: 65%;

        text-align: right;

    }


    /* =================================================
       마지막 행
       ================================================= */

    .history_table tbody td:nth-child(7) {

        padding-bottom: 0;

        border-bottom: 0;

    }


    /* =================================================
       데이터 없음
       ================================================= */

    .empty_message {

        padding:
            35px
            10px;

        font-size: 15px;

    }


    /* =================================================
       팝업
       ================================================= */

    .annual_leave_modal_overlay {

        padding: 15px;

    }


    .annual_leave_modal {

        max-width: 390px;

        padding: 24px 20px;

    }


    .annual_leave_modal_header h3 {

        font-size: 20px;

    }


    .annual_leave_modal_description {

        font-size: 14px;

    }

}


/* =====================================================
   Small Mobile
   480px 이하
   ===================================================== */

@media (max-width: 480px) {


    .history_page {

        padding:
            20px
            12px
            45px;

    }


    .history_box {

        padding:
            22px
            15px;

    }


    /* =================================================
       제목
       ================================================= */

    .history_title {

        margin-bottom: 22px;

        gap: 8px;

    }


    .history_title h2 {

        font-size: 25px;

    }


    .user_info {

        font-size: 13px;

    }


    /* =================================================
       상단 버튼
       ================================================= */

    .history_title_buttons {

        gap: 5px;

    }


    .refresh_button,
    .home_button {

        min-width: 62px;
        height: 34px;

        padding: 0 8px;

        font-size: 12px;

    }


    /* =================================================
       요약
       ================================================= */

    .summary_card {

        padding:
            18px
            8px;

    }


    .summary_label {

        font-size: 13px;

    }


    .summary_value {

        font-size: 22px;

    }


    /* =================================================
       내역 제목 / 연도
       ================================================= */

    .history_list_title {

        margin-bottom: 12px;

    }


    .history_list_title h3 {

        font-size: 17px;

    }


    .history_year_select {

        min-width: 88px;
        height: 34px;

        padding:
            0
            24px
            0
            9px;

        font-size: 12px;

    }


    /* =================================================
       카드
       ================================================= */

    .history_table tbody tr {

        padding: 16px;

    }


    .history_table tbody td {

        min-height: 36px;

        padding:
            8px
            0;

        font-size: 14px;

    }


    .history_table tbody td::before {

        font-size: 13px;

    }


    .history_table tbody td:nth-child(1) {

        font-size: 16px;

    }


    /* =================================================
       팝업
       ================================================= */

    .annual_leave_modal_overlay {

        padding: 12px;

    }


    .annual_leave_modal {

        padding:
            22px
            18px;

        border-radius: 10px;

    }


    .annual_leave_modal_header {

        margin-bottom: 16px;

    }


    .annual_leave_modal_header h3 {

        font-size: 19px;

    }


    .annual_leave_modal_description {

        margin-bottom: 18px;

        font-size: 13px;

    }


    .annual_leave_input {

        height: 42px;

        font-size: 15px;

    }


    .annual_leave_save_button {

        width: 100%;
        height: 40px;

    }

}

/* =====================================================
   공통 좌측바 / vacationapproval 동일 UI
   ===================================================== */
body.has-listbar {
    padding-left: 250px;
    background: #eff8ff;
    color: #19253d;
    box-sizing: border-box;
}

.history_topbar {
    display: none;
}

body.has-listbar .history_page {
    width: 100%;
    min-width: 0;
    padding: 45px 30px 60px;
}

body.has-listbar .history_box {
    background: #ffffff;
    border: 1px solid #e1e8f3;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(30, 56, 95, 0.08);
}

body.has-listbar .history_title h2 {
    color: #19253d;
    font-weight: 700;
}

body.has-listbar .user_info {
    color: #61718a;
}

body.has-listbar .refresh_button {
    background: #4268ed;
}

body.has-listbar .refresh_button:hover {
    background: #3153c9;
}

body.has-listbar .home_button {
    background: #344967;
}

body.has-listbar .home_button:hover {
    background: #243650;
}

body.has-listbar .summary_card {
    background: #f8fbff;
    border: 1px solid #e1e8f3;
    box-shadow: 0 2px 8px rgba(30, 56, 95, 0.04);
}

body.has-listbar .summary_label {
    color: #61718a;
}

body.has-listbar .summary_value {
    color: #19253d;
}

body.has-listbar .history_list_title h3 {
    color: #19253d;
    font-weight: 600;
}

body.has-listbar .history_year_select {
    border-color: #cbd8eb;
}

body.has-listbar .history_year_select:focus {
    border-color: #4268ed;
}

body.has-listbar .history_table th {
    background: #f2f6fd;
    color: #344967;
    font-weight: 600;
}

body.has-listbar .history_table td {
    border-bottom-color: #e3eaf4;
}

body.has-listbar .table_wrap {
    border-radius: 9px;
}

/* 공통 사이드바와 동일한 태블릿/모바일 전환 기준: 1050px */
@media (max-width: 1050px) {
    body.has-listbar {
        padding-left: 0;
    }

    .history_topbar {
        display: flex;
        align-items: center;
        height: 56px;
        padding: 0 15px;
        background: #ffffff;
        border-bottom: 1px solid #e1e8f3;
    }

    .history_topbar .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 0;
        border-radius: 8px;
        background: #f2f6fd;
        color: #243650;
        font-size: 24px;
        cursor: pointer;
    }

    body.has-listbar .history_page {
        padding: 24px 15px 50px;
    }

    body.has-listbar .history_table tbody tr {
        border-color: #e1e8f3;
    }
}

@media (max-width: 480px) {
    body.has-listbar .history_page {
        padding: 20px 12px 45px;
    }
}

/* =====================================================
   모바일 레이아웃 통합 최종 규칙 (2026-10-28)
   - 기존 PC 테이블 및 사이드바 유지
   - 모든 카드 행의 구분선 너비 통일
   - 반려 건에만 반려 사유 노출
   ===================================================== */
@media (max-width: 767px) {
    body.has-listbar .history_page {
        padding: 16px 12px 36px;
    }

    body.has-listbar .history_box {
        padding: 20px 14px;
        min-width: 0;
    }

    body.has-listbar .history_title {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        margin-bottom: 18px;
    }

    body.has-listbar .history_title h2 {
        font-size: 23px;
    }

    body.has-listbar .history_title_buttons {
        display: flex;
        gap: 6px;
    }

    body.has-listbar .history_title_buttons .refresh_button,
    body.has-listbar .history_title_buttons .home_button {
        min-width: 0;
        height: 34px;
        padding: 0 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    body.has-listbar .history_summary {
        gap: 10px;
        margin-bottom: 22px;
    }

    body.has-listbar .history_summary .summary_card {
        padding: 14px 8px;
    }

    body.has-listbar .history_summary .summary_label {
        font-size: 13px;
    }

    body.has-listbar .history_summary .summary_value {
        font-size: 22px;
    }

    body.has-listbar .history_list_title {
        gap: 8px;
        margin-bottom: 12px;
    }

    body.has-listbar .history_list_title h3 {
        font-size: 17px;
    }

    body.has-listbar .history_year_select {
        min-width: 88px;
    }

    body.has-listbar .history_table tbody tr {
        padding: 12px 14px;
        margin-bottom: 12px;
    }

    body.has-listbar .history_table tbody td,
    body.has-listbar .history_table tbody td.history_reason,
    body.has-listbar .history_table tbody td.history_reject_reason {
        display: flex;
        width: 100%;
        max-width: none;
        min-width: 0;
        min-height: 0;
        padding: 8px 0;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border: 0;
        border-bottom: 1px solid #e3eaf4;
        box-sizing: border-box;
        line-height: 1.4;
        font-size: 14px;
        text-align: right;
    }

    body.has-listbar .history_table tbody td::before {
        flex: 0 0 76px;
        font-size: 13px;
        text-align: left;
    }

    body.has-listbar .history_table tbody td:nth-child(1) {
        padding-top: 0;
        font-size: 15px;
    }

    body.has-listbar .history_table tbody tr:not(.is-rejected) td:nth-child(7) {
        display: none !important;
    }

    body.has-listbar .history_table tbody tr:not(.is-rejected) td:nth-child(6) {
        border-bottom: 0;
        padding-bottom: 0;
    }

    body.has-listbar .history_table tbody tr.is-rejected td:nth-child(6) {
        border-bottom: 1px solid #e3eaf4;
        padding-bottom: 8px;
    }

    body.has-listbar .history_table tbody tr.is-rejected td:nth-child(7) {
        display: flex;
        border-bottom: 0;
        padding-bottom: 0;
    }
}

@media (max-width: 360px) {
    body.has-listbar .history_title {
        grid-template-columns: 1fr;
    }

    body.has-listbar .history_title_buttons {
        justify-content: flex-start;
    }
}

/* =====================================================
   휴가 상태 배지 최종 통일
   - 승인 / 취소 / 반려 / 대기중 공통 크기 및 정렬
   - PC 테이블과 모바일 카드에 동일 적용
   ===================================================== */

body.has-listbar .history_table .status_badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 64px;
    min-height: 30px;
    padding: 5px 12px;

    border: 0;
    border-radius: 999px;

    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;

    box-sizing: border-box;
    flex-shrink: 0;
    vertical-align: middle;
}

body.has-listbar .history_table .status_badge.status_approved {
    background: #e8f1fb;
    color: #1565c0;
}

body.has-listbar .history_table .status_badge.status_cancelled {
    background: #eeeeee;
    color: #666666;
}

body.has-listbar .history_table .status_badge.status_rejected {
    background: #fdeaea;
    color: #c62828;
}

body.has-listbar .history_table .status_badge.status_pending {
    background: #eeeeee;
    color: #444444;
}

