html:not(.popupMode){
    /* 스크롤바가 사라져도 화면이 밀리지 않게 공간을 고정합니다. */
    scrollbar-gutter: stable;
}

/* SweetAlert2가 강제로 넣는 패딩 차단 */
body.swal2-shown:not(.popupMode) {
    padding-right: 0 !important;
}

/* ==========================================================================
   SweetAlert2 공통 테마 (ui-alert)
   - 프로젝트별로 :root 변수만 바꿔서 재사용
   - JS에서 buttonsStyling: false 와 함께 사용 권장
   ========================================================================== */

:root {
    /* 브랜드 컬러 (프로젝트마다 이 부분만 교체) */
    --ui-alert-primary: #0a3663;
    --ui-alert-primary-hover: #072a4e;
    --ui-alert-primary-ring: rgba(10, 54, 99, 0.28);

    --ui-alert-danger: #dc2626;
    --ui-alert-danger-hover: #b91c1c;

    /* 뉴트럴 */
    --ui-alert-surface: #ffffff;
    --ui-alert-title: #0f172a;
    --ui-alert-text: #475569;
    --ui-alert-muted-bg: #f1f5f9;
    --ui-alert-muted-bg-hover: #e2e8f0;
    --ui-alert-muted-text: #475569;
    --ui-alert-border: rgba(15, 23, 42, 0.06);
    --ui-alert-backdrop: rgba(15, 23, 42, 0.45);

    /* 형태 */
    --ui-alert-radius: 20px;
    --ui-alert-btn-radius: 10px;
    --ui-alert-font: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto,
        'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
}

/* 1. 배경 딤 + 블러 */
.ui-alert-backdrop {
    background: var(--ui-alert-backdrop) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* 2. 팝업 컨테이너 */
.ui-alert-popup {
    font-family: var(--ui-alert-font) !important;
    background: var(--ui-alert-surface) !important;
    width: min(420px, calc(100vw - 32px)) !important;
    padding: 2rem 1.75rem 1.5rem !important;
    border: 1px solid var(--ui-alert-border) !important;
    border-radius: var(--ui-alert-radius) !important;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 24px 48px -12px rgba(15, 23, 42, 0.25) !important;
}

/* 아이콘 크기 축소 (기본값이 너무 큼) */
.ui-alert-popup .swal2-icon {
    width: 3.5em !important;
    height: 3.5em !important;
    margin: 0.25em auto 1.25em !important;
    border-width: 0.2em !important;
}
.ui-alert-popup .swal2-icon .swal2-icon-content {
    font-size: 2.25em !important;
}

/* 3. 제목 */
.ui-alert-title {
    color: var(--ui-alert-title) !important;
    font-size: 19px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    letter-spacing: -0.02em !important;
    padding: 0 !important;
    margin: 0 0 8px !important;
    word-break: keep-all;
}

/* 4. 본문 */
.ui-alert-html {
    color: var(--ui-alert-text) !important;
    font-size: 15px !important;
    line-height: 1.65 !important;
    letter-spacing: -0.01em !important;
    padding: 0 !important;
    margin: 0 !important;
    word-break: keep-all;
}

/* 5. 버튼 영역 */
.ui-alert-actions {
    display: flex !important;
    flex-direction: row-reverse; /* 확인 버튼을 오른쪽에 */
    gap: 8px !important;
    width: 100% !important;
    margin: 1.75rem 0 0 !important;
    padding: 0 !important;
}

/* 버튼 공통 */
.ui-alert-confirm-btn,
.ui-alert-cancel-btn,
.ui-alert-deny-btn {
    flex: 1 1 0;
    min-height: 48px;
    margin: 0 !important;
    padding: 0 20px !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em;
    border: none !important;
    border-radius: var(--ui-alert-btn-radius) !important;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.ui-alert-confirm-btn:active,
.ui-alert-cancel-btn:active,
.ui-alert-deny-btn:active {
    transform: scale(0.97);
}

/* 확인 버튼 */
.ui-alert-confirm-btn {
    background: var(--ui-alert-primary) !important;
    color: #ffffff !important;
}
.ui-alert-confirm-btn:hover {
    background: var(--ui-alert-primary-hover) !important;
}

/* 취소 버튼 */
.ui-alert-cancel-btn {
    background: var(--ui-alert-muted-bg) !important;
    color: var(--ui-alert-muted-text) !important;
}
.ui-alert-cancel-btn:hover {
    background: var(--ui-alert-muted-bg-hover) !important;
    color: var(--ui-alert-title) !important;
}

/* 거부/삭제 버튼 (showDenyButton 사용 시) */
.ui-alert-deny-btn {
    background: var(--ui-alert-danger) !important;
    color: #ffffff !important;
}
.ui-alert-deny-btn:hover {
    background: var(--ui-alert-danger-hover) !important;
}

/* 키보드 포커스 표시 */
.ui-alert-confirm-btn:focus-visible,
.ui-alert-cancel-btn:focus-visible,
.ui-alert-deny-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--ui-alert-surface), 0 0 0 5px var(--ui-alert-primary-ring) !important;
}

/* 6. 입력창 (input 옵션 사용 시) */
.ui-alert-input {
    font-family: inherit !important;
    font-size: 15px !important;
    height: 48px !important;
    margin: 1.25rem 0 0 !important;
    padding: 0 14px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: var(--ui-alert-btn-radius) !important;
    box-shadow: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ui-alert-input:focus {
    border-color: var(--ui-alert-primary) !important;
    box-shadow: 0 0 0 3px var(--ui-alert-primary-ring) !important;
}

/* 7. 모바일: 버튼 세로 배치 */
@media (max-width: 400px) {
    .ui-alert-actions {
        flex-direction: column;
    }
}

/* 8. 모션 최소화 설정 존중 */
@media (prefers-reduced-motion: reduce) {
    .ui-alert-confirm-btn,
    .ui-alert-cancel-btn,
    .ui-alert-deny-btn {
        transition: none;
    }
}


/* 토글 전체를 감싸는 컨테이너 */
.toggle-container {
    display: inline-block;
    position: relative;
    width: 40px;  /* 👈 관리자 페이지 테이블 안에도 쏙 들어가게 가로를 줄임 */
    height: 20px; /* 👈 안정적인 2:1 비율로 조절 */
    cursor: pointer;
    user-select: none;
    top:3px;
  }
  
  /* 실제 체크박스는 화면에서 숨깁니다. */
  .toggle-input {
    display: none;
  }
  
  /* ⭐️ OFF 상태: 시스템 설정 창에 어울리는 플랫한 다크 그레이 톤 */
  .toggle-switch {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #f1f5f9; /* 👈 부드러운 연회색 바탕 */
    border: 1px solid #cbd5e1;  /* 👈 대시보드 경계선과 일치하는 플랫한 테두리 */
    border-radius: 4px;        /* 👈 완전히 동그란 모양 대신 살짝 각을 살린 둥근 사각형 */
    box-sizing: border-box;
    transition: all 0.15s ease-in-out;
  }
  
  /* 토글 안의 사각형 버튼 (입체감과 그림자를 빼고 깔끔한 플랫 스타일로 전환) */
  .toggle-switch::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    top: 2px; 
    left: 3px;
    background-color: #94a3b8; /* 👈 OFF일 때는 버튼도 차분한 슬레이트 회색 */
    border-radius: 2px;        /* 👈 바 형태와 통일감을 주는 미세한 라운딩 */
    transition: transform 0.15s ease-in-out, background-color 0.15s ease-in-out;
  }
  
  /* 💡 ON 상태: 활성화되었을 때 스타일 */
  /* 1. 글로벌 대시보드 표준인 차분하고 명확한 오피스 그린(Success) 컬러 */
  .toggle-input:checked + .toggle-switch {
    background-color: #ecfdf5; /* 👈 연한 그린 틴트 배경 */
    border-color: #10b981;     /* 👈 선명한 그린 테두리 */
  }
  
  /* 2. ON이 되면 내부 버튼 색상도 그린으로 변경하며 슬라이딩 */
  .toggle-input:checked + .toggle-switch::before {
    background-color: #10b981; /* 👈 확연히 눈에 띄는 활성화 컬러 */
    transform: translateX(18px); /* 👈 슬림해진 가로폭에 맞춰 이동 거리 최적화 */
  }