/* Emoco Cloud 기본 스타일. 모바일 폭(360px)부터 깨지지 않게 한다. */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #1f1d1a;
  --muted: #6b655c;
  --line: #e4dfd5;
  --accent: #8b5a2b;
  --accent-ink: #ffffff;
  --notice-bg: #fff6e5;
  --notice-line: #f0d9a8;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.menu { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.menu a { padding: 6px 10px; border-radius: 6px; color: var(--ink); }
.menu a.active, .menu a:hover { background: var(--bg); text-decoration: none; }
.account { margin-left: auto; }
main { padding: 24px 16px 40px; }
.hero h1 { margin: 0 0 8px; font-size: 1.8rem; }
.muted { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 24px; }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; color: var(--ink); }
.card h2 { margin: 0 0 4px; font-size: 1.05rem; }
.card:hover { border-color: var(--accent); text-decoration: none; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.panel.narrow { max-width: 480px; }
.panel h1 { margin-top: 0; font-size: 1.4rem; }
.notice { background: var(--notice-bg); border: 1px solid var(--notice-line); border-radius: 8px; padding: 10px 12px; }
.foot { padding: 16px; color: var(--muted); font-size: 0.85rem; display: flex; gap: 8px; }
button, .btn {
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px;
  padding: 8px 14px; font-size: 1rem; cursor: pointer;
}
input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 1rem; background: #fff;
}
label { display: block; margin: 12px 0 4px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
@media (max-width: 600px) {
  .topbar .wrap { gap: 8px; }
  .menu a { padding: 6px 8px; font-size: 0.95rem; }
  .panel { padding: 16px; }
}

/* 폼·표·알림 (1단계) */
.small { font-size: 0.85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.form-error { color: #b42318; background: #fdecea; border: 1px solid #f5c2c0; border-radius: 6px; padding: 8px 10px; margin-top: 12px; }
button.link { background: none; color: var(--accent); padding: 0; font-size: inherit; }
button.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
button.small { padding: 4px 10px; font-size: 0.9rem; margin: 2px 2px 2px 0; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.check { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-weight: 400; white-space: nowrap; }
.inline-form { margin-bottom: 12px; }
th.perm, td.perm { text-align: center; font-size: 0.8rem; white-space: normal; max-width: 72px; }
td.actions { white-space: nowrap; }
tr.suspended td { color: var(--muted); }
.panel + .panel { margin-top: 16px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; opacity: 0; transition: all .25s; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
input[type=checkbox] { width: auto; }

/* 재고 화면 (3단계) */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.page-head .actions { display: flex; gap: 6px; flex-wrap: wrap; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 20px; max-width: 560px; width: calc(100% - 32px); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog h2 { margin-top: 0; font-size: 1.2rem; }
dialog .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
dialog .buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.78rem; background: var(--bg); border: 1px solid var(--line); }
.badge.warn { background: var(--notice-bg); border-color: var(--notice-line); }
.badge.bad { background: #fdecea; border-color: #f5c2c0; color: #b42318; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 16px; }
.info-grid dt { color: var(--muted); font-size: 0.85rem; }
.info-grid dd { margin: 0 0 6px; }
.ingredients .row { grid-template-columns: 2fr 1fr 2fr auto; align-items: end; }
a.row-link { color: var(--ink); font-weight: 600; }

/* 프로파일 분석 (5단계) */
.dropzone { border: 2px dashed var(--line); border-radius: 10px; padding: 10px 14px; color: var(--muted); font-size: 0.9rem; }
.dropzone.over { border-color: var(--accent); background: var(--notice-bg); }
.link-label { color: var(--accent); cursor: pointer; text-decoration: underline; }
.trend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.trend-grid h3 { margin: 0 0 4px; font-size: 0.95rem; }
#overlay-chart { margin-top: 12px; }
.dev-table td.pos { color: #b42318; } .dev-table td.neg { color: #1d6fa5; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
