/* 디자인: 브랜드 정돈형 (2026-12-01 사용자 선택, 시안 A). 글꼴 Pretendard (앱 안에 넣음, OFL) */
@font-face { font-family: "Pretendard"; src: url("/static/vendor/fonts/PretendardVariable.woff2") format("woff2-variations"); font-weight: 45 920; font-display: swap; }
:root {
  color-scheme: light dark;
  --bg: #f6f4f2; --card: #fff; --line: #ebe5e2; --line-strong: #d3cac6; --text: #1f1a1b; --muted: #6f6668;
  --accent: #e8501a; --accent-btn: #c8410f; --accent-ink: #fff; --link: #2d64b0; --danger: #b42318; --ok-bg: #e8f3ec; --ok-line: #9cc9ad; --err-bg: #fdecea;
  font-family: "Pretendard", system-ui, -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  letter-spacing: -0.1px; line-height: 1.5; color: var(--text); background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1012; --card: #18191c; --line: #2a2c31; --line-strong: #40434a; --text: #ececee; --muted: #a0a2a8;
          --accent: #ff6a36; --accent-btn: #ff6a36; --accent-ink: #111; --link: #8ab8f2; --danger: #ff8a80; --ok-bg: #1d2b22; --ok-line: #2f5a3f; --err-bg: #3a1d1b; }
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--link); }
.top { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; min-height: 56px; padding: .5rem 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text); text-decoration: none; }
.brand::before { content: ""; width: 6px; height: 18px; border-radius: 2px; background: var(--accent); }
.me { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; font-size: 13px; }
.me form { margin: 0; }
.who { color: var(--text); font-weight: 600; }
.top .me a, .top .me button.link { color: var(--muted); text-decoration: none; font-size: 13px; }
.top .me a:hover, .top .me button.link:hover { color: var(--text); }
.top .me button.link { padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; }
main.page { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
main.narrow { max-width: 28rem; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 .75rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; }
.card h2 { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.card + .card, .card + p { margin-top: 1rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
label { font-weight: 600; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], select {
  font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); width: 100%;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[aria-invalid=true] { border-color: var(--danger); }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
button { font: inherit; padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
/* 눌러서 고르는 입력은 손 모양 (글자 넣는 칸은 기본 I자 커서 그대로) */
select, summary, input[type=checkbox], input[type=radio], label:has(> input[type=checkbox], > input[type=radio]) { cursor: pointer; }
button.primary { background: var(--accent-btn); border-color: var(--accent-btn); color: var(--accent-ink); font-weight: 600; }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
button.link { border: 0; padding: 0; background: none; color: var(--link); text-decoration: underline; }
.danger-link { color: var(--danger); }
.hint, .sub { margin: 0; color: var(--muted); font-size: .9rem; }
.field-error { margin: 0; color: var(--danger); font-size: .9rem; }
.form-error { margin: 0; padding: .6rem .8rem; background: var(--err-bg); border-radius: 6px; color: var(--danger); }
.notice { margin: 0 0 1rem; padding: .6rem .8rem; background: var(--ok-bg); border: 1px solid var(--ok-line); border-radius: 6px; }
.warn { margin: 0; color: var(--danger); }
.secret { font-size: 1.25rem; padding: .2rem .5rem; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; letter-spacing: .05em; user-select: all; }
.actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.grid-form .wide, .grid-form .form-error { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
table.list { width: 100%; border-collapse: collapse; font-size: .95rem; }
.list th, .list td { padding: .55rem .75rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.list th { background: var(--bg); font-weight: 600; }
.list tbody tr:last-child td { border-bottom: 0; }
.list .memo { white-space: normal; min-width: 10rem; }
.num { font-variant-numeric: tabular-nums; }
.off { color: var(--danger); }
.tag { font-size: .8rem; padding: 0 .4rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.placeholder { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* 머리줄 레이어 팝업 (사용자 관리·비밀번호 변경) */
.layer { position: fixed; width: min(980px, 100vw - 32px); height: min(820px, 100dvh - 32px); max-width: none; max-height: none; padding: 0;
         border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / .25); overflow: hidden; }
.layer[data-size=narrow] { width: min(520px, 100vw - 32px); height: min(600px, 100dvh - 32px); }
.layer:modal { overscroll-behavior: contain; }
.layer::backdrop { background: rgb(20 16 16 / .45); overflow: hidden; overscroll-behavior: contain; }
.layer iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--bg); }
.layer-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; padding: 0; border-radius: 999px; font-size: 16px; line-height: 1; }
body.embed main.page, body.embed main.narrow { padding-top: 20px; }
body.embed main > h1:first-of-type, body.embed main > .notice:first-child { margin-right: 44px; }  /* 닫기 단추 자리 */

/* 로딩 동그라미 (busy.js · dashboard.js). 화면을 막지 않게 옅은 덮개 + 가운데 동그라미 */
.busy { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgb(246 244 242 / .45); cursor: progress; }
.busy[hidden] { display: none; }
.spin, .layer[data-busy]::after { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--accent); animation: spin .7s linear infinite; }
.layer[data-busy]::after { content: ""; position: absolute; inset: 0; margin: auto; }
.layer[data-busy] iframe { visibility: hidden; }
@keyframes spin { to { rotate: 1turn; } }
@media (prefers-reduced-motion: reduce) { .spin, .layer[data-busy]::after { animation-duration: 1.6s; } }
@media (prefers-color-scheme: dark) { .busy { background: rgb(15 16 18 / .45); } }

/* 표 정렬 (table_sort.js · DataTables 3): 정렬 가능 ↕(흐리게) → 정렬 중 ▲/▼ */
th.dt-orderable-asc, th.dt-orderable-desc { cursor: pointer; user-select: none; }
th .dt-column-header { display: inline-flex; align-items: center; gap: 3px; }
th .dt-column-order { display: inline-block; min-width: .8em; font-size: .8em; line-height: 1; }
th.dt-orderable-asc .dt-column-order::after, th.dt-orderable-desc .dt-column-order::after { content: "↕"; opacity: .45; }
th.dt-ordering-asc .dt-column-order::after { content: "▲"; opacity: 1; }
th.dt-ordering-desc .dt-column-order::after { content: "▼"; opacity: 1; }
th.dt-orderable-asc:focus-visible, th.dt-orderable-desc:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
