/* 기업 분석 — 남색 기준. ① SCM 프로그램(녹색)과 한눈에 구분되게 */
:root {
  --ink: #1c2733; --paper: #f5f6f4; --surface: #ffffff; --line: #dfe3e6; --line2: #eceff1;
  --muted: #5b6773; --faint: #8a949e; --accent: #24507a; --accent-2: #173a5c; --side: #17222d;
  --warm: #c8672b; --warm-bg: #fdf0e3; --warm-ink: #8a4a12; --bad: #b3261e; --bad-bg: #fbe4e2;
  --good: #1f6f5c; --good-bg: #e3f0ec; --info-bg: #e7eef6; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.55;
  font-family: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }
a { color: var(--accent); }
a:hover { color: var(--accent-2); }
.num, .tnum { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: #d7dde3; padding: 28px 0; display: flex; flex-direction: column; }
.side .brand { padding: 0 24px 22px; border-bottom: 1px solid #2a3642; margin-bottom: 14px; }
.side .brand b { display: block; font-size: 18px; color: #fff; }
.side .brand span { font-size: 12px; color: #93a0ad; }
.side nav a { display: flex; justify-content: space-between; align-items: center; padding: 10px 24px;
  color: #d7dde3; text-decoration: none; font-size: 14px; border-left: 3px solid transparent; }
.side nav a:hover { background: #1f2c38; }
.side nav a.on { background: #22303d; color: #fff; font-weight: 600; border-left-color: #6d9ccc; }
.side nav .group { font-size: 11px; color: #7d8a97; padding: 18px 24px 6px; letter-spacing: .04em; }
.side .badge { background: var(--warm); color: #fff; font-size: 12px; font-weight: 700; border-radius: 10px; padding: 0 8px; }
.side .me { margin-top: auto; padding: 16px 24px 0; border-top: 1px solid #2a3642; font-size: 13px; color: #93a0ad; }
.side .me a { color: #b8c3ce; margin-right: 10px; }

main { padding: 30px 40px 48px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
h1 { margin: 0; font-size: 26px; font-weight: 700; }
h2 { margin: 0; font-size: 16px; font-weight: 700; }
.sub { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.crumb { font-size: 13px; color: var(--muted); }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xs { font-size: 12px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.card.accent { border-top: 3px solid var(--accent); }
.card.warm { background: #fffaf3; border-color: #f0d9bf; }
.card h2 { margin-bottom: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.split { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.btn, button.btn { font: inherit; font-size: 14px; padding: 10px 16px; border: 1px solid #c9d0d6; background: #fff;
  color: var(--ink); border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.btn-go, .btn-go { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.btn-go:hover, .btn-go:hover { background: var(--accent-2); color: #fff; }
.btn-plain { font: inherit; font-size: 13px; padding: 5px 10px; border: 1px solid var(--line); background: #fff; border-radius: 5px;
  cursor: pointer; color: var(--ink); }
.btn-plain:hover { border-color: var(--accent); }
.inline { display: inline; margin: 0; }
.chip { font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid #c9d0d6; background: #fff;
  color: var(--ink); text-decoration: none; cursor: pointer; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=search], input[type=password], select {
  font: inherit; font-size: 15px; padding: 10px 14px; border: 1px solid #c9d0d6; border-radius: 6px; color: var(--ink); background: #fff; }
input:focus, select:focus { outline: 2px solid #9fbbd6; outline-offset: 0; border-color: var(--accent); }

.flash { background: var(--info-bg); border: 1px solid #c9d8e8; color: var(--accent-2); border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.notice { background: var(--warm-bg); border: 1px solid #f0d9bf; color: var(--warm-ink); border-radius: 8px; padding: 12px 16px; font-size: 14px; }
.notice a { color: var(--warm-ink); font-weight: 600; }

/* 검색 자동완성 */
.search-box { position: relative; flex-grow: 1; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(23, 34, 45, .12); z-index: 20; max-height: 380px; overflow: auto; }
.suggest button { display: flex; width: 100%; justify-content: space-between; gap: 12px; padding: 9px 14px; border: 0;
  background: #fff; font: inherit; font-size: 14px; text-align: left; cursor: pointer; color: var(--ink); border-bottom: 1px solid var(--line2); }
.suggest button:hover, .suggest button:focus { background: #f2f6fa; outline: none; }
.suggest .meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.suggest .empty { padding: 12px 14px; color: var(--muted); font-size: 13px; }

/* 수치 카드 */
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 15px; color: var(--muted); font-weight: 500; }
.stat .foot { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 16px; align-content: start; }
.kv .k { font-size: 13px; color: var(--muted); }
.kv .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kv .v small { font-size: 14px; color: var(--muted); font-weight: 500; }
.kv .f { font-size: 12px; color: var(--muted); }

/* 표 */
.table-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-card .card-head { padding: 14px 20px; border-bottom: 1px solid var(--line); margin: 0; }
.table-wrap { overflow-x: auto; }
table.cmp { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.cmp th { background: #f7f8f7; color: var(--muted); font-size: 13px; font-weight: 600; padding: 10px 8px; text-align: right; white-space: nowrap; }
table.cmp td { padding: 10px 8px; text-align: right; border-top: 1px solid var(--line2); white-space: nowrap; }
table.cmp th:first-child, table.cmp td:first-child { text-align: left; padding-left: 20px; }
table.cmp th.l, table.cmp td.l { text-align: left; }
table.cmp td.sig { text-align: left; padding-right: 20px; white-space: normal; }
table.cmp tr.me td { background: #f2f6fa; }
table.cmp tr.median td { border-top: 2px solid #c9d0d6; background: #f7f8f7; font-weight: 600; }
table.cmp td.bad, .bad-t { color: var(--bad); font-weight: 600; }
table.cmp td.hi, .hi-t { color: #a8461b; font-weight: 600; }
table.cmp a { font-weight: 600; }
table.kvt { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.kvt td { padding: 9px 0; border-bottom: 1px solid var(--line2); }
table.kvt tr:last-child td { border-bottom: 0; }
table.kvt td.r { text-align: right; font-weight: 600; }
table.kvt td.n { text-align: right; font-size: 12px; color: var(--muted); width: 110px; }

.tag { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 4px; padding: 2px 8px; white-space: nowrap; margin: 1px 2px 1px 0; }
.tag.warn { background: var(--warm-bg); color: var(--warm-ink); }
.tag.risk { background: var(--bad-bg); color: #8f1f18; }
.tag.info { background: var(--info-bg); color: var(--accent); }
.tag.good { background: var(--good-bg); color: #17594a; }
.tag.plain { border: 1px solid #c9d0d6; color: var(--muted); font-weight: 600; }

/* 운전자본 막대 */
.ccc { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; font-size: 13px; font-variant-numeric: tabular-nums; }
.ccc .r { display: flex; align-items: center; gap: 12px; }
.ccc .lab { width: 120px; color: var(--muted); flex: none; }
.ccc .bar { height: 22px; border-radius: 3px; flex: none; }
.ccc .b-dio { background: var(--warm); }
.ccc .b-dso { background: #7f98b2; }
.ccc .b-dpo { background: #fff; border: 2px dashed #7f98b2; }
.ccc .b-ccc { background: var(--ink); }
.ccc .tot { border-top: 1px solid var(--line); padding-top: 10px; }
.mix { display: flex; height: 12px; border-radius: 3px; overflow: hidden; margin: 8px 0 6px; background: var(--line2); }

/* 업종 내 위치 */
.pos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 48px; margin-top: 8px; font-size: 13px; }
.pos .r { display: flex; align-items: center; gap: 12px; }
.pos .lab { width: 96px; color: var(--muted); }
.pos .track { flex-grow: 1; height: 6px; background: var(--line2); border-radius: 3px; position: relative; }
.pos .dot { position: absolute; top: -5px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--accent); }
.pos .dot.low { background: var(--warm); }
.pos .rk { width: 64px; text-align: right; font-weight: 600; }

/* 비상장 확인 */
.src { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.src td { padding: 4px 6px; border-bottom: 1px solid var(--line2); }
.src td.v { text-align: right; font-family: "IBM Plex Mono", ui-monospace, monospace; white-space: nowrap; }
.src tr.hit td { background: var(--info-bg); }
.src tr.hit-check td { background: var(--warm-bg); }
.fields { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.fields th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.fields td { padding: 6px 4px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.fields td.acct { min-width: 128px; }
.fields input { width: 150px; text-align: right; font-size: 14px; padding: 5px 8px; }
.fields tr.check td { background: #fffaf3; }
.fields tr.check input { border: 2px solid var(--warm); }
.fields tr.missing td { color: var(--faint); }
.fields .st { font-size: 12px; line-height: 1.4; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.tabs button { font: inherit; font-size: 13px; padding: 6px 12px; border: 0; background: none; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

.job { font-size: 13px; }
.progress { height: 6px; background: var(--line2); border-radius: 3px; overflow: hidden; width: 160px; display: inline-block; vertical-align: middle; }
.progress i { display: block; height: 100%; background: var(--accent); }
.timing { font-size: 12px; color: var(--faint); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login form { width: 100%; max-width: 360px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.login label { display: block; font-size: 13px; color: var(--muted); margin: 16px 0 4px; }
.login input { width: 100%; }
.login button { width: 100%; margin-top: 20px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { padding: 14px 0; }
  .side nav { display: flex; flex-wrap: wrap; }
  .side .me { display: none; }
  main { padding: 20px 16px 40px; }
  .grid-2, .grid-3, .grid-4, .split, .pos { grid-template-columns: 1fr; }
  .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
