:root {
  --navy: #0c3c6e;
  --blue: #1565b0;
  --blue-dark: #0e4e8a;
  --green: #0a8f4d;
  --line: #c5d2e0;
  --th: #e7f1fb;
  --bg: #eef2f6;
  --card: #fff;
  --text: #1c2833;
  --muted: #5d6b7a;
  --danger: #b42318;
  --ok: #067647;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Malgun Gothic", "맑은 고딕", sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: Consolas, monospace; font-size: 12px; }

.topbar { background: var(--navy); color: #fff; }
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 64px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.agency { margin: 0; font-size: 12px; letter-spacing: -0.02em; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand strong { display: block; font-size: 16px; }
.brand small { display: block; color: #c9d8ea; font-size: 11px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--green); display: grid; place-items: center;
  font-weight: 700; font-size: 16px;
}
.session { display: flex; align-items: center; gap: 12px; color: #d7e4f2; font-size: 12px; }
.who { color: #fff; font-weight: 700; }
.mock-banner {
  background: #fff7e8; color: #8a4b08; text-align: center;
  padding: 7px 16px; border-bottom: 1px solid #f0d7a8; font-size: 12px;
}

.shell { max-width: 1180px; margin: 18px auto 40px; display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 0 16px; }
.sidenav { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px; height: fit-content; }
.sidenav a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.sidenav a.active, .sidenav a:hover { background: #e8f2fc; color: var(--blue-dark); text-decoration: none; font-weight: 700; }
.nav-label { margin: 12px 10px 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.content { min-width: 0; }
.page-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.page-head h1 { margin: 0; font-size: 22px; }
.crumb, .meta, .hint, .field-note, .counter { color: var(--muted); }
.crumb { margin: 0 0 4px; font-size: 12px; }
.meta { margin: 0; }

.login-wrap {
  max-width: 980px; margin: 48px auto; padding: 0 16px;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px; align-items: center;
}
.brand-kicker { margin: 0; color: var(--green); font-weight: 700; }
.login-intro h1 { margin: 6px 0 10px; font-size: 32px; color: var(--navy); }
.lead { line-height: 1.6; color: var(--muted); }
.steps { padding-left: 18px; line-height: 1.9; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; box-shadow: 0 8px 24px rgba(12, 60, 110, 0.06); }
.login-card h2 { margin: 0 0 14px; }
.login-card label { display: block; margin: 12px 0 4px; font-weight: 700; }
.login-card input, .filters input, .filters select, .form-table input, .form-table select, .grid input, .grid select, .grid textarea, .sheet textarea, .detail-row input, .adl-grid select {
  width: 100%; border: 1px solid #b7c6d6; border-radius: 4px; padding: 7px 8px; font: inherit; background: #fff;
}
.login-card .btn { margin-top: 16px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.filters label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); min-width: 140px; }
.result-count { margin: 10px 2px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.grid, .form-table { width: 100%; border-collapse: collapse; background: #fff; }
.grid th, .grid td, .form-table th, .form-table td { border: 1px solid var(--line); padding: 8px; vertical-align: middle; }
.grid th, .form-table th { background: var(--th); color: #24425f; font-weight: 700; text-align: left; white-space: nowrap; }
.form-table th { width: 140px; }
.grid td { background: #fff; }
.center { text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 28px !important; }
.grid textarea { min-width: 140px; }

.sheet { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-top: 14px; }
.sheet h3 { margin: 0 0 10px; font-size: 15px; color: var(--navy); }
.sheet-focus { border-color: #8eb4de; box-shadow: inset 3px 0 0 var(--blue); }
.choices, .detail-row, .inline-fields, .form-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.choice { display: inline-flex; align-items: center; gap: 4px; margin: 2px 10px 2px 0; }
.choice input { width: auto; }
.group-label { margin: 10px 0 4px; font-weight: 700; color: #24425f; }
.detail-row input, .inline-fields input { width: auto; }
.adl-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 8px; }
.adl-grid label { display: grid; gap: 4px; }
.block-label { display: block; margin: 10px 0 4px; font-weight: 700; }
.sheet textarea { display: block; margin-top: 6px; }
i { color: var(--danger); font-style: normal; }
.form-actions { margin-top: 12px; }
.counter { text-align: right; margin: 4px 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #b7c6d6; background: #fff; color: var(--text);
  border-radius: 4px; padding: 8px 14px; font: inherit; cursor: pointer; text-decoration: none;
}
.btn:hover { background: #f4f8fc; text-decoration: none; }
.btn-primary { background: var(--blue); border-color: var(--blue-dark); color: #fff; font-weight: 700; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.btn-block { width: 100%; }
.btn-small { padding: 4px 8px; font-size: 12px; }
.badge { display: inline-block; min-width: 64px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.badge-none { background: #eef2f6; color: #66788a; }
.badge-draft { background: #fff6df; color: #946200; }
.badge-completed { background: #e7f6ee; color: var(--ok); }
.alert { margin: 0 0 12px; padding: 10px 12px; border-radius: 6px; }
.alert-error { background: #fdecea; color: var(--danger); }
.alert-ok { background: #e8f7ef; color: var(--ok); }

@media (max-width: 860px) {
  .shell, .login-wrap { grid-template-columns: 1fr; }
  .session { flex-wrap: wrap; justify-content: flex-end; }
  .adl-grid { grid-template-columns: 1fr 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
}
