:root {
    --primary: #01745e;
    --primary-dark: #00473d;
    --primary-soft: #e6f6f2;
    --blue: #2f80ed;
    --yellow: #e9aa00;
    --pink: #e44f72;
    --orange: #f59a3d;
    --purple: #7b61ff;
    --bg: #f5f7fb;
    --card: #ffffff;
    --line: #e5e9ef;
    --line-strong: #d9e1e8;
    --text: #111827;
    --muted: #6b7280;
    --soft-text: #8a98a7;
    --sidebar: #003c36;
    --sidebar-dark: #002d29;
    --shadow: 0 6px 18px rgba(21, 34, 50, 0.06);
    --shadow-hover: 0 14px 28px rgba(21, 34, 50, 0.09);
    --radius: 12px;
    --sidebar-width: 250px;
    --header-height: 74px;
    --font: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--bg);
}

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

table {
    width: 100%;
    border-collapse: collapse;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.card {
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.card-head h2 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
}

.card-head span,
.card-head i {
    color: var(--soft-text);
    font-size: 12px;
    font-weight: 600;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrapper table {
    min-width: 560px;
}

/* jslee 20260709-2 모든 adm 페이지에서 사용하는 클릭 차단 로딩 레이어 */
.adm-loading {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    background: rgba(245, 247, 251, 0.38);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    cursor: wait;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.adm-loading.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.adm-loading-panel {
    display: grid;
    min-width: 260px;
    gap: 8px;
    justify-items: center;
    padding: 26px 30px;
    color: var(--text);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 18px 45px rgba(21, 34, 50, 0.16);
}

.adm-loading-spinner {
    width: 38px;
    height: 38px;
    border: 4px solid #dbeee9;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: adm-loading-spin 0.78s linear infinite;
}

.adm-loading-panel strong {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 800;
}

.adm-loading-panel small {
    color: var(--soft-text);
    font-size: 12px;
}

@keyframes adm-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

/* jslee 20260721-33 DB 분배관리 공통 모달 */
.l-hidden,
.adm-db-sort-modal[aria-hidden="true"] {
    display: none !important;
}

.adm-db-sort-modal {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.adm-db-sort-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(19, 30, 43, 0.48);
}

.adm-db-sort-dialog {
    position: relative;
    z-index: 1;
    width: min(640px, 100%);
    max-height: calc(100vh - 40px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 22px 58px rgba(21, 34, 50, 0.2);
}

.adm-db-sort-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
}

.adm-db-sort-header small {
    display: block;
    margin-bottom: 3px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
}

.adm-db-sort-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 21px;
}

.adm-db-sort-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #364152;
    background: #fff;
}

#dbSortform {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 118px);
}

.adm-db-sort-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 22px;
    background: #f5f7fb;
}

.adm-db-sort-toolbar label {
    color: #26313d;
    font-size: 13px;
    font-weight: 600;
}

.adm-db-sort-toolbar select,
.adm-db-sort-table select {
    height: 36px;
    padding: 0 30px 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: var(--text);
    background: #fff;
    font-size: 13px;
}

.adm-db-sort-table-wrap {
    max-height: 390px;
    overflow-y: auto;
    padding: 0 22px;
}

.adm-db-sort-table {
    table-layout: fixed;
}

.adm-db-sort-table th,
.adm-db-sort-table td {
    height: 46px;
    padding: 8px 12px;
    border-right: 1px solid #edf0f3;
    border-bottom: 1px solid #edf0f3;
    color: #111827;
    font-size: 13px;
    text-align: center;
}

.adm-db-sort-table th:first-child,
.adm-db-sort-table td:first-child {
    border-left: 1px solid #edf0f3;
}

.adm-db-sort-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    height: 48px;
    color: #344151;
    background: #eef3f1;
    font-weight: 800;
}

.adm-db-sort-table th:nth-child(3),
.adm-db-sort-table td:nth-child(3) {
    width: 110px;
}

.adm-db-sort-table select {
    width: 72px;
}

.adm-db-sort-empty {
    height: 120px !important;
    color: var(--muted) !important;
}

.adm-db-sort-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    min-height: 70px;
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.adm-db-sort-outline,
.adm-db-sort-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    height: 38px;
    padding: 0 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

.adm-db-sort-outline {
    border: 1px solid #8fcabe;
    color: var(--primary);
    background: #fff;
}

.adm-db-sort-primary {
    border: 1px solid var(--primary);
    color: #fff;
    background: var(--primary);
}

body.adm-db-sort-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    body {
        font-size: 13px;
    }

    .card-head h2 {
        font-size: 15px;
    }

    .adm-db-sort-modal {
        align-items: flex-start;
        padding: 0;
    }

    .adm-db-sort-dialog {
        width: 100%;
        max-height: 100vh;
        min-height: 100vh;
        border: 0;
        border-radius: 0;
    }

    #dbSortform {
        max-height: calc(100vh - 76px);
    }

    .adm-db-sort-table-wrap {
        max-height: none;
        flex: 1;
        padding: 0 14px;
    }

    .adm-db-sort-toolbar,
    .adm-db-sort-actions {
        padding-right: 14px;
        padding-left: 14px;
    }
}
