/* ===== 공통 스타일 (데모 사이트) ===== */
:root {
  --blue: #2f6fed;
  --blue-dark: #1d4fc4;
  --blue-deep: #0d47c9;
  --navy: #1b2a41;
  --line: #d7dce5;
  --line-soft: #e8ecf2;
  --bg: #f3f5f9;
  --th: #eef2f8;
  --text: #222;
  --muted: #6b7280;
  --red: #d33;
  --green: #2e8b3e;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Pretendard", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  font-size: 13px; color: var(--text); background: #fff;
}
a { color: inherit; text-decoration: none; cursor: pointer; }
button { font-family: inherit; font-size: 12px; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 12px; }
[hidden] { display: none !important; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px;
  border: 1px solid #b9c2d0; background: #fff; color: #333; border-radius: 3px; white-space: nowrap;
}
.btn:hover { filter: brightness(0.97); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-navy { background: #23345a; border-color: #23345a; color: #fff; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-teal { background: #1fa37a; border-color: #1fa37a; color: #fff; }
.btn-lg { height: 34px; padding: 0 16px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 폼 */
.inp, .sel {
  height: 24px; border: 1px solid #b9c2d0; border-radius: 2px; padding: 0 6px; background: #fff;
}
.inp:focus, .sel:focus, textarea:focus { outline: 2px solid #8fb2ff; outline-offset: -1px; }
.inp.date { width: 100px; }
.req::before { content: "*"; color: var(--red); margin-right: 2px; }
label.chk { display: inline-flex; align-items: center; gap: 3px; margin-right: 8px; white-space: nowrap; }

/* 표 */
table.grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.grid th, table.grid td { border: 1px solid var(--line); padding: 5px 6px; text-align: center; font-size: 12px; }
table.grid th { background: var(--th); font-weight: 600; color: #333; }
table.grid tbody tr:hover td { background: #f5f8ff; }
table.grid tr.selected td { background: #e3ecff; }
table.form { width: 100%; border-collapse: collapse; }
table.form th, table.form td { border: 1px solid var(--line); padding: 4px 8px; font-size: 12px; text-align: left; }
table.form th { background: var(--th); font-weight: 600; width: 120px; text-align: center; }

/* 모달 */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: #fff; border-radius: 4px; box-shadow: 0 8px 30px rgba(0,0,0,.3);
  max-height: 94vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 12px;
  border-bottom: 1px solid var(--line); font-weight: 700; font-size: 13px;
}
.modal-head .x { border: 0; background: none; font-size: 18px; line-height: 1; padding: 0 4px; }
.modal-body { padding: 12px; overflow: auto; }
.modal-foot { padding: 10px 12px; display: flex; justify-content: center; gap: 6px; border-top: 1px solid var(--line-soft); }

/* 확인창 */
#sys-dialog .modal { width: 360px; }
#sys-dialog .modal-body { padding: 22px 20px; line-height: 1.6; white-space: pre-line; }
#sys-dialog .dlg-title { font-weight: 700; margin-bottom: 8px; }

/* 토스트 */
#toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: 6px; }
.toast { background: #23345a; color: #fff; padding: 10px 18px; border-radius: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.25); font-size: 13px; }
.toast.ok { background: #1f7a3e; }
.toast.err { background: #b42318; }

.section-title { font-size: 15px; font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.section-title::before { content: ""; width: 3px; height: 13px; background: var(--blue); display: inline-block; }
.sub-title { font-size: 13px; font-weight: 700; margin: 14px 0 6px; display: flex; align-items: center; gap: 6px; }
.empty { color: var(--muted); text-align: center; padding: 50px 0; }
.empty::before { content: "🔍"; display: block; font-size: 30px; margin-bottom: 8px; }
.demo-badge { font-size: 10px; background: #ffb020; color: #222; border-radius: 3px; padding: 1px 5px; margin-left: 6px; font-weight: 700; vertical-align: middle; }
