/* ============================
 * 방문신청 진행조회 전용 스타일
 * Trendy redesign 2025
 * ============================ */

.toolbar--right { display: flex; justify-content: flex-end; gap: 8px; }

.card--result .section-head--result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.result-status {
    margin: 6px 0 12px;
    font-size: 13px;
    color: #6b7a94;
    line-height: 1.5;
}

/* 결과 패널 */
.result-panel {
    margin-top: 8px;
    border-radius: 12px;
    border: 1px solid rgba(200,210,235,.7);
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(20,40,90,.04);
}
.result-panel__scroll { width: 100%; overflow-x: auto; }

.result-footer {
    padding: 10px 16px 12px;
    border-top: 1px solid rgba(200,210,235,.5);
    background: #f8faff;
}
.result-footer__text { font-size: 12px; color: #9aacbe; }

/* 뱃지 */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}
.badge--muted {
    background: #f0f3fa;
    color: #6b7a94;
    border-color: rgba(200,210,235,.8);
}
.badge--primary {
    background: #1c52cc;
    color: #fff;
    border-color: #1240a8;
}
.badge--wait {
    background: #f0f3fa;
    color: #6b7a94;
    border-color: rgba(200,210,235,.8);
}
.badge--progress {
    background: #fff1f2;
    color: #be123c;
    border-color: rgba(244,63,94,.4);
}
.badge--ongoing {
    background: #fff7ed;
    color: #c2410c;
    border-color: rgba(234,88,12,.4);
}
.badge--approved {
    background: #f0fdf4;
    color: #15803d;
    border-color: rgba(34,197,94,.4);
}

/* 테이블 */
.visit-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 940px;
    font-size: 13px;
}

.btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 8px;
    border: 1.5px solid rgba(28,82,204,.25);
    background: #fff;
    color: #1c52cc;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: -.01em;
    transition: background .15s, border-color .15s, box-shadow .15s;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(28,82,204,.1);
}
.btn-edit:hover {
    background: #eef2ff;
    border-color: #1c52cc;
    box-shadow: 0 2px 8px rgba(28,82,204,.18);
}

.visit-table thead { background: #f8faff; }

.visit-table th,
.visit-table td {
    padding: 10px 14px;
    text-align: center;
    white-space: nowrap;
}

.visit-table th {
    font-weight: 700;
    font-size: 11px;
    color: #1c52cc;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-bottom: 1.5px solid rgba(28,82,204,.15);
}

.visit-table tbody tr {
    border-bottom: 1px solid rgba(200,210,235,.4);
    transition: background .1s;
}
.visit-table tbody tr:nth-child(even) { background: #fafbff; }
.visit-table tbody tr:hover { background: #eef2ff; }

/* No, 상태, 수정 — 짧은 값만 중앙정렬 */
.visit-table td:nth-child(1),
.visit-table th:nth-child(1),
.visit-table td:nth-child(10),
.visit-table th:nth-child(10),
.visit-table td:nth-child(11),
.visit-table th:nth-child(11) { text-align: center; }

.visit-table td:first-child,
.visit-table th:first-child {
    width: 40px;
    color: #9aacbe;
    font-weight: 600;
}
.visit-table td:nth-child(2),
.visit-table th:nth-child(2) { min-width: 140px; }
.visit-table td:nth-child(3),
.visit-table td:nth-child(9) {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── 태블릿: 덜 중요한 컬럼 숨김 ─────────────────────── */
@media (max-width: 900px) and (min-width: 641px) {
    .visit-table { min-width: 580px; font-size: 12px; }
    .visit-table th, .visit-table td { padding: 8px 10px; }
    /* 직급(5번째), 목적(9번째) 숨김 */
    .visit-table th:nth-child(5),
    .visit-table td:nth-child(5),
    .visit-table th:nth-child(9),
    .visit-table td:nth-child(9) { display: none; }
    .result-panel__scroll { -webkit-overflow-scrolling: touch; }
}

/* ── 모바일: 카드형 레이아웃 ───────────────────────────── */
@media (max-width: 640px) {
    .result-panel__scroll { overflow-x: hidden; }

    .visit-table          { display: block; min-width: unset; font-size: 13px; }
    .visit-table thead    { display: none; }
    .visit-table tbody    { display: block; }

    .visit-table tbody tr {
        display: block;
        border: 1px solid rgba(200,210,235,.7);
        border-radius: 12px;
        margin: 0 0 10px;
        padding: 12px 14px;
        background: #fff;
        box-shadow: 0 1px 4px rgba(20,40,90,.05);
    }
    .visit-table tbody tr:nth-child(even) { background: #fff; }
    .visit-table tbody tr:hover { background: #f8faff; }

    /* No 컬럼 숨김 */
    .visit-table td:first-child { display: none; }

    .visit-table td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 8px;
        padding: 5px 0;
        border: none;
        white-space: normal;
        text-align: left;
        max-width: unset;
        overflow: visible;
    }

    /* data-label 을 앞에 표시 */
    .visit-table td::before {
        content: attr(data-label);
        flex-shrink: 0;
        min-width: 68px;
        font-weight: 700;
        font-size: 11px;
        color: #9aacbe;
        letter-spacing: .04em;
        padding-top: 2px;
    }

    /* 신청회사(3), 목적(9): 데스크톱 overflow 규칙 초기화 */
    .visit-table td:nth-child(3),
    .visit-table td:nth-child(9) {
        max-width: unset;
        overflow: visible;
        text-overflow: unset;
        text-align: left;
    }

    /* 상태 + 수정 행: 구분선 + 정렬 초기화 */
    .visit-table td:nth-child(10),
    .visit-table td:nth-child(11) {
        text-align: left;
        justify-content: space-between;
        margin-top: 4px;
        padding-top: 10px;
        border-top: 1px solid rgba(200,210,235,.4);
    }
    .visit-table td:nth-child(10) { border-top: 1px solid rgba(200,210,235,.4); }
    .visit-table td:nth-child(11) { border-top: none; padding-top: 6px; }
}

/* ── 모바일: 수정 모달 ──────────────────────────────────── */
@media (max-width: 560px) {
    .modal__dialog {
        width: 96vw;
        border-radius: 14px;
        margin: 0 auto;
    }
    .modal__header { padding: 14px 16px; }
    .modal__body   { padding: 16px; }
    .modal__footer {
        flex-direction: column-reverse;
        gap: 8px;
        padding: 12px 16px;
    }
    .modal__footer .btn-primary,
    .modal__footer .btn-secondary {
        width: 100% !important;
        min-width: unset !important;
        text-align: center;
        justify-content: center;
    }
}

/* 헤더 고정 높이 보정 */
body { padding-top: 64px !important; }
.header + .section { margin-top: 20px !important; }
