:root {
  --blue: #2563eb;
  --green: #16a34a;
  --yellow: #f2b705;
  --orange: #ea580c;
  --red: #dc2626;
  --gray-bg: #f5f6f8;
  --text: #1f2430;
  --border: #e2e5ea;
}

* { box-sizing: border-box; }
body {
  font-family: "Pretendard", "Malgun Gothic", "맑은 고딕", sans-serif;
  background: var(--gray-bg);
  color: var(--text);
  margin: 0;
  font-size: 15px;
}
a { color: var(--blue); text-decoration: none; }

/* ---- Install wizard ---- */
.install-body { display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; }
.install-wrap { width: 100%; max-width: 560px; }
.install-wrap h1 { font-size: 20px; margin-bottom: 20px; }
.steps { display: flex; gap: 8px; margin-bottom: 16px; font-size: 13px; color: #8a8f99; }
.steps .on { color: var(--blue); font-weight: 700; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 24px; }
.card h2 { margin-top: 0; font-size: 17px; }
.hint { color: #6b7280; font-size: 13px; margin-bottom: 16px; }
label { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: #4b5160; }
input[type=text], input[type=password], input[type=email], textarea, select {
  width: 100%; margin-top: 6px; padding: 9px 10px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 14px; font-family: inherit;
}
button, .btn {
  background: var(--blue); color: #fff; border: none; padding: 10px 18px;
  border-radius: 7px; font-size: 14px; font-weight: 600; cursor: pointer;
}
button:hover, .btn:hover { opacity: .92; }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.error { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; padding: 10px 12px; border-radius: 7px; margin-bottom: 14px; font-size: 13px; }
.success { background: #f0fdf4; color: var(--green); border: 1px solid #bbf7d0; padding: 10px 12px; border-radius: 7px; margin-bottom: 14px; font-size: 13px; }
.summary { font-size: 14px; line-height: 1.8; }

/* ---- App shell ---- */
.app-header { background: #fff; border-bottom: 1px solid var(--border); padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; }
.app-header .brand { font-weight: 800; font-size: 16px; }
.app-main { max-width: 1040px; margin: 24px auto; padding: 0 16px; }

/* ---- Menu cards (dashboard) ---- */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 28px; }
.menu-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; transition: box-shadow .15s; }
.menu-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.menu-card .title { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.menu-card .desc { font-size: 12.5px; color: #6b7280; margin-bottom: 14px; min-height: 36px; }

/* ---- Tables ---- */
table.list { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
table.list th, table.list td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; text-align: left; }
table.list th { background: #fafbfc; color: #6b7280; font-weight: 700; }

/* ---- Badges (신뢰도/원장대조) ---- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-orange { background: #ffedd5; color: #9a3412; }

/* ---- Step indicator (업로드→추출→검토→생성→다운로드) ---- */
.flow-steps { display: flex; gap: 6px; margin-bottom: 20px; }
.flow-steps span { flex: 1; text-align: center; padding: 8px 4px; font-size: 12.5px; border-radius: 7px; background: #eef0f3; color: #8a8f99; font-weight: 700; }
.flow-steps span.active { background: var(--blue); color: #fff; }
.flow-steps span.done { background: #dcfce7; color: #166534; }

/* ---- Help ---- */
.help-icon { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: #e2e5ea; color: #4b5160; text-align: center; font-size: 11px; line-height: 16px; cursor: help; margin-left: 4px; }
.legend { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 12.5px; margin-bottom: 16px; }

/* ---- Upload ---- */
.upload-slot { border: 2px dashed var(--border); border-radius: 10px; padding: 18px; text-align: center; background: #fff; margin-bottom: 10px; }
.upload-slot .label { font-weight: 700; font-size: 13.5px; }
.upload-slot .sub { font-size: 12px; color: #8a8f99; margin-top: 4px; }

/* ---- Review screen ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-bottom: 10px; }
.grid-2 label, label { display: block; font-size: 12.5px; color: #4b5160; font-weight: 600; margin-bottom: 10px; }
.grid-2 input, label input, label textarea, label select { display: block; width: 100%; margin-top: 3px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; box-sizing: border-box; }
#items-table input { padding: 4px 6px; border: 1px solid var(--border); border-radius: 5px; font-size: 12.5px; }
.new-row td { background: #fafbfc; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }
