/* 로그인 후 상단 회원 메뉴 */
.header-menu {
    align-items: center;
    gap: 20px;
}

.header-user {
    max-width: 220px;
    overflow: hidden;
    color: #FFFFFF;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-user::before {
    content: "ID ";
    color: #AAC4DD;
    font-size: 12px;
    font-weight: 600;
}

.header-logout-form {
    display: inline-flex;
    margin: 0;
}

.header-action-button {
    padding: 0;
    border: 0;
    color: #DDEEFF;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.header-menu a:hover,
.header-action-button:hover {
    color: #FFFFFF;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.header-menu a:focus-visible,
.header-action-button:focus-visible {
    border-radius: 3px;
    outline: 3px solid #FFFFFF;
    outline-offset: 4px;
}

/* 로그인·비밀번호 변경 공통 화면 */
.auth-page,
.admin-page {
    min-width: 320px;
    min-height: 100vh;
    color: #203040;
    background: #EEF2F5;
}

.auth-main {
    display: grid;
    min-height: calc(100vh - 70px);
    padding: 40px 20px;
    place-items: center;
}

.auth-card {
    width: min(100%, 440px);
    padding: 36px;
    border: 1px solid #CCD5DD;
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: 0 14px 36px rgba(17, 51, 85, 0.10);
}

.auth-card-heading {
    margin-bottom: 26px;
}

.auth-eyebrow {
    margin: 0 0 7px;
    color: #557799;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.auth-card-heading h2,
.admin-heading h2 {
    margin: 0;
    color: #113355;
    font-size: 28px;
    line-height: 1.25;
}

.auth-card-heading > p:last-child,
.admin-heading > p,
.admin-card-heading p {
    margin: 10px 0 0;
    color: #627180;
    font-size: 14px;
    line-height: 1.55;
}

.auth-alert {
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.auth-alert-error {
    border-color: #E8B4B0;
    color: #8E2923;
    background: #FFF3F2;
}

.auth-alert-success {
    border-color: #B7D8C2;
    color: #21643B;
    background: #F0FAF3;
}

.auth-form {
    display: grid;
    gap: 20px;
}

.auth-field {
    display: grid;
    min-width: 0;
    gap: 7px;
}

.auth-field label,
.admin-reset-form label {
    color: #263B50;
    font-size: 14px;
    font-weight: 700;
}

.auth-input {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #AEBBC7;
    border-radius: 7px;
    color: #172B3E;
    background: #FFFFFF;
    font: inherit;
}

.auth-input:hover {
    border-color: #7794AE;
}

.auth-input:focus {
    border-color: #2D638F;
    outline: 3px solid rgba(45, 99, 143, 0.18);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-field-hint {
    margin: 0;
    color: #6D7985;
    font-size: 12px;
    line-height: 1.45;
}

.auth-primary-button {
    min-height: 46px;
    padding: 10px 18px;
    border: 1px solid #113355;
    border-radius: 7px;
    color: #FFFFFF;
    background: #113355;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.auth-primary-button:hover {
    border-color: #244F75;
    background: #244F75;
}

.auth-primary-button:focus-visible,
.admin-action-button:focus-visible,
.admin-reset summary:focus-visible,
.admin-delete summary:focus-visible,
.auth-secondary-link:focus-visible {
    outline: 3px solid rgba(45, 99, 143, 0.30);
    outline-offset: 3px;
}

.auth-help {
    margin: 22px 0 0;
    color: #667788;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.auth-secondary-link {
    display: block;
    width: max-content;
    margin: 22px auto 0;
    color: #315F87;
    font-size: 14px;
    font-weight: 700;
    text-underline-offset: 3px;
}

/* 관리자 회원 관리 화면 */
.admin-main {
    width: min(94%, 1320px);
    min-height: calc(100vh - 70px);
    margin: 0 auto;
    padding: 36px 0 54px;
}

.admin-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 24px;
}

.admin-heading > p {
    max-width: 560px;
    margin: 0;
    text-align: right;
}

.admin-alert {
    margin-bottom: 16px;
}

.admin-card {
    margin-bottom: 20px;
    padding: 24px;
    border: 1px solid #CCD5DD;
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: 0 8px 24px rgba(17, 51, 85, 0.06);
}

.admin-card-heading {
    margin-bottom: 20px;
}

.admin-card-heading h3 {
    margin: 0;
    color: #193B5C;
    font-size: 20px;
}

.admin-create-form {
    display: grid;
    align-items: end;
    grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1.2fr) auto;
    gap: 16px;
}

.admin-create-button {
    min-width: 145px;
}

.admin-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.admin-member-count {
    color: #557799;
    font-size: 14px;
    font-weight: 800;
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid #D5DCE2;
    border-radius: 8px;
}

.admin-table {
    width: 100%;
    min-width: 1320px;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th,
.admin-table td {
    padding: 9px 8px;
    border-bottom: 1px solid #E2E7EB;
    vertical-align: middle;
    text-align: left;
}

.admin-table thead th {
    color: #3F566C;
    background: #F3F6F8;
    font-size: 12px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.admin-table tbody tr:last-child > * {
    border-bottom: 0;
}

.admin-username {
    color: #183B5B;
    font-weight: 800;
}

.admin-status,
.admin-password-state {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    color: #3E586D;
    background: #EAF0F4;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.admin-status-active {
    color: #23663C;
    background: #E3F4E8;
}

.admin-status-inactive {
    color: #7A3632;
    background: #F7E7E5;
}

.admin-password-waiting {
    color: #80520D;
    background: #FFF1CE;
}

.admin-actions {
    min-width: 150px;
}

.admin-memo-cell {
    min-width: 205px;
}

.admin-memo-form {
    display: flex;
    align-items: center;
    margin: 0 !important;
    gap: 6px;
}

.admin-memo-input {
    width: 130px;
    min-width: 130px;
    height: 30px;
}

.admin-memo-form .admin-action-button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.admin-action-row {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.admin-action-row > form {
    display: inline-flex;
    margin: 0;
}

.admin-table td:not(.admin-actions) > form {
    margin: 8px 0 0;
}

.admin-audit-table {
    min-width: 720px;
}

.admin-action-button {
    min-height: 30px;
    padding: 4px 8px;
    border: 1px solid #8096AA;
    border-radius: 6px;
    color: #244760;
    background: #FFFFFF;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.admin-action-button:hover {
    border-color: #315F87;
    background: #EEF5FA;
}

.admin-action-danger {
    border-color: #C49390;
    color: #8B302B;
}

.admin-action-danger:hover {
    border-color: #A54A44;
    background: #FFF3F2;
}

.admin-reset summary,
.admin-delete summary {
    width: max-content;
    color: #315F87;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.admin-reset-form,
.admin-delete-form {
    display: grid;
    width: 210px;
    margin-top: 10px;
    padding: 12px;
    gap: 8px;
    border: 1px solid #CBD6DF;
    border-radius: 7px;
    background: #F7F9FA;
}

.admin-reset-form .auth-input,
.admin-delete-form .auth-input {
    height: 38px;
}

.admin-delete-cell {
    min-width: 105px;
}

.admin-delete summary {
    color: #8B302B;
}

.admin-empty {
    padding: 36px !important;
    color: #667788;
    text-align: center !important;
}

@media (max-width: 820px) {
    .site-header.auth-header {
        flex-wrap: wrap;
        height: auto;
        min-height: 70px;
        padding-top: 12px;
        padding-bottom: 12px;
        gap: 10px 18px;
    }

    .site-header h1 {
        font-size: 27px;
    }

    .header-menu {
        flex-wrap: wrap;
        gap: 10px 14px;
        font-size: 14px;
    }

    .admin-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .admin-heading > p {
        text-align: left;
    }

    .admin-create-form {
        align-items: stretch;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .auth-main {
        align-items: start;
        padding: 24px 12px;
    }

    .auth-card {
        padding: 26px 20px;
    }

    .auth-card-heading h2,
    .admin-heading h2 {
        font-size: 24px;
    }

    .auth-header .header-user {
        display: none;
    }

    .admin-main {
        width: 94%;
        padding-top: 24px;
    }

    .admin-card {
        padding: 18px 14px;
    }
}
