:root {
  --brand: #0b1d8a;
  --brand-soft: #e8ecfb;
  --ink: #1b2130;
  --muted: #667085;
  --line: #d9dee8;
  --bg: #f4f6fa;
  --ok: #0f7b4f;
  --warn: #b4540a;
  --bad: #b42318;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}
h1, h2, h3 { margin: 0; line-height: 1.3; }
button, input, select { font: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.btn {
  display: inline-block;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: #fff; color: var(--brand); }
.btn.sm { padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.btn.block { display: block; width: 100%; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.field input:focus, .field select:focus { outline: 2px solid var(--brand); outline-offset: 0; }
.msg { font-size: 14px; margin: 8px 0; min-height: 20px; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--ok); }

.badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef0f4;
  color: var(--muted);
  white-space: nowrap;
}
.badge.ok { background: #e3f4ec; color: var(--ok); }
.badge.warn { background: #fdefe2; color: var(--warn); }
.badge.bad { background: #fde8e6; color: var(--bad); }
.badge.mock { background: #fff3c4; color: #7a5b00; }

/* ---------- 고객사 가입 (모바일) ---------- */
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: #fff; display: flex; flex-direction: column; }
.app header {
  background: var(--brand);
  color: #fff;
  padding: calc(18px + env(safe-area-inset-top)) 20px 18px;
}
.app header h1 { font-size: 22px; }
.app header p { margin: 4px 0 0; opacity: .85; font-size: 14px; }
.steps { display: flex; gap: 6px; padding: 14px 20px 0; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps span.on { background: var(--brand); }
.app main { padding: 20px; flex: 1; }
.app main h2 { font-size: 19px; margin-bottom: 4px; }
.app main .lead { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.row > .fixed { flex: none; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.check span { font-size: 15px; }
.check small { display: block; color: var(--muted); }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; background: var(--brand-soft); }
.actions { display: flex; gap: 8px; margin-top: 20px; }
.actions .btn { flex: 1; }
.done { text-align: center; padding-top: 40px; }
.done .mark {
  width: 72px; height: 72px; border-radius: 50%; background: #e3f4ec; color: var(--ok);
  font-size: 40px; line-height: 72px; margin: 0 auto 16px;
}
.install { margin-top: 28px; text-align: left; }
.app footer { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- 관리자 ---------- */
.admin-top {
  background: var(--brand); color: #fff; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.admin-top h1 { font-size: 18px; }
.admin-top .btn { border-color: #fff; background: transparent; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 20px; }
.login { max-width: 360px; margin: 80px auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.login h2 { margin-bottom: 16px; font-size: 20px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.panel h2 { font-size: 17px; margin-bottom: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.panel-head h3 { font-size: 16px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover { background: var(--brand-soft); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 20px; }
.kv div span { display: block; font-size: 12px; color: var(--muted); }
.consents { display: flex; flex-wrap: wrap; gap: 10px; }
.consent { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.back { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; margin-bottom: 12px; }

/* ---------- 첫 화면 · 홈 ---------- */
.welcome { text-align: center; padding-top: 28px; }
.welcome img { border-radius: 20px; margin-bottom: 16px; }
.welcome h2 { margin-bottom: 8px; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.center { text-align: center; margin-top: 18px; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; text-decoration: underline; cursor: pointer; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.menu-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.menu-item span { font-size: 13px; color: var(--muted); }
.menu-item em { font-style: normal; font-size: 12px; color: var(--warn); margin-top: 6px; }
.menu-item.soon { background: #fafbfc; }
.install { margin-top: 24px; text-align: left; }
