/* 사용자 관리 모달 CSS - 콤팩트 레이아웃 */

/* 모달 오버레이 */
.user-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: modal-fade-in 200ms ease-out;
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 모달 본체 */
.user-modal {
    background-color: rgb(15 23 42);
    border: 1px solid rgb(51 65 85);
    border-radius: 0.625rem;
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modal-slide-in 200ms ease-out;
}

/* 모달 헤더 */
.user-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgb(51 65 85);
}

.user-modal-title {
    font-size: 0.9375rem;
    font-weight: 800;
    color: rgb(241 245 249);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.user-modal-title-icon {
    color: #3b82f6;
    font-size: 1.125rem;
}

.user-modal-close {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgb(148 163 184);
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 150ms;
}

.user-modal-close:hover {
    background-color: rgb(51 65 85);
    color: white;
}

.user-modal-close .material-symbols-outlined {
    font-size: 1.125rem;
}

/* 모달 바디 */
.user-modal-body {
    padding: 0.875rem 1rem;
    overflow-y: auto;
    flex: 1;
}

/* 폼 섹션 구분선 */
.user-form-section {
    margin-top: 0.875rem;
    padding-top: 0.625rem;
    border-top: 1px solid rgb(51 65 85 / 0.5);
}

.user-form-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.user-form-section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    color: rgb(100 116 139);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.user-form-section-title .material-symbols-outlined {
    font-size: 0.8125rem;
}

/* 폼 2열 그리드 */
.user-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 0.625rem;
}

.user-form-row-full {
    grid-column: 1 / -1;
}

/* 폼 그룹 */
.user-form-group {
    margin-bottom: 0.5rem;
}

.user-form-group:last-child {
    margin-bottom: 0;
}

.user-form-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: rgb(148 163 184);
    margin-bottom: 0.1875rem;
}

.user-form-required {
    color: rgb(244 63 94);
    margin-left: 0.125rem;
}

/* 폼 입력 필드 - 콤팩트 */
.user-form-input {
    width: 100%;
    padding: 0.25rem 0.5rem;
    background-color: rgb(30 41 59);
    border: 1px solid rgb(51 65 85);
    border-radius: 0.25rem;
    color: rgb(226 232 240);
    font-size: 0.8125rem;
    outline: none;
    transition: all 150ms;
    box-sizing: border-box;
    height: 32px;
}

.user-form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.user-form-input::placeholder {
    color: rgb(71 85 105);
    font-size: 0.75rem;
}

.user-form-input:disabled,
.user-form-input[readonly] {
    background-color: rgb(15 23 42);
    color: rgb(100 116 139);
    cursor: not-allowed;
    border-color: rgb(30 41 59);
}

/* 셀렉트 - 콤팩트 */
.user-form-select {
    width: 100%;
    padding: 0.25rem 0.5rem;
    background-color: rgb(30 41 59);
    border: 1px solid rgb(51 65 85);
    border-radius: 0.25rem;
    color: rgb(226 232 240);
    font-size: 0.8125rem;
    cursor: pointer;
    outline: none;
    transition: all 150ms;
    box-sizing: border-box;
    height: 32px;
}

.user-form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* 토글 스위치 - 작게 */
.user-form-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-form-toggle {
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 200ms;
    border: none;
    flex-shrink: 0;
}

.user-form-toggle-on {
    background-color: rgb(16 185 129);
}

.user-form-toggle-off {
    background-color: rgb(71 85 105);
}

.user-form-toggle-knob {
    position: absolute;
    top: 2px;
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 9999px;
    transition: transform 200ms;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.user-form-toggle-on .user-form-toggle-knob {
    transform: translateX(18px);
}

.user-form-toggle-off .user-form-toggle-knob {
    transform: translateX(2px);
}

.user-form-toggle-text {
    font-size: 0.75rem;
    font-weight: 600;
}

.user-form-toggle-text-on {
    color: rgb(16 185 129);
}

.user-form-toggle-text-off {
    color: rgb(100 116 139);
}

/* 읽기전용 정보 */
.user-form-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.user-form-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.user-form-info-label {
    font-size: 0.625rem;
    font-weight: 600;
    color: rgb(71 85 105);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-form-info-value {
    font-size: 0.75rem;
    color: rgb(203 213 225);
    font-weight: 500;
}

/* 잠금 상태 */
.user-form-lock-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.user-form-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.1875rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.1875rem;
    font-size: 0.625rem;
    font-weight: 700;
}

.user-form-lock-badge-safe {
    background-color: rgb(16 185 129 / 0.15);
    color: rgb(16 185 129);
}

.user-form-lock-badge-locked {
    background-color: rgb(244 63 94 / 0.15);
    color: rgb(244 63 94);
}

.user-form-unlock-btn {
    padding: 0.125rem 0.375rem;
    background-color: rgb(59 130 246 / 0.15);
    color: #3b82f6;
    border: none;
    border-radius: 0.1875rem;
    font-size: 0.625rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 150ms;
}

.user-form-unlock-btn:hover {
    background-color: rgb(59 130 246 / 0.25);
}

/* 유효성 오류 */
.user-form-error {
    font-size: 0.6875rem;
    color: rgb(244 63 94);
    margin-top: 0.125rem;
    display: flex;
    align-items: center;
    gap: 0.1875rem;
}

.user-form-error .material-symbols-outlined {
    font-size: 0.75rem;
}

.user-form-input-error {
    border-color: rgb(244 63 94) !important;
}

/* 모달 푸터 */
.user-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    border-top: 1px solid rgb(51 65 85);
    gap: 0.5rem;
}

.user-modal-footer-right {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

/* 모달 버튼 - 콤팩트 */
.user-modal-btn {
    height: 32px;
    padding: 0 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 150ms;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.user-modal-btn:active {
    transform: scale(0.98);
}

.user-modal-btn-primary {
    background-color: #3b82f6;
    color: white;
}

.user-modal-btn-primary:hover {
    background-color: #2563eb;
}

.user-modal-btn-cancel {
    background-color: transparent;
    color: rgb(203 213 225);
    border: 1px solid rgb(51 65 85);
}

.user-modal-btn-cancel:hover {
    background-color: rgb(30 41 59);
}

.user-modal-btn-danger {
    background-color: rgb(244 63 94 / 0.15);
    color: rgb(244 63 94);
}

.user-modal-btn-danger:hover {
    background-color: rgb(244 63 94 / 0.25);
}

.user-modal-btn .material-symbols-outlined {
    font-size: 1rem;
}

/* 삭제 확인 다이얼로그 */
.user-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
}

.user-confirm-dialog {
    background-color: rgb(15 23 42);
    border: 1px solid rgb(51 65 85);
    border-radius: 0.625rem;
    padding: 1.25rem;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.user-confirm-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgb(244 63 94 / 0.15);
    border-radius: 9999px;
}

.user-confirm-icon .material-symbols-outlined {
    font-size: 1.25rem;
    color: rgb(244 63 94);
}

.user-confirm-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: rgb(241 245 249);
    margin-bottom: 0.375rem;
}

.user-confirm-message {
    font-size: 0.8125rem;
    color: rgb(148 163 184);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.user-confirm-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* 토스트 알림 */
.user-toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: toast-slide-in 300ms ease-out;
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.user-toast-success {
    background-color: rgb(16 185 129 / 0.15);
    border: 1px solid rgb(16 185 129 / 0.3);
    color: rgb(16 185 129);
}

.user-toast-error {
    background-color: rgb(244 63 94 / 0.15);
    border: 1px solid rgb(244 63 94 / 0.3);
    color: rgb(244 63 94);
}

.user-toast .material-symbols-outlined {
    font-size: 1rem;
}