@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

:root {
  /* 국도머신(주) 로고 색상 */
  --brand: #09408e;
  --brand-strong: #062f6b;
  --brand-soft: #e7edf7;
  --accent: #12b886;
  --danger: #e03131;
  --danger-soft: #fdecec;
  --warn: #f08c00;
  --warn-soft: #fff4e0;
  --ok-soft: #e6f8f1;
  --ink: #16202e;
  --ink-2: #4a5566;
  --ink-3: #8a94a6;
  --line: #e3e7ee;
  --bg: #f4f6fa;
  --panel: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --font: 'Pretendard', 'Malgun Gothic', 'Apple SD Gothic Neo', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; }

/* ---------- 버튼 / 폼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: #f0f3f8; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-strong); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #c92a2a; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.05); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 50px; padding: 0 24px; font-size: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font: inherit; color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(9,64,142, .15); }
.error-text { color: var(--danger); font-size: 13px; min-height: 18px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: #eef1f5; color: var(--ink-2);
}
.badge.ok { background: var(--ok-soft); color: #0b7a57; }
.badge.warn { background: var(--warn-soft); color: #b35c00; }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--brand-soft); color: var(--brand-strong); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- 토스트 / 모달 ---------- */
#toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1d2533; color: #fff; padding: 10px 18px; border-radius: 8px; box-shadow: var(--shadow); font-size: 14px; animation: toast-in .2s ease-out; max-width: 90vw; }
.toast.error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 22, 35, .45); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 18px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 20px; }

/* ---------- 테이블 ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfd; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #f7f9fc; }
.table .ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 40px; text-align: center; color: var(--ink-3); }

.progress { height: 6px; background: #e9edf3; border-radius: 3px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }

@media (max-width: 640px) {
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
  .modal-foot { padding: 0 16px 16px; }
}
