:root {
  --paper: #f6f4ef;
  --paper-2: #ece9e1;
  --ink: #1c1c1a;
  --ink-2: #55534d;
  --ink-3: #8a877f;
  --rule: #d6d2c7;
  --accent: #1f4e46;
  --accent-ink: #ffffff;
  --mark: #f1e3a6;
  --radius: 3px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "tnum";
}
a { color: var(--accent); }
[hidden] { display: none !important; }

/* 상단 */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px 16px;
  border-bottom: 2px solid var(--ink);
}
.topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.topbar p { margin: 2px 0 0; color: var(--ink-2); font-size: 13px; }
.topbar__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.file-meta { color: var(--ink-2); font-size: 12px; margin-right: 4px; }

/* 버튼 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--paper-2); }
.btn:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); }
.btn--ghost { border-color: var(--rule); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .4; cursor: default; }

/* 시작 화면 */
.intro { max-width: 880px; margin: 48px auto; padding: 0 28px; }
.dropzone {
  border: 1.5px dashed var(--ink-3);
  border-radius: var(--radius);
  padding: 56px 24px;
  text-align: center;
  background: #fbfaf7;
  transition: background .15s, border-color .15s;
}
.dropzone.is-over { background: #eef3f1; border-color: var(--accent); }
.dropzone__main { margin: 0; font-size: 17px; font-weight: 700; }
.dropzone__sub { margin: 6px 0 0; color: var(--ink-2); font-size: 13px; }
.guide {
  list-style: none;
  counter-reset: g;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ink);
}
.guide li {
  counter-increment: g;
  padding: 14px 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.guide li::before {
  content: "0" counter(g);
  font-weight: 800;
  color: var(--accent);
  font-size: 12px;
}
.guide strong { font-size: 14px; }
.guide span { color: var(--ink-2); font-size: 13px; }

/* 로딩 */
.center { max-width: 480px; margin: 96px auto; padding: 0 28px; text-align: center; }
.center h2 { font-size: 18px; margin: 0 0 8px; }
.center p { color: var(--ink-2); }
code { font-size: 12px; background: var(--paper-2); padding: 1px 5px; border-radius: 2px; }
.progress { height: 4px; background: var(--rule); margin-top: 12px; overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: var(--accent); transition: width .1s; }

/* 작업 화면 */
.workspace {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 80px);
}
.panel {
  border-right: 1px solid var(--rule);
  padding: 18px 20px 28px;
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
}
.panel__group { border: 0; margin: 0 0 18px; padding: 0; }
.panel__group legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--ink-3);
}
.field { display: block; margin-bottom: 8px; }
.field > span { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 3px; }
select, input[type="search"], input[type="email"], input[type="password"], input[type="date"], input[type="text"], textarea {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
textarea { height: auto; padding: 8px; resize: vertical; line-height: 1.5; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; }

.results { padding: 18px 28px 48px; min-width: 0; }
.results__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
}
.results__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: flex; gap: 28px; margin: 0; }
.stats div { display: flex; flex-direction: column; }
.stats dt { font-size: 11px; color: var(--ink-3); font-weight: 700; letter-spacing: .04em; }
.stats dd { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }

/* 묶음 */
.groups { margin-top: 4px; }
.group { border-bottom: 1px solid var(--rule); }
.group > summary {
  list-style: none;
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px 4px;
  cursor: pointer;
}
.group > summary::-webkit-details-marker { display: none; }
.group > summary::before {
  content: "";
  width: 7px; height: 7px;
  border-right: 1.5px solid var(--ink-2);
  border-bottom: 1.5px solid var(--ink-2);
  transform: rotate(-45deg);
  transition: transform .15s;
  justify-self: center;
}
.group[open] > summary::before { transform: rotate(45deg); }
.group > summary:hover { background: var(--paper-2); }
.group__title { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.group__region { font-weight: 700; }
.group__sep { color: var(--ink-3); }
.group__cat { color: var(--ink-2); }
.group__count { font-weight: 800; font-size: 15px; }
.group__count small { font-weight: 500; color: var(--ink-3); font-size: 12px; margin-left: 2px; }
.group__body { padding: 0 0 14px 30px; overflow-x: auto; }

table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th {
  text-align: left;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 700;
  padding: 6px 8px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
table.list td { padding: 7px 8px; border-bottom: 1px solid #e7e3d9; vertical-align: top; }
table.list td.name { font-weight: 600; min-width: 140px; }
table.list td.cat { color: var(--ink-2); white-space: nowrap; }
table.list td.addr { color: var(--ink-2); min-width: 220px; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover, table.list tbody tr:focus-visible { background: #fbfaf7; outline: none; }
table.list td.st { white-space: nowrap; }
.branch { color: var(--ink-2); font-weight: 500; }
.closed { font-size: 11px; color: #9a3b2f; margin-left: 6px; font-weight: 600; }
.memo-line { font-weight: 400; font-size: 12px; color: var(--ink-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.lc { font-size: 11px; color: var(--ink-3); margin-left: 6px; }
.group__count em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--accent); margin-right: 10px; }

/* 진행 상태 */
.status { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 2px; border: 1px solid currentColor; }
.s-0 { color: var(--ink-3); }
.s-1 { color: #7a5a12; }
.s-2 { color: #1f4e46; }
.s-3 { color: #24467a; }
.s-4 { color: #fff; background: #1f4e46; border-color: #1f4e46; }
.s-5 { color: #8a6d5a; }
.s-6 { color: #9a3b2f; }
mark { background: var(--mark); color: inherit; padding: 0 1px; }

.more { margin: 10px 0 0; }
.empty { padding: 48px 0; text-align: center; color: var(--ink-2); }
.notice { margin: 12px 0 0; font-size: 12px; color: var(--ink-3); }

/* 열 지정 대화상자 */
.dialog {
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 22px 24px;
  width: min(520px, calc(100vw - 32px));
  background: var(--paper);
  color: var(--ink);
}
.dialog--wide { width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
.icon-btn { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--ink-2); padding: 0 4px; }
.icon-btn--sm { font-size: 18px; color: var(--ink-3); }
.icon-btn:hover { color: var(--ink); }
.biz__head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--ink); }
.biz__head h2 { margin: 0; font-size: 20px; }
.biz__meta { margin: 4px 0 0; font-size: 12px; color: var(--ink-2); }
.biz__addr { margin: 2px 0 0; font-size: 13px; }
.biz__links { margin: 8px 0 0; display: flex; gap: 14px; font-size: 12px; font-weight: 600; }
.biz__section { padding: 16px 0 4px; }
.biz__section + .biz__section { border-top: 1px solid var(--rule); }
.biz__section h3 { margin: 0 0 10px; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--ink-3); }
.status-set { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.status-opt { font: inherit; font-size: 13px; font-weight: 600; padding: 5px 11px; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; color: var(--ink-2); cursor: pointer; }
.status-opt[aria-checked="true"] { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.status-opt.s-0[aria-checked="true"] { color: var(--ink); }
.status-opt.s-4 { background: #fff; color: var(--ink-2); border-color: var(--rule); }
.status-opt.s-4[aria-checked="true"] { background: #1f4e46; color: #fff; border-color: #1f4e46; }
.biz__save { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.save-state { font-size: 12px; color: var(--ink-3); }
.log-form { display: grid; grid-template-columns: 140px 110px 1fr auto; gap: 6px; }
.logs { list-style: none; margin: 12px 0 0; padding: 0; }
.logs li { display: grid; grid-template-columns: 92px 70px 1fr auto; gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid #e7e3d9; font-size: 13px; }
.logs__date { font-weight: 600; }
.logs__method { color: var(--ink-2); font-size: 12px; }
.logs__content { white-space: pre-wrap; word-break: break-word; }
.logs .logs__empty { display: block; color: var(--ink-3); font-size: 13px; }
.import-summary dl { margin: 0 0 12px; border-top: 1px solid var(--rule); }
.import-summary dl div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.import-summary dt { color: var(--ink-2); }
.import-summary dd { margin: 0; font-weight: 700; text-align: right; }
.dialog::backdrop { background: rgba(28,28,26,.45); }
.dialog h2 { margin: 0 0 6px; font-size: 18px; }
.dialog__desc { margin: 0 0 16px; color: var(--ink-2); font-size: 13px; }
.map-fields { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; align-items: center; }
.map-fields label { font-size: 13px; font-weight: 600; }
.map-fields label.req::after { content: " *"; color: #9a3b2f; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* 모바일 */
@media (max-width: 860px) {
  .topbar { padding: 16px; align-items: flex-start; flex-direction: column; }
  .topbar__actions { justify-content: flex-start; }
  .intro { margin: 24px auto; padding: 0 16px; }
  .guide { grid-template-columns: 1fr; }
  .guide li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .workspace { grid-template-columns: 1fr; }
  .panel {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
  }
  .panel__group { margin-bottom: 12px; }
  .panel .btn--block { grid-column: 1 / -1; }
  .results { padding: 16px; }
  .stats { gap: 20px; }
  .stats dd { font-size: 20px; }
  .group__body { padding-left: 0; }
}
@media (max-width: 600px) {
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; }
  table.list tr { padding: 9px 0; border-bottom: 1px solid #e7e3d9; }
  table.list td { padding: 0; border: 0; min-width: 0 !important; }
  table.list td.name { font-size: 14px; }
  table.list td.cat { font-size: 12px; margin-top: 1px; }
  table.list td.addr { font-size: 12px; }
  table.list td.st { margin-top: 4px; }
  .log-form { grid-template-columns: 1fr 1fr; }
  .log-form input[type="text"] { grid-column: 1 / -1; }
  .log-form .btn { grid-column: 1 / -1; }
  .logs li { grid-template-columns: 84px 1fr auto; }
  .logs__method { grid-column: 2; grid-row: 1; }
  .logs__content { grid-column: 1 / 3; }
  .logs li .icon-btn { grid-column: 3; grid-row: 1; }
}
@media (max-width: 480px) {
  .panel { grid-template-columns: 1fr; }
  .results__actions { width: 100%; }
  .results__actions .btn { flex: 1 1 auto; }
}

/* =====================================================================
   로그인 화면 — 더행 ERP 로그인 디자인 (erp.css 로그인 영역과 동일한 값)
   ===================================================================== */
.auth {
  --e-ink: #17263a;
  --e-ink-2: #3b4a5e;
  --e-muted: #6a788b;
  --e-line-strong: #c6d0db;
  --e-bg: #f4f6f9;
  --e-navy: #10243a;
  --e-navy-2: #1b3550;
  --e-navy-text: #b8c6d6;
  --e-accent: #1f5f99;
  --e-err: #b42318;
  --e-err-bg: #fdecea;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 5fr) 7fr;
  background: var(--e-bg);
  color: var(--e-ink);
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: normal;
  word-break: keep-all;
}
.auth h1, .auth h2 { line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
.auth-intro {
  background: var(--e-navy); color: #fff; padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-mark { margin: 0; font-weight: 800; letter-spacing: .22em; font-size: 13px; color: var(--e-navy-text); }
.auth-intro h1 { font-size: clamp(30px, 3.4vw, 44px); font-weight: 700; margin-bottom: 18px; }
.auth-intro p { color: var(--e-navy-text); margin: 0; }
.auth-copy { font-size: 12px; }
.auth-panel { display: grid; place-items: center; padding: 48px 24px; }
.auth-form { width: min(380px, 100%); }
.auth-form h2 { font-size: 26px; margin-bottom: 6px; }
.auth-help { color: var(--e-muted); margin: 0 0 24px; font-size: 14px; }
.auth-help code { background: #e8eef4; color: var(--e-ink-2); }
.auth-foot { margin: 18px 0 0; color: var(--e-muted); font-size: 13px; text-align: center; }
.auth-notice { margin: 0 0 16px; padding: 11px 14px; border-radius: 8px; font-size: 14px; }
.auth-notice--error { background: var(--e-err-bg); color: var(--e-err); }
.auth-field { display: grid; gap: 6px; margin-bottom: 16px; }
.auth-field > span { font-size: 13px; font-weight: 600; color: var(--e-ink-2); }
.auth-field input {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--e-line-strong); border-radius: 8px;
  background: #fff; color: var(--e-ink); font: inherit; font-size: 16px; /* iOS 확대 방지 */
}
.auth-field input:focus { border-color: var(--e-accent); outline: none; box-shadow: 0 0 0 3px rgba(31, 95, 153, .15); }
.auth-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 0 16px;
  border: 1px solid var(--e-line-strong); border-radius: 8px; background: #fff; color: var(--e-ink);
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
}
.auth-btn:hover { border-color: var(--e-ink-2); }
.auth-btn:disabled { opacity: .55; cursor: default; }
.auth-btn:focus-visible { outline: 2px solid var(--e-accent); outline-offset: 2px; }
.auth-btn--primary { background: var(--e-navy); border-color: var(--e-navy); color: #fff; }
.auth-btn--primary:hover { background: var(--e-navy-2); border-color: var(--e-navy-2); }

@media (max-width: 760px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-intro { padding: 28px 20px 24px; gap: 18px; }
  .auth-intro h1 { font-size: 26px; margin-bottom: 8px; }
  .auth-intro br { display: none; }
  .auth-copy { display: none; }
  .auth-panel { place-items: start center; padding: 28px 16px 40px; }
}
