@font-face {
  font-family: "Pretendard Variable";
  font-style: normal;
  font-weight: 45 920;
  font-display: swap;
  src: url("/fonts/PretendardVariable.woff2") format("woff2");
}
:root {
  color-scheme: light;
  --ink: #253041;
  --muted: #617082;
  --line: #e1e7ed;
  --green: #236449;
  --warn: #98632a;
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: #f6f8fa;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.6px;
}
h2 {
  font-size: 17px;
  font-weight: 600;
}
a {
  color: var(--green);
  text-underline-offset: 3px;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  min-height: 34px;
  border: 1px solid #d6dfe5;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
button:hover,
.button:hover {
  background: #edf4ee;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary,
.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
input,
select,
textarea {
  border: 1px solid #d6dfe5;
  border-radius: 5px;
  padding: 7px 9px;
  min-height: 34px;
  background: #fff;
  max-width: 100%;
}
input[type="checkbox"] {
  min-height: auto;
  accent-color: var(--green);
}
:focus-visible {
  outline: 3px solid #337ca7;
  outline-offset: 2px;
}
header {
  padding: 18px 30px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.logo {
  font:
    600 25px Georgia,
    serif;
  text-decoration: none;
  color: var(--ink);
}
.logo small {
  font:
    12px Arial,
    sans-serif;
  color: var(--muted);
  margin-left: 18px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.actions.end {
  justify-content: flex-end;
  margin-top: 18px;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.eyebrow {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
main {
  max-width: 1560px;
  margin: auto;
  padding: 26px 30px;
}
.heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
nav {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
nav a {
  padding: 0 2px 13px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
nav a[aria-current="page"] {
  color: var(--green);
  border-color: var(--green);
  font-weight: 600;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.metric {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px 18px;
}
.metric p {
  font-size: 12px;
  color: var(--muted);
}
.metric strong {
  display: block;
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 8px;
  letter-spacing: -0.4px;
}
.metric small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  min-width: 0;
}
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
}
.toolbar h2 {
  margin-right: auto;
}
.toolbar input[type="search"] {
  width: 220px;
}
.scroll {
  overflow: auto;
  max-width: 100%;
}
.scroll.tall {
  max-height: 430px;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
td,
th {
  text-align: left;
  padding: 7px 10px;
  height: 34px;
  border-top: 1px solid var(--line);
}
thead th {
  font-weight: 500;
  color: var(--muted);
  background: #f2f5f8;
  position: sticky;
  top: 0;
  z-index: 1;
}
td:first-child,
th:first-child {
  padding-left: 16px;
}
tbody tr:hover {
  background: #f8faf7;
}
.number {
  text-align: right;
}
.name {
  font-weight: 550;
}
.state {
  border: 0;
  background: none;
  padding: 0;
  min-height: 20px;
  font-size: 12px;
  justify-content: flex-start;
}
.good {
  color: var(--green);
}
.unknown {
  color: var(--muted);
}
.date {
  font-size: 11px;
  color: var(--muted);
  margin-left: 5px;
}
.link {
  padding: 0;
  border: 0;
  min-height: 20px;
  font-size: 12px;
  text-decoration: underline;
  color: var(--green);
  background: none;
  text-underline-offset: 3px;
}
.note {
  font-size: 11px;
  color: var(--muted);
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  line-height: 1.6;
}
.pad {
  padding: 17px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}
.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.field {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.wide {
  grid-column: 1/-1;
}
.field small {
  color: var(--muted);
  line-height: 1.5;
}
.checks {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
}
.checks label {
  display: flex;
  gap: 6px;
  align-items: center;
}
.success,
.warning,
.alert {
  padding: 11px 14px;
  border-radius: 5px;
  line-height: 1.6;
  font-size: 12px;
  margin-bottom: 15px;
}
.success {
  background: #eaf5ed;
  color: var(--green);
}
.warning {
  background: #fbf2e6;
  color: #84571e;
}
.alert {
  background: #fbeceb;
  color: #962f29;
}
#notice:empty {
  display: none;
}
.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}
details {
  margin: 10px 0;
}
summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  padding: 7px 0;
}
.details {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr);
  gap: 11px;
  margin: 18px 0;
  font-size: 13px;
}
.details dt {
  color: var(--muted);
}
.details dd {
  margin: 0;
}
.file-name {
  max-width: 470px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill {
  font-size: 11px;
  border-radius: 4px;
  background: #fbf2e6;
  color: var(--warn);
  padding: 3px 6px;
}
.controls {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.raw {
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  margin: 12px 0;
}
.raw td {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.raw pre {
  font-size: 11px;
  white-space: pre-wrap;
  margin: 0;
  padding: 12px;
}
.edit td {
  padding: 2px 5px;
  height: 32px;
}
.edit input {
  font-size: 12px;
  min-height: 28px;
  min-width: 100px;
  width: 100%;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
}
.edit td.name input {
  min-width: 310px;
}
.edit input:hover,
.edit input:focus {
  border-color: #aac3b2;
  background: #fff;
}
.drop {
  border: 1px dashed #aabdad;
  border-radius: 7px;
  background: #f8faf7;
  padding: 20px;
}
dialog {
  width: min(660px, calc(100% - 32px));
  max-height: 90vh;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 18px 60px #14281b2b;
}
dialog::backdrop {
  background: #18291e60;
}
dialog h2 {
  margin-bottom: 19px;
}
footer {
  font-size: 11px;
  color: #7b887f;
  padding: 5px 0;
}
[hidden] {
  display: none !important;
}
@media (max-width: 950px) {
  header {
    padding: 14px 18px;
    align-items: flex-start;
  }
  header .actions {
    justify-content: flex-end;
  }
  .logo small {
    display: none;
  }
  main {
    padding: 20px 18px;
  }
  .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .heading > p {
    text-align: right;
    max-width: 230px;
  }
}
@media (max-width: 600px) {
  h1 {
    font-size: 23px;
  }
  .metric strong {
    font-size: 22px;
  }
  .metrics {
    gap: 9px;
  }
  .metric {
    padding: 12px;
  }
  .grid,
  .grid.four,
  .controls {
    grid-template-columns: minmax(0, 1fr);
  }
  .heading {
    display: block;
  }
  .heading > p {
    text-align: left;
    max-width: none;
    margin-top: 10px;
  }
  nav {
    gap: 22px;
  }
  .toolbar input[type="search"] {
    width: 100%;
  }
  button,
  input,
  select {
    min-height: 38px;
  }
  .details {
    grid-template-columns: 100px minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 721px) and (max-width: 950px) {
  .metric strong {
    font-size: 21px;
  }
  .metric {
    padding: 13px;
  }
}

.file-title {
  overflow-wrap: anywhere;
}
/* 공통 화면: 실제 회사 로고와 계정, 작은 화면에서도 유지되는 입력 폭. */
body {
  min-width: 0;
}
h1, h2, h3 {
  overflow-wrap: anywhere;
}
input, select, textarea {
  min-width: 0;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-family: inherit;
  flex-shrink: 0;
}
.logo img {
  display: block;
  width: 195px;
  height: auto;
}
.logo small {
  font: 500 12px "Pretendard Variable", Pretendard, sans-serif;
  margin: 0;
}
.header-actions {
  justify-content: flex-end;
  font-size: 12px;
}
#connection {
  overflow-wrap: anywhere;
  max-width: 260px;
}
.account-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.heading > div {
  min-width: 0;
}
nav {
  flex-wrap: wrap;
}
nav a {
  white-space: nowrap;
}
.metric {
  min-width: 0;
}
.metric strong {
  overflow-wrap: anywhere;
}
.money-metrics .metric strong {
  font-size: clamp(16px, 2vw, 26px);
}
.details dd {
  overflow-wrap: anywhere;
}
.details .state {
  flex-wrap: wrap;
  white-space: normal;
  text-align: start;
}
.details .date {
  white-space: nowrap;
}
.scroll {
  scrollbar-width: thin;
  scrollbar-color: #b6c3ce #f3f6f8;
}
.scroll:focus-visible {
  outline-offset: -3px;
}
.raw pre {
  font-family: inherit;
}
input[type="file"] {
  width: 100%;
}

/* 진행 요약: 일곱 지표를 작은 카드와 원형 그래프로 함께 표시. */
.progress-metrics {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.progress-metrics .metric {
  padding: 12px 13px 10px;
  border-radius: 9px;
}
.progress-metrics .metric p {
  color: #536173;
  font-size: 11px;
  font-weight: 550;
  line-height: 16px;
}
.metric-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}
.progress-metrics .metric strong {
  margin: 0;
  font-size: 25px;
  line-height: 30px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--ink);
}
.metric-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-inline-start: 3px;
  letter-spacing: 0;
}
.progress-metrics .metric small {
  font-size: 10px;
  line-height: 14px;
  margin-top: 5px;
}
.metric-chart {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: var(--metric-color);
}
.metric-chart circle {
  fill: none;
  stroke-width: 3;
}
.ring-track {
  stroke: #eaf0f4;
}
.ring-value {
  stroke: currentColor;
  stroke-linecap: round;
}
.brand-chart {
  fill: currentColor;
  width: 28px;
  height: 28px;
}
.brand-chart rect:nth-child(2), .brand-chart rect:nth-child(3) {
  opacity: 0.35;
}
.metric-brands {
  --metric-color: #5682b4;
}
.metric-po {
  --metric-color: #6473b8;
}
.metric-inbound_req {
  --metric-color: #bf9654;
}
.metric-inbound_actual {
  --metric-color: #4d9484;
}
.metric-pc {
  --metric-color: #8d72b6;
}
.metric-tax_invoice {
  --metric-color: #b77c8b;
}
.metric-shipment {
  --metric-color: #5b8eaa;
}

/* 공급사별로 같은 옅은 음영을 유지한다. 검색·필터는 색 기준을 바꾸지 않는다. */
.supplier-tone-0 {
  --supplier-bg: #f4f7fb;
  --supplier-edge: #bacde3;
}
.supplier-tone-1 {
  --supplier-bg: #f2f8f5;
  --supplier-edge: #b4d5c8;
}
.supplier-tone-2 {
  --supplier-bg: #f7f4fb;
  --supplier-edge: #cec0e3;
}
.supplier-tone-3 {
  --supplier-bg: #fcf8f0;
  --supplier-edge: #e3d0ae;
}
.supplier-tone-4 {
  --supplier-bg: #fcf4f5;
  --supplier-edge: #e1bec5;
}
.supplier-tone-5 {
  --supplier-bg: #f1f8fa;
  --supplier-edge: #b4d2da;
}
.progress-table tbody tr {
  background: var(--supplier-bg);
}
.progress-table tbody tr:hover {
  background: var(--supplier-bg);
}
.progress-table td:first-child {
  border-inline-start: 3px solid var(--supplier-edge);
}
.progress-table .supplier-start td {
  border-top: 2px solid #d9e2e9;
}
.progress-table th {
  height: 32px;
  padding-block: 6px;
}
.progress-table td {
  height: 38px;
  padding: 3px 10px;
  line-height: 16px;
  border-top-color: #e5eaf0;
}
.progress-table td:first-child {
  padding-inline-start: 13px;
}
.progress-table .name .link {
  color: #2b465a;
  font-weight: 600;
}
.progress-table .state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  padding: 0;
  min-height: 24px;
  line-height: 16px;
  border-radius: 3px;
}
.progress-table .date {
  display: block;
  margin: 0;
  font-size: 10px;
  line-height: 12px;
  color: #596b7d;
  font-weight: 400;
}
.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.payment-dates {
  display: flex;
  gap: 6px;
}
.progress-table .supplier-name {
  color: #536173;
  font-size: 11px;
}
.progress-table .unknown {
  color: var(--muted);
}

@media (max-width: 1150px) {
  .progress-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .progress-metrics {
    display: flex;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: #b6c3ce #f3f6f8;
  }
  .progress-metrics .metric {
    flex: 0 0 156px;
    scroll-snap-align: start;
  }
  .controls {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }
  .logo img {
    width: 175px;
  }
  header .header-actions {
    justify-content: flex-start;
    width: 100%;
    gap: 8px;
  }
  #connection {
    display: inline;
    flex: 1 1 auto;
    max-width: none;
  }
  main {
    padding: 18px 16px;
  }
  nav {
    gap: 10px 18px;
  }
  nav a {
    padding-bottom: 9px;
    font-size: 12px;
  }
  .progress-metrics .metric {
    padding: 10px 12px;
  }
  .progress-metrics .metric strong {
    font-size: 24px;
  }
  .progress-metrics .metric:last-child {
    grid-column: auto;
  }
  .progress-table .state, .progress-table .link {
    min-height: 24px;
  }
  .toolbar h2 {
    flex-basis: 100%;
  }
  #content > .toolbar h2 {
    flex-basis: auto;
  }
  dialog {
    padding: 18px;
  }
}
@media (max-width: 360px) {
  #connection {
    flex-basis: 100%;
  }
}

/* Hallmark Cobalt: 차가운 종이색, 코발트 강조, 키캡과 패널의 고정 깊이. */
:root {
  --paper: oklch(98.6% 0.005 250);
  --paper-2: oklch(96.2% 0.008 252);
  --ink: oklch(21% 0.028 262);
  --muted: oklch(50% 0.018 258);
  --line: oklch(90% 0.009 252);
  --green: oklch(52% 0.19 258);
  --key-edge: oklch(80% 0.016 254);
  background: var(--paper);
}
header { background: var(--paper); }
h1 { font-weight: 650; letter-spacing: -0.028em; }
nav {
  gap: 8px;
  padding: 7px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 1px 3px #1720330a;
}
nav a { padding: 8px 14px; border-bottom: 0; border-radius: 5px; }
nav a[aria-current="page"] {
  background: #fff;
  color: var(--green);
  box-shadow: 0 2px 0 var(--key-edge), inset 0 1px 0 #fff;
}
button, .button {
  border-color: var(--key-edge);
  background: oklch(99.4% 0.003 250);
  box-shadow: 0 2px 0 var(--key-edge), 0 4px 6px -4px #17203335, inset 0 1px 0 #fff;
}
button:hover, .button:hover { background: var(--paper-2); }
button.primary, .button.primary {
  background: var(--green);
  border-color: oklch(39% 0.16 260);
  box-shadow: 0 2px 0 oklch(39% 0.16 260), inset 0 1px 0 #ffffff38;
}
button.primary:hover, .button.primary:hover { background: oklch(48% 0.19 259); }
.state, .link { box-shadow: none; background: transparent; }
input, select, textarea { border-color: var(--key-edge); background: var(--paper); }
:focus-visible { outline-color: var(--green); }
.panel, .metric {
  border-color: var(--line);
  box-shadow: 0 1px 2px #1720330f;
}
.panel { border-radius: 8px; }
.progress-metrics .metric { border-radius: 8px; }
.toolbar { background: var(--paper); }
thead th { background: var(--paper-2); }
.progress-metrics .metric-po { --metric-color: var(--green); }
.progress-metrics .metric-brands { --metric-color: var(--green); }
.progress-metrics .metric strong { color: var(--ink); }
.success { background: oklch(95% 0.028 256); color: var(--green); }
.drop { background: var(--paper-2); border-color: var(--key-edge); }
dialog { border-radius: 8px; box-shadow: 0 18px 48px #17203330; }
dialog::backdrop { background: #17203366; }
@supports (corner-shape: bevel) {
  .panel, .progress-metrics .metric { border-radius: 12px 4px 12px 4px; corner-shape: bevel round bevel round; }
}
/* 자동 움직임과 hover 이동 효과를 사용하지 않는다. */
*, *::before, *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* 제목과 업체 구역, 확인이 필요한 상태를 각각 구분한다. */
.progress-table thead th {
  background: #e0e7f0;
  color: #273b55;
  border-bottom: 2px solid #9eafc5;
  font-weight: 650;
}
.state.good { color: #146b50; }
.state.needs-check { color: #986000; }
.state.unknown { color: #657185; }
.stage-details { width: 100%; min-width: 0; table-layout: fixed; }
.stage-details th, .stage-details td { padding: 7px 10px; }
.stage-details th:first-child { width: 43%; }
.stage-details th:last-child { width: 27%; }
.stage-details tbody th {
  text-align: left;
  font-weight: 450;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.stage-details .stage-date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: #536173;
  border-left: 1px solid var(--line);
}
.stage-details .state { text-align: left; white-space: normal; }
.stage-details thead th:last-child { border-left: 1px solid var(--line); }

/* 독립적으로 진행되는 구매·물류·증빙의 요약 */
.work-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.summary-group { --summary-color: var(--green); min-width: 0; padding: 13px 15px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 2px #1720330f; }
.summary-logistics { --summary-color: #277967; }
.summary-documents { --summary-color: #8060ac; }
.summary-group h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 9px; font-size: 13px; color: var(--summary-color); }
.summary-group h2 small { margin-left: auto; font-size: 10px; font-weight: 400; color: var(--muted); }
.summary-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 4px; margin-top: 9px; font-size: 11px; line-height: 16px; }
.summary-row strong { white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.summary-total { font-size: 11px; font-weight: 400; color: var(--muted); }
.summary-track { grid-column: 1 / -1; height: 4px; border-radius: 2px; overflow: hidden; background: #eaf0f4; }
.summary-track svg { display: block; width: 100%; height: 100%; }
.summary-track rect { fill: var(--summary-color); }
.summary-brand { display: flex; align-items: baseline; gap: 9px; padding: 5px 0; font-size: 11px; }
.summary-brand strong { margin-left: auto; font-size: 25px; line-height: 30px; }
.summary-brand small { font-size: 10px; font-weight: 400; color: var(--muted); }
.summary-brand strong small { margin-left: 3px; font-size: 12px; }
@media (max-width: 720px) {
  .work-summary { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 6px; }
  .summary-group { flex: 0 0 265px; }
}

/* 업무 목적별 다섯 구분 */
.work-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.summary-group { padding: 12px; }
.summary-group h2 { flex-wrap: wrap; gap: 3px 6px; }
.summary-group h2 small { font-size: 9px; }
.summary-customs { --summary-color: #ad7430; }
.summary-shipment { --summary-color: #397ca0; }
.summary-brand { flex-wrap: wrap; gap: 4px; }
.progress-table .workflow-groups th { text-align: center; border-inline-end: 1px solid #bdc9d9; padding-top: 7px; padding-bottom: 7px; }
.progress-table .workflow-groups th[rowspan] { text-align: left; }
.progress-table tbody td:nth-child(3), .progress-table tbody td:nth-child(5), .progress-table tbody td:nth-child(7), .progress-table tbody td:nth-child(9), .progress-table tbody td:nth-child(11) { border-inline-start: 1px solid #d0d9e4; }
.stage-details .stage-group th { width: auto; background: #e8edf5; color: #273b55; font-size: 11px; font-weight: 650; padding: 5px 10px; }
@media (max-width: 1100px) {
  .work-summary { display: flex; overflow-x: auto; padding-bottom: 6px; }
  .summary-group { flex: 0 0 220px; }
}

/* 카드 제목은 보조 문구와 별도로 카드 중앙에 정렬한다. */
.summary-group h2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  text-align: center;
  justify-items: center;
  gap: 3px;
  min-height: 31px;
  align-content: start;
}
.summary-group h2 small { margin-left: 0; }

.summary-group h2 { position: relative; display: block; min-height: 26px; padding-top: 10px; }
.summary-group h2 small { position: absolute; right: 0; top: -4px; line-height: 12px; }

/* 제목과 집계 기준을 같은 높이에 배치한다. */
.summary-group h2 { min-height: 16px; padding-top: 0; }
.summary-group h2 small { top: 0; line-height: 16px; font-size: 8px; }

/* 진행 표의 두 줄 열 제목을 모두 가운데 정렬한다. */
.progress-table thead th,
.progress-table .workflow-groups th[rowspan] {
  text-align: center;
  vertical-align: middle;
}

/* 상세 업무 구분을 왼쪽 병합 열로 표시한다. */
dialog:has(.stage-details) { width: min(760px, calc(100vw - 32px)); }
.stage-details .stage-category-col { width: 19%; }
.stage-details .stage-task-col { width: 36%; }
.stage-details .stage-status-col { width: 24%; }
.stage-details .stage-date-col { width: 21%; }
.stage-details th:first-child, .stage-details th:last-child { width: auto; }
.stage-details th, .stage-details td { padding: 5px 9px; line-height: 18px; border-bottom: 1px solid var(--line); }
.stage-details tr > * + * { border-left: 1px solid var(--line); }
.stage-details .stage-date, .stage-details thead th:last-child { border-left: 1px solid var(--line); }
.stage-details .stage-category { background: #e8edf5; color: #273b55; font-size: 11px; font-weight: 650; vertical-align: middle; text-align: center; }
.stage-details tbody + tbody tr:first-child > * { border-top: 2px solid #bdc9d9; }
.stage-details .state { min-height: 18px; line-height: 18px; }
@media (max-width: 600px) {
  .stage-details { min-width: 490px; }
}

/* 병합 구분 셀 다음 행에서도 업무 열의 왼쪽 경계를 이어 준다. */
.stage-details tbody th[scope="row"] { border-left: 1px solid var(--line); }
.stage-details .stage-category { border-right: 1px solid var(--line); }

.product-summary { display:flex; flex-wrap:wrap; gap:24px; padding:18px; border-bottom:1px solid var(--line); font-size:12px; }
.product-summary strong { display:block; margin-top:8px; font-size:20px; }
.product-table { min-width:1100px; }
.product-table th { text-align:center; }

.quantity-diff { background:#fff0d1; color:#895400; font-weight:600; }
.product-summary { gap:20px; }
.product-summary > div { flex:1; min-width:110px; }

.finance-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:12px 0; }
.finance-block { padding:15px 18px; border:1px solid var(--finance-edge); background:var(--finance-bg); border-radius:8px; }
.finance-order { --finance-bg:#eef3fc; --finance-edge:#c6d5ee; --finance-ink:#315c9a; }
.finance-supplier { --finance-bg:#edf7f3; --finance-edge:#bcdccc; --finance-ink:#206c52; }
.finance-buyer { --finance-bg:#f5f0fb; --finance-edge:#d8c8eb; --finance-ink:#77539b; }
.finance-block h2 { color:var(--finance-ink); font-size:14px; text-align:center; margin:0 0 12px; }
.finance-block dl { margin:0; }
.finance-block dl div { display:flex; justify-content:space-between; gap:12px; padding:6px 0; align-items:baseline; }
.finance-block dt { font-size:12px; }
.finance-block dd { margin:0; font-size:20px; font-weight:650; font-variant-numeric:tabular-nums; }
.finance-block small { display:block; color:var(--muted); font-size:10px; margin-top:8px; }
.finance-difference { border-top:1px solid var(--finance-edge); margin-top:4px; }
.finance-purchases tbody tr { background:var(--supplier-bg); }
.finance-purchases .finance-subtotal { font-weight:650; }
.finance-purchases .finance-subtotal td { border-top:1px solid var(--supplier-edge); border-bottom:2px solid var(--supplier-edge); }
.finance-purchases th { text-align:center; }
@media(max-width:800px) { .finance-summary { grid-template-columns:1fr; } }

/* 열 제목은 데이터 행의 공급사 음영과 확실히 구분한다. */
.progress-table thead th,
.finance-purchases thead th {
  background: #304b70;
  color: #fff;
  font-weight: 600;
  border-bottom: 1px solid #7189a7;
}
.progress-table .workflow-groups th {
  background: #243b5b;
  border-inline-end-color: #7189a7;
}
.progress-table thead tr:last-child th {
  border-bottom: 2px solid #1b304c;
}
.finance-purchases thead th {
  border-bottom: 2px solid #1b304c;
}

.supplier-cell { vertical-align: middle; font-weight: 600; border-inline-end:1px solid var(--supplier-edge); }
.progress-table td.name { border-inline-start:0; }
.progress-table td.supplier-cell { border-inline-start:3px solid var(--supplier-edge); }

/* rowspan이 있어도 모든 데이터 열의 경계를 일정하게 유지한다. */
.progress-table tbody td,
.progress-table tbody td:first-child,
.progress-table tbody td.name,
.progress-table tbody td:nth-child(3),
.progress-table tbody td:nth-child(5),
.progress-table tbody td:nth-child(7),
.progress-table tbody td:nth-child(9),
.progress-table tbody td:nth-child(11) {
  border-inline-start: 0;
  border-inline-end: 1px solid #d0d9e4;
}
.progress-table tbody td.supplier-cell {
  border-inline-start: 3px solid var(--supplier-edge);
  border-inline-end: 1px solid #b9c8db;
}
.progress-table tbody td:last-child { border-inline-end: 0; }

/* 공통 시각 기준: 카드·표·폼·상태 색상 */
:root {
  --ui-header: #304b70;
  --ui-header-group: #243b5b;
  --ui-rule: #d6dfeb;
  --ui-radius: 8px;
}
.panel, .summary-group, .finance-block {
  border-radius: var(--ui-radius);
  corner-shape: round;
  box-shadow: 0 1px 2px #1720330a;
}
.panel { background: #fff; }
.toolbar { background: #fff; padding: 14px 16px; }
.toolbar h2 { font-size: 14px; font-weight: 650; }
.summary-group, .finance-block { padding: 14px 16px; }
.summary-group h2, .finance-block h2 { font-size: 13px; font-weight: 650; }
button, .button, input, select, textarea { border-radius: 5px; }
#content table thead th {
  background: var(--ui-header);
  color: #fff;
  font-weight: 600;
  text-align: center;
  border-top: 0;
  border-bottom: 1px solid #7287a3;
  border-inline-end: 1px solid #7287a3;
}
#content table thead th:last-child { border-inline-end: 0; }
#content .progress-table .workflow-groups th { background: var(--ui-header-group); }
#content table tbody td,
#content table tbody th {
  border-top-color: var(--ui-rule);
  border-bottom-color: var(--ui-rule);
  border-inline-start: 0;
  border-inline-end: 1px solid var(--ui-rule);
}
#content table tbody td:last-child { border-inline-end: 0; }
#content table tbody .supplier-cell {
  border-inline-start: 3px solid var(--supplier-edge);
  border-inline-end: 1px solid #b9c8db;
}
#content .finance-purchases .finance-subtotal td {
  border-top: 1px solid var(--supplier-edge);
  border-bottom: 2px solid var(--supplier-edge);
}
#content table tbody tr:hover { background: #f5f7fb; }
#content .progress-table tbody tr:hover,
#content .finance-purchases tbody tr:hover { background: var(--supplier-bg); }
.note { color: #667489; font-size: 11px; line-height: 1.6; }
.stage-details thead th { background: var(--ui-header); color: #fff; font-weight: 600; text-align: center; }
.stage-details th, .stage-details td { border-color: var(--ui-rule); }
.stage-details .stage-category { background: #eaf0f8; color: #304b70; }
#content > .toolbar { background: transparent; padding: 10px 0; }

dialog:has(#revision-form) { width:min(1000px,calc(100vw - 32px)); }
#revision-lines input { width:100%; min-width:70px; }
#revision-lines td:nth-child(2) { min-width:220px; }
#revision-lines .scroll { max-height:350px; overflow:auto; }

.revision-status { display:block; font-size:10px; font-weight:450; line-height:14px; color:#986000; background:transparent; border:0; box-shadow:none; padding:0; min-height:0; margin-top:2px; text-align:left; white-space:normal; max-width:200px; }
.revision-status:hover { background:#fff0d1; }
.amount-revision-note { display:block; font-size:10px; line-height:14px; font-weight:400; color:var(--muted); margin-top:3px; }

.amount-original { font-size:11px; color:var(--muted); }
.amount-current { font-weight:600; margin-top:3px; }

.money-value { border:0; background:transparent; box-shadow:none; padding:0; min-height:20px; color:var(--ink); font-size:12px; font-weight:inherit; font-variant-numeric:tabular-nums; }
.money-value:hover { color:var(--green); background:transparent; text-decoration:underline; }
.money-status { display:block; color:#146b50; font-size:10px; line-height:14px; }
.money-status.pending { color:#986000; }
.money-history-link { display:block; margin-inline-start:auto; padding:0; border:0; background:transparent; box-shadow:none; min-height:16px; font-size:10px; color:var(--green); }
.amount-history-section { margin:16px 0; padding-bottom:16px; border-bottom:1px solid var(--line); }
.amount-history-section h3 { font-size:13px; }
#content td.history-key { font-size:12px; font-weight:700; color:var(--ink); background:var(--paper-3); }
#content td.history-key .unconfirmed { font-size:11px; font-weight:400; color:var(--muted); }
.stage-evidence { margin:12px 0 0; padding:10px 12px; background:var(--paper-3); font-size:12px; overflow-wrap:anywhere; }
.stage-evidence strong { display:block; margin-bottom:4px; }
dialog:has(.stage-details) { width: min(1000px, calc(100vw - 32px)); }
.stage-details .stage-category-col { width: 11%; }
.stage-details .stage-task-col { width: 19%; }
.stage-details .stage-status-col { width: 15%; }
.stage-details .stage-date-col { width: 55%; }
.stage-details .stage-date { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.stage-date a, .stage-evidence a { overflow-wrap:anywhere; }
.amount-sources { display:grid; gap:6px; margin:12px 0; font-size:12px; }
.amount-sources > div { display:grid; grid-template-columns:120px minmax(0,1fr); gap:8px; }
.amount-sources dt { color:var(--muted); }
.amount-sources dd { margin:0; overflow-wrap:anywhere; }
@media (max-width: 600px) { .amount-sources > div { grid-template-columns:1fr; gap:2px; } }

/* 선적 예정일과 실제일은 상세에서도 각각 한 줄로 표시한다. */
.stage-date .date { display:block; margin-left:0; white-space:nowrap; }

/* 업무 칸 구분 */
.state.todo { color: #1f5fbf; font-weight: 600; }
.state.in-progress { color: #6b4fbb; }
.state.waiting, .state.waiting span { color: #a4adba; }
a.state { display: inline-flex; flex-direction: column; text-decoration: none; }
/* 지금 할 일 */
.todo-panel { margin-bottom: 16px; }
.todo-panel .toolbar { justify-content: flex-start; gap: 12px; }
.todo-panel > .todo-summary { cursor: pointer; margin: 0; }
.todo-summary::-webkit-details-marker { display: none; }
.todo-summary .todo-expand, .todo-summary .todo-collapse { margin-left: auto; color: var(--muted); font-size: 13px; }
.todo-panel:not([open]) .todo-collapse, .todo-panel[open] .todo-expand { display: none; }
.todo-summary:focus-visible { outline: 2px solid #1f5fbf; outline-offset: -3px; }
.todo-hint { margin: 0; padding: 0 16px 12px; font-size: 12px; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); }
.todo-main { min-width: 0; }
.todo-main strong { font-size: 13px; font-weight: 600; }
.todo-detail { margin: 3px 0 0; font-size: 12px; }
.todo-brands { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.todo-side { display: flex; align-items: center; gap: 8px; flex: none; }
.todo-meta { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 2px 4px; min-height: 0; box-shadow: none; }
.todo-meta.overdue { color: #962f29; font-weight: 600; }
@media (max-width: 640px) { .todo-list li { flex-direction: column; align-items: flex-start; gap: 6px; } }
.order-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.order-tools .actions { margin: 0; }
.finance-unverified dd { color: var(--muted); font-weight: 500; }
td.wrap { white-space: normal; min-width: 220px; }

.signin {
  max-width: 360px;
  margin: 12vh auto 0;
  padding: 0 16px;
}
.signin h1 {
  margin: 20px 0;
  font-size: 22px;
}
.signin form {
  display: grid;
  gap: 12px;
}

/* 양식 생성: 양식 → 원본 순서 */
.doc-step { font-size: 14px; margin: 18px 0 10px; }
.doc-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.doc-kind { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 2px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 13px; }
.doc-kind small { grid-column: 2; color: var(--muted); }
.doc-kind.selected { border-color: currentColor; font-weight: 600; }
.doc-kind.selected small { font-weight: 400; }
.doc-shipment { max-width: 360px; margin-bottom: 12px; }
.doc-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; align-items: start; }
.doc-group { border: 1px solid var(--line); border-radius: 6px; }
.doc-group-head { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.doc-group-head .muted { margin-left: auto; font-size: 12px; }
.doc-group ul { list-style: none; margin: 0; padding: 4px 0; }
.doc-source { font-size: 13px; }
.doc-source label, .doc-source.missing { display: flex; flex-wrap: nowrap; gap: 4px 8px; align-items: center; padding: 6px 12px; }
.doc-source label { cursor: pointer; }
.doc-source .muted { font-size: 12px; }
.doc-source.missing { padding-left: 34px; color: var(--muted); justify-content: space-between; }
.doc-source-name { font-weight: 500; white-space: nowrap; }
.doc-source label > .muted { margin-left: auto; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-split { display: flex; flex-wrap: wrap; gap: 15px; align-items: center; font-size: 12px; padding: 13px 16px; border-top: 1px solid var(--line); }
.doc-split label { display: flex; gap: 6px; align-items: center; }
#edit-rows select { min-width: 150px; }

/* 코발트 도형 기준: 비스듬히 자른 패널, 가로줄 표, 키캡, 칸 눈금. 움직임 없음. 색 구분은 유지한다. */
:root {
  --graphite: oklch(22% 0.028 262);
  --graphite-2: oklch(29% 0.03 262);
  --rule-2: oklch(83% 0.012 252);
  --paper-3: oklch(93.5% 0.011 252);
  --font-data: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Pretendard Variable", monospace;
  --g-buy: oklch(52% 0.19 258);
  --g-wh: oklch(50% 0.1 175);
  --g-customs: oklch(56% 0.12 70);
  --g-ship: oklch(52% 0.1 235);
  --g-doc: oklch(50% 0.13 305);
  --shadow-panel: 0 1px 2px #1720330f, 0 16px 28px -22px #17203340;
  --cut-card: 14px 4px 14px 4px;
  --cut-small: 8px 3px 8px 3px;
}
body { background: var(--paper); }
header { border-bottom-color: var(--rule-2); }
h1 { font-size: 30px; font-weight: 650; letter-spacing: -0.03em; }
.eyebrow { letter-spacing: 0; }

/* 패널·카드: 왼쪽 위와 오른쪽 아래를 자른다. 지원하지 않는 브라우저는 둥근 모서리로 표시된다. */
.panel, .summary-group, .finance-block, .doc-group, dialog {
  border: 1px solid var(--rule-2);
  border-radius: var(--cut-card);
  corner-shape: bevel round;
  box-shadow: var(--shadow-panel);
}
.toolbar { border-bottom: 1px solid var(--line); }
.panel > .toolbar:last-child, .checks + .toolbar { border-bottom: 0; }
.toolbar h2 { font-size: 15px; letter-spacing: -0.01em; }
.success, .warning, .alert, .pill, .curl, .drop, input, select, textarea {
  border-radius: var(--cut-small);
  corner-shape: bevel round;
}
input[type="checkbox"], input[type="radio"] { border-radius: revert; corner-shape: round; min-height: auto; }
input, select, textarea { border-color: var(--rule-2); background: #fff; }

/* 탭: 트레이 위의 키캡. 선택한 탭은 눌린 상태로 표시한다. */
nav {
  gap: 7px;
  padding: 8px 8px 11px;
  background: var(--paper-3);
  border: 1px solid var(--rule-2);
  border-radius: var(--cut-card);
  corner-shape: bevel round;
  box-shadow: inset 0 1px 3px #17203314;
}
nav a {
  padding: 8px 15px;
  color: oklch(36% 0.022 260);
  font-weight: 500;
  background: oklch(99.4% 0.003 250);
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  box-shadow: 0 3px 0 var(--key-edge), inset 0 1px 0 #fff;
}
nav a:hover { background: var(--paper-2); }
nav a[aria-current="page"] {
  position: relative;
  top: 3px;
  background: var(--paper-2);
  color: var(--green);
  font-weight: 650;
  box-shadow: inset 0 1px 2px #17203326;
}

/* 버튼 */
button, .button {
  border-color: var(--rule-2);
  font-weight: 500;
  box-shadow: 0 3px 0 var(--key-edge), inset 0 1px 0 #fff;
  margin-bottom: 3px;
}
button.primary, .button.primary {
  font-weight: 600;
  box-shadow: 0 3px 0 oklch(39% 0.16 260), inset 0 1px 0 #ffffff38;
}
.state, .link, .todo-meta, .money-value, .money-history-link, .revision-status { box-shadow: none; margin-bottom: 0; font-weight: inherit; }

/* 표: 세로줄 없이 가로줄로 읽는다. 머리글은 흑연색으로 내용과 분명히 나눈다. */
#content table thead th, .stage-details thead th {
  background: var(--graphite);
  color: oklch(96% 0.006 252);
  font-weight: 550;
  border: 0;
  border-bottom: 1px solid var(--graphite-2);
  border-inline-end: 0;
}
#content .progress-table .workflow-groups th { background: var(--graphite); font-weight: 650; padding-block: 8px; border-inline-end: 0; }
#content .progress-table thead tr:last-child th { background: var(--graphite-2); border-bottom: 0; font-size: 11px; }
#content .progress-table .workflow-groups th:nth-child(3) { box-shadow: inset 0 -3px 0 oklch(66% 0.17 258); }
#content .progress-table .workflow-groups th:nth-child(4) { box-shadow: inset 0 -3px 0 oklch(70% 0.11 175); }
#content .progress-table .workflow-groups th:nth-child(5) { box-shadow: inset 0 -3px 0 oklch(72% 0.12 305); }
#content .progress-table .workflow-groups th:nth-child(6) { box-shadow: inset 0 -3px 0 oklch(76% 0.13 75); }
#content .progress-table .workflow-groups th:nth-child(7) { box-shadow: inset 0 -3px 0 oklch(72% 0.1 235); }
#content .progress-table .workflow-groups th:nth-child(n+3) { border-inline-start: 1px solid var(--graphite-2); }
#content .progress-table thead tr:last-child th.group-start { border-inline-start: 1px solid oklch(38% 0.03 262); }
#content table tbody td, #content table tbody th { border-inline-end: 0; border-top-color: var(--line); }
#content .progress-table tbody td { height: 42px; border-top-color: oklch(88% 0.012 252); }
#content .progress-table tbody td.group-start { border-inline-start: 1px solid var(--rule-2); }
#content table tbody .supplier-cell { font-size: 12px; color: var(--ink); border-inline-end: 0; }
#content .progress-table .supplier-start td { border-top: 1px solid oklch(62% 0.02 258); }
.progress-table .name .link { color: var(--ink); text-decoration-color: var(--rule-2); }

/* 상태: 색과 기호를 함께 써서 구분한다. */
.state.good > span:not(.date)::before { content: "✓ "; }
.state.needs-check > span:not(.date)::before { content: "! "; font-weight: 700; }
.state.todo > span:not(.date)::before { content: "→ "; }
.state.in-progress > span:not(.date)::before { content: "◐ "; }
.state.good { color: oklch(45% 0.11 165); }
.state.needs-check { color: oklch(52% 0.13 70); font-weight: 600; }
.state.todo { color: var(--green); }
.state.in-progress { color: var(--g-doc); }

/* 날짜와 숫자 값은 고정폭 글꼴로 맞춘다. */
.date, .progress-table .date, .number, .summary-row strong, .summary-brand strong { font-family: var(--font-data); }
.date, .progress-table .date { font-size: 10px; letter-spacing: -0.02em; }
.number, .summary-row strong { letter-spacing: -0.03em; }
.summary-brand strong { letter-spacing: -0.05em; }

/* 업무 단계 색을 요약 카드와 표 머리글에서 같이 쓴다. */
.work-summary { gap: 12px; }
.summary-group { background: #fff; padding: 14px 15px; }
.summary-group, .summary-buy { --summary-color: var(--g-buy); }
.summary-logistics { --summary-color: var(--g-wh); }
.summary-customs { --summary-color: var(--g-customs); }
.summary-shipment { --summary-color: var(--g-ship); }
.summary-documents { --summary-color: var(--g-doc); }
/* 진행 막대: 채운 칸과 점으로 남은 양을 표시한다. */
.summary-track {
  height: 7px;
  border-radius: 0;
  background: radial-gradient(circle at 2px 3.5px, var(--rule-2) 0.8px, transparent 1.1px) 0 0 / 5px 7px;
}
.summary-track svg { -webkit-mask: repeating-linear-gradient(90deg, #000 0 3px, transparent 3px 5px); mask: repeating-linear-gradient(90deg, #000 0 3px, transparent 3px 5px); }

/* 지금 할 일·양식 생성 */
.todo-list li { border-top-color: var(--line); }
.doc-step { font-size: 15px; letter-spacing: -0.01em; margin: 22px 0 10px; }
.doc-kinds { padding: 8px 8px 11px; background: var(--paper-3); border: 1px solid var(--rule-2); border-radius: var(--cut-card); corner-shape: bevel round; box-shadow: inset 0 1px 3px #17203314; }
.doc-kind { background: oklch(99.4% 0.003 250); border-color: var(--rule-2); box-shadow: 0 3px 0 var(--key-edge), inset 0 1px 0 #fff; }
.doc-kind.selected { position: relative; top: 3px; background: var(--paper-2); border-color: var(--rule-2); color: var(--green); box-shadow: inset 0 1px 2px #17203326; }
.doc-group { background: #fff; box-shadow: none; overflow: hidden; }
.doc-group-head { background: var(--paper-2); border-bottom-color: var(--rule-2); }
.doc-source + .doc-source { border-top: 1px solid var(--line); }

dialog { box-shadow: 0 24px 56px -12px #17203345; }
@media (max-width: 600px) {
  h1 { font-size: 24px; }
  nav { gap: 7px 6px; }
  nav a { padding: 7px 10px; }
}

/* 자금: 바이어 발주 금액과 실제 처리 금액 구분 */
.finance-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.finance-actual { --finance-bg: #fdf6e8; --finance-edge: #e6d3a8; --finance-ink: #8a5c0f; }
.finance-block dt em { display: block; font-style: normal; font-size: 10px; color: var(--muted); margin-top: 2px; }
.finance-block dt em .amount-gap { font-size: 10px; }
.finance-block dd { font-size: 17px; text-align: right; }
.finance-block dd .unconfirmed { font-size: 13px; font-weight: 500; }
.unconfirmed { color: var(--muted); font-size: 11px; font-family: inherit; }
.amount-gap { font-family: var(--font-data); }
.amount-gap.minus, .amount-gap.plus { color: #8a5c0f; background: #fdf1d6; padding: 1px 4px; font-weight: 650; }
.amount-count { display: block; color: var(--muted); font-size: 10px; font-weight: 400; }
#content .finance-purchases .finance-groups th { background: var(--graphite); font-weight: 650; }
#content .finance-purchases thead tr:last-child th { background: var(--graphite-2); font-size: 11px; }
#content .finance-purchases thead tr:last-child th:nth-child(1), #content .finance-purchases thead tr:last-child th:nth-child(3) { border-inline-start: 1px solid oklch(38% 0.03 262); }
#content .finance-purchases .finance-groups th[colspan="2"] { box-shadow: inset 0 -3px 0 oklch(72% 0.12 305); }
#content .finance-purchases .finance-groups th[colspan="4"] { box-shadow: inset 0 -3px 0 oklch(70% 0.11 175); }
.profit-cell { font-weight: 650; }
.profit-cell small { font-weight: 400; }
.profit-expected { color: var(--muted); font-weight: 400; white-space: nowrap; }
#content .finance-purchases tbody td.group-start { border-inline-start: 1px solid var(--rule-2); }
@media (max-width: 1200px) { .finance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 800px) { .finance-summary { grid-template-columns: 1fr; } }
#content .finance-purchases tr.finance-total { --supplier-bg: var(--paper-3); --supplier-edge: var(--graphite); }
#content .finance-purchases .finance-total td { border-top: 2px solid var(--graphite); border-bottom: 0; font-size: 13px; }

/* 양식 생성: 용도별 묶음 */
.doc-kind-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.doc-kind-group h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.doc-kind-group .doc-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.doc-total { font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; margin-inline: auto; }
#doc-meta { margin-bottom: 4px; }
#doc-meta textarea { resize: vertical; font-size: 12px; }
@media (max-width: 900px) { .doc-kind-groups { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .doc-kind-group .doc-kinds { grid-template-columns: minmax(0, 1fr); } }

#content .finance-purchases th .formula { display:block; margin-top:2px; font-size:10.5px; font-weight:600; color:oklch(88% 0.08 85); letter-spacing:.02em; white-space:nowrap; }
#content .finance-purchases .finance-groups th.profit-plan { box-shadow: inset 0 -3px 0 oklch(80% 0.12 85); }
#content .finance-purchases .finance-groups th.profit-confirmed { box-shadow: inset 0 -3px 0 oklch(72% 0.15 25); }
#content .finance-purchases thead tr:last-child th:nth-child(7), #content .finance-purchases thead tr:last-child th:nth-child(10) { border-inline-start: 1px solid oklch(38% 0.03 262); }

/* 양식에 직접 입력: 회사 CI·PL 양식과 같은 배치의 종이 화면. 노란 칸은 아직 비어 있는 필수 칸. */
.paper-notes { padding-top: 0; }
.paper-notes summary { cursor: pointer; color: var(--warn); margin-bottom: 6px; }
.paper-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; padding: 0 16px 16px; align-items: start; }
.paper-scroll { overflow-x: auto; background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.paper { min-width: 860px; background: #fff; border: 1px solid #1f2733; box-shadow: 0 6px 18px -10px #17203340; color: #111; font-size: 12.5px; }
.ptitle { text-align: center; font-weight: 700; font-size: 18px; letter-spacing: 0.08em; padding: 10px; border-bottom: 1px solid #1f2733; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; }
.pgrid.ci { grid-template-areas: "a b" "c d" "e f" "g f" "h f"; }
.pgrid.pl { grid-template-areas: "a b" "c d" "e f" "g i" "h i" "j i"; }
.ga-a { grid-area: a; } .ga-b { grid-area: b; } .ga-c { grid-area: c; } .ga-d { grid-area: d; } .ga-e { grid-area: e; }
.ga-f { grid-area: f; } .ga-g { grid-area: g; } .ga-h { grid-area: h; } .ga-i { grid-area: i; } .ga-j { grid-area: j; }
.pbox, .ppair { border-bottom: 1px solid #1f2733; border-right: 1px solid #1f2733; padding: 5px 7px 6px; min-width: 0; }
.ppair { display: grid; grid-template-columns: 1fr 1fr; padding: 0; }
.ppair .pbox { border-bottom: 0; }
.ppair .pbox:last-child { border-right: 0; }
.pgrid > .pr { border-right: 0; }
.plabel { display: block; font-size: 11px; font-weight: 600; color: #3b4656; margin-bottom: 3px; }
.pfixed { color: #6b7685; line-height: 1.45; }
.pfixed small { display: block; font-size: 11px; }
.pinline { display: flex; gap: 6px; align-items: center; }
.paper .pf, .paper .pc { width: 100%; border: 1px dashed transparent; border-radius: 3px; background: transparent; padding: 3px 4px; font-size: 12.5px; color: #111; resize: vertical; line-height: 1.4; }
.paper .pf { border-color: #d5dbe2; background: #fbfcfd; }
.paper .pf:hover, .paper .pc:hover { border-color: oklch(70% 0.1 258); background: oklch(97.5% 0.015 258); }
.paper .pf:focus, .paper .pc:focus { outline: 2px solid var(--green); outline-offset: -1px; background: #fff; border-color: transparent; }
.paper .req.empty { background: oklch(95.5% 0.08 95); border-color: oklch(80% 0.11 85); }
.paper .req.empty::placeholder { color: oklch(52% 0.1 70); }
.paper .pc::placeholder { color: #a5adb8; }
.ptool { min-height: 26px; padding: 2px 8px; font-size: 11.5px; white-space: nowrap; margin-top: 4px; box-shadow: none; }
.pinline .ptool { margin-top: 0; }
.paper-items { width: 100%; border-collapse: collapse; }
#content .paper-items thead th { background: #f1f3f6; font-size: 11px; font-weight: 600; color: #3b4656; padding: 5px 4px; border: 1px solid #1f2733; text-align: center; }
.paper-items td { border: 1px solid #c3cad3; padding: 0; vertical-align: middle; }
.paper-items td.pno, .paper-items td.pcalc { padding: 3px 6px; color: #3b4656; }
.paper-items td.pno { text-align: center; width: 36px; }
.paper-items .num, .paper-items .num input { text-align: right; }
.paper-items th.wide { min-width: 300px; }
.paper-items th.code { min-width: 120px; }
.paper-items th.plt { min-width: 90px; }
.paper-items td.premarks { vertical-align: top; padding: 3px; width: 120px; }
.paper-items tfoot td { font-weight: 700; padding: 5px 6px; border-top: 2px solid #1f2733; background: #f8f9fb; }
.paper-items .pextra { border: 0; background: transparent; width: 1%; padding: 0 4px; }
.paper-items .pextra select { max-width: 130px; font-size: 11.5px; }
.paper-items .pextra button { min-height: 24px; padding: 0 7px; box-shadow: none; color: var(--muted); }
.paper-foot { display: flex; gap: 12px; align-items: center; padding: 8px; border-top: 1px solid #1f2733; font-size: 12px; }
.paper-side { position: sticky; top: 12px; display: grid; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.paper-side h3 { font-size: 13px; font-weight: 650; display: flex; justify-content: space-between; }
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.todo button, .todo span { all: unset; display: block; cursor: pointer; padding: 5px 8px 5px 26px; border-radius: 5px; position: relative; font-size: 13px; }
.todo button::before, .todo span::before { content: ""; position: absolute; left: 8px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: oklch(80% 0.13 85); }
.todo li.done button::before, .todo li.done span::before { background: oklch(62% 0.13 160); }
.todo li.done button, .todo li.done span { color: var(--muted); }
.todo button:hover { background: var(--paper-2); }
.todo button:focus-visible { outline: 2px solid var(--green); }
.todo.optional button::before { background: #d3d9e0; }
.checks.stack { display: grid; gap: 6px; padding: 0; }
.wide-button { width: 100%; }
.paper-side .small { font-size: 12px; line-height: 1.45; }
@media (max-width: 1100px) {
  .paper-layout { grid-template-columns: 1fr; }
  .paper-side { position: static; }
}
#content .paper-items thead th.pextra { background: transparent; border: 0; }

/* 제품 기준표 */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 7px; }
.seg button { min-height: 28px; padding: 3px 12px; box-shadow: none; border-color: transparent; background: transparent; }
.seg button.on { background: #fff; color: var(--green); border-color: var(--key-edge); box-shadow: 0 1px 0 var(--key-edge); font-weight: 600; }
.cat-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0; }
.cat-filters button { min-height: 30px; padding: 3px 10px; box-shadow: none; }
.cat-filters button.on { border-color: var(--green); color: var(--green); background: oklch(97% 0.02 258); }
.cat-filters b { margin-left: 4px; }
.cat-filters input { margin-left: auto; min-width: 220px; }
.cat-bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; background: oklch(97.5% 0.03 95); border: 1px solid oklch(88% 0.06 90); border-radius: 7px; margin-bottom: 10px; }
.cat-evidence { max-width: 560px; margin-bottom: 10px; }
.catalog-table td { vertical-align: top; }
.catalog-table td:first-child { white-space: nowrap; }
.cat-names { min-width: 340px; }
.cat-name { display: flex; gap: 6px; align-items: baseline; padding: 2px 0; cursor: pointer; }
.cat-name mark { background: oklch(92% 0.09 95); padding: 0 1px; border-radius: 2px; }
.cat-name.off > span { background: oklch(94% 0.07 90); border-radius: 3px; padding: 0 3px; }
.cat-list { min-width: 200px; max-width: 260px; }
.catalog-table { font-size: 12.5px; }
#content .catalog-table td, #content .catalog-table th { white-space: normal; overflow-wrap: anywhere; }
#content .catalog-table td:first-child b { white-space: nowrap; }
.catalog-table .cat-names { min-width: 240px; }
.catalog-table .cat-std { min-width: 190px; }
.catalog-table .cat-units { width: 70px; }
.catalog-table td .pill { margin-top: 3px; display: inline-block; }
.cat-doc { display: block; font-size: 11px; color: var(--muted); }
.catalog-table .cat-std { width: 100%; min-width: 240px; }
.catalog-table .cat-net { width: 90px; }
.pill.cat-different { background: oklch(94% 0.05 25); color: oklch(45% 0.14 25); }
.pill.cat-tail, .pill.cat-case { background: oklch(95% 0.06 90); color: oklch(45% 0.09 70); }
.pill.cat-ok { background: oklch(94% 0.05 160); color: oklch(40% 0.1 160); }

/* 변동 이력 */
.variance-table td small { display:block; font-size:11px; }
.variance-note { display:flex; gap:4px; }
.variance-note input { min-width:120px; }
#content .variance-table td { white-space:normal; }

/* 제품·수량 탭: 탭마다 오른쪽 조작이 달라도 탭 위치가 움직이지 않게 제목 옆에 고정한다. */
.toolbar h2:has(+ .product-tabs) { margin-right: 0; }
.toolbar .product-tabs { margin-right: auto; }

/* 무상 샘플·테스터 (공급사 PL에만 있는 제품·늘어난 수량) */
.product-table tr.sample-row td, .product-table td.sample-cell { background: #f1f3f2; }
#content .product-table tbody tr:hover td { background: #e6effc; }

/* 변동 이력 열 제목: 어두운 배경에서 잘 보이게 */
.variance-table th .th-date { color: #d6dcd9; font-weight: 400; font-size: 12px; }
.variance-table th .th-link { color: #fff; font-weight: 400; font-size: 12px; text-decoration: underline; }
.variance-table td.variance-kind { min-width: 96px; }

/* 구매 건별 수량 요약 카드: 종 수 아래에 수량·날짜를 줄 바꿔 보인다 */
.product-summary small { display: block; }

/* 공급사 리스트 */
button.linkish { background: none; border: 0; box-shadow: none; padding: 0; color: var(--green); font-weight: 600; text-decoration: underline; min-height: 0; }
tr.row-open td { background: #eef5f1; }
#list-detail .toolbar { margin-top: 18px; }

nav .nav-sep { width: 1px; align-self: stretch; margin: 4px 6px; background: var(--line, #c9d1dc); }
.th-flow { font-size: 11px; font-weight: 400; opacity: .8; }
.variance-table td.price-up { background: #fdecec; color: #b42318; }
.variance-table td.price-down { background: #e8f0fd; color: #1d4ed8; }
.variance-table td.units-changed { background: #fff4d6; color: #92400e; }

/* 같은 진행 표 안에서 발주월을 구분한다. */
#content .progress-table .order-month-row th { text-align: left; background: #e4edf7; color: #163657; padding: 12px 16px; border-top: 2px solid #9db2c9; }
.order-month-row span { margin-left: 10px; font-size: 12px; font-weight: 400; }

/* 진행 표: 두 단 제목을 함께 고정하고 데이터만 스크롤한다. */
.progress-scroll { max-height: min(68vh, 760px); overflow: auto; overscroll-behavior: contain; }
.progress-table thead { position: sticky; top: 0; z-index: 3; }
.progress-table thead th { position: static; }
.progress-months { display:flex; flex-wrap:wrap; gap:6px; padding:8px 14px 12px; }
.progress-months button { min-height:30px; padding:5px 12px; font-size:12px; }
.progress-months button span { margin-left:8px; opacity:.7; font-size:11px; }
.progress-months button[aria-pressed="true"] { background:#304b70; border-color:#304b70; color:#fff; }
.purchase-month { display:inline-block; margin-left:7px; font-size:10px; color:#66758b; white-space:nowrap; }

.finance-scroll { max-height:min(68vh,760px); overflow:auto; overscroll-behavior:contain; }
.finance-scroll thead { position:sticky; top:0; z-index:3; }
.finance-scroll thead th { position:static; }
.progress-months .muted { align-self:center; font-size:11px; margin-left:6px; }

/* 단가 관리 */
.price-up-text { color: #b42318; font-weight: 600; }
.price-down-text { color: #1d4ed8; font-weight: 600; }
tr.row-attention td { background: #fffaf0; }
tr.clickable { cursor: pointer; }
tr.price-history > td { background: var(--paper-2); }
.price-img { width: 44px; height: 44px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 4px; display: inline-block; vertical-align: middle; }
.price-img.empty { background: #fff5f5; border: 1px dashed #e0a3a3; color: #c0392b; text-align: center; font-size: 18px; font-weight: 600; }
.price-table td { vertical-align: top; }
.price-table td:first-child { width: 28px; }
.price-entry + .price-entry { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.price-entry.gone { opacity: .55; }
tr.price-brand td { background: var(--paper-2); }
.toolbar .spacer { flex: 1; }
.price-table { table-layout: fixed; width: 100%; min-width: 980px; }
.price-table th:nth-child(1) { width: 32px; } .price-table th:nth-child(2) { width: 60px; }
.price-table th:nth-child(3) { width: 30%; } .price-table th:nth-child(4) { width: 27%; }
.price-table th:nth-child(5) { width: 19%; } .price-table th:nth-child(6) { width: 15%; }
.price-table td { overflow-wrap: anywhere; white-space: normal; }
dialog.wide { width: min(1100px, calc(100% - 32px)); }
.offer-rule { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.offer-rule .field.small, #offer-form .field.small { max-width: 200px; margin: 0; }
.offer-preview { max-height: 46vh; }
.offer-table { min-width: 760px; }
.offer-table th:nth-child(1) { width: 52px; } .offer-table th:nth-child(2) { width: auto; } .offer-table th:nth-child(3) { width: 170px; }
.offer-table th:nth-child(4) { width: 170px; } .offer-table th:nth-child(5) { width: 80px; } .offer-table th:nth-child(6) { width: 110px; }
.offer-price { width: 110px; text-align: right; }
/* 단가 관리 단순화 (2026-11-16) */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.brand-card { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: inherit; text-decoration: none; }
.brand-card:hover { border-color: var(--green); }
.brand-card.attention { border-color: #e9b949; background: #fffaf0; }
.brand-card span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-card .changed { color: #b42318; }
.price-table.simple { table-layout: fixed; min-width: 0; }
.price-table.simple th:nth-child(1) { width: 34px; } .price-table.simple th:nth-child(2) { width: 62px; }
.price-table.simple th:nth-child(3) { width: auto; } .price-table.simple th:nth-child(4) { width: 130px; }
.price-table.simple th:nth-child(5) { width: 110px; } .price-table.simple th:nth-child(6) { width: 90px; }
.price-table.simple td { vertical-align: middle; }
#price-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: #fff; border-left: 1px solid var(--line); box-shadow: -12px 0 32px #14281b22; overflow-y: auto; z-index: 20; }
#price-panel h4 { margin: 14px 0 6px; }
#price-panel .panel-head { display: flex; gap: 12px; align-items: flex-start; }
.price-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; align-items: center; padding: 10px 24px; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px #14281b1a; z-index: 15; }
.price-page { margin-bottom: 70px; }
.seg a.button { min-height: 28px; padding: 3px 12px; border-color: transparent; background: transparent; box-shadow: none; }
.seg a.button.on { background: #fff; color: var(--green); border-color: var(--key-edge); font-weight: 600; }

/* ‘더 보기’: 매일 쓰지 않는 화면을 한 버튼에 묶는다. */
nav .nav-more { position: relative; }
nav .nav-more summary { list-style: none; cursor: pointer; padding: 8px 15px; color: oklch(36% 0.022 260); font-weight: 500; background: oklch(99.4% 0.003 250); border: 1px solid var(--rule-2); border-radius: 6px; box-shadow: 0 3px 0 var(--key-edge), inset 0 1px 0 #fff; white-space: nowrap; }
nav .nav-more summary::-webkit-details-marker { display: none; }
nav .nav-more summary::after { content: " ▾"; color: var(--muted); }
nav .nav-more.current summary, nav .nav-more[open] summary { position: relative; top: 3px; background: var(--paper-2); color: var(--green); box-shadow: inset 0 1px 0 #fff; }
nav .nav-more-menu { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; display: flex; flex-direction: column; gap: 4px; min-width: 170px; padding: 8px; background: #fff; border: 1px solid var(--rule-2); border-radius: 8px; box-shadow: 0 10px 24px -8px #17203340; }
nav .nav-more-menu a { box-shadow: none; border-color: transparent; background: transparent; top: 0; white-space: nowrap; }
nav .nav-more-menu a:hover, nav .nav-more-menu a[aria-current="page"] { background: var(--paper-2); top: 0; box-shadow: none; }
nav { align-items: center; }
@media (max-width: 760px) { nav .nav-more-menu { left: auto; right: 0; } }
@media (max-width: 760px) { nav .nav-sep { display: none; } }

/* 서류 검사 */
.check-page { display: grid; gap: 14px; }
.check-drop { display: grid; gap: 4px; place-items: center; padding: 26px 16px; border: 2px dashed var(--ui-rule); border-radius: var(--ui-radius); background: #f9fbfd; cursor: pointer; text-align: center; }
.check-drop.over, .check-drop:hover { border-color: var(--green); background: #f2f6fb; }
.check-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check-card { display: grid; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--ui-radius); background: #fff; }
.check-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.check-head h3 { font-size: 15px; overflow-wrap: anywhere; }
.check-fields { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 12px; }
.check-fields label { display: flex; gap: 6px; align-items: center; }
.check-findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.check-findings > li { display: flex; gap: 10px; padding: 9px 12px; border-radius: 6px; line-height: 1.55; }
.check-findings ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.check-mark { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; }
.check-error { background: #fbeceb; color: #7c2722; } .check-error .check-mark { background: #c0392b; }
.check-warn { background: #fbf2e6; color: #6e4a19; } .check-warn .check-mark { background: #b7791f; }
.check-ok { background: #eef6f0; color: #1f5139; } .check-ok .check-mark { background: #2f7d55; }
.check-table-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; }
.check-table-head h4 { margin: 0; font-size: 13px; }
tr.check-changed td { background: #fff7e8; }
.check-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.check-badge.error { background: #fbeceb; color: #962f29; } .check-badge.warn { background: #fbf2e6; color: #84571e; } .check-badge.ok { background: #eaf5ed; color: #236449; }
.check-history-title { font-size: 14px; margin-top: 8px; }

.file-registered { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 공급사 칸(rowspan)이 있는 첫 줄과 없는 줄의 브랜드 칸 여백을 같게 한다. */
.progress-table tbody td.name { padding-inline-start: 13px; }
.finance-purchases tbody td.brand-cell { padding-left: 16px; }
