/* 기본 설정 */
#dbhb-erp-content {
    min-width: 0;
}

#clm-doc {
    --clm-primary: #2c6732;
    --clm-primary-dark: #235429;
    --clm-border: #e3e9e5;
    --clm-muted: #66756d;
    --clm-text: #24332b;

    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    gap: 24px;
    color: var(--clm-text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
}

#clm-doc,
#clm-doc *,
#clm-doc *::before,
#clm-doc *::after {
    box-sizing: border-box;
}

#clm-doc [hidden] {
    display: none !important;
}

#clm-doc h2,
#clm-doc h3,
#clm-doc h4,
#clm-doc p,
#clm-doc dl,
#clm-doc dd,
#clm-doc form {
    margin: 0;
}

#clm-doc button,
#clm-doc input,
#clm-doc select {
    font-family: inherit;
}

#clm-doc > * {
    min-width: 0;
}

/* 제목 */
#clm-doc .clm-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

#clm-doc .clm-eyebrow {
    margin-bottom: 7px;
    color: var(--clm-primary);
    font-size: 13px;
    font-weight: 700;
}

#clm-doc .clm-heading h2 {
    color: #1d2d22;
    font-size: 27px;
    font-weight: 750;
    line-height: 1.35;
    letter-spacing: -0.045em;
}

#clm-doc .clm-description {
    margin-top: 8px;
    color: var(--clm-muted);
    font-size: 14px;
    line-height: 1.7;
}

#clm-doc .clm-sample-label {
    padding: 6px 11px;
    border: 1px solid var(--clm-border);
    border-radius: 7px;
    background: #fff;
    color: var(--clm-muted);
    font-size: 12px;
    white-space: nowrap;
}

/* 안내 */
#clm-doc .clm-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 20px;
    border: 1px solid #dbe8dd;
    border-radius: 10px;
    background: #edf5ee;
    color: #496650;
    font-size: 13px;
    line-height: 1.7;
}

#clm-doc .clm-notice-icon {
    display: inline-flex;
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    border: 1px solid #789d7f;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

/* 작업 영역 */
#clm-doc .clm-workspace {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}

#clm-doc .clm-detail-column,
#clm-doc #clm-work-area {
    min-width: 0;
}

#clm-doc #clm-work-area {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

#clm-doc .clm-panel {
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--clm-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 6px rgb(24 49 32 / 2%);
}

#clm-doc .clm-panel-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

#clm-doc .clm-panel-heading > div {
    display: flex;
    align-items: center;
    gap: 9px;
}

#clm-doc .clm-panel-heading h3 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

#clm-doc .clm-step {
    display: inline-flex;
    width: 27px;
    height: 27px;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #edf5ee;
    color: var(--clm-primary);
    font-size: 11px;
    font-weight: 700;
}

#clm-doc .clm-count {
    color: var(--clm-muted);
    font-size: 12px;
}

/* 입력 및 버튼 */
#clm-doc .clm-label {
    display: block;
    margin-bottom: 9px;
    padding: 0;
    color: #405347;
    font-size: 13px;
    font-weight: 650;
}

#clm-doc .clm-input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 46px;
    margin: 0;
    padding: 0 13px;
    border: 1px solid #dce4de;
    border-radius: 8px;
    background: #fff;
    color: #293c30;
    font-size: 14px;
    line-height: normal;
}

#clm-doc .clm-input:focus {
    border-color: #608f67;
    outline: none;
    box-shadow: 0 0 0 3px rgb(44 103 50 / 10%);
}

#clm-doc .clm-input::placeholder {
    color: #758178;
    font-size: 12px;
}

#clm-doc select.clm-input {
    padding-right: 30px;
}

#clm-doc .clm-button {
    display: inline-flex;
    min-width: 74px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    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;
}

#clm-doc .clm-button:hover:not(:disabled) {
    background: #f5f9f6;
    color: var(--clm-primary);
}

#clm-doc .clm-button-primary {
    border-color: var(--clm-primary);
    background: var(--clm-primary);
    color: #fff;
}

#clm-doc .clm-button-primary:hover:not(:disabled) {
    border-color: var(--clm-primary-dark);
    background: var(--clm-primary-dark);
    color: #fff;
}

#clm-doc .clm-button:disabled {
    border-color: #e3e9e5;
    background: #edf1ee;
    color: #7b8980;
    cursor: default;
}

#clm-doc button:focus-visible,
#clm-doc a:focus-visible,
#clm-doc input[type="checkbox"]:focus-visible,
#clm-doc input[type="radio"]:focus-visible,
#clm-doc [tabindex]:focus-visible {
    outline: 3px solid #477b4e;
    outline-offset: 3px;
}

#clm-doc input[type="checkbox"],
#clm-doc input[type="radio"] {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin: 0;
    accent-color: var(--clm-primary);
}

/* 대상 검색 및 목록 */
#clm-doc .clm-search {
    padding-bottom: 20px;
    border-bottom: 1px solid #edf1ee;
}

#clm-doc .clm-search-line {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

#clm-doc .clm-search-line .clm-input {
    flex: 1;
}

#clm-doc .clm-target-list {
    display: flex;
    max-height: 740px;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    padding: 3px;
    overflow-y: auto;
    scrollbar-width: thin;
}

#clm-doc .clm-target {
    display: block;
    width: 100%;
    padding: 17px;
    border: 1px solid var(--clm-border);
    border-radius: 10px;
    background: #fff;
    color: var(--clm-text);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

#clm-doc .clm-target:hover {
    border-color: #b9cfbe;
    background: #fafcfb;
}

#clm-doc .clm-target[aria-pressed="true"] {
    border-color: #65916d;
    background: #f0f7f1;
    box-shadow: inset 3px 0 0 var(--clm-primary);
}

#clm-doc .clm-target-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 9px;
}

#clm-doc .clm-target-name {
    font-size: 16px;
    font-weight: 700;
}

#clm-doc .clm-target-code,
#clm-doc .clm-target-hospital {
    display: block;
    margin-top: 4px;
    color: var(--clm-muted);
    font-size: 12px;
}

#clm-doc .clm-badge {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

#clm-doc .clm-badge-done {
    background: #eaf4eb;
    color: #2c6732;
}

#clm-doc .clm-badge-wait {
    background: #fff5df;
    color: #89631d;
}

/* 미선택 화면 */
#clm-doc .clm-empty {
    display: flex;
    min-height: 420px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
}

#clm-doc .clm-empty-icon {
    display: inline-flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    border-radius: 16px;
    background: #edf5ee;
    color: var(--clm-primary);
    font-size: 27px;
}

#clm-doc .clm-empty h3 {
    font-size: 18px;
}

#clm-doc .clm-empty p,
#clm-doc .clm-list-empty {
    color: var(--clm-muted);
    font-size: 13px;
    line-height: 1.8;
}

#clm-doc .clm-list-empty {
    padding: 30px 0;
    text-align: center;
}

/* 신청정보 */
#clm-doc .clm-patient-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid #edf1ee;
}

#clm-doc .clm-patient-heading h4 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.035em;
}

#clm-doc #clm-matching-code {
    margin-top: 5px;
    color: var(--clm-primary);
    font-size: 12px;
}

#clm-doc .clm-period {
    padding: 8px 12px;
    border-radius: 7px;
    background: #f5f8f6;
    color: #5c7062;
    font-size: 12px;
}

#clm-doc .clm-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 22px;
}

#clm-doc .clm-info-grid > div {
    min-width: 0;
}

#clm-doc .clm-info-grid dt {
    margin-bottom: 6px;
    color: var(--clm-muted);
    font-size: 12px;
}

#clm-doc .clm-info-grid dd {
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

#clm-doc .clm-warning {
    margin-top: 20px;
    padding: 13px 16px;
    border-radius: 8px;
    background: #fff6e6;
    color: #89631d;
    font-size: 13px;
}

/* 보험사 및 서류 */
#clm-doc .clm-insurance-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 20px;
}

#clm-doc .clm-insurance-types {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

#clm-doc .clm-insurance-types > div {
    display: flex;
    gap: 8px;
}

#clm-doc .clm-type-option {
    display: flex;
    min-height: 46px;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px;
    border: 1px solid var(--clm-border);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

#clm-doc .clm-document-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 26px 0 12px;
    padding-top: 22px;
    border-top: 1px solid #edf1ee;
}

#clm-doc .clm-document-heading h4 {
    font-size: 14px;
    font-weight: 700;
}

#clm-doc .clm-check-label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--clm-muted);
    font-size: 12px;
    cursor: pointer;
}

#clm-doc .clm-document-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#clm-doc .clm-document {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 17px;
    border: 1px solid var(--clm-border);
    border-radius: 9px;
    cursor: pointer;
}

#clm-doc .clm-document:hover {
    background: #f8fbf8;
}

#clm-doc .clm-document.is-disabled {
    background: #fafbfA;
    cursor: default;
}

#clm-doc .clm-document-text {
    min-width: 0;
    flex: 1;
}

#clm-doc .clm-document-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

#clm-doc .clm-document-description {
    display: block;
    margin-top: 5px;
    color: var(--clm-muted);
    font-size: 12px;
}

#clm-doc .clm-document-tag {
    flex-shrink: 0;
    padding: 4px 7px;
    border-radius: 5px;
    background: #f0f4f1;
    color: #607166;
    font-size: 11px;
}

#clm-doc .clm-field-help {
    margin-top: 14px;
    color: var(--clm-muted);
    font-size: 12px;
    line-height: 1.8;
}

#clm-doc .clm-issue-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #edf1ee;
}

#clm-doc .clm-issue-footer strong {
    color: var(--clm-primary);
    font-size: 14px;
}

#clm-doc .clm-issue-footer p {
    margin-top: 5px;
    color: var(--clm-muted);
    font-size: 12px;
}

#clm-doc .clm-message:not(:empty) {
    margin-top: 16px;
    padding: 13px 16px;
    border-radius: 8px;
    background: #f1f5f2;
    color: #496650;
    font-size: 13px;
    line-height: 1.7;
}

/* 발급 이력 */
#clm-doc .clm-history-panel {
    padding: 0;
}

#clm-doc .clm-history-panel .clm-panel-heading {
    margin: 0;
    padding: 22px 24px;
}

#clm-doc .clm-table-wrap {
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

#clm-doc .clm-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    text-align: left;
}

#clm-doc .clm-table th {
    padding: 14px 20px;
    border-top: 1px solid var(--clm-border);
    border-bottom: 1px solid var(--clm-border);
    background: #f5f8f6;
    color: #607166;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

#clm-doc .clm-table td {
    padding: 18px 20px;
    border-bottom: 1px solid #edf1ee;
    font-size: 13px;
    vertical-align: middle;
}

#clm-doc .clm-table tr:last-child td {
    border-bottom: 0;
}

#clm-doc .clm-history-name {
    display: block;
    margin-top: 4px;
    color: var(--clm-muted);
    font-size: 12px;
}

#clm-doc .clm-file-link {
    color: var(--clm-primary);
    font-size: 12px;
    font-weight: 600;
    text-underline-offset: 3px;
}

#clm-doc .clm-muted {
    color: var(--clm-muted);
    font-size: 12px;
}

#clm-doc .clm-table .clm-history-empty {
    padding: 42px 20px;
    color: var(--clm-muted);
    text-align: center;
}

#clm-doc .clm-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* 반응형 */
@media (max-width: 1280px) {
    #clm-doc .clm-workspace {
        grid-template-columns: 290px minmax(0, 1fr);
        gap: 18px;
    }

    #clm-doc .clm-insurance-controls {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 1000px) {
    #clm-doc .clm-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    #clm-doc .clm-target-list {
        max-height: 330px;
    }

    #clm-doc .clm-insurance-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    #clm-doc {
        gap: 18px;
    }

    #clm-doc .clm-heading h2 {
        font-size: 23px;
    }

    #clm-doc .clm-panel {
        padding: 18px;
    }

    #clm-doc .clm-history-panel {
        padding: 0;
    }

    #clm-doc .clm-info-grid,
    #clm-doc .clm-insurance-controls {
        grid-template-columns: minmax(0, 1fr);
    }

    #clm-doc .clm-issue-footer .clm-button {
        width: 100%;
    }

    #clm-doc .clm-document {
        flex-wrap: wrap;
    }

    #clm-doc .clm-document-tag {
        margin-left: 29px;
    }

    #clm-doc .clm-empty {
        min-height: 280px;
    }
}
