/* =========================================================
   관리자(치과 등록/관리) 전용 스타일
   style.css의 브랜드 토큰(:root 변수)을 그대로 재사용합니다.
   ========================================================= */

body.admin-body {
    padding-top: 0;
    padding-bottom: 0;
    background: var(--parchment);
}

.admin-topbar {
    background: var(--ink);
    color: var(--white);
}
.admin-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.admin-topbar__user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .88rem;
    color: var(--white);
}
.admin-topbar .btn--outline {
    border-color: rgba(255, 255, 255, .5);
    color: var(--white);
}

.admin-main {
    padding-top: 28px;
    padding-bottom: 60px;
}

.admin-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.admin-header-row h1 { font-size: 1.4rem; font-weight: 800; }

.admin-flash {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-weight: 600;
    margin-bottom: 16px;
}
.admin-flash--ok { background: var(--lime-tint); color: var(--lime-deep); }
.admin-flash--error { background: var(--warn-bg); color: var(--warn); }

/* ---- 목록 테이블 ---- */
.admin-table-wrap {
    overflow-x: auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
    white-space: nowrap;
}
.admin-table th, .admin-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.admin-table th { color: var(--text-muted); font-weight: 700; }
.admin-table th[data-sort-key] { cursor: pointer; user-select: none; }
.admin-table th[data-sort-key]:hover { color: var(--ink); }
.admin-table th[data-sort-key]::after { content: '⇅'; margin-left: 4px; opacity: .35; font-size: .8em; }
.admin-table th[data-sort-dir="asc"]::after { content: '▲'; opacity: 1; }
.admin-table th[data-sort-dir="desc"]::after { content: '▼'; opacity: 1; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table__actions { display: flex; gap: 10px; align-items: center; }
.admin-table__actions form { display: inline; margin: 0; }
.admin-table__empty { text-align: center; color: var(--text-muted); white-space: normal; }

.admin-link-danger {
    background: none;
    border: none;
    padding: 0;
    color: var(--warn);
    font-weight: 700;
    font-size: .88rem;
    text-decoration: underline;
}

/* ---- 등록/수정 폼 ---- */
.admin-form {
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.admin-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .84rem;
    font-weight: 700;
    color: var(--text-muted);
}
.admin-form input[type="text"],
.admin-form select {
    font-weight: 400;
    color: var(--text);
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
}
.admin-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.admin-form__checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}
.admin-form__checkbox input { width: auto; }
.admin-form__actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

/* ---- HIRA 전체 가져오기 진행률 ---- */
.hira-progress {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 640px;
}
.hira-progress__bar-track {
    height: 10px;
    border-radius: 999px;
    background: var(--parchment);
    overflow: hidden;
    margin-bottom: 10px;
}
.hira-progress__bar-fill {
    height: 100%;
    background: var(--lime);
    transition: width .3s ease;
}
.hira-progress__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 16px 0 4px;
}
.hira-progress__stats > div {
    background: var(--parchment);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    text-align: center;
}
.hira-progress__stats dt { font-size: .78rem; color: var(--text-muted); margin-bottom: 4px; }
.hira-progress__stats dd { font-size: 1.15rem; font-weight: 800; }

.hira-status { font-weight: 700; font-size: .82rem; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.hira-status--new { background: var(--lime-tint); color: var(--lime-deep); }
.hira-status--changed { background: var(--warn-bg); color: var(--warn); }
.hira-status--same { background: var(--parchment); color: var(--text-muted); }

/* ---- HIRA 변경사항 검토 diff ---- */
.hira-diff-cell { white-space: normal; min-width: 260px; }
.hira-diff-row { margin: 2px 0; }
.hira-diff-row del { color: var(--warn); text-decoration: line-through; opacity: .75; }
.hira-diff-row ins { color: var(--lime-deep); text-decoration: none; font-weight: 700; }

/* ---- 예시/안내 팝업(<dialog>) ---- */
.admin-modal {
    max-width: 640px;
    width: 92vw;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    background: var(--white);
    color: var(--text);
}
.admin-modal::backdrop {
    background: rgba(0, 0, 0, .45);
}

/* ---- 로그인 화면 ---- */
.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.admin-login__card {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px 28px;
}
.admin-login__card h1 { font-size: 1.2rem; font-weight: 800; }
.admin-login__desc { font-size: .82rem; color: var(--text-muted); margin-top: -8px; }
.admin-login__card label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .84rem;
    font-weight: 700;
    color: var(--text-muted);
}
.admin-login__card input {
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 400;
    color: var(--text);
}
.admin-login__submit { width: 100%; margin-top: 4px; }

/* ---- 엑셀 업로드 처리 결과 팝업 ---- */
.admin-modal--wide { max-width: 920px; }
.xlsx-result__title { font-size: 1.15rem; font-weight: 800; margin-bottom: 10px; }
.xlsx-result__title--ok { color: var(--lime-deep); }
.xlsx-result__title--fail { color: var(--warn); }
.xlsx-result__filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.xlsx-result__filters .is-active { background: var(--ink); color: var(--white); border-color: var(--ink); }
.xlsx-result__table-wrap { max-height: 55vh; overflow: auto; margin-bottom: 14px; }
.xlsx-result__table-wrap td { white-space: normal; word-break: keep-all; }
.xlsx-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}
.xlsx-status--new { background: var(--info-tint); color: var(--info-deep); }
.xlsx-status--updated { background: var(--lime-tint); color: var(--lime-deep); }
.xlsx-status--same { background: var(--parchment); color: var(--ink-2); }
.xlsx-status--failed { background: var(--warn-bg); color: var(--warn); }
.xlsx-result__regions { margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--warn); border-radius: var(--r-sm); background: var(--warn-bg); }
.xlsx-result__regions summary { cursor: pointer; font-weight: 700; color: var(--warn); }
.xlsx-result__regions .admin-table { margin-top: 6px; background: var(--white); }

/* ---- 치과 관리 목록: 서버 검색·필터 바, 페이지 이동 ---- */
.admin-list-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.admin-list-filter input[type=search] { flex: 1 1 280px; max-width: 420px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.admin-list-filter select { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--white); }
.admin-list-filter__check { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; color: var(--text-muted); }
.admin-table th[data-sort-key] a { color: inherit; text-decoration: none; }
.admin-pagination { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-items: center; margin: 16px 0; }
.admin-pagination a, .admin-pagination span { min-width: 34px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); text-align: center; font-size: .85rem; text-decoration: none; color: var(--ink); background: var(--white); }
.admin-pagination a:hover { border-color: var(--ink); }
.admin-pagination .is-current { background: var(--ink); color: var(--white); border-color: var(--ink); font-weight: 700; }
.admin-pagination .is-disabled { opacity: .4; }
.admin-pagination .admin-pagination__info { border: 0; background: none; color: var(--text-muted); }
/* 엑셀 처리 결과 팝업: 내려받기 버튼까지 버튼이 많아져 좁은 화면에서 줄바꿈되게 */
.admin-modal .admin-form__actions { flex-wrap: wrap; }
/* hidden 속성을 준 버튼(.btn의 display 지정)도 확실히 숨기기 */
.admin-modal [hidden] { display: none !important; }