@charset "utf-8";

/*************************************/
/* IMPORTS & BASIC RESET             */
/*************************************/
@import url('https://fonts.googleapis.com/css?family=Noto+Sans');
@import url('https://fonts.googleapis.com/earlyaccess/notosanskr.css');


/*************************************/
/* GENERAL PURPOSE CLASSES           */
/*************************************/

/* Default Button */
button.bt-def {
    padding: 6px 10px;
    width: 80px;
    font-size: 14px;
    background-color: #fff;
    color: #000E2B;
    border: solid 1px #bbb;
    border-radius: 5px
}

@media all and (max-width: 768px) {
    button.bt-def {
        font-size: 12px;
    }
}

/* Blue Button */
button.bt-blu {
    padding: 8px 12px;
    background-color: #0072ce;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button.bt-blu:hover {
    background-color: #005bb5;
}

@media all and (max-width: 768px) {
    button.bt-blu {
        font-size: 12px;
    }
}

/* Default Input Text */
input.it-def {
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    width: 100%;
}

input.it-def:focus {
    outline: none;
    border-color: #0072ce;
    box-shadow: 0 0 0 2px rgba(0, 114, 206, 0.2);
}

@media all and (max-width: 768px) {
    input.it-def {
        font-size: 12px;
        padding: 6px 8px;
    }
}

/* Message Box */
div.dv-msg {
    border-radius: 6px;
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 30px;
    background-color: #f8f8f8;
    font-size: 14px;
}

@media all and (max-width: 768px) {
    div.dv-msg {
        font-size: 12px;
    }
}


/*************************************/
/* TABLE - DEFAULT (Horizontal)      */
/*************************************/
table.tb-def {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.tb-def th,
table.tb-def td {
    padding: 12px;
    text-align: center;
    vertical-align: middle;
    border: 1px solid #ccc;
    word-wrap: break-word;
}

table.tb-def tr:first-child th {
    border-top: 2px solid #666;
}

table.tb-def thead th {
    font-weight: bold;
    background-color: #f8f8f8;
}

@media all and (max-width: 768px) {
    table.tb-def {
        border: none;
    }

    table.tb-def thead {
        display: none;
    }

    table.tb-def tr {
        display: block;
        border: 3px solid #eee;
        border-radius: 5px;
        padding: 0 15px;
        margin-bottom: 20px;
    }

    table.tb-def td {
        display: flex;
        align-items: center;
        text-align: left;
        padding: 12px 0;
        border: none;
        border-bottom: 1px solid #eee;
        font-size: 0.8rem;
    }

    table.tb-def td::before {
        content: attr(data-label);
        font-weight: bold;
        width: 130px;
        flex-shrink: 0;
        padding-right: 10px;
        text-align: left;
    }

    table.tb-def tr td:last-child {
        border-bottom: none;
    }
}


/*************************************/
/* TABLE - VERTICAL (REFACTORED)     */
/*************************************/

table.tb-ver {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    font-size: 15px;
    border: 1px solid #ddd;
    margin-top: 20px;
    table-layout: fixed; /* 테이블 레이아웃 알고리즘을 고정으로 변경 */
}

table.tb-ver th,
table.tb-ver td {
    padding: 14px 16px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}

table.tb-ver tr:last-child th,
table.tb-ver tr:last-child td {
    border-bottom: none;
}

table.tb-ver th {
    font-weight: bold;
    color: #555;
    width: 180px;
}

table.tb-ver td {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
}

/* --- tb-ver 내부 요소들에 대한 기본 스타일 --- */

table.tb-ver input[type="text"],
table.tb-ver input[type="password"] {
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    width: 250px;
    flex-grow: 0;
}

table.tb-ver input[type="text"]:focus,
table.tb-ver input[type="password"]:focus {
    outline: none;
    border-color: #0072ce;
    box-shadow: 0 0 0 2px rgba(0, 114, 206, 0.2);
}

/* .it-flx 클래스가 있는 input만 유연하게 늘어납니다. */
table.tb-ver input.it-flx {
    flex-grow: 1;
    width: auto;
    min-width: 0; /* 해결책 1: input이 자신의 최소 너비 이하로도 줄어들 수 있도록 허용 */
}

table.tb-ver button {
    padding: 8px 12px;
    background-color: #0072ce;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

table.tb-ver button:hover {
    background-color: #005bb5;
}

table.tb-ver td > span {
    flex-shrink: 0;
    font-size: 13px;
    color: #666;
    white-space: normal; /* 해결책 2: nowrap을 normal로 변경하여 자동 줄바꿈 허용 */
}

@media all and (max-width: 768px) {
    table.tb-ver {
        border: none;
        margin-top: 20px;
        table-layout: auto;
    }

    table.tb-ver tr {
        display: block;
        border: 1px solid #bbb;
        border-radius: 8px;
        padding: 10px;
        margin-bottom: 15px;
    }

    table.tb-ver th,
    table.tb-ver td {
        display: block;
        width: 100%;
        text-align: left;
        padding: 0;
        border: none;
        font-size: 0.8rem;
    }

    table.tb-ver th {
        padding-bottom: 8px;
        margin-bottom: 8px;
        border-bottom: 1px solid #999;
    }

    table.tb-ver tr:last-child th {
        border-bottom: 1px solid #999;
    }

    table.tb-ver td {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 0 0 0;
    }

    table.tb-ver input[type="text"],
    table.tb-ver input[type="password"] {
        flex-basis: 100%;
        width: 100%;
    }

    table.tb-ver input[type="text"],
    table.tb-ver input[type="password"],
    table.tb-ver button {
        font-size: 12px;
    }
}
