/* 관리자 공통 UI 피드백: 로딩 / 알림·확인 모달 / 토스트 / 선택 액션바 / 상태 배지 (admin-ui.js 와 함께 사용) */

/* ----- 로딩 오버레이 ----- */
.aui_ld { display: none; position: fixed; inset: 0; z-index: 10001; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.55); backdrop-filter: blur(1.5px); }
.aui_ld.on { display: flex; }
.aui_ld_box { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 26px 38px; border-radius: 14px; background: #fff; box-shadow: 0 8px 30px rgba(30, 50, 90, 0.18); }
.aui_ld_dots { display: flex; gap: 8px; }
.aui_ld_dots i { width: 11px; height: 11px; border-radius: 50%; background: #4777d9; animation: auiBounce 1s infinite ease-in-out both; }
.aui_ld_dots i:nth-child(2) { animation-delay: 0.16s; }
.aui_ld_dots i:nth-child(3) { animation-delay: 0.32s; }
.aui_ld_txt { font-size: 13.5px; font-weight: 600; color: #555; }
@keyframes auiBounce { 0%, 80%, 100% { transform: scale(0.5); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

/* ----- 모달 (알림 / 확인 / 내용 보기) ----- */
.aui_dlg { display: none; position: fixed; inset: 0; z-index: 10000; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.45); }
.aui_dlg.on { display: flex; }
.aui_box { width: 420px; max-width: 92vw; padding: 26px 28px 20px; border-radius: 14px; background: #fff; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); text-align: center; animation: auiPop 0.14s ease-out; }
.aui_box.wide { width: 720px; text-align: left; }
@keyframes auiPop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.aui_ico { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 50%; font-size: 24px; font-weight: 700; background: #e6f6ec; color: #1f9d55; }
.aui_ico.warn { background: #fff4e0; color: #e08a00; }
.aui_ico.error { background: #fdecee; color: #e5484d; }
.aui_ico.ask { background: #e8f0fe; color: #3b6fd8; }
.aui_title { margin: 0 0 6px; font-size: 16.5px; font-weight: 700; color: #222; }
.aui_msg { margin: 0 0 20px; font-size: 14px; line-height: 1.65; color: #555; white-space: pre-line; }
.aui_msg b { color: #222; }
.aui_btns { display: flex; justify-content: center; gap: 8px; }
.aui_box.wide .aui_btns { justify-content: flex-end; }
.aui_btns button { min-width: 80px; height: 38px; padding: 0 18px; border: 1px solid #d9dde3; border-radius: 8px; background: #fff; font-size: 14px; font-weight: 600; color: #444; cursor: pointer; }
.aui_btns button:hover { background: #f6f9fa; }
.aui_btns button.primary { border-color: #4777d9; background: #4777d9; color: #fff; }
.aui_btns button.primary:hover { background: #3a64bf; }
.aui_btns button.danger { border-color: #e5484d; background: #e5484d; color: #fff; }
.aui_code { max-height: 56vh; margin: 0 0 16px; padding: 14px 16px; overflow: auto; border-radius: 10px; background: #f7f9fc; font: 12.5px/1.6 Consolas, 'D2Coding', monospace; color: #333; white-space: pre-wrap; word-break: break-all; }

/* ----- 토스트 ----- */
.aui_toasts { position: fixed; top: 20px; right: 20px; z-index: 10002; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.aui_toast { display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px; padding: 12px 16px; border-radius: 10px; background: #2d3748; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22); font-size: 13.5px; line-height: 1.5; color: #fff; animation: auiSlide 0.18s ease-out; pointer-events: auto; }
.aui_toast i { flex: none; width: 20px; height: 20px; border-radius: 50%; background: #1f9d55; font-style: normal; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.aui_toast.warn i { background: #e08a00; }
.aui_toast.error i { background: #e5484d; }
.aui_toast.out { opacity: 0; transform: translateX(16px); transition: all 0.2s; }
@keyframes auiSlide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ----- 선택 액션바 (하단 고정) ----- */
.aui_bar { position: fixed; left: 50%; bottom: 22px; z-index: 900; display: none; align-items: center; gap: 14px; padding: 10px 12px 10px 20px; border-radius: 14px; background: #2d3748; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); color: #fff; transform: translateX(-50%); animation: auiUp 0.18s ease-out; }
.aui_bar.on { display: flex; }
.aui_bar b { font-size: 16px; color: #8fb2ff; }
.aui_bar .sp { width: 1px; height: 18px; background: rgba(255, 255, 255, 0.25); }
.aui_bar button { height: 36px; padding: 0 16px; border: 0; border-radius: 8px; background: #4777d9; font-size: 13.5px; font-weight: 700; color: #fff; cursor: pointer; }
.aui_bar button:hover { background: #5b8be8; }
.aui_bar button.ghost { background: transparent; color: #cfd6e4; font-weight: 500; }
.aui_bar button.ghost:hover { background: rgba(255, 255, 255, 0.12); }
@keyframes auiUp { from { transform: translate(-50%, 14px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ----- 진행률 / 칩 / 안내 ----- */
.aui_prog { display: flex; align-items: center; gap: 8px; }
.aui_prog_bar { flex: 1; height: 7px; border-radius: 4px; background: #eaeff7; overflow: hidden; }
.aui_prog_bar span { display: block; height: 100%; border-radius: 4px; background: #4777d9; }
.aui_prog_bar span.done { background: #1f9d55; }
.aui_prog_txt { flex: none; min-width: 64px; font-size: 12px; color: #6b7280; text-align: right; font-variant-numeric: tabular-nums; }
.aui_tabs { display: inline-flex; padding: 4px; gap: 2px; border-radius: 10px; background: #eaeff7; }
.aui_tab { height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; font-size: 13px; font-weight: 500; color: #5b6b8c; cursor: pointer; }
.aui_tab.on { background: #fff; color: #4777d9; font-weight: 700; box-shadow: 0 1px 4px rgba(30, 50, 90, 0.15); }
.aui_tab em { margin-left: 5px; font-style: normal; font-size: 12px; opacity: 0.75; }
.aui_field_err { margin-top: 4px; font-size: 12px; color: #e5484d; }
.el_f input.is_err, .el_f select.is_err { border-color: #e5484d !important; box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.12) !important; }
.el_f input:disabled { background: #f1f3f5; color: #aab0bb; cursor: not-allowed; }
.aui_tr_click { cursor: pointer; }
.aui_tr_sel td { background: #f1f6ff !important; }
.aui_stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.aui_stat > div { padding: 14px 18px; border: 1px solid #e2e5ea; border-radius: 12px; background: #fff; box-shadow: 0 2px 10px rgba(30, 50, 90, 0.06); }
.aui_stat .lb { display: block; font-size: 12.5px; color: #8a93a3; }
.aui_stat .vl { display: block; margin-top: 4px; font-size: 19px; font-weight: 700; color: #222; font-variant-numeric: tabular-nums; word-break: break-all; }
.aui_stat .vl.sm { font-size: 14px; }
.aui_stat .vl.red { color: #e5484d; }
.aui_stat .vl.green { color: #1f9d55; }

/* ----- 커스텀 드롭다운 ----- */
.aui_sel { position: relative; display: block; width: 100%; }
.aui_sel_native { position: absolute !important; left: 0; top: 0; width: 100% !important; height: 100% !important; opacity: 0; pointer-events: none; }
.aui_sel_btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 38px; padding: 0 12px; box-sizing: border-box; border: 1px solid #d9dde3; border-radius: 8px; background: #fff; font: inherit; font-size: 13.5px; color: #333; text-align: left; cursor: pointer; }
.aui_sel_btn span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aui_sel_btn i { flex: none; width: 7px; height: 7px; margin-top: -3px; border-right: 2px solid #8a93a3; border-bottom: 2px solid #8a93a3; transform: rotate(45deg); transition: transform 0.15s; }
.aui_sel_btn.on i { margin-top: 3px; transform: rotate(-135deg); }
.aui_sel_btn:hover { border-color: #b9c3d6; }
.aui_sel_btn:focus, .aui_sel_btn.on { outline: 0; border-color: #4777d9; box-shadow: 0 0 0 3px rgba(71, 119, 217, 0.15); }
.aui_sel_btn:disabled { background: #f1f3f5; color: #aab0bb; cursor: not-allowed; }
.aui_sel_native.is_err + .aui_sel_btn { border-color: #e5484d; }
.aui_sel_menu { position: fixed; z-index: 9000; max-height: 280px; margin: 0; padding: 6px; overflow-y: auto; list-style: none; border: 1px solid #e2e5ea; border-radius: 10px; background: #fff; box-shadow: 0 8px 24px rgba(30, 50, 90, 0.18); animation: auiPop 0.1s ease-out; }
.aui_sel_menu li { padding: 8px 12px; border-radius: 6px; font-size: 13.5px; color: #333; white-space: nowrap; cursor: pointer; }
.aui_sel_menu li:hover { background: #f1f6ff; color: #4777d9; }
.aui_sel_menu li.sel { background: #e8f0fe; color: #3b6fd8; font-weight: 700; }
.aui_sel_menu li.dis { color: #c3c8d0; cursor: default; }
.aui_sel_menu { scrollbar-width: thin; scrollbar-color: #cdd5e3 transparent; border-radius: 14px; }
.aui_sel_menu::-webkit-scrollbar { width: 8px; }
.aui_sel_menu::-webkit-scrollbar-button { display: none; }
.aui_sel_menu::-webkit-scrollbar-thumb { border: 2px solid #fff; border-radius: 999px; background: #cdd5e3; }
.aui_sel_menu::-webkit-scrollbar-thumb:hover { background: #b3bfd4; }
.aui_sel_menu li { padding: 9px 12px; }

/* ===== 공통 체크박스 (표/목록의 기본 체크박스를 둥근 파란 체크로) =====
   label 과 짝을 이뤄 숨겨 쓰는 커스텀 체크박스(.check, 로그인/가입 등)는 건드리지 않는다. */
table input[type='checkbox']:not(.check):not(.no-aui),
input[type='checkbox'].pr_chk,
input[type='checkbox'].el_chk,
.el_check input[type='checkbox'],
.sw_agree input[type='checkbox'] {
  -webkit-appearance: none; appearance: none; display: inline-block; flex: none; width: 20px; height: 20px; margin: 0; padding: 0;
  border: 1.6px solid #c5cddb; border-radius: 7px; background: #fff center / 14px 14px no-repeat; vertical-align: middle; cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
table input[type='checkbox']:not(.check):not(.no-aui):hover, input[type='checkbox'].pr_chk:hover, input[type='checkbox'].el_chk:hover, .el_check input[type='checkbox']:hover, .sw_agree input[type='checkbox']:hover { border-color: #4777d9; }
table input[type='checkbox']:not(.check):not(.no-aui):focus-visible, input[type='checkbox'].pr_chk:focus-visible, input[type='checkbox'].el_chk:focus-visible, .el_check input[type='checkbox']:focus-visible, .sw_agree input[type='checkbox']:focus-visible { outline: 0; box-shadow: 0 0 0 4px rgba(71, 119, 217, 0.2); }
table input[type='checkbox']:not(.check):not(.no-aui):checked, input[type='checkbox'].pr_chk:checked, input[type='checkbox'].el_chk:checked, .el_check input[type='checkbox']:checked, .sw_agree input[type='checkbox']:checked {
  border-color: #4777d9; background-color: #4777d9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
table input[type='checkbox']:not(.check):not(.no-aui):indeterminate, input[type='checkbox'].pr_chk:indeterminate, input[type='checkbox'].el_chk:indeterminate {
  border-color: #4777d9; background-color: #4777d9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.6' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
}
table input[type='checkbox']:not(.check):not(.no-aui):disabled, input[type='checkbox'].pr_chk:disabled, input[type='checkbox'].el_chk:disabled { opacity: 0.45; cursor: not-allowed; }

/* 모던 체크박스 (모바일) — 옛 스프라이트 체크박스를 20px 둥근 네모로 */
@media (max-width: 768px) {
  .check_label.txt_hide > label { width: 20px; height: 20px; min-width: 20px; min-height: 20px; padding: 0; }
  .check_label.txt_hide > label:before, .check_label.txt_hide > label:after { top: 0; left: 0; width: 20px; height: 20px; box-sizing: border-box; border-radius: 6px; background-image: none !important; background-position: center !important; }
  .check_label.txt_hide > label:before { border: 1.5px solid #c3cada; background-color: #fff; transition: background-color 0.15s, border-color 0.15s; }
  .check_label.txt_hide > label.on:before { border-color: #4777d9; background-color: #4777d9; }
  .check_label.txt_hide > label.on:after { background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7.5'/></svg>") center / 13px no-repeat !important; }
}
