/* ==================================================
   매칭내역 기본 설정
   ================================================== */

#dbhb-erp-content {
    min-width: 0;
}

#mth-lst {
    height: 100%;
    --mth-primary: #2c6732;
    --mth-primary-dark: #235429;
    --mth-primary-light: #edf5ee;
    --mth-text: #24332b;
    --mth-muted: #66756d;
    --mth-border: #e3e9e5;
    --mth-background: #f7f9f8;

    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    gap: 24px;

    color: var(--mth-text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}

#mth-lst,
#mth-lst *,
#mth-lst *::before,
#mth-lst *::after {
    box-sizing: border-box;
}

#mth-lst > * {
    min-width: 0;
    margin: 0;
}

#mth-lst h2,
#mth-lst h3,
#mth-lst p {
    margin: 0;
}

#mth-lst button,
#mth-lst input,
#mth-lst select {
    font-family: inherit;
}

#mth-lst button {
    text-transform: none;
}

#mth-lst [hidden] {
    display: none !important;
}


/* ==================================================
   페이지 제목
   ================================================== */

#mth-lst > div:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 2px 0 0;
}

#mth-lst > div:first-child > div > p:first-child {
    margin-bottom: 7px;
    color: var(--mth-primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

#mth-lst > div:first-child h2 {
    color: #1d2d22;
    font-size: 27px;
    font-weight: 750;
    line-height: 1.35;
    letter-spacing: -0.045em;
}

#mth-lst > div:first-child h2 + p {
    margin-top: 8px;
    color: var(--mth-muted);
    font-size: 14px;
    line-height: 1.7;
}

#mth-lst .mth-sample-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 6px 11px;
    border: 1px solid var(--mth-border);
    border-radius: 7px;
    background: #fff;
    color: var(--mth-muted);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}


/* ==================================================
   요약 카드
   ================================================== */

#mth-lst > div:nth-child(2) {
    display: flex;
    gap: 18px;
}

#mth-lst > div:nth-child(3) {
    flex: 1;
    min-height: 0;
}

#mth-lst .mth-summary {
    flex: 1;
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    padding: 22px 24px;
    border: 1px solid var(--mth-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 5px rgb(24 49 32 / 2%);
}

#mth-lst .mth-summary:first-child {
    border-color: #d5e4d7;
    background: linear-gradient(120deg, #edf5ee 0%, #f9fcf9 100%);
}

#mth-lst .mth-summary > span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #59695f;
    font-size: 14px;
    font-weight: 600;
}

#mth-lst .mth-summary strong {
    display: block;
    color: #24352a;
    font-size: 31px;
    font-weight: 750;
    line-height: 1.1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

#mth-lst .mth-summary:first-child strong {
    color: var(--mth-primary);
}

#mth-lst .mth-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 50%;
}

#mth-lst .mth-dot-wait {
    background: #c48b2c;
}

#mth-lst .mth-dot-progress {
    background: #43814b;
}

#mth-lst .mth-dot-done {
    background: #7b8994;
}


/* ==================================================
   공통 패널
   ================================================== */

#mth-lst .mth-panel {
    width: 100%;
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--mth-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 6px rgb(24 49 32 / 2%);
}

/* 목록 패널 */
#mth-lst > .mth-panel:nth-child(4) {
    padding: 0;
}


/* ==================================================
   검색 조건
   ================================================== */

#mth-lst #mth-search-form {
    width: 100%;
    display: block;
    margin: 0;
}

#mth-lst #mth-search-form > div:first-child {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr)
        minmax(0, 0.85fr)
        minmax(0, 1.7fr);
    align-items: end;
    gap: 20px;
}

#mth-lst #mth-search-form > div:first-child > div {
    min-width: 0;
}

#mth-lst .mth-label {
    display: block;
    margin: 0 0 9px;
    color: #405347;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.5;
}

#mth-lst .mth-input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 46px;
    margin: 0;
    padding: 0 13px;
    border: 1px solid #dce4de;
    border-radius: 8px;
    background-color: #fff;
    color: #293c30;
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    box-shadow: none;
    transition:
            border-color 0.15s ease,
            box-shadow 0.15s ease;
}

#mth-lst .mth-input:hover {
    border-color: #b6c9ba;
}

#mth-lst .mth-input:focus {
    border-color: #608f67;
    outline: none;
    box-shadow: 0 0 0 3px rgb(44 103 50 / 10%);
}

#mth-lst .mth-input::placeholder {
    color: #758178;
    font-size: 13px;
    opacity: 1;
}

#mth-lst input[type="date"].mth-input {
    color-scheme: light;
}

#mth-lst input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.65;
}

#mth-lst select.mth-input {
    padding-right: 34px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2366756d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 16px;
    cursor: pointer;
}

#mth-lst #mth-search-form > div:last-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #edf1ee;
}

#mth-lst #mth-search-form > div:last-child > div {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
    margin-left: auto;
}

#mth-lst #mth-search-error {
    flex: 1 1 240px;
    margin: 0;
    color: #b43e3e;
    font-size: 13px;
}

#mth-lst #mth-search-error:empty {
    display: none;
}


/* ==================================================
   버튼
   ================================================== */

#mth-lst .mth-button {
    display: inline-flex;
    min-width: 86px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 10px 18px;
    border: 1px solid #dce4de;
    border-radius: 8px;
    background: #fff;
    color: #4d6153;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition:
            background-color 0.15s ease,
            border-color 0.15s ease,
            color 0.15s ease;
}

#mth-lst .mth-button:hover {
    border-color: #b8cdbd;
    background: #f5f9f6;
    color: var(--mth-primary);
}

#mth-lst .mth-button-primary {
    min-width: 108px;
    border-color: var(--mth-primary);
    background: var(--mth-primary);
    color: #fff;
}

#mth-lst .mth-button-primary:hover {
    border-color: var(--mth-primary-dark);
    background: var(--mth-primary-dark);
    color: #fff;
}

#mth-lst button:focus-visible,
#mth-lst [tabindex]:focus-visible {
    outline: 3px solid #477b4e;
    outline-offset: 3px;
}


/* ==================================================
   목록 상단
   ================================================== */

#mth-lst > .mth-panel:nth-child(4) > div:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 21px 24px;
}

#mth-lst > .mth-panel:nth-child(4) > div:first-child > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

#mth-lst > .mth-panel:nth-child(4) h3 {
    color: #24352a;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: -0.025em;
}

#mth-lst > .mth-panel:nth-child(4) [role="status"] {
    color: var(--mth-muted);
    font-size: 13px;
    white-space: nowrap;
}

#mth-lst #mth-result-count {
    margin: 0 2px;
    color: var(--mth-primary);
    font-weight: 700;
}

#mth-lst label[for="mth-page-size"] {
    color: var(--mth-muted);
    font-size: 13px;
    white-space: nowrap;
}

#mth-lst .mth-page-size {
    width: 106px;
    height: 40px;
    font-size: 13px;
}


/* ==================================================
   테이블 스크롤 영역
   ================================================== */

#mth-lst [role="region"][aria-label="매칭내역 표"] {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: #bfcfc3 #f3f6f4;
}

#mth-lst [role="region"]::-webkit-scrollbar {
    height: 8px;
}

#mth-lst [role="region"]::-webkit-scrollbar-track {
    background: #f3f6f4;
}

#mth-lst [role="region"]::-webkit-scrollbar-thumb {
    border: 2px solid #f3f6f4;
    border-radius: 8px;
    background: #bfcfc3;
}


/* ==================================================
   매칭 목록 테이블
   ================================================== */

#mth-lst .mth-table {
    display: table;
    width: 100%;
    min-width: 1080px;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: auto;
    background: #fff;
    color: var(--mth-text);
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}

#mth-lst .mth-table thead {
    display: table-header-group;
}

#mth-lst .mth-table tbody {
    display: table-row-group;
}

#mth-lst .mth-table tr {
    display: table-row;
}

#mth-lst .mth-table th,
#mth-lst .mth-table td {
    display: table-cell;
    height: auto;
    border-right: 0;
    border-left: 0;
    text-align: left;
    vertical-align: middle;
}

#mth-lst .mth-table th {
    padding: 15px 20px;
    border-top: 1px solid var(--mth-border);
    border-bottom: 1px solid var(--mth-border);
    background: #f5f8f6;
    color: #607166;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

#mth-lst .mth-table td {
    padding: 20px;
    border-top: 0;
    border-bottom: 1px solid #edf1ee;
    background: transparent;
}

#mth-lst .mth-table th:first-child,
#mth-lst .mth-table td:first-child {
    padding-left: 24px;
}

#mth-lst .mth-table th:last-child,
#mth-lst .mth-table td:last-child {
    padding-right: 24px;
    text-align: right;
}

#mth-lst .mth-table th:nth-child(6),
#mth-lst .mth-table td:nth-child(6) {
    text-align: center;
}

#mth-lst .mth-table tbody tr:last-child td {
    border-bottom: 0;
}

#mth-lst .mth-table tbody tr:hover {
    background: #f9fcf9;
}

#mth-lst .mth-cell-title {
    display: block;
    color: #2a3c30;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

#mth-lst .mth-cell-sub {
    display: block;
    margin-top: 5px;
    color: #718077;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    white-space: nowrap;
}

#mth-lst .mth-table td:first-child .mth-cell-title {
    color: var(--mth-primary);
    font-variant-numeric: tabular-nums;
}

#mth-lst .mth-table td:nth-child(5) .mth-cell-title,
#mth-lst .mth-table td:nth-child(5) .mth-cell-sub {
    font-variant-numeric: tabular-nums;
}

#mth-lst .mth-table .mth-button {
    min-width: 78px;
    min-height: 40px;
    padding: 8px 12px;
    border-color: #dce7de;
    background: #fff;
    color: #44684b;
    font-size: 12px;
}

#mth-lst .mth-table .mth-button:hover {
    border-color: #aac5af;
    background: var(--mth-primary-light);
}

#mth-lst .mth-table .mth-empty {
    height: 220px;
    padding: 40px 24px;
    color: #718077;
    font-size: 14px;
    font-weight: 400;
    text-align: center;
}


/* ==================================================
   진행 상태
   ================================================== */

#mth-lst .mth-badge {
    display: inline-flex;
    min-width: 76px;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #f0f3f1;
    color: #526359;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

#mth-lst .mth-status-WAIT {
    border-color: #f2e4bf;
    background: #fff8e8;
    color: #89631d;
}

#mth-lst .mth-status-PROGRESS {
    border-color: #d8e9db;
    background: #edf6ee;
    color: #2c6732;
}

#mth-lst .mth-status-DONE {
    border-color: #e0e6ec;
    background: #f0f4f8;
    color: #586b7c;
}

#mth-lst .mth-status-CANCEL {
    border-color: #f1dddd;
    background: #fcf1f1;
    color: #a44e4e;
}


/* ==================================================
   페이지 이동
   ================================================== */

#mth-lst > .mth-panel:nth-child(4) > div:last-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    border-top: 1px solid var(--mth-border);
}

#mth-lst #mth-page-info {
    margin: 0;
    color: #718077;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

#mth-lst #mth-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

#mth-lst .mth-page-button {
    display: inline-flex;
    min-width: 38px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 7px 11px;
    border: 1px solid #e1e8e3;
    border-radius: 7px;
    background: #fff;
    color: #617067;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
}

#mth-lst .mth-page-button:hover:not(:disabled) {
    border-color: #c4d6c8;
    background: #f2f7f3;
    color: var(--mth-primary);
}

#mth-lst .mth-page-button[aria-current="page"],
#mth-lst .mth-page-button[aria-current="page"]:hover {
    border-color: var(--mth-primary);
    background: var(--mth-primary);
    color: #fff;
    font-weight: 700;
}

#mth-lst .mth-page-button:disabled {
    border-color: #edf1ee;
    background: #fafcfb;
    color: #89968e;
    cursor: default;
}


/* ==================================================
   상세정보 모달
   ================================================== */

#mth-lst .mth-dialog {
    position: fixed;
    inset: 0;
    width: min(620px, calc(100% - 32px));
    max-width: calc(100% - 32px);
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    margin: auto;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #e1e8e3;
    border-radius: 16px;
    background: #fff;
    color: var(--mth-text);
    box-shadow: 0 24px 80px rgb(18 39 25 / 20%);
}

#mth-lst .mth-dialog:not([open]) {
    display: none;
}

#mth-lst .mth-dialog[open] {
    display: block;
}

#mth-lst .mth-dialog::backdrop {
    background: rgb(20 35 26 / 44%);
}

#mth-lst .mth-dialog > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--mth-border);
    background: #f8fbf8;
}

#mth-lst .mth-dialog > div:first-child p {
    margin: 0 0 4px;
    color: #6a7b70;
    font-size: 12px;
}

#mth-lst #mth-detail-title {
    margin: 0;
    color: #284a30;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

#mth-lst .mth-dialog > div:last-child {
    padding: 8px 24px 24px;
}

#mth-lst .mth-detail-grid {
    display: grid;
    grid-template-columns: 125px minmax(0, 1fr);
    margin: 0;
    padding: 0;
}

#mth-lst .mth-detail-grid dt,
#mth-lst .mth-detail-grid dd {
    min-width: 0;
    margin: 0;
    padding: 16px 0;
    border-bottom: 1px solid #edf1ee;
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

#mth-lst .mth-detail-grid dt {
    padding-right: 16px;
    color: #718077;
    font-weight: 400;
}

#mth-lst .mth-detail-grid dd {
    color: #2b3e31;
    font-weight: 500;
}

#mth-lst .mth-detail-grid dt:nth-last-child(2),
#mth-lst .mth-detail-grid dd:last-child {
    border-bottom: 0;
}


/* ==================================================
   화면 낭독기 전용 문구
   ================================================== */

#mth-lst .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}


/* ==================================================
   반응형
   ================================================== */

@media (max-width: 1280px) {
    #mth-lst #mth-search-form > div:first-child {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    #mth-lst .mth-summary {
        padding: 20px;
    }
}

@media (max-width: 900px) {
    #mth-lst > div:nth-child(2) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    #mth-lst {
        gap: 18px;
    }

    #mth-lst > div:first-child {
        align-items: flex-start;
    }

    #mth-lst > div:first-child h2 {
        font-size: 23px;
    }

    #mth-lst > div:first-child h2 + p {
        font-size: 13px;
    }

    #mth-lst > div:nth-child(2) {
        gap: 10px;
    }

    #mth-lst .mth-summary {
        min-height: 110px;
        gap: 16px;
        padding: 17px;
        border-radius: 12px;
    }

    #mth-lst .mth-summary > span {
        font-size: 12px;
    }

    #mth-lst .mth-summary strong {
        font-size: 27px;
    }

    #mth-lst .mth-panel {
        padding: 18px;
        border-radius: 12px;
    }

    #mth-lst #mth-search-form > div:first-child {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    #mth-lst #mth-search-form > div:last-child {
        margin-top: 18px;
        padding-top: 16px;
    }

    #mth-lst #mth-search-error {
        flex-basis: 100%;
    }

    #mth-lst #mth-search-form > div:last-child > div {
        width: 100%;
    }

    #mth-lst #mth-search-form > div:last-child .mth-button {
        flex: 1;
    }

    #mth-lst > .mth-panel:nth-child(4) > div:first-child {
        gap: 12px;
        padding: 18px;
    }

    #mth-lst > .mth-panel:nth-child(4) > div:first-child > div {
        gap: 8px;
    }

    #mth-lst label[for="mth-page-size"] {
        display: none;
    }

    #mth-lst .mth-page-size {
        width: 98px;
    }

    #mth-lst > .mth-panel:nth-child(4) > div:last-child {
        flex-direction: column;
        justify-content: center;
        gap: 12px;
        padding: 18px;
    }

    #mth-lst .mth-dialog > div:first-child {
        padding: 18px;
    }

    #mth-lst .mth-dialog > div:last-child {
        padding: 4px 18px 18px;
    }

    #mth-lst .mth-detail-grid {
        grid-template-columns: 98px minmax(0, 1fr);
    }

    #mth-lst .mth-detail-grid dt,
    #mth-lst .mth-detail-grid dd {
        padding-top: 14px;
        padding-bottom: 14px;
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #mth-lst .mth-input,
    #mth-lst .mth-button {
        transition: none;
    }
}
